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

Unified Diff: src/objects.h

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/frames.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 0e78af87f127f9f03ca4f5bd2d6a2a25db7f98a4..46b457c18917d61324c0ea83f54612a4a7c2f6ee 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -5159,6 +5159,11 @@ class DeoptimizationOutputData: public FixedArray {
// [ return-address-offset , handler-offset ]
class HandlerTable : public FixedArray {
public:
+ // Conservative prediction whether a given handler will locally catch an
+ // exception or cause a re-throw to outside the code boundary. Since this is
+ // undecidable it is merely an approximation (e.g. useful for debugger).
+ enum CatchPrediction { UNCAUGHT, CAUGHT };
+
// Accessors for handler table based on ranges.
void SetRangeStart(int index, int value) {
set(index * kRangeEntrySize + kRangeStartIndex, Smi::FromInt(value));
@@ -5177,7 +5182,9 @@ class HandlerTable : public FixedArray {
void SetReturnOffset(int index, int value) {
set(index * kReturnEntrySize + kReturnOffsetIndex, Smi::FromInt(value));
}
- void SetReturnHandler(int index, int value) {
+ void SetReturnHandler(int index, int offset, CatchPrediction prediction) {
+ int value = HandlerOffsetField::encode(offset) |
+ HandlerPredictionField::encode(prediction);
set(index * kReturnEntrySize + kReturnHandlerIndex, Smi::FromInt(value));
}
@@ -5185,7 +5192,7 @@ class HandlerTable : public FixedArray {
int LookupRange(int pc_offset, int* stack_depth);
// Lookup handler in a table based on return addresses.
- int LookupReturn(int pc_offset);
+ int LookupReturn(int pc_offset, CatchPrediction* prediction);
// Returns the required length of the underlying fixed array.
static int LengthForRange(int entries) { return entries * kRangeEntrySize; }
@@ -5210,6 +5217,10 @@ class HandlerTable : public FixedArray {
static const int kReturnOffsetIndex = 0;
static const int kReturnHandlerIndex = 1;
static const int kReturnEntrySize = 2;
+
+ // Encoding of the {handler} field.
+ class HandlerPredictionField : public BitField<CatchPrediction, 0, 1> {};
+ class HandlerOffsetField : public BitField<int, 1, 30> {};
};
« no previous file with comments | « src/frames.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698