Index: src/deoptimizer.cc |
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc |
index 31147dd2002af2b97db93d82d4eaedc5634f58a8..77ac4d8fbda23f294c4802657a4df043398f72a9 100644 |
--- a/src/deoptimizer.cc |
+++ b/src/deoptimizer.cc |
@@ -627,23 +627,28 @@ |
int LookupCatchHandler(TranslatedFrame* translated_frame, int* data_out) { |
switch (translated_frame->kind()) { |
case TranslatedFrame::kFunction: { |
-#ifdef DEBUG |
+ BailoutId node_id = translated_frame->node_id(); |
JSFunction* function = |
JSFunction::cast(translated_frame->begin()->GetRawValue()); |
Code* non_optimized_code = function->shared()->code(); |
+ FixedArray* raw_data = non_optimized_code->deoptimization_data(); |
+ DeoptimizationOutputData* data = DeoptimizationOutputData::cast(raw_data); |
+ unsigned pc_and_state = |
+ Deoptimizer::GetOutputInfo(data, node_id, function->shared()); |
+ unsigned pc_offset = FullCodeGenerator::PcField::decode(pc_and_state); |
HandlerTable* table = |
HandlerTable::cast(non_optimized_code->handler_table()); |
- DCHECK_EQ(0, table->NumberOfRangeEntries()); |
-#endif |
- break; |
+ HandlerTable::CatchPrediction prediction; |
+ return table->LookupRange(pc_offset, data_out, &prediction); |
} |
case TranslatedFrame::kInterpretedFunction: { |
int bytecode_offset = translated_frame->node_id().ToInt(); |
JSFunction* function = |
JSFunction::cast(translated_frame->begin()->GetRawValue()); |
BytecodeArray* bytecode = function->shared()->bytecode_array(); |
+ HandlerTable::CatchPrediction prediction; |
return bytecode->LookupRangeInHandlerTable(bytecode_offset, data_out, |
- nullptr); |
+ &prediction); |
} |
default: |
break; |