Commit Graph

176 Commits

Author SHA1 Message Date
srdjan@google.com 4f285ac0a8 Add flag to block optimizations of large implicit getters. Implicit getters have a 0 size in tokens, therefore also check the size of unoptimized code to decide if a function is optimizable. Print more data with --trace-compiler.
Review URL: https://codereview.chromium.org//12263017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18485 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-13 21:52:02 +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
asiva@google.com f4fe42c280 Added macros OBJECT_IMPLEMENTATION and FINAL_OBJECT_IMPLEMENTATION
which have different implementations of 'operator=' and 'operator^='.
In the case of FINAL_OBJECT_IMPLEMENTATION we do not do the vtable setting
in these methods (Note the |= operator functionality is now subsumed into
the new implementation of "operator^=")
Review URL: https://codereview.chromium.org//12052033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17491 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-23 20:01:31 +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
srdjan@google.com d56766f251 More ^= to |=
Review URL: https://codereview.chromium.org//11941021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17308 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 19:43:19 +00:00
vegorov@google.com c2776cdbcc Canonicalize away redundant checks that appear after store-to-load forwarding.
BUG=dart:7513

Review URL: https://codereview.chromium.org//11885017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17016 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-14 12:15:11 +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
srdjan@google.com 6cbaf5b800 Increase deoptimization counter threshold to 16, cleanups.
Review URL: https://codereview.chromium.org//11823070

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16945 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-11 00:43:56 +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
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
vegorov@google.com 114fd4280c Do ComputeUseLists after ApplyClassIds.
Applying class ids invalidates use lists.

R=fschneider@google.com
BUG=

Review URL: https://codereview.chromium.org//11791024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16731 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-07 17:06:50 +00:00
asiva@google.com 0a825a9ed7 Cleanup handles more efficiently, ensures we don't have to iterate over them
while visiting objects during GC.
- Add handle scopes during class finialization
- Add handle scopes to different stages of the compiler
- Ensure that we iterate only to the top of scoped handles while visiting objects
Review URL: https://codereview.chromium.org//11778013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16683 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-07 05:44:20 +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
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
vegorov@google.com 1ee5f51793 Improve redundant load elimination.
Previously it incorrectly computed OUT sets during the fix point iteration: did not propagate changed from IN to OUT.

However just computing bitset representation of IN set was actually not enough because different values might be coming in from different predecessors.

This algorithm inserts phis at merge points.

R=fschneider@google.com
BUG=

Review URL: https://codereview.chromium.org//11505002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16109 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-13 14:10:38 +00:00
asiva@google.com b9bff21042 Start a fresh zone and handle scope for each function being compiled
in CompileAll (currently handles and memory is not being released
until all the functions are compiled).
Review URL: https://codereview.chromium.org//11280315

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15941 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-11 01:06:44 +00:00
regis@google.com 91ad9a0180 Remove support for interfaces.
For now, disable tests using obsolete syntax.
Tests disabled in this cl and in previous ones removing default factory classes
will either be deleted or updated in a later cl.
Review URL: https://codereview.chromium.org//11411271

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15562 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-30 01:26:31 +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
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
regis@google.com 1d760bc36b Never compile a redirecting factory (issue 6697).
Review URL: https://codereview.chromium.org//11377164

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14905 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-14 17:33:50 +00:00
srdjan@google.com 2fdbeb2153 Make sure that ParsedFunction holds onto zone handles.
Review URL: https://codereview.chromium.org//11364166

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14718 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-09 00:58:21 +00:00
srdjan@google.com 80a4b76c81 Fixed disabling inlining of static calls that were not executed.
Review URL: https://codereview.chromium.org//11275180

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14611 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-07 01:34:50 +00:00
srdjan@google.com 9a4e7b073b Do not inline static calls that have not been executed in unoptimized code: the inlined function does not have type feedback that takes that call's arguments into account. As a side effect, it fixes a crash in smi-equality.
Review URL: https://codereview.chromium.org//11312105

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14605 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-06 23:47:19 +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
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
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
srdjan@google.com 9c4cb91442 Trace when disabling optimized code (--trace-disabling-optimized-code)
Review URL: https://codereview.chromium.org//11282003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14036 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-24 20:38:53 +00:00
zerny@google.com 8459bad004 Inlining of calls with optional parameters.
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//11028140

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13999 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-24 08:22:11 +00:00
srdjan@google.com b794eea01a Print time when tracing compiler.
Review URL: https://codereview.chromium.org//11251002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13985 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-23 20:56:51 +00:00
zerny@google.com 0bc2e84cb3 Restructure code generation timers and add sub-timers for inlining phases.
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//11236063

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13927 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-23 08:14:59 +00:00
zerny@google.com 8e36c2f3cc Cache parsed functions when inlining.
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//11228022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13882 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-22 15:13:32 +00:00
fschneider@google.com 89cab1577b Enable redundancy elimination for array loads.
This CL also adds a second round of CSE if necessary to make use
 of secondary effects for more optimization opportunities.
Review URL: https://codereview.chromium.org//11234002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13859 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-22 10:40:19 +00:00
srdjan@google.com 03a61f332c Apply optimization after class-id propagation: instance calls without ICData are optimized by using input argument class-ids to create fake ICData. This reduces the number of deoptimizations.
Review URL: https://codereview.chromium.org//11187046

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13798 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-18 20:41:58 +00:00
fschneider@google.com 54ea76dc6b Remove support for optimized dart leaf functions.
This optimization does not bring any benefit since all functions
have at least a call in the slow-path of the stack-overflow check.

I'm suggesting to remove support for this optimization since it
does not get triggered currently, therefore is also not tested.
Plus we have inlining now, which already makes calls to (small 
enough) leaf functions fast.
Review URL: https://codereview.chromium.org//11086044

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13555 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-11 16:35:47 +00:00
fschneider@google.com 667b0d5185 Mark optimized functions with a * in the perf event symbol output.
This allows to distinguish time spent in optimized code vs unoptimized code
in our profile information.
Review URL: https://codereview.chromium.org//11028143

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13547 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-11 15:07:49 +00:00
fschneider@google.com 5113b2411a Remove support for generating visualizer format file for the flowgraph.
Review URL: https://codereview.chromium.org//11099061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13536 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-11 12:25:55 +00:00
zerny@google.com 5200dfb8b1 Remove slow assert from VM.
Replaced slow-asserts with verify-compiler and removed vm/assert.h

R=srdjan@google.com
BUG=5720

Review URL: https://codereview.chromium.org//11017027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13456 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-10 08:03:28 +00:00
kmillikin@google.com 8a6dd23f3c Run canonicalization again after constant propagation.
This eliminates smi checks of constant-valued instructions.  Also fix
printing of block numbers in code comments.

R=fschneider@google.com
BUG=

Review URL: https://codereview.chromium.org//10989077

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13170 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-03 11:09:19 +00:00
zerny@google.com 792a5cbcee Added slow_assert macro and flag for slow development assertions in the VM.
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//11014013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13069 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-01 14:27:45 +00:00
kmillikin@google.com d7115e5eda Remove deoptimization index PC descriptors.
Put the PC (offset) of the deoptimization point and the deoptimization
reason in the DeoptInfo table.  The table entries are now triples of
(PC offset, info, reason).

R=srdjan@google.com
BUG=

Review URL: https://codereview.chromium.org//10982088

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13056 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-01 10:16:22 +00:00
zerny@google.com 7c03f02086 Fix error in r12771 disabling licm.
R=fschneider@google.com

Review URL: https://codereview.chromium.org//10990031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12849 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 16:41:51 +00:00
vegorov@google.com 6560f5c84b Fix convergence issues in range analysis.
Split it into three phases: initialization, widening and narrowing.

During widening and narrowing phi-ranges change according to classical widening and narrowing operators defined as:

Widening:
  [_|_, _|_] v [a, b] = [a, b]
  [a, b] v [c, d] = [c < a ? -inf : a, d > b ? +inf : b]

Narrowing:
  [a, b] ^ [c, d] = [(a == -inf) ? c : min(a, c), (b == +inf) ? d : max(b, d)]

R=fschneider@google.com

Review URL: https://codereview.chromium.org//10972003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12772 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 12:00:19 +00:00
zerny@google.com b4ccb26cb6 Disable loop invariant code motion on deoptimized functions.
R=fschneider@google.com

Review URL: https://codereview.chromium.org//10974005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12771 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 11:28:51 +00:00