Commit Graph

179 Commits

Author SHA1 Message Date
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
hausner@google.com e56a1fc324 Remember owner class of patch code
This is a step towards using PatchClass for mixins
Review URL: https://codereview.chromium.org//12213020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18155 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-05 20:19:32 +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
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
fschneider@google.com 74a6a35e1d Do not add smis to the store buffer when cloning objects.
StoreBufferObjectPointerVisitor did not check for smis. It is
  used from Object::Clone.

Also assert that IsNewObject and IsOldObject is only called
on heap objects.
Review URL: https://codereview.chromium.org//12089049

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17804 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-29 20:12:00 +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
srdjan@google.com 8451080044 Improve function lookup speed by working with raw objects only.
Review URL: https://codereview.chromium.org//11970043

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17232 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-17 19:27:00 +00:00
hausner@google.com 79f4b5b61b Simplify exception handler table
Sort entries and drop the try_index field. This simplifies lookup
of exception handlers when walking the traces on exceptions.
Review URL: https://codereview.chromium.org//11970024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17179 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-17 01:10:42 +00:00
asiva@google.com c8284ad1bb Fix for 7941
- mark unused space in an object whose type has been transformed as
  Int8Array instead of Array. This ensure that GC does not traverse
  the contents of the unused space.
Review URL: https://codereview.chromium.org//11968020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17165 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-16 21:45:49 +00:00
hausner@google.com 245c0e2c3e Collect debugging info for catch clauses
Collect info about try-statement nesting, and a list of
handled types in each catch clause. This will be used by
the debugger to determine whether an exception is handled
by any handler on the stack.
Review URL: https://codereview.chromium.org//11883023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17100 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-15 22:43:00 +00:00
hausner@google.com 7e70aaddf7 Support for embedded Dart scripts
Add a line and column offset to scripts so that errors and exceptions
in embedded Dart scripts are reported at the proper location.
New API call Dart_LoadEmbeddedScript() that allows to specify
line and column offsets.

Stumbled on and fixed a bug. Script::kind field was not externalized to snapshot.
Review URL: https://codereview.chromium.org//11824067

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16934 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-10 21:47:09 +00:00
asiva@google.com 92dee42dcc Do not emit pointer information for embedded singleton VM Isolate objects while generating code. These embedded objects do not need to be visited during GC.
Review URL: https://codereview.chromium.org//11722026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16645 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-04 18:38:00 +00:00
vegorov@google.com 9fc1b54794 Store optimized flow graph statistics on the function itself.
This gives a good estimate for an early bailout from the inlining attempt.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16212 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-17 15:22:16 +00:00
cshapiro@google.com 49f6f9f36d Merge the Merlin heap tracing to top-of-trunk.
Review URL: https://codereview.chromium.org//11428067

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16199 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-15 19:58:45 +00:00
kmillikin@google.com a119414b2f Cache lookups at megamorphic call sites in optimized code.
The function name and argument descriptor are mapped to a lookup cache
at compile time.  The cache maps class id to target function.  It is
resizable.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15889 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-10 09:48:52 +00:00
srdjan@google.com 76fe027314 Windows complains:
'dart::RawUint8Array' : base classes cannot contain zero-sized arrays

Replicate code for now instead of subclassing.
Review URL: https://codereview.chromium.org//11464011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15814 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-06 22:30:08 +00:00
srdjan@google.com 93dd217564 Added Uint8ClampedList. COmpielr optimziations to follow in next CL.
Review URL: https://codereview.chromium.org//11437028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15806 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-06 21:53:51 +00:00
johnmccutchan@google.com 5642ee09f1 Expose transferable constructor to Int8List
Review URL: https://codereview.chromium.org//11414211

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15598 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-30 20:35:22 +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 b7673910ab Fix for issue 6359 - Make snapshots platform independent.
The issue previously was that an instance size was stored a
size in bytes, similarly field offsets were stored as an offset
in bytes. This caused issues when generating the snapshot on
one platform and reading it on another platform.
The VM has been changed to store the instance size as a size in
words and the field offset as an offset in words.
Review URL: https://codereview.chromium.org//11421117

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15538 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-29 19:28:22 +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
srdjan@google.com bfd459b09c Add flag 'implements' to class, it is set anytime someone implements this class. This is a way to recognize implicit interfaces in order to improve class checks.
Review URL: https://codereview.chromium.org//11348283

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15477 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-28 22:57:26 +00:00
asiva@google.com 3b5f530a44 Rename the field type_arguments_instance_field_offset_ to
type_arguments_field_offset_ in preparation for calling it
type_arguments_field_offset_in_words_
Review URL: https://codereview.chromium.org//11316203

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15431 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-28 01:36:04 +00:00
iposva@google.com 6245a1ac1b - Make RawObject::tags_ private.
Review URL: https://codereview.chromium.org//11411139

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15241 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-22 07:54:00 +00:00
ager@google.com 28775e1c98 Intrinsify ExternalUint8Array.[].
This helps the HTTP parser quite a bit. I was playing around with
it and thought I might as well upload it for review. Feel free
to take over the changelist if I'm doing this wrong. In that
case you should see this as a request for intrinsification of
ExternalUint8Arrays. :-)

R=fschneider@google.com,srdjan@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15200 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-21 15:35:15 +00:00
srdjan@google.com a6dae8cd4a First part of static call cleanup: store static call targets into code object, referenced by code-offset.
Review URL: https://codereview.chromium.org//11418046

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15091 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-19 16:39:07 +00:00
srdjan@google.com 7375693321 In optimized code use IC calls for instance calls that have no IC data instead of deoptimizing. The optimized IC call increments usage counter and reoptimizes optimized function if the threshold is met.
Recognize closure calls and mark them in ICData. Closure calls do not populate ICData, i.e., number of checks is always 0 (unless mixed closure calls with regular instance calls). Therefore closure IC calls do not count for reoptimization.
Review URL: https://codereview.chromium.org//11361225

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14860 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-13 18:34:05 +00:00
iposva@google.com c9c79e6bcc - Fix x64 build.
Review URL: https://codereview.chromium.org//11362214

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14822 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-12 23:26:38 +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
asiva@google.com 2e21fbd3ee Fix for issue 6623 - Canonicalize implicit static closure objects.
Review URL: https://codereview.chromium.org//11359151

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14802 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-12 19:02:44 +00:00
fschneider@google.com a42474ba37 Reland: Improve smi shift operations and avoid repeated deoptimizations.
This CL includes a bug fix where a NULL check of the pc was missing.

Also change the dart2js test status of arithmetic_test from Skip to Fail.
Review URL: https://codereview.chromium.org//11369158

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14755 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-09 19:54:55 +00:00
hausner@google.com be175c758e Implement const expressions for local variables
Review URL: https://codereview.chromium.org//11265047

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14716 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-09 00:19:43 +00:00
fschneider@google.com a830c7c091 Revert r14711 and r14709 because of test failures.
TBR=srdjan@google.com
Review URL: https://codereview.chromium.org//11363151

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14712 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-08 22:37:26 +00:00
fschneider@google.com 0f251088ec Improve smi shift operations and avoid repeated deoptimizations.
Smi left shifts do not contain a call now. Only after deoptimizing
at a smi operation we we generate mint code or a generic call to
avoid repeated deoptimization.

Added a test case for the code that was not covered by existing tests.
Review URL: https://codereview.chromium.org//11363141

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14709 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-08 22:03:47 +00:00
tball@google.com 209499c17f Merged String subclasses into String.
Merged String subclasses (OneByteString, etc.) into String, keeping
their raw types.  This allows String handles to continue to point
to a String after its raw type is changed, such as to make its data
external.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14545 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-05 22:22:19 +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
regis@google.com 57a60316f0 Fix wrong canonicalization of signature class due to name collision (issue 6353).
Add test.
Review URL: https://codereview.chromium.org//11342028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14234 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 00:06:24 +00:00
iposva@google.com dc2c8b3707 - Consolidate code into the old generation.
- Record pointers between code objects.
- Collect unreferenced code objects.
Review URL: https://codereview.chromium.org//11265026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14113 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-25 23:46:01 +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
asiva@google.com 1bf642129d - Get rid of RawClosure class and use RawInstance for closures.
- Simplify SetRaw to not require an access to the Current Isolate.
Review URL: https://codereview.chromium.org//11087070

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13581 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-11 20:34:08 +00:00
asiva@google.com 6b07453dd6 - Remove deprecated Dart API calls Dart_ClosureSmrck and DartClosureSetSmrck
- Remove the smrck field from RawClosure object.
Review URL: https://codereview.chromium.org//11017069

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13559 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-11 17:08:30 +00:00
iposva@google.com 78c30b0775 - Update status files for failing tests.
Review URL: https://codereview.chromium.org//11093013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13387 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-09 00:47:42 +00:00
iposva@google.com 5f2f50f960 Land http://codereview.chromium.org/11047027/ for Matthias:
Implement export clause in VM 

Implement export namespace support in VM compiler. 

Missing functionality: ensuring that a name is only re-exported once.
Review URL: https://codereview.chromium.org//11028084

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13384 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-09 00:14:42 +00:00
iposva@google.com b85f604f66 - Implement first class types in the VM.
- Make AbstractType a subclass of Instance and map it and its subclasses
  to private Dart classes in dart:core implementing the Type interface.
- Avoid dispatching through statics in Object if not strictly needed.
Review URL: https://codereview.chromium.org//10979058

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12981 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-27 21:19:00 +00:00
iposva@google.com b1f0b23fc7 - Remove obsolete class.
Review URL: https://codereview.chromium.org//10979035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12920 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-26 17:25:39 +00:00
hausner@google.com 201bce4219 Support for show/hide combinators
- Add a new VM object called a Namespace.
- A Namespace is a library, and two list of names to hide/show.
- Convert Library and LibraryPrefix to contain Namespace
  objects instead of Libraries in their import list.
Review URL: https://codereview.chromium.org//10967052

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12804 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 20:46:56 +00:00
regis@google.com 61297238fb Support redirecting factory constructors in the VM (issue 3969).
Add test (negative tests still missing).
Some more work is needed regarding when to throw a dynamic error and when to
report a compile-time error. Some questions are not answered by the spec.
Review URL: https://codereview.chromium.org//10964058

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12791 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 17:28:37 +00:00
asiva@google.com 724b8600d4 Move all the closure related fields in RawFunction into a new class
called RawClosureData
Add a field called 'data_' in RawFunction which points to a RawClosureData
object for closure functions, a signature class for signature functions or
an implicit closure function if there is an implicit closure for a regular
function.

This ensures that we don't burn 5 fields in RawFunction for normal functions.
The heap savings from this change on standalone dart is about 67k.

After this change:
New space (0k of 32768k) Old space (886k of 1024k) Code space (0k of 0k)

Prior to this change:
New space (0k of 32768k) Old space (953k of 1024k) Code space (0k of 0k)
Review URL: https://chromiumcodereview.appspot.com//10917222

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12290 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-13 00:20:37 +00:00
regis@google.com e860f819a0 Limit the maximum number of formal parameters (32K fixed and 32K optional)
in order to save space in function objects.
Naming cleanup.
Review URL: https://codereview.chromium.org//10928160

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12288 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-12 23:35:05 +00:00