Index: src/runtime/runtime-compiler.cc |
diff --git a/src/runtime/runtime-compiler.cc b/src/runtime/runtime-compiler.cc |
index 472e076de4f5600f80000b9e8116542347ff7843..3f9457e560f6cfe5deb0044922a0d42265e9e21a 100644 |
--- a/src/runtime/runtime-compiler.cc |
+++ b/src/runtime/runtime-compiler.cc |
@@ -11,7 +11,6 @@ |
#include "src/deoptimizer.h" |
#include "src/frames-inl.h" |
#include "src/full-codegen/full-codegen.h" |
-#include "src/interpreter/bytecode-array-iterator.h" |
#include "src/isolate-inl.h" |
#include "src/messages.h" |
#include "src/v8threads.h" |
@@ -270,9 +269,9 @@ BailoutId DetermineEntryAndDisarmOSRForBaseline(JavaScriptFrame* frame) { |
// Revert the patched back edge table, regardless of whether OSR succeeds. |
BackEdgeTable::Revert(frame->isolate(), *caller_code); |
+ // Return a BailoutId representing an AST id of the {IterationStatement}. |
uint32_t pc_offset = |
static_cast<uint32_t>(frame->pc() - caller_code->instruction_start()); |
- |
return caller_code->TranslatePcOffsetToAstId(pc_offset); |
} |
@@ -293,20 +292,8 @@ BailoutId DetermineEntryAndDisarmOSRForInterpreter(JavaScriptFrame* frame) { |
// Reset the OSR loop nesting depth to disarm back edges. |
bytecode->set_osr_loop_nesting_level(0); |
- // Translate the offset of the jump instruction to the jump target offset of |
- // that instruction so that the derived BailoutId points to the loop header. |
- // TODO(mstarzinger): This can be merged with {BytecodeBranchAnalysis} which |
- // already performs a pre-pass over the bytecode stream anyways. |
- int jump_offset = iframe->GetBytecodeOffset(); |
- interpreter::BytecodeArrayIterator iterator(bytecode); |
- while (iterator.current_offset() + iterator.current_prefix_offset() < |
- jump_offset) { |
- iterator.Advance(); |
- } |
- DCHECK(interpreter::Bytecodes::IsJump(iterator.current_bytecode())); |
- int jump_target_offset = iterator.GetJumpTargetOffset(); |
- |
- return BailoutId(jump_target_offset); |
+ // Return a BailoutId representing the bytecode offset of the back branch. |
+ return BailoutId(iframe->GetBytecodeOffset()); |
} |
} // namespace |