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

Unified Diff: src/compiler/code-generator.cc

Issue 2161263003: [debug] use catch prediction flag for promise rejections. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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
Index: src/compiler/code-generator.cc
diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc
index d4fb6b3ac99ed25ec4fd3a4668f877750ee0c1d7..b503a6cb57c6ee5e1db3ec876709d9a50ea54de3 100644
--- a/src/compiler/code-generator.cc
+++ b/src/compiler/code-generator.cc
@@ -229,11 +229,9 @@ Handle<Code> CodeGenerator::GenerateCode() {
TENURED));
for (size_t i = 0; i < handlers_.size(); ++i) {
int position = handlers_[i].handler->pos();
- HandlerTable::CatchPrediction prediction = handlers_[i].caught_locally
- ? HandlerTable::CAUGHT
- : HandlerTable::UNCAUGHT;
table->SetReturnOffset(static_cast<int>(i), handlers_[i].pc_offset);
- table->SetReturnHandler(static_cast<int>(i), position, prediction);
+ table->SetReturnHandler(static_cast<int>(i), position,
+ handlers_[i].catch_prediction);
}
result->set_handler_table(*table);
}
@@ -605,9 +603,15 @@ void CodeGenerator::RecordCallPosition(Instruction* instr) {
if (flags & CallDescriptor::kHasExceptionHandler) {
InstructionOperandConverter i(this, instr);
- bool caught = flags & CallDescriptor::kHasLocalCatchHandler;
+ HandlerTable::CatchPrediction prediction = HandlerTable::UNCAUGHT;
+ if (flags & CallDescriptor::kHasLocalCatchHandler) {
+ prediction = HandlerTable::CAUGHT;
+ } else if (flags & CallDescriptor::kHasLocalCatchHandlerForPromiseReject) {
+ prediction = HandlerTable::PROMISE;
+ }
RpoNumber handler_rpo = i.InputRpo(instr->InputCount() - 1);
- handlers_.push_back({caught, GetLabel(handler_rpo), masm()->pc_offset()});
+ handlers_.push_back(
+ {prediction, GetLabel(handler_rpo), masm()->pc_offset()});
}
if (needs_frame_state) {

Powered by Google App Engine
This is Rietveld 408576698