fschneider@google.com
0a1d6d15f9
Fix bug in optimizing string .length loads.
...
We're not allowed to hoist a .length load if the corresponding
class-check is not also hoisted out of a loop.
TEST=tests/language/optimized_string_charcodeat_test.dart
Review URL: https://codereview.chromium.org//12256037
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18519 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-14 15:59:18 +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
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
kmillikin@google.com
ab3cbf5796
Change CSE, LICM, and range analysis to preserve use lists.
...
Change the common subexpression elimination, loop-invariant code
motion, and range analysis passes to maintain use lists.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18209 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-07 09:42:36 +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
8200c55ed9
Flip test condition when testing for fixed-length array length load.
...
This addresses additional comments to my previous CL:
https://codereview.chromium.org/12088108/
Review URL: https://codereview.chromium.org//12208046
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18175 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-06 16:21:51 +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
kmillikin@google.com
a518a0a36f
Add a use list iterator that allows mutation of current.
...
Add Value::Iterator that supports removing the current use from the
underlying use list, including deleting it or moving it to another use
list. Use it in range analysis and representation selection.
R=fschneider@google.com
Review URL: https://codereview.chromium.org//12178019
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18055 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-04 17:04:02 +00:00
kmillikin@google.com
361300cb71
Move recording of definition uses from the value to the definition.
...
It was weird that this method mutated an object that wasn't even
mentioned in the call. Also, change Definition::ReplaceUsesWith so that
it appends all at once instead of consing each individual use.
Review URL: https://codereview.chromium.org//12091091
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18048 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-04 14:01:35 +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
kmillikin@google.com
a2436038da
Make use lists into doubly-linked lists.
...
At the cost of a word per use, we gain constant time removal from use
lists.
BUG=
Review URL: https://codereview.chromium.org//12079096
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17924 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-31 16:10:15 +00:00
srdjan@google.com
64282183fe
Try to have constant on the right hand side for commutative Smi instructions.
...
Review URL: https://codereview.chromium.org//12096067
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17879 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-30 22:57:20 +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
3d1a139c4d
Fix double modulo bug by temporary disabling calling to C (fix and reenabling it will follow later). Added test.
...
Review URL: https://codereview.chromium.org//12077052
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17806 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-29 20:36:59 +00:00
fschneider@google.com
35bc3b674e
Widen the type of constant values handled by constant propagation.
...
The constant object has to be a smi or an old space heap object: Right
now, we can only embed old space objects into code.
Review URL: https://codereview.chromium.org//12096039
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17770 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-29 16:02:15 +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
srdjan@google.com
d3e5631456
Use builtin fmod for double modulo operation.
...
Review URL: https://codereview.chromium.org//12049056
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17514 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-24 00:06:16 +00:00
srdjan@google.com
76dffe600c
Removed loop depth info tracking at graph build time.
...
60% compilation speed improvement on pathological case. Improvements for dart2js
The loop depth signal was made unnecessary by the call frequency signal.
Review URL: https://codereview.chromium.org//11975061
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17408 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-22 16:15:54 +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
3e94e4a2fa
Fix bug in optimization in the presence of externalized strings.
...
The class-id of string objects can be changed via the Dart API. The optimizer
has to disable hoisting class-id checks across calls. For now, loop-invariant
code motion is disabled for checks of string class-ids.
Review URL: https://codereview.chromium.org//11867020
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17288 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 16:29:02 +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
4982f8ff33
Fix a bug with store-to-load forwarding for typed arrays.
...
Stores to typed arrays implicitly convert the value stored.
This CL disables store-to-load forwarding for these array stores.
Normal arrays and float64 arrays can be still optimized as before (no
conversion occurs on store)
TEST=tests/language/int_array_load_elimination_test.dart
Review URL: https://codereview.chromium.org//11962036
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17208 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-17 14:08:04 +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
vegorov@google.com
d11d988998
Set statically known ResultCid for AllocateObject.
...
Specialize PolymorphicInstanceCall in ApplyClassIds if receiver cid
was infered: filter out all but one target for attached ICData and drop
checks.
Canonicalize away CheckClass if reciever cid matches at least one in the list of checked.
R=fschneider@google.com
BUG=
Review URL: https://codereview.chromium.org//11886044
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17079 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-15 15:51:24 +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
kmillikin@google.com
0f65888e88
Change the inlining context from an enum to a class.
...
To support inlining in test contexts, the inlining context needs to have its
dispatched behavior and state. This change introduces a context class
representing calls inlined for their value or solely for their effects. The
intermediate array of exits is moved from the graph to the inlining context.
The implementation behavior is otherwise the same as before.
Review URL: https://codereview.chromium.org//11856010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16965 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-11 11:43:48 +00:00
fschneider@google.com
15432b2fee
Add canonicalize optimization for branches.
...
Comparisons where the result is only used in a branch on true
can be folded into the branch instruction.
Patterns like this can occur after inlining and constant propagation.
In normal code, we merge branches and comparisons already at graph
building time.
v3 <- (v1 == v2)
Branch if (v3 === true)
is optimized to
Branch if (v1 == v2)
Also: Remove outdated TODOs and rename the canonicalization pass to a
better name.
Review URL: https://codereview.chromium.org//11819031
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16919 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-10 13:18:31 +00:00
vegorov@google.com
f115552d29
Constant propagator should revisit phis when it visits predecessor block.
...
Phi's value depends both on its inputs and reachability of join's predecessors. Thus it is essential to revisit phi when predecessor becomes reachable.
R=kmillikin@google.com
BUG=
Review URL: https://codereview.chromium.org//11824024
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16847 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-09 12:27:46 +00:00
fschneider@google.com
d5f2305515
Support scalar lists in array bounds check elimination.
...
This allows to eliminate bounds checks for scalar lists in loops like:
for (var i=0; i < a.length; i++) {
a[i]
}
Review URL: https://codereview.chromium.org//11665005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16716 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-07 15:43:35 +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
regis@google.com
47e08870ca
Support Null type in Class::TypeTest and simplify Instance::IsInstanceOf.
...
Review URL: https://codereview.chromium.org//11785006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16664 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-05 00:45:52 +00:00
srdjan@google.com
5915aff811
Optimize instanceof: if all results are true and tests can be done using class only replace instanceof with a Boolean constant.
...
Review URL: https://codereview.chromium.org//11746024
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16648 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-04 21:29:05 +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
asiva@google.com
7ea520f10f
Create read only handles for empty_array and sentinel objects
...
(trying out a basic framework and will extend it to others once this
works).
Review URL: https://codereview.chromium.org//11648006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16416 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-21 02:33:05 +00:00
srdjan@google.com
324f1715bc
Mark final fields as immutable.
...
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16390 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-20 19:29:52 +00:00
vegorov@google.com
9a45691c76
When replacing one value with another ensure that replacement has SSA index assigned.
...
R=srdjan@google.com
BUG=dart:7513
Review URL: https://codereview.chromium.org//11638030
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16352 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-20 00:16:42 +00:00