Commit Graph

61 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
srdjan@google.com f0b56ef792 Reduce allocation of ArrayNode-s where a GrowableArray could be used instead.
Review URL: https://codereview.chromium.org//12207137

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18412 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-12 23:34:12 +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
srdjan@google.com 020b5893db Cleanups.
Review URL: https://codereview.chromium.org//11801023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16756 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-07 22:13:47 +00:00
kmillikin@google.com 309fcb1ba3 Fix incorrect desugaring of cascades.
Make use of the attractive and powerful way that the LoadLocal expression is
really a pair of an arbitrary statement and a local variable load.

BUG=dart:7494

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16684 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-07 10:03:17 +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
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
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
vegorov@google.com 361af1463a Remove unused field AstNode::ic_data.
R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15733 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-05 14:29:41 +00:00
vegorov@google.com f9f587d6fe Kill unused CodeGenInfo field in AstNode.
R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15731 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-05 13:46:58 +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
hausner@google.com be175c758e Implement const expressions for local variables
Review URL: https://codereview.chromium.org//11265047

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14716 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-09 00:19:43 +00:00
regis@google.com d372a816bb Pass closure object as first implicit argument to closure functions.
Remove code passing captured receiver to native instance closures; instead,
access captured receiver in context, as non-native functions do.
Review URL: https://codereview.chromium.org//11360116

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14698 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-08 18:28:07 +00:00
asiva@google.com 48a8be1d7c Fix compiler warning.
Review URL: https://codereview.chromium.org//11364084

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14548 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-06 00:56:41 +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
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
kasperl@google.com d1da3ed908 Re-land r12289.
Looks like Johnni has fixed the dartdoc issues.

R=iposva@google.com,hausner@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12321 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-13 12:37:00 +00:00
hausner@google.com 08893af550 Revert change 12289
Will resubmit tomorrow. Dartc and Editor need to cleanup static finals.
Review URL: https://codereview.chromium.org//10928169

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12291 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-13 00:22:12 +00:00
hausner@google.com b740a3266f Stop treating finals as const
Toplevel final variables and static final fields are no longer
considered compile-time constants.
Review URL: https://codereview.chromium.org//10918203

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12289 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-13 00:03:16 +00:00
regis@google.com 9e00bd8ccb Implement argument definition test in the vm.
Add tests.
Various cleanups.
Review URL: https://chromiumcodereview.appspot.com//10915022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11664 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 22:46:44 +00:00
regis@google.com d0539c0335 Propagate type of list literal from parser to ast, graph, and optimizer.
Review URL: https://chromiumcodereview.appspot.com//10878042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11329 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-24 18:17:11 +00:00
hausner@google.com 8f2c8c35fb References to static functions are CT constants
A compile time constant expression may refer to top-level and
static closures.

Fix for issue 3406.
Review URL: https://chromiumcodereview.appspot.com//10823292

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10600 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 20:15:06 +00:00
hausner@google.com 45b76746b5 Fix super getter/setter
Fix handling of super getters and setters. In particular, parser
now correctly converts super getters into super setters for
compound assignment, and pre- and postfix increment operators.

co 19 tests still fail because super index operator is broken.
Will work on this next.
Review URL: https://chromiumcodereview.appspot.com//10849004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10413 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 18:02:51 +00:00
regis@google.com bf7540da98 Store pointer instead of reference to LocalVariable in ast and flow graph.
Address comments of already committed r10203.
Review URL: https://chromiumcodereview.appspot.com//10832126

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10321 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-06 23:17:04 +00:00
regis@google.com 6f5281c404 Get rid of ast node ids.
Rename cid to deopt_id.
Review URL: https://chromiumcodereview.appspot.com//10832150

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10306 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-06 20:24:03 +00:00
regis@google.com 12de02cbab Associate the correct type to method receivers (instead of Dynamic type).
Properly name the first implicit parameter to factories as ':type_arguments'
(instead of 'this', which made it accessible to user code).
Various cleanup.
Review URL: https://chromiumcodereview.appspot.com//10831142

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10203 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 23:00: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
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
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
regis@google.com d95cbc8d7f Use VM type cast and save handles.
Review URL: https://chromiumcodereview.appspot.com//10693071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9317 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-02 21:42:53 +00:00
asiva@google.com 5cbd276939 Make the parser agnostic to the TokenStream implementation. This is the first step towards compacting the token stream.
Pull the data stream writer/reader code out of snapshot into a generic file so that it can be reused into the token stream compaction implementation.
Review URL: https://chromiumcodereview.appspot.com//10632009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9043 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-22 20:37:01 +00:00
asiva@google.com 73bfbc5da4 Allow implicit 'close your eyes' of native methods. This will hopefully fix issue 3466.
- when resolving the native method which has been closurized account for the 'this' argument in the count of arguments.
- explicitly copy the 'this' parameter in the closure context as the first parameter before calling the native function. This is done by piggy backing on the CopyParameters code used for functions with optional parameters.
Review URL: https://chromiumcodereview.appspot.com//10535180

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8816 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-18 19:56:06 +00:00
regis@google.com 395d3ba587 Insert closure calls in conditional expression of assert (issue 1584).
Review URL: https://chromiumcodereview.appspot.com//10446102

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8164 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-31 15:57:06 +00:00
srdjan@google.com 54f73f0365 Remove TuckTemp, PickTemp, use temporary locals instead.
Review URL: https://chromiumcodereview.appspot.com//10310132

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7624 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-14 20:01:35 +00:00
srdjan@google.com bdb733b800 With removal of increment operations, each node has a unique id.
Review URL: https://chromiumcodereview.appspot.com//10356108

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7517 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-10 20:23:15 +00:00
regis@google.com 5e99edcea7 Properly set the element type of literal lists.
Add test.
Keep element type consistent between growable array and backing array.
Fix snapshot reader to set the element type in growable array
Remove run time call checking rest argument.
Review URL: https://chromiumcodereview.appspot.com//10368004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7337 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 16:36:27 +00:00
srdjan@google.com 2c3cab0603 Removing all incr-op nodes.
Review URL: https://chromiumcodereview.appspot.com//10354019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7305 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-03 22:17:44 +00:00
srdjan@google.com 259d099c6d Step toward eliminating increment nodes, starting with increment local. Fix a bug in evaluating side effect free nodes.
Review URL: https://chromiumcodereview.appspot.com//10350003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7300 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-03 20:27:37 +00:00
srdjan@google.com 071e9240b9 - Fix another side effect issue: never add AstNode to sequence unless they are a statement. Added tests. LoadLocal has now an optional pseudo input.
Review URL: https://chromiumcodereview.appspot.com//10283003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7210 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-01 23:35:17 +00:00
srdjan@google.com 344aba1e75 Assign ids to incoming arguments (to be used in checked mode).
Review URL: https://chromiumcodereview.appspot.com//10115053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6718 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-19 00:04:47 +00:00
srdjan@google.com ea5a4fac30 New compiler: implement switch/case in graph builder.
Review URL: https://chromiumcodereview.appspot.com//9959127

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6180 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-04 17:56:53 +00:00
srdjan@google.com d6abdfb6b8 Eliminate IncrOpStaticFieldNode, replace a set of nodes.
Review URL: https://chromiumcodereview.appspot.com//9592031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5063 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-07 00:40:48 +00:00
srdjan@google.com a396e575ee Fix Issue 1804: Forgot to rename one virtual function.
Review URL: https://chromiumcodereview.appspot.com//9429072

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4503 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 22:41:56 +00:00
kmillikin@google.com 41e77a0a9e Initial implementation of a flow-graph builder for Dart's AST.
Visit the AST and generate an instruction (ie, not basic-block) flow
graph.

The flow graph for the simple function:

main() {
  var f = 1;
  var n = 5;
  while (n > 0) {
    f = f * n;
    n = n - 1;
  }
  print(f);
}

is:

       1: StoreLocal(f, #1)
       2: StoreLocal(n, #5)
       3: [join]
       4: t0 <-LoadLocal(n)
       5: t0 <-InstanceCall(>, t0, #0)
       6: if t0 goto(7, 15)
       7: [target]
       8: t0 <-LoadLocal(f)
       9: t1 <-LoadLocal(n)
      10: t0 <-InstanceCall(*, t0, t1)
      11: StoreLocal(f, t0)
      12: t0 <-LoadLocal(n)
      13: t0 <-InstanceCall(-, t0, #1)
      14: StoreLocal(n, t0) goto 3
      15: [target]
      16: t0 <-LoadLocal(f)
      17: StaticCall(print, t0)
      18: return #null

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4460 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 15:20:13 +00:00
srdjan@google.com a54f33bf92 ICData is now a wrapper object that refers to the calling function, target name, ic data array, etc. The old ICData C++ class that wrapped around an Array is removed. The advantage is that the ICData object remains the same, only its ic_data array object is being modified as classes are added..
TODO: store ICData-s into function so that the type feedback can be easily extracted (currently must traverse the unoptimized code).
Review URL: https://chromiumcodereview.appspot.com//9395016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4417 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 00:40:03 +00:00
sgjesse@google.com bf67f24098 Move assert.h/assert.cc from runtime/vm to runtime/platform
The purpose of this change is twofold:

1. Source in the bin directory can now use the same assertions as
   source in the vm directory. The ASSERT macro used by the code
   in runtime/bin was just defined to use assert from the standard
   C library.
2. Moving other implementation parts from runtime/vm to
   runtime/platform (e.g. classes Monitor and Mutex) for sharing
   between runtime/bin and runtime/vm will be easier as these
   implementations rely on these assertion macros.

Created two gypi files for the platform directory. One for the
headers and one for the source. The source one is only included
when building the VM library and will be present in libdart.a
when the dart executable is linked.

All the code for asserts is still in the dart namespace.

Also re-arranged the order of includes to be alphabetically in
the files touched.

R=ager@google.com, iposva@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//9189003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3335 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-16 12:28:10 +00:00
regis@google.com 809cd5590a Helper ast node sequences must not wrongly grab ownership of the enclosing
scope (fix issue 736).
Add test.
Review URL: http://codereview.chromium.org//8893008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2324 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-09 21:32:14 +00:00
srdjan@google.com d07087ce77 Ongoing renaming of type classes:
TypeArguments -> AbstractTypeArguments
TypeArray -> TypeArguments
Review URL: http://codereview.chromium.org//8776020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2002 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 23:19:59 +00:00