Commit Graph

2008 Commits

Author SHA1 Message Date
hausner@google.com 44376ee4a5 Retrieve value of local variables in stack frames.
Works for stack-based variables. Need more work to distinguish between
stack and context (captured) variables.
 
Review URL: http://codereview.chromium.org//9019029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2736 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-22 00:17:15 +00:00
asiva@google.com 69c9c61ee7 Use StorePointer instead of direct assignments of objects.
Review URL: http://codereview.chromium.org//9007032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2674 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-20 22:38:12 +00:00
hausner@google.com 503e2219b8 First part of inspecting local variables
This change introduces variable descriptors that describe the name, stack slot index, and source code stretch in which a variable is valid.

Activation frames in the stack trace now can enumerate the variables that are active in that frame.

Next step: fetch the value of variables from the stack.
Review URL: http://codereview.chromium.org//8992020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2671 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-20 21:40:28 +00:00
asiva@google.com 77dba39e63 Add Double::NewCanonical and Mint::NewCanonical so that it is possible to
canonicalize double and mint constants without having to create an object first.
Review URL: http://codereview.chromium.org//8963001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2496 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-16 00:31:33 +00:00
asiva@google.com 79857c7d20 Changes to set up the object tag bits
- sets up canonical
- sets up created from a snapshot
Added code to capture the tag bits during snapshot generation.
Review URL: http://codereview.chromium.org//8879063

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2436 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-14 18:09:18 +00:00
regis@google.com dd32effb72 Adjust index of type parameters at finalization time (fix issue 718).
Add test.
Review URL: http://codereview.chromium.org//8872037

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2286 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-08 23:00:55 +00:00
asiva@google.com 566ff2b3cf Add a tags field to RawObject so that we can tag objects with certain values,
e.g:
- object is canonical
- object was created from snapshot
etc.

Once we have class Ids implemented the current class_ and flags_ words can be
compressed into a single header word.
Review URL: http://codereview.chromium.org//8827016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2211 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-08 00:43:06 +00:00
srdjan@google.com f98993384f Canonicalize TypeArguments.
Review URL: http://codereview.chromium.org//8773026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2133 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-06 17:47:47 +00:00
asiva@google.com 7ddd0f0b89 First step towards generation of application script snapshots
- Introduce 3 kinds of snapshots (full, application script and messages)
- Added a dart API function to be used for generating an application snapshot
  and for loading the script from an application snapshot.

Next step is to introduce special handling in the WriteTo and ReadFrom
snapshot functions for 'kind == Snapshot::kScript'
Review URL: http://codereview.chromium.org//8772061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2105 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-06 00:34:49 +00:00
hausner@google.com f296131d32 Fix linux build
Mac doesn't care when you compare signed and unsigned values it seems...
Review URL: http://codereview.chromium.org//8803025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2091 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-05 21:40:44 +00:00
turnidge@google.com 1abf65b434 Add Dart_IsExternalString and Dart_ExternalStringGetPeer to the dart
embedding api.
Review URL: http://codereview.chromium.org//8775039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2080 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-05 17:55:01 +00:00
srdjan@google.com d07087ce77 Ongoing renaming of type classes:
TypeArguments -> AbstractTypeArguments
TypeArray -> TypeArguments
Review URL: http://codereview.chromium.org//8776020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2002 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 23:19:59 +00:00
srdjan@google.com 2ff4d8a207 Address Regis' comments, replace AbstractType with Type where possible.
Review URL: http://codereview.chromium.org//8772009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1992 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 21:14:48 +00:00
srdjan@google.com 17552e9a3c Renaming type classes as discussed:
Type -> AbstractType
ParameterizedType -> Type

TODO: 

TypeArguments -> AbstractTypeArguments
TypeArray -> TypeArguments
Review URL: http://codereview.chromium.org//8761011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1987 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 16:54:52 +00:00
srdjan@google.com 0063555050 Use ParametrizedType instead of Type where appropriate. Expand ToCString of type related classes. Do not instantiate abtract classes Type and TypeArguments (e.g., through Type::null());
Review URL: http://codereview.chromium.org//8742028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1941 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-30 21:14:22 +00:00
regis@google.com f43ffceffd Update function type checking in VM after spec change (issue 444):
- the return types must be covariant or contravariant (an earlier version of the
  guide specified contravariance only).
- the names of optional parameters must match in the same order (an earlier
  version of the spec specified that any subset was allowed, no order required).
Review URL: http://codereview.chromium.org//8664015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1898 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-29 17:00:16 +00:00
regis@google.com 5382e56f05 Optimize type checks of list and map literals.
Introduce an ast node for explicit 'assignable to' type checks.
Remove Instance::Is() helper.
Review URL: http://codereview.chromium.org//8678031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1827 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-24 00:26:18 +00:00
turnidge@google.com a31b5a59f7 Start using UNWRAP_NONNULL to check inputs to dart api functions.
Improve a few error messages.

Lots of testing.
Review URL: http://codereview.chromium.org//8528018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1712 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-21 19:09:51 +00:00
cshapiro@google.com 1cff31c3d0 Implement external strings.
External strings refer to character data in memory located outside of
the managed heap.  This memory is considered to be owned by the
embedding application.  To help with the management of external
memory, the virtual machine allows the embedding application to
register for a "death notice" when an external string object is
garbage collected.  A death notice takes the form of a callback
invoked by the garbage collector with the address of the external
memory.  Death notices will be implemented in the garbage collector by
future commit.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1679 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-19 00:33:23 +00:00
asiva@google.com 5e6441a5cd Change loaded_ flag in RawLibrary to load_state_ in order to register different
states of the load process.
This state can then be used to ensure we report errors on duplicate loads.
Review URL: http://codereview.chromium.org//8520030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1643 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-18 00:09:13 +00:00
asiva@google.com 9f49e2bf74 Implement automatic loading of dart:core_native_fields library
with predefined classes having native fields.
Classes that need native fields in them can import this library and
extend these predefined classes.
Review URL: http://codereview.chromium.org//8537023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1629 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-17 21:04:43 +00:00
cshapiro@google.com 1309ebd16e Add an external array type to support typed arrays.
Review URL: http://codereview.chromium.org//8429027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1601 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-17 03:18:52 +00:00
regis@google.com 3c64ffe9a3 Support correct factory syntax in the VM as decribed in the spec.
Change the default value of --silent_warnings from true to false, so that
warnings are visible when legacy factory syntax is used.

In order to facilitate transition of libraries and user programs, legacy factory
syntax is still supported by 2 workarounds, but warnings are printed.

The first workaround allows the factory clause to omit the type
parameter list, which otherwise has to match exactly with the list of
type parameters in the factory class declaration.

The second workaround allows a factory method to omit the type
parameter list. In that case, the type parameter list of the enclosing
class is used instead.

Workarounds will be removed to enforce correct factory syntax at a later time.
Review URL: http://codereview.chromium.org//8585004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1595 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-16 23:49:04 +00:00
cshapiro@google.com eccf8cdae6 Use a common subroutine for the snapshot reading and writing of strings.
Review URL: http://codereview.chromium.org//8340017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1517 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-14 18:03:02 +00:00
regis@google.com 8b9ebb3528 Second attempt at finalizing all classes in the VM (fix issue 364).
Review URL: http://codereview.chromium.org//8491055

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1475 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 21:38:49 +00:00
turnidge@google.com 8c64adf13e Deal with unhandled exceptions the same way in all Dart api functions.
--

Terminology change: invalid handles are now called error handles.

Unhandled exceptions used to be a kind of valid handle.  Now they are
a kind of error handle.

For the Dart_Invoke* functions, this means that the standard
error-checking blob drops from two tests to one test and is
harder to mess up.

Many other Dart api functions (Dart_ToString, for example) previously
dealt with unhandled exceptions by turning them into terse error
messages.  Now these functions preserve information about the
exceptions and generate better error messages.

Changed Dart_HandleMessage to return success/failure.  It seemed to fit.

--

Details:

Dart_IsValid becomes Dart_IsError (negated sense).

Dart_GetError now knows how to print a stack trace semi-nicely.

Dart_ExceptionOccurred -> Dart_IsUnhandledException.

Renamed ApiFailure class to ApiError to fit better.

ApiError now has a "data" pointer that points to either an error
message string or to an unhandled exception object.

Documentation changes aplenty.
Review URL: http://codereview.chromium.org//8501034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1470 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 19:31:04 +00:00
regis@google.com a6282231eb Revert r1380 that is breaking frog.
Review URL: http://codereview.chromium.org//8509031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1382 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-10 01:39:06 +00:00
regis@google.com 8dd26ba9f6 Finalize all classes (fix issue 364).
Review URL: http://codereview.chromium.org//8506001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1380 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-09 23:33:48 +00:00
srdjan@google.com 6b6d16a41e Add type check tracing (--trace_type_checks). Inline type checks with class types that have only Dynamic type arguments (or none) and with List<Dynamic> interface.
Review URL: http://codereview.chromium.org//8503034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1372 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-09 21:36:32 +00:00
srdjan@google.com 8237924b4a Runtime type checking should be skipped for Object as destination type.
Review URL: http://codereview.chromium.org//8503028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1329 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-08 21:36:31 +00:00
srdjan@google.com 67cee5e5d2 Intrinsify String.charCodeAt, String.length and String.hashCode. Improves frog performance by 2x.
Review URL: http://codereview.chromium.org//8440051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1120 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-02 20:42:23 +00:00
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 4bc0c5eecc Simplify canonicalization of constants and types.
Review URL: http://codereview.chromium.org//8442001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1053 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-01 23:38:09 +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
antonm@google.com cf53ea78d7 Make DartVM build with clang.
Review URL: http://codereview.chromium.org//8381037

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@966 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-31 19:07:48 +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
srdjan@google.com ffaec5255d Store IC data instead of array of classes in AST node, so that we can easier access targets and future multi-check IC data.
Review URL: http://codereview.chromium.org//8394061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@770 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-26 18:47:17 +00:00
regis@google.com d03b6815fe Complete generic closure type checking.
Disable a bad test in co19 (issue 5512850).
Replace workaround by permanent fix for issue 5474672.
Review URL: http://codereview.chromium.org//8391007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@713 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-25 20:21:22 +00:00
srdjan@google.com 5f43c05de7 Implement new inline cache. Delete a lot of unused code (most of change).
Review URL: http://codereview.chromium.org//8379013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@706 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-25 18:35:49 +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
cshapiro@google.com f52039f03c Implement case mapping using the Unicode default case mapping algorithm.
BUG=5425968

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@616 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-21 20:33:29 +00:00
regis@google.com a019951eb9 Fix member overriding rules in VM according to latest spec.
Fix tests accordingly.
Review URL: http://codereview.chromium.org//8360022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@607 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-21 17:44:04 +00:00
asiva@google.com 61a641bdcf Add an imported into list for libraries so that it is possible to lookup
the local scope at the imported site in order to check if a variable is already
defined.

Added a check for duplicate definitions during class finialization which
checks for duplicate definitions.
Review URL: http://codereview.chromium.org//8342046

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@593 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-20 23:29:06 +00:00
turnidge@google.com 368f37895f Use the distinguished class, ApiFailure, to signal when a Dart_Result is
invalid.

We eventually plan to drop the Dart_Result type entirely, but this change allows us to try out the functionality before we munge the user-visible api.
Review URL: http://codereview.chromium.org//8334009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@566 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-19 18:41:33 +00:00
cshapiro@google.com aa427ff3dd Use the narrowest character width possible for substrings.
Review URL: http://codereview.chromium.org//8346014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@540 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-18 22:36:16 +00:00
regis@google.com 715f9a9700 Address review comments of previously submitted cl 8329005.
Review URL: http://codereview.chromium.org//8347008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@531 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-18 21:07:44 +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
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
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
asiva@google.com 9c927f8e02 Ensure that the passed in raw pointer is not used in SetRaw().
Review URL: http://codereview.chromium.org//8231028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@404 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-13 17:10:35 +00:00