Commit Graph

2008 Commits

Author SHA1 Message Date
asiva@google.com 3f97d1492a More cleanup to avoid creation of redundant handles
- create read only handles for null object and sentinel smi value
- add a RawCast function to allow direct casting of Raw pointers without the
  need to create a Handle for it
- use Smi::Value where possible
- hoist out handle creation from some loops

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23502 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 22:55:29 +00:00
iposva@google.com b60d09b1fb - Add different types for persistent and weak persistent handles
in the Dart C API.
- Adapt code in the runtime.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23421 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-30 15:55:59 +00:00
asiva@google.com 7735d59c7c More cleanup based on profile information.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23375 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-30 01:24:09 +00:00
fschneider@google.com fdcae8a772 Add a helper function for allocation of deoptimization history.
This CL addresses DBC comments from my previous CL (https://codereview.chromium.org/15779006/)

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23330 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 09:11:23 +00:00
asiva@google.com 26cdebaccf More cleanups to avoid Handle creation in hot paths.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23189 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 23:42:01 +00:00
zra@google.com 40f0800c10 Ensures that Bigints returned to Dart are all checked by Integer::AsValidInteger.
Rather than by ad-hoc checks at the point of return.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23151 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 15:45:17 +00:00
fschneider@google.com c1a33f3ea6 Add deoptimization history to optimized functions.
Each function that is optimized or inlined into an optimized
functions keeps an array of deoptimization ids.

This history is used to avoid repeated deoptimization caused by
speculative hoisting of check instructions.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23136 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 12:03:40 +00:00
asiva@google.com e33c2d4254 Delay Class parsing until the class is actually used.
Prior to this change the initial heap sizes were as follows:
ia32:
Size of isolate snapshot = 1230921
New space (0k of 32768k) Old space (1446k of 1604k)

X64:
Size of isolate snapshot = 1223943
New space (0k of 32768k) Old space (2630k of 2692k)


After this change the initial heap sizes are as follows:
ia32:
Size of isolate snapshot = 686443
New space (0k of 32768k) Old space (677k of 836k)

X64:
Size of isolate snapshot = 684731
New space (0k of 32768k) Old space (1220k of 1412k)

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23115 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 00:13:10 +00:00
hausner@google.com 4b497b0c17 Consolidate debug stubs
The new debug stub BreakpointRuntime gets the original stub address
from the debugger. With this scheme, we don't need a new debug stub
for every runtime stub that the debugger patches.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23094 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-23 18:42:03 +00:00
asiva@google.com de8b3c18b0 Remove some dead code.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23046 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-23 00:26:33 +00:00
iposva@google.com e24d83c10d - Add a GetClassId() to Object, so that we do not have to
create a temporary class handle only to get at an object's
  class id, which is stored in the object header.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22904 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-20 21:01:31 +00:00
srdjan@google.com dd6ca671d7 Cleanups: addressed your comments from https://codereview.chromium.org/14962008/
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22881 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-17 23:45:08 +00:00
hausner@google.com 7349a6d611 Make breakpoints on == fire reliably
Add breakpoints in the path taken if one of the operands
in a == b is null.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22857 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-17 17:08:09 +00:00
srdjan@google.com 142b49316a Fix issue 5275: The VM must always generate the most compact form of an integer (Smi, Mint or Bigint). Hide methods that can be used to bypass that assumption and require the use of Integer::NewXXX which is guaranteed to return the most compact integer form.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22816 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-16 20:49:06 +00:00
srdjan@google.com 428dea19dc Fix crash with --no-use-cha: the optimizer expects a concrete type for array creation, not dynamic as is the result because we cannot determine without CHA if a class is guaranteed to have no sublcasses and has not been implemented. Regardless of use_cha, always rely on known information for internal classes that are not subtype or implemented by other clases.
R=asiva@google.com, vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22655 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-13 23:19:20 +00:00
srdjan@google.com 0acfcf21e7 A load static of an initialized static final field can be converted to its value, as long as it is in old space or Smi, and can therefore be a literal node.
Add special objects to mark non_constant and unknown_constant in constant propagator so that there is no confusion with sentinels used in the graph.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22600 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-10 21:33:14 +00:00
hausner@google.com 80c7ad1070 Implement breakpoint for closure calls
Introduce a new PcDescriptor kind to distinguish closure calls from other runtime calls. The debugger can patch these calls to set a breakpoint. When stepping into a closure call, the debugger must fish out the closure object from the stack, find the function and set breakpoints in it.

Arm and Mips breakpoint stubs are not implemented yet. ia32 and x64 stubs tested by hand. Automated test to follow.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22596 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-10 21:06:04 +00:00
vegorov@google.com 2565ca222f Implement a variation of scalar replacement for non-escaping allocations.
AllocationSinking pass discovers non-escaping allocations that have no input uses other than uses in the stores into its own fields.

Every environment use of such allocation is replaced by a state snapshot (MaterializeObject instruction) that describes the state of each initialized field in the object. State snapshots are computed through an additional round of load-forwarding.

Once snapshots are computed allocations are removed from the graph.

MaterializeObject instructions are not compiled into native code but produce deoptimization instructions instead that describe how object should be materialized at deoptimization.

Deoptimization instructions now follow the following format:

[mat obj #1]...[mat obj #N][ret addr][... mat arguments ...][... real frames ...]

- the prefix describes each object to materialize on deopt via kMaterializeObject instruction;
- actual values that are needed for materialization are emited as a part of bottom-most stack frame. This is done to simplify implementation: they need to be discoverable by a GC during materialization phase. At the end of deoptimization they will be removed from the stack;
- normal stack slots can refer to materialized objects via kMaterializedObjectRef instruction.

Additionally this change contains fixes in load-forwarding that are needed to guarantee that all artificial LoadField instructions inserted during AllocationSinking are correctly replaced with actual values.

Limitations of the current implementation:

- can't eliminate allocations that flow into phis but otherwise don't actually escape;
- can't sink allocations out of loops;
- allocation with type arguments are not handled.

R=regis@google.com, srdjan@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22485 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-07 23:40:42 +00:00
srdjan@google.com ab188d327c Improve performance of String.fromCharCodes by implementing it in Dart. Add tow internal natives to Dart in order to be able to allocate and fill a String. Next step is to implement String.concatAll in Dart as well and to inline String._setAt operation (currently intrinsified).
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22399 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-03 23:48:10 +00:00
iposva@google.com 083c9e5e95 - Remember the fact that an object has been added to the
store buffer by a bit in the header.
- This bit can be used to filter out redundant additions
  into the store buffer making the dedup sets not needed.
- Remove the need for a HashSet when remembering old to
  new references.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22393 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-03 20:59:42 +00:00
regis@google.com 0e030b6f5c Further improve type optimization reusing the type argument vector of the
instantiator of generic objects (fixes issue 10149).
This optimization considers the generic type argument vector of the instance
being allocated as well as the generic type argument vector of the compile
time type of the instantiator.
If the instance vector is a prefix of the instantiator vector, the instantiator
vector can be shared by the new instance.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22155 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-29 23:39:46 +00:00
asiva@google.com 04cb8721ad First step towards loading the core library scripts directly from the sources
instead of concatenating all the scripts and linking them into the executable.
- Refactor the bootstrap script loading and compilation part to use a
  custom bootstrap library tag handler

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22154 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-29 22:00:18 +00:00
regis@google.com 2de2e615e6 Improve type optimization reusing the type argument vector of the instantiator
of generic objects:
Do not require anymore that the vector be of the same length. A longer vector
with a compatible prefix is acceptable. This saves a class id check and length
check.
We still require that the uninstantiated type argument vector be the identity
vector, i.e. consisting only of type parameters with consecutive indices
starting at zero. We will relax this requirement in a later change.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22062 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-26 00:04:13 +00:00
asiva@google.com fbc931e6a6 Report OOM errors instead of asserting on allocation failures when sending
messages to other isolates.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21980 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-24 20:52:22 +00:00
vegorov@google.com c34810fd26 Preserve aggregate count when creating unary checks ICData.
We were reseting it to 1 which leads to worse inlining decisions for example for user defined binary operators. Inliner considered them all cold.

R=srdjan@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21964 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-24 17:51:10 +00:00
kustermann@google.com e2216f61bf Fast copy between TypedData and ExternalTypedData
Until now, copying data from TypedData to TypedData and from ExternalTypedData
to ExternalTypedData was fast. But copying between TypedData and
ExternalTypedData was not handled in a fast way.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21791 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-22 08:27:15 +00:00
iposva@google.com 749ac45917 - Use DISALLOW_ALLOCATION in Object class.
- Intercept operator delete in handles.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21788 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-22 05:51:47 +00:00
srdjan@google.com 9b53a42536 Add flag --check-function-fingerprints, it checks all function fingerprints of the intrinsifier and method recognizer. Added flag to a test so that the fingerprints will be tested during a regular test.
Review URL: https://codereview.chromium.org//14247005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21711 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-18 23:18:13 +00:00
asiva@google.com 70ef44f1c2 Fix for issue 9871 - Object::empty_array() returns a broken handle.
Review URL: https://codereview.chromium.org//14298012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21587 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-16 22:51:24 +00:00
iposva@google.com 9ac0c8d7c9 - Allow for experimentation with different header sizes.
Review URL: https://codereview.chromium.org//13951019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21505 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 19:46:21 +00:00
hausner@google.com 54dde7ce89 Implement rethrow statement
Or: how to turn a 5 minute task into a 2 hour ordeal.

The actual business of the change is one line in token.h and one line in parser.cc.
Review URL: https://codereview.chromium.org//14012005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21371 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-12 16:32:37 +00:00
vegorov@google.com 9f3783186f Ensure that all goto instructions have deoptimization target.
R=kmillikin@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21351 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-12 11:19:34 +00:00
johnmccutchan@google.com 968e805cfc Unboxed load/store indexed of Float32x4
Review URL: https://codereview.chromium.org//13818006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21274 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-11 12:50:46 +00:00
asiva@google.com ecc5b67833 - Create an all static TypedDataView class which uses implicit field offset
values to get direct access to the fields of a typed data view object.

- Added a verification step after class finalization to ensure that the
  implicit field offsets in TypedDataView match the actual values in the
  dart instance.
Review URL: https://codereview.chromium.org//13472019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20948 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 05:19:36 +00:00
regis@google.com 158d90d50f Prevent expensive and unnecessary error formatting in the case a bound check is
postponed to run time (issue 9106).
Eliminate bound check at compile time in some cases.
Fix bound checking of mutually referencing bounds.
Added test.
Review URL: https://codereview.chromium.org//13653005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20938 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-04 20:24:49 +00:00
iposva@google.com 4dff6b8e2b - Remember objects (not addresses) in the old generation containing new pointers.
Review URL: https://codereview.chromium.org//13406004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20828 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-02 22:45:18 +00:00
asiva@google.com 2f7ca6843f Remove support for 'dart:scalarlist' in the Dart VM.
Review URL: https://codereview.chromium.org//13139002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20680 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-29 18:33:54 +00:00
johnmccutchan@google.com 5b140f8452 Really remove SIMD types from dart:scalarlist. Fixes build.
Review URL: https://codereview.chromium.org//12907023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20563 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-27 17:06:41 +00:00
johnmccutchan@google.com d516a7acde Review changes
Review URL: https://codereview.chromium.org//12982010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20559 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-27 14:44:15 +00:00
asiva@google.com 8dde962f6d More cleanup in preparation for removing support for dart:scalarlist in the VM.
Review URL: https://codereview.chromium.org//13093012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20547 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-26 22:01:31 +00:00
johnmccutchan@google.com e07063f389 Revert 12534006
Review URL: https://codereview.chromium.org//13093005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20526 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-26 17:40:25 +00:00
johnmccutchan@google.com 7b1d3b9134 Port SIMD types from dart:scalarlist to dart:typeddata.
Review URL: https://codereview.chromium.org//12534006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20522 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-26 16:50:26 +00:00
regis@google.com b8bf4159b5 Do not use object pool for VM heap objects on ARM.
Update decoding of call pattern accordingly.
Add missing store barrier when storing object pool in instructions object.
Work with GrowableObjectArray in old heap space when assembling object pool.
Review URL: https://codereview.chromium.org//13070003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20483 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-25 20:29:47 +00:00
asiva@google.com 5642025044 Handle TypedDataView objects in Dart_TypedDataAcquireData and
Dart_TypedDataReleaseData
Review URL: https://codereview.chromium.org//12937010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20482 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-25 20:18:44 +00:00
regis@google.com 0c27ffc6a4 Implement optional parameter handling in ARM vm.
Enable FindCodeObject test on ARM (production mode only for now).
Make sure the object pool is allocated in the old space.
Some more code cleanup on IA32 and X64 (use named constants).
Review URL: https://codereview.chromium.org//12663024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20399 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-22 18:30:35 +00:00
hausner@google.com d4872a1499 Support initialized mixin fields across scripts
Add capability to set parser to read tokens from different
scripts and token positions. This is used when the initializer
expression of a field resides in a different script.
Review URL: https://codereview.chromium.org//12827007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20388 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-22 17:06:42 +00:00
johnmccutchan@google.com 3d4778e2c2 SIMD plumbing
Review URL: https://codereview.chromium.org//12871015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20287 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-20 20:29:00 +00:00
asiva@google.com 68d1955b88 Translate raw strings to regular strings during source code generation. This should hopefully avoid issues with deciding when to escape special characters and when not to.
Review URL: https://codereview.chromium.org//12568007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20248 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-19 21:32:35 +00:00
vegorov@google.com 1c9d22d75c Collect type feedback for fields.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20235 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-19 20:15:10 +00:00
hausner@google.com ed2e198b99 Mixins with Generics
This change adds support for generics to mixins. It's not a particularly elegant
implementation, so I expect to change how it works internally in later checkins.

Also, there is still one aspect of the implementation that is incorrect. In the
case of typedef, the newly introduced name is not yet an alias for  the
mixin application. Instead, the MA is a superclass of the typedef name. That
will need to be fixed in a later checkin. I don't want to make this change
bigger.
 
Review URL: https://codereview.chromium.org//12779008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20084 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-15 15:59:24 +00:00