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
vegorov@google.com
a77fc9701c
When requested to extract a method M from class C inject a method extractor (consisting of a single AST node CreateClosure) as a getter get:M into C.
...
This allows to cache and optimize method extraction requests as normal method invocations and at hot method extraction sites that significantly decreases overhead of method extraction which previously required two trips into runtime system and was not cached at all.
BUG=
Review URL: https://codereview.chromium.org//11642003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17261 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 11:54:45 +00:00
regis@google.com
912194a756
Fix vm code base so that it can be built for --arch=simarm (no snapshot yet).
...
Review URL: https://codereview.chromium.org//11956004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17246 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 00:34:20 +00:00
srdjan@google.com
faeb58ba40
Fix printing of deoptimized function.
...
Review URL: https://codereview.chromium.org//11886008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17002 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-12 00:44:16 +00:00
asiva@google.com
62115b51fe
Fix for issue 7757
...
- Iterate and collect all the inlined functions in an optimized dart frame
into the stack frame when throwing an exception.
- Added a OptimizedDartFrameIterator class which iterates over all the inlined
functions of a single optimized dart frame.
Review URL: https://codereview.chromium.org//11833025
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17000 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-12 00:24:28 +00:00
srdjan@google.com
ec59e1e5e0
Fix printing of the function that cannot be optimized.
...
Review URL: https://codereview.chromium.org//11878006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16997 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-11 23:15:51 +00:00
srdjan@google.com
04fc29c7e1
Optimize function at its entry instead of at exit.
...
The code can be patched if it should not be executed any longer.
The code can be now patched at other location than at entry, the requirement is still that patching code does not overwrite an inlined object.
Intrinsic methods that do not have a fall through cannot be patched.
Review URL: https://codereview.chromium.org//11783066
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16897 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-10 00:28:57 +00:00
hausner@google.com
e8a293c05a
Allow optimized code when debugger is active
...
The debugger allows the VM to optimize code unless there is a breakpoint inside the
function. Whenever a new breakpoint is set (explicitly or implicitly by stepping)
all optimized code is discarded.
Review URL: https://codereview.chromium.org//11780005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16815 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-08 18:57:19 +00:00
asiva@google.com
4c069867e4
- Make Boolean 'true' and 'false' singleton VM isolate objects.
...
- Change all uses of it
Review URL: https://codereview.chromium.org//11745022
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16623 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-04 01:52:05 +00:00
srdjan@google.com
29e06db609
In unoptimized code use call for instanceof instead of inlined checks. This allows us to collect type feedback and to reduce the code size of unoptimized code. Next will be work on type tests as well.
...
Review URL: https://codereview.chromium.org//11694003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16589 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-02 22:22:39 +00:00
asiva@google.com
7022b39e35
Convert all symbol accessors to return read only handles so that it is not necessary to create a new handle in the code that uses it.
...
Added a few more strings to the symbols list.
Review URL: https://codereview.chromium.org//11667012
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16584 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-02 19:31:59 +00:00
fschneider@google.com
8a54796712
Cleanup: Don't allocate a frame iterator in the IC miss handler when it's not needed.
...
Review URL: https://codereview.chromium.org//11607018
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16439 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-21 11:56:11 +00:00
regis@google.com
9cdeb399d1
Simplify method invocation runtime entries.
...
Review URL: https://codereview.chromium.org//11636025
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16343 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-19 21:26:29 +00:00
asiva@google.com
2c6de68680
Changed the API in DartEntry for invoking dart code from C++ to make it more compatible with the requirements of the runtime.
...
Deleted all the code duplication that was added to circumvent the old DartEntry API requirements.
Review URL: https://codereview.chromium.org//11613009
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16288 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-18 21:36:01 +00:00
regis@google.com
aef9047742
Invoke noSuchMethod instead of immediately throwing NoSuchMethodError when
...
invoking a non-closure as a closure (reopened issue 3326).
Address comments of last cl.
Review URL: https://codereview.chromium.org//11612002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16220 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-17 19:35:16 +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
regis@google.com
3ae792bbf4
Implement InvocationMirror.invokeOn method in the vm (issue 7227).
...
Review URL: https://codereview.chromium.org//11570042
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16187 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-15 00:28:41 +00:00
regis@google.com
849585ef7c
Implement Function.apply in vm (issue 5670).
...
Fix a closure parameter count check bug (unveiled by an apply test).
Review URL: https://codereview.chromium.org//11564029
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16175 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-14 19:04:01 +00:00
srdjan@google.com
27296584c2
Increase optimziation counter threshold to 3000, improves dart2js preformance.
...
Review URL: https://codereview.chromium.org//11442059
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16127 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-13 16:27:09 +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
regis@google.com
3b1dfe51d1
Pass the proper invocation mirror argument to noSuchMethod.
...
Review URL: https://codereview.chromium.org//11523002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15939 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-11 00:31:53 +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
srdjan@google.com
c0315644f3
Pass handles not raw objects into methods.
...
Review URL: https://codereview.chromium.org//11441021
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15748 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-05 19:50:50 +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
fschneider@google.com
d6a35f1983
Avoid unneccary handle allocation in OptimizeTypeArguments.
...
Review URL: https://codereview.chromium.org//11453008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15732 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-05 13:59:41 +00:00
kmillikin@google.com
275c8d928f
Introduce a class encapsulating arguments descriptor arrays.
...
BUG=
Review URL: https://codereview.chromium.org//11442010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15727 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-05 12:05:57 +00:00
fschneider@google.com
408e3abca9
Cleanup: Remove unused return value in OptimizeTypeArguments.
...
Instead use it to replace the bool* output-parameter.
Review URL: https://codereview.chromium.org//11428079
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15515 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-29 13:43:20 +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
85cf9af6ab
Fix for issue 6678: Result of identical(a, b) with a and b doubles not consistent.
...
Implement proposed new identity spec (flag --new_identity_spec). It will be enabled/committed once the new spec been confirmed.
The new spec says that identity of numbers is computed on their values instead of on the object reference. This provides deterministic behavior without having to disable optimizations in the VM. In some cases 'identical' is now slower than 'equality' as more checks need to be done. The VM compiler can optimize 'identical' in the future.
My benchmarks do not show any slow down.
Review URL: https://codereview.chromium.org//11414136
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15332 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-26 18:35:45 +00:00
lrn@google.com
22309b260c
Remove NullPointerException.
...
Accessing non-existing members on null now throws NoSuchMethodError.
Throwing a null value fails by throwing a NullThrownError.
Methods checking for null now generally throw new ArgumentError(null).
Committed: https://code.google.com/p/dart/source/detail?r=15061
Review URL: https://codereview.chromium.org//11415028
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15136 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-20 09:21:52 +00:00
srdjan@google.com
637c7a8b1f
Remove loading of function object in static calls.
...
Review URL: https://codereview.chromium.org//11419073
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15126 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-20 00:04:08 +00:00
srdjan@google.com
7c6a68f2a4
Simplify CodePatcher::GetStaticCallAt.
...
Review URL: https://codereview.chromium.org//11411072
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15101 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-19 19:17:02 +00:00
srdjan@google.com
a6dae8cd4a
First part of static call cleanup: store static call targets into code object, referenced by code-offset.
...
Review URL: https://codereview.chromium.org//11418046
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15091 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-19 16:39:07 +00:00
lrn@google.com
0c8dce77f1
Revert "Remove NullPointerException."
...
Crashes in the x64 VM.
Review URL: https://codereview.chromium.org//11417058
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15065 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-19 09:59:59 +00:00
lrn@google.com
e211c2f0ee
Remove NullPointerException.
...
Accessing non-existing members on null now throws NoSuchMethodError.
Throwing a null value fails by throwing a NullThrownError.
Methods checking for null now generally throw new ArgumentError(null).
Review URL: https://codereview.chromium.org//11415028
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15061 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-19 08:51:49 +00:00
regis@google.com
01a31275bd
Make creation of list literal more resilient to changes in the underlying
...
dart implementation of List in the core library.
Do the same for map literal creation.
Review URL: https://codereview.chromium.org//11299020
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14997 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-16 01:31:15 +00:00
hausner@google.com
7eb3efc2ba
Fix native argument handling
...
Native functions need to fetch arguments differently if they are
called through a closure.
fixes issue 6696.
Review URL: https://codereview.chromium.org//11293290
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14937 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-15 01:14:01 +00:00
srdjan@google.com
fc4f5c093d
Upon script loading deoptimize only functions whose owener has been subclassed, as that is the only CHA optimizations being applied to the code at the moment.
...
Review URL: https://codereview.chromium.org//11365273
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14934 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-15 00:41:53 +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
srdjan@google.com
1fad6314b7
Do not add InstantiatedTypeArgument entries into cache as they cannot be canonicalized. Limit the maximum subtype cache size, so that it does not become brobdingnagian and thus slows the GC.
...
Review URL: https://codereview.chromium.org//11369204
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14825 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-13 00:43:17 +00:00
fschneider@google.com
a42474ba37
Reland: Improve smi shift operations and avoid repeated deoptimizations.
...
This CL includes a bug fix where a NULL check of the pc was missing.
Also change the dart2js test status of arithmetic_test from Skip to Fail.
Review URL: https://codereview.chromium.org//11369158
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14755 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-09 19:54:55 +00:00
fschneider@google.com
a830c7c091
Revert r14711 and r14709 because of test failures.
...
TBR=srdjan@google.com
Review URL: https://codereview.chromium.org//11363151
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14712 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-08 22:37:26 +00:00
fschneider@google.com
0f251088ec
Improve smi shift operations and avoid repeated deoptimizations.
...
Smi left shifts do not contain a call now. Only after deoptimizing
at a smi operation we we generate mint code or a generic call to
avoid repeated deoptimization.
Added a test case for the code that was not covered by existing tests.
Review URL: https://codereview.chromium.org//11363141
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14709 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-08 22:03:47 +00:00
regis@google.com
d372a816bb
Pass closure object as first implicit argument to closure functions.
...
Remove code passing captured receiver to native instance closures; instead,
access captured receiver in context, as non-native functions do.
Review URL: https://codereview.chromium.org//11360116
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14698 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-08 18:28:07 +00:00
regis@google.com
ec09038e82
Remove references to ObjectNotClosureException and ClosureArgumentMismatchException
...
from the VM (issue 6124).
These are replaced with NoSuchMethodError for now (work in progress).
Review URL: https://codereview.chromium.org//11312019
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14362 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 18:13:12 +00:00