Commit Graph

351 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
Ryan Macnak b15b98bcc3 Reapply "Use CodeSourceMap for stack traces (still JIT only)."
- Fix missing null termination in initialization of ZoneTextBuffer.
 - Merge with John's async stack trace changes.

R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2686813006 .
2017-02-09 18:03:41 -08:00
Ryan Macnak 15a9eafb77 Revert "Reapply "Use CodeSourceMap for stack traces (still JIT only).""
This reverts commit bee82fef8b.

Revert "Use zone memory for StackTrace::ToCString."

This reverts commit 4e8b265ea0.

The later CL somehow caused hangs in some service tests.

Review-Url: https://codereview.chromium.org/2683033007 .
2017-02-09 13:14:01 -08:00
Ryan Macnak bee82fef8b Reapply "Use CodeSourceMap for stack traces (still JIT only)."
Include CodeSourceMaps in app-jit snapshots.

R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2686623006 .
2017-02-08 16:43:47 -08:00
Ryan Macnak 9e3bd0ef0a Revert "Use CodeSourceMap for stack traces (still JIT only)."
Failed with app-jit snapshots.

This reverts commit 7d2e6b1615.

Review-Url: https://codereview.chromium.org/2685723004 .
2017-02-08 13:33:23 -08:00
Ryan Macnak 7d2e6b1615 Use CodeSourceMap for stack traces (still JIT only).
R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2684763002 .
2017-02-08 11:31:46 -08: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
Martin Kustermann a4dbbaae10 Mark lazily-patched native calls correctly as patchable.
Lazily linked native entries patch two entries: target native *and* the stub that is used for call.

It only works because we don't ever have two native nodes inside a single function. However it makes sense to always correctly generate patchable calls as patchable.

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

Review URL: https://codereview.chromium.org/2504693002 .
2016-11-16 21:03:38 +01:00
Ryan Macnak e7040c86eb AOT: Speculate that bitwise operators will have Smi receivers and arguments.
Add shifts to CheckedSmiOps.

Fix invalid load forwarding across CheckedSmiOps and CheckedSmiComparisons.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2487873003 .
2016-11-11 13:33:43 -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 0294f8650d AOT: Enable branch merging for checked smi comparisons
This generates better code for smi comparisons in AOT code where the inputs
are not known smis: It avoids materializing the bool-value before branching.

Before:

;; v46 <- CheckedSmiOp:86(==, v35, v77)
;; Branch if StrictCompare:88(!==, v46, v38) goto (8, 9)
0x10e0c2ca3    f6c201                 testb rdx,1
0x10e0c2ca6    0f8526010000           jnz 0x10e0c2dd2
0x10e0c2cac    483bca                 cmpq rcx,rdx
0x10e0c2caf    0f8409000000           jz 0x10e0c2cbe
0x10e0c2cb5    498b5e58               movq rbx,[thr+0x58]   false
0x10e0c2cb9    e904000000             jmp 0x10e0c2cc2
0x10e0c2cbe    498b5e50               movq rbx,[thr+0x50]   true
0x10e0c2cc2    493b5e50               cmpq rbx,[thr+0x50]   true
0x10e0c2cc6    0f8429000000           jz 0x10e0c2cf5  ;; B9
;; B8

===
After:
;; Branch if CheckedSmiComparison:86(!=, v35, v77) goto (8, 9)
0x118b3ce15    f6c201                 testb rdx,1
0x118b3ce18    0f850c010000           jnz 0x118b3cf2a
0x118b3ce1e    483bca                 cmpq rcx,rdx
0x118b3ce21    0f8429000000           jz 0x118b3ce50  ;; B9
;; B8

R=vegorov@google.com

Review URL: https://codereview.chromium.org/2466643002 .
2016-11-01 17:08:33 +01: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
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 8a909671e6 Fix Double.pow() for arm and mips
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2433933003 .
2016-10-19 09:01:55 -07: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
Ryan Macnak 2fddd90a22 VM+RISC: Share object pool entries for allocation stubs.
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2391723002 .
2016-10-03 15:50:03 -07:00
Ryan Macnak 763daa9d06 Reapply "Lazy deopt without code patching."
When throwing to a frame scheduled for lazy deopt, update the continuation pc for that frame to be the catch handler.

Weaken new assert that the deopt pc belongs to the frame's code as the deopt pc for the last eager deopt in a function lies outside the code, after the call to the deopt stub.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2392613002 .
2016-10-03 11:31:48 -07:00
Ryan Macnak 4e9a473746 Revert "Lazy deopt without code patching."
This reverts commit 6cff17c59a.

Review URL: https://codereview.chromium.org/2382953004 .
2016-09-30 18:04:58 -07:00
Ryan Macnak 6cff17c59a Lazy deopt without code patching.
Keep a side table that maps a fp back to a deopt pc.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2380403003 .
2016-09-30 16:53:29 -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
Zachary Anderson 50d321085c Fix -O0 compilation errors
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2289993002 .
2016-08-29 14:57:51 -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
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
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
Siva Annamalai 006bab2c47 Land Ivan's change of 'Remove support for verified memory handling'
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2112043002 .
2016-07-01 09:21:01 -07:00
Florian Schneider baaea63e0a VM: Fix bug that can causes infinite opt/deopt loop.
When deoptimizing on a hoisted TestCids instruction, we must mark the
function to that this instruction does not get hoisted the next time
the function gets optimized.

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

Review URL: https://codereview.chromium.org/1999043002 .
2016-05-20 13:43:02 +02:00
Florian Schneider c1e6aef400 VM: Optimized code for all of [External]{One|Two}ByteString::codeUnitAt.
Added support for external string using flow graph based intrinsics
which helps with precompiled code, but also polymorphic calls in jitted code.
I also added support for the missing cases in the flow graph optimizer.

BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1961393002 .
2016-05-11 09:29:28 +02:00
Florian Schneider 66fa897507 VM: Avoid smi-check when loading class-ids from known non-smi values.
The code for LoadClassId is a lot smaller when we know that the value can't be a smi.

BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1897983002 .
2016-04-19 12:45:39 +02:00
Srdjan Mitrovic 80ba69dfdb Print messages when aborting background compilation (--trace-compiler); turn on background compilation; mark a slow test.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1879033002 .
2016-04-12 11:19:56 -07:00
Florian Schneider 6d27476cd1 VM: Fix a couple of issues in the AOT optimizer, add fast path smi multiply.
1. Add fast path smi multiply

2. Recognize more operands as likely smi: If they are the result
  another CheckedSmiOp, or the result of a phi that has a known smi.

3. Fix guessing receiver cids of getters/setters based.

4. Try to specialize calls based on propagated receiver type first before
  using guessed cids (which generates a call with checks + megamorphic slow path)

BUG=

Review URL: https://codereview.chromium.org/1824023002 .
2016-03-25 08:52:15 -07:00
Florian Schneider ef1c7211bf VM: Use propagated type to improve checked smi operations in aot compiler.
Avoid checking inputs that are known to be smis.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1826463002 .
2016-03-23 10:03:24 +01:00
Siva Annamalai 56e888d4cd - Move
stack_limit_,
   stack_overflow_flags_,
   saved_stack_limit_,
   stack_overflow_count_ and
   other interrupts mask fields from Isolate structure to Thread structure

- Change the stack overflow check in the prolog to load the stack limit
  from the THR register, this removes the back to back dependent loads to
  load the stack limit from the Isolate structure

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

Review URL: https://codereview.chromium.org/1812753002 .
2016-03-17 12:57:36 -07:00
Florian Schneider 2148815673 Add fast path smi comparison operators.
Only rudimentary support for now, gives around 15% speedup on richards, precompiled.

Branch-merging is not yet supported in this CL.

BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1773633002 .
2016-03-07 08:55:43 -08:00
Florian Schneider 72a815c39f VM: Add smi fast path operations for precompiled code
The non-smi case is handled in a slow-path deferred code path.

BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1756403002 .
2016-03-04 09:33:09 -08:00
Regis Crelier 6219753e18 Use TRUNC.W instead of CVT.W on mips to convert from double to int as to not
depend on the current rounding mode (fixes issue 25900).
Add support for TRUNC.W in assembler, disassembler, and simulator.
Fix disassembler to understand CVT.S.
Remove unused instructions.
Update co19 status file.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1765623002 .
2016-03-03 17:05:09 -08:00
Florian Schneider 48b0183926 Make precompiler work with product mode.
For now, change compilation-related flags to be regular
command line options. They won't affect the size of the
precompiled runtime anyway since the compiler is not included
there.

Also introduce a separate switch for precompiled runtime. This can be
 used instead of the macro since it is a compile-time constant in the
 precompiled runtime.

BUG=

Review URL: https://codereview.chromium.org/1759913002 .
2016-03-02 13:59:54 -08:00
Srdjan Mitrovic 5a69e3661b In background compilation make a copy of Field in order to freeze its state. Add flag --force_clone_compiler_objects for debugging purpose.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1722733002 .
2016-02-26 09:07:49 -08:00
Ivan Posva 8d18298fed - Remove Isolate::Flags structure and store flags directly in isolate.
- Make enable_asserts, enable_type_checks, error_on_bad_override and
  error_on_bad_type release mode flags only.

BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1737693003 .
2016-02-25 18:06:56 -08:00
Regis Crelier 3ffe9922b7 Simplify various name flavors in VM.
R=asiva@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1723733002 .
2016-02-25 11:21:27 -08:00
Florian Schneider d8677964a3 Move precompilation-related flags to flags list.
They become compile-time constants in the precompiled runtime, and in product mode.

In precompiled product mode, the precompiled value has precedence.

BUG=
R=rmacnak@google.com

Committed: https://github.com/dart-lang/sdk/commit/5c9f18c6c87284395564051a052cc4acc9b6f59a

Review URL: https://codereview.chromium.org/1731743003 .
2016-02-25 07:53:39 -08:00
Ryan Macnak bd85deaf4e Revert "Move precompilation-related flags to flags list."
The default value of print_stop_message was architecture specific.

TBR=fschneider@google.com

Review URL: https://codereview.chromium.org/1739593002 .
2016-02-24 18:08:01 -08:00
Florian Schneider 5c9f18c6c8 Move precompilation-related flags to flags list.
They become compile-time constants in the precompiled runtime, and in product mode.

In precompiled product mode, the precompiled value has precedence.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1731743003 .
2016-02-24 17:31:08 -08:00
Ryan Macnak 65063a0927 Tests that --fields_may_be_reset, --link_natives_lazily, and --no_allow_absolute_addresses work in the JIT.
Minor change to make --no_allow_aboslute_address to work in the (non-IA32) JIT.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1679363002 .
2016-02-11 09:53:30 -08:00
Srdjan Mitrovic 5cba052d70 Bailout if field state changed during background compilation.
Bailout if deferred loading cleared ic_data_array.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1672873003 .
2016-02-08 12:51:15 -08:00
John McCutchan d77d376124 Replace intptr_t with TokenDescriptor
- Use TokenDescriptor instead of intptr_t for all token positions.
- Use TokenDescriptor in raw_object instead of int32_t.
- TokenDescriptor is a POD with an int32_t (this shrinks the size of AST and IR nodes by 32-bits on 64-bit architectures).

There are some cleanups I plan on doing as a follow up CL:

- Replace TokenDescriptor::value() with TokenDescriptor::TokenPos()

R=iposva@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/1644793002 .
2016-02-02 10:15:44 -08:00