Commit Graph

102 Commits

Author SHA1 Message Date
srdjan@google.com 2fdbeb2153 Make sure that ParsedFunction holds onto zone handles.
Review URL: https://codereview.chromium.org//11364166

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14718 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-09 00:58:21 +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
hausner@google.com 5a51906fa3 Disallow 'dynamic' as type parameter name
Fixes issue 2492
Review URL: https://codereview.chromium.org//11343044

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14296 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 17:45:36 +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
regis@google.com d00ed7fbc6 Ambiguous references do not necessarily cause compilation errors (issue 5736).
Triage related co19 test failures.
Review URL: https://codereview.chromium.org//11232071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13987 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-23 22:29:44 +00:00
zerny@google.com 8e36c2f3cc Cache parsed functions when inlining.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13882 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-22 15:13:32 +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
regis@google.com 6c7a1f30fd Look up getter in super call (issue 3621).
Review URL: https://codereview.chromium.org//11088014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13376 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-08 21:37:34 +00:00
regis@google.com 3a45259cc5 Implement new scope rules for type variables (issue 5230).
Fix tests.
Review URL: https://codereview.chromium.org//11030056

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13316 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-05 20:29:02 +00:00
hausner@google.com ed960e0432 Add catchless catch clauses
The Dart grammar says the catch clause is optional, ie. the following is legal:

try {
  ...
} on String {
  ...
}

Added a test case
Review URL: https://codereview.chromium.org//11051031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13240 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-04 16:10:45 +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
hausner@google.com ffedcb612d Make assert a reserved word
Issue 5051.

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12861 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 17:59:35 +00:00
hausner@google.com c13e591405 Implement part header
This is the final piece in the new import syntax.
Review URL: https://codereview.chromium.org//10989010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12850 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 16:45:14 +00:00
hausner@google.com 201bce4219 Support for show/hide combinators
- Add a new VM object called a Namespace.
- A Namespace is a library, and two list of names to hide/show.
- Convert Library and LibraryPrefix to contain Namespace
  objects instead of Libraries in their import list.
Review URL: https://codereview.chromium.org//10967052

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12804 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 20:46:56 +00:00
hausner@google.com 731f692895 Get rid of #resource directive in VM
Review URL: https://codereview.chromium.org//10918226

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12358 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-13 22:25:09 +00:00
hausner@google.com a32a698c6f Support new library/import syntax
This change simply adds new syntax support for the functionality we
currently have in the VM.

- Support for library and import, import-as.
- Still to do: show/hide combinators, export, library parts.
Review URL: https://chromiumcodereview.appspot.com//10928121

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12216 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-11 20:10:56 +00:00
iposva@google.com a8a8f1e7de - Do not limit the compiler message buffer, by allocating the message
into a String object.
Review URL: https://chromiumcodereview.appspot.com//10933021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12202 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-11 15:03:40 +00:00
hausner@google.com 22fdbae05b VM can parse and ignore metadata
Support parsing of metadata in all legal locations except library
and import directives. The metadata is simply ignored. It is not
evaluated or validated for correctness.
 
Review URL: https://chromiumcodereview.appspot.com//10913138

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12078 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 23:06:48 +00:00
regis@google.com 7cc84c2892 Implement new optional parameters syntax in the vm (issue 4290).
Provide --reject_named_argument_as_positional flag to ease transition to new
syntax (default is false).
Add tests.
Review URL: https://chromiumcodereview.appspot.com//10910119

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12004 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 01:13:27 +00:00
hausner@google.com e0ed54ea8e Add named constructor name checking
Named constructors may not clash with any other class members.
Add a check but enable it only when --construcotr_name_check
runtime flag is passed to the VM.

Eliminate one named constructor in Process class in core library,
as well as a couple of cases in dart2js.

The dart2js team may want to rename the constructors I changed.

Issue 3990  (http://code.google.com/p/dart/issues/detail?id=3990)
 
Review URL: https://chromiumcodereview.appspot.com//10905109

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11972 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 18:02:41 +00:00
cshapiro@google.com da14bf70a7 Add attributions so printf like functions can have their arguments checked.
This change also corrects some misuses of format strings and format
arguments that discovered by the compiler checks.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11912 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 00:58:25 +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 55c106f812 Make ClassFinalizer indifferent on whether we are generating a snapshot or not.
Add flag --error_on_malformed_type.
Remove obsolete flag --verify_implements.
Support snapshotting of LanguageError (for malformed types) and ApiError.
Review URL: https://chromiumcodereview.appspot.com//10871005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11198 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-23 00:27:49 +00:00
hausner@google.com 9dc7ab8e1e Implement import scope
Implement the new scope rule for imports.

- Imported identifiers are in a scope that is shadowed
  by the importing library's top-level scope.
- Conflicting names imported from different libraries
  are not an error unless the name is referenced.
- Conflicting type names are only an error in checked mode.

In a follow-on change, I'll remove the "imported_into" pointers in libraries. They are no longer needed.


Issue 2945
Review URL: https://chromiumcodereview.appspot.com//10823396

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10923 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-17 21:06:16 +00:00
iposva@google.com 5a443ddcc9 - Split functionality of adding implicit constructors and checking
for cycles into two functions.
- Fix handling of closures in patch classes.
Review URL: https://chromiumcodereview.appspot.com//10829332

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10703 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-15 07:33:19 +00:00
hausner@google.com b69319b6ce Allow non-const field initializers
Revision 0.11 of the spec allows arbitrary initializer expressions
for instance fields.

Issue 3848
Review URL: https://chromiumcodereview.appspot.com//10832283

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10672 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 19:52:00 +00:00
iposva@google.com de7f866c4a - Allow patching of top-level methods and accessors.
Review URL: https://chromiumcodereview.appspot.com//10824209

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10409 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 17:29:49 +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
hausner@google.com db4653f0e0 Add check for duplicate field initialization
This change adds a check that reports duplicate initialization
of instance fields. Fixes issues 921 and 1034.

There were several tests in the language suite that had duplicate
initializers for final instance fields. Corrected the tests.

dart2js also contained duplicate initializations of a couple
of final fields.
Review URL: https://chromiumcodereview.appspot.com//10825140

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10146 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-01 22:25:36 +00:00
hausner@google.com b3917271aa Optimize away most implicit const getter functions
If a static field has a very simple initializer expression
(a literal number or string for example) we initialize the field
directly while compiling instead of generating an implicit
getter. We only do this if the type of the expression is
assignment compatible with the field. If the expression is not
compatible, we let the implicit getter do the error checking.

This eliminates about 330 implicit getters in the core libraries
and saves 35k in the snapshot (830k, down from 865k).
Review URL: https://chromiumcodereview.appspot.com//10826090

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10098 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-31 23:33:48 +00:00
hausner@google.com 741a12cfd6 Support const modifier in fields, variables
Issue 3551

This change adds const as a valid keyword to declare fields and
variables. The mandatory initializer has to be a compile time
const expression.

Static final variables still have to be initialized with
compile time constant expressions. I will add non-const static
finals (issue 3558) in another change.

Other small changes:
- allow null in some compile time constant expressions.
- allow only numbers, booleans, strings and null in compile time
  constant string interpolation.
Review URL: https://chromiumcodereview.appspot.com//10828053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9992 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-27 20:49:24 +00:00
hausner@google.com a2fec11205 Make sure the "Skip*" functions know about cascades as well.
Also, handle index operator in cascades correctly.
Review URL: https://chromiumcodereview.appspot.com//10809089

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9910 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-25 21:31:02 +00:00
asiva@google.com ed8db0f611 Move more symbols to the vm isolate.
Review URL: https://chromiumcodereview.appspot.com//10808111

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9905 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-25 20:31:26 +00:00
hausner@google.com fdd91990f1 Implement cascade operator in VM
- Factoring out parsing of selectors
- Create temp variable holding the receiver of the cascade
  selectors
Review URL: https://chromiumcodereview.appspot.com//10796109

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9857 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-24 17:20:49 +00:00
asiva@google.com ef67b96777 Rename some of the enum definitions inside classes to avoid conflict with the ObjectKind enum.
Review URL: https://chromiumcodereview.appspot.com//10808064

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9792 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-20 22:24:49 +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 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
hausner@google.com 0b403430bf Fix parent function of deeply nested closures
We got the parent of nested closures wrong if the nesting level
was > 2.

Fix for issue 3412.
Review URL: https://chromiumcodereview.appspot.com//10665009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9065 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-25 15:43:04 +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
hausner@google.com 56bc7ca48a Fix stuff
Fix for issue 3781: don't hang on to deleted breakpoints (manually tested).
Fix for issue 3390: allow function names in all string interpolation expressions.
Review URL: https://chromiumcodereview.appspot.com//10603003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8956 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-21 00:16:27 +00:00
regis@google.com 858b662c84 Fix super call invocation (issue 2028).
Review URL: https://chromiumcodereview.appspot.com//10513008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8633 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-13 23:06:23 +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 d8f4aa2fd0 Use temporary variable for StoreIndexed that returns a value.
Review URL: https://chromiumcodereview.appspot.com//10448059

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8109 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-30 15:55:46 +00:00
turnidge@google.com 05b5d44b0e spawnUri. Take two. This time I'll wait for Anton before committing :-).
See original change 7756 for description.
Review URL: https://chromiumcodereview.appspot.com//10407042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7917 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-23 18:32:51 +00:00
turnidge@google.com 76d4586dea Revert my last change.
Review URL: https://chromiumcodereview.appspot.com//10332257

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7757 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 18:35:04 +00:00
turnidge@google.com 6a8c82db83 Implement spawnUri from dart:isolate. This function allows us to
launch an isolate running a different script.  Finally.

Reviewers: This isn't as hard to review as it looks.  Dive right in!

Siggi: Take a look at my test status file changes and make sure I'm
excluding the right stuff.

Much of the churn in the CL comes from moving ownership of the
import_map.  It used to be set per-library and is now set per-isolate.
This caused a lot of superficial diffs.

DART EMBEDDING API CHANGES:

- Dart_IsolateCreateCallback now takes a script_uri and main argument
  instead of a name_prefix argument.  The script_uri argument allows
  the callback to launch different scripts.  The main argument is used
  in creating the isolate debug name.

- Dart_CreateIsolate now takes script_uri and main arguments.  These
  are used to build the isolate's debug name.

- Dart_LibraryTagHandler, Dart_LoadScript, and Dart_LoadLibrary no
  longer take an import_map.

- Added Dart_SetImportMap.

- Added Dart_RootLibrary to provide access to the root library for the
  current isolate.

OTHER STUFF

Add a couple of tests for spawnUri -- the existing tests assume that
scripts end in a .js suffix which isn't going to work out for us.

Changed how the debug name for isolates get built a bit.

Refactored bin/main.cc a bit.  Fixed some problems with error handling
while creating isolates.

Minor refactoring in builtin.dart to always pass is_windows rather
than relying on it being squirreled away.
Review URL: https://chromiumcodereview.appspot.com//10386107

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7756 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 18:22:10 +00:00
asiva@google.com c71a8cc1ee Change dart frame and stub frame layout to include the PC of the code executing on the frame. The stack frame layout is as follows:
ret PC
  saved EBP                          <== EBP
  PC (used to locate RawInstruction) <== ESP
Review URL: https://chromiumcodereview.appspot.com//10375059

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7675 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-16 00:47:05 +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