srdjan@google.com
5d42e63bd1
Optimize left shift of a constant: compute max value of right that does not overflow into Mint/Bigint.
...
Review URL: https://codereview.chromium.org//12212175
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18525 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-14 18:10:21 +00:00
fschneider@google.com
e2a0c8f7ca
Optimize stores to ExternalUint8Array and ExternalUint8ClampedArray in the optimizer.
...
This CL adds support for these two array types to the StoreIndexed instruction.
Review URL: https://codereview.chromium.org//12263010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18517 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-14 12:59:51 +00:00
fschneider@google.com
352cb5bd78
Use writable register policy to avoid explicit restoring input register after untagging.
...
This CL produces more compact code if the writable input
register is the last use by avoiding unnecessary re-tagging.
In that case no extra temp generated by the register allocator.
Review URL: https://codereview.chromium.org//12114008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18515 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-14 11:41:08 +00:00
srdjan@google.com
5694a140e3
Fix allocation of array tables (use store barrier if needed, store values directly instead of via stack).
...
Review URL: https://codereview.chromium.org//12212050
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18464 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-13 18:44:27 +00:00
vegorov@google.com
baa0347253
Reapply r18377 it was reverted due to the unrelated bug it surfaced.
...
Remove SminessPropagator and FlowGraphTypePropagator and all associated infrastructure and fields.
Replace multiple fields (result_cid_, propagated_cid_, propagated_type_, reaching_cid_) with a single field of type CompileType which represents an element of type analysis lattice and incorporates information about: value's nullability, concrete class id and abstract super type. This ensures that propagated cid and type are always in sync and complement each other
Implement a new FlowGraphPropagator that propagates types over the CompileType-lattice.
R=fschneider@google.com
Review URL: https://codereview.chromium.org//12260008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18456 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-13 17:16:35 +00:00
vegorov@google.com
487c73e01f
Revert "Remove SminessPropagator and FlowGraphTypePropagator and all associated infrastructure and fields."
...
This reverts commit r12365.
Reason: failure on vm-mac-debug (debug_ia32 standalone/io/file_fuzz_test).
TBR=fschneider@google.com
Review URL: https://codereview.chromium.org//12221139
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18378 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-12 12:36:21 +00:00
vegorov@google.com
f8d9a90b2c
Remove SminessPropagator and FlowGraphTypePropagator and all associated infrastructure and fields.
...
Replace multiple fields (result_cid_, propagated_cid_, propagated_type_, reaching_cid_) with a single field of type CompileType which represents an element of type analysis lattice and incorporates information about: value's nullability, concrete class id and abstract super type. This ensures that propagated cid and type are always in sync and complement each other
Implement a new FlowGraphPropagator that propagates types over the CompileType-lattice.
BUG=
Review URL: https://codereview.chromium.org//12221119
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18377 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-12 12:06:47 +00:00
fschneider@google.com
f29d1c7aa2
Optimize branches in polymorphic equality operations.
...
Review URL: https://codereview.chromium.org//12209057
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18256 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-08 15:47:09 +00:00
fschneider@google.com
f0caa40576
Add optimized loads from ExternalUint8ClampedArrays.
...
The generated code is exactly the same as for ExternalUint8Array.
TEST=tests/standalone/byte_array_test.dart
Review URL: https://codereview.chromium.org//12225049
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18183 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-06 19:00:50 +00:00
fschneider@google.com
7fc8f72c25
Inline getters of byte array view in the optimized flow graph.
...
This CL provides inline IL code for the getters _getInt8, _getInt16, etc.
to speed up [] and byte array views.
The code uses the existing LoadIndexed instructions by passing a index
scale factor explicitly: For normal arrays loads, the scale factor is equal
to the element size. For byte array access, the scale factor is always 1.
I'm adding inlined setters in a separate CL.
Review URL: https://codereview.chromium.org//12218008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18173 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-06 15:18:57 +00:00
srdjan@google.com
eaa1c974a3
Use SAR for divident by a power-of two constant divisor.
...
Review URL: https://codereview.chromium.org//12091100
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18075 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-04 20:29:58 +00:00
fschneider@google.com
2718b54625
Separate the array/string .length load from the bounds check.
...
This is done in preparation to inline more array and array view
operations.
Since the length is immutable for fixed length arrays, it allows
hoisting the load out of loops.
Review URL: https://codereview.chromium.org//12088108
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17984 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-01 15:10:24 +00:00
asiva@google.com
c2cafbbe33
- Change the layout of external typed array objects to avoid the extra indirection when accessing elements in the array.
...
- Change the Dart API which create these external arrays to account for this change
Review URL: https://codereview.chromium.org//12093071
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17937 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-31 18:53:21 +00:00
fschneider@google.com
dfda7854a8
Fix source position for stack traces with optimized top function.
...
Fix decoding of the deoptimization info when constructing a stack trace.
Fix stack trace for checked mode exceptions from optimized code.
BUG=dart:8058
TEST=runtime/tests/vm/dart/optimized_stacktrace_test.dart,
tests/language/stack_overflow_stacktrace_test.dart
Review URL: https://codereview.chromium.org//12049039
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17755 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-29 12:38:27 +00:00
vegorov@google.com
932a05420a
Reland r17365.
...
Introduce InvokeMathCFunction that can be used to directly invoke mathematical
function provided by runtime.
Use it to unconditionally inline _Double.pow.
Use it to inline floor, ceil, round, truncate, round when SSE4.1 is not
available.
Perform representation selection phase after constant propagation to minimize
boxing.
Add support for enter instruction in the x64 disassembler.
Add test for optimized pow and fix compilation on windows.
R=fschneider@google.com
BUG=dart:8002
Review URL: https://codereview.chromium.org//12038013
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17393 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-22 12:18:31 +00:00
vegorov@google.com
ab91977173
Revert "Introduce InvokeMathCFunction that can be used to directly invoke mathematical function provided by runtime."
...
This reverts commit r17365.
TBR=fschneider@google.com
Review URL: https://codereview.chromium.org//12042014
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17367 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-21 17:16:16 +00:00
vegorov@google.com
a20c8d28b8
Introduce InvokeMathCFunction that can be used to directly invoke mathematical function provided by runtime.
...
Use it to unconditionally inline _Double.pow.
Use it to inline floor, ceil, round, truncate, round when SSE4.1 is not available.
Perform representation selection phase after constant propagation to minimize boxing.
Add support for enter instruction in the x64 disassembler.
R=fschneider@google.com
BUG=dart:8002
Review URL: https://codereview.chromium.org//12050002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17365 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-21 16:59:37 +00:00
fschneider@google.com
64039d8ec3
Optimize loads and stores to Int32Array and Uint32Array.
...
Review URL: https://codereview.chromium.org//12041005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17362 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-21 16:19:42 +00:00
fschneider@google.com
03aa82a87f
Improve smi code for truncating division(~/) by using two fewer temp registers.
...
One temp was not used at all, the other can be replaced by a using a writable
input register.
Review URL: https://codereview.chromium.org//12043014
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17360 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-21 15:00:43 +00:00
vegorov@google.com
f6f7f1579e
Optimize double.floor and double.ceil down to roundsd when SSE4.1 is available.
...
R=fschneider@google.com
BUG=dart:7971
Review URL: https://codereview.chromium.org//11929021
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17278 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 14:28:25 +00:00
fschneider@google.com
657c4944c3
Remove StringCharCodeAtInstr and handle it as part of LoadIndexed.
...
Review URL: https://codereview.chromium.org//11970038
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17274 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 14:03:40 +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
fschneider@google.com
8c5b198d95
Optimized loads/stores for scalar list: Uint8Clamped, Int8, Int16, Uint16.
...
This CL adds optimized stores for Uint8ClampedList, and
loads+stores for Int8List, Int16List and Uint16List.
TEST=tests/standalone/byte_array_test.dart, tests/standalone/int_array_test.dart
Review URL: https://codereview.chromium.org//11967012
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17190 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-17 10:43:46 +00:00
fschneider@google.com
339ac7f288
Immediate index operand for string [] and streamline code for generating array ops.
...
Replace sizeof(RawArray) with Array::data_offset where it is used to compute the start
of the array data.
Refactor helpers for generating array addressing mode and use them for string []
operations as well.
Review URL: https://codereview.chromium.org//11880022
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17019 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-14 17:00:34 +00:00
fschneider@google.com
e0395cf4bb
Optimize stores to Uint8List.
...
Review URL: https://codereview.chromium.org//11855007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17014 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-14 10:27:28 +00:00
srdjan@google.com
40a7130741
Inline Doubles truncate and round.
...
Review URL: https://codereview.chromium.org//11573044
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16983 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-11 20:42:47 +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
fschneider@google.com
87a3a4b479
Support immediate and memory operands for PushArgumentInstr in optimized code.
...
If a value is a constant or stored on the stack this change avoids loading it into a
new register before pushing it.
Review URL: https://codereview.chromium.org//11791051
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16806 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-08 16:51:57 +00:00
srdjan@google.com
0af16251b5
Intrinsify Uint8ClampedArray's store and load indexed, inline load indexed.
...
Review URL: https://codereview.chromium.org//11783006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16666 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-05 01:07:32 +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
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
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
asiva@google.com
6749a3be79
Add read only handles for the following predefined symbols
...
"=="
"[]"
"[]="
"this"
and use them in the code.
Review URL: https://codereview.chromium.org//11519006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15942 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-11 01:20:02 +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
3a28c6ec9c
Add code comments to slow paths.
...
Review URL: https://codereview.chromium.org//11475042
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15868 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-07 21:45:37 +00:00
fschneider@google.com
26e054bbc4
Support loads from Uint8Array and ExternalUint8Array in the optimizing compiler.
...
This is done by extending LoadIndexed to handle Uint8Array and ExternalUint8Array.
Small cleanups:
- Share code for computing the element addresses for indexed loads.
- Remove kGrowableArrayCid where it cannot occur. We only ever emit
LoadIndexedInstr for fixed-size arrays. Loads from growable arrays
are split into loading the backing store first and then an indexed
load from the backing store.
Review URL: https://codereview.chromium.org//11411142
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15305 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-26 11:50:07 +00:00
fschneider@google.com
2693c71850
Inline [] operator on one-byte strings.
...
str[i] is translated into
temp = str.charCodeAt(i)
result = StringFromCharCode(temp);
The existing code for charCodeAt is reused and contains
the necessary range class id and range check.
Review URL: https://codereview.chromium.org//11416129
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15246 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-22 12:06:52 +00:00
fschneider@google.com
569322cec5
Improve SHR by using range information for the shift count.
...
Avoid emitting unnecessary range checks for the shift count
if the value is known to be positive and/or less than the
max shift count.
Review URL: https://codereview.chromium.org//11364222
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14864 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-13 20:00:47 +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
fschneider@google.com
8aa175b9e6
Restrict immediate operands to smi where only smis are supported.
...
Re-enable redundant phi elimination.
Add x64 codegen templates and assembler instructions for immediate operands.
Fix x64 assembler for imull when using r8-r15.
Add x64 instruction for imulq(reg, imm).
Fix x64 disassembler printing of immediates.
Review URL: https://codereview.chromium.org//11362210
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14814 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-12 22:44:34 +00:00
srdjan@google.com
dc8115e19a
Remove unused/not working function tracing flag and functionality.
...
Other small fixes, use stub to call optimization of a function (in preparation for reoptimization).
Review URL: https://codereview.chromium.org//11364184
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14756 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-09 20:55:31 +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
srdjan@google.com
32c54b3d60
Remove special meaning when usage counter reaches the threshold.
...
Review URL: https://codereview.chromium.org//11366076
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14540 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-05 17:07:06 +00:00
srdjan@google.com
078bc44a1d
Various little cleanups to avoid excessive allocation of handles.
...
Review URL: https://codereview.chromium.org//11358052
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14486 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-02 16:35:05 +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