Commit Graph

13143 Commits

Author SHA1 Message Date
vegorov@google.com 7f5971b251 Fix computations in LeaveCallRuntimeFrame to use kDoubleSize for saved XMM registers.
On ia32 a single XMM register occupies two words.

R=srdjan@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11659 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 21:21:59 +00:00
vegorov@google.com a573d2dec8 Unbox phis that were proven to be of type Double.
Eliminate Boxing/Unboxing pairs.

Allow boxing, unboxing and double binary operations to participate in CSE.

Allow double comparisons to operate on unboxed inputs.

Support XMM registers and double spill slots in deoptimization.

Save XMM registers when calling to runtime from WriteBarrier stub.

R=srdjan@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11652 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 20:39:48 +00:00
turnidge@google.com 9a0cbfe8da Make fewer assumptions about the layout of api handles.
Found these problems by changing the layout and seeing what broke.
Review URL: https://chromiumcodereview.appspot.com//10915015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11647 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 19:40:27 +00:00
cshapiro@google.com 72c02b48c4 Format pointer type declarations more consistently.
Review URL: https://chromiumcodereview.appspot.com//10896054

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11645 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 19:26:28 +00:00
srdjan@google.com caf04303f7 Deoptimization can occur at Dart calls (includes native calls to C) but not at runtime calls. This assumption (verified with Todd and Gilad) simplifies the implementation of lazy deoptimization considerably.
Add flag --deoptimize-alot, which will lazily deoptimize all live optimized frames. Currently only the presence of deoptimization information is checked.

Add kDeoptAfter deoptimization point, which is the continuation for lazy deoptimization, after a call. Rename kDeopt to kDeoptBefore.

Removed a tests case that called into a native without properly setting up a Dart frame (Ok-d by Siva).

Native functions are not optimizable.

TODO: Split deoptimization information from DeoptimizationStubs. Check for redundant PcDescriptor information (what can be merged, especially at calls).
Review URL: https://chromiumcodereview.appspot.com//10885039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11642 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 18:53:46 +00:00
vegorov@google.com be313b5530 Restrict objects printing in disassembler to avoid GC.
R=iposva@google.com
BUG=4709

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11637 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 18:08:30 +00:00
vegorov@google.com 978ec58a5e Rematerialize constants instead of spilling them.
This also fixes the crash that occurs when we try to spill constant null at the graph entry.

R=srdjan@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11634 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 17:49:23 +00:00
turnidge@google.com 14f614da12 Use the return value of vm native methods to set the return value,
based on Siva's earlier suggestion (he actually suggested putting it
in the generated stub, which I haven't done).

Added SetReturnUnsafe and use it exactly one place so far.
Review URL: https://chromiumcodereview.appspot.com//10874072

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11633 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 17:41:19 +00:00
hausner@google.com 5692051e4e Convert double interface into abstract class
In a future change, we can implement double in the core
library, eliminating class Double (using the patch class
feature).
Review URL: https://chromiumcodereview.appspot.com//10876100

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11631 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 17:29:49 +00:00
zerny@google.com d0f3b89aca Clear use lists for globals and definitions in start environment in release mode.
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11613 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 13:28:11 +00:00
ajohnsen@google.com 3cf5d6531d Move core and coreimpl from corelib/ to lib/core and lib/coreimpl.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11606 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 11:45:40 +00:00
ager@google.com 178100ded4 Move print to corelib.
Allow embedder customization in the VM through a static field that can
be set by the embedder.

Mark failing test that is unrelated to this change. The VM does not
like when you import dart:core explicitly and tells you there both
'dart:core' and 'dart:core' define 'print'.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11603 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 11:31:30 +00:00
kasperl@google.com 0af11bc9c4 More uses of the new try-catch syntax.
With this change, the VM can run all tests (except co19) without
allowing the use of the old try-catch syntax.

R=ngeoffray@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11600 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 11:14:39 +00:00
fschneider@google.com bea1a5b379 Add explicit class checks: LoadVMField.
R=kmillikin@google.com
Review URL: https://chromiumcodereview.appspot.com//10917005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11598 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 10:50:37 +00:00
kmillikin@google.com 8122966c80 Put live register bits in stackmaps.
Add a count of live registers to each stackmap and add bits describing the
registers.  This allows untagged values in general purpose registers at
safepoints.

R=vegorov@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11595 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 10:20:26 +00:00
kmillikin@google.com ea925449f6 Eliminate class UseVal.
This was the only subclass of Value.  All functionality is moved to the base
class, and all functions are made non-virtual.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11590 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 09:08:27 +00:00
zerny@google.com b859298d3f Reapply "Inlining of static calls with trivial function bodies."
Reapply r11579 with a bug fix.
Original review at https://chromiumcodereview.appspot.com/10919004

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11586 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 08:54:56 +00:00
zerny@google.com 9a6da424e6 Revert "Inlining of static calls with trivial function bodies."
This reverts r11579. Reverted due to test failures on dartc builders.

TBR=kmillikin@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11583 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 08:17:54 +00:00
zerny@google.com 15ff4e19c8 Inlining of static calls with trivial function bodies.
R=kmillikin@google.com,srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11579 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 07:35:16 +00:00
asiva@google.com 0dc73ee3a2 Remove inclusion of 'include/dart_api.h' in 'raw_object.h'
Review URL: https://chromiumcodereview.appspot.com//10902002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11571 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 00:17:52 +00:00
hausner@google.com b3a2c41d02 Revert change 11558
I learnt that instantiating an abstract class is a runtime error, not a compile time error.

TBR=regis
Review URL: https://chromiumcodereview.appspot.com//10894048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11567 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 22:49:52 +00:00
hausner@google.com 28d88d4b2d Add compiler error when instantiating abstract class
Also, make abstract keyword on methods optional.
Review URL: https://chromiumcodereview.appspot.com//10899039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11558 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 22:13:06 +00:00
jackpal@google.com 73ffeb4418 Add support for building the Dart VM for Android OS.
The Android target OS is based upon the existing Linux target OS.
The existing _linux source files have been copied to create
corresponding _android source files. The copies have been
modified as needed to adapt to differences between the Linux
platform and the Android platform.

Currently the dart vm binary builds on Linux and runs on x86 Android,
Simple test scripts execute correctly, but no formal testing has been
done.

The process for building the Dart VM for Android will be documented on
the Dart wiki.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11547 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 20:42:28 +00:00
asiva@google.com 4c24f3f17a Ensure types are canonicalized when canonicalization is requested and the type is already finalized.
(Reduces initial heap size by about 15k)
Review URL: https://chromiumcodereview.appspot.com//10886038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11544 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 20:20:52 +00:00
tball@google.com 962da19ba8 Reworked previous CL (ExternalStringGetPeer speed up) to avoid the
need for an 'extern "C"' declaration in raw_object.h, which broke
the Windows builds.  Instead, a peer() method is added to the
RawExternalString*Object classes, and RawObject::ToAddr() is used
to fetch the address of these raw instances.  This avoids the need
for Dart_ExternalStringGetPeer needing friend access to those classes.
Review URL: https://chromiumcodereview.appspot.com//10891036

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11540 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 20:04:55 +00:00
tball@google.com 59efb29a14 Performance improvement for the Dart VM runtime method
Dart_ExternalStringGetPeer. This change is basically an unrolling 
of the templates that previously defined the method, to reduce 
the number of handles allocated. 

This change is supported by the DartStringAccess VM benchmark, which 
showed a ~20x improvement from the above change. Currently this 
benchmark focuses on Dart_ExternalStringGetPeer, rather than String 
performance in general. 

Please review this carefully. Commented-out is a "NoGCScope no_gc_scope;" 
line, which when enabled asserts that GC doesn't happen when this function 
is called. However, one of the tests fails this check, though when I 
set a breakpoint in gdb before the NoGCScope item is allocated, it's not 
hit before the assertion fails. I commented out that line, in the hope 
that more senior reviewers suggest improvements.
Review URL: https://chromiumcodereview.appspot.com//10897014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11534 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 18:06:17 +00:00
vegorov@google.com 855629ccae Stop attaching try_index to individual instructions put it at block entry instead.
This simplifies code motion and insertion of instructions that make calls after graph is constructed.

R=srdjan@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11528 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 16:44:18 +00:00
kmillikin@google.com 58d842d6d7 Make constants computations instead of values.
This change requires a pool of global constants that don't have an easy
place to go in the instruction stream.  Currently, that is only the constant
null used to mark eliminated phis in deoptimization environments.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11518 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 12:56:57 +00:00
fschneider@google.com d264ecea59 Fix bug in flow graph builder that caused invalid optimization.
Using type-feedback in the flow graph builder to generate optimized
code violates the invariant that the initial flow graph of the
non-optimized version and the optimized version of a function
have to be identical.

Eliminating type checks based on type feedback has to be done later.
(e.g. after the flow graph optimizer and after type propagation
where we specialized operation based on type feedback)

BUG=dart:4797
Review URL: https://chromiumcodereview.appspot.com//10900024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11515 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 12:36:49 +00:00
ajohnsen@google.com 3a6daefd99 Expose remaining 'errors' in an unified dart:core.
This is a follow-up on my previous move of AssertionError.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11513 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 11:57:37 +00:00
fschneider@google.com a347dd7f82 Refactor branch instructions to enable further optimizations.
This CL simplifies the code generation for branches: Each BranchInstr
wraps a comparison computation and we can reuse the code between the two
in many cases. Similar to BindInstr, most accessors forward to the wrapped
computation. One exception is the location summary, which is modified for
branches: The result location is removed since branches don't produce a result.

This way, it is easier to replace a comparison branch
with a specialized version and eliminate redundante checks before branches.
Review URL: https://chromiumcodereview.appspot.com//10887009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11500 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 09:07:11 +00:00
ager@google.com c16f0ef499 Fix compilation errors on Windows.
R=antonm@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11499 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 09:05:47 +00:00
ager@google.com 2ad46b61fe Beginning support for library prefixes in the dart API.
This is a request for comments. Do we want to expose library
prefixes like this? Is there a way to import with a prefix already
and lookup members?

The reason why I would like to do this is so that I can import the
user-supplied builtins library under a prefix. This will be a useful
first step to move the print function to corelib while preserving
the ability to patch in a print implementation via the builtins
library.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11494 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 08:35:43 +00:00
asiva@google.com e65ddf4079 Use Heap::kOld when allocating objects for script snapshots.
Review URL: https://chromiumcodereview.appspot.com//10867046

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11486 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 00:51:32 +00:00
cshapiro@google.com 0265cf8b9e Report the reason for a garbage collection when verbose GC is enabled.
Review URL: https://chromiumcodereview.appspot.com//10872074

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11485 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 00:49:14 +00:00
asiva@google.com 1cbaf478c1 Add StorePointer when updating fields from a snapshot for
InstantiatedTypeArguments, ContextScope and JSRegExp
Review URL: https://chromiumcodereview.appspot.com//10892026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11483 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 00:27:42 +00:00
tball@google.com c228cb4b55 Rollback of previous commit -- still under review.
Review URL: https://chromiumcodereview.appspot.com//10896018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11476 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-28 21:18:21 +00:00
tball@google.com 8f12d338d6 First implementation of performance improvement for
Dart_ExternalStringGetPeer.


git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11475 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-28 20:55:16 +00:00
srdjan@google.com bed2197b07 Fix crash with --code-comments.
Review URL: https://chromiumcodereview.appspot.com//10896011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11471 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-28 18:26:42 +00:00
srdjan@google.com 727f1bf9e7 Eliminate try-index for deopt stubs.
Review URL: https://chromiumcodereview.appspot.com//10886015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11469 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-28 18:02:19 +00:00
srdjan@google.com 5f5150e031 Emit deoptimization information at stati calls (preparation for full deoptimization). Currently we use Deoptimization stubs to maintain the deoptimization info, do not emit stubs though for static calls.
Any instruction  that calls out of Dart code and into other Dart code or C++ may deoptimize.
Review URL: https://chromiumcodereview.appspot.com//10880079

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11467 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-28 17:25:10 +00:00
ajohnsen@google.com a04ecc7678 Unify AssertionError.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11448 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-28 14:39:50 +00:00
fschneider@google.com ec93339347 Implement array bounds checks explicitly in the optimized IL.
They are inserted by the flow-graph optimizer when specializing
array operations.

As a result, LoadIndexed and StoreIndexed can't deoptimize themselves
anymore. All checks happen before in check-instructions.

Redundant array bound checks can be eliminated by CSE if all operands
match.
Review URL: https://chromiumcodereview.appspot.com//10867086

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11433 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-28 09:14:57 +00:00
cshapiro@google.com c61c303275 Fix a build break caused by a type mismatch on 64-bit build targets.
Review URL: https://chromiumcodereview.appspot.com//10871096

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11430 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-28 02:44:28 +00:00
cshapiro@google.com 16b554d4d0 Increase the page space growth rate when there is insufficient free space.
Review URL: https://chromiumcodereview.appspot.com//10876095

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11429 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-28 02:32:55 +00:00
iposva@google.com 327ff5d70e - Change "static final" to "static const" in the runtime/ directory.
- Fixed parsing of top-level static const.
Review URL: https://chromiumcodereview.appspot.com//10883071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11425 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-27 23:51:37 +00:00
hausner@google.com c7f5bcd0ca Eliminate interface bool
Replace with concrete class bool instead, and getting rid of class Bool in core_impl library.
Review URL: https://chromiumcodereview.appspot.com//10874071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11418 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-27 21:09:23 +00:00
srdjan@google.com 894e85a5f5 Simplify EmitTestAndCall and eliminated excessive code generation (two Smi tests emitted).
Review URL: https://chromiumcodereview.appspot.com//10872096

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11417 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-27 21:06:30 +00:00
turnidge@google.com bd995a345e Avoid trusting the length encoded in the Snapshot if there is an
external length available.  We now pass a length with all messages in
the vm and verify that there is no mismatch with the length from the
Snapshot.

Fixed a bug in the use of ApiMessageReader.  We were always manually
adding Snapshot::kHeaderSize to the data, but neglecting to subtract
kHeaderSize from the message length.

Added FullSnapshotWriter and MessageWriter classes.
Review URL: https://chromiumcodereview.appspot.com//10829444

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11413 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-27 20:25:44 +00:00
srdjan@google.com 57c2f57e6a Factored out code, based on Florian's recent submit.
Review URL: https://chromiumcodereview.appspot.com//10868109

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11398 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-27 17:05:09 +00:00