Commit Graph

7090 Commits

Author SHA1 Message Date
vegorov@google.com dde7963d36 Ignore redundant parallel moves when checking if a block is empty.
Single predecessor blocks containing nothing but redundant parallel moves can be compacted away.

R=zerny@google.com
BUG=http://dartbug.com/21302

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41187 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-20 11:29:19 +00:00
iposva@google.com 6266f1d4a0 - Do not attempt to set parameter types if they
were already finalized.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41182 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-17 21:50:28 +00:00
iposva@google.com 39703863c4 - Add a separate step to finalize the VM isolate explicitly.
- Allocate the method extractor parameter types and names
  only once, namely in the VM isolate.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41173 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-17 17:02:19 +00:00
srdjan@google.com 3dbcfcca7a Fix issue 21159: prevent endless inlining of field dispatchers.
Review URL: https://codereview.chromium.org//659793003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41156 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-16 17:13:01 +00:00
srdjan@google.com 5b9f017992 Fix issue 20133: do not crash if debug port is illegal.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41155 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-16 17:08:22 +00:00
fschneider@google.com 04563b8bce Fix crash with --trace-deoptimization-verbose and tweak formatting.
Uninitialized instances (e.g. closures) can't be printed using ToCString.
Print just the class instead.

Print values/addresses consistently with our disassembly output (no leading zeros)
This makes searching in the trace output easier.

Limit printing source lines to max 80 chars. Otherwise the trace output for
minified Dart code gets unreadable.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41134 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-15 15:49:40 +00:00
fschneider@google.com 9087108b5f VM: Avoid repeated deoptimization on speculatively hoisted smi-checks.
This adds the same check as we already have for CheckClass for
CheckSmi and CheckEitherNonSmi instructions to avoid repeated
deoptimization after LICM.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41133 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-15 15:46:49 +00:00
fschneider@google.com c4ff0631f8 Initialize the async jump variable with a smi to avoid polymorphic comparison.
Using the implicit initial null value makes the comparison in the dispatch
prologue of async closures polymorphic (Null|Smi). Initializing to it -1
eliminates the unnecessary class check for null.

Small clean up of scopes and internal variables used for async functions:
Capture them in the parser, so that there is no need to do this later in the
async-transformer.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41123 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-15 11:41:22 +00:00
vegorov@google.com 3d0ddfce79 BoundsCheckGeneralizer::Simplify should ignore unsupported binary ops.
R=fschneider@google.com
BUG=http://dartbug.com/21324

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41118 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-15 10:26:37 +00:00
hausner@google.com 053dc6eaee Fixing release build
Make compiler happy.

TBR=srdjan

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41106 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-14 20:07:48 +00:00
hausner@google.com 2f49f29c38 Await always waits
The expression ‘await e’ always suspends the enclosing function. If e does not
evaluate to a an object o of type Future, a new Future is created using Future.value(o).

A small change in the backend allows a return instruction to be followed by
other instructions. In async functions, a return can suspend the function and the
continuation point is in the same code block after the return.

Other small changes:
- More user-friendly error message if async/await is not enabled.
- Programs no longer need to import dart:async when using async/await.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41105 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-14 19:58:06 +00:00
fschneider@google.com e6ef4b16bf Fix captured parameters and optimized try-catch.
The stack slots of captured parameters must be skipped when
generating sync code in optimized try-catch. Since those parameters
are initially copied into the context, their values are not recorded
in the environment.

Store-to-load forwarding may though use the original initial value
from the stack and therefore it must not be overwritten by try-sync
code that predeeds every call inside optimized try-blocks.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41099 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-14 14:48:32 +00:00
rmacnak@google.com 2b51264dcf Make deserialization more regular as prep for deferring canonicalization for types/instances.
BUG=http://dartbug.com/21079
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41089 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-14 01:16:00 +00:00
hausner@google.com 05398d6e02 Reuse function objects of async closure body
When an async function is compiled, it creates a closure that contains the code of the async function’s body. Before this change, a new function object is created each time the async function is compiled. This change looks up previously created closures and reuses them, similar to what the parser does for local functions.

R=rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41084 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-13 21:38:12 +00:00
koda@google.com 1fbac47d9e Write barrier audit: const raw_ptr()
raw_ptr() now returns a const*, and all writes within objects must be routed through a well-defined set of methods on Object.

Note: This also includes writes to non-pointer fields, to enable low-level verification of all writes. Additionally, it allows enforcing a NoGCScope around such writes to protect against moving objects.

Add a bunch of these (now required) NoGCScopes.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41058 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-11 00:26:54 +00:00
koda@google.com b7db007f71 Fix Object::Clone.
Exclude header when copying: default value for its tags will be that of a fresh object.
Correct logic for adding the clone to the store buffer.

BUG=21273

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41055 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-10 23:26:58 +00:00
regis@google.com 8e8456cfdb Fix x64 build (RBX is callee-saved, use R8 instead).
Review URL: https://codereview.chromium.org//643293002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41053 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-10 20:43:44 +00:00
regis@google.com 3e4f87790e Implement bigint absAdd, absSub, mulAdd, sqrAdd, estQuotientDigit intrinsics,
and Montgomery mulMod intrinsics on x64.
Add support for mul, div, shld, adc, sbb instructions on x64.
Add assembler tests.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41050 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-10 19:50:03 +00:00
iposva@google.com 1cae9b9c40 - Fine grain locking of free list when sweeping concurrently.
Review URL: https://codereview.chromium.org//649743002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41049 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-10 19:44:41 +00:00
koda@google.com 9fc1ca4536 Add unit test for freeing VirtualMemory.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41043 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-10 15:41:00 +00:00
zra@google.com f3a21e3ff3 Uses correct mnemonic for vmrs instructions.
Keeps vmstat as a macro.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41042 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-10 15:30:41 +00:00
zra@google.com 677a4709ce Uses stp/ldp for frame entry/exit on arm64.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41041 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-10 15:29:27 +00:00
regis@google.com 2d677be961 Implement bigint absAdd, bigint absSub, and Montgomery mulMod intrinsics on ARM.
R=johnmccutchan@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41036 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-10 07:49:27 +00:00
johnmccutchan@google.com 7bbdfc2e16 - Use UnboxedInt32 and UnboxedUint32 representation for LoadIndexedInstr
- Avoid inserting an check class instruction for Uint32 and Int32 arrays on StoreIndexedInstr
- Implement Int32ToDouble on all architectures
- Add Int32 to double instruction to ARM64 and simulator.
- Add Int32 to double instruction to X64.

R=vegorov@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41025 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-09 20:49:15 +00:00
koda@google.com 299cc226b8 Fix windows build.
TBR=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41020 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-09 16:09:59 +00:00
koda@google.com ada197e1dd Fix return types on macos+android.
TBR=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41018 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-09 16:07:21 +00:00
koda@google.com 2965f45064 Simplify VirtualMemory by removing unused ReserveAligned method.
Also add the ability to truncate without actually unmapping.
Note: We never create holes in the underlying reservation.

This CL is in preparation for using a thin wrapper around VirtualMemory to verify our upcoming concurrent write barrier.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41017 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-09 15:59:28 +00:00
jgruber@google.com bdfcd15bd5 Iterative graph traversal in FlowGraph::DiscoverBlocks()
The motivation behind this change is that very large functions could
cause stack overflows in the (previously recursive) DiscoverBlocks
function. This commit introduces replaces recursive traversal by
iterative algorithms. Postorder traversal had to be removed from
DiscoverBlocks and is now done in a separate pass.

BUG=21109
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41016 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-09 15:35:13 +00:00
vegorov@google.com 1ea5f34f56 Fix incorrect handling of refined aliases during load forwarding.
If intrablock load forwarding refines some store instruction in a way that introduces previously unseen alias fallback to unrefined place with a more generic alias instead.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41009 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-09 11:47:13 +00:00
regis@google.com 48439b139d Split bigint test into several tests.
Add bigint tests with --no_intrinsify.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41008 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-09 09:42:35 +00:00
ajohnsen@google.com 1e731cf3e5 Don't create unused OSError in Socket_Available.
BUG=
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41005 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-09 06:21:21 +00:00
regis@google.com fa35913e91 Fix expected value in arm assembler test.
Review URL: https://codereview.chromium.org//639973002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40994 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-08 17:47:55 +00:00
regis@google.com 632edf5d55 Implement bigint mulAdd and sqrAdd intrinsics on ARM.
Add support for umaal instruction on ARM (assembler, disassembler, simulator).
Add assembler test for umaal instruction on ARM.

R=johnmccutchan@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40993 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-08 16:59:59 +00:00
regis@google.com 1026872687 Fix 32-bit and 64-bit carry out calculation in arm64 simulator.
Add support for 32-bit and 64-bit addition/subtraction with carry on simarm64.
Add assembler tests.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40989 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-08 07:22:06 +00:00
vegorov@google.com 71c15a979c Fix clang based build after r40969.
TBR=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40972 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-07 19:09:32 +00:00
vegorov@google.com e6113cc0f5 If bounds check 0 <= index < length is not redundant we attempt to
replace it with a sequence of checks that guarantee

          0 <= LowerBound(index) < UpperBound(index) < length

and hoist all of those checks out of the enclosing loop.

Upper/Lower bounds are symbolic arithmetic expressions with +, -, *
operations and are computed based on discovered simple induction variables.

Simple induction variable is a variable that follows the pattern v1 <- phi(v0, v1 + 1)

BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40969 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-07 18:50:29 +00:00
zra@google.com f9b269397c Unrolls array initialization loop for small arrays.
This is similar to what is already done for
object field initializaion, and gives a small
performance improvement on ARM.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40961 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-07 16:26:18 +00:00
zra@google.com fb29f5e342 Adds ldp and stp instructions to ARM64.
These should be used instead of single
register load and store on frame entry
and exit. I'll update these in another
change.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40960 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-07 16:25:56 +00:00
koda@google.com 3e73a6bcbf Enable concurrent sweep for ia32.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40947 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-06 23:25:39 +00:00
koda@google.com 3291f76135 Avoid verifying heap while sweeper is running.
Verifier cannot handle a combination of dead+unswept objects and dead+swept objects.
* Verify before marking, before sweeping, and after a non-concurrent sweep.
* Disable pre/post-scavenge verification when concurrently sweeping.
* On shutdown, wait until concurrent GC tasks finish before verifying.

R=iposva@google.com
TBR=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40946 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-06 23:20:23 +00:00
koda@google.com 627e89639c Check mark bit when verifying heap.
Verify expected state of mark bit, depending on:
- pre vs. post-GC
- VM vs. regular isolate
- concurrent vs. regular sweep

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40943 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-06 19:24:45 +00:00
fschneider@google.com 217dab63db Fix assertion failure in range analysis.
The resulting range was correct, but not precise, as expected (too large by a constant)

BUG=dartbug.com/21245
TEST=tests/language/vm/regress_21245_test.dart
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40932 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-06 14:52:05 +00:00
koda@google.com a6c75c3960 Fix Object::Clone heap corruption under concurrent sweeping.
Don't clone the mark bit; for details,
see https://code.google.com/p/dart/issues/detail?id=21236

BUG=21236
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40926 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-06 13:28:27 +00:00
regis@google.com b7120c779c Fix carry out calculation in ARM simulator.
Add a regression test.
Simplify overflow calculation in ARM simulator.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40918 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-06 07:12:15 +00:00
zra@google.com 240afa6afa Expands the use of Immediate and Operand wrappers.
Since Register is an enum type, it is automatically
coerced to integer types when passed as a parameter to
functions expecting an integer argument. This change
expands the use of Immediate and Operand wrappers
for Assembler instructions and macros to avoid this
automatic coercion.

I've also added dummy constructors to Address and
FieldAddress classes to address the same problem,
but in a way that does not increase verbosity,
since Address and FieldAddress are much more
prevalent in the code.

A cleaner solution would involve making Register
no longer coercable to integer types, but this
would likely require many changes to the Assemblers.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40905 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-03 19:46:24 +00:00
lrn@google.com 4d4c8a6332 Make Iterable.toSet say that it returns a Set with the same equality as the Iterable's contains method.
Let's consider whether this is really desirable once more.
It seems messy, but so does not doing it.

R=ajohnsen@google.com, floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40893 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-03 07:43:10 +00:00
lrn@google.com d8a2043098 Fix wrong limit on list index in double.parse.
Review URL: https://codereview.chromium.org//623073002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40892 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-03 07:03:45 +00:00
lrn@google.com 3192c983bf Dart version of double.parse that works for numbers that can be represented exactly as doubles.
BUG= http://dartbug.com/17711
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40891 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-03 06:01:44 +00:00
koda@google.com 366ac688e3 Write barrier audit, part 1.
First step towards complete audit of all writes to the heap for write barrier compliance (at least on simulator debug builds).

This first CL is a semi-mechanical refactoring to route most Object field writes through StoreNonPointer and StoreSmi methods.

A few stores were converted to StorePointer (skipping the write barrier check is premature optimization for those cases).

Next step will be to make raw_ptr() return a const pointer and use the constness to clean up remaining writes in C++.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40889 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-02 20:47:45 +00:00
koda@google.com b296ba0e82 Bump-pointer allocation when reading snapshot; 10-15% faster isolate creation.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40888 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-02 20:45:39 +00:00