Commit Graph

1278 Commits

Author SHA1 Message Date
asiva@google.com 41b01ececf - Some of the pre registered classes like Int, Double etc. were not being
marked as being prefinalized. Mark them as pre finalized.
- Replaced the check (cls.functions() != Object::empty_array().raw()) as
  indicating it is a pre-registered class.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22914 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-21 01:02:28 +00:00
fschneider@google.com 0a243bf66c Revert r22620 because of dart2js test failures.
TBR=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22621 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-13 12:41:02 +00:00
fschneider@google.com 8df37f63e2 Enable optimizing try-finally.
Everything needed is already in place by my previous CL
(https://codereview.chromium.org/14682020/)

This just removes the early bailout in the parser.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22620 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-13 12:09:14 +00:00
regis@google.com 53347a3337 Remove stack_frame_<arch>.cc files.
The architecture specific information is in stack_frame_<arch>.h files.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22470 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-07 18:06:21 +00:00
regis@google.com 880af693cf Introduce architecture specific headers describing Dart stack frames.
The actual cleanup will follow in another cl.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22394 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-03 21:42:16 +00:00
hausner@google.com 8e29370a1b BREAKING CHANGE: enforce part of directive
For historical reasons, the VM is currently too lenient when parsing library parts. Files that get loaded through a 'part' directive must start with a 'part of libraryname;' clause. The VM so far has not reported an error if the clause is missing.

This change enforces the grammar as the Spec mandates it. Library parts that do not start with 'part of' will no longer compile.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22278 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-01 20:46:48 +00:00
srdjan@google.com 706e79d074 Fix error reporting when calling static methods and closures withh mismatched arguments.
Closures BEFORE:
----
Unhandled exception:
Class '(dynamic, dynamic, dynamic) => dynamic' has no instance method 'call'.

NoSuchMethodError : method not found: 'call'
Receiver: Closure: (dynamic, dynamic, dynamic, dynamic) => dynamic from Function 'foo':.
Arguments: [2]

Closures NOW:
----
Closure call with mismatched arguments: function 'A.foo'

NoSuchMethodError: incorrect number of arguments passed to method named 'A.foo'
Receiver: Closure: (dynamic, dynamic, dynamic, dynamic) => dynamic from Function 'foo':.
Tried calling: A.foo(2)
Found: A.foo(a, b, c)


Statics BEFORE:
----
Unhandled exception:
No top-level method 'foo' declared.

NoSuchMethodError : method not found: 'foo'
Receiver: Type: class '::'
Arguments: []

Statics NOW:
----
Unhandled exception:
No top-level method 'foo' with matching arguments declared.

NoSuchMethodError: incorrect number of arguments passed to method named 'foo'
Receiver: top-level
Tried calling: foo(...)
Found: foo(a, b, c)

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22209 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-30 22:05:14 +00:00
hausner@google.com 51e4445539 Fix debugging of top-level getters
Parser didn't set the valid token range of top-level getters, so they
were invisible to the debugger.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21976 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-24 20:26:14 +00:00
hausner@google.com 9ae17640bf Handle built-in function identical correctly
The parser, rather than the backend, recognizes the built-in function identical
and replaces is with the old token for the === operator. This fixes compile
time constant handling of calls to identical.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21753 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-19 16:26:05 +00:00
srdjan@google.com 5ea0d55fa6 Do not allocate unnecessary ObjectArrays. When allocating an empty growable array, pass it a compile time constant empty array instead of allocating a new empty array at runtime, since the factory method will anyway allocate its own object array of length 4.
Review URL: https://codereview.chromium.org//14023005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21490 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 18:06:59 +00:00
hausner@google.com 54dde7ce89 Implement rethrow statement
Or: how to turn a 5 minute task into a 2 hour ordeal.

The actual business of the change is one line in token.h and one line in parser.cc.
Review URL: https://codereview.chromium.org//14012005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21371 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-12 16:32:37 +00:00
regis@google.com 5900ae72af A patch class must be given the same name as the class it is patching, otherwise
the generic signature classes it defines will not match the patched generic
signature classes. Therefore, new signature classes will be introduced and the
original ones will not get finalized.
Review URL: https://codereview.chromium.org//14097006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21235 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-10 22:34:02 +00:00
regis@google.com bdcca76e3a Prohibit use of dynamic when extending or implementing classes (was crashing).
Added test.
Fix typos in array patch.
Cleanup factory result finalization.
Do not verify field offsets after a finalization error.
Review URL: https://codereview.chromium.org//13992002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21217 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-10 16:43:39 +00:00
hausner@google.com 89346f3e3a Remove legacy syntax support for library import
Remove legacy syntax for #import, #library and #source
Update test programs
Recalc fingerprints of inlined functions that were apparently
affected by the change of library name from "dart:io" to dart.io.
Review URL: https://codereview.chromium.org//12880023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20466 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-25 18:11:08 +00:00
hausner@google.com d4872a1499 Support initialized mixin fields across scripts
Add capability to set parser to read tokens from different
scripts and token positions. This is used when the initializer
expression of a field resides in a different script.
Review URL: https://codereview.chromium.org//12827007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20388 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-22 17:06:42 +00:00
hausner@google.com 595271f2c9 Properly handle cascades in top-level functions
Fix for bug 8530
Review URL: https://codereview.chromium.org//12647012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20279 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-20 17:04:28 +00:00
vegorov@google.com 1c9d22d75c Collect type feedback for fields.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20235 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-19 20:15:10 +00:00
hausner@google.com 8e499806e8 Revise duplicate interface check
Move check for duplicate interfaces from parser to class finalizer.
The parser only compared interfaces by name, which did not work
properly for qualified (imported) names. Now the check happens in the
class finalizer after types are finalized.

Sadly, our test harness does not appear to know how to handle multitests
that import libraries.
Review URL: https://codereview.chromium.org//12837007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20167 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-18 17:34:16 +00:00
hausner@google.com ed2e198b99 Mixins with Generics
This change adds support for generics to mixins. It's not a particularly elegant
implementation, so I expect to change how it works internally in later checkins.

Also, there is still one aspect of the implementation that is incorrect. In the
case of typedef, the newly introduced name is not yet an alias for  the
mixin application. Instead, the MA is a superclass of the typedef name. That
will need to be fixed in a later checkin. I don't want to make this change
bigger.
 
Review URL: https://codereview.chromium.org//12779008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20084 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-15 15:59:24 +00:00
regis@google.com 7b5a610084 Make allocation of Dart parameters and local variables architecture independent.
Enable a couple more vm tests on ARM.
Fix function usage counter access on ARM.
Review URL: https://codereview.chromium.org//12776006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20048 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-14 21:33:03 +00:00
regis@google.com f644ba9791 Complete implementation of bounds checking in the vm, by introducing a vm object
BoundedType that represents a type that could not be checked against an upper
bound at compile time. A BoundedType is verified at run time when used,
typically when it (and/or its bound) gets instantiated.
This fixes issues 7075 and 7625.
Added one test.
Review URL: https://codereview.chromium.org//12473002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19519 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-05 22:04:23 +00:00
hausner@google.com c5634503f7 Fix for loop variable capturing
We had a bug in the capturing of for loop variables that only manifested
itself if another variable outside the loop was captured as well.

Fix for issue 8207 and 8698.
 
Review URL: https://codereview.chromium.org//12381089

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19429 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-04 22:28:55 +00:00
hausner@google.com 34cebe18cb Libraries: update VM to current spec
- Exports allowed in script files
- library name is optional
- delete meaningless test, file co19 bugs
Review URL: https://codereview.chromium.org//12382026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19258 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-28 21:17:47 +00:00
asiva@google.com 3c90369ba6 Add functionality to get full stack trace when exceptions are thrown.
This should address the issue raised in 7813.

try {
 ...
 ...
} on Object catch(e, s) {
 print(s.fullStackTrace);  // This should print the full stack trace.
}
Review URL: https://codereview.chromium.org//12316116

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19179 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 22:47:06 +00:00
hausner@google.com f52edb6446 Less confusing names for mixing application classes
Use names of super and mixin class rather than types.
Review URL: https://codereview.chromium.org//12317150

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19154 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 17:42:24 +00:00
regis@google.com 7c4eec75ed Fix bad optimization prematurely marking types as instantiated (issue 8710).
Add test.
Review URL: https://codereview.chromium.org//12314132

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19101 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 00:32:31 +00:00
hausner@google.com ad61d01daa Progress in generic mixins
Handle generic mixin applications in class declarations, but
not yet in type aliases.
Review URL: https://codereview.chromium.org//12340085

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19097 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-26 23:39:37 +00:00
iposva@google.com b564104ea5 - Properly load the core libraries as libraries and not as scripts.
This will honor their imports and library names.
Review URL: https://codereview.chromium.org//12321082

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19017 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-25 23:25:29 +00:00
regis@google.com 163db76189 Hook up simulator (if needed) when calling Dart code.
Merge identical InvokeDynamic and InvokeStatic to InvokeFunction.
Remove redundant argument from InvokeClosure.
Review URL: https://codereview.chromium.org//12315087

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18994 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-25 19:30:29 +00:00
iposva@google.com c900112af7 - Improve the message for NoSuchMethodErrors that are
determined statically at compile time.
Review URL: https://codereview.chromium.org//12328019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18848 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 18:53:27 +00:00
hausner@google.com 5eba0b69e4 Fix static name resolution in mixing code
In mixin code, static names need to be looked up in the mixin class.
OTOH, in patch classes, we need to resolve static names in the
class into with the code is patched. I'm all for simplicity!
Review URL: https://codereview.chromium.org//12308005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18710 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-19 18:26:55 +00:00
hausner@google.com b4527a7465 First stab at mixins in VM compiler
Things not yet supported:
- Type parameters for super class and mixin class
- super call limitation check
Review URL: https://codereview.chromium.org//12210127

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18479 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-13 21:08:15 +00:00
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
asiva@google.com 97c6554061 Minor cleanup
- added a field parsed_function to the parser
- remove fields expression_temp_ and saved_current_context_
Review URL: https://codereview.chromium.org//12225141

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18402 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-12 21:14:05 +00:00
floitsch@google.com bbbe0c382d Allow ambiguous Expect and ExpectException imports.
This patch temporarily allows Expect to come from core and from any other library without (I wanted to make the CL public reporting an error (or warning).
Once everyone (including co19) has migrated I will revert this CL.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18318 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-11 17:59:52 +00:00
asiva@google.com 80e281a078 Fix for issues 6080 -
- Read the saved context from the entry frame when straddling across C++ frames while iterating over a stack trace in the debugger. This ensures that the correct context is setup in the ActivationFrame structure in these scenarios (instead of the empty context).

- Read the saved context from the caller's frame when iterating over a stack trace in the debugger. The compiler saves the context in the caller frame before invoking closures, we read this saved context when iterating the stack trace.
Review URL: https://codereview.chromium.org//12179020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18235 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-07 22:43:16 +00:00
iposva@google.com fe95f789c8 - Add handling of private dart:_ libraries.
- Make dart:collection-dev a private library by renaming it to dart:_collection-dev.
- Predefine the URIs of dart: libraries as VM symbols.
Review URL: https://codereview.chromium.org//12220027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18159 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-06 00:29:48 +00:00
asiva@google.com cd7b9395b6 Rename the accessor functions saved_context_var and set_saved_context_var to saved_entry_context_var and set_saved_entry_context_var so that it matches the local variable name used. This avoids confusing this with the saved_context_var variable which is used by try statements.
Review URL: https://codereview.chromium.org//12207023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18157 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-05 20:42:33 +00:00
regis@google.com ca927278dc Resubmit reverted r17962, but, for now, only report error about unfinalized
types if flag --error_on_malformed_type is specified.
Fix one more case of unfinalized signature type.
Review URL: https://codereview.chromium.org//12183014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18033 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-04 05:51:02 +00:00
antonm@google.com 5a9cc92093 Revert changes 17962-3 which break Dartium Debug build.
TBR=ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17977 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-01 12:45:42 +00:00
regis@google.com 650ae359a4 Fix class patching involving type parameters: type parameters of patched classes
were not finalized.
Simplify and fix function type alias finalization (remove dummy alias owner).
Make sure no unfinalized types or unresolved classes are written to a snapshot.
Verify that all pending classes are finalized before writing a snapshot.
Make snapshot_test more resilient to finalization errors.
Add missing import to snapshot_test.dart.
Fix typo in growable_array.dart.
Review URL: https://codereview.chromium.org//12123002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17962 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-01 02:40:16 +00:00
regis@google.com 517f653176 Fix argument test for the captured parameter of an outer function (issue 8007).
Review URL: https://codereview.chromium.org//12036088

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17592 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-24 19:14:55 +00:00
asiva@google.com f4fe42c280 Added macros OBJECT_IMPLEMENTATION and FINAL_OBJECT_IMPLEMENTATION
which have different implementations of 'operator=' and 'operator^='.
In the case of FINAL_OBJECT_IMPLEMENTATION we do not do the vtable setting
in these methods (Note the |= operator functionality is now subsumed into
the new implementation of "operator^=")
Review URL: https://codereview.chromium.org//12052033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17491 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-23 20:01:31 +00:00
hausner@google.com dc3bf6646a Stop supporting map literals with 1 type argument
To be checked in next week Tue (Jan 22)

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17410 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-22 16:48:00 +00:00
kmillikin@google.com 265ff9453d Allow cascades in initializer lists.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17383 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-22 10:08:57 +00:00
srdjan@google.com 7159a6f103 Some more ^= to |=
Review URL: https://codereview.chromium.org//12017020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17310 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 20:43:33 +00:00
asiva@google.com 069b3dabc4 Use new |= operator instead of ^= where it is possible to do so.
Review URL: https://codereview.chromium.org//11941005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17302 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 18:47:03 +00:00
vegorov@google.com a77fc9701c When requested to extract a method M from class C inject a method extractor (consisting of a single AST node CreateClosure) as a getter get:M into C.
This allows to cache and optimize method extraction requests as normal method invocations and at hot method extraction sites that significantly decreases overhead of method extraction which previously required two trips into runtime system and was not cached at all.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17261 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 11:54:45 +00:00
hausner@google.com 0b01d53bd9 Remove support for old style function literals
Fix issue 6709.

TBR=iposva
Review URL: https://codereview.chromium.org//11996003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17245 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 00:24:19 +00:00