Chromium Code Reviews| Index: src/hydrogen-instructions.h |
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
| index d1f2372db689de8059d55f532d8ad26bf3bd661a..14f0c4055764ce0f6fb3c9d540a7dcacd3173790 100644 |
| --- a/src/hydrogen-instructions.h |
| +++ b/src/hydrogen-instructions.h |
| @@ -1206,7 +1206,7 @@ class HInstruction : public HValue { |
| template<int V> |
| class HTemplateInstruction : public HInstruction { |
| public: |
| - virtual int OperandCount() V8_FINAL V8_OVERRIDE { return V; } |
| + virtual int OperandCount() V8_OVERRIDE { return V; } |
| virtual HValue* OperandAt(int i) const V8_FINAL V8_OVERRIDE { |
| return inputs_[i]; |
| } |
| @@ -6226,12 +6226,21 @@ class HObjectAccess V8_FINAL { |
| }; |
| -class HLoadNamedField V8_FINAL : public HTemplateInstruction<2> { |
| +class HLoadNamedField V8_FINAL : public HTemplateInstruction<3> { |
| public: |
| DECLARE_INSTRUCTION_FACTORY_P3(HLoadNamedField, HValue*, |
| HValue*, HObjectAccess); |
| + DECLARE_INSTRUCTION_FACTORY_P4(HLoadNamedField, HValue*, |
| + HValue*, HObjectAccess, HValue*); |
| DECLARE_INSTRUCTION_FACTORY_P5(HLoadNamedField, HValue*, HValue*, |
| HObjectAccess, const UniqueSet<Map>*, HType); |
| + DECLARE_INSTRUCTION_FACTORY_P6(HLoadNamedField, HValue*, HValue*, |
| + HObjectAccess, const UniqueSet<Map>*, HType, |
| + HValue*); |
| + |
| + virtual int OperandCount() V8_OVERRIDE { |
| + return (object_properties() != NULL) ? 3 : 2; |
| + } |
| HValue* object() { return OperandAt(0); } |
| HValue* dependency() { |
| @@ -6239,6 +6248,7 @@ class HLoadNamedField V8_FINAL : public HTemplateInstruction<2> { |
| return OperandAt(1); |
| } |
| bool HasDependency() const { return OperandAt(0) != OperandAt(1); } |
| + HValue* object_properties() { return OperandAt(2); } |
| HObjectAccess access() const { return access_; } |
| Representation field_representation() const { |
| return access_.representation(); |
| @@ -6271,6 +6281,19 @@ class HLoadNamedField V8_FINAL : public HTemplateInstruction<2> { |
| return this->maps_->IsSubset(that->maps_); |
| } |
| + static bool PreferExtractLoadPropertiesPointer() { |
| +#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 |
| + return true; |
| +#else |
| + return false; |
| +#endif |
| + } |
| + static bool NeedsPropertiesPointer(HObjectAccess access) { |
| + return !(access.IsExternalMemory() || |
| + access.representation().IsDouble() || |
| + access.IsInobject()); |
| + } |
| + |
| DECLARE_CONCRETE_INSTRUCTION(LoadNamedField) |
| protected: |
| @@ -6286,11 +6309,13 @@ class HLoadNamedField V8_FINAL : public HTemplateInstruction<2> { |
| private: |
| HLoadNamedField(HValue* object, |
| HValue* dependency, |
| - HObjectAccess access) |
| + HObjectAccess access, |
| + HValue* object_properties = NULL) |
| : access_(access), maps_(NULL) { |
| ASSERT_NOT_NULL(object); |
| SetOperandAt(0, object); |
| SetOperandAt(1, dependency ? dependency : object); |
| + SetOperandAt(2, object_properties); |
| Representation representation = access.representation(); |
| if (representation.IsInteger8() || |
| @@ -6322,14 +6347,16 @@ class HLoadNamedField V8_FINAL : public HTemplateInstruction<2> { |
| HValue* dependency, |
| HObjectAccess access, |
| const UniqueSet<Map>* maps, |
| - HType type) |
| - : HTemplateInstruction<2>(type), access_(access), maps_(maps) { |
| + HType type, |
| + HValue* object_properties = NULL) |
| + : HTemplateInstruction<3>(type), access_(access), maps_(maps) { |
| ASSERT_NOT_NULL(maps); |
| ASSERT_NE(0, maps->size()); |
| ASSERT_NOT_NULL(object); |
| SetOperandAt(0, object); |
| SetOperandAt(1, dependency ? dependency : object); |
| + SetOperandAt(2, object_properties); |
| ASSERT(access.representation().IsHeapObject()); |
| ASSERT(type.IsHeapObject()); |
| @@ -6657,15 +6684,22 @@ enum StoreFieldOrKeyedMode { |
| }; |
| -class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> { |
| +class HStoreNamedField V8_FINAL : public HTemplateInstruction<4> { |
| public: |
| DECLARE_INSTRUCTION_FACTORY_P3(HStoreNamedField, HValue*, |
| HObjectAccess, HValue*); |
| DECLARE_INSTRUCTION_FACTORY_P4(HStoreNamedField, HValue*, |
| HObjectAccess, HValue*, StoreFieldOrKeyedMode); |
| + DECLARE_INSTRUCTION_FACTORY_P5(HStoreNamedField, HValue*, |
| + HObjectAccess, HValue*, StoreFieldOrKeyedMode, |
| + HValue*); |
| DECLARE_CONCRETE_INSTRUCTION(StoreNamedField) |
| + virtual int OperandCount() V8_OVERRIDE { |
| + return (object_properties() != NULL) ? 4 : 3; |
| + } |
| + |
| virtual bool HasEscapingOperandAt(int index) V8_OVERRIDE { |
| return index == 1; |
| } |
| @@ -6708,6 +6742,7 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> { |
| HValue* object() const { return OperandAt(0); } |
| HValue* value() const { return OperandAt(1); } |
| HValue* transition() const { return OperandAt(2); } |
| + HValue* object_properties() { return OperandAt(3); } |
| HObjectAccess access() const { return access_; } |
| HValue* dominator() const { return dominator_; } |
| @@ -6745,6 +6780,19 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> { |
| dominator()); |
| } |
| + static bool PreferExtractLoadPropertiesPointer() { |
| +#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 |
| + return true; |
|
ulan
2014/06/12 13:39:18
Could you please port this to other architectures
|
| +#else |
| + return false; |
| +#endif |
| + } |
| + static bool NeedsPropertiesPointer(HObjectAccess access) { |
| + return !(access.IsExternalMemory() || |
|
ulan
2014/06/12 13:39:18
This predicate should be part of HObjectAccess (if
|
| + access.representation().IsDouble() || |
| + access.IsInobject()); |
| + } |
| + |
| SmiCheck SmiCheckForWriteBarrier() const { |
| if (field_representation().IsHeapObject()) return OMIT_SMI_CHECK; |
| if (value()->type().IsHeapObject()) return OMIT_SMI_CHECK; |
| @@ -6780,7 +6828,8 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> { |
| HStoreNamedField(HValue* obj, |
| HObjectAccess access, |
| HValue* val, |
| - StoreFieldOrKeyedMode store_mode = INITIALIZING_STORE) |
| + StoreFieldOrKeyedMode store_mode = INITIALIZING_STORE, |
| + HValue* obj_properties = NULL) |
| : access_(access), |
| dominator_(NULL), |
| has_transition_(false), |
| @@ -6792,6 +6841,7 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> { |
| SetOperandAt(0, obj); |
| SetOperandAt(1, val); |
| SetOperandAt(2, obj); |
| + SetOperandAt(3, obj_properties); |
| access.SetGVNFlags(this, STORE); |
| } |