| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 5692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5703 } | 5703 } |
| 5704 | 5704 |
| 5705 inline Handle<String> name() const { | 5705 inline Handle<String> name() const { |
| 5706 return name_; | 5706 return name_; |
| 5707 } | 5707 } |
| 5708 | 5708 |
| 5709 inline bool immutable() const { | 5709 inline bool immutable() const { |
| 5710 return ImmutableField::decode(value_); | 5710 return ImmutableField::decode(value_); |
| 5711 } | 5711 } |
| 5712 | 5712 |
| 5713 // Returns true if access is being made to an in-object property that |
| 5714 // was already added to the object. |
| 5715 inline bool existing_inobject_property() const { |
| 5716 return ExistingInobjectPropertyField::decode(value_); |
| 5717 } |
| 5718 |
| 5713 inline HObjectAccess WithRepresentation(Representation representation) { | 5719 inline HObjectAccess WithRepresentation(Representation representation) { |
| 5714 return HObjectAccess(portion(), offset(), representation, name()); | 5720 return HObjectAccess(portion(), offset(), representation, name(), |
| 5721 immutable(), existing_inobject_property()); |
| 5715 } | 5722 } |
| 5716 | 5723 |
| 5717 static HObjectAccess ForHeapNumberValue() { | 5724 static HObjectAccess ForHeapNumberValue() { |
| 5718 return HObjectAccess( | 5725 return HObjectAccess( |
| 5719 kDouble, HeapNumber::kValueOffset, Representation::Double()); | 5726 kDouble, HeapNumber::kValueOffset, Representation::Double()); |
| 5720 } | 5727 } |
| 5721 | 5728 |
| 5722 static HObjectAccess ForHeapNumberValueLowestBits() { | 5729 static HObjectAccess ForHeapNumberValueLowestBits() { |
| 5723 return HObjectAccess(kDouble, | 5730 return HObjectAccess(kDouble, |
| 5724 HeapNumber::kValueOffset, | 5731 HeapNumber::kValueOffset, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 5748 kArrayLengths, | 5755 kArrayLengths, |
| 5749 JSArray::kLengthOffset, | 5756 JSArray::kLengthOffset, |
| 5750 IsFastElementsKind(elements_kind) && | 5757 IsFastElementsKind(elements_kind) && |
| 5751 FLAG_track_fields | 5758 FLAG_track_fields |
| 5752 ? Representation::Smi() : Representation::Tagged()); | 5759 ? Representation::Smi() : Representation::Tagged()); |
| 5753 } | 5760 } |
| 5754 | 5761 |
| 5755 static HObjectAccess ForAllocationSiteOffset(int offset); | 5762 static HObjectAccess ForAllocationSiteOffset(int offset); |
| 5756 | 5763 |
| 5757 static HObjectAccess ForAllocationSiteList() { | 5764 static HObjectAccess ForAllocationSiteList() { |
| 5758 return HObjectAccess(kExternalMemory, 0, Representation::Tagged()); | 5765 return HObjectAccess(kExternalMemory, 0, Representation::Tagged(), |
| 5766 Handle<String>::null(), false, false); |
| 5759 } | 5767 } |
| 5760 | 5768 |
| 5761 static HObjectAccess ForFixedArrayLength() { | 5769 static HObjectAccess ForFixedArrayLength() { |
| 5762 return HObjectAccess( | 5770 return HObjectAccess( |
| 5763 kArrayLengths, | 5771 kArrayLengths, |
| 5764 FixedArray::kLengthOffset, | 5772 FixedArray::kLengthOffset, |
| 5765 FLAG_track_fields ? Representation::Smi() : Representation::Tagged()); | 5773 FLAG_track_fields ? Representation::Smi() : Representation::Tagged()); |
| 5766 } | 5774 } |
| 5767 | 5775 |
| 5768 static HObjectAccess ForStringHashField() { | 5776 static HObjectAccess ForStringHashField() { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5850 | 5858 |
| 5851 static HObjectAccess ForCellValue() { | 5859 static HObjectAccess ForCellValue() { |
| 5852 return HObjectAccess(kInobject, Cell::kValueOffset); | 5860 return HObjectAccess(kInobject, Cell::kValueOffset); |
| 5853 } | 5861 } |
| 5854 | 5862 |
| 5855 static HObjectAccess ForAllocationMementoSite() { | 5863 static HObjectAccess ForAllocationMementoSite() { |
| 5856 return HObjectAccess(kInobject, AllocationMemento::kAllocationSiteOffset); | 5864 return HObjectAccess(kInobject, AllocationMemento::kAllocationSiteOffset); |
| 5857 } | 5865 } |
| 5858 | 5866 |
| 5859 static HObjectAccess ForCounter() { | 5867 static HObjectAccess ForCounter() { |
| 5860 return HObjectAccess(kExternalMemory, 0, Representation::Integer32()); | 5868 return HObjectAccess(kExternalMemory, 0, Representation::Integer32(), |
| 5869 Handle<String>::null(), false, false); |
| 5861 } | 5870 } |
| 5862 | 5871 |
| 5863 // Create an access to an offset in a fixed array header. | 5872 // Create an access to an offset in a fixed array header. |
| 5864 static HObjectAccess ForFixedArrayHeader(int offset); | 5873 static HObjectAccess ForFixedArrayHeader(int offset); |
| 5865 | 5874 |
| 5866 // Create an access to an in-object property in a JSObject. | 5875 // Create an access to an in-object property in a JSObject. |
| 5867 static HObjectAccess ForJSObjectOffset(int offset, | 5876 // This kind of access must be used when the object |map| is known and |
| 5877 // in-object properties are being accessed. Accesses of the in-object |
| 5878 // properties can have different semantics depending on whether corresponding |
| 5879 // property was added to the map or not. |
| 5880 static HObjectAccess ForMapAndOffset(Handle<Map> map, int offset, |
| 5868 Representation representation = Representation::Tagged()); | 5881 Representation representation = Representation::Tagged()); |
| 5869 | 5882 |
| 5883 // Create an access to an in-object property in a JSObject. |
| 5884 // This kind of access can be used for accessing object header fields or |
| 5885 // in-object properties if the map of the object is not known. |
| 5886 static HObjectAccess ForObservableJSObjectOffset(int offset, |
| 5887 Representation representation = Representation::Tagged()) { |
| 5888 return ForMapAndOffset(Handle<Map>::null(), offset, representation); |
| 5889 } |
| 5890 |
| 5870 // Create an access to an in-object property in a JSArray. | 5891 // Create an access to an in-object property in a JSArray. |
| 5871 static HObjectAccess ForJSArrayOffset(int offset); | 5892 static HObjectAccess ForJSArrayOffset(int offset); |
| 5872 | 5893 |
| 5873 static HObjectAccess ForContextSlot(int index); | 5894 static HObjectAccess ForContextSlot(int index); |
| 5874 | 5895 |
| 5875 // Create an access to the backing store of an object. | 5896 // Create an access to the backing store of an object. |
| 5876 static HObjectAccess ForBackingStoreOffset(int offset, | 5897 static HObjectAccess ForBackingStoreOffset(int offset, |
| 5877 Representation representation = Representation::Tagged()); | 5898 Representation representation = Representation::Tagged()); |
| 5878 | 5899 |
| 5879 // Create an access to a resolved field (in-object or backing store). | 5900 // Create an access to a resolved field (in-object or backing store). |
| 5880 static HObjectAccess ForField(Handle<Map> map, | 5901 static HObjectAccess ForField(Handle<Map> map, |
| 5881 LookupResult *lookup, Handle<String> name = Handle<String>::null()); | 5902 LookupResult *lookup, Handle<String> name = Handle<String>::null()); |
| 5882 | 5903 |
| 5883 // Create an access for the payload of a Cell or JSGlobalPropertyCell. | 5904 // Create an access for the payload of a Cell or JSGlobalPropertyCell. |
| 5884 static HObjectAccess ForCellPayload(Isolate* isolate); | 5905 static HObjectAccess ForCellPayload(Isolate* isolate); |
| 5885 | 5906 |
| 5886 static HObjectAccess ForJSTypedArrayLength() { | 5907 static HObjectAccess ForJSTypedArrayLength() { |
| 5887 return HObjectAccess::ForJSObjectOffset(JSTypedArray::kLengthOffset); | 5908 return HObjectAccess::ForObservableJSObjectOffset( |
| 5909 JSTypedArray::kLengthOffset); |
| 5888 } | 5910 } |
| 5889 | 5911 |
| 5890 static HObjectAccess ForJSArrayBufferBackingStore() { | 5912 static HObjectAccess ForJSArrayBufferBackingStore() { |
| 5891 return HObjectAccess::ForJSObjectOffset( | 5913 return HObjectAccess::ForObservableJSObjectOffset( |
| 5892 JSArrayBuffer::kBackingStoreOffset, Representation::External()); | 5914 JSArrayBuffer::kBackingStoreOffset, Representation::External()); |
| 5893 } | 5915 } |
| 5894 | 5916 |
| 5895 static HObjectAccess ForExternalArrayExternalPointer() { | 5917 static HObjectAccess ForExternalArrayExternalPointer() { |
| 5896 return HObjectAccess::ForJSObjectOffset( | 5918 return HObjectAccess::ForObservableJSObjectOffset( |
| 5897 ExternalArray::kExternalPointerOffset, Representation::External()); | 5919 ExternalArray::kExternalPointerOffset, Representation::External()); |
| 5898 } | 5920 } |
| 5899 | 5921 |
| 5900 static HObjectAccess ForJSArrayBufferViewWeakNext() { | 5922 static HObjectAccess ForJSArrayBufferViewWeakNext() { |
| 5901 return HObjectAccess::ForJSObjectOffset(JSArrayBufferView::kWeakNextOffset); | 5923 return HObjectAccess::ForObservableJSObjectOffset( |
| 5924 JSArrayBufferView::kWeakNextOffset); |
| 5902 } | 5925 } |
| 5903 | 5926 |
| 5904 static HObjectAccess ForJSArrayBufferWeakFirstView() { | 5927 static HObjectAccess ForJSArrayBufferWeakFirstView() { |
| 5905 return HObjectAccess::ForJSObjectOffset( | 5928 return HObjectAccess::ForObservableJSObjectOffset( |
| 5906 JSArrayBuffer::kWeakFirstViewOffset); | 5929 JSArrayBuffer::kWeakFirstViewOffset); |
| 5907 } | 5930 } |
| 5908 | 5931 |
| 5909 static HObjectAccess ForJSArrayBufferViewBuffer() { | 5932 static HObjectAccess ForJSArrayBufferViewBuffer() { |
| 5910 return HObjectAccess::ForJSObjectOffset(JSArrayBufferView::kBufferOffset); | 5933 return HObjectAccess::ForObservableJSObjectOffset( |
| 5934 JSArrayBufferView::kBufferOffset); |
| 5911 } | 5935 } |
| 5912 | 5936 |
| 5913 static HObjectAccess ForJSArrayBufferViewByteOffset() { | 5937 static HObjectAccess ForJSArrayBufferViewByteOffset() { |
| 5914 return HObjectAccess::ForJSObjectOffset( | 5938 return HObjectAccess::ForObservableJSObjectOffset( |
| 5915 JSArrayBufferView::kByteOffsetOffset); | 5939 JSArrayBufferView::kByteOffsetOffset); |
| 5916 } | 5940 } |
| 5917 | 5941 |
| 5918 static HObjectAccess ForJSArrayBufferViewByteLength() { | 5942 static HObjectAccess ForJSArrayBufferViewByteLength() { |
| 5919 return HObjectAccess::ForJSObjectOffset( | 5943 return HObjectAccess::ForObservableJSObjectOffset( |
| 5920 JSArrayBufferView::kByteLengthOffset); | 5944 JSArrayBufferView::kByteLengthOffset); |
| 5921 } | 5945 } |
| 5922 | 5946 |
| 5923 static HObjectAccess ForGlobalObjectNativeContext() { | 5947 static HObjectAccess ForGlobalObjectNativeContext() { |
| 5924 return HObjectAccess(kInobject, GlobalObject::kNativeContextOffset); | 5948 return HObjectAccess(kInobject, GlobalObject::kNativeContextOffset); |
| 5925 } | 5949 } |
| 5926 | 5950 |
| 5927 void PrintTo(StringStream* stream); | 5951 void PrintTo(StringStream* stream); |
| 5928 | 5952 |
| 5929 inline bool Equals(HObjectAccess that) const { | 5953 inline bool Equals(HObjectAccess that) const { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 5942 kElementsPointer, // elements pointer | 5966 kElementsPointer, // elements pointer |
| 5943 kBackingStore, // some field in the backing store | 5967 kBackingStore, // some field in the backing store |
| 5944 kDouble, // some double field | 5968 kDouble, // some double field |
| 5945 kInobject, // some other in-object field | 5969 kInobject, // some other in-object field |
| 5946 kExternalMemory // some field in external memory | 5970 kExternalMemory // some field in external memory |
| 5947 }; | 5971 }; |
| 5948 | 5972 |
| 5949 HObjectAccess(Portion portion, int offset, | 5973 HObjectAccess(Portion portion, int offset, |
| 5950 Representation representation = Representation::Tagged(), | 5974 Representation representation = Representation::Tagged(), |
| 5951 Handle<String> name = Handle<String>::null(), | 5975 Handle<String> name = Handle<String>::null(), |
| 5952 bool immutable = false) | 5976 bool immutable = false, |
| 5977 bool existing_inobject_property = true) |
| 5953 : value_(PortionField::encode(portion) | | 5978 : value_(PortionField::encode(portion) | |
| 5954 RepresentationField::encode(representation.kind()) | | 5979 RepresentationField::encode(representation.kind()) | |
| 5955 ImmutableField::encode(immutable ? 1 : 0) | | 5980 ImmutableField::encode(immutable ? 1 : 0) | |
| 5981 ExistingInobjectPropertyField::encode( |
| 5982 existing_inobject_property ? 1 : 0) | |
| 5956 OffsetField::encode(offset)), | 5983 OffsetField::encode(offset)), |
| 5957 name_(name) { | 5984 name_(name) { |
| 5958 // assert that the fields decode correctly | 5985 // assert that the fields decode correctly |
| 5959 ASSERT(this->offset() == offset); | 5986 ASSERT(this->offset() == offset); |
| 5960 ASSERT(this->portion() == portion); | 5987 ASSERT(this->portion() == portion); |
| 5961 ASSERT(this->immutable() == immutable); | 5988 ASSERT(this->immutable() == immutable); |
| 5989 ASSERT(this->existing_inobject_property() == existing_inobject_property); |
| 5962 ASSERT(RepresentationField::decode(value_) == representation.kind()); | 5990 ASSERT(RepresentationField::decode(value_) == representation.kind()); |
| 5991 ASSERT(!this->existing_inobject_property() || IsInobject()); |
| 5963 } | 5992 } |
| 5964 | 5993 |
| 5965 class PortionField : public BitField<Portion, 0, 3> {}; | 5994 class PortionField : public BitField<Portion, 0, 3> {}; |
| 5966 class RepresentationField : public BitField<Representation::Kind, 3, 4> {}; | 5995 class RepresentationField : public BitField<Representation::Kind, 3, 4> {}; |
| 5967 class ImmutableField : public BitField<bool, 7, 1> {}; | 5996 class ImmutableField : public BitField<bool, 7, 1> {}; |
| 5968 class OffsetField : public BitField<int, 8, 24> {}; | 5997 class ExistingInobjectPropertyField : public BitField<bool, 8, 1> {}; |
| 5998 class OffsetField : public BitField<int, 9, 23> {}; |
| 5969 | 5999 |
| 5970 uint32_t value_; // encodes portion, representation, immutable, and offset | 6000 uint32_t value_; // encodes portion, representation, immutable, and offset |
| 5971 Handle<String> name_; | 6001 Handle<String> name_; |
| 5972 | 6002 |
| 5973 friend class HLoadNamedField; | 6003 friend class HLoadNamedField; |
| 5974 friend class HStoreNamedField; | 6004 friend class HStoreNamedField; |
| 5975 | 6005 |
| 5976 inline Portion portion() const { | 6006 inline Portion portion() const { |
| 5977 return PortionField::decode(value_); | 6007 return PortionField::decode(value_); |
| 5978 } | 6008 } |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6344 SetOperandAt(1, key); | 6374 SetOperandAt(1, key); |
| 6345 SetOperandAt(2, context); | 6375 SetOperandAt(2, context); |
| 6346 SetAllSideEffects(); | 6376 SetAllSideEffects(); |
| 6347 } | 6377 } |
| 6348 }; | 6378 }; |
| 6349 | 6379 |
| 6350 | 6380 |
| 6351 // Indicates whether the store is a store to an entry that was previously | 6381 // Indicates whether the store is a store to an entry that was previously |
| 6352 // initialized or not. | 6382 // initialized or not. |
| 6353 enum StoreFieldOrKeyedMode { | 6383 enum StoreFieldOrKeyedMode { |
| 6354 // This is a store of either an undefined value to a field or a hole/NaN to | |
| 6355 // an entry of a newly allocated object. | |
| 6356 PREINITIALIZING_STORE, | |
| 6357 // The entry could be either previously initialized or not. | 6384 // The entry could be either previously initialized or not. |
| 6358 INITIALIZING_STORE, | 6385 INITIALIZING_STORE, |
| 6359 // At the time of this store it is guaranteed that the entry is already | 6386 // At the time of this store it is guaranteed that the entry is already |
| 6360 // initialized. | 6387 // initialized. |
| 6361 STORE_TO_INITIALIZED_ENTRY | 6388 STORE_TO_INITIALIZED_ENTRY |
| 6362 }; | 6389 }; |
| 6363 | 6390 |
| 6364 | 6391 |
| 6365 class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> { | 6392 class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> { |
| 6366 public: | 6393 public: |
| 6394 DECLARE_INSTRUCTION_FACTORY_P3(HStoreNamedField, HValue*, |
| 6395 HObjectAccess, HValue*); |
| 6367 DECLARE_INSTRUCTION_FACTORY_P4(HStoreNamedField, HValue*, | 6396 DECLARE_INSTRUCTION_FACTORY_P4(HStoreNamedField, HValue*, |
| 6368 HObjectAccess, HValue*, StoreFieldOrKeyedMode); | 6397 HObjectAccess, HValue*, StoreFieldOrKeyedMode); |
| 6369 | 6398 |
| 6370 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField) | 6399 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField) |
| 6371 | 6400 |
| 6372 virtual bool HasEscapingOperandAt(int index) V8_OVERRIDE { | 6401 virtual bool HasEscapingOperandAt(int index) V8_OVERRIDE { |
| 6373 return index == 1; | 6402 return index == 1; |
| 6374 } | 6403 } |
| 6375 virtual bool HasOutOfBoundsAccess(int size) V8_OVERRIDE { | 6404 virtual bool HasOutOfBoundsAccess(int size) V8_OVERRIDE { |
| 6376 return !access().IsInobject() || access().offset() >= size; | 6405 return !access().IsInobject() || access().offset() >= size; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6463 } | 6492 } |
| 6464 | 6493 |
| 6465 void UpdateValue(HValue* value) { | 6494 void UpdateValue(HValue* value) { |
| 6466 SetOperandAt(1, value); | 6495 SetOperandAt(1, value); |
| 6467 } | 6496 } |
| 6468 | 6497 |
| 6469 private: | 6498 private: |
| 6470 HStoreNamedField(HValue* obj, | 6499 HStoreNamedField(HValue* obj, |
| 6471 HObjectAccess access, | 6500 HObjectAccess access, |
| 6472 HValue* val, | 6501 HValue* val, |
| 6473 StoreFieldOrKeyedMode store_mode) | 6502 StoreFieldOrKeyedMode store_mode = INITIALIZING_STORE) |
| 6474 : access_(access), | 6503 : access_(access), |
| 6475 new_space_dominator_(NULL), | 6504 new_space_dominator_(NULL), |
| 6476 write_barrier_mode_(UPDATE_WRITE_BARRIER), | 6505 write_barrier_mode_(UPDATE_WRITE_BARRIER), |
| 6477 has_transition_(false), | 6506 has_transition_(false), |
| 6478 store_mode_(store_mode) { | 6507 store_mode_(store_mode) { |
| 6479 // PREINITIALIZING_STORE is only used to mark stores that initialize a | 6508 // Stores to a non existing in-object property are allowed only to the |
| 6480 // memory region resulting from HAllocate (possibly through an | 6509 // newly allocated objects (via HAllocate or HInnerAllocatedObject). |
| 6481 // HInnerAllocatedObject). | 6510 ASSERT(!access.IsInobject() || access.existing_inobject_property() || |
| 6482 ASSERT(store_mode != PREINITIALIZING_STORE || | |
| 6483 obj->IsAllocate() || obj->IsInnerAllocatedObject()); | 6511 obj->IsAllocate() || obj->IsInnerAllocatedObject()); |
| 6484 SetOperandAt(0, obj); | 6512 SetOperandAt(0, obj); |
| 6485 SetOperandAt(1, val); | 6513 SetOperandAt(1, val); |
| 6486 SetOperandAt(2, obj); | 6514 SetOperandAt(2, obj); |
| 6487 access.SetGVNFlags(this, true); | 6515 access.SetGVNFlags(this, true); |
| 6488 } | 6516 } |
| 6489 | 6517 |
| 6490 HObjectAccess access_; | 6518 HObjectAccess access_; |
| 6491 HValue* new_space_dominator_; | 6519 HValue* new_space_dominator_; |
| 6492 WriteBarrierMode write_barrier_mode_ : 1; | 6520 WriteBarrierMode write_barrier_mode_ : 1; |
| 6493 bool has_transition_ : 1; | 6521 bool has_transition_ : 1; |
| 6494 StoreFieldOrKeyedMode store_mode_ : 2; | 6522 StoreFieldOrKeyedMode store_mode_ : 1; |
| 6495 }; | 6523 }; |
| 6496 | 6524 |
| 6497 | 6525 |
| 6498 class HStoreNamedGeneric V8_FINAL : public HTemplateInstruction<3> { | 6526 class HStoreNamedGeneric V8_FINAL : public HTemplateInstruction<3> { |
| 6499 public: | 6527 public: |
| 6500 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreNamedGeneric, HValue*, | 6528 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreNamedGeneric, HValue*, |
| 6501 Handle<String>, HValue*, | 6529 Handle<String>, HValue*, |
| 6502 StrictModeFlag); | 6530 StrictModeFlag); |
| 6503 HValue* object() { return OperandAt(0); } | 6531 HValue* object() { return OperandAt(0); } |
| 6504 HValue* value() { return OperandAt(1); } | 6532 HValue* value() { return OperandAt(1); } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 6529 } | 6557 } |
| 6530 | 6558 |
| 6531 Handle<String> name_; | 6559 Handle<String> name_; |
| 6532 StrictModeFlag strict_mode_flag_; | 6560 StrictModeFlag strict_mode_flag_; |
| 6533 }; | 6561 }; |
| 6534 | 6562 |
| 6535 | 6563 |
| 6536 class HStoreKeyed V8_FINAL | 6564 class HStoreKeyed V8_FINAL |
| 6537 : public HTemplateInstruction<3>, public ArrayInstructionInterface { | 6565 : public HTemplateInstruction<3>, public ArrayInstructionInterface { |
| 6538 public: | 6566 public: |
| 6567 DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*, |
| 6568 ElementsKind); |
| 6539 DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*, | 6569 DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*, |
| 6540 ElementsKind, StoreFieldOrKeyedMode); | 6570 ElementsKind, StoreFieldOrKeyedMode); |
| 6541 | 6571 |
| 6542 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 6572 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 6543 // kind_fast: tagged[int32] = tagged | 6573 // kind_fast: tagged[int32] = tagged |
| 6544 // kind_double: tagged[int32] = double | 6574 // kind_double: tagged[int32] = double |
| 6545 // kind_smi : tagged[int32] = smi | 6575 // kind_smi : tagged[int32] = smi |
| 6546 // kind_fixed_typed_array: tagged[int32] = (double | int32) | 6576 // kind_fixed_typed_array: tagged[int32] = (double | int32) |
| 6547 // kind_external: external[int32] = (double | int32) | 6577 // kind_external: external[int32] = (double | int32) |
| 6548 if (index == 0) { | 6578 if (index == 0) { |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6648 | 6678 |
| 6649 bool NeedsCanonicalization(); | 6679 bool NeedsCanonicalization(); |
| 6650 | 6680 |
| 6651 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 6681 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 6652 | 6682 |
| 6653 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed) | 6683 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed) |
| 6654 | 6684 |
| 6655 private: | 6685 private: |
| 6656 HStoreKeyed(HValue* obj, HValue* key, HValue* val, | 6686 HStoreKeyed(HValue* obj, HValue* key, HValue* val, |
| 6657 ElementsKind elements_kind, | 6687 ElementsKind elements_kind, |
| 6658 StoreFieldOrKeyedMode store_mode) | 6688 StoreFieldOrKeyedMode store_mode = INITIALIZING_STORE) |
| 6659 : elements_kind_(elements_kind), | 6689 : elements_kind_(elements_kind), |
| 6660 index_offset_(0), | 6690 index_offset_(0), |
| 6661 is_dehoisted_(false), | 6691 is_dehoisted_(false), |
| 6662 is_uninitialized_(false), | 6692 is_uninitialized_(false), |
| 6663 store_mode_(store_mode), | 6693 store_mode_(store_mode), |
| 6664 new_space_dominator_(NULL) { | 6694 new_space_dominator_(NULL) { |
| 6665 SetOperandAt(0, obj); | 6695 SetOperandAt(0, obj); |
| 6666 SetOperandAt(1, key); | 6696 SetOperandAt(1, key); |
| 6667 SetOperandAt(2, val); | 6697 SetOperandAt(2, val); |
| 6668 | 6698 |
| 6669 // PREINITIALIZING_STORE is only used to mark stores that initialize a | |
| 6670 // memory region resulting from HAllocate (possibly through an | |
| 6671 // HInnerAllocatedObject). | |
| 6672 ASSERT(store_mode != PREINITIALIZING_STORE || | |
| 6673 obj->IsAllocate() || obj->IsInnerAllocatedObject()); | |
| 6674 | |
| 6675 ASSERT(store_mode != STORE_TO_INITIALIZED_ENTRY || | 6699 ASSERT(store_mode != STORE_TO_INITIALIZED_ENTRY || |
| 6676 elements_kind == FAST_SMI_ELEMENTS); | 6700 elements_kind == FAST_SMI_ELEMENTS); |
| 6677 | 6701 |
| 6678 if (IsFastObjectElementsKind(elements_kind)) { | 6702 if (IsFastObjectElementsKind(elements_kind)) { |
| 6679 SetFlag(kTrackSideEffectDominators); | 6703 SetFlag(kTrackSideEffectDominators); |
| 6680 SetGVNFlag(kDependsOnNewSpacePromotion); | 6704 SetGVNFlag(kDependsOnNewSpacePromotion); |
| 6681 } | 6705 } |
| 6682 if (is_external()) { | 6706 if (is_external()) { |
| 6683 SetGVNFlag(kChangesExternalMemory); | 6707 SetGVNFlag(kChangesExternalMemory); |
| 6684 SetFlag(kAllowUndefinedAsNaN); | 6708 SetFlag(kAllowUndefinedAsNaN); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 6699 (elements_kind >= UINT8_ELEMENTS && | 6723 (elements_kind >= UINT8_ELEMENTS && |
| 6700 elements_kind <= INT32_ELEMENTS)) { | 6724 elements_kind <= INT32_ELEMENTS)) { |
| 6701 SetFlag(kTruncatingToInt32); | 6725 SetFlag(kTruncatingToInt32); |
| 6702 } | 6726 } |
| 6703 } | 6727 } |
| 6704 | 6728 |
| 6705 ElementsKind elements_kind_; | 6729 ElementsKind elements_kind_; |
| 6706 uint32_t index_offset_; | 6730 uint32_t index_offset_; |
| 6707 bool is_dehoisted_ : 1; | 6731 bool is_dehoisted_ : 1; |
| 6708 bool is_uninitialized_ : 1; | 6732 bool is_uninitialized_ : 1; |
| 6709 StoreFieldOrKeyedMode store_mode_: 2; | 6733 StoreFieldOrKeyedMode store_mode_: 1; |
| 6710 HValue* new_space_dominator_; | 6734 HValue* new_space_dominator_; |
| 6711 }; | 6735 }; |
| 6712 | 6736 |
| 6713 | 6737 |
| 6714 class HStoreKeyedGeneric V8_FINAL : public HTemplateInstruction<4> { | 6738 class HStoreKeyedGeneric V8_FINAL : public HTemplateInstruction<4> { |
| 6715 public: | 6739 public: |
| 6716 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreKeyedGeneric, HValue*, | 6740 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreKeyedGeneric, HValue*, |
| 6717 HValue*, HValue*, StrictModeFlag); | 6741 HValue*, HValue*, StrictModeFlag); |
| 6718 | 6742 |
| 6719 HValue* object() { return OperandAt(0); } | 6743 HValue* object() { return OperandAt(0); } |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7380 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7404 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
| 7381 }; | 7405 }; |
| 7382 | 7406 |
| 7383 | 7407 |
| 7384 #undef DECLARE_INSTRUCTION | 7408 #undef DECLARE_INSTRUCTION |
| 7385 #undef DECLARE_CONCRETE_INSTRUCTION | 7409 #undef DECLARE_CONCRETE_INSTRUCTION |
| 7386 | 7410 |
| 7387 } } // namespace v8::internal | 7411 } } // namespace v8::internal |
| 7388 | 7412 |
| 7389 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7413 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |