Commit Graph

58 Commits

Author SHA1 Message Date
Kevin Millikin f31b6d5e2c Reland "Track the 'awaiter return' call stack..."
Original CL: https://codereview.chromium.org/2692803006/

Original commit message:
Tracking the awaiter return call stack:

- [x] Each async function closure now knows who is awaiting on their
return. This is effectively the asynchronous equivalent of the 'frame pointer'.
- [x] Each async* function closure now knows how is listening on their
stream. This is effectively the asynchronous equivalent of the 'frame pointer'.

Detecting uncaught exceptions in async functions:

- [x] Code object keeps a map from :await_jump_var to token position
- [x] Exception Handlers keep track if they are generated (as part of compilation) or directly from user code
- [x] Debugger maps :await_jump_var to a specific try index

R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2725623003 .
2017-02-28 16:13:41 +01:00
Kevin Millikin a0965a641f Revert "Track the 'awaiter return' call stack..."
Revert a pair of commits that cause failure of the Kernel continuation
transformer:

  cba7e3e79a
  4fe4f177de

R=kustermann@google.com

Review-Url: https://codereview.chromium.org/2718353002 .
2017-02-28 12:46:31 +01:00
John McCutchan cba7e3e79a Track the 'awaiter return' call stack use it to detect uncaught exceptions in async functions
Tracking the awaiter return call stack:

- [x] Each async function closure now knows who is awaiting on their
return. This is effectively the asynchronous equivalent of the 'frame pointer'.
- [x] Each async* function closure now knows how is listening on their
stream. This is effectively the asynchronous equivalent of the 'frame pointer'.

Detecting uncaught exceptions in async functions:

- [x] Code object keeps a map from :await_jump_var to token position
- [x] Exception Handlers keep track if they are generated (as part of compilation) or directly from user code
- [x] Debugger maps :await_jump_var to a specific try index

Fixes #27242

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2692803006 .
2017-02-27 14:16:15 -08:00
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
John McCutchan f125cc7d0b Improve the casing of Stackmap and Stacktrace.
- [x] Stackmap -> StackMap
- [x] Stacktrace -> StackTrace

This makes us consistent with the Dart language (StackTrace) and
corrects the casing of StackMap.

BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2572563004 .
2016-12-12 14:51:30 -08:00
John McCutchan 8b6f610206 Fix hot reload test mode in simdbc by supporting forced slow paths on simdbc
- [x] Add new SIM DBC byte code: CheckStackAlwaysExit.
- [x] Emit CheckStackAlwaysExit instead of CheckStack when requested.

BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2569013002 .
2016-12-12 14:07:22 -08:00
Florian Schneider dc6aaadba9 DBC: Add missing PC descriptors in static initializers.
InitStatic can call, and may throw. Therefore we need to mark it as a call.

BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/2491713002 .
2016-11-17 10:30:06 -08:00
Zachary Anderson a64272b912 DBC: Fix checked mode stack traces
fixes #27732

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2493353002 .
2016-11-11 21:39:47 -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
Zachary Anderson a1bcf051d8 clang-format runtime/vm
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2481873005 .
2016-11-08 13:54:47 -08:00
Florian Schneider a77d860806 Fix static field initialization in optimzed DBC code.
Static fields can be initialized from optimized code. This CL
adds support for handling InitStaticFieldInstr in optimized code.

Fixes #27787.

R=zra@google.com

Review URL: https://codereview.chromium.org/2486863002 .
2016-11-08 11:21:47 -08:00
Florian Schneider 44418359e0 DBC: Handle constants correctly in the optimizing backend
We don't always allocate a register for constants in optimized code. Instead
they are copied into registes as needed by parallel moves at the use site.

Fixes #27731.

R=vegorov@google.com

Review URL: https://codereview.chromium.org/2477653002 .
2016-11-03 12:24:05 +01:00
Florian Schneider f0b9466e55 Fix DBC build.
Fix linker errors by adding missing definitions.

TBR=vegorov@

BUG=

Review URL: https://codereview.chromium.org/2471793002 .
2016-11-02 14:41:27 +01:00
Florian Schneider b1dfa2aee1 VM: Enable branch merging of isnan, isinf.
More general ComparisonInstr by introducing TemplateComparison.

R=zra@google.com

Review URL: https://codereview.chromium.org/2463593002 .
2016-10-31 20:21:19 +01:00
Zachary Anderson 088347fd9d Reland "Add DoubleTestOp instruction"
Fixes DoubteTestOpInstr::AttributesEqual()

Review URL: https://codereview.chromium.org/2433813002 .
2016-10-18 22:46:36 -07:00
Zachary Anderson f6296cc91b Revert "Add DoubleTestOp instruction"
Review URL: https://codereview.chromium.org/2432903002 .
2016-10-18 21:57:05 -07:00
Zachary Anderson fa855cf1c2 Add DoubleTestOp instruction
This gives a ~5% bump to the Flutter layout benchmark
in checked mode.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2423843002 .
2016-10-18 21:24:12 -07:00
Florian Schneider 6d66f3dea8 VM: Make optimized try-catch work in DBC.
The catch entry block has all locals in fixed locations
(Rj) where j = kNumberOfRegisters - i for parameter i.

This means we reserve a range of DBC registers at the top-end of the frame.
Those registers are blocked for general allocation to avoid any overlap
with the rest of the registers that are allocated from the bottom.

Each optimized frame with a try-catch will be kNumberOfRegisters wide.

BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/2388093003 .
2016-10-13 11:36:23 -07:00
Florian Schneider e013aaa511 Fix DBC double comparisons for NaN.
Because NaN is not handled in a separate branch (like on other architetures -
e.g. branch-on-parity-flag on ia32), and every comparison with NaN returns false,
except "!=" we can't flip the branch condition in the same way for double
compares like we do for integer compares.

We could re-order blocks to always make the false-successor the fall-through, but
for now I just disable flipping the branch condition for double compares.

BUG=#27481
R=zra@google.com

Review URL: https://codereview.chromium.org/2400103002 .
2016-10-07 15:30:21 -07:00
Florian Schneider a292de544f DBC: Support large offsets in optimized field access.
Added two new bytecodes: LoadFieldExt, StoreFieldExt that
store the field offset in the following nop-instruction that
is skipped.  This allows offsets up to 16 bit.

BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/2399333003 .
2016-10-07 14:03:34 -07:00
Zachary Anderson bc1dc06687 DBC: Double converstion instructions
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2341683003 .
2016-09-15 09:18:32 -07:00
Zachary Anderson 360d55b4f6 DBC: Another allocation fast path
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2335363002 .
2016-09-14 10:24:58 -07:00
Zachary Anderson 7d01ca5e0d DBC: A couple allocation fastpaths.
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2331033003 .
2016-09-13 10:21:27 -07:00
Florian Schneider 7d6f78b88f VM: More refactoring of recognized methods inlining.
Move inlining OneByteString._setAt, List constructor, Object constructor
and a few math function to the flow-graph inliner.

Enable inlining of trigonometric math functions in AOT that were previously not inlined.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2273943002 .
2016-08-24 10:35:05 -07:00
Zachary Anderson b49de12f6c DBC: Fix more HTTP benchmark bailouts
HttpRequest(IOPerSecond) ~300 -> ~350

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2270483002 .
2016-08-22 15:57:57 -07:00
Zachary Anderson ae3d47fdc4 DBC: Add back special case for float64 load/store
After my last change eliminating the special case, there was a
20% perf drop on FluidMotion.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2268593002 .
2016-08-22 14:39:27 -07:00
Zachary Anderson 08ff3c039e DBC: Fixes typed data bugs. Adds unboxed int32 instructions
Typed data indexing was all wrong. It was also wrong to clobber the index register in LoadIndexed.

RSA benchmark: 88s -> 0.7s

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2258493004 .
2016-08-19 15:23:16 -07:00
Zachary Anderson f7e186eb20 DBC: Instructions for bailouts from http tests.
Load/Store indexed from typed data arrays, etc.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2258613002 .
2016-08-18 09:50:55 -07:00
Zachary Anderson c75200774b DBC: Fleshing out the polymorphic instance call instruction
R=vegorov@google.com

Review URL: https://codereview.chromium.org/2244313002 .
2016-08-16 11:21:25 -07:00
Ryan Macnak 10863a8f0c DBC: Fail cleanly when attempting to create an AOT or JIT app snapshot.
Use the appropriate object pool entry type for native functions (makes a JIT app snapshot fail at snapshot creation time instead of runtime).

R=zra@google.com

Review URL: https://codereview.chromium.org/2196693003 .
2016-07-29 14:11:27 -07:00
Ryan Macnak 634a62c9df DBC: Add missing deopt info after stack overflow checks.
Fixes collecting a debugger stack trace at an interrupt.

Enable most vm-service tests.

R=zra@google.com

Review URL: https://codereview.chromium.org/2183993004 .
2016-07-27 12:25:54 -07:00
Zachary Anderson d279392430 DBC: More Load/Store Indexed variants, A few more math instructions.
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2181713002 .
2016-07-25 13:40:37 -07:00
Zachary Anderson 2c6449087d DBC: Misc double instructions
- DoubleToSmi
- MathUnary
- MathMinMax

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2162173002 .
2016-07-20 09:46:32 -07:00
Zachary Anderson 8aed249e88 DBC: A bit of Polymorphic instance call
Only for the case without checks. Still enough for a good bump on
Richards. I've also increased the number of "registers" to 32 to
get rid of the SPILLs on DeltaBlue, but couldn't see a performnace
improvement. Probably better not to bail out, though.

R=vegorov@google.com

Review URL: https://codereview.chromium.org/2162953005 .
2016-07-20 08:54:50 -07:00
Zachary Anderson 43e89ccdd3 DBC: Make unoptimized static calls call through ICData
Isolate reloading works by manipulating ICData. Unoptimized
static calls won't go to the new function after a reload unless
the calls go through the ICData.

R=vegorov@google.com

Review URL: https://codereview.chromium.org/2149993006 .
2016-07-18 10:39:09 -07:00
Zachary Anderson b43b9bad86 DBC: UnboxedConstantInstr
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2150933008 .
2016-07-15 14:25:40 -07:00
Florian Schneider d3810213b0 VM: Array bounds checks that don't deoptimize for precompiled code.
1. Make CheckArrayBoundInstr also check the index for smi. This allows easy replacement
of the deoptimizing checks with the slow-path checks in the precompiler.

2. Add GenericCheckBoundInstr which has a slow-path attached for
handling check failures.

BUG=
R=rmacnak@google.com, vegorov@google.com

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

Committed: https://github.com/dart-lang/sdk/commit/4a5f651c4b2202013ab7c3db887fd95e2597e173
2016-07-15 10:07:41 -07:00
Zachary Anderson fe2b7b35c4 DBC: Enables unboxed doubles
This CL enables unboxed doubles for simdbc64. Unboxed
doubles are stored in regular dbc registers, which are
really 64-bit stack slots. It also implements binary
and unary double operations and comparisons.

R=vegorov@google.com

Review URL: https://codereview.chromium.org/2120703002 .
2016-07-14 16:05:20 -07:00
Ryan Macnak 2a535414bc Revert "VM: Array bounds checks that don't deoptimize for precompiled code."
This reverts commit 4a5f651c4b.

Review URL: https://codereview.chromium.org/2152683003 .
2016-07-14 13:28:23 -07:00
Florian Schneider 4a5f651c4b VM: Array bounds checks that don't deoptimize for precompiled code.
1. Make CheckArrayBoundInstr also check the index for smi. This allows easy replacement
of the deoptimizing checks with the slow-path checks in the precompiler.

2. Add GenericCheckBoundInstr which has a slow-path attached for
handling check failures.

BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/2149023002 .
2016-07-14 10:48:50 -07:00
Zachary Anderson 726fd84ff4 DBC: Various instructions.
- LoadIndexed
- EqualityCompare
- RelationalOp

R=vegorov@google.com

Review URL: https://codereview.chromium.org/2113563002 .
2016-07-11 09:02:18 -07:00
Ryan Macnak 0737ee08bf DBC: Implement TestCids instruction.
Separate out instructions that won't be implemented.

R=vegorov@google.com

Review URL: https://codereview.chromium.org/2122363002 .
2016-07-07 17:57:39 -07:00
Zachary Anderson 1c783dea87 DBC: Remove special case from CheckClassInstr. Cleanup.
R=vegorov@google.com

Review URL: https://codereview.chromium.org/2111803003 .
2016-07-01 10:19:21 -07:00
Ryan Macnak 17e0b56025 DBC: Implement TestSmi instruction.
Somewhat simplify branch generation.

R=zra@google.com

Review URL: https://codereview.chromium.org/2113523002 .
2016-06-29 16:54:20 -07:00
Zachary Anderson db26281172 DBC: CheckClassInstr
R=vegorov@google.com

Review URL: https://codereview.chromium.org/2098573004 .
2016-06-29 15:25:43 -07:00
Ryan Macnak f84facd284 DBC: Implement OneByteStringFromCharCode and StringToCharCode.
R=zra@google.com

Review URL: https://codereview.chromium.org/2104093003 .
2016-06-29 09:44:31 -07:00
Ryan Macnak 5548f4dd67 DBC: Implement InstanceOf.
R=zra@google.com

Review URL: https://codereview.chromium.org/2109743002 .
2016-06-28 15:45:26 -07:00
Zachary Anderson 4fae9d3efa DBC: Adds UnarySmiOp instruction, etc.
R=vegorov@google.com

Review URL: https://codereview.chromium.org/2076773002 .
2016-06-21 13:40:45 -07:00
Vyacheslav Egorov 669edf6375 VM: Fix frame size computation for optimized DBC code
Register allocator was not accounting for fixed register constraints correctly.

R=zra@google.com
BUG=

Review URL: https://codereview.chromium.org/2072823002 .
2016-06-16 21:58:55 +02:00