Chromium Code Reviews| Index: src/frames.cc |
| diff --git a/src/frames.cc b/src/frames.cc |
| index d60ab29c4e62c2e60cc52a7b1cf54378076ed8e3..3cf1dd82464010aafc47aeabf258e89d0e2212f8 100644 |
| --- a/src/frames.cc |
| +++ b/src/frames.cc |
| @@ -1128,6 +1128,31 @@ Object* OptimizedFrame::StackSlotAt(int index) const { |
| } |
| +int InterpretedFrame::LookupExceptionHandlerInTable( |
| + int* stack_slots, HandlerTable::CatchPrediction* prediction) { |
| + BytecodeArray* bytecode = function()->shared()->bytecode_array(); |
| + HandlerTable* table = HandlerTable::cast(bytecode->handler_table()); |
| + int pc_offset = GetBytecodeOffset() + 1; // Point after current bytecode. |
| + return table->LookupRange(pc_offset, stack_slots, prediction); |
| +} |
| + |
| + |
| +int InterpretedFrame::GetBytecodeOffset() const { |
| + STATIC_ASSERT(InterpreterFrameConstants::kBytecodeOffsetFromFp == |
| + StandardFrameConstants::kExpressionsOffset - kPointerSize); |
| + int raw_offset = Smi::cast(GetExpression(1))->value(); |
|
rmcilroy
2016/01/20 08:52:13
Nit - could you pull the '1' out to a constant som
Michael Starzinger
2016/01/20 11:45:27
Done. Added the constant to the InterpreterFrameCo
|
| + return raw_offset - BytecodeArray::kHeaderSize + kHeapObjectTag; |
| +} |
| + |
| + |
| +void InterpretedFrame::PatchBytecodeOffset(int new_offset) { |
| + STATIC_ASSERT(InterpreterFrameConstants::kBytecodeOffsetFromFp == |
| + StandardFrameConstants::kExpressionsOffset - kPointerSize); |
| + int raw_offset = new_offset + BytecodeArray::kHeaderSize - kHeapObjectTag; |
| + SetExpression(1, Smi::FromInt(raw_offset)); |
| +} |
| + |
| + |
| int ArgumentsAdaptorFrame::GetNumberOfIncomingArguments() const { |
| return Smi::cast(GetExpression(0))->value(); |
| } |