Commit Graph

267 Commits

Author SHA1 Message Date
regis@google.com 2f900dab13 Cache number of type arguments in class object instead of recalculating it.
Reduce size of num_native_fields field in class object.

R=asiva@google.com

Review URL: https://codereview.chromium.org//26682003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28670 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-15 18:31:31 +00:00
fschneider@google.com 06ace75239 Improve --optimization-filter to accept a comma-separated list of strings.
Only functions where the fully-qualified name contains one of the strings supplied
as substring will be optimized.

This helps tracking down bugs in the optimizing compiler that occur when a
large number of optimized functions are involved.

R=kmillikin@google.com

Review URL: https://codereview.chromium.org//25446003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28578 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-14 12:21:40 +00:00
turnidge@google.com b15b2931e0 Allow the debugger to inspect local variables from optimized and
inlined frames.

------------

Most remaining deoptimization code from the code generator moves to
DeoptContext.  This allows the code to be reused by the debugger.
There is some rework of the code along the way.  The remaining code in
the code generator is simpler.

Implement the ability to deopt a frame to an Array.  Each inlined
frame accesses its locals from this array at some fixed offset.

Refactor the Debugger::CollectStackTrace code.  New code is int
Debugger::CollectStackTraceNew.  There is a flag --use_new_stacktrace
which can be used to revert back to the old version.  I intend to
remove this flag shortly, after any dust clears.

Added a unit test which makes sure that we can inspect locals from
optimized and inlined frames.  Tested this code in the dart editor
debugger as well.

R=iposva@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org//26255004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28468 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-10 18:15:53 +00:00
srdjan@google.com 3a8252f90d Cleanups: int -> intptr_t for "array" lengths, memory sizes.
R=asiva@google.com

Review URL: https://codereview.chromium.org//26294002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28324 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-07 20:19:37 +00:00
turnidge@google.com baeb23f9a5 Refactor some deoptimization code.
Primarily this change moves deoptimization state/code out of Isolate
and into DeoptContext (formerly DeoptimizationContext).  The lifetime
of DeoptizationContext changes to survive through the entire
deoptimization process.

Some minor renaming.  DeoptizationContext -> DeoptContext to make it
consistent with DeoptInstr and to save my wrists.

New files deferred_object.{cc,h} contain a bunch of the stuff lifted
from isolate.{cc,h}.

R=fschneider@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org//24834002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28112 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 19:34:12 +00:00
regis@google.com c0036588b9 Move the assertion checking the number of arguments passed to a runtime entry
from the entry to the macro.

R=asiva@google.com

Review URL: https://codereview.chromium.org//23621008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26829 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-29 00:08:02 +00:00
kmillikin@google.com 4f80ef09df Change Bool::Get to return a handle instead of a pointer to a raw object.
Replace occurrences of 'expr ? Bool::True() : Bool::False()' with simply
'Bool::Get(expr)' and analogously for its negation.  The pointer to the raw
object can still be extracted with 'Bool::Get(expr).raw()'.

R=iposva@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org//23480005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26770 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 08:38:56 +00:00
regis@google.com 81bcb1f18a Distinguish between malformed and malbounded types (fix issues 12552 and 12554).
Add test.
Update status files.

Explanation of change: A malbounded type argument should not be mapped to
dynamic, as is a malformed type argument.
This change also adds a bunch of TODOs related to the encounter of malbounded
types in unexpected places.
A follow-up change will address these TODOs, add more tests, and may simplify
code that is still handling malformed types where they cannot occur anymore
after the spec simplified their handling.

R=hausner@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org//23190035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26665 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 17:56:02 +00:00
johnmccutchan@google.com c8b370ab50 Initial support for length guards on final fields.
R=regis@google.com, srdjan@google.com, zra@google.com

Review URL: https://codereview.chromium.org//22851003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26433 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-21 15:32:45 +00:00
jacobr@google.com 605b33c1bc fix cpp11 compile errors
R=asiva@google.com

Review URL: https://codereview.chromium.org//23072026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26387 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-20 20:24:11 +00:00
rmacnak@google.com 8bdc9b5696 Cleanup making Null a public class of dart:core in the VM. Remove special cases for Null in lookup and compile-time type tests.
BUG=http://dartbug.com/12364
R=asiva@google.com, regis@google.com

Review URL: https://codereview.chromium.org//22819005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26205 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-15 18:34:23 +00:00
regis@google.com 09bcdc6d6d Fix VM implementation of CastError not to extend TypeError (issue 5280).
Remove non-compliant fields in various Error classes (issue 10144).
Remove implicit constructor when patching in a constructor (issue 12217).
Patch corelib Error classes instead of declaring subclasses.
Update tests and status files.

R=asiva@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org//21832003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25782 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-05 18:35:04 +00:00
fschneider@google.com 3933db4a7b Simplify allocation stub for closures.
The compiler never generates code for allocating implicit static closures
using the allocation stub.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//21067002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25573 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-29 16:56:39 +00:00
srdjan@google.com 5781d7cc84 Collect both arguments for math's min/max static functions. Later that information will be used to inline the operation if possible.
R=regis@google.com

Review URL: https://codereview.chromium.org//19774007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25225 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-19 16:49:29 +00:00
srdjan@google.com 624fb4cf59 Cleanup: remove argument descriptor parameter when calling inline cache miss handler.
R=zra@google.com

Review URL: https://codereview.chromium.org//19547003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25162 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-18 18:15:29 +00:00
fschneider@google.com dfd21c06e0 Change resolving of instance methods to check early for name mismatch.
The names of actual arguments are checked at resolving time
for a mismatch instead of deferring this check to the function
prologue (emitted as part of the CopyParameters() prologue).

For example:

class A {
  foo({a:42}) => null;
}

main() {
  var a = new A();
  a.foo(b:123);  // noSuchMethod: no named parameter named "b".
}

This enables e.g. fast noSuchMethod invocation in the case
of a named argument mismatch.

It also makes the function prologue for instance functions that
use optional parameters shorter by omitting the check for a 
name mismatch there.

R=regis@google.com

Review URL: https://codereview.chromium.org//19200002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25041 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-16 09:38:13 +00:00
fschneider@google.com 13b7b7242a Faster invocation of fields as methods.
Until now there was a large discrepancy between

x.f() and
(x.f)()

This CL makes x.f() as fast as (x.f)() by automatically
generating  a intermediate dispatcher function that loads
the field and invokes the result as a closure.

The approach resembles the one taken for fast noSuchMethod
invocation and reuses the same per-class cache
of dispatcher functions.

It also fixes a bug in the debugger so that VM-generated 
implicit dispatcher functions (like for noSuchMethod, or
field-as-method invocation) don't show up the debuggers
stack trace.

BUG=https://code.google.com/p/dart/issues/detail?id=11041
R=srdjan@google.com

Review URL: https://codereview.chromium.org//18750004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25001 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-15 11:12:09 +00:00
srdjan@google.com cbb9d76c4b Fix wrong type test optimization when testing against a signature class: we must always consider the instance type arguments as well. FIxes failing tests when run with --optimization-counter-threshold=5.
R=regis@google.com

Review URL: https://codereview.chromium.org//18807007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24961 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-12 17:31:19 +00:00
fschneider@google.com eb01603a53 Guard against entering a noSuchMethod dispatcher twice into ICData.
This may occur in optimized code when called via the megamorphic
cache miss handler.

For now, I fixed it by checking if there is already an entry in the IC data.
I'll discuss with Kevin how to handle the extraordinary cases like
noSuchMethod and implicit closure invocation in the megamorphic cache.

BUG=https://code.google.com/p/dart/issues/detail?id=11786
R=srdjan@google.com

Review URL: https://codereview.chromium.org//18469003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24953 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-12 15:50:24 +00:00
zra@google.com 20dcf8afaa Implements OSR for arm and mips.
R=regis@google.com

Review URL: https://codereview.chromium.org//19017007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24896 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-10 23:45:18 +00:00
fschneider@google.com f260416fb8 Support fast noSuchMethod dispatch for any number of arguments.
Until now, the fast dispatch was only available with getters and
zero argument methods.

This CL generalizes the approach to any number of arguments. The
dispatcher functions that are auto-generated by the compiler
are not attached to the class anymore. Instead the dispatcher
is only stored in the IC data of each call site. Each class
contains a cache of dispatcher function that map
(name, arguments descriptor) => dispatcher.

This also fixes a bug where the VM report a wrong error message
when throwing a NoSuchMethodError.

BUG=https://code.google.com/p/dart/issues/detail?id=11528
BUG=https://code.google.com/p/dart/issues/detail?id=11223
TEST=tests/language/no_such_method_dispatcher_test.dart
R=srdjan@google.com

Review URL: https://codereview.chromium.org//18097004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24876 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-10 10:09:14 +00:00
regis@google.com e8a722870b Support type parameters and classes as expression in the vm.
Turn many compile-time errors into runtime errors per latest spec.
Triage affected tests.

R=hausner@google.com

Review URL: https://codereview.chromium.org//18801007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24861 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-09 19:35:56 +00:00
hausner@google.com 1e955965df Better single stepping in VM debugger
Single stepping now steps into the next dart code that the
user is interested in, including from one asynchronous task
to the next.

R=asiva@google.com

Review URL: https://codereview.chromium.org//17846009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24632 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-01 17:29:18 +00:00
srdjan@google.com f415b31685 Add --deoptimization_counter_inlining_threshold=10 that stops inlining in a method that has reached it.
R=fschneider@google.com

Review URL: https://codereview.chromium.org//17770003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24519 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-27 15:26:16 +00:00
fschneider@google.com b76b3bbbf4 Correctly deal with method invocation of a getter.
If getter lookup succeeds, but getter invocation throws
an exception, the result is the thrown exception and
not as previously noSuchMethod invocation.

BUG=https://code.google.com/p/dart/issues/detail?id=11512
TEST=tests/language/method_invocation_test.dart
R=srdjan@google.com

Review URL: https://codereview.chromium.org//17675002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24457 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-26 08:44:00 +00:00
srdjan@google.com 7d945c593a Remove skip_static_calls_ as it uses an obsolete way to check for uncalled static calls. Will be replaced by ICData tracking.
Add two different PCDescriptors to differentiate between optimized and unoptimized static calls (the former loads args. descr, the later loads ICData before calling).
Populate static call's ic_data field when optimizing.

R=asiva@google.com

Review URL: https://codereview.chromium.org//17723002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24433 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-25 21:31:37 +00:00
fschneider@google.com 0bf7251d1a Reland: Optimizing noSuchMethod invocation with no arguments.
This is the same CL as https://codereview.chromium.org/17315008/ with
one bug fixed:

If a method is invoked with a mismatching number of arguments, we don't
add a no-such-method-dispatcher function since the dispatcher currently
can only invoke noSuchMethod and would not work if the method
is invoked with correct arguments at a later point.

I extended the test to cover that case.

TEST=tests/language/no_such_method_dispatcher_test.dart
R=srdjan@google.com

Review URL: https://codereview.chromium.org//17571010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24351 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-24 17:18:51 +00:00
srdjan@google.com fa7817bf79 Change static calls in unoptimized code to always call via a stub. Using ICData, the call count of static calls is collected as well.
TODO: Use call frequency to guide inlining.

R=asiva@google.com, hausner@google.com, zra@google.com

Review URL: https://codereview.chromium.org//17554003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24307 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 23:35:10 +00:00
fschneider@google.com 48555c83ac Back out r24266 to investigate dartium test failure.
TBR=kmillikin@google.com

Review URL: https://codereview.chromium.org//17074003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24284 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 11:56:32 +00:00
fschneider@google.com ab1981b421 Optimizing noSuchMethod invocation with no arguments.
On each call that triggers a noSuchMethod invocation we 
attach a custom dispatch function that allocates the 
invocation object and invokes noSuchMethod. This dispatcher
is compiled and optimized like a normal Dart function.

Similar to method-extractors, these implicit dispatchers
do not show up as normal functions.

As a first step this CL only handles invocations of getters
and methods with no like o.foo or o.foo().  This CL gives
a >25x speedup of such noSuchMethod invocations. Calls with
multiple arguments still go through the slow path.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//17315008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24266 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 07:31:51 +00:00
srdjan@google.com 47de186e76 Store arguments descriptor in ICData. Remove loading of arguments descriptor at unoptimized call site (the ones using ICData).
R=asiva@google.com, zra@google.com

Review URL: https://codereview.chromium.org//17421003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24239 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-20 16:29:39 +00:00
kmillikin@google.com 1a9f9f691c Scale the OSR optimization threshold by loop nesting depth.
For on-stack replacement (OSR), code quality is better if we optimize at
the outermost hot loop.  Track loop nesting depth and scale the
threshold based on the loop depth to prefer outer loops over inner ones.

R=fschneider@google.com

Review URL: https://codereview.chromium.org//17315006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24175 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-19 09:21:25 +00:00
kmillikin@google.com 665ffe3164 Ensure we perform the same checks for all optimizing compilations.
Ensure that we perform the same checks for on-stack replacement (OSR)
as for normal optimizing compilation.

R=fschneider@google.com

Review URL: https://codereview.chromium.org//17183003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24132 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-18 11:06:18 +00:00
srdjan@google.com 91fdcba000 Change optimization counter threshold 3000 -> 15000.
This improves startup time considerably (30% dart2js Hello.dart, 20% others)

R=iposva@google.com

Review URL: https://codereview.chromium.org//17306003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24117 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-17 23:33:46 +00:00
srdjan@google.com 71340907c2 Cosmetic change: s/arg_descriptor/args_descriptor/
R=asiva@google.com

Review URL: https://codereview.chromium.org//17141004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24103 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-17 17:31:00 +00:00
kmillikin@google.com 3e78b2ad4a Reapply "Initial implementation of on-stack replacement (OSR)."
This reapplies SVN r24024 with a bugfix.

After OSR compilation, restore the pre-OSR code (which might be already
optimized) rather than the unoptimized code (which might have its entry
patched).  When the optimized code entry is patched it is only safe to call
it as a static call, not as an instance call.

R=fschneider@google.com

Review URL: https://codereview.chromium.org//17233003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24088 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-17 11:05:15 +00:00
kmillikin@google.com d6f3eccdf2 Revert "Initial implementation of on-stack replacement (OSR)."
This reverts commit 24024.

TBR=fschneider@google.com

Review URL: https://codereview.chromium.org//16888013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24025 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 10:30:53 +00:00
kmillikin@google.com 0b39927d30 Initial implementation of on-stack replacement (OSR).
Add profiling support to select OSR candidates and launch the compiler
for OSR, followed by entry to the function at the OSR entry point.

Implemented only on IA32 and X64.  The initial implementation can be
improved in various ways --- specifically: tuning of profiling
parameters and incorporation of feedback about the actual values seen
at OSR entry.

R=fschneider@google.com

Review URL: https://codereview.chromium.org//16693006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24024 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 10:10:55 +00:00
regis@google.com 8f62a87598 Switch code generation on ARM from softfp ABI to hardfp ABI.
Support leaf float runtime calls in ARM simulator.
Enable previously failing tests.

R=zra@google.com

Review URL: https://codereview.chromium.org//16638012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23868 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 16:47:01 +00:00
zra@google.com 354b204cf0 Enables optimization on MIPS
- Exposes double precision rather than single precision floating point registers
  to architecture generic code. This entails a mechanical change in the assembler
  to floating point instructions.
- Adds slti, sltiu instructions for comparison with small immediates, and uses
  them in the Branch(Un)Signed* macros.
- Fixes a bug in the intermediate language comparison/branching instructions
  caused by using subu for comparison. Now it uses two slt instructions.
- Fixes register use bugs in intermediate language.
- More uses of NULLREG instead of loading Object::null()

R=regis@google.com

Review URL: https://codereview.chromium.org//16022011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23190 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 23:45:41 +00:00
regis@google.com ac2e804324 Fix a bug in optimized ARM code.
Fix a bug in deoptimization (wrong stack layout assumption, worked on Intel by
chance).
Implement megamorphic instance call on ARM.
Improve line number reporting in simulator backtraces.

R=zra@google.com

Review URL: https://codereview.chromium.org//15692005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23169 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 18:52:34 +00:00
hausner@google.com 4b497b0c17 Consolidate debug stubs
The new debug stub BreakpointRuntime gets the original stub address
from the debugger. With this scheme, we don't need a new debug stub
for every runtime stub that the debugger patches.

R=asiva@google.com

Review URL: https://codereview.chromium.org//15743019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23094 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-23 18:42:03 +00:00
regis@google.com 89b673467c Enable code optimization on ARM.
Disable failing tests.

R=zra@google.com

Review URL: https://codereview.chromium.org//15697009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23037 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-22 18:53:51 +00:00
iposva@google.com e24d83c10d - Add a GetClassId() to Object, so that we do not have to
create a temporary class handle only to get at an object's
  class id, which is stored in the object header.

R=asiva@google.com

Review URL: https://codereview.chromium.org//15338008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22904 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-20 21:01:31 +00:00
hausner@google.com 7349a6d611 Make breakpoints on == fire reliably
Add breakpoints in the path taken if one of the operands
in a == b is null.

R=asiva@google.com

Review URL: https://codereview.chromium.org//14991010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22857 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-17 17:08:09 +00:00
regis@google.com 9e867eb4a1 Make deoptimization architecture dependent (it depends on the frame layout).
R=srdjan@google.com, zra@google.com

Review URL: https://codereview.chromium.org//15110003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22719 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-14 23:23:54 +00:00
hausner@google.com 80c7ad1070 Implement breakpoint for closure calls
Introduce a new PcDescriptor kind to distinguish closure calls from other runtime calls. The debugger can patch these calls to set a breakpoint. When stepping into a closure call, the debugger must fish out the closure object from the stack, find the function and set breakpoints in it.

Arm and Mips breakpoint stubs are not implemented yet. ia32 and x64 stubs tested by hand. Automated test to follow.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//14858033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22596 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-10 21:06:04 +00:00
vegorov@google.com 2565ca222f Implement a variation of scalar replacement for non-escaping allocations.
AllocationSinking pass discovers non-escaping allocations that have no input uses other than uses in the stores into its own fields.

Every environment use of such allocation is replaced by a state snapshot (MaterializeObject instruction) that describes the state of each initialized field in the object. State snapshots are computed through an additional round of load-forwarding.

Once snapshots are computed allocations are removed from the graph.

MaterializeObject instructions are not compiled into native code but produce deoptimization instructions instead that describe how object should be materialized at deoptimization.

Deoptimization instructions now follow the following format:

[mat obj #1]...[mat obj #N][ret addr][... mat arguments ...][... real frames ...]

- the prefix describes each object to materialize on deopt via kMaterializeObject instruction;
- actual values that are needed for materialization are emited as a part of bottom-most stack frame. This is done to simplify implementation: they need to be discoverable by a GC during materialization phase. At the end of deoptimization they will be removed from the stack;
- normal stack slots can refer to materialized objects via kMaterializedObjectRef instruction.

Additionally this change contains fixes in load-forwarding that are needed to guarantee that all artificial LoadField instructions inserted during AllocationSinking are correctly replaced with actual values.

Limitations of the current implementation:

- can't eliminate allocations that flow into phis but otherwise don't actually escape;
- can't sink allocations out of loops;
- allocation with type arguments are not handled.

R=regis@google.com, srdjan@google.com, zra@google.com

Review URL: https://codereview.chromium.org//14935005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22485 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-07 23:40:42 +00:00
regis@google.com 53347a3337 Remove stack_frame_<arch>.cc files.
The architecture specific information is in stack_frame_<arch>.h files.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//14925005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22470 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-07 18:06:21 +00:00
regis@google.com deeb192b03 Cleanup deoptimization code to make it architecture independent (in progress).
Implement some optimizing code on ARM in order to debug the above cleanup using
inline_stack_frame_test (still skipped in the vm status file).

This is not quite working yet, because CompilerDeoptInfo::CreateDeoptInfo
makes assumptions about the stack layout that are not valid for ARM or MIPS.
This will be cleaned up in a following cl.

R=srdjan@google.com, zra@google.com

Review URL: https://codereview.chromium.org//14812005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22386 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-03 18:39:40 +00:00