Commit Graph

15405 Commits

Author SHA1 Message Date
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
whesse@google.com 3b7099b7e2 Change lookup path for Dart native extensions shared libraries.
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5524 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-15 15:49:57 +00:00
ager@google.com 357588d0c9 Change quoting in Process implementation on Windows.
Only quote command and arguments if they contain a space or a tab.
This seems consistent with the way it is handled in other systems.

R=antonm@google.com,sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5522 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-15 15:33:06 +00:00
whesse@google.com d51bb2b427 Fix some minor static type issues in dart:io implementation.
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5514 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-15 09:34:51 +00:00
vsm@google.com 6d22763a88 Define DEBUG for Chrome Debug config
Review URL: https://chromiumcodereview.appspot.com//9702063

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5510 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-15 05:22:41 +00:00
iposva@google.com a7cb125488 - source_filter.gypi needs to be available somewhere in the
Dart builds. The Dart deps files include it manually, but
  it appears to be missing from Dartium builds.
Review URL: https://chromiumcodereview.appspot.com//9705051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5509 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-15 04:37:15 +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 78f6ca09cd Try fixing the linux and windows builds.
Review URL: https://chromiumcodereview.appspot.com//9706041

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5497 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 23:20:49 +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
cshapiro@google.com aae5faf7b1 Implement regular expression support for split and replace{First,All}.
BUG=429

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5491 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 22:09:52 +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
ager@google.com c96189c6a9 Wrap all arguments passed to processes in "" on Windows.
I'm not 100% sure that this is what we want. I'll dig into
what other systems are doing tomorrow.

This could make the test scripts work on Windows for Dartium.

Updated windows test binary as well.

R=antonm@google.com,sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5472 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 16:50:16 +00:00
ajohnsen@google.com 94490e2e2a Close connections on server.close(), and call onError on early connection close.
Review URL: https://chromiumcodereview.appspot.com//9700012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5452 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 11:24:50 +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 b71faf4528 Fix bogus mistake in get:_port().
Review URL: https://chromiumcodereview.appspot.com//9691063

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5443 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 22:22:21 +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
hausner@google.com 09b97fefd4 Address Ivan's review comments.
Review URL: https://chromiumcodereview.appspot.com//9696048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5438 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 21:07:42 +00:00
hausner@google.com 9655e2af7d Add type checking to some native function arguments
Review URL: https://chromiumcodereview.appspot.com//9693051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5437 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 20:53:37 +00:00
hausner@google.com cd6e29a898 Deoptimize functions before setting breakpoints
Does not yet handle cases where the functions have active frames
on the stack.
Review URL: https://chromiumcodereview.appspot.com//9696020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5436 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 20:37:49 +00:00
turnidge@google.com 4547323b63 Fix unused vars warning.
Review URL: https://chromiumcodereview.appspot.com//9692061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5435 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 20:36:56 +00:00
turnidge@google.com 3d363b570f Add Dart_Invoke, which will replace Dart_InvokeDynamic and Dart_InvokeStatic.
Fixed Dart_SetField to allow us to set a field to null.
Review URL: https://chromiumcodereview.appspot.com//9608024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5433 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 19:49:48 +00:00
iposva@google.com cd8cdc5fe8 - Now that VM entry points are hardened the checking in the Dart
code is unneeded.
Review URL: https://chromiumcodereview.appspot.com//9677059

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5432 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 19:30:10 +00:00
iposva@google.com 831aa612c7 - Disable isolate mirror tests as they can run into races.
Review URL: https://chromiumcodereview.appspot.com//9689077

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5431 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 19:29:32 +00:00
srdjan@google.com 41f23549c3 Fix another unused variable issue. Tested and built on Linux.
Review URL: https://chromiumcodereview.appspot.com//9689070

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5424 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 18:17:11 +00:00
srdjan@google.com 01b27d8f6f Fix build.
Review URL: https://chromiumcodereview.appspot.com//9689068

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5421 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 17:51:02 +00:00
srdjan@google.com aca2d7ffe0 Optional arguments in new compiler.
Includes Issue 9664062: Support allocating and calling closures in the new non-optimizing compiler (with fixes)
Review URL: https://chromiumcodereview.appspot.com//9693020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5419 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 17:35:05 +00:00
regis@google.com d74c2008be Fix type check to perform a subtype test at top level instead of an
assignability test. This only makes a difference when assigning an instance of
a function type.
Fix a bad language test.
Disable a bad co19 test (issue 99 filed).
Change error message for dynamic type error.
Review URL: https://chromiumcodereview.appspot.com//9664029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5413 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 16:16:12 +00:00
srdjan@google.com bff9b8a33b Disable another IsolateMirror tests.
Review URL: https://chromiumcodereview.appspot.com//9691052

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5412 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 15:58:19 +00:00
sgjesse@google.com 18b878fccd Fix missing member initialization on Mac OS
TBR=ager@google.com

Fix Mac OS build\n\nTBR=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5400 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 13:24:17 +00:00
sgjesse@google.com e06beb7f89 Fix Mac OS build
TBR=ager@google.com

BUG=none
TEST=none

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5397 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 13:09:24 +00:00