zerny@google.com
5aac823c39
Revert "Remove push arguments and replace constants in FlowGraph::InlineCall."
...
This reverts r14468 due to test failures.
TBR=kmillikin@google.com
Review URL: https://codereview.chromium.org//11362060
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14471 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-02 14:02:53 +00:00
zerny@google.com
8522885d32
Remove push arguments and replace constants in FlowGraph::InlineCall.
...
R=kmillikin@google.com
Review URL: https://codereview.chromium.org//11262008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14468 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-02 13:29:35 +00:00
zerny@google.com
8f5aa24ec9
More inlining flags and tuned heuristics.
...
The heuristics should be examined further, but these maintain about the same
runtime for the benchmarks while decreasing compile time for dart2js.
R=kmillikin@google.com
Review URL: https://codereview.chromium.org//11269040
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14463 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-02 12:26:07 +00:00
iposva@google.com
4d410f0ebb
- Prepopulate the keyword symbol table otherwise we can end up
...
with empty spots when reading from a snapshot.
Review URL: https://codereview.chromium.org//11366058
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14453 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-02 07:29:12 +00:00
hausner@google.com
e4880d6698
Revert cl 14446
...
Review URL: https://codereview.chromium.org//11293054
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14448 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-02 00:19:48 +00:00
hausner@google.com
4c6b490ab8
Make library, import, export, part built-in identifiers
...
Review URL: https://codereview.chromium.org//11360051
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14446 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-01 23:47:25 +00:00
srdjan@google.com
0db049051c
Add is_intrinsic and is_not_intrinsic bits to prevent repeated tests on the same function (inlining, recompilations). The bist are set lazily, initially both are false.
...
Review URL: https://codereview.chromium.org//11358047
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14444 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-01 23:25:26 +00:00
fschneider@google.com
85a2dca687
Inline native String.charCodeAt in optimized code and fix a bounds-check bug.
...
Introduce a new IL instruction that does charCodeAt from
1- and 2-byte character strings. The existing CheckArrayBound
instructions is extended to be used for string bounds checking.
Also fix a bug with a missing compile-time bounds-check on constant
arrays.
TEST=tests/language/optimized_string_charcodeat.dart,
tests/language/optimized_constant_array_string_access.dart
Review URL: https://codereview.chromium.org//11360033
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14441 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-01 22:47:41 +00:00
srdjan@google.com
251169951b
Do not recompute unary_checks repeatedly. Add special (and quicker) way to check for method overrides using CHA.
...
Review URL: https://codereview.chromium.org//11275110
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14434 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-01 21:06:36 +00:00
vegorov@google.com
4c4f55929b
Improve RangeBoundary::LowerBound/UpperBound.
...
They should not just return MinSmi/MaxSmi when symbol's range is not available. Instead they should take offset into account.
R=fschneider@google.com
BUG=
Review URL: https://codereview.chromium.org//11275098
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14426 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-01 18:56:39 +00:00
srdjan@google.com
081e765eb5
Fix issue 6288, move DeoptimizeAll to top level parsing. Allow optimizing compiler to optimize even when ooptimzied code is active.
...
Review URL: https://codereview.chromium.org//11293038
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14422 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-01 18:10:30 +00:00
asiva@google.com
df1b318ae4
Remove some unnecessary class handle creations.
...
Review URL: https://codereview.chromium.org//11293031
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14420 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-01 17:58:58 +00:00
lrn@google.com
7e6ae8ea09
Renaming IndexOutOfRangeException to RangeError.
...
It now extends ArgumentError.
Review URL: https://codereview.chromium.org//11275042
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14405 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-01 13:46:30 +00:00
sgjesse@google.com
efb730d712
Fix broken VM build caused by 14380
...
TBR=csaphiro@google.com
BUG=
Review URL: https://codereview.chromium.org//11361028
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14381 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-01 08:09:30 +00:00
sgjesse@google.com
a248c61b14
New APIs for external byte arrays
...
The following APIs have been added:
Dart_IsExternalByteArray: Check whether an object is an external byte
array.
Dart_ExternalByteArrayGetData: Return the pointer to the external data
hosted by the external byte array.
R=cshapiro@google.com
BUG=
Review URL: https://codereview.chromium.org//11362009
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14380 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-01 07:53:33 +00:00
srdjan@google.com
b2b9dc3bb1
Any instance call with too many checks is left to be megamorphic. This helps with, e.g., LoadField instructions with large number of checks and frequent deoptimization. Deoptimization improves on dart2js/swarm: total number of deoptimization 956 -> 753; number of methods becoming unoptimizable 101 -> 52.
...
Review URL: https://codereview.chromium.org//11367022
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14377 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 23:17:20 +00:00
srdjan@google.com
86e8ff0a06
Add flag --always_cleared_ic_data, which forces a cleared ICData to be emitted with each IC call (instead of propagating the ICData from unoptimized to optimized code). This addresses Kevin's concern that propagating the ICData may hurt performance when inlining methods as the IC calls of inlined methods may not need all classes as the unoptimized code. Currently running with cleared ICData slows dart2js by > 2%, probably because the ICData has to be repopulated by optimized code through calls to runtime. Adding the flag for experimenting as we work on inlining strategies and megamorphic calls.
...
Review URL: https://codereview.chromium.org//11347049
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14367 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 20:07:31 +00:00
hausner@google.com
29c1668cb9
Prevent mutation of final variables
...
Fixes issue 4328
Review URL: https://codereview.chromium.org//11363012
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14366 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 19:43:44 +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
asiva@google.com
ebbb7c4134
- Represent strings internally in UTF-16 format, this makes it
...
compatible with webkit and will allow for easy externalization of
strings. One byte strings are retained for pure ASCII strings.
(The language specification was changed recently to reflect this as
follows "A string is a sequence of UTF-16 code units").
- Remove four byte string class and all references to it.
- Rename some of the string functions in Dart API to make them
consistent and better describe the underlying functionality
Dart_NewString => Dart_NewStringFromCString
Dart_NewString8 => Dart_NewStringFromUTF8
Dart_NewString16 => Dart_NewStringFromUTF16
Dart_NewString32 => Dart_NewStringFromUTF32
Dart_NewExternalString8 => Dart_NewExternalUTF8String
Dart_NewExternalString16 => Dart_NewExternalUTF16String
Dart_NewExternalString32 => Dart_NewExternalUTF32String
Dart_StringGet8 => Dart_StringToUTF8
Dart_StringGet16 => Dart_StringToUTF16
Dart_StringToCString => Dart_StringToCString
Dart_IsString8 => Removed
Dart_IsString16 -> Removed
Dart_StringToBytes -> Removed
Dart_StringGet32 -> Removed
Review URL: https://codereview.chromium.org//11318018
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14357 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 17:56:46 +00:00
srdjan@google.com
dc55e9817f
Use unary class checks when emitting instance calls in optimized mode.
...
Review URL: https://codereview.chromium.org//11339033
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14350 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 16:35:30 +00:00
fschneider@google.com
abd3671604
Relational comparisons for unboxed mints.
...
Review URL: https://codereview.chromium.org//11344011
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14343 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 14:53:15 +00:00
lrn@google.com
a8720a6d9c
Change signature of noSuchMethod to take an InvocationMirror.
...
Requires VM and dart2js/dart2dart changes to work.
Committed: https://code.google.com/p/dart/source/detail?r=14198
Committed: https://code.google.com/p/dart/source/detail?r=14254
Review URL: https://codereview.chromium.org//11231074
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14324 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 10:32:54 +00:00
srdjan@google.com
d5146f80ab
Fix equality instruction to switch from checked (polymorphic) to megamorphic state. This helps dart2js as it eliminates excessive deoptimizations (probeForAdding runs now in optimized mode) -> 5% improvement.
...
Review URL: https://codereview.chromium.org//11343046
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14309 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 20:59:22 +00:00
srdjan@google.com
6d2277f70f
Add range to kBIT_AND with positive constants. Use that range to eliminate compares in left shifts.
...
Review URL: https://codereview.chromium.org//11175013
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14304 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 19:59:58 +00:00
hausner@google.com
5a51906fa3
Disallow 'dynamic' as type parameter name
...
Fixes issue 2492
Review URL: https://codereview.chromium.org//11343044
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14296 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 17:45:36 +00:00
srdjan@google.com
238028f8b2
Fix issue 6403: do not crash if super indexed load does not exist (return 'no-such-method call' instrcution as result.
...
Review URL: https://codereview.chromium.org//11273117
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14295 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 17:27:58 +00:00
vegorov@google.com
55c9c6c444
Allow bound check elimination to eliminate checks when both array length and index boundaries are expressed through the same symbol.
...
For example:
var list = new List(n);
for (var i = 0; i < n; i++) list[i];
R=fschneider@google.com
BUG=
Review URL: https://codereview.chromium.org//11273111
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14293 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 16:26:46 +00:00
ajohnsen@google.com
806fa6fab1
Move StringImplementation from coreimpl to core as _StringImpl.
...
BUG=
Review URL: https://codereview.chromium.org//11348035
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14281 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 14:19:57 +00:00
ajohnsen@google.com
dbbf15abd8
Move ListImplementation from coreimpl to core, as a private member.
...
BUG=
Review URL: https://codereview.chromium.org//11189141
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14274 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 13:25:04 +00:00
lrn@google.com
895d155ab1
Revert "Change signature of noSuchMethod to take an InvocationMirror."
...
TBR=ager@google.com
Review URL: https://codereview.chromium.org//11339042
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14260 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 10:47:42 +00:00
vegorov@google.com
4e99855580
Fold away x === null comparisons when propagated cid of x is not kDynamicCid.
...
Eliminate single operand phis that appear in the graph after constant propagation.
Recognize constructors for _ObjectArray and _GrowableObjectArray.
Fix bug in result cid recognition for List. constructor call. A call with an argument does not guarantee that fixed size array (kArrayCid) is returned.
These changes together allow us to produce better code after inlining of List constructor, otherwise we lose information due to non-specialized control-flow that chooses between _GrowableObjectArray and _ObjectArray.
R=kmillikin@google.com
BUG=
Review URL: https://codereview.chromium.org//11342014
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14258 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 10:27:51 +00:00
lrn@google.com
4a24ddc1d4
Change signature of noSuchMethod to take an InvocationMirror.
...
Requires VM and dart2js/dart2dart changes to work.
Committed: https://code.google.com/p/dart/source/detail?r=14198
Review URL: https://codereview.chromium.org//11231074
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14254 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 10:04:12 +00:00
kmillikin@google.com
3d684dcc70
Compress deoptimization information by sharing common suffixes.
...
For all the deoptimization entries in a function, build a suffix trie. Add
a new deoptimization instruction that indicates the rest of the translation
is a fixed-length suffix of another entry.
BUG=
Review URL: https://codereview.chromium.org//11040058
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14252 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 09:50:35 +00:00
kmillikin@google.com
8c806ce0df
Simplify the implementation and generated code for the IC stubs.
...
The implementation now uses the same code for 1 and >1 argument cases. For
the 1 argument case the generated code is essentially the same code as
before. For the >1 argument case the generated code is slightly improved.
R=fschneider@google.com
BUG=
Review URL: https://codereview.chromium.org//11272028
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14249 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 09:37:35 +00:00
iposva@google.com
15114867c7
- GrowableArray::RemoveLast returns the value being removed
...
to avoid having to call Last() followed by RemoveLast().
Review URL: https://codereview.chromium.org//11348026
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14237 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 00:52:21 +00:00
srdjan@google.com
39931e05c5
Propagate ICData from unoptimized code to instance calls in optimized code.
...
Review URL: https://codereview.chromium.org//11341025
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14236 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 00:48:11 +00:00
regis@google.com
57a60316f0
Fix wrong canonicalization of signature class due to name collision (issue 6353).
...
Add test.
Review URL: https://codereview.chromium.org//11342028
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14234 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 00:06:24 +00:00
hausner@google.com
d4c5f9f05b
Handle super call to unary operators
...
Fix issue 1288.
Review URL: https://codereview.chromium.org//11342027
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14233 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 00:02:22 +00:00
asiva@google.com
cff311e30d
Fix for issue 6311 (serialize the right type).
...
Review URL: https://codereview.chromium.org//11344018
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14224 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-29 21:17:54 +00:00
iposva@google.com
f820a4599c
- Avoid recursion in the scavenger by remembering weak properties
...
with reachable keys in a stack.
- Added assertion to trigger when scavenger is called recursively.
Review URL: https://codereview.chromium.org//11338017
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14221 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-29 20:26:14 +00:00
regis@google.com
989791ac05
Remove --reject_named_argument_as_positional flag from the VM.
...
Review URL: https://codereview.chromium.org//11341014
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14215 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-29 18:31:24 +00:00
lrn@google.com
778b0dc5e5
Revert "Change signature of noSuchMethod to take an InvocationMirror."
...
TBR=floitsch@google.com
Review URL: https://codereview.chromium.org//11336011
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14199 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-29 14:07:10 +00:00
lrn@google.com
0bcd2f4f7b
Change signature of noSuchMethod to take an InvocationMirror.
...
Requires VM and dart2js/dart2dart changes to work.
Review URL: https://codereview.chromium.org//11231074
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14198 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-29 13:34:58 +00:00
ajohnsen@google.com
e925b5591e
Move Arrays, Collections and Maps into a new library, dart:collections.
...
BUG=
Review URL: https://codereview.chromium.org//11274043
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14173 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-29 08:38:15 +00:00
hausner@google.com
feff694279
More fixes for super[]
...
Extend the LoadIndexedNode to also handle super[] and super[]=
Make sure super []= returns the value.
Handle side effects in index expression correctly.
Defer operator function resolution to the flow graph build phase.
Review URL: https://codereview.chromium.org//11267027
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14157 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-26 22:31:49 +00:00
vegorov@google.com
06dded663f
Simple array bounds check elimination on top of range analysis framework.
...
Currenly eliminates only bounds checks when there is an implicit constraint bounding index's range with array length.
Does not eliminate redundancy in expressions like a[i + 1], a[i].
R=fschneider@google.com
BUG=
Review URL: https://codereview.chromium.org//11262033
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14141 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-26 16:04:55 +00:00
fschneider@google.com
95def51f04
Small performance fix for mint equality operation.
...
Mint compares don't have side effects and can't deoptimize.
Review URL: https://codereview.chromium.org//11313005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14131 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-26 12:28:11 +00:00
lrn@google.com
b8b5632148
Convert NoMoreElementsException and EmptyQueueException to StateError.
...
Review URL: https://codereview.chromium.org//11269045
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14122 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-26 08:28:33 +00:00
ager@google.com
2d74d2b6d0
Introduce VM API for the patching mechanism.
...
This will be used to use patching for the dart:io library.
R=iposva@google.com
BUG=
Review URL: https://codereview.chromium.org//11264032
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14121 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-26 08:00:05 +00:00