Commit Graph

13143 Commits

Author SHA1 Message Date
kmillikin@google.com 87d743a3c5 Introduce Goto instructions to the flow graph.
Goto is a control instruction with a single successor.

Before: basic blocks ended with an exit (return, throw, or rethrow), a
branch to a pair of target entries, or else they fell through to the
next block entry.

Now: basic blocks end with an exit, a branch, or an explicit goto to a
join entry.

R=vegorov@google.com,srdjan@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10735071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9731 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-18 10:28:37 +00:00
hausner@google.com e3b118f88e Don't return private fields from imported libs
Fix for issue 4098 (dartbug.com/4098)
Review URL: https://chromiumcodereview.appspot.com//10783038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9722 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-17 21:18:44 +00:00
asiva@google.com f4e3396989 Address some leftover review comments from previous CL.
Review URL: https://chromiumcodereview.appspot.com//10792019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9721 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-17 21:16:08 +00:00
asiva@google.com 178f6739ae Minor changes based on the profile while running dart2js compile all.
Review URL: https://chromiumcodereview.appspot.com//10785007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9720 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-17 20:57:46 +00:00
srdjan@google.com c90763f160 Fix triggering of method optimization: increment counter at all IC calls and return as before but allow triggering of optimization only at exit of the method.
Review URL: https://chromiumcodereview.appspot.com//10779026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9710 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-17 16:35:45 +00:00
srdjan@google.com ea41dd5d7a Shorter code for simple type comparisons.
Review URL: https://chromiumcodereview.appspot.com//10787024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9687 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-16 23:07:11 +00:00
rmacnak@google.com 3d1c598ed5 Add a limited version of ParameterMirrors that can only tell whether they are
optional. Add Dart_FunctionParameterCounts. Drop passing isSimpleValue to
instance mirrors: they can compute this on the Dart-side.
Review URL: https://chromiumcodereview.appspot.com//10778005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9683 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-16 22:05:16 +00:00
regis@google.com b86a40f48f Fix type checking of void type.
Fix library and tests accordingly.
Add new test.
Disable new test for dart2js.
Disable some now failing co19 tests (new issue 158 filed).
Hide internal VM String types from user (not complete).
Review URL: https://chromiumcodereview.appspot.com//10787021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9681 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-16 21:34:07 +00:00
srdjan@google.com 00c3067049 Fix problem of excessive attempts to optimize, fix excessive deoptimizations for load/store indexed, performance issue with non-inlineable instance setter (direct call instead of IC call). Add tracing of issues encountered when attepting to optimize a method (--trace_failed_optimization_attempts), rename flag --print_stacktrace_at_throw.
Review URL: https://chromiumcodereview.appspot.com//10704210

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9680 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-16 20:55:09 +00:00
regis@google.com dc96874999 Revert fix for type checking of void type, because some top level tests fail.
Review URL: https://chromiumcodereview.appspot.com//10784020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9673 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-16 19:05:38 +00:00
regis@google.com a8ceb243f6 Fix type checking of void type.
Fix library and tests accordingly.
Add new test.
Disable new test for dart2js.
Disable some now failing co19 tests (new issue 158 filed).
Hide internal VM String types from user (not complete).
Review URL: https://chromiumcodereview.appspot.com//10704216

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9672 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-16 18:05:55 +00:00
cshapiro@google.com e964989681 Ensure objects emitted in code are allocated in old space.
BUG=3866

Review URL: https://chromiumcodereview.appspot.com//10786003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9649 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-13 23:23:45 +00:00
srdjan@google.com f5b544c948 Equality compare should record two arguments in IC data. Inline double equality comparison.
Review URL: https://chromiumcodereview.appspot.com//10702195

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9644 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-13 20:17:42 +00:00
turnidge@google.com e48dd76856 Some small changes to make the vm dart:mirrors somewhat closer to the
source mirror implementation by Johnni.

- Add the MirrorSystem interface
- Add a simple TypeMirror
Review URL: https://chromiumcodereview.appspot.com//10700149

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9612 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 20:40:06 +00:00
asiva@google.com ac914d3b8a Don't create a Bigint object first for every integer while parsing the sources, instead first check to see if it can be represented as a Smi or Mint. This avoids unnecessary creation of Bigint objects.
Review URL: https://chromiumcodereview.appspot.com//10703150

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9607 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 19:22:33 +00:00
srdjan@google.com b9aed1cd3c Implement the remaining methods in intrinsifier_x64.cc
Review URL: https://chromiumcodereview.appspot.com//10704192

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9605 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 19:10:50 +00:00
regis@google.com a7b85ecff8 Provide better error message when passing wrong number of arguments.
Review URL: https://chromiumcodereview.appspot.com//10695137

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9602 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 17:46:55 +00:00
srdjan@google.com 9b391ef9cf Add some missing x64 instruction variations.
Review URL: https://chromiumcodereview.appspot.com//10696183

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9578 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 00:41:45 +00:00
srdjan@google.com e74f5a721b Implement more intrinisification for x64 (not as inlined code but as header of the target).
Review URL: https://chromiumcodereview.appspot.com//10701147

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9573 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 22:37:41 +00:00
vegorov@google.com 1bd5a9b414 Skeleton of a linear scan register allocator.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10696151

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9563 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 18:52:17 +00:00
srdjan@google.com 94192b98a1 Use class id instead of class in subtype test cache.
Review URL: https://chromiumcodereview.appspot.com//10695136

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9559 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 18:16:30 +00:00
turnidge@google.com 9cbae35238 Don't allow OS::SNPrint or OS::VSNPrint to return negative values.
If we encounter conditions that would have caused vsnprintf to return
a negative value, then something pretty wild is going on.  We choose
to terminate the vm when this occurs.

This fixes security bug 1745.
Review URL: https://chromiumcodereview.appspot.com//10696165

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9558 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 17:54:24 +00:00
vegorov@google.com 1ae72fbd8b Change comparison-to-branch fusion to actually remove comparison from the graph.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10698153

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9556 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 17:41:54 +00:00
asiva@google.com 08c662b1c0 Represent tokens as a compressed stream instead of an array.
On x86:

Original sizes:
Size of isolate snapshot = 925655
New space (0k of 32768k) Old space (1700k of 1792k) Code space (0k of 0k)
out/ReleaseIA32/run_vm_tests --benchmarks
CorelibCompileAll(RunTime): 80944
CorelibIsolateStartup(RunTime): 5636
UseDartApi(RunTime): 404620
Dart2JSCompileAll(RunTime): 1379683
FrameLookup(RunTime): 45

Size with the new TokenStream implementation:
Size of isolate snapshot = 851352
New space (0k of 32768k) Old space (1368k of 1536k) Code space (0k of 0k)
out/ReleaseIA32/run_vm_tests --benchmarks
CorelibCompileAll(RunTime): 76918
CorelibIsolateStartup(RunTime): 4056
UseDartApi(RunTime): 502111
Dart2JSCompileAll(RunTime): 1251646
FrameLookup(RunTime): 45

(saves about 332k out of the original TokenStream size of 410k)

On x64:

Original sizes:
Size of isolate snapshot = 924865
New space (0k of 32768k) Old space (3234k of 3444k) Code space (0k of 0k)
out/ReleaseX64/run_vm_tests --benchmarks
CorelibCompileAll(RunTime): 109660
CorelibIsolateStartup(RunTime): 3985
UseDartApi(RunTime): 463009
Dart2JSCompileAll(RunTime): 2170309
FrameLookup(RunTime): 35

Size with the new TokenStream implementation:
Size of isolate snapshot = 849675
New space (0k of 32768k) Old space (2436k of 2560k) Code space (0k of 0k)
out/ReleaseX64/run_vm_tests --benchmarks
CorelibCompileAll(RunTime): 98716
CorelibIsolateStartup(RunTime): 2938
UseDartApi(RunTime): 509149
Dart2JSCompileAll(RunTime): 2042273
FrameLookup(RunTime): 39

(saves about 798k out of the original TokenStream size of 810k)

Token stats:
Number of tokens:   101470
  Literal tokens:   4550
    Ident tokens:   33020
Review URL: https://chromiumcodereview.appspot.com//10697055

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9539 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 00:11:58 +00:00
regis@google.com 1e055acce8 Stop passing location argument to run time calls, since it is stored in the pc
descriptor.
Various cleanups.
Review URL: https://chromiumcodereview.appspot.com//10701131

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9538 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 23:59:09 +00:00
asiva@google.com 8269202ff2 Add quotes around strings when generating source from the token stream.
Review URL: https://chromiumcodereview.appspot.com//10765017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9536 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 23:19:57 +00:00
asiva@google.com 7ba3fa9503 Invoke 'Scavenge' in the weak handle processing unit tests and not 'CollectGarbage' in order to avoid triggering of old space mark sweep in certain situations.
Review URL: https://chromiumcodereview.appspot.com//10748006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9535 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 23:03:07 +00:00
cshapiro@google.com 0928c651e5 Implement a 2-pass heap verification algorithm.
The previous algorithm would visit each pointer in the heap and verify it
without regard for whether the pointer had already been visited.

The new algorithm computes the set of allocated objects and verifies each
object in the set.  In a second pass, each pointer is visited and tested
for membership in the set.

BUG=2606

Review URL: https://chromiumcodereview.appspot.com//10696029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9532 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 22:07:40 +00:00
regis@google.com e6e70d7bb2 Allocate types in proper heap space.
Allow type finalization without canonicalization.
Review URL: https://chromiumcodereview.appspot.com//10696155

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9529 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 21:54:13 +00:00
srdjan@google.com f680c68a55 Cleanup usage of GrowableArrays in class Environment.
Review URL: https://chromiumcodereview.appspot.com//10692140

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9525 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 21:06:52 +00:00
srdjan@google.com b4e299e2c1 Improve code for checked instance calls (polymorphic calls) and expand printing of PolymorphicInstanceCall to include checked class names.
Review URL: https://chromiumcodereview.appspot.com//10698128

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9520 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 18:22:45 +00:00
srdjan@google.com 0273f70312 Intrinsify a couple of x64 methods (fix performance regression on Mandelbrot). Need to investigate Mandelbrot optimization next.
Review URL: https://chromiumcodereview.appspot.com//10753018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9495 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 01:09:32 +00:00
srdjan@google.com bfd52ec46a Rename Script's source to Source. Trace parser (--trace-parser) only if source is available (thus skipping all the 'noise' of bootstrap methods).
Review URL: https://chromiumcodereview.appspot.com//10752017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9494 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 00:14:25 +00:00
turnidge@google.com 22fb45f640 Implement method and variable reflection in dart:mirrors.
Review URL: https://chromiumcodereview.appspot.com//10687004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9493 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 23:57:08 +00:00
iposva@google.com dd800b6870 - On store buffer block overflow call a VM leaf function to
add the entries into the store buffer.
- Add a way to preserve and restore caller saved registers.
- Clean up the implementation of the stub for Assembler::Stop.
Review URL: https://chromiumcodereview.appspot.com//10758008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9490 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 22:58:27 +00:00
srdjan@google.com e801021a27 Cleanups.
Review URL: https://chromiumcodereview.appspot.com//10765007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9482 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 20:31:25 +00:00
regis@google.com 5919998308 Fix static type analysis of closure calls (issue 3959).
Add test.
Review URL: https://chromiumcodereview.appspot.com//10762003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9473 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 18:02:40 +00:00
regis@google.com 32c8564b0a Add --trace_type_check_elimination flag for debugging purposes.
Review URL: https://chromiumcodereview.appspot.com//10689099

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9471 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 16:59:15 +00:00
kmillikin@google.com ac0025ebd3 Use the instruction iterator rather than an explicit loop in more places.
R=vegorov@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10704119

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9467 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 12:58:36 +00:00
kmillikin@google.com 6bd463ee85 Rename the successor field of instruction to next.
Renaming only change to use a name parallel to 'previous'.

R=vegorov@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10693122

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9464 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 11:38:29 +00:00
fschneider@google.com a411bf5045 Add forward iterator to iterate instructions inside a basic block.
It is currently only used in SSA renaming.
Review URL: https://chromiumcodereview.appspot.com//10692107

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9438 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 12:31:37 +00:00
kmillikin@google.com 0b1f1323cd Remove the instruction pointer from computations.
Remove the back pointers from computations to instructions in favor of
passing the instruction explicitly when needed.

R=fschneider@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10700123

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9435 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 11:10:53 +00:00
kmillikin@google.com 5f541253ad Eliminate the type distinction between BindInstr and DoInstr.
Represent the distinction between computations whose value is used and
computations whose value is unused with a data member (instead of a
separate type).

R=fschneider@google.com,srdjan@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10700111

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9416 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-05 10:06:28 +00:00
kmillikin@google.com ca7e5a9972 Fix broken build.
TBR=fschneider@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10703088

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9408 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 13:48:26 +00:00
kmillikin@google.com 595aafa18e Simplify adding of computations to the flow graph.
In preparation for collapsing BindInstr/DoInstr and flattening
Computations into the Instruction hierarchy.

Add a pair of functions EffectGraphVisitor::Bind and
EffectGraphVisitor::Do for adding computations to the flow graph that
have respectively one and zero uses.  This creates a single site where
we construct new BindInstr and a single site where we construct new
DoInstr (also, a single site where we construct new UseVal during flow
graph construction).

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10702092

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9407 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 13:43:28 +00:00
fschneider@google.com 7de785eaf4 Remove unused code for StringConcatNode from the AST and the graph builder.
Review URL: https://chromiumcodereview.appspot.com//10693092

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9405 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 13:07:22 +00:00
fschneider@google.com 767b5d4439 Add support for fixed parameters in SSA builder and fix a bug in the pre-order graph traversal.
Each fixed parameter is initially defined by a ParameterInstr as definition. This
definition is not in the instruction stream, but just in the initial environment
at the graph entry so that the live range of all parameters start at the same point.

The pre-order spanning tree was computed in the wrong way which caused test failures
when building SSA because renaming relies on the dominator tree which depends on
the preorder spanning tree.

Also change the IL printing functions to be more compatible with the visualizer tool.
Review URL: https://chromiumcodereview.appspot.com//10735002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9391 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 10:24:19 +00:00
regis@google.com 09d3ecf285 Compile an instance setter call when a static getter is declared, but no field
or static setter are declared (issue 3941).
Add test.
Review URL: https://chromiumcodereview.appspot.com//10689083

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9376 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 20:40:02 +00:00
fschneider@google.com 3dcdc79ffe Add deoptimization environments to instructions.
Each instruction that can deoptimize need to have the values of the
non-optimizing code as uses. The values are stored in an environment
(GrowableArray<Value*>) attached to the instruction when constructing
SSA form.

For now every instructions gets a deoptimization environment. It contains
the values of all locals, parameters and expression stack elements at
the start of the instruction.

The environment is not used yet, but can be printed in the flow graph
with the flag --print-environments.
Review URL: https://chromiumcodereview.appspot.com//10696090

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9345 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 12:54:03 +00:00
vegorov@google.com 2935029239 Implement ActivationFrame::GetLocalVarValue on x64.
R=iposva@google.com
BUG=3961
TEST=Debug_ExprClosureBreakpoint

Review URL: https://chromiumcodereview.appspot.com//10702068

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9334 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 09:31:44 +00:00