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

Unified Diff: src/crankshaft/hydrogen-instructions.h

Issue 2622783002: [crankshaft] Remove dead Variable hole-checking code (Closed)
Patch Set: Update golden files Created 3 years, 11 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/crankshaft/hydrogen.cc ('k') | src/crankshaft/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen-instructions.h
diff --git a/src/crankshaft/hydrogen-instructions.h b/src/crankshaft/hydrogen-instructions.h
index 7ffb2a3a7ba10f1d03f6aa3021986cc58dd5c0c7..3b8a4593f9f43db395adca7115d2553985d7b1b1 100644
--- a/src/crankshaft/hydrogen-instructions.h
+++ b/src/crankshaft/hydrogen-instructions.h
@@ -4947,33 +4947,14 @@ inline PointersToHereCheck PointersToHereCheckForObject(HValue* object,
class HLoadContextSlot final : public HUnaryOperation {
public:
- enum Mode {
- // Perform a normal load of the context slot without checking its value.
- kNoCheck,
- // Load and check the value of the context slot. Deoptimize if it's the
- // hole value. This is used for checking for loading of uninitialized
- // harmony bindings where we deoptimize into full-codegen generated code
- // which will subsequently throw a reference error.
- kCheckDeoptimize
- };
-
- HLoadContextSlot(HValue* context, int slot_index, Mode mode)
- : HUnaryOperation(context), slot_index_(slot_index), mode_(mode) {
+ HLoadContextSlot(HValue* context, int slot_index)
+ : HUnaryOperation(context), slot_index_(slot_index) {
set_representation(Representation::Tagged());
SetFlag(kUseGVN);
SetDependsOnFlag(kContextSlots);
}
int slot_index() const { return slot_index_; }
- Mode mode() const { return mode_; }
-
- bool DeoptimizesOnHole() {
- return mode_ == kCheckDeoptimize;
- }
-
- bool RequiresHoleCheck() const {
- return mode_ != kNoCheck;
- }
Representation RequiredInputRepresentation(int index) override {
return Representation::Tagged();
@@ -4990,46 +4971,24 @@ class HLoadContextSlot final : public HUnaryOperation {
}
private:
- bool IsDeletable() const override { return !RequiresHoleCheck(); }
+ bool IsDeletable() const override { return true; }
int slot_index_;
- Mode mode_;
};
class HStoreContextSlot final : public HTemplateInstruction<2> {
public:
- enum Mode {
- // Perform a normal store to the context slot without checking its previous
- // value.
- kNoCheck,
- // Check the previous value of the context slot and deoptimize if it's the
- // hole value. This is used for checking for assignments to uninitialized
- // harmony bindings where we deoptimize into full-codegen generated code
- // which will subsequently throw a reference error.
- kCheckDeoptimize
- };
-
- DECLARE_INSTRUCTION_FACTORY_P4(HStoreContextSlot, HValue*, int,
- Mode, HValue*);
+ DECLARE_INSTRUCTION_FACTORY_P3(HStoreContextSlot, HValue*, int, HValue*);
HValue* context() const { return OperandAt(0); }
HValue* value() const { return OperandAt(1); }
int slot_index() const { return slot_index_; }
- Mode mode() const { return mode_; }
bool NeedsWriteBarrier() {
return StoringValueNeedsWriteBarrier(value());
}
- bool DeoptimizesOnHole() {
- return mode_ == kCheckDeoptimize;
- }
-
- bool RequiresHoleCheck() {
- return mode_ != kNoCheck;
- }
-
Representation RequiredInputRepresentation(int index) override {
return Representation::Tagged();
}
@@ -5039,15 +4998,14 @@ class HStoreContextSlot final : public HTemplateInstruction<2> {
DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot)
private:
- HStoreContextSlot(HValue* context, int slot_index, Mode mode, HValue* value)
- : slot_index_(slot_index), mode_(mode) {
+ HStoreContextSlot(HValue* context, int slot_index, HValue* value)
+ : slot_index_(slot_index) {
SetOperandAt(0, context);
SetOperandAt(1, value);
SetChangesFlag(kContextSlots);
}
int slot_index_;
- Mode mode_;
};
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/crankshaft/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698