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

Unified Diff: src/hydrogen-instructions.h

Issue 10382055: Array index computation dehoisting. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 9d262fc811724c985c6ddc96697c218e6daab976..7d737961ffb3330dea11153f147627b56521ebd4 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -3954,7 +3954,7 @@ class HLoadKeyedFastElement: public HTemplateInstruction<2> {
HLoadKeyedFastElement(HValue* obj,
HValue* key,
HoleCheckMode hole_check_mode = PERFORM_HOLE_CHECK)
- : hole_check_mode_(hole_check_mode) {
+ : hole_check_mode_(hole_check_mode), index_offset_(0) {
SetOperandAt(0, obj);
SetOperandAt(1, key);
set_representation(Representation::Tagged());
@@ -3964,6 +3964,8 @@ class HLoadKeyedFastElement: public HTemplateInstruction<2> {
HValue* object() { return OperandAt(0); }
HValue* key() { return OperandAt(1); }
+ uint32_t index_offset() { return index_offset_; }
+ void SetIndexOffset(uint32_t index_offset) { index_offset_ = index_offset; }
virtual Representation RequiredInputRepresentation(int index) {
// The key is supposed to be Integer32.
@@ -3987,12 +3989,14 @@ class HLoadKeyedFastElement: public HTemplateInstruction<2> {
private:
HoleCheckMode hole_check_mode_;
+ uint32_t index_offset_;
Jakob Kummerow 2012/05/08 13:46:26 Why is this a uint32_t? In hydrogen.cc, you're pas
Massi 2012/05/14 13:48:52 This is unsigned because on ia32 and x64 we can on
};
class HLoadKeyedFastDoubleElement: public HTemplateInstruction<2> {
public:
- HLoadKeyedFastDoubleElement(HValue* elements, HValue* key) {
+ HLoadKeyedFastDoubleElement(HValue* elements, HValue* key) :
Jakob Kummerow 2012/05/08 13:46:26 nit: the colon goes in the next line (see HLoadKey
Massi 2012/05/14 13:48:52 Done.
+ index_offset_(0) {
SetOperandAt(0, elements);
SetOperandAt(1, key);
set_representation(Representation::Double());
@@ -4002,6 +4006,8 @@ class HLoadKeyedFastDoubleElement: public HTemplateInstruction<2> {
HValue* elements() { return OperandAt(0); }
HValue* key() { return OperandAt(1); }
+ uint32_t index_offset() { return index_offset_; }
+ void SetIndexOffset(uint32_t index_offset) { index_offset_ = index_offset; }
virtual Representation RequiredInputRepresentation(int index) {
// The key is supposed to be Integer32.
@@ -4016,6 +4022,9 @@ class HLoadKeyedFastDoubleElement: public HTemplateInstruction<2> {
protected:
virtual bool DataEquals(HValue* other) { return true; }
+
+ private:
+ uint32_t index_offset_;
};
@@ -4024,7 +4033,7 @@ class HLoadKeyedSpecializedArrayElement: public HTemplateInstruction<2> {
HLoadKeyedSpecializedArrayElement(HValue* external_elements,
HValue* key,
ElementsKind elements_kind)
- : elements_kind_(elements_kind) {
+ : elements_kind_(elements_kind), index_offset_(0) {
SetOperandAt(0, external_elements);
SetOperandAt(1, key);
if (elements_kind == EXTERNAL_FLOAT_ELEMENTS ||
@@ -4052,6 +4061,8 @@ class HLoadKeyedSpecializedArrayElement: public HTemplateInstruction<2> {
HValue* external_pointer() { return OperandAt(0); }
HValue* key() { return OperandAt(1); }
ElementsKind elements_kind() const { return elements_kind_; }
+ uint32_t index_offset() { return index_offset_; }
+ void SetIndexOffset(uint32_t index_offset) { index_offset_ = index_offset; }
virtual Range* InferRange(Zone* zone);
@@ -4067,6 +4078,7 @@ class HLoadKeyedSpecializedArrayElement: public HTemplateInstruction<2> {
private:
ElementsKind elements_kind_;
+ uint32_t index_offset_;
};
@@ -4192,7 +4204,7 @@ class HStoreKeyedFastElement: public HTemplateInstruction<3> {
public:
HStoreKeyedFastElement(HValue* obj, HValue* key, HValue* val,
ElementsKind elements_kind = FAST_ELEMENTS)
- : elements_kind_(elements_kind) {
+ : elements_kind_(elements_kind), index_offset_(0) {
SetOperandAt(0, obj);
SetOperandAt(1, key);
SetOperandAt(2, val);
@@ -4212,6 +4224,8 @@ class HStoreKeyedFastElement: public HTemplateInstruction<3> {
bool value_is_smi() {
return elements_kind_ == FAST_SMI_ONLY_ELEMENTS;
}
+ uint32_t index_offset() { return index_offset_; }
+ void SetIndexOffset(uint32_t index_offset) { index_offset_ = index_offset; }
bool NeedsWriteBarrier() {
if (value_is_smi()) {
@@ -4227,6 +4241,7 @@ class HStoreKeyedFastElement: public HTemplateInstruction<3> {
private:
ElementsKind elements_kind_;
+ uint32_t index_offset_;
};
@@ -4234,7 +4249,7 @@ class HStoreKeyedFastDoubleElement: public HTemplateInstruction<3> {
public:
HStoreKeyedFastDoubleElement(HValue* elements,
HValue* key,
- HValue* val) {
+ HValue* val) : index_offset_(0) {
SetOperandAt(0, elements);
SetOperandAt(1, key);
SetOperandAt(2, val);
@@ -4254,6 +4269,8 @@ class HStoreKeyedFastDoubleElement: public HTemplateInstruction<3> {
HValue* elements() { return OperandAt(0); }
HValue* key() { return OperandAt(1); }
HValue* value() { return OperandAt(2); }
+ uint32_t index_offset() { return index_offset_; }
+ void SetIndexOffset(uint32_t index_offset) { index_offset_ = index_offset; }
bool NeedsWriteBarrier() {
return StoringValueNeedsWriteBarrier(value());
@@ -4264,6 +4281,9 @@ class HStoreKeyedFastDoubleElement: public HTemplateInstruction<3> {
virtual void PrintDataTo(StringStream* stream);
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastDoubleElement)
+
+ private:
+ uint32_t index_offset_;
};
@@ -4273,7 +4293,7 @@ class HStoreKeyedSpecializedArrayElement: public HTemplateInstruction<3> {
HValue* key,
HValue* val,
ElementsKind elements_kind)
- : elements_kind_(elements_kind) {
+ : elements_kind_(elements_kind), index_offset_(0) {
SetGVNFlag(kChangesSpecializedArrayElements);
SetOperandAt(0, external_elements);
SetOperandAt(1, key);
@@ -4301,11 +4321,14 @@ class HStoreKeyedSpecializedArrayElement: public HTemplateInstruction<3> {
HValue* key() { return OperandAt(1); }
HValue* value() { return OperandAt(2); }
ElementsKind elements_kind() const { return elements_kind_; }
+ uint32_t index_offset() { return index_offset_; }
+ void SetIndexOffset(uint32_t index_offset) { index_offset_ = index_offset; }
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedSpecializedArrayElement)
private:
ElementsKind elements_kind_;
+ uint32_t index_offset_;
};

Powered by Google App Engine
This is Rietveld 408576698