Commit 1f27ed9d authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[deoptimizer] Remove dead Code::LookupRangeInHandlerTable.

This removes the supporting function to perform a range-lookup in the
exception handler table for unoptimized code. Such tables are by now
guaranteed to be empty, the deoptimizer cannot encounter this case.

R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2529343003
Cr-Commit-Position: refs/heads/master@{#41318}
parent aefc7936
...@@ -627,28 +627,23 @@ namespace { ...@@ -627,28 +627,23 @@ namespace {
int LookupCatchHandler(TranslatedFrame* translated_frame, int* data_out) { int LookupCatchHandler(TranslatedFrame* translated_frame, int* data_out) {
switch (translated_frame->kind()) { switch (translated_frame->kind()) {
case TranslatedFrame::kFunction: { case TranslatedFrame::kFunction: {
BailoutId node_id = translated_frame->node_id(); #ifdef DEBUG
JSFunction* function = JSFunction* function =
JSFunction::cast(translated_frame->begin()->GetRawValue()); JSFunction::cast(translated_frame->begin()->GetRawValue());
Code* non_optimized_code = function->shared()->code(); 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* table =
HandlerTable::cast(non_optimized_code->handler_table()); HandlerTable::cast(non_optimized_code->handler_table());
HandlerTable::CatchPrediction prediction; DCHECK_EQ(0, table->NumberOfRangeEntries());
return table->LookupRange(pc_offset, data_out, &prediction); #endif
break;
} }
case TranslatedFrame::kInterpretedFunction: { case TranslatedFrame::kInterpretedFunction: {
int bytecode_offset = translated_frame->node_id().ToInt(); int bytecode_offset = translated_frame->node_id().ToInt();
JSFunction* function = JSFunction* function =
JSFunction::cast(translated_frame->begin()->GetRawValue()); JSFunction::cast(translated_frame->begin()->GetRawValue());
BytecodeArray* bytecode = function->shared()->bytecode_array(); BytecodeArray* bytecode = function->shared()->bytecode_array();
HandlerTable::CatchPrediction prediction;
return bytecode->LookupRangeInHandlerTable(bytecode_offset, data_out, return bytecode->LookupRangeInHandlerTable(bytecode_offset, data_out,
&prediction); nullptr);
} }
default: default:
break; break;
......
...@@ -14402,13 +14402,6 @@ uint32_t Code::TranslateAstIdToPcOffset(BailoutId ast_id) { ...@@ -14402,13 +14402,6 @@ uint32_t Code::TranslateAstIdToPcOffset(BailoutId ast_id) {
return 0; return 0;
} }
int Code::LookupRangeInHandlerTable(int code_offset, int* data,
HandlerTable::CatchPrediction* prediction) {
DCHECK(!is_optimized_code());
HandlerTable* table = HandlerTable::cast(handler_table());
return table->LookupRange(code_offset, data, prediction);
}
void Code::MakeCodeAgeSequenceYoung(byte* sequence, Isolate* isolate) { void Code::MakeCodeAgeSequenceYoung(byte* sequence, Isolate* isolate) {
PatchPlatformCodeAge(isolate, sequence, kNoAgeCodeAge, NO_MARKING_PARITY); PatchPlatformCodeAge(isolate, sequence, kNoAgeCodeAge, NO_MARKING_PARITY);
} }
......
...@@ -5713,9 +5713,6 @@ class Code: public HeapObject { ...@@ -5713,9 +5713,6 @@ class Code: public HeapObject {
BailoutId TranslatePcOffsetToAstId(uint32_t pc_offset); BailoutId TranslatePcOffsetToAstId(uint32_t pc_offset);
uint32_t TranslateAstIdToPcOffset(BailoutId ast_id); uint32_t TranslateAstIdToPcOffset(BailoutId ast_id);
int LookupRangeInHandlerTable(int code_offset, int* data,
HandlerTable::CatchPrediction* prediction);
#define DECLARE_CODE_AGE_ENUM(X) k##X##CodeAge, #define DECLARE_CODE_AGE_ENUM(X) k##X##CodeAge,
enum Age { enum Age {
kToBeExecutedOnceCodeAge = -3, kToBeExecutedOnceCodeAge = -3,
......
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