Commit Graph

500 Commits

Author SHA1 Message Date
srdjan@google.com 39713f0efc The code size does not scale with architecture word size, set code size cutoff limit to 200,000 bytes for all architectures
Review URL: https://codereview.chromium.org//12256028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18492 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-13 23:00:09 +00:00
srdjan@google.com 4f285ac0a8 Add flag to block optimizations of large implicit getters. Implicit getters have a 0 size in tokens, therefore also check the size of unoptimized code to decide if a function is optimizable. Print more data with --trace-compiler.
Review URL: https://codereview.chromium.org//12263017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18485 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-13 21:52:02 +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
vegorov@google.com baa0347253 Reapply r18377 it was reverted due to the unrelated bug it surfaced.
Remove SminessPropagator and FlowGraphTypePropagator and all associated infrastructure and fields.

Replace multiple fields (result_cid_, propagated_cid_, propagated_type_, reaching_cid_) with a single field of type CompileType which represents an element of type analysis lattice and incorporates information about: value's nullability, concrete class id and abstract super type. This ensures that propagated cid and type are always in sync and complement each other

Implement a new FlowGraphPropagator that propagates types over the CompileType-lattice.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18456 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-13 17:16:35 +00:00
vegorov@google.com 487c73e01f Revert "Remove SminessPropagator and FlowGraphTypePropagator and all associated infrastructure and fields."
This reverts commit r12365.

Reason: failure on vm-mac-debug (debug_ia32 standalone/io/file_fuzz_test).

TBR=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18378 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-12 12:36:21 +00:00
vegorov@google.com f8d9a90b2c Remove SminessPropagator and FlowGraphTypePropagator and all associated infrastructure and fields.
Replace multiple fields (result_cid_, propagated_cid_, propagated_type_, reaching_cid_) with a single field of type CompileType which represents an element of type analysis lattice and incorporates information about: value's nullability, concrete class id and abstract super type. This ensures that propagated cid and type are always in sync and complement each other

Implement a new FlowGraphPropagator that propagates types over the CompileType-lattice.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18377 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-12 12:06:47 +00:00
iposva@google.com d421507d55 - Remove redundant type parameters for internal data.
Review URL: https://codereview.chromium.org//12218082

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18287 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-08 23:27:50 +00:00
iposva@google.com fe95f789c8 - Add handling of private dart:_ libraries.
- Make dart:collection-dev a private library by renaming it to dart:_collection-dev.
- Predefine the URIs of dart: libraries as VM symbols.
Review URL: https://codereview.chromium.org//12220027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18159 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-06 00:29:48 +00:00
hausner@google.com 9d42f829f2 Save 0.00001% memory
Release the functions and fields array after patching classes.
Review URL: https://codereview.chromium.org//12207028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18158 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-05 22:43:57 +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 20f821b4cb Instead of setting up the can intrinsify state lazily setup eagerly
in Object::Init() so that the snapshot will carry it and when
running from a snapshot Intrinsifier::CanIntrinsify can be just a bit check.
Review URL: https://codereview.chromium.org//12096105

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17995 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-01 19:16:34 +00:00
antonm@google.com 5a9cc92093 Revert changes 17962-3 which break Dartium Debug build.
TBR=ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17977 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-01 12:45:42 +00:00
regis@google.com 650ae359a4 Fix class patching involving type parameters: type parameters of patched classes
were not finalized.
Simplify and fix function type alias finalization (remove dummy alias owner).
Make sure no unfinalized types or unresolved classes are written to a snapshot.
Verify that all pending classes are finalized before writing a snapshot.
Make snapshot_test more resilient to finalization errors.
Add missing import to snapshot_test.dart.
Fix typo in growable_array.dart.
Review URL: https://codereview.chromium.org//12123002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17962 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-01 02:40:16 +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
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
fschneider@google.com 00d11158e7 Address comments about safely casting handles.
The debug version exactly follows the original code. Release mode
avoid creating a temporary handle.
Review URL: https://codereview.chromium.org//11500004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17703 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-28 12:02:07 +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
srdjan@google.com f2d02edd3f Hide private corelib's method from stack trace in exceptions.
Review URL: https://codereview.chromium.org//12025038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17489 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-23 19:52:26 +00:00
asiva@google.com 4c796304dd Move verification of builtin_vtables into Dart::InitializeIsolate.
This ensures that we don't ASSERT on every handle assignment
(not an issue with release builds but should help the debug builds some).
Review URL: https://codereview.chromium.org//11867015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17438 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-23 06:13:18 +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 aec77f4d71 Use new |= operator in object.cc .
Review URL: https://codereview.chromium.org//11938023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17301 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 18:37:06 +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
floitsch@google.com c2446d4626 Move many iterable classes to collection_dev.
Review URL: https://codereview.chromium.org//11931042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17276 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 14:08:41 +00:00
floitsch@google.com fb1632180e Add dart:collection_dev library.
Committed: https://code.google.com/p/dart/source/detail?r=17263
Reverted: https://code.google.com/p/dart/source/detail?r=17265

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17269 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 13:07:27 +00:00
floitsch@google.com 8d1020c6d2 Revert "Add dart:collection_dev library."
This reverts commit 17263.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17265 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 12:34:34 +00:00
floitsch@google.com ba73897a3e Add dart:collection_dev library.
Review URL: https://codereview.chromium.org//11959012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17263 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 12:26:09 +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
asiva@google.com fff63865e6 Add a new operator |= which does a simple assignment of the raw pointer into
a handle without any vtable settings. In debug mode there are the usual checks
to ensure that the vtable in the handle matches the expected vtable value
based on the dynamic type of the object.

It is useful in loopy code as follows:
  const Array& funcs = class.functions();
  Function func = Function::Handle();
  for (int i = 0; i < 100000000; i++) {
    func |= funcs.At(i);
  }
Review URL: https://codereview.chromium.org//11979003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17244 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 00:24:06 +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
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
hausner@google.com cfb3b53aac Check whether exceptions are caught
The debugger can now determine whether an exemption will be caught or not.
Review URL: https://codereview.chromium.org//11946020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17167 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-16 22:16:09 +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
srdjan@google.com 9320b18911 Improve compilation speed on a pathological case > 2x (7 sec -> 2.7 sec) by improving local lookups.
Review URL: https://codereview.chromium.org//11893002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17085 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-15 19:08:55 +00:00
fschneider@google.com 75c4844bf5 Cleanup uses of X::CheckedHandle where X::Cast or X::Handle is sufficient.
The only places where CheckedHandle is appropiate is with arguments to
runtime functions and values from Dart API functions.

For other places in the VM either normal Handle and ^=, or Cast is sufficient.

T::Cast is used when the value is guaranteed to be of type T (and never Object::null()).
Otherwise, the operator^= is used for casting.

Also fix a style issue where a Raw* should be used as return type.
Review URL: https://codereview.chromium.org//11826024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17013 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-14 09:51:48 +00:00
asiva@google.com 62115b51fe Fix for issue 7757
- Iterate and collect all the inlined functions in an optimized dart frame
  into the stack frame when throwing an exception.
- Added a OptimizedDartFrameIterator class which iterates over all the inlined
  functions of a single optimized dart frame.
Review URL: https://codereview.chromium.org//11833025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17000 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-12 00:24:28 +00:00
iposva@google.com 51447e92ba - Start adding meta data for fields of VM internal classes.
- Correctly report instance size in bytes.
- At least report field sizes for variable sized objects.
Review URL: https://codereview.chromium.org//11880004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16996 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-11 23:05:57 +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
srdjan@google.com 04fc29c7e1 Optimize function at its entry instead of at exit.
The code can be patched if it should not be executed any longer.
The code can be now patched at other location than at entry, the requirement is still that patching code does not overwrite an inlined object.
Intrinsic methods that do not have a fall through cannot be patched.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16897 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-10 00:28:57 +00:00
hausner@google.com e8a293c05a Allow optimized code when debugger is active
The debugger allows the VM to optimize code unless there is a breakpoint inside the
function. Whenever a new breakpoint is set (explicitly or implicitly by stepping)
all optimized code is discarded.
Review URL: https://codereview.chromium.org//11780005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16815 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-08 18:57:19 +00:00
iposva@google.com dbb7d249fb - Preallocate non-named ArgumentsDescriptors with a small amount of parameters.
Review URL: https://codereview.chromium.org//11773008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16734 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-07 18:36:39 +00:00
floitsch@google.com 4a7dfd2da3 Big merge from experimental to bleeding edge.
Review URL: https://codereview.chromium.org//11783009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16687 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-07 11:23:16 +00:00
regis@google.com 47e08870ca Support Null type in Class::TypeTest and simplify Instance::IsInstanceOf.
Review URL: https://codereview.chromium.org//11785006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16664 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-05 00:45:52 +00:00
asiva@google.com 4c069867e4 - Make Boolean 'true' and 'false' singleton VM isolate objects.
- Change all uses of it
Review URL: https://codereview.chromium.org//11745022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16623 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-04 01:52:05 +00:00
iposva@google.com e988dec7e7 - Mark huge methods are not-optimizable.
Review URL: https://codereview.chromium.org//11722006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16588 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-02 22:09:28 +00:00
asiva@google.com 7022b39e35 Convert all symbol accessors to return read only handles so that it is not necessary to create a new handle in the code that uses it.
Added a few more strings to the symbols list.
Review URL: https://codereview.chromium.org//11667012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16584 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-02 19:31:59 +00:00
hausner@google.com a2d682d1d8 Improve line info accuracy in debugging
Review URL: https://codereview.chromium.org//11696005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16550 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-28 18:51:58 +00:00