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

Unified Diff: src/hydrogen-instructions.h

Issue 1228113008: Crankshaft part of the 'loads and stores to global vars through property cell shortcuts' feature. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments + regression test Created 5 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/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index b7e9903f05aa078e458654341a77b464fc231e33..11e85a0c034ab6a689eaa4fdf55cb537f9af1035 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -119,6 +119,7 @@ class LChunkBuilder;
V(LoadFieldByIndex) \
V(LoadFunctionPrototype) \
V(LoadGlobalGeneric) \
+ V(LoadGlobalViaContext) \
V(LoadKeyed) \
V(LoadKeyedGeneric) \
V(LoadNamedField) \
@@ -147,6 +148,7 @@ class LChunkBuilder;
V(StoreCodeEntry) \
V(StoreContextSlot) \
V(StoreFrameContext) \
+ V(StoreGlobalViaContext) \
V(StoreKeyed) \
V(StoreKeyedGeneric) \
V(StoreNamedField) \
@@ -5445,6 +5447,39 @@ class HLoadGlobalGeneric final : public HTemplateInstruction<2> {
};
+class HLoadGlobalViaContext final : public HTemplateInstruction<1> {
+ public:
+ DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadGlobalViaContext,
+ Handle<String>, int, int);
+
+ HValue* context() { return OperandAt(0); }
+ Handle<String> name() const { return name_; }
+ int depth() const { return depth_; }
+ int slot_index() const { return slot_index_; }
+
+ std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT
+
+ Representation RequiredInputRepresentation(int index) override {
+ return Representation::Tagged();
+ }
+
+ DECLARE_CONCRETE_INSTRUCTION(LoadGlobalViaContext)
+
+ private:
+ HLoadGlobalViaContext(HValue* context, Handle<String> name, int depth,
+ int slot_index)
+ : name_(name), depth_(depth), slot_index_(slot_index) {
+ SetOperandAt(0, context);
+ set_representation(Representation::Tagged());
+ SetAllSideEffects();
+ }
+
+ Handle<String> name_;
+ int depth_;
+ int slot_index_;
+};
+
+
class HAllocate final : public HTemplateInstruction<2> {
public:
static bool CompatibleInstanceTypes(InstanceType type1,
@@ -6979,6 +7014,45 @@ class HStoreNamedGeneric final : public HTemplateInstruction<3> {
};
+class HStoreGlobalViaContext final : public HTemplateInstruction<2> {
+ public:
+ DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P5(HStoreGlobalViaContext,
+ Handle<String>, HValue*, int, int,
+ LanguageMode);
+ HValue* context() const { return OperandAt(0); }
+ HValue* value() const { return OperandAt(1); }
+ Handle<String> name() const { return name_; }
+ int depth() const { return depth_; }
+ int slot_index() const { return slot_index_; }
+ LanguageMode language_mode() const { return language_mode_; }
+
+ std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT
+
+ Representation RequiredInputRepresentation(int index) override {
+ return Representation::Tagged();
+ }
+
+ DECLARE_CONCRETE_INSTRUCTION(StoreGlobalViaContext)
+
+ private:
+ HStoreGlobalViaContext(HValue* context, Handle<String> name, HValue* value,
+ int depth, int slot_index, LanguageMode language_mode)
+ : name_(name),
+ depth_(depth),
+ slot_index_(slot_index),
+ language_mode_(language_mode) {
+ SetOperandAt(0, context);
+ SetOperandAt(1, value);
+ SetAllSideEffects();
+ }
+
+ Handle<String> name_;
+ int depth_;
+ int slot_index_;
+ LanguageMode language_mode_;
+};
+
+
class HStoreKeyed final : public HTemplateInstruction<3>,
public ArrayInstructionInterface {
public:
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698