Commit Graph

1278 Commits

Author SHA1 Message Date
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 e860f819a0 Limit the maximum number of formal parameters (32K fixed and 32K optional)
in order to save space in function objects.
Naming cleanup.
Review URL: https://codereview.chromium.org//10928160

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12288 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-12 23:35:05 +00:00
iposva@google.com 609f39c69e - Fixed patching of named factory constructors. Bug 4727.
- Added test to check for error free patching of native factories.

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12280 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-12 20:13:25 +00:00
kasperl@google.com 55140fd125 Remove support for operator negate and replace occurrences with unary
operator -.

In the VM, I have disabled the operator negate support in the parser but I
have not removed the keyword because the token is used in quite a few other
places.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12233 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-12 05:29:03 +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
vegorov@google.com a528a1a3ea Refactor building of StoreStaticField and StoreLocal to manually preserve value.
This is first step towards eliminating manual value preservation in the write barrier's fast-path.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12124 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-10 16:02:40 +00:00
hausner@google.com 5aff33a57f Add missing dot in comment
Review URL: https://chromiumcodereview.appspot.com//10908152

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12079 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 23:10:43 +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
tball@google.com 90bd62f488 Fixed parsing of parameterized type test assert statement in production mode.
BUG=3741
TEST=Verified with bug's test, plus all VM tests.
Review URL: https://chromiumcodereview.appspot.com//10911042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11843 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-04 21:42:20 +00:00
hausner@google.com dce2c6a275 Catch illegally declared constructors
Constructors cannot be abstract or static.
Review URL: https://chromiumcodereview.appspot.com//10910079

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11842 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-04 21:28:48 +00:00
regis@google.com 2ea2249b48 Fix argument definition test (issue 4888).
Review URL: https://chromiumcodereview.appspot.com//10907064

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11835 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-04 18:59:01 +00:00
kasperl@google.com 7a535d3226 Disable all support for legacy try-catch in the VM.
R=ngeoffray@google.com,hausner@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11754 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-03 10:15:47 +00:00
hausner@google.com 35d7793891 Throw AbstractClassInstantiationError if an abstract class is instantiated
This is the second try to my previous attempt to implement the
new abstract class handling. Instead of a compile-time error,
the VM now throws an AbstractClassInstantiationError at runtime
if an abstract class is instantiated. Added the new error class
to the core library.

For now I'm still using the rule that a class is abstract if it is explicitly
marked as abstract, or if it defines a new abstract method.
Review URL: https://chromiumcodereview.appspot.com//10916039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11708 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-31 18:06:42 +00:00
asiva@google.com 9ed2e66130 Get rid of support for string interpolation in #import strings.
Review URL: https://chromiumcodereview.appspot.com//10911025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11698 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-31 16:55:03 +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
cshapiro@google.com 72c02b48c4 Format pointer type declarations more consistently.
Review URL: https://chromiumcodereview.appspot.com//10896054

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11645 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 19:26:28 +00:00
hausner@google.com 5692051e4e Convert double interface into abstract class
In a future change, we can implement double in the core
library, eliminating class Double (using the patch class
feature).
Review URL: https://chromiumcodereview.appspot.com//10876100

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11631 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 17:29:49 +00:00
hausner@google.com b3a2c41d02 Revert change 11558
I learnt that instantiating an abstract class is a runtime error, not a compile time error.

TBR=regis
Review URL: https://chromiumcodereview.appspot.com//10894048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11567 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 22:49:52 +00:00
hausner@google.com 28d88d4b2d Add compiler error when instantiating abstract class
Also, make abstract keyword on methods optional.
Review URL: https://chromiumcodereview.appspot.com//10899039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11558 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 22:13:06 +00:00
iposva@google.com 327ff5d70e - Change "static final" to "static const" in the runtime/ directory.
- Fixed parsing of top-level static const.
Review URL: https://chromiumcodereview.appspot.com//10883071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11425 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-27 23:51:37 +00:00
hausner@google.com c7f5bcd0ca Eliminate interface bool
Replace with concrete class bool instead, and getting rid of class Bool in core_impl library.
Review URL: https://chromiumcodereview.appspot.com//10874071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11418 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-27 21:09:23 +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
srdjan@google.com b77b6f913d Type of PhasePramater is Smi.
Review URL: https://chromiumcodereview.appspot.com//10868057

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11276 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-23 23:50:23 +00:00
hausner@google.com 0300d88b1b Gentle start with removing explicit interfaces
Review URL: https://chromiumcodereview.appspot.com//10832401

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11248 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-23 18:32:10 +00:00
regis@google.com 9efad2644b Re-enable checking of native resolvers.
Review URL: https://chromiumcodereview.appspot.com//10882007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11206 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-23 03:26:20 +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
regis@google.com d9b0276a4c Require two type arguments for map literals (issue 4522).
Spec has been changed back.
VM temporarily accepts a single type argument and emits a warning.
Update tests, dart2js source, dartdoc, etc...
Disable failing co19 tests (issue 175 filed).
Review URL: https://chromiumcodereview.appspot.com//10854191

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10861 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-16 20:44:32 +00:00
hausner@google.com d116929aa9 New getter syntax for top-level getters
Fix 4538
Review URL: https://chromiumcodereview.appspot.com//10837288

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10846 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-16 17:30:56 +00:00
iposva@google.com e5851a16c5 - Merge function lists when patching classes (no more duplicates).
- Report errors when applying a patch with duplicate fields or mismatched parameters.
- Fix bug 4526: Wrong error message when defining an already defined class.
Review URL: https://chromiumcodereview.appspot.com//10854176

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10784 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-16 00:00:04 +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 99d563982c - Support for patching of class methods and fields.
Review URL: https://chromiumcodereview.appspot.com//10827288

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10616 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 00:38:01 +00:00
iposva@google.com f29e6bb659 - Split Dart core libraries into shared sources and patch sources.
Currently this split goes along the runtime vs. library directories,
  eventually more shared code will be sitting in the shared library
  sources.
Review URL: https://chromiumcodereview.appspot.com//10834284

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10612 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 23:01:20 +00:00
hausner@google.com 9b47d131bf Support new getter syntax (no formal parameter list)
Support both new and old getter syntax in the VM compiler.
One co19 test becomes invalid, as it expects a compile error
due to missing getter formal parameters.
Review URL: https://chromiumcodereview.appspot.com//10837208

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10541 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 22:53:34 +00:00
asiva@google.com 5fd180cdfc 1. Register canonical names for internal VM classes and get rid of the method GetSingletonClassName
2. Create the empty_array object as a singleton in the VM isolate and remove it from the object store
3. Remove eager population of the functions_cache entry in the class. This results in a pretty impressive reduction of the initial isolate heap size:
    - on IA32 it goes from 1331k to 1071k
    - on X64 it goes from 2431k to 1911k
    - snapshot size also is reduced from 859219 bytes to 789147 bytes.
    (as a follow up change I will consider completely removing functions cache)
Review URL: https://chromiumcodereview.appspot.com//10827249

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10535 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 21:43:00 +00:00
hausner@google.com 6a1a13901d Support for new operator -
Implement unary operator -. Operator negate is still recognized,
but internally it is represented like unary -. In particular,
operator negate no longer implies an instance method named
negate.

Marked several co19 tests that use "negate" as failing and filed
co19 issue 169 to have these tests updated.
Review URL: https://chromiumcodereview.appspot.com//10830253

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10523 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 18:30:22 +00:00
hausner@google.com 29f91cc6f4 Implement new catch syntax in vm compiler
- Support for new on T catch (e) syntax
- warning (default:off) when old catch clause syntax is found
- convert one language test to used new catch syntax
Review URL: https://chromiumcodereview.appspot.com//10827240

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10456 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-09 20:14:18 +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
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
turnidge@google.com 2d70c7a5eb Improve the stack trace output to be more readable.
BEFORE

Unhandled exception:
MyException
 0. Function: '::baz' url: 'file:///Users/turnidge/dart/bug.dart' line:2 col:3
 1. Function: '_OtherClass@11f7ef14._OtherClass@11f7ef14._named@11f7ef14' url: 'file:///Users/turnidge/dart/bug.dart' line:7 col:8
 2. Function: '::set:globalVar' url: 'file:///Users/turnidge/dart/bug.dart' line:12 col:3
 3. Function: '::_bar@11f7ef14' url: 'file:///Users/turnidge/dart/bug.dart' line:16 col:3
 4. Function: 'MyClass.get:field' url: 'file:///Users/turnidge/dart/bug.dart' line:25 col:9
 5. Function: 'MyClass.fooHelper' url: 'file:///Users/turnidge/dart/bug.dart' line:30 col:7
 6. Function: 'MyClass.foo' url: 'file:///Users/turnidge/dart/bug.dart' line:32 col:14
 7. Function: 'MyClass.function' url: 'file:///Users/turnidge/dart/bug.dart' line:21 col:15
 8. Function: 'MyClass.MyClass.' url: 'file:///Users/turnidge/dart/bug.dart' line:21 col:18
 9. Function: '::function' url: 'file:///Users/turnidge/dart/bug.dart' line:38 col:10
 10. Function: '::main' url: 'file:///Users/turnidge/dart/bug.dart' line:38 col:24

AFTER

Unhandled exception:
MyException
#0      baz (file:///Users/turnidge/dart/bug.dart:2:3)
#1      _OtherClass._OtherClass._named (file:///Users/turnidge/dart/bug.dart:7:8)
#2      globalVar= (file:///Users/turnidge/dart/bug.dart:12:3)
#3      _bar (file:///Users/turnidge/dart/bug.dart:16:3)
#4      MyClass.field (file:///Users/turnidge/dart/bug.dart:25:9)
#5      MyClass.foo.fooHelper (file:///Users/turnidge/dart/bug.dart:30:7)
#6      MyClass.foo (file:///Users/turnidge/dart/bug.dart:32:14)
#7      MyClass.MyClass.<anonymous closure> (file:///Users/turnidge/dart/bug.dart:21:15)
#8      MyClass.MyClass (file:///Users/turnidge/dart/bug.dart:21:18)
#9      main.<anonymous closure> (file:///Users/turnidge/dart/bug.dart:38:10)
#10     main (file:///Users/turnidge/dart/bug.dart:38:24)
Review URL: https://chromiumcodereview.appspot.com//10826191

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10408 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 17:22:26 +00:00
srdjan@google.com 3dfabb26ea Verify at method exit that stack size is the same as at entry, except for methods with finally clauses. Mark functions that have finally clauses as they may produce extra values on stack. Note that we currently do not optimize methods with finally clauses and therefore there are no issues related to incorrect stack size at deoptimization.
Review URL: https://chromiumcodereview.appspot.com//10824201

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10351 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-07 20:15:17 +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
fschneider@google.com 04fa2e3547 Refactor our IL instruction for static setters.
We do not need a separate IL instruction anymore. Instead I generate
a normal static call and save the result in a temporary local if it
is needed.
Review URL: https://chromiumcodereview.appspot.com//10825176

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10222 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-03 11:14:07 +00:00