Commit 771b81f8 authored by yangguo's avatar yangguo Committed by Commit bot

[debug] fix exception prediction for asm frames.

R=mstarzinger@chromium.org
BUG=chromium:633999

Review-Url: https://codereview.chromium.org/2215713002
Cr-Commit-Position: refs/heads/master@{#38358}
parent 0dabe5f6
......@@ -1310,9 +1310,16 @@ HandlerTable::CatchPrediction PredictException(JavaScriptFrame* frame) {
List<FrameSummary> summaries;
frame->Summarize(&summaries);
for (const FrameSummary& summary : summaries) {
Handle<AbstractCode> code = summary.abstract_code();
if (code->kind() == AbstractCode::OPTIMIZED_FUNCTION) {
DCHECK(summary.function()->shared()->asm_function());
DCHECK(!FLAG_turbo_asm_deoptimization);
// asm code cannot contain try-catch.
continue;
}
int code_offset = summary.code_offset();
int index = summary.abstract_code()->LookupRangeInHandlerTable(
code_offset, nullptr, &prediction);
int index =
code->LookupRangeInHandlerTable(code_offset, nullptr, &prediction);
if (index <= 0) continue;
if (prediction == HandlerTable::UNCAUGHT) continue;
return prediction;
......
// 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: --expose-debug-as debug --allow-natives-syntax --noturbo
var Debug = debug.Debug
var exception = null;
var step = 0;
function listener(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.Exception) return;
try {
step++;
} catch (e) {
exception = e;
}
}
Debug.setBreakOnException();
Debug.setListener(listener);
(function () {
"use asm";
function f() {
try {
throw 666;
} catch (e) {
}
}
f();
f();
%OptimizeFunctionOnNextCall(f);
f();
assertOptimized(f);
})();
Debug.setListener(null);
assertNull(exception);
assertEquals(3, step);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment