srdjan@google.com
92eb96c913
Fix issue 2939, revert previous change that accepted null as excpetion objects:
...
throw null throws NullPointerException as per latest spec.
Review URL: https://chromiumcodereview.appspot.com//10392016
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7475 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-09 22:27:12 +00:00
srdjan@google.com
48f28eebdb
Fix bugs in expression temp allocation, Kevin's CL 10302007 (Remove temporaries using explicit names) and merge with other temp.
...
Review URL: https://chromiumcodereview.appspot.com//10389041
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7472 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-09 21:39:58 +00:00
srdjan@google.com
c8dd31e39b
Fix bug 2907: cannot instantiate Dynamic.
...
Review URL: https://chromiumcodereview.appspot.com//10389006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7397 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-07 19:49:54 +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
regis@google.com
7793191032
Check upper bounds of type arguments when allocating objects of a generic type
...
at run time when they cannot be checked at compile time.
Review URL: https://chromiumcodereview.appspot.com//10280007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7211 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-02 01:57:22 +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
bfebc9cca3
Merge two functions that create side effect free compound load nodes.
...
Review URL: https://chromiumcodereview.appspot.com//10272031
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7201 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-01 18:43:57 +00:00
srdjan@google.com
3eabbdd7dc
Fix wrong order of execution in compound assignment nodes (located by Kevin).
...
Review URL: https://chromiumcodereview.appspot.com//10270028
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7173 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-01 00:38:02 +00:00
srdjan@google.com
dc17b7338f
Canonicalize type arguments lazily.
...
Review URL: https://chromiumcodereview.appspot.com//10161030
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6973 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-25 20:32:45 +00:00
regis@google.com
efa92f5447
Mark types as instantiated or uninstantiated upon finalization.
...
Review URL: https://chromiumcodereview.appspot.com//10205006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6894 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-24 16:15:37 +00:00
regis@google.com
f955de9bc0
Throw a type error in production mode when the type of the type test is not
...
declared (issue 2571).
Add test.
Delete bad negative test now covered by new test.
Update status files of different compilers.
Review URL: https://chromiumcodereview.appspot.com//10035058
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6754 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-19 17:01:28 +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
hausner@google.com
e74cd5fc3a
Static members are not visible in subclasses
...
Fix for issue 1598.
Lexical scope comes before inherited names. Also, Static members
are not inherited and are not visible in subclasses.
Code in the subclass (or any other code for that matter) has to
qualify the names of these members with the class name.
We had a few tests that were wrong and only passed in the VM because
this was not implemented correctly.
Also had to fix code in frog and dartdoc.
I hope I ran enough tests. I built an all.deps tree using tools/build.py from the root directory, which brought up the frog and dartdoc issues.
Tested:
tools/test.py --compiler=dart2js --runtime=drt
tools/test.py -c none -r drt
tools/test.py -c frog -r drt
tools/test.py -r vm
Review URL: https://chromiumcodereview.appspot.com//10115005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6698 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-18 16:09:22 +00:00
hausner@google.com
69d33b8d8d
Fix bug 1991, variable resolution in string interpolation
...
Check to make sure string interpolation expressions cannot
contain type parameter names.
Review URL: https://chromiumcodereview.appspot.com//10108020
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6645 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-17 16:10:35 +00:00
hausner@google.com
02661e6905
Accept keyword abstract in front of a class declaration
...
We can just ignore it. The VM has nothing to do for abstract
classes.
Review URL: https://chromiumcodereview.appspot.com//10103014
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6612 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-16 23:46:55 +00:00
hausner@google.com
b8d3cc0929
Fix bug 918
...
Don't choke to top-level native function declarations.
Review URL: https://chromiumcodereview.appspot.com//10086015
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6541 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-13 22:02:31 +00:00
regis@google.com
fce1a7e45e
Fix lazy initialization of static fields (issue 2472).
...
Review URL: https://chromiumcodereview.appspot.com//10050022
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6438 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-11 21:24:17 +00:00
hausner@google.com
2fc3bb679d
Introduce a flag to disable string operator +
...
If allow_string_plus is set to false, the compiler will report an error
when it finds a string literal followed by +. Invoking the + operator on a
string value throws a noSuchMethod exception.
This is temporary code that we'll eliminate once the + operator on
strings is completely removed.
Review URL: https://chromiumcodereview.appspot.com//9960084
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6423 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-11 18:23:22 +00:00
regis@google.com
3c063c8d4f
Eliminate type checks that can successfully be performed at compile time.
...
Review URL: https://chromiumcodereview.appspot.com//10051011
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6420 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-11 17:42:39 +00:00
srdjan@google.com
b3452e74fb
Add a test to check correct references to a global variable that initially throws
...
a type error.
Review URL: https://chromiumcodereview.appspot.com//10006040
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6294 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-06 20:25:21 +00:00
turnidge@google.com
9731c1c254
Rename Api::NewLocalHandle -> Api::NewHandle.
...
Api::NewHandle now takes a RawObject* intead of an Object&.
- This makes the code shorter and easier to read.
- This allows us to drop the DARTSCOPE from Dart_GetNativeArgument.
(6% speedup on Benchmark_UseDartApi)
Review URL: https://chromiumcodereview.appspot.com//10014002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6283 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-06 17:05:50 +00:00
regis@google.com
9ff0afa50e
Do not require upper bounds to be resolved and finalized before comparing them
...
between the expected and actual factory class (issue 2431).
Add test.
Review URL: https://chromiumcodereview.appspot.com//10008017
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6236 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-05 18:11:42 +00:00
turnidge@google.com
c0d7f96409
Remove many calls to Isolate::Current() in the dart embedding api by
...
passing the isolate explicitly.
Review URL: https://chromiumcodereview.appspot.com//9956133
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6193 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-04 20:31:49 +00:00
regis@google.com
ab0a25eb1d
Add missing type checks for top level static initializers (issue 1980 and
...
duplicates 1957, 2070, 2224).
Review URL: https://chromiumcodereview.appspot.com//9958091
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6145 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-03 20:23:30 +00:00
hausner@google.com
55a9a4831e
Fix issue 1569
...
Report proper error on illegal getter and setter syntax, and bad field declarations.
Review URL: https://chromiumcodereview.appspot.com//9958041
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6112 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-02 21:18:02 +00:00
regis@google.com
5282e44fb2
Use null type argument vector instead of vector of Dynamic for a generic raw
...
type when possible.
Fix type finalization of type parameters (always finalize in the context of the
class being parameterized and not in the enclosing class where the type
parameter is used).
Fix wrong generic optimization and added a test (a generic type instantiated
from a raw instantiator is not always raw).
Added printing of type argument vectors.
Review URL: https://chromiumcodereview.appspot.com//9939003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6068 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-30 22:16:52 +00:00
hausner@google.com
50433eb7a9
Report error on missing factory class
...
Fixes issue 974. If an interface declares a constructor, it must
declare a factory class. Report compile-time error if the factory
class is missing.
Review URL: https://chromiumcodereview.appspot.com//9958018
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6046 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-30 16:53:55 +00:00
hausner@google.com
c91cbd26a7
Fix capturing of for-loop variables
...
It was broken when there were captured variables in inner blocks.
LocalFunctionTest had a test case that was expecting the wrong result.
Add a few more test cases to For2Test.dart
Fixes issue 2338 (http://code.google.com/p/dart/issues/detail?id=2338 )
Review URL: https://chromiumcodereview.appspot.com//9921030
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6006 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-29 22:44:47 +00:00
regis@google.com
8ba77ffb83
Do not share local function between closurized and non-closurized enclosing
...
function.
Add test (thanks to Florian for reporting the issue).
Review URL: https://chromiumcodereview.appspot.com//9835070
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5843 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-26 16:59:37 +00:00
regis@google.com
bb20585e0f
Use a local variable to save/restore the context on entry/exit, instead of
...
explicitly pushing/popping.
Review URL: https://chromiumcodereview.appspot.com//9721004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5649 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-19 17:02:40 +00:00
hausner@google.com
feafdf0e06
Properly recognize closures when setting breakpoints
...
Local functions and function literals are unknown to the VM
until the enclosing function is compiled. This change introduces
a list of known closures per class, and a function to look up
the innermost closure at a given token index.
The debugger now checks whether there are newly discovered
closures when a function containing a pending breakpoint is
compiled. If necessary, the breakpoint is set to the inner
function.
Review URL: https://chromiumcodereview.appspot.com//9716004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5599 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-16 22:28:57 +00:00
hausner@google.com
ad939b2035
Remove warning for illegal parameter names
...
Review URL: https://chromiumcodereview.appspot.com//9704094
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5573 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-16 16:17:23 +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
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
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
kmillikin@google.com
b05d117185
Support allocating and calling closures in the new non-optimizing compiler.
...
As part of this change, variable allocation is split out from the backend
code generator.
R=srdjan@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//9664062
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5392 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 12:31:45 +00:00
iposva@google.com
9e93428d9e
- Allow string interpolation in constant strings.
...
- Add test for constant adjacent strings with and without interpolation.
- Update status files.
Review URL: https://chromiumcodereview.appspot.com//9694024
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5377 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 00:59:17 +00:00
iposva@google.com
8e5b5a02e2
Fix issue 1950:
...
- enable-checked-mode forces --enable_type_checks and --enable_asserts.
Review URL: https://chromiumcodereview.appspot.com//9668034
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5269 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-09 23:21:09 +00:00
regis@google.com
33bd965e2a
Generate a dynamic type error when creating an instance with a bound error.
...
Review URL: https://chromiumcodereview.appspot.com//9665013
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5250 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-09 21:15:11 +00:00
asiva@google.com
e4d024664e
Add a first class GrowableObjectArray type in the VM and use it internally in the VM at all spots were we use GrowableArray first and then copy the contents into an Array object.
...
Next step is to use this type in growable_array.dart
Review URL: https://chromiumcodereview.appspot.com//9594028
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5109 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-07 19:14:02 +00:00
regis@google.com
f4ddc43cdf
Generate dynamic type errors according to spec.
...
Fix a few bad tests.
Turn a couple negative tests in multi-tests.
Triage a few co19 failing tests.
Still to do:
Check bounds of generic types at runtime in checked mode.
Stop reporting bounds error in new operator as a compile time error.
Review URL: https://chromiumcodereview.appspot.com//9615035
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5064 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-07 02:23:12 +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
hausner@google.com
5f72e92b4e
Re-introduce string concatenation
...
This change re-introduces concatenation of adjacent
string literals, i.e. the compiler concatenates "abc" "123"
into the literal "abc123" at compile time. If the literals
contain interpolations, the concatenation happens at
runtime.
The change also re-introduces interpolated compile-time
string literal constants, but the feature is disabled because
several tests need to be changed.
Review URL: https://chromiumcodereview.appspot.com//9582040
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4991 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-05 23:47:34 +00:00
srdjan@google.com
1d7321e3f2
Fix Issue 1846: Improve error reporting in presence of imports. With this CL:
...
'/Users/srdjan/bdartall/dart/runtime/bug3.dart': Error: line 2 pos 1: unexpected token 'abstract'
abstract class A { }
^
'/Users/srdjan/bdartall/dart/runtime/bug2.dart': Error: line 2 pos 1: library handler failed
#import("bug3.dart");
^
'/Users/srdjan/bdartall/dart/runtime/bug1.dart': Error: line 2 pos 1: library handler failed
#import("bug2.dart");
^
Review URL: https://chromiumcodereview.appspot.com//9559001
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4773 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-29 23:53:07 +00:00
asiva@google.com
33d2e2fe26
Changes to shrink the token stream representation from two words to one word.
...
On standalone dartium which has about 50000 tokens in the libraries (core, coreimpl, builtin, io etc.) this reduces the heap size by about 180kb. The size of the standalone snapshot buffer reduces by about 72kb.
Also moved the keyword symbol table to the object store so that it does not have to repopulated on every script compilation. Should benefit regular user script load times.
Review URL: https://chromiumcodereview.appspot.com//9462003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4734 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-29 02:46:29 +00:00
regis@google.com
47724a8491
Add support for malformed types and postpone some related errors from compile
...
time to execution time.
Still to do (once spec is clarified):
- properly handle generic type bounds errors
- properly handle 'instance of' type checks involving malformed types
- fix bad tests
Review URL: https://chromiumcodereview.appspot.com//9515011
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4732 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-29 02:14:18 +00:00
hausner@google.com
eff1a31d6f
Fixing bugs: 1612, 1843, 1847
...
- Fix error location when referring to types in object allocation.
- Handle CR/LF correctly at beginning of source.
- Detect duplicate identifier in typedef declaration.
Review URL: https://chromiumcodereview.appspot.com//9466030
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4584 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-25 00:47:06 +00:00