Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(453)

Unified Diff: src/frames.cc

Issue 2197183002: [debugger] use handler table on unoptimized code for exception prediction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: address comments and rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/frames.h ('k') | src/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames.cc
diff --git a/src/frames.cc b/src/frames.cc
index 161d3ecfaf36af29175c77fc2735f8f965207a7f..83b8d83c74c9f090eb5e3282dfb81ae44b31222e 100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -982,12 +982,10 @@ int JavaScriptFrame::LookupExceptionHandlerInTable(
int* stack_depth, HandlerTable::CatchPrediction* prediction) {
Code* code = LookupCode();
DCHECK(!code->is_optimized_code());
- HandlerTable* table = HandlerTable::cast(code->handler_table());
int pc_offset = static_cast<int>(pc() - code->entry());
- return table->LookupRange(pc_offset, stack_depth, prediction);
+ return code->LookupRangeInHandlerTable(pc_offset, stack_depth, prediction);
}
-
void JavaScriptFrame::PrintFunctionAndOffset(JSFunction* function, Code* code,
Address pc, FILE* file,
bool print_line_number) {
@@ -1236,11 +1234,15 @@ void OptimizedFrame::Summarize(List<FrameSummary>* frames,
int OptimizedFrame::LookupExceptionHandlerInTable(
int* stack_slots, HandlerTable::CatchPrediction* prediction) {
+ // We cannot perform exception prediction on optimized code. Instead, we need
+ // to use FrameSummary to find the corresponding code offset in unoptimized
+ // code to perform prediction there.
+ DCHECK_NULL(prediction);
Code* code = LookupCode();
HandlerTable* table = HandlerTable::cast(code->handler_table());
int pc_offset = static_cast<int>(pc() - code->entry());
if (stack_slots) *stack_slots = code->stack_slots();
- return table->LookupReturn(pc_offset, prediction);
+ return table->LookupReturn(pc_offset);
}
@@ -1337,9 +1339,8 @@ Object* OptimizedFrame::StackSlotAt(int index) const {
int InterpretedFrame::LookupExceptionHandlerInTable(
int* context_register, 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, context_register, prediction);
+ return bytecode->LookupRangeInHandlerTable(GetBytecodeOffset(),
+ context_register, prediction);
}
int InterpretedFrame::GetBytecodeOffset() const {
« no previous file with comments | « src/frames.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698