Ryan Macnak
d47827b88e
Port "Add mapping from address to id for runtime functions."
...
Delete some out-of-sync DECLAREs.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//1288953003 .
2015-08-13 14:42:31 -07:00
Ryan Macnak
66194d4fc1
Port "Add flag to disable lazy compilation of invocation dispatchers."
...
Fix InvokeNoSuchMethodDispatcher to propagate with a rethrow instead of a throw.
Fix unit test checking raw stack frames.
R=fschneider@google.com
Review URL: https://codereview.chromium.org//1191813002 .
2015-06-18 10:23:39 -07:00
rmacnak@google.com
7322f1f37b
Rename DeoptimizeAll to DeoptimizeFunctionsOnStack.
...
To avoid confusion with operations related to live modification that really do touch all functions.
BUG=
R=srdjan@google.com
Review URL: https://codereview.chromium.org//861393004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43303 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-29 17:45:54 +00:00
zerny@google.com
c77ab72c54
Use a typed array for the irregexp stack.
...
BUG=
R=vegorov@google.com
Review URL: https://codereview.chromium.org//800433004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43039 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-21 15:11:36 +00:00
srdjan@google.com
dd9c0ef25e
Allow invalidation and recompilation of instance allocation stubs. Requested in order to implement better pretenuring strategy.
...
R=zra@google.com
Review URL: https://codereview.chromium.org//557913002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40168 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 17:56:42 +00:00
fschneider@google.com
e2443c0ef2
VM: Clean up generated code for NoSuchMethod invocation of closures.
...
Remove unnecessary ic-data argument from the runtime function that
invokes noSuchMethod for closures. This reduces the size of generated
code for closures.
R=vegorov@google.com
Review URL: https://codereview.chromium.org//517383005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39804 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 12:51:28 +00:00
fschneider@google.com
937726a0aa
Improve polymorphic inlining of int/int double/double operations.
...
I added inlining of the native Double methods _add, _sub, _mul and _div and fromInteger
and unified the method recognition of the MethodRecognizer and the Intrinsifier classes.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//484693003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39446 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-21 11:13:44 +00:00
hausner@google.com
0bbf6c5b16
Runtime support for evaluation of static field initializer expressions
...
Eliminates the generation of field initializer functions by the parser.
Adds a runtime call that creates a one-shot function to evaluate the
initializer of a static field. The runtime function gets called from
the implicit static getter function for the field.
R=srdjan@google.com , zra@google.com
Review URL: https://codereview.chromium.org//471283002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39387 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-19 21:53:44 +00:00
srdjan@google.com
5ce61408ae
Fix SIMARM64 to compile on Mac, fix compilation because of ICData change.
...
R=regis@google.com
Review URL: https://codereview.chromium.org//257793005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35460 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-26 00:13:32 +00:00
regis@google.com
e0ab99b0b2
Remember all deopt reasons in ic_data, not just the last one.
...
Remember if a JS warning was issued in ic_data.
Save a word in ic_data on 64-bit platforms.
R=iposva@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//254723003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35457 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-25 23:45:14 +00:00
srdjan@google.com
0c2b0af123
Copy of Issue 231383002 after hard disk crash: First step in improving instance of test for a fixed set of value cids returning different results.
...
Review URL: https://codereview.chromium.org//258563004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35455 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-25 23:21:12 +00:00
fschneider@google.com
79a5307d5b
VM: Implement closure calls as instance calls.
...
Conceptually f() becomes f.call() where the .call method performs the actual
closure call. The closure call itself is implemented without a stub.
The check if the object called is a closure becomes a class-id check
which can be hoisted out of loops.
R=iposva@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//227723002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34917 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-10 10:56:00 +00:00
fschneider@google.com
9ed4cf1cb6
Simplify and improve handling of IC and megamorphic cache miss handling.
...
Instead of going back and forth from stub code to C++, perform
only the lookup in C++ and call target functions only from
stub code.
noSuchMethod and implicit closure invocations are now also work with
the megamorphic cache. Before they would go slow-case in the megamorphic case.
This CL eliminates the InstanceFunctionLookup stub that was previously
used to handle noSuchMethod and implicit closure invocations.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//221173011
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34774 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-07 09:27:43 +00:00
regis@google.com
8d5dae7798
Allocate instance closures similarly to regular closures, i.e. without a
...
specific stub and runtime call.
R=fschneider@google.com
Review URL: https://codereview.chromium.org//178233003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33074 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-26 18:38:47 +00:00
srdjan@google.com
2c37517875
Disable hoisting CheckClass due to excessive deoptimization (issue 16285). Detect that a deoptimization was caused by hoisted check class instruction and disable hoisting of CheckClassInstr for that function. This is a short-term solution to fix excessive deoptimization causing slow start-ups.
...
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org//157833004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32460 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-08 00:02:22 +00:00
regis@google.com
7830430adf
Implement eager instantiation and canonicalization of type arguments at run
...
time using a cache in uninstantiated type arguments.
Remove InstantiatedTypeArguments class.
Fix a bug in optimized code: do not update unused type test cache for Smi.
Fix a bug in optimized code on ARM and MIPS in type test cache lookup.
R=iposva@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//154393003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32447 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-07 19:54:33 +00:00
srdjan@google.com
8b7ebed54f
Mark optimized code that used CHA for optimization so that lazy class 'finalization' does not invalidate that code.
...
R=fschneider@google.com
Review URL: https://codereview.chromium.org//150923002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32335 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-05 20:31:57 +00:00
hausner@google.com
a65c571f18
Get rid of dynamic call debug stub
...
This leaves only one debugger stub function. Yay.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//140743010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31932 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-17 21:32:58 +00:00
hausner@google.com
06da68b5aa
Eliminate another debugger stub
...
This change replaces https://codereview.chromium.org/135213002/
The specialized debugger stub call for static method calls is
no longer needed. It was introduced because once upon a time, the
static method call stub used to patch the call site when the target
was compiled. The VM stopped patching unoptimized static calls a
long time ago. Thus we can treat a static call like a regular runtime
call when patching it to set a breakpoint.
Bonus fix: single step runtime callback on mips was broken. The
enter/leave stub frame were missing.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//140793010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31928 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-17 19:09:46 +00:00
hausner@google.com
31db06a905
Delete obsolete debug stub
...
Remove the debug stub that became obsolete with the recent rewrite
of how we handle breakpoints at return statements.
R=regis@google.com
Review URL: https://codereview.chromium.org//132793002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31685 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-09 23:56:08 +00:00
srdjan@google.com
a8f549dbc3
Merge sin(a), cos(a) into one instruction. On IA32 use x87 fsincos operation, on x64 call runtime routine whihc merges sin/cos intos sincos.
...
TODO: Implement for ARM and MIPS.
R=fschneider@google.com
Review URL: https://codereview.chromium.org//92433002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30827 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-03 22:00:27 +00:00
regis@google.com
3fa7a61efc
Implement latest spec changes regarding malformed types (see issue 14006):
...
- a malformed type used in a is, as, or catch type test results in a dynamic
type error being thrown.
- a malformed type is not mapped to dynamic anymore.
For now, this applies to type tests in checked mode as well, but discussion is
still on-going.
R=hausner@google.com
Review URL: https://codereview.chromium.org//53583003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29608 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 23:30:32 +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
zra@google.com
40394904bb
Enables unboxed mints in ia32 javascript int compatability mode.
...
Also checks range information before emitting checks on x64.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//21885003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25740 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-02 18:37:20 +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
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
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
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
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
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
iposva@google.com
6c4ac09cb9
- Remove heap tracing.
...
Review URL: https://codereview.chromium.org//14179015
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21844 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-22 21:43:57 +00:00
vegorov@google.com
1c9d22d75c
Collect type feedback for fields.
...
BUG=
Review URL: https://codereview.chromium.org//12529008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20235 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-19 20:15:10 +00:00
srdjan@google.com
35ef4ddbd5
Enable correct optimized double modulo operation. (TODO: enable remainder optimization).
...
Review URL: https://codereview.chromium.org//12082063
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17859 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-30 17:40:28 +00:00
srdjan@google.com
6e26ea871d
On Ia32 optimistically assume that results from int32 and uint32 array loads fit into Smi. Only if the instruction caused deoptimization will we assume mixed Smi/Mint operations. In absence of precise tracking of deoptimization history (location/reason) conservatively assume that a method that was deoptimized once may have been deoptimzied because of uint32/int32 loads.
...
Significant improvement for MeshDecompression on ia32.
Review URL: https://codereview.chromium.org//12086045
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17810 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-29 21:16:44 +00:00
srdjan@google.com
18b376a8ad
Add DoubleToSmi optimistically, preventing boxing/unboxing of doubles and propagate smi-nessof the result.
...
Review URL: https://codereview.chromium.org//11568044
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16272 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-18 18:43:29 +00:00
cshapiro@google.com
49f6f9f36d
Merge the Merlin heap tracing to top-of-trunk.
...
Review URL: https://codereview.chromium.org//11428067
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16199 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-15 19:58:45 +00:00
kmillikin@google.com
1610d7d2ac
Refactor the InstanceFunctionLookupStub.
...
The stub is used in the case that an IC miss handler cannot find a
cacheable target. It handles implicit closures, calls to instance
fields, and no such method.
Refactor the stub to make a single call into the runtime.
BUG=
Review URL: https://codereview.chromium.org//11316353
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16057 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-12 19:52:47 +00:00
regis@google.com
697550b2a2
Support call operator in the vm.
...
Review URL: https://codereview.chromium.org//11316343
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16009 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-12 00:48:58 +00:00
kmillikin@google.com
a119414b2f
Cache lookups at megamorphic call sites in optimized code.
...
The function name and argument descriptor are mapped to a lookup cache
at compile time. The cache maps class id to target function. It is
resizable.
Review URL: https://codereview.chromium.org//11299298
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15889 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-10 09:48:52 +00:00
srdjan@google.com
d6772016eb
Cleanups based on Kevin's and Florian's suggestions.
...
Review URL: https://codereview.chromium.org//11481002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15850 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-07 17:59:53 +00:00
kmillikin@google.com
3dabe31e91
Reapply "Do not call ResolveCompileInstanceFunction from the lookup stub."
...
With a fix for a crash bug on x64. The near jump encoding could fail on
some platforms due to platform-specific code.
BUG=
Review URL: https://codereview.chromium.org//11476021
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15845 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-07 13:00:38 +00:00
kmillikin@google.com
1ddeb10349
Revert "Do not call ResolveCompileInstanceFunction from the lookup stub."
...
This reverts svn revision 15842 due to a snapshot build failure on Mac.
TBR=fschneider@google.com
Review URL: https://codereview.chromium.org//11467015
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15843 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-07 11:21:13 +00:00
kmillikin@google.com
c9bab9efaa
Do not call ResolveCompileInstanceFunction from the lookup stub.
...
The InstanceFunctionLookup stub is only called after the inline cache miss
handler. The miss handler ensures that ResolveCompileInstanceCallTarget is
called.
BUG=
Review URL: https://codereview.chromium.org//11451036
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15842 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-07 11:13:51 +00:00
kmillikin@google.com
8c4e214722
Pass IC data and arguments descriptor to IC miss runtime functions.
...
Before, we obtained them by pattern matching backwards on the machine
instructions at the call site. This previous approach becomes unwieldy when
we need to use to use multiple instance call patterns.
R=vegorov@google.com
BUG=
Review URL: https://codereview.chromium.org//11438017
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15737 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-05 15:35:18 +00:00
regis@google.com
f19052e037
Remove ClosureArgumentMismatch runtime entry in vm and
...
replace with call to noSuchMethod.
Review URL: https://codereview.chromium.org//11421134
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15472 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-28 21:14:43 +00:00
srdjan@google.com
99ff4cef45
Address Florian's comments: use restricted lazy deoptimization, fix typo.
...
Review URL: https://codereview.chromium.org//11364245
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14938 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-15 01:36:04 +00:00
srdjan@google.com
7375693321
In optimized code use IC calls for instance calls that have no IC data instead of deoptimizing. The optimized IC call increments usage counter and reoptimizes optimized function if the threshold is met.
...
Recognize closure calls and mark them in ICData. Closure calls do not populate ICData, i.e., number of checks is always 0 (unless mixed closure calls with regular instance calls). Therefore closure IC calls do not count for reoptimization.
Review URL: https://codereview.chromium.org//11361225
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14860 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-13 18:34:05 +00:00