Commit Graph

1278 Commits

Author SHA1 Message Date
hausner@google.com 7651034e9e Two-phase constructors
This CL fixes the initializer evaluation order and brings the VM fully up to spec.

Constructors are executed in two phases: the initializer phase and the constructor body phase. An additional implicit parameter tells the constructor code whether to execute the initializer list or the body (or both).

If the super initializer call is not at the end of the initializer list, the super constructor has to be called twice. The arguments to the super initializer have to be evaluated and stored in temporary local variables. At the beginning of the constructor block, a second implicit super call is inserted.

If the super initializer call happens to be at the end of the list, none of this madness has to happen, except for the extra implicit parameter to the constructor.

 
Review URL: http://codereview.chromium.org//8440014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1102 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-02 17:19:15 +00:00
regis@google.com 3125475ef8 Canonicalize types.
Review URL: http://codereview.chromium.org//8372041

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1045 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-01 22:00:06 +00:00
regis@google.com a8478d5312 Fix parsing of named parameters (issue 243).
Add corresponding test.
Review URL: http://codereview.chromium.org//8387046

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@973 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-31 21:16:15 +00:00
asiva@google.com b245c234f0 Report NullPointerException when we try to construct a regular expression
using a NULL pointer.
Report NullPointerException instead of ObjectNotClosureException when the
closure object is Null.
Review URL: http://codereview.chromium.org//8363034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@901 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-28 17:32:29 +00:00
regis@google.com 1df8ca858e Rename the VM internal 'var' type to 'Dynamic' type.
This change does not implement support for the built-in identifier 'Dynamic'.
Review URL: http://codereview.chromium.org//8403003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@779 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-26 20:58:34 +00:00
turnidge@google.com e756497a78 Refactor the dart api a bit:
- Dart_Result is gone.  Dart_Handle mostly replaces it.
- Name/signature changes
  - IsValidResult -> IsValid
  - GetErrorCString -> GetError
  - many more...
- Make details of persistent handle freelist private.
- Add persistent "True" handle to api state.

Things I am not doing in this changelist:

- Documentation updates
Review URL: http://codereview.chromium.org//8380020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@778 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-26 20:38:41 +00:00
regis@google.com 0b98430a58 Cleanups.
Review URL: http://codereview.chromium.org//8390021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@726 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-25 23:16:16 +00:00
hausner@google.com 48304ec6d7 Implicitly move super constructor call
Implicitly move super constructor call to the end of the initializer
list. Some code failed after r412.
Review URL: http://codereview.chromium.org//8380023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@663 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-24 23:06:01 +00:00
regis@google.com d2e9c47e77 Fix wrong detection of duplicate definition of function types (issue 187).
Duplicate import of a function type alias must be detected, but duplicate
import of a compiler generated canonical function type is necessary for proper
class resolution and is permitted.
Add tests.
Review URL: http://codereview.chromium.org//8375033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@658 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-24 22:31:30 +00:00
srdjan@google.com 584a6f81b4 Some performance improvements to make raytracer faster (e.g, support intensified operation in mixed double/smi, constant folding).
Review URL: http://codereview.chromium.org//8355041

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@596 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-21 07:03:17 +00:00
regis@google.com ee3fdf27e4 Replace calls to Class::IsParameterized() by either
Class::NumTypeParameters() > 0
or by
  Class::NumTypeArguments() > 0.
Review URL: http://codereview.chromium.org//8329005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@503 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-18 00:59:54 +00:00
hausner@google.com ab37c41e1d Interpolated strings are never considered compile time const
Review URL: http://codereview.chromium.org//8318031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@500 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-17 23:51:28 +00:00
regis@google.com 7c2f02849c Merge the 3 different closure nodes into a single node.
Review URL: http://codereview.chromium.org//8294013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@485 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-17 20:22:42 +00:00
regis@google.com 4d24678892 Set type argument vector at compile time in type of closure parameters; this
require the introduction of a signature type cached in signature functions.
Support printing of the name of an instantiated signature type, e.g. print
'(int) => int' instead of '<T>(T) => T<int>'.
Avoid cycles when printing the name of illegal types during error reporting by
checking that the type is not being finalized.
Review URL: http://codereview.chromium.org//8289027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@479 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-17 19:03:32 +00:00
regis@google.com dc895f3138 Rename class AssertError to AssertionError in the VM (fix issue 119).
Move VM specific tests to the correct tests directory.
Enable asserts in the VM when type checks are enabled.
Review URL: http://codereview.chromium.org//8294005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@460 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-14 22:02:50 +00:00
regis@google.com c09dfa132e Set type argument vector at run time in instantiated closure objects.
Set type argument vector at compile time in type of closure variables.
TODO: Set type argument vector at compile time in type of closure parameters.
Review URL: http://codereview.chromium.org//8271008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@416 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-13 21:34:48 +00:00
hausner@google.com 13da6d834f Create implicit super constructor call if necessary
Create an implicit call to the super constructor if no explicit
call is present, and also if the constructor does not have an
initializer list at all.

The evaluation order is still not conforming to the spec. Thus,
a couple of tests that happened to pass before now fail.

Fix issue 85
https://code.google.com/p/dart/issues/detail?id=85
Review URL: http://codereview.chromium.org//8286003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@412 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-13 20:16:38 +00:00
asiva@google.com 60f1913eb2 Changes to handle unresolved qualified identifiers.
Review URL: http://codereview.chromium.org//8247014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@411 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-13 20:09:21 +00:00
hausner@google.com 08a5cffb3b Implement index operator super call
Last portion of super operator calls.
Review URL: http://codereview.chromium.org//8234022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@359 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-11 23:50:19 +00:00
regis@google.com 19208574f0 Inline allocation of implicit closures.
Consolidate generation of closure allocation stubs into one function.
Fix type name printing when printing ast.
Review URL: http://codereview.chromium.org//8234016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@357 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-11 23:42:20 +00:00
hausner@google.com a487770657 Implement super operator calls
Review URL: http://codereview.chromium.org//8222015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@335 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-11 16:49:35 +00:00
asiva@google.com fdb5d9a607 Fix compilation warnings/errors seen with newer versions of gcc compiler.
Review URL: http://codereview.chromium.org//8222017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@321 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-11 00:37:11 +00:00
hausner@google.com 51bfa4841e Supercall skipping
Trivial change. Fixes b/5384453
Review URL: https://chromereviews.googleplex.com/3570015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@244 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-07 18:02:30 +00:00
kasperl@google.com de889ee719 Get rid of the support for the old parameter syntax.
I've CC'ed Matthias too and I wouldn't be surprised if he can
find a nicer way of dealing with this, but this is pretty
simple and allows me to make progress on getting rid of the
old syntax.

R=iposva@google.com
BUG=
TEST=

Review URL: https://chromereviews.googleplex.com/3569013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@199 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-07 08:03:04 +00:00
cshapiro@google.com 9aca46d2a7 Implement support for reading and writing UTF-8 encoded strings.
In the past, characters in C strings were assumed to encode themselves
and when converting Dart strings to C strings characters were narrowed
to 8-bit values.

With this change, C strings are assumed to be UTF-8 encoded.
Converting a C string to a Dart string applies UTF-8 decoding and
converting a Dart string to a C string applies UTF-8 encoding.

Also part of this change are new methods to construct uninitialized
string objects and to copy string data.

BUG=5343358

Review URL: https://chromereviews.googleplex.com/3557012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@169 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-06 22:42:24 +00:00
regis@google.com db3a736c33 Support optional named arguments at the dart_entry level in the VM.
Fix bug 5422033: Const expressions don't work with named arguments.
Review URL: https://chromereviews.googleplex.com/3552015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@168 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-06 22:40:45 +00:00
hausner@google.com b8a55bf3d7 Initializer expressions must not access 'this'
Catch explicit and implicit accesses to 'this' in initializer list of constructors.
Review URL: https://chromereviews.googleplex.com/3517020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@81 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 22:39:25 +00:00
dgrove@google.com 4c0f559d23 Initial checkin.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00