Commit Graph

177 Commits

Author SHA1 Message Date
regis@google.com 6c92ec5439 Simplify VM internal representation of a mixin application clause (MixinAppType
object) by removing some redundant field and type arguments.
Tolerate mixins with wrong number of type arguments and update tests.
Note: this is a first cleanup step in preparation of more mixin bug fixes.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27363 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-11 00:41:07 +00:00
hausner@google.com fd57843900 Update handling of ambiguous name references
Update VM to latest spec. Referencing a name that is imported
from more than one library is no longer a compile-time error.
If one of the sources of an ambiguous reference is a dart library,
the dart library declaration is automatically hidden.

Also fixes a bug where looking up a getter name in a library
found the getter even though the name is filtered out in the
'hide' combinator.

Long-term we should fix the need for repeatedly convert between
the mangled getter and setter names and the untangled name.

Fixes 12915, 12913, 12724.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27312 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-09 21:52:40 +00:00
regis@google.com 765aac1496 Keep track of the application of a mixin type to a mixin application class,
which includes setting up its type parameters (fix issue 12871).

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27157 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-04 22:21:36 +00:00
regis@google.com 93059fe3cf More cleanup related to malformed and malbounded types.
Remove support for warnings in parser and related flags.
Rename flag --error-on-malformed-type to --error-on-bad-type, since it covers
both malformed and malbounded types (also closer to --error-on-bad-override).

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26677 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 23:24:01 +00:00
regis@google.com 81bcb1f18a Distinguish between malformed and malbounded types (fix issues 12552 and 12554).
Add test.
Update status files.

Explanation of change: A malbounded type argument should not be mapped to
dynamic, as is a malformed type argument.
This change also adds a bunch of TODOs related to the encounter of malbounded
types in unexpected places.
A follow-up change will address these TODOs, add more tests, and may simplify
code that is still handling malformed types where they cannot occur anymore
after the spec simplified their handling.

R=hausner@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26665 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 17:56:02 +00:00
regis@google.com 0ab840ae98 Fix bound checking in self referencing type (issue 12553).
Added test.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26444 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-21 17:22:18 +00:00
jacobr@google.com 605b33c1bc fix cpp11 compile errors
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26387 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-20 20:24:11 +00:00
regis@google.com f9df206e2e Report compile-time errors for conflicting overrides as specified by latest
language spec (fix issue 12342).
Add override conflict tests.
Update status files.
Add support for 'ok' status in multi-tests.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26302 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-16 23:39:41 +00:00
rmacnak@google.com 8bdc9b5696 Cleanup making Null a public class of dart:core in the VM. Remove special cases for Null in lookup and compile-time type tests.
BUG=http://dartbug.com/12364
R=asiva@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26205 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-15 18:34:23 +00:00
lrn@google.com 14a75969c3 Add Null class to dart:core.
Make dart2js accept this class as the type of `null`.

Dart2js still fails on tests on the form: x is Null
VM does not recognize Null as the type of `null`.

BUG= http://dartbug.com/12382
R=fschneider@google.com, karlklose@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26175 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-15 09:12:19 +00:00
regis@google.com dd9d0b1f36 Make sure type information is not lost in snapshots created in production mode,
since they can be executed in checked mode.
Add snapshot test.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26127 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-14 15:52:41 +00:00
fschneider@google.com 447ddebd68 Fix equality of implicit closures in the Dart VM.
This CL also lifts the restriction that classes could not
extends or implement 'Function'.

BUG=https://code.google.com/p/dart/issues/detail?id=10849
BUG=https://code.google.com/p/dart/issues/detail?id=12411

TEST=tests/language/bound_closure_equality_test.dart,
tests/language/black_listed_test.dart

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26114 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-14 11:43:50 +00:00
fschneider@google.com 0b94e4c329 Clean up VM class DartFunction.
DartFunction was the VM-internal class associated with
the Dart class "Function". It does not have any functionality
on it and therefore we don't need a VM-internal class for it.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26063 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-13 17:05:46 +00:00
regis@google.com 9eb12ad303 Implement updated method overriding rules in the vm (issue 11495).
Introduce --error-on-bad-override flag and use it when generating snapshots.
Fix signature checking when patching methods.
Fix errors in patch files.
Fix receiver type of constructors.
Fix finalization of mixin application typedefs.
Update tests and status files.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26027 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-12 20:28:52 +00:00
hausner@google.com 2c4b0c880a Forwarding constructors are never const
Forwarding constructors of mixing application classes do not
inherit the super constructor's const-ness. They are also
never abstract or external.

Fixes issue 11917.

R=ahe@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25765 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-05 12:13:36 +00:00
regis@google.com 3b7cdf80a0 Update VM to handle malformed types according to revised spec (issues 9055,
12105, 7247).
Update language tests.
Update status files.
Allow map literals to specify a key type that is not a String.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25666 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-31 15:20:28 +00:00
regis@google.com b55b249409 Delay resolution of redirecting factory targets in order to avoid class
finalization cycles (issue 12041).
Ensure that a super class is finalized before the class extending it.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25532 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-26 18:18:56 +00:00
regis@google.com 7b9a84dfbb Implement more restrictive checking of typedefs illegally referring to
themselves and fix vm issue 9611.
Update a test and add a test.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25382 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-23 23:17:42 +00:00
regis@google.com 9581071936 Refactor resolution code in the vm to properly handle ambiguity errors.
Add test.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25324 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-23 00:19:39 +00:00
regis@google.com 4891c126bb Fix generic mixins (issue 11803).
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25136 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-18 00:23:04 +00:00
hausner@google.com 4c629b9b50 Implement forwarding constructors for mixins
By popular demand, fixes issue dartbug.com/9339

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24977 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-12 22:09:18 +00:00
regis@google.com 71f88546cc Stop resolving classes prematurely in the vm (issue 11023).
Add missing class finalization to mirrors tests.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24965 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-12 17:59:17 +00:00
fschneider@google.com f260416fb8 Support fast noSuchMethod dispatch for any number of arguments.
Until now, the fast dispatch was only available with getters and
zero argument methods.

This CL generalizes the approach to any number of arguments. The
dispatcher functions that are auto-generated by the compiler
are not attached to the class anymore. Instead the dispatcher
is only stored in the IC data of each call site. Each class
contains a cache of dispatcher function that map
(name, arguments descriptor) => dispatcher.

This also fixes a bug where the VM report a wrong error message
when throwing a NoSuchMethodError.

BUG=https://code.google.com/p/dart/issues/detail?id=11528
BUG=https://code.google.com/p/dart/issues/detail?id=11223
TEST=tests/language/no_such_method_dispatcher_test.dart
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24876 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-10 10:09:14 +00:00
hausner@google.com 8b8795fc0b Const constructor must have const super initializer
Compile time error if a const constructor calls a non-const super
constructor (either explicitly or implicitly).

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24704 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-02 20:09:24 +00:00
fschneider@google.com 0bf7251d1a Reland: Optimizing noSuchMethod invocation with no arguments.
This is the same CL as https://codereview.chromium.org/17315008/ with
one bug fixed:

If a method is invoked with a mismatching number of arguments, we don't
add a no-such-method-dispatcher function since the dispatcher currently
can only invoke noSuchMethod and would not work if the method
is invoked with correct arguments at a later point.

I extended the test to cover that case.

TEST=tests/language/no_such_method_dispatcher_test.dart
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24351 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-24 17:18:51 +00:00
fschneider@google.com 48555c83ac Back out r24266 to investigate dartium test failure.
TBR=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24284 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 11:56:32 +00:00
fschneider@google.com ab1981b421 Optimizing noSuchMethod invocation with no arguments.
On each call that triggers a noSuchMethod invocation we 
attach a custom dispatch function that allocates the 
invocation object and invokes noSuchMethod. This dispatcher
is compiled and optimized like a normal Dart function.

Similar to method-extractors, these implicit dispatchers
do not show up as normal functions.

As a first step this CL only handles invocations of getters
and methods with no like o.foo or o.foo().  This CL gives
a >25x speedup of such noSuchMethod invocations. Calls with
multiple arguments still go through the slow path.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24266 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 07:31:51 +00:00
asiva@google.com 69b5efffd2 Create specific null read only handles for the frequently used types
Array, String, Instance, Object and use them.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23785 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-08 00:47:35 +00:00
asiva@google.com 3f97d1492a More cleanup to avoid creation of redundant handles
- create read only handles for null object and sentinel smi value
- add a RawCast function to allow direct casting of Raw pointers without the
  need to create a Handle for it
- use Smi::Value where possible
- hoist out handle creation from some loops

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23502 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 22:55:29 +00:00
asiva@google.com e33c2d4254 Delay Class parsing until the class is actually used.
Prior to this change the initial heap sizes were as follows:
ia32:
Size of isolate snapshot = 1230921
New space (0k of 32768k) Old space (1446k of 1604k)

X64:
Size of isolate snapshot = 1223943
New space (0k of 32768k) Old space (2630k of 2692k)


After this change the initial heap sizes are as follows:
ia32:
Size of isolate snapshot = 686443
New space (0k of 32768k) Old space (677k of 836k)

X64:
Size of isolate snapshot = 684731
New space (0k of 32768k) Old space (1220k of 1412k)

R=hausner@google.com, iposva@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23115 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 00:13:10 +00:00
asiva@google.com da9d1d664f Add a call to CheckIsolateState in all paths of Dart_GetField and Dart_SetField.
R=ager@chromium.org

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22893 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-20 16:02:30 +00:00
ager@google.com 63c98181b0 Fix wrong typed_data change.
R=asiva@google.com, floitsch@google.com, srdjan@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21873 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-23 12:06:00 +00:00
ager@google.com 431954b584 Rename dart:typeddata to dart:typed_data.
R=asiva@google.com, floitsch@google.com, srdjan@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21871 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-23 11:54:54 +00:00
zra@google.com 069456803e Implements features to run "Hello, world!" on simulated MIPS.
Review URL: https://codereview.chromium.org//14246039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21759 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-19 18:31:47 +00:00
regis@google.com a75f98dbe3 Implement missing features to run Hello world! on simulated ARM.
Review URL: https://codereview.chromium.org//14153004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21582 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-16 21:53:09 +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
asiva@google.com ecc5b67833 - Create an all static TypedDataView class which uses implicit field offset
values to get direct access to the fields of a typed data view object.

- Added a verification step after class finalization to ensure that the
  implicit field offsets in TypedDataView match the actual values in the
  dart instance.
Review URL: https://codereview.chromium.org//13472019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20948 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 05:19:36 +00:00
regis@google.com 158d90d50f Prevent expensive and unnecessary error formatting in the case a bound check is
postponed to run time (issue 9106).
Eliminate bound check at compile time in some cases.
Fix bound checking of mutually referencing bounds.
Added test.
Review URL: https://codereview.chromium.org//13653005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20938 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-04 20:24:49 +00:00
asiva@google.com 2f7ca6843f Remove support for 'dart:scalarlist' in the Dart VM.
Review URL: https://codereview.chromium.org//13139002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20680 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-29 18:33:54 +00:00
regis@google.com 3e4d359fce Fix an F-bounded quantification bug (issue 9291).
Add regression test.
Review URL: https://codereview.chromium.org//13119022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20576 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-27 20:42:02 +00:00
asiva@google.com da200f7133 Limit handle scope to the loop in order to avoid creation of large number of handles when finalizing classes of a large application.
Review URL: https://codereview.chromium.org//12593015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20387 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-22 17:04:08 +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
asiva@google.com fc899d671a Add the typed data classes to the do not extend list.
Review URL: https://codereview.chromium.org//12528013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19708 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-08 18:40:05 +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 0320d0551c Fix order of mixin application during class finalization
Review URL: https://codereview.chromium.org//12355002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19170 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 20:58:07 +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
hausner@google.com d3a1050ebc Minor improvement in mixin application
Build list of functions and attach it to mixing application
class on one call. Takes care of a review comment by Siva.

TBR=asiva
Review URL: https://codereview.chromium.org//12261029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18495 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-13 23:48:18 +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