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
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
73366bab9e
Properly skip expressions that contain the operator as.
...
Fix 4277.
Review URL: https://chromiumcodereview.appspot.com//10830130
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10151 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 00:11:09 +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
turnidge@google.com
a3a73029f0
Consolidate a few fields in RawFunction using bitfields.
...
Remove kAbstract from the list of function kinds. It now has its own
dedicated bit. This allows us to distinguish abstract methods from
abstract getters and setters.
Review URL: https://chromiumcodereview.appspot.com//10796004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10087 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-31 21:26:28 +00:00
iposva@google.com
e5a314d222
- Allow parsing of external methods.
...
Review URL: https://chromiumcodereview.appspot.com//10821076
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10028 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-30 22:46:24 +00:00
hausner@google.com
d03049391b
Fix issue 977
...
Constructors with redirection may not have a function body.
Review URL: https://chromiumcodereview.appspot.com//10820064
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9999 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-27 23:23:24 +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
regis@google.com
8fe3e69e37
Improve static type propagation.
...
Review URL: https://chromiumcodereview.appspot.com//10823022
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9943 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-26 16:04:36 +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
ec7f44f025
Create frequently used symbols in the vm isolate
...
- Avoids the need for doing a NewSymbol on these everytime
- saves space as they get shared by isolates
Review URL: https://chromiumcodereview.appspot.com//10783035
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9834 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-24 00:01:50 +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
regis@google.com
24944b0ec1
Fix build break, i.e. fix type finalization for function literals not assigned
...
to a function.
Review URL: https://chromiumcodereview.appspot.com//10807055
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9785 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-20 18:08:05 +00:00