Commit 01f603d2 authored by mythria's avatar mythria Committed by Commit bot

[Interpreter] Fixes translation from bailout id to code offset.

BailoutId points to the next bytecode in the bytecode array. Code offset
is set to one less than the bail out id. This would point to the end of the
current instruction. Since we use it only for summarizing the frame and to
compute the source position, it should be safe to set it to the end of current
instruction.

BUG=v8:4280, v8:4689
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#34580}
parent 46bd989a
......@@ -2466,7 +2466,9 @@ int ComputeSourcePosition(Handle<SharedFunctionInfo> shared,
BailoutId node_id) {
if (shared->HasBytecodeArray()) {
BytecodeArray* bytecodes = shared->bytecode_array();
return bytecodes->SourcePosition(node_id.ToInt());
// BailoutId points to the next bytecode in the bytecode aray. Subtract
// 1 to get the end of current bytecode.
return bytecodes->SourcePosition(node_id.ToInt() - 1);
} else {
Code* non_optimized_code = shared->code();
FixedArray* raw_data = non_optimized_code->deoptimization_data();
......
......@@ -1055,7 +1055,9 @@ void OptimizedFrame::Summarize(List<FrameSummary>* frames) {
abstract_code = AbstractCode::cast(code);
} else {
DCHECK_EQ(frame_opcode, Translation::INTERPRETED_FRAME);
code_offset = bailout_id.ToInt();
// BailoutId points to the next bytecode in the bytecode aray. Subtract
// 1 to get the end of current bytecode.
code_offset = bailout_id.ToInt() - 1;
abstract_code = AbstractCode::cast(shared_info->bytecode_array());
}
FrameSummary summary(receiver, function, abstract_code, code_offset,
......
......@@ -787,12 +787,6 @@
}], # 'arch == ppc and simulator_run == True'
['ignition == True', {
# TODO(rmcilroy, 4689): FrameInspector does not translate interpreted frame.
'ignition/optimized-debug-frame': [FAIL],
# TODO(rmcilroy, 4689): Translated code offset for FrameSummary is wrong.
'ignition/optimized-stack-trace': [FAIL],
# TODO(yangguo,4690): assertion failures in debugger tests.
'debug-allscopes-on-debugger': [FAIL],
'debug-return-value': [FAIL],
......
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