Commit Graph

13143 Commits

Author SHA1 Message Date
srdjan@google.com a559ebbc68 Inline checks for super class and interfaces (checked mdoe improvements).
Review URL: https://chromiumcodereview.appspot.com//9863043

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5898 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-27 19:40:08 +00:00
srdjan@google.com 3206b2446f Restructure type checks in ObjectArray []= to accept any value if parameterized type is Dynamic.
Review URL: https://chromiumcodereview.appspot.com//9860019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5889 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-27 17:35:45 +00:00
floitsch@google.com d50d890578 Remove redundant assert.
There could be two reasons that this test fails:
1. The uint64-to-double conversion fails at runtime.
2. The windows-compiler rounds the wrong way.

This CL assumes 2.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5864 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-27 05:28:13 +00:00
floitsch@google.com 617cf9e7c7 Implement correct bigint to double conversion.
Review URL: https://chromiumcodereview.appspot.com//9540015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5863 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-27 05:08:50 +00:00
srdjan@google.com 756b3f9535 Fortgot the changes as requested by Regis.
Review URL: https://chromiumcodereview.appspot.com//9836097

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5859 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-26 22:55:08 +00:00
srdjan@google.com 6a397bdba2 Run intrinsified version of ObjectArray[]= even in checked mode (inline value type check for null and Smi values).
Review URL: https://chromiumcodereview.appspot.com//9865004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5858 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-26 22:35:01 +00:00
srdjan@google.com f1bad6571d Improve checked mode a little (more to come in a different CL).
Review URL: https://chromiumcodereview.appspot.com//9854030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5847 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-26 18:23:37 +00:00
regis@google.com 8ba77ffb83 Do not share local function between closurized and non-closurized enclosing
function.
Add test (thanks to Florian for reporting the issue).
Review URL: https://chromiumcodereview.appspot.com//9835070

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5843 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-26 16:59:37 +00:00
hausner@google.com 356870a3c8 Stop ignoring compilation errors on compile_all
When compiling all code, stop compiling after the first error.
Previously, we ignored compilation errors.

This was a feature wish so we can detect errors in libraries.
In fact, there are errors in the library, e.g. references
to non-existing top-level functions in utf16 code. And possibly
others. If this code gets checked in, any tests that depends on
--compile_all will break.

First problem:

'dart:utf': Error: line 607 pos 7: identifier 'is16BitCodeUnit' is not declared in this scope
  if (is16BitCodeUnit()) {
      ^

If I hack that, the next one is:

'dart:utf': Error: line 613 pos 9: identifier 'utf16CodeUnitsToCodepoints' is not declared in this scope
        utf16CodeUnitsToCodepoints(codeunits, 0, null, replacementCodepoint));
        ^

Didn't investigate any more than that...
Review URL: https://chromiumcodereview.appspot.com//9836064

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5835 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-26 15:51:25 +00:00
asiva@google.com 007764149f Update comment describing the length field in class Bigint.
Review URL: https://chromiumcodereview.appspot.com//9839087

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5803 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-24 02:56:26 +00:00
asiva@google.com d0d0cec4fc Fix for issue 2233
- Fixed the bigint instance allocation path when full snapshots are read.

- JSRegExp objects are only serialized/deserialized in a message snapshot and
hence do not need that special path. There is an assertion in JSRegExp to
ensure that these objects are not part of a full snapshot.
Review URL: https://chromiumcodereview.appspot.com//9835074

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5802 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-24 02:42:56 +00:00
srdjan@google.com 86472e6dfd Add contexts.
Review URL: https://chromiumcodereview.appspot.com//9726024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5793 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-23 21:26:34 +00:00
asiva@google.com e360e4d1c9 Second set of changes for implementation of stack map support.
- Added functionality to be able to build stack maps in the compiler and register them into the Code object during Code finalization.
- Merged code_generator_ia32_test.cc and code_generator_x64_test.cc into code_generator_test.cc as the two files were identical.
Review URL: https://chromiumcodereview.appspot.com//9721006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5764 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-23 01:27:35 +00:00
kmillikin@google.com be9bc9c068 Compute immediate dominators using SEMI-NCA.
This is a version of the Lengauer-Tarjan algorithm that is both simpler and
faster.

R=srdjan@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5737 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-21 23:45:20 +00:00
hausner@google.com 48bafb9900 Fix use-after-free bug in debugger
This was the cause for crashes on Linux.
Review URL: https://chromiumcodereview.appspot.com//9726017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5668 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-19 23:35:30 +00:00
regis@google.com 18bd10e96a Implement StaticGetter and StaticSetter in new compiler.
Review URL: https://chromiumcodereview.appspot.com//9726011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5664 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-19 23:09:06 +00:00
kmillikin@google.com df6881a022 Do not use recursion for depth-first traversal of straight line code.
For straight-line sequences of intermediate instructions, use iteration in
the depth-first search implementation.

R=srdjan@google.com
BUG=
TEST=vm/CodeIndexTable should pass on x64

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5660 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-19 21:57:06 +00:00
kmillikin@google.com 7c43fbb9a3 Make the CFG depth-first traversal do more work for us.
Turn the depth-first traversal into a pass to discover the graph's basic
block structure.  Record basic-block predecessors in the block entry
instructions.  Also record the last instruction in a block in the block
entry instruction (giving constant-time access to the block's successors).

Also, record the depth-first spanning tree of the traversal to be used for
dominator computation.

R=srdjan@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5655 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-19 19:39:14 +00:00
regis@google.com bb20585e0f Use a local variable to save/restore the context on entry/exit, instead of
explicitly pushing/popping.
Review URL: https://chromiumcodereview.appspot.com//9721004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5649 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-19 17:02:40 +00:00
srdjan@google.com 1f072a6171 Remove possibility of critical edges.
Review URL: https://chromiumcodereview.appspot.com//9722009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5601 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-16 23:06:39 +00:00
kmillikin@google.com 7539e7f989 Make required changes to {ia32,arm} stubbed graph code generator.
The function signature was changed and the platform-independent caller, but
not the platform-specific stub implementations.

TBR=srdjan@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5600 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-16 22:36:20 +00:00
hausner@google.com feafdf0e06 Properly recognize closures when setting breakpoints
Local functions and function literals are unknown to the VM
until the enclosing function is compiled. This change introduces
a list of known closures per class, and a function to look up
the innermost closure at a given token index.

The debugger now checks whether there are newly discovered
closures when a function containing a pending breakpoint is
compiled. If necessary, the breakpoint is set to the inner
function.
Review URL: https://chromiumcodereview.appspot.com//9716004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5599 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-16 22:28:57 +00:00
kmillikin@google.com 6653fd66eb Compute preorder as well as postorder basic block orderings.
The Lengauer-Tarjan dominator/dominance frontier algorithm needs to
visit the blocks in reverse preorder (in the first pass) and preorder
(in the second).  Compute that at the same time as postorder (e.g.,
using the same spanning tree).

Take this chance to make the flow graph visitors always operate on a
forward block ordering.

R=srdjan@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5598 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-16 22:20:04 +00:00
hausner@google.com ad939b2035 Remove warning for illegal parameter names
Review URL: https://chromiumcodereview.appspot.com//9704094

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5573 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-16 16:17:23 +00:00
srdjan@google.com d4dcb9fee0 Clean-up CodeGenState: remove unused loop_level and move context_level to CodeGenerator (and add it to FlowGraphBuilder).
Review URL: https://chromiumcodereview.appspot.com//9706086

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5571 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-16 15:38:43 +00:00
asiva@google.com 9ca9e8fbd4 Fix for issue 2124 - Dart VM crashes on windows
The Array::MakeArray was incorrectly accessing the class_ field before it was initialized.
Review URL: https://chromiumcodereview.appspot.com//9700079

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5552 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-16 03:58:06 +00:00
kmillikin@google.com 6e7fa43e58 Simplify translation of conditionals in the flow graph builder.
Allow the builder to assume that, if control flow reaches a conditional
expresion, there is always control flow to two branches.

R=srdjan@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5546 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-15 21:52:27 +00:00
srdjan@google.com b9ba050c9c Make Throw and ReThrow instructions instead of computations. That way they can terminate a basic block.
Review URL: https://chromiumcodereview.appspot.com//9699090

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5539 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-15 20:42:01 +00:00
regis@google.com 9827cdc826 Split the computation of uninstantiated type arguments between the factory case
and the constructor case, as suggested in my review of
https://chromiumcodereview.appspot.com/9700003/

Examples of generated IL (first factory, second non-factory).

 foo() { return new List<T>(); }
 moo() { return new A<T>(); }

==== file:///home/regis/test.dart_A_foo
 0: [target]
    t0 <- LoadLocal(this)
    t0 <- NativeLoadField(t0, 16)
    t0 <- ExtractFactoryTypeArguments(t0)
    t0 <- StaticCall(List., t0)
    return t0
==== file:///home/regis/test.dart_A_moo
 0: [target]
    t0 <- #null
    t1 <- LoadLocal(this)
    t1 <- NativeLoadField(t1, 16)
    t2 <- Pick(t1)
    t2 <- ExtractConstructorTypeArguments(t2)
    t0 := t2
    t1 <- ExtractConstructorInstantiator(t1, t2)
    t0 <- AllocateObject(Library:'file:///home/regis/test.dart' Class: A, t0, t1)
    t1 <- Pick(t0)
    t2 <- #3
    StaticCall(A., t1, t2)
    return t0

This change removes the computation that previously returned two values at the
cost of a some small code duplication. We could address this duplication by
exposing the computation recognizing the identity vector at the IL level and
implement a branch.
Review URL: https://chromiumcodereview.appspot.com//9703080

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5537 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-15 20:16:29 +00:00
srdjan@google.com 0832db6261 Fix 2172: report 'int' instead of Smi, Mint and Bigint when throwing TypeError.
Review URL: https://chromiumcodereview.appspot.com//9705041

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5525 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-15 15:54:59 +00:00
iposva@google.com 0b1b94c9e3 - Proper inclusion of gypi files, so that they do not override
existing build flags.
Review URL: https://chromiumcodereview.appspot.com//9701054

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5505 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-15 01:07:15 +00:00
asiva@google.com 0086ec20b0 Fix build break.
TBR=srdjan.
Review URL: https://chromiumcodereview.appspot.com//9703047

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5503 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-15 00:42:45 +00:00
asiva@google.com f120af8463 First step towards implementing stack map descriptions for the optimizing compiler.
Add a RawBitmap object and a bitmap builder.
Review URL: https://chromiumcodereview.appspot.com//9701010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5502 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-15 00:18:05 +00:00
hausner@google.com 0a668f551c Now that it works, make it nice.
INT_MAX is almost as good as INTPTR_MAX, and it has the benefit
that it works on all platforms.

TBR=srdjan
Review URL: https://chromiumcodereview.appspot.com//9704044

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5501 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 23:49:22 +00:00
hausner@google.com 6a576fbf79 More fixing
Review URL: https://chromiumcodereview.appspot.com//9701049

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5500 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 23:37:17 +00:00
hausner@google.com d55f4fb816 If at first you don't succeed...
...give up.
Review URL: https://chromiumcodereview.appspot.com//9699055

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5499 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 23:25:14 +00:00
hausner@google.com f04c722086 Fix breakpoint location
The debugger code erroneously assumed that PC descriptors are
sorted by ascending token_index. That is not the case. This change
fixes the translation from token index to pc descriptor index.
Review URL: https://chromiumcodereview.appspot.com//9706038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5496 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 23:10:35 +00:00
srdjan@google.com fdb793e189 Add Throw and ReThrow nodes. Rethrow not yet tested (bailout with untested), since it needs the try/catch implementation. Discuss if Throw/ReThrow shoudl be computations or instructions. We have one case in parser where throw is added into the expression tree.
I suggest introducing an EndInstr that has no successor and use it for throw and return. (TODO: Discuss and chnage if necessary). Currently we generate code even after the throw.
Review URL: https://chromiumcodereview.appspot.com//9706032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5490 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 21:47:43 +00:00
turnidge@google.com 5f3f461557 Fix failing test on windows. I was accessing a stat too early.
Review URL: https://chromiumcodereview.appspot.com//9706033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5487 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 21:19:03 +00:00
turnidge@google.com d1ed3d8850 Another fix for non-mac build:
../runtime/platform/assert.h: In member function ‘void dart::DynamicAssertionHelper::Equals(const E&, const A&) [with E = int, A = uint64_t]’:
../runtime/vm/thread_pool_test.cc:64:   instantiated from here
../runtime/platform/assert.h:98: error: comparison between signed and unsigned integer expressions
Review URL: https://chromiumcodereview.appspot.com//9704037

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5486 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 21:10:33 +00:00
turnidge@google.com be59121e8f Fix wrong initializer order -- not caught on mac build because mac
warnings are busted right now.
Review URL: https://chromiumcodereview.appspot.com//9700039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5485 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 21:04:14 +00:00
turnidge@google.com e420a07ee3 Implement ThreadPool.
Review URL: https://chromiumcodereview.appspot.com//9581039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5484 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 21:00:45 +00:00
srdjan@google.com daa7217127 Implement more of allocation code using type arguments. Type argument extraction for non-factories produces two results, however, instructions can produce only one temporary. Use a stack placeholder so that we have room to push two results. Examples of generated IL (first factory, second non-factory).
foo() { return new List<T>(); }
  moo() { return new A<T>(); }

==== file:///sources/dartall/dart/runtime/Test.dart_A_foo
 0: [target]
    t1 <- LoadLocal(this)
    t1 <- NativeLoadField(t1, 16)
    t1 <- ExtractTypeArguments(t1)
    t0 <- StaticCall(List., t0)
    return t0
==== file:///sources/dartall/dart/runtime/Test.dart_A_moo
 0: [target]
    t0 <- #null
    t1 <- LoadLocal(this)
    t1 <- NativeLoadField(t1, 16)
    t1 <- ExtractTypeArguments(t1)
    t0 <- AllocateObject(Library:'file:///sources/dartall/dart/runtime/Test.dart' Class: A, t0, t1)
    t1 <- Pick(t0)
    t2 <- #3
    StaticCall(A., t1, t2)
    return t0
Review URL: https://chromiumcodereview.appspot.com//9700003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5480 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 18:51:47 +00:00
hausner@google.com 6ac08888fe Compiler warning on named optional params that start with '_'
Temporary change so Dartium can can fix their source. Then convert
the warning to an error message as in change 5444.

TBR=vsm
Review URL: https://chromiumcodereview.appspot.com//9702010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5450 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 00:41:40 +00:00
hausner@google.com 63b525bb0e Revert change 5444
Review URL: https://chromiumcodereview.appspot.com//9703004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5448 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 00:35:16 +00:00
regis@google.com 0e5fd9b99c Do not chain the current context on entry in non-closure functions, but
save and restore it on the stack instead, and chain a null context (issue 1613).
Review URL: https://chromiumcodereview.appspot.com//9705004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5446 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 00:16:22 +00:00
cshapiro@google.com f4c5dd4db3 Implement prologue weak persistent handles.
Prologue weak persistent handles are similar to weak persistent
handles but exhibit different behavior during garbage collections that
invoke the prologue and epilogue callbacks.  While weak persistent
handles always weakly reference their referents, prologue weak
persistent handles weakly reference their referents only during a
garbage collection occurs that invokes the prologue and epilogue
callbacks.  During all other garbage collections, prologue weak
persistent handles strongly reference their referents.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5445 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 23:41:59 +00:00
hausner@google.com a995d60106 named optional parameters must not be private
Named optional parameters may not start with an underscore '_'.

Fix issue 434 (http://code.google.com/p/dart/issues/detail?id=434)
Review URL: https://chromiumcodereview.appspot.com//9701001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5444 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 23:24:37 +00:00
turnidge@google.com 24de28fb0f Fix unused var warning.
Review URL: https://chromiumcodereview.appspot.com//9693062

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5442 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 22:08:51 +00:00
turnidge@google.com e61a02c10d Implement spawnFunction from the new isolate api.
Still need to implement spawnUri, which will be the more difficult one.
Review URL: https://chromiumcodereview.appspot.com//9691005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5441 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 22:05:08 +00:00