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

Unified Diff: src/objects.cc

Issue 1158563008: [turbofan] Introduce prediction for exception handlers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Architecture ports. Created 5 years, 7 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/objects.h ('k') | test/unittests/compiler/common-operator-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 180eb63536c1f35bf5d07189478a81c55951d281..5fadaeb2380cec44feed51aea9ed80c5e5b4d5f8 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -8638,11 +8638,14 @@ int HandlerTable::LookupRange(int pc_offset, int* stack_depth_out) {
// TODO(turbofan): Make sure table is sorted and use binary search.
-int HandlerTable::LookupReturn(int pc_offset) {
+int HandlerTable::LookupReturn(int pc_offset, CatchPrediction* prediction) {
for (int i = 0; i < length(); i += kReturnEntrySize) {
int return_offset = Smi::cast(get(i + kReturnOffsetIndex))->value();
- int handler_offset = Smi::cast(get(i + kReturnHandlerIndex))->value();
- if (pc_offset == return_offset) return handler_offset;
+ int handler_field = Smi::cast(get(i + kReturnHandlerIndex))->value();
+ if (pc_offset == return_offset) {
+ *prediction = HandlerPredictionField::decode(handler_field);
+ return HandlerOffsetField::decode(handler_field);
+ }
}
return -1;
}
@@ -11834,12 +11837,14 @@ void HandlerTable::HandlerTableRangePrint(std::ostream& os) {
void HandlerTable::HandlerTableReturnPrint(std::ostream& os) {
- os << " off hdlr\n";
+ os << " off hdlr (c)\n";
for (int i = 0; i < length(); i += kReturnEntrySize) {
int pc_offset = Smi::cast(get(i + kReturnOffsetIndex))->value();
- int handler = Smi::cast(get(i + kReturnHandlerIndex))->value();
+ int handler_field = Smi::cast(get(i + kReturnHandlerIndex))->value();
+ int handler_offset = HandlerOffsetField::decode(handler_field);
+ CatchPrediction prediction = HandlerPredictionField::decode(handler_field);
os << " " << std::setw(4) << pc_offset << " -> " << std::setw(4)
- << handler << "\n";
+ << handler_offset << " (" << prediction << ")\n";
}
}
« no previous file with comments | « src/objects.h ('k') | test/unittests/compiler/common-operator-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698