Commit Graph

283 Commits

Author SHA1 Message Date
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
asiva@google.com 80e281a078 Fix for issues 6080 -
- Read the saved context from the entry frame when straddling across C++ frames while iterating over a stack trace in the debugger. This ensures that the correct context is setup in the ActivationFrame structure in these scenarios (instead of the empty context).

- Read the saved context from the caller's frame when iterating over a stack trace in the debugger. The compiler saves the context in the caller frame before invoking closures, we read this saved context when iterating the stack trace.
Review URL: https://codereview.chromium.org//12179020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18235 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-07 22:43:16 +00:00
asiva@google.com cd7b9395b6 Rename the accessor functions saved_context_var and set_saved_context_var to saved_entry_context_var and set_saved_entry_context_var so that it matches the local variable name used. This avoids confusing this with the saved_context_var variable which is used by try statements.
Review URL: https://codereview.chromium.org//12207023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18157 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-05 20:42:33 +00:00
srdjan@google.com 6392b0b9b2 Added result cids to some natives (byte array _new).
Review URL: https://codereview.chromium.org//12090010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17730 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-28 20:46:16 +00:00
kmillikin@google.com 27af144369 Move code around in preparation for better inlining.
To inlining calls in a test context, the code to plug the inlined
function graph into the caller graph should be dispatched on the type
of the inlining context.

This change moves code around without otherwise changing it.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17569 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-24 14:13:02 +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 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
srdjan@google.com 37a715bbbf Lookup functions by name that contains the private key, except for dart_api which allows ignoring the private key.
Review URL: https://codereview.chromium.org//11968022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17178 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-17 00:42:03 +00:00
hausner@google.com 245c0e2c3e Collect debugging info for catch clauses
Collect info about try-statement nesting, and a list of
handled types in each catch clause. This will be used by
the debugger to determine whether an exception is handled
by any handler on the stack.
Review URL: https://codereview.chromium.org//11883023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17100 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-15 22:43:00 +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
regis@google.com 34df344e36 Fix context chaining to prevent memory leak (issue 7681).
Review URL: https://codereview.chromium.org//11806003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16757 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-07 22:24:11 +00:00
vegorov@google.com 96812c4cff Recognize List.fixedLength factory constructor.
R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16717 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-07 15:44:23 +00:00
floitsch@google.com 4a7dfd2da3 Big merge from experimental to bleeding edge.
Review URL: https://codereview.chromium.org//11783009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16687 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-07 11:23:16 +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
regis@google.com cb27634842 Remove NoSuchMethodErrorImplementation class and use NoSuchMethodError from core
lib instead.
Review URL: https://codereview.chromium.org//11712002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16583 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-02 18:52:28 +00:00
tball@google.com 18e748d0b3 Implemented class literals in the VM.
Review URL: https://codereview.chromium.org//11633054

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16530 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-27 23:45:40 +00:00
regis@google.com d273efd45f Turn compile time errors related to missing getters and setters into invocation
of noSuchMethod or into throwing of NoSuchMethodError according to spec.
Return result of InvocationMirror.invokeOn to caller.
Fix various tests.
Review URL: https://codereview.chromium.org//11669015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16463 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-22 00:40:46 +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
kmillikin@google.com 2424252d6d Remove inadvertently duplicated code.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16040 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-12 14:20:42 +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
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
asiva@google.com d5f055b605 - Create frame work for adding read only handles for symbols in the VM isolate
- Make the symbol corresponding to "." use this frame work and change code
  which was creating a handle to use the read only handle instead.
  (Once we agree on this frame work we could create similar read only handles
   for the frequently used symbols)
Review URL: https://codereview.chromium.org//11469036

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15920 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-10 18:24:34 +00:00
asiva@google.com 3b5f530a44 Rename the field type_arguments_instance_field_offset_ to
type_arguments_field_offset_ in preparation for calling it
type_arguments_field_offset_in_words_
Review URL: https://codereview.chromium.org//11316203

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15431 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-28 01:36:04 +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
ajohnsen@google.com 0f367f8894 Make List an abstract class.
This was the last interface in dart:core.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15240 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-22 07:40:52 +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
fschneider@google.com 59a1f747f4 Enable inlining of functions containing instance-of.
The corresponding issues have been fixed and all tests pass now.

BUG=dart:5216,dart:5217
Review URL: https://codereview.chromium.org//11369230

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14872 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-13 23:45:23 +00:00
regis@google.com ebc3402925 Create symbols for string constants.
Review URL: https://codereview.chromium.org//11360231

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14866 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-13 21:05:55 +00:00
regis@google.com 7614e956dc Check result type of redirecting factory in checked mode.
Review URL: https://codereview.chromium.org//11369219

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14862 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-13 19:02:08 +00:00
asiva@google.com 2e21fbd3ee Fix for issue 6623 - Canonicalize implicit static closure objects.
Review URL: https://codereview.chromium.org//11359151

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14802 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-12 19:02:44 +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
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 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 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
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
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
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
fschneider@google.com 113e753734 Enable merging of comparisons into branches in checked mode.
Instead of inserting an explicit type check at branches, the
branch instruction checks the input for boolean itself:

"if (a < b)" will be translated by the flowgraph builder
like this:

  CheckedBranch(a < b)

before it would look like this:

  t1 <- (a < b)
  t2 <- AssertBool(t1)
  Branch(t2 === true)


Also in this change:
flow_graph_optimizer.cc contains a small fix of an assert triggered when running with --trace-optimization.
Review URL: https://codereview.chromium.org//11232063

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14006 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-24 10:44:00 +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 9eea0fc253 Convert 'identical' to strict equal.
Review URL: https://codereview.chromium.org//11234047

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13973 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-23 16:13:33 +00:00
hausner@google.com 384115d235 Remove built-in identifier 'negate' from VM
Keep the token kNEGATE for the backend to distinguish between
unary and binary - operator.
Review URL: https://codereview.chromium.org//11199002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13700 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-16 20:19:06 +00:00
hausner@google.com 1811a6b913 Support for type dynamic in VM
Old name Dynamic is supported, and automatically converted to
lower-case dynamic when parsed.

VM flag --warn_legacy_dynamic prints warnings when Dynamic
is found.
Review URL: https://codereview.chromium.org//11125005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13637 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-12 22:40:24 +00:00
regis@google.com 1b8e614d7d Change compile-time errors into dynamic errors in instance creation expression
(issue 3085).
Change compile-time errors into dynamic errors in static getter and setter
calls (issues 3088, 3094).
Fix a crash in flow graph builder for missing static getter (issue 4360).
Add support in VM for NoSuchMethodError.
Remove support in VM for StaticResolutionException.
Add, remove, update related language tests.
Triage related co19 tests.
Review URL: https://codereview.chromium.org//11049038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13208 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-04 00:15:38 +00:00
zerny@google.com 3ae0b96762 Set previous instruction pointers when building the graph.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13174 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-03 15:05:27 +00:00