Commit Graph

134 Commits

Author SHA1 Message Date
Vyacheslav Egorov e763fac3b7 VM: [DBC] Fix more problems with lazy deopt.
Catch entries must record a lazy deoptimization descriptor because we patch catch entries if exception reaches a frame that has a pending lazy deoptimization.

StringInterpolate instruction was recording an incorrect lazy deoptimization environment - on DBC we drop arguments from it because it is a part of the return sequence and not a part of the calling sequence like on other architectures. This means one needs to pass correct argument count down to RecordAfterCall(Helper). StringInterpolate however has argument count of 0 but internally emits a call with a single argument leading to a mismatch if RecordAfterCall is used. Use
RecordAfterCallHelper instead.

BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2595553002 .
2016-12-20 17:30:06 +01:00
Vyacheslav Egorov 1fcc7384aa VM: [DBC] Fix lazy deoptimization after calls that return no values.
On DBC calls return value on the stack instead of a dedicate register but not all calls have a return value (e.g. CheckStack does not) and such calls don't push anything. Implementation of a lazy deopt however assumed that value is always present and tried to manually preserve it by popping and pushing it back after the frame was rewritten. This of course damaged the frame if we performed a lazy deoptimization after the call that did not push anything.

Instead of manually preserving result value value use frame translation to handle it. This allows to handle calls that return value and those that do not uniformly in the Deopt bytecode. Compiler takes care of creating the right deoptimization environment instead.

BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2587133002 .
2016-12-19 23:08:26 +01:00
Ben Konyi 7e918f5b48 Fixed the conditions of an assert causing the debug VM to crash when trying to load a library from an invalid path. Created copy of a previous deferred_import_t02.dart test from co19 as a regression test until deferred_import_t02.dart is reverted to the previous test.
Fixes #27201

R=zra@google.com

Review URL: https://codereview.chromium.org/2537253002 .
2016-11-29 14:07:19 -08:00
Florian Schneider 890bfa8015 AOT: Fix bug in receiver type propagation after unique selector calls.
Insert Redefinition instructions to prohibit unsafe code motion. If we propagate
the receiver type downwards from a call to a unique selector, we must not hoist
instructions that were optimized using this type information across the call.

R=vegorov@google.com

Review URL: https://codereview.chromium.org/2498073004 .
2016-11-16 10:14:40 -08:00
Florian Schneider 368409d3e4 DBC: Fix bugs with array allocation
Guard against negative length in the fast path.

Add missing PC descriptors for correct exceptions.

BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/2490803002 .
2016-11-08 15:45:31 -08:00
Ryan Macnak d5580f3b00 Fix unaligned access to TypedData from native code.
Split unaligned access test and mark the float half as failing on Android.

R=zra@google.com

Review URL: https://codereview.chromium.org/2473553002 .
2016-11-02 15:53:26 -07:00
Ryan Macnak 26245de7a5 Support unaligned integer loads on ARM and MIPS.
Fixes SDK build with SIMARM/SIMARM64/SIMMIPS.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2452453002 .
2016-10-31 17:41:53 -07:00
John McCutchan 8007a98b5b Produce the correct assertion failure expression in the face of inlining
Fixes #27671

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2453263002 .
2016-10-27 07:29:22 -07:00
John McCutchan 7fd9df4d91 Improvements to NoSuchMethodError.toString
This makes the following improvements:

* Always show the call that was made, with arguments.
* ...and show the actual arguments in more cases.
* Be less confusing in the case of a call on the null receiver.
* Be less redundant in the output.
* Report when a constructor is called with the wrong number of arguments.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2405353002 .
2016-10-12 09:52:51 -07:00
Florian Schneider e25461c151 VM Propagate receiver type from calls to unique selectors in AOT compilation.
If there is no override of noSuchMethod in any class, we can
propagate the receiver type downwards from calls that call a unique
selector.

This speeds up dart2js by around 3%, a particle simulation benchmark by around 10%.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2412653002 .
2016-10-11 13:17:47 -07:00
Ryan Macnak e1a252a017 Fix a throw returning to a frame marked for lazy deopt that captures the stacktrace.
A lazy deopt via a return needs to preserve one value (the result), but via a throw needs to preserve two values (the exception and stacktrace).

Fixes #27446.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2374273002 .
2016-09-28 16:51:45 -07:00
Ryan Macnak e3420eab29 Revert "Pass new pool pointer to the JumpToException stub instead of reloading in through the frame's Code object."
This reverts commit 3413e052b3.

Review URL: https://codereview.chromium.org/2374173002 .
2016-09-28 13:00:00 -07:00
Ryan Macnak 3413e052b3 Pass new pool pointer to the JumpToException stub instead of reloading in through the frame's Code object.
This is prep work for lazy deopt without code patching.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2376843002 .
2016-09-28 10:15:09 -07:00
Florian Schneider 7ca3da1a3a Fix lazy deoptimization in the presence of exceptions
Catch block entries need to be considered when doing lazy deoptimization.

In addition to the return, also patch all catch entry blocks in a function scheduled for lazy deoptimization.

Also, move restoring the pool pointer to the jump-to-handler stub to simplify patching the catch entry.

BUG=#27419
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2357343003 .
2016-09-26 16:24:23 -07:00
Florian Schneider 021ebb2033 Correct and GC unrecognized flags from our tests.
Fix some misspelled flags.

Remove some non-existent flags.

Fix --short_socket_read and --short_socket_write flags used in IO tests.

Running with --ignore-unrecognized-flags is still on because some flags are only visible
in DEBUG mode.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2247733005 .
2016-08-15 18:28:11 -07:00
Regis Crelier 962353674b Delete stray comment in tests.
R=hausner@google.com

Review URL: https://codereview.chromium.org/2067453003 .
2016-06-13 11:30:57 -07:00
Zachary Anderson 6e90ca4e0a DBC: Eager deoptimization and CheckSmi instruction.
R=vegorov@google.com

Review URL: https://codereview.chromium.org/2039913006 .
2016-06-09 09:47:56 -07:00
Florian Schneider 2783afd607 VM: Fix receiver type propagation in presence of try-catch.
With catch blocks appearing as additional function entry blocks,
there can be phis for the receiver (parameter 0).

This CL fixes the problem that the receiver type information
was lost in the presence of try-catch.

BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1841073003 .
2016-03-30 15:55:11 -07:00
Srdjan Mitrovic b3405d5ebc Add --no-background-compilation to tests that expect to run code in optimized form
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1759973002 .
2016-03-02 16:30:58 -08:00
Florian Schneider 2b7ff6dfab Fix test by removing the --noopt flag from the test file.
Not all platforms (ia32) support --noopt, and test.py --noopt will run the test
with this option anyway.

TBR=rmacnak@google.com

BUG=

Review URL: https://codereview.chromium.org/1497213002 .
2015-12-04 13:08:14 +01:00
Florian Schneider eee0e6d8c3 Fix optimizations on static fields in precompiled code.
Don't perform LICM / or load elimination of static fields in precompiled
code since they may not be initialized and we don't record an explicit
dependency between the initialization and the load of a static field.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1497783002 .
2015-12-04 12:42:39 +01:00
Florian Schneider 94fcce2b0c Fix analyzer warning in a unit test.
Add initializer for a final field.

TBR=rmacnak@google.com

BUG=

Review URL: https://codereview.chromium.org/1494233003 .
2015-12-03 21:45:00 +01:00
Florian Schneider dff13bef8d VM: Fix bug in type propagation at conditionals.
Propagating type/cid at conditional branches is not possible because
it may cause invalid code motion.

For this to be safe we need to explicitly represent the dependency
between checks eliminated in a branch and the condition that constrains the type/cid.

BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1491373005 .
2015-12-03 21:14:35 +01:00
Alan Knight 50b1ea35e9 Fix a couple more tests related to Isolate.spawn semantics change
BUG=

Review URL: https://codereview.chromium.org/1481693002 .
2015-11-25 16:28:59 -08:00
Srdjan Mitrovic 4600d37dc1 Background compilation work:
- Defer deoptimization from optimizing compiler to code installation in mutator thread.
- Defer registration of field and leaf class dependency until code is installed in mutator thread.
- Cleanup.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1433243003 .
2015-11-12 11:25:58 -08:00
Florian Schneider 9f54259d57 VM: Fix FP math discrepancies by adding -mfpmath=sse to 32-bit simulator and cross host builds.
BUG=dartbug.com/24517
R=zra@google.com

Review URL: https://codereview.chromium.org/1395543003 .
2015-10-08 17:16:46 +02:00
regis@google.com 240c208462 Add a separate test verifying that the optimizer does not trip over debug break.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45300 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-20 23:19:58 +00:00
vegorov@google.com 7db7425826 Reland r45243.
Type and constant propagator should guard against mutable class ids.

Constant strings can be externalized so we can't fold away class checks against
them.

Prevent CP from removing redefinitions of constants with mutable cids.

BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45275 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-20 10:42:54 +00:00
regis@google.com c983ebf506 Fix bigint division (issue 23238).
Add regression test.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45253 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 20:30:29 +00:00
regis@google.com 9a2468736a Add support for debug break in Dart source.
The new flag --enable-debug-break turns the otherwise illegal Dart statement
  break "message";
into a break instruction preceded with a debug message, the equivalent of
emitting an Assembler::Stop("message").
Add a language test expecting a syntax error without the flag.
Change expected break instruction in arm64 simulator.
Remove constants related to now deleted simulator tracing on mips and arm64.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45218 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 19:32:48 +00:00
regis@google.com 8a0194b846 Fix mint shifting by zero on MIPS (issue 23117).
Add regression test.
Restore formatting space dropped by mistake in simulator tracing output.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45042 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-09 22:50:25 +00:00
vegorov@google.com b2d9992127 Fix incorrect kNumTemps for BinaryUint32OpInstr on x64
R=johnmccutchan@google.com
BUG=http://dartbug.com/22693

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44296 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-06 17:53:39 +00:00
vegorov@google.com 8c89e30eb8 Emit stackmaps even in unoptimized code if slow path pushes untagged values.
These stackmaps cover only pushed registers region, the rest of the stack (copied parameters, locals and temporaries) will be scanned as tagged values.

R=fschneider@google.com
BUG=http://dartbug.com/22621

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44173 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-03 15:43:32 +00:00
fschneider@google.com ea77da464b VM: Better type propagation for string objects.
For strings we can't propagate the class-id because of externalization,
but we still can record the compile-type (String). This is for example useful
for eliminating number-checks with identical-comparisons.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44133 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-02 16:10:22 +00:00
vegorov@google.com 094e899972 Fix Range::Mul for fully non-positive ranges.
BUG=http://dartbug.com/22541
R=fschneider@google.com, iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44046 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-26 12:40:55 +00:00
vegorov@google.com 598811048b Fold BIT_NOT and NEGATE during constant propagation.
Convert (a & 2^n) == 2^n into TestSmi instruction.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43957 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-23 14:53:02 +00:00
vegorov@google.com e8b7f9cb06 Don't constant fold operation if result is incompatible with it.
For example we can't replace BinarySmiOp with Mint constant because we might have removed the checks based on the assumption that BinarySmiOp always returns a Smi.

BUG=http://dartbug.com/22480
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43875 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-19 13:48:48 +00:00
fschneider@google.com f7a97fa4d4 VM: Fix slow-path deoptimization environment.
The number of pushed arguments needs to be accounted for.

BUG=dartbug.com/22331
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43681 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-11 13:34:15 +00:00
vegorov@google.com 2b42069b43 Fix LoadOptimizer's handling of load/stores with constant indices for TypedData.
LoadOptimizer computes KILL sets in assumption that place X[C] can alias place X[K] if and only if K == C. This however does not hold for TypedData where X[0] can alias X[1] if we are reading 32bit value at X[0] and 8bit value at X[1]. The only thing that TypedData guarantees is that all accesses are done with byte offsets aligned by the size of the data type.

This change incorporates TypeData elements aliasing rules into LoadOptimizer:

- Place hierarchy was extended with constant index places for TypedData X[C|S]:
  - C is a byte offset to the element being read instead of an unscaled index that was used before;
  - S size of the element being read.

- KILL set computation ensures the following aliasing rule:

      X[C|S] aliases X[RoundDown(C, S')|S'] for all sizes S' > S

R=fschneider@google.com
BUG=http://dartbug.com/22120

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43137 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-26 15:14:35 +00:00
rmacnak@google.com db79e9cca6 Rename is_visible to is_reflectable; use is_debuggable instead of is_reflectable to decide whether to filter a frame from stack traces.
Merge verbose_stacktrace flag into show_hidden_frames.

Don't mark native functions as non-debuggable (breakpoints don't actually work there now but nothing goes wrong).

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43121 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 21:16:40 +00:00
fschneider@google.com e081d375e4 Fix 64-bit bug in optimized class-check instructions.
The mask is machine-word wide, so the computation of the mask
must not use a 32-bit shift operation.

BUG=dartbug.com/22104
TEST=tests/language/vm/optimized_check_class_test.dart
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43014 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 16:00:43 +00:00
hausner@google.com bb1ab60dc0 First step in eliminating —enable_async flag
Switch default value of enable-async to true, and remove the flag
from test source code.

Next step is to remove the flag altogether

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42670 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-07 19:42:59 +00:00
hausner@google.com 392db8d312 Implement correct semantics of Boolean Conversion
When converting null to a boolean value, throw an AssertionError
rather than a TypeError.

This is the same change as r42145, with added co19 status updates.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42170 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-08 18:51:48 +00:00
hausner@google.com 4cfdf02012 Revert r42145 to fix co19 tests
Review URL: https://codereview.chromium.org//772513003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42148 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-05 21:05:38 +00:00
hausner@google.com ad837a0d9f Implement correct semantics of Boolean Conversion
When converting null to a boolean value, throw an AssertionError
rather than a TypeError.

Fixes issue 21279.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42145 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-05 20:36:37 +00:00
vegorov@google.com 8f7f26c0a4 Reland "Suppress canonicalization of Unbox() instruction that can deoptimize."
This relands commit r41693 with additional fixes in canonicalization pass.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41736 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-14 11:19:42 +00:00
fschneider@google.com b26ff22adf Allocation sinking for contexts.
Improved aliasing computation in presence of Redefinition and AssertAssignable.

Added possibility for inlining annotations via --enable-inlining-annotations flag.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41713 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-13 13:53:58 +00:00
vegorov@google.com 97c3268f51 Revert "Suppress canonicalization of Unbox() instruction that can deoptimize."
This reverts commit r41693 due to checked mode test failures.

TBR=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41695 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-12 18:57:31 +00:00
vegorov@google.com 94e896d963 Suppress canonicalization of Unbox() instruction that can deoptimize.
Suppress canonicalization of instructions that have unsatisfied input representations.

BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41693 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-12 17:23:55 +00:00
vegorov@google.com a3c8a2643d Add regression test for http://dartbug.com/21220.
BUG=http://dartbug.com/21220
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41599 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-07 12:18:41 +00:00