Commit Graph

188 Commits

Author SHA1 Message Date
asiva@google.com a7b617c5d4 Provide implementations for
Dart_ScalarListAcquireData & Dart_ScalarListReleaseData
Review URL: https://codereview.chromium.org//12209075

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18330 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-11 19:48:32 +00:00
asiva@google.com c64871d699 First set of changes towards cleaning up the bytearray access APIs
- Added unimplemented versions of Dart_ByteArrayAcquireData and
  Dart_ByteArrayReleaseData
- Added infrastructure to prevent callbacks into an API function that
  allocates a new object on the Dart heap or invokes dart code.
- Removed the old Dart_ByteArrayGet* access functions as it was felt that
  they have become redundant once we provide direct access to the internal
  data pointers.
- Removed DARTSCOPE_NOCHECKS as it seems to be redundant after the change
  to not create explicit stack zones on each Dart API call.
Review URL: https://codereview.chromium.org//12036098

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17958 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-31 23:56:48 +00:00
asiva@google.com c2cafbbe33 - Change the layout of external typed array objects to avoid the extra indirection when accessing elements in the array.
- Change the Dart API which create these external arrays to account for this change
Review URL: https://codereview.chromium.org//12093071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17937 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-31 18:53:21 +00:00
ager@google.com 6c6e8f4f4e Change a couple of API functions to return unhandled exception errors instead of fatal errors on immutable array (by calling into dart code for immutable arrays).
Add regression tests.

We should look at all the API errors returned from the API and
figure out if they should actually be fatal errors or just
exceptions.

R=iposva@google.com,sgjesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17750 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-29 10:15:50 +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
asiva@google.com 8579ac9bb5 Allow externalization of canonical strings also. Only restrict canonical strings
in the VM isolate heap.
Review URL: https://codereview.chromium.org//11969029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17437 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-23 05:57:29 +00:00
srdjan@google.com d56766f251 More ^= to |=
Review URL: https://codereview.chromium.org//11941021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17308 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 19:43:19 +00:00
fschneider@google.com 3e94e4a2fa Fix bug in optimization in the presence of externalized strings.
The class-id of string objects can be changed via the Dart API. The optimizer
has to disable hoisting class-id checks across calls. For now, loop-invariant
code motion is disabled for checks of string class-ids.
Review URL: https://codereview.chromium.org//11867020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17288 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 16:29:02 +00:00
hausner@google.com eee56248f0 Remove support for legacy abstract declarations
Make keyword 'abstract' illegal in front of class member declarations.
Review URL: https://codereview.chromium.org//12016005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17243 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 00:01:14 +00:00
srdjan@google.com 37a715bbbf Lookup functions by name that contains the private key, except for dart_api which allows ignoring the private key.
Review URL: https://codereview.chromium.org//11968022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17178 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-17 00:42:03 +00:00
srdjan@google.com 843e48f6f0 Add Dart class for _ExternalUint8ClampedArray and API to allocate it.
Review URL: https://codereview.chromium.org//11881031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17040 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-15 01:14:17 +00:00
iposva@google.com 3e367a12d8 - Consolidate verbose-gc output to be a single line which can be imported easily into spreadsheets.
Review URL: https://codereview.chromium.org//11734028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16624 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-04 02:15:36 +00:00
regis@google.com cb27634842 Remove NoSuchMethodErrorImplementation class and use NoSuchMethodError from core
lib instead.
Review URL: https://codereview.chromium.org//11712002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16583 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-02 18:52:28 +00:00
asiva@google.com e2e6ae3437 Fix windows build.
Review URL: https://codereview.chromium.org//11566025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16152 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-14 07:17:27 +00:00
asiva@google.com 0a5bf36268 Changes per discussion with Anton
- Add a new API call Dart_StringTolatin1 so that the contents of a
  string object that satisfies Dart_IsStringLatin1 can be gotten
- Tweak Dart_MakeExternalString to copy out the contents of the string
  for valid string objects that can not be externalized by the VM
  (e.g strings in the VM isolate)
Review URL: https://codereview.chromium.org//11580003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16149 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-14 06:44:26 +00:00
asiva@google.com 76def187f8 Fix bug in Utf8::CodePointCount which was causing some strings with latin1
characters to be stored as TwoByteStrings.
Review URL: https://codereview.chromium.org//11419259

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15604 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-30 21:53:58 +00:00
regis@google.com 91ad9a0180 Remove support for interfaces.
For now, disable tests using obsolete syntax.
Tests disabled in this cl and in previous ones removing default factory classes
will either be deleted or updated in a later cl.
Review URL: https://codereview.chromium.org//11411271

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15562 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-30 01:26:31 +00:00
asiva@google.com 9d41d29b1a Fix StringBase_createFromCodePoints to correctly accept Latin-1 characters
as one_byte_string.

Rename Dart_NewExternalUTF8String to Dart_NewExternalLatin1String, this reflects
the functionality correctly.
Review URL: https://codereview.chromium.org//11280241

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15554 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-29 23:43:47 +00:00
vegorov@google.com 132bdc6bfb Support VTune's JIT interface.
R=iposva@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15517 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-29 13:54:06 +00:00
regis@google.com 7e9531a1d2 Remove support for default factory classes.
For now, disable tests using obsolete syntax. More will get disabled as support
for interfaces is completely removed. We may then permanently remove some tests,
while updating and reenabling others whose purpose is not related to interfaces.

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15480 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-28 23:39:27 +00:00
tball@google.com a5769593c4 Commented out child isolate test until it's fixed with monitor.
Review URL: https://codereview.chromium.org//11419172

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15359 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-27 00:33:21 +00:00
tball@google.com f56bf1f260 Fixed race-condition in isolate test.
Review URL: https://codereview.chromium.org//11411186

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15356 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-27 00:11:07 +00:00
tball@google.com bf5f0db5d0 Added support for isolate unhandled exceptions.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15352 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-26 23:31:47 +00:00
cshapiro@google.com 979571d3ee Use a signed 32-bit integer for representing code points.
Review URL: https://codereview.chromium.org//11419086

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15188 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-21 00:30:27 +00:00
asiva@google.com 58be6c9a96 Change the library directive syntax in the VM unit tests,
to the new format.
Review URL: https://codereview.chromium.org//11412048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15048 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-17 01:48:45 +00:00
asiva@google.com e1adedb421 Revert OneByteString back to ISO Latin-1 instead of ASCII
as webkit supports ISO Latin-1 and UTF-16 encodings for strings.
Review URL: https://codereview.chromium.org//11365243

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14989 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-16 00:13:18 +00:00
asiva@google.com 271a1f96ae - Add functionality to morph a string into an external string
- Add Dart API call Dart_MakeExternalString
Review URL: https://codereview.chromium.org//11360114

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14978 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-15 21:37:26 +00:00
srdjan@google.com fc4f5c093d Upon script loading deoptimize only functions whose owener has been subclassed, as that is the only CHA optimizations being applied to the code at the moment.
Review URL: https://codereview.chromium.org//11365273

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14934 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-15 00:41:53 +00:00
asiva@google.com 4027860e52 Throw illegal argument exception when
- objects which extend NativeWrapper are passed in isolate messages
- closure objects are passed in isolate messages
(issues 6108, 6312)
Review URL: https://codereview.chromium.org//11293163

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14926 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-14 23:14:41 +00:00
iposva@google.com 0c6ff657ed - Do not mix scalar values and object fields in RawInstance to
simplify the traversal for GC. Classes with native fields
  have a hidden reference to a typed array containing the
  native fields.
Review URL: https://codereview.chromium.org//11312183

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14821 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-12 23:21:04 +00:00
hausner@google.com 959f9ab4c4 More function literal changes in tests.
Review URL: https://codereview.chromium.org//11363206

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14816 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-12 22:57:39 +00:00
sgjesse@google.com a248c61b14 New APIs for external byte arrays
The following APIs have been added:

Dart_IsExternalByteArray: Check whether an object is an external byte
array.

Dart_ExternalByteArrayGetData: Return the pointer to the external data
hosted by the external byte array.

R=cshapiro@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14380 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-01 07:53:33 +00:00
asiva@google.com ebbb7c4134 - Represent strings internally in UTF-16 format, this makes it
compatible with webkit and will allow for easy externalization of
  strings. One byte strings are retained for pure ASCII strings.
  (The language specification was changed recently to reflect this as
   follows "A string is a sequence of UTF-16 code units").
- Remove four byte string class and all references to it.
- Rename some of the string functions in Dart API to make them
  consistent and better describe the underlying functionality
  Dart_NewString => Dart_NewStringFromCString
  Dart_NewString8 => Dart_NewStringFromUTF8
  Dart_NewString16 => Dart_NewStringFromUTF16
  Dart_NewString32 => Dart_NewStringFromUTF32
  Dart_NewExternalString8 => Dart_NewExternalUTF8String
  Dart_NewExternalString16 => Dart_NewExternalUTF16String
  Dart_NewExternalString32 => Dart_NewExternalUTF32String
  Dart_StringGet8 => Dart_StringToUTF8
  Dart_StringGet16 => Dart_StringToUTF16
  Dart_StringToCString => Dart_StringToCString
  Dart_IsString8 => Removed
  Dart_IsString16 -> Removed
  Dart_StringToBytes -> Removed
  Dart_StringGet32 -> Removed
Review URL: https://codereview.chromium.org//11318018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14357 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 17:56:46 +00:00
ager@google.com 2d74d2b6d0 Introduce VM API for the patching mechanism.
This will be used to use patching for the dart:io library.

R=iposva@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14121 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-26 08:00:05 +00:00
ager@google.com d378a0fd4f Revert change that was based on a local change that was not
part of the test script change.

R=sgjesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14065 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-25 09:57:06 +00:00
ager@google.com 01e373bef0 Fix CCTestSuite in test.dart.
R=sgjesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14064 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-25 09:38:51 +00:00
tball@google.com e0db231c1a Fixed failing 4_External_Functions_A01_t01 test, updated co19-runtime.status with triaged test bug numbers.
BUG=5430

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13843 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-19 22:15:11 +00:00
tball@google.com 058a5a10ba Removed StackZone allocation from DARTSCOPE macro, added StackZones in the few places they were still needed.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13751 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-17 18:06:26 +00:00
tball@google.com 2cd8436c5a Changed StackZone and ApiZone to be containers for Zone.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13707 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-16 22:05:40 +00:00
hausner@google.com 1811a6b913 Support for type dynamic in VM
Old name Dynamic is supported, and automatically converted to
lower-case dynamic when parsed.

VM flag --warn_legacy_dynamic prints warnings when Dynamic
is found.
Review URL: https://codereview.chromium.org//11125005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13637 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-12 22:40:24 +00:00
regis@google.com 1b8e614d7d Change compile-time errors into dynamic errors in instance creation expression
(issue 3085).
Change compile-time errors into dynamic errors in static getter and setter
calls (issues 3088, 3094).
Fix a crash in flow graph builder for missing static getter (issue 4360).
Add support in VM for NoSuchMethodError.
Remove support in VM for StaticResolutionException.
Add, remove, update related language tests.
Triage related co19 tests.
Review URL: https://codereview.chromium.org//11049038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13208 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-04 00:15:38 +00:00
ager@google.com b065e9cb29 Fix implicit super constructor calls for sub-classes of native field wrappers.
The current code does not add implicit super calls for any sub-classes
of native field wrappers. It should only omit them from the actual
native field wrappers.

I encountered this issue when looking into dartbug.com/5301.

The test in the parser is not pretty. However, since the native field
wrappers can be generated through the API a better solution was not
immediate. I wanted to check if the class was from the
dart:nativewrappers library, but through the API you can create
native wrappers in any other library as well.

R=hausner@google.com,asiva@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12679 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 05:40:33 +00:00
cshapiro@google.com 40604757dc Lazy peer API.
This change provides getters and setters for a lazily allocated field
associated with every heap allocated object.  It is a generalization
of the peer field of external string instances, external byte array
instances, and the smrck field of closure instances.

Review URL: https://chromiumcodereview.appspot.com//10905251

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12511 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-18 21:15:46 +00:00
turnidge@google.com a28d475ff3 Implement more of the mirrors library, primarily stuff to do with types.
Highlights:

- Implement FunctionClassMirror, used to reflect on the class of
  function objects.

- Implement TypeVariableMirror, used to reflect on type variables.

- Implement TypedefMirror, used to reflect on typedefs.

- Implement returnType for MethodMirror

- Implement type for VariableMirror/ParameterMirror

- Added supporting functions to the dart embedding api:
  - Dart_ClassIsTypedef
  - Dart_ClassGetTypedefReferent
  - Dart_ClassIsFunctionClass
  - Dart_ClassGetFunctionClassSignature
  - Dart_FunctionReturnType
  - Dart_FunctionParameterType
  - Dart_VariableType
  - Dart_GetTypeVariableNames
  - Dart_LookupTypeVariable
  - Dart_IsTypeVariable
  - Dart_TypeVariableOwner
  - Dart_TypeVariableUpperBound

Other stuff:

- Fixed bug in Function::NumberOfImplicitParameters for signature
  functions.

- Chnaged the default upper bound for type variables to Object from
  Dynamic.  Discussed this with Gilad and Regis.

- Fixed some smaller problems in mirrors_impl.dart.
Review URL: https://chromiumcodereview.appspot.com//10916252

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12342 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-13 17:47:25 +00:00
iposva@google.com 609f39c69e - Fixed patching of named factory constructors. Bug 4727.
- Added test to check for error free patching of native factories.

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12280 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-12 20:13:25 +00:00
cshapiro@google.com 5daf534d94 New test case to ensure finalizers are not invoked on deleted handles.
This also removes a needless allocation from the complementary test.

Review URL: https://chromiumcodereview.appspot.com//10916185

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12075 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 22:37:10 +00:00
cshapiro@google.com 5665da6258 Revert "Revert "Finalize reachable weak persistent handles at isolate shutdown.""
This reverts commit d701af3a2c8a7169898adcb38fe9da0a667ae7ff.

Review URL: https://chromiumcodereview.appspot.com//10928065

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12072 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 22:17:56 +00:00
kasperl@google.com 023546faf8 Remove more () from getters.
This makes it possible to run all standard tests except co19
without ever using a getter that's defined with ().

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

Review URL: https://chromiumcodereview.appspot.com//10928051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12028 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 12:56:21 +00:00
cshapiro@google.com c065f5bac1 Revert "Finalize reachable weak persistent handles at isolate shutdown."
This reverts commit b67c5b5d0651a6c9d335ff5ce511901948fd1a51.

Review URL: https://chromiumcodereview.appspot.com//10917126

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12006 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 03:50:44 +00:00
cshapiro@google.com bdb1e2509f Finalize reachable weak persistent handles at isolate shutdown.
BUG=http://code.google.com/p/dart/issues/detail?id=4071

Review URL: https://chromiumcodereview.appspot.com//10910123

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12005 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 03:14:41 +00:00