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

Unified Diff: src/compiler/instruction.h

Issue 2161543002: [turbofan] Add support for eager/soft deoptimization reasons. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Do the ports properly 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
« no previous file with comments | « src/compiler/ia32/instruction-selector-ia32.cc ('k') | src/compiler/instruction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction.h
diff --git a/src/compiler/instruction.h b/src/compiler/instruction.h
index 76bc09b6164ab835c527991117642281a2cb2d9b..b839acf6a66f3301baa252c34c7bce69b58128e8 100644
--- a/src/compiler/instruction.h
+++ b/src/compiler/instruction.h
@@ -1161,9 +1161,23 @@ class FrameStateDescriptor : public ZoneObject {
FrameStateDescriptor* outer_state_;
};
+// A deoptimization entry is a pair of the reason why we deoptimize and the
+// frame state descriptor that we have to go back to.
+class DeoptimizationEntry final {
+ public:
+ DeoptimizationEntry() {}
+ DeoptimizationEntry(FrameStateDescriptor* descriptor, DeoptimizeReason reason)
+ : descriptor_(descriptor), reason_(reason) {}
+
+ FrameStateDescriptor* descriptor() const { return descriptor_; }
+ DeoptimizeReason reason() const { return reason_; }
-typedef ZoneVector<FrameStateDescriptor*> DeoptimizationVector;
+ private:
+ FrameStateDescriptor* descriptor_ = nullptr;
+ DeoptimizeReason reason_ = DeoptimizeReason::kNoReason;
+};
+typedef ZoneVector<DeoptimizationEntry> DeoptimizationVector;
class PhiInstruction final : public ZoneObject {
public:
@@ -1414,21 +1428,11 @@ class InstructionSequence final : public ZoneObject {
return Constant(static_cast<int32_t>(0));
}
- class StateId {
- public:
- static StateId FromInt(int id) { return StateId(id); }
- int ToInt() const { return id_; }
-
- private:
- explicit StateId(int id) : id_(id) {}
- int id_;
- };
-
- StateId AddFrameStateDescriptor(FrameStateDescriptor* descriptor);
- FrameStateDescriptor* GetFrameStateDescriptor(StateId deoptimization_id);
- int GetFrameStateDescriptorCount();
- DeoptimizationVector const& frame_state_descriptors() const {
- return deoptimization_entries_;
+ int AddDeoptimizationEntry(FrameStateDescriptor* descriptor,
+ DeoptimizeReason reason);
+ DeoptimizationEntry const& GetDeoptimizationEntry(int deoptimization_id);
+ int GetDeoptimizationEntryCount() const {
+ return static_cast<int>(deoptimization_entries_.size());
}
RpoNumber InputRpo(Instruction* instr, size_t index);
« no previous file with comments | « src/compiler/ia32/instruction-selector-ia32.cc ('k') | src/compiler/instruction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698