v8/test/mjsunit/regress/regress-crbug-660379.js
mstarzinger 93c6595200 [turbofan] Advance bytecode offset after lazy deopt.
This changes {FrameState} nodes modeling "after" states to use bytecode
offsets pointing to the deoptimizing bytecode. This is in sync with the
normal execution, as the bytecode offset is advanced after operations
complete in regular bytecode handlers.

The change is necessary to ensure lazy deoptimized frames contain an
accurate bytecode offset while they are on the stack. Such frames can be
inspected by various stack walks. The continuation builtin will advance
the bytecode offset upon return.

R=jarin@chromium.org
TEST=mjsunit/regress/regress-crbug-660379
BUG=chromium:660379

Review-Url: https://codereview.chromium.org/2487173002
Cr-Commit-Position: refs/heads/master@{#40887}
2016-11-10 11:35:22 +00:00

43 lines
889 B
JavaScript

// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
(function InlinedThrowAtEndOfTry() {
function g() {
%DeoptimizeFunction(f);
throw "boom";
}
function f() {
try {
g(); // Right at the end of try.
} catch (e) {
assertEquals("boom", e)
}
}
assertDoesNotThrow(f);
assertDoesNotThrow(f);
%OptimizeFunctionOnNextCall(f);
assertDoesNotThrow(f);
})();
(function InlinedThrowInFrontOfTry() {
function g() {
%DeoptimizeFunction(f);
throw "boom";
}
function f() {
g(); // Right in front of try.
try {
Math.random();
} catch (e) {
assertUnreachable();
}
}
assertThrows(f);
assertThrows(f);
%OptimizeFunctionOnNextCall(f);
assertThrows(f);
})();