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 5723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5734 } | 5734 } |
5735 | 5735 |
5736 inline Handle<String> name() const { | 5736 inline Handle<String> name() const { |
5737 return name_; | 5737 return name_; |
5738 } | 5738 } |
5739 | 5739 |
5740 inline bool immutable() const { | 5740 inline bool immutable() const { |
5741 return ImmutableField::decode(value_); | 5741 return ImmutableField::decode(value_); |
5742 } | 5742 } |
5743 | 5743 |
| 5744 // Returns true if access is being made to an in-object property that |
| 5745 // was already added to the object. |
| 5746 inline bool existing_inobject_property() const { |
| 5747 return ExistingInobjectPropertyField::decode(value_); |
| 5748 } |
| 5749 |
5744 inline HObjectAccess WithRepresentation(Representation representation) { | 5750 inline HObjectAccess WithRepresentation(Representation representation) { |
5745 return HObjectAccess(portion(), offset(), representation, name()); | 5751 return HObjectAccess(portion(), offset(), representation, name(), |
| 5752 immutable(), existing_inobject_property()); |
5746 } | 5753 } |
5747 | 5754 |
5748 static HObjectAccess ForHeapNumberValue() { | 5755 static HObjectAccess ForHeapNumberValue() { |
5749 return HObjectAccess( | 5756 return HObjectAccess( |
5750 kDouble, HeapNumber::kValueOffset, Representation::Double()); | 5757 kDouble, HeapNumber::kValueOffset, Representation::Double()); |
5751 } | 5758 } |
5752 | 5759 |
5753 static HObjectAccess ForHeapNumberValueLowestBits() { | 5760 static HObjectAccess ForHeapNumberValueLowestBits() { |
5754 return HObjectAccess(kDouble, | 5761 return HObjectAccess(kDouble, |
5755 HeapNumber::kValueOffset, | 5762 HeapNumber::kValueOffset, |
(...skipping 23 matching lines...) Expand all Loading... |
5779 kArrayLengths, | 5786 kArrayLengths, |
5780 JSArray::kLengthOffset, | 5787 JSArray::kLengthOffset, |
5781 IsFastElementsKind(elements_kind) && | 5788 IsFastElementsKind(elements_kind) && |
5782 FLAG_track_fields | 5789 FLAG_track_fields |
5783 ? Representation::Smi() : Representation::Tagged()); | 5790 ? Representation::Smi() : Representation::Tagged()); |
5784 } | 5791 } |
5785 | 5792 |
5786 static HObjectAccess ForAllocationSiteOffset(int offset); | 5793 static HObjectAccess ForAllocationSiteOffset(int offset); |
5787 | 5794 |
5788 static HObjectAccess ForAllocationSiteList() { | 5795 static HObjectAccess ForAllocationSiteList() { |
5789 return HObjectAccess(kExternalMemory, 0, Representation::Tagged()); | 5796 return HObjectAccess(kExternalMemory, 0, Representation::Tagged(), |
| 5797 Handle<String>::null(), false, false); |
5790 } | 5798 } |
5791 | 5799 |
5792 static HObjectAccess ForFixedArrayLength() { | 5800 static HObjectAccess ForFixedArrayLength() { |
5793 return HObjectAccess( | 5801 return HObjectAccess( |
5794 kArrayLengths, | 5802 kArrayLengths, |
5795 FixedArray::kLengthOffset, | 5803 FixedArray::kLengthOffset, |
5796 FLAG_track_fields ? Representation::Smi() : Representation::Tagged()); | 5804 FLAG_track_fields ? Representation::Smi() : Representation::Tagged()); |
5797 } | 5805 } |
5798 | 5806 |
5799 static HObjectAccess ForStringHashField() { | 5807 static HObjectAccess ForStringHashField() { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5881 | 5889 |
5882 static HObjectAccess ForCellValue() { | 5890 static HObjectAccess ForCellValue() { |
5883 return HObjectAccess(kInobject, Cell::kValueOffset); | 5891 return HObjectAccess(kInobject, Cell::kValueOffset); |
5884 } | 5892 } |
5885 | 5893 |
5886 static HObjectAccess ForAllocationMementoSite() { | 5894 static HObjectAccess ForAllocationMementoSite() { |
5887 return HObjectAccess(kInobject, AllocationMemento::kAllocationSiteOffset); | 5895 return HObjectAccess(kInobject, AllocationMemento::kAllocationSiteOffset); |
5888 } | 5896 } |
5889 | 5897 |
5890 static HObjectAccess ForCounter() { | 5898 static HObjectAccess ForCounter() { |
5891 return HObjectAccess(kExternalMemory, 0, Representation::Integer32()); | 5899 return HObjectAccess(kExternalMemory, 0, Representation::Integer32(), |
| 5900 Handle<String>::null(), false, false); |
5892 } | 5901 } |
5893 | 5902 |
5894 // Create an access to an offset in a fixed array header. | 5903 // Create an access to an offset in a fixed array header. |
5895 static HObjectAccess ForFixedArrayHeader(int offset); | 5904 static HObjectAccess ForFixedArrayHeader(int offset); |
5896 | 5905 |
5897 // Create an access to an in-object property in a JSObject. | 5906 // Create an access to an in-object property in a JSObject. |
5898 static HObjectAccess ForJSObjectOffset(int offset, | 5907 // This kind of access must be used when the object |map| is known and |
| 5908 // in-object properties are being accessed. Accesses of the in-object |
| 5909 // properties can have different semantics depending on whether corresponding |
| 5910 // property was added to the map or not. |
| 5911 static HObjectAccess ForMapAndOffset(Handle<Map> map, int offset, |
5899 Representation representation = Representation::Tagged()); | 5912 Representation representation = Representation::Tagged()); |
5900 | 5913 |
| 5914 // Create an access to an in-object property in a JSObject. |
| 5915 // This kind of access can be used for accessing object header fields or |
| 5916 // in-object properties if the map of the object is not known. |
| 5917 static HObjectAccess ForObservableJSObjectPropertyAt(int offset, |
| 5918 Representation representation = Representation::Tagged()) { |
| 5919 return ForMapAndOffset(Handle<Map>::null(), offset, representation); |
| 5920 } |
| 5921 |
5901 // Create an access to an in-object property in a JSArray. | 5922 // Create an access to an in-object property in a JSArray. |
5902 static HObjectAccess ForJSArrayOffset(int offset); | 5923 static HObjectAccess ForJSArrayOffset(int offset); |
5903 | 5924 |
5904 static HObjectAccess ForContextSlot(int index); | 5925 static HObjectAccess ForContextSlot(int index); |
5905 | 5926 |
5906 // Create an access to the backing store of an object. | 5927 // Create an access to the backing store of an object. |
5907 static HObjectAccess ForBackingStoreOffset(int offset, | 5928 static HObjectAccess ForBackingStoreOffset(int offset, |
5908 Representation representation = Representation::Tagged()); | 5929 Representation representation = Representation::Tagged()); |
5909 | 5930 |
5910 // Create an access to a resolved field (in-object or backing store). | 5931 // Create an access to a resolved field (in-object or backing store). |
5911 static HObjectAccess ForField(Handle<Map> map, | 5932 static HObjectAccess ForField(Handle<Map> map, |
5912 LookupResult *lookup, Handle<String> name = Handle<String>::null()); | 5933 LookupResult *lookup, Handle<String> name = Handle<String>::null()); |
5913 | 5934 |
5914 // Create an access for the payload of a Cell or JSGlobalPropertyCell. | 5935 // Create an access for the payload of a Cell or JSGlobalPropertyCell. |
5915 static HObjectAccess ForCellPayload(Isolate* isolate); | 5936 static HObjectAccess ForCellPayload(Isolate* isolate); |
5916 | 5937 |
5917 static HObjectAccess ForJSTypedArrayLength() { | 5938 static HObjectAccess ForJSTypedArrayLength() { |
5918 return HObjectAccess::ForJSObjectOffset(JSTypedArray::kLengthOffset); | 5939 return HObjectAccess::ForObservableJSObjectPropertyAt( |
| 5940 JSTypedArray::kLengthOffset); |
5919 } | 5941 } |
5920 | 5942 |
5921 static HObjectAccess ForJSArrayBufferBackingStore() { | 5943 static HObjectAccess ForJSArrayBufferBackingStore() { |
5922 return HObjectAccess::ForJSObjectOffset( | 5944 return HObjectAccess::ForObservableJSObjectPropertyAt( |
5923 JSArrayBuffer::kBackingStoreOffset, Representation::External()); | 5945 JSArrayBuffer::kBackingStoreOffset, Representation::External()); |
5924 } | 5946 } |
5925 | 5947 |
5926 static HObjectAccess ForExternalArrayExternalPointer() { | 5948 static HObjectAccess ForExternalArrayExternalPointer() { |
5927 return HObjectAccess::ForJSObjectOffset( | 5949 return HObjectAccess::ForObservableJSObjectPropertyAt( |
5928 ExternalArray::kExternalPointerOffset, Representation::External()); | 5950 ExternalArray::kExternalPointerOffset, Representation::External()); |
5929 } | 5951 } |
5930 | 5952 |
5931 static HObjectAccess ForJSArrayBufferViewWeakNext() { | 5953 static HObjectAccess ForJSArrayBufferViewWeakNext() { |
5932 return HObjectAccess::ForJSObjectOffset(JSArrayBufferView::kWeakNextOffset); | 5954 return HObjectAccess::ForObservableJSObjectPropertyAt( |
| 5955 JSArrayBufferView::kWeakNextOffset); |
5933 } | 5956 } |
5934 | 5957 |
5935 static HObjectAccess ForJSArrayBufferWeakFirstView() { | 5958 static HObjectAccess ForJSArrayBufferWeakFirstView() { |
5936 return HObjectAccess::ForJSObjectOffset( | 5959 return HObjectAccess::ForObservableJSObjectPropertyAt( |
5937 JSArrayBuffer::kWeakFirstViewOffset); | 5960 JSArrayBuffer::kWeakFirstViewOffset); |
5938 } | 5961 } |
5939 | 5962 |
5940 static HObjectAccess ForJSArrayBufferViewBuffer() { | 5963 static HObjectAccess ForJSArrayBufferViewBuffer() { |
5941 return HObjectAccess::ForJSObjectOffset(JSArrayBufferView::kBufferOffset); | 5964 return HObjectAccess::ForObservableJSObjectPropertyAt( |
| 5965 JSArrayBufferView::kBufferOffset); |
5942 } | 5966 } |
5943 | 5967 |
5944 static HObjectAccess ForJSArrayBufferViewByteOffset() { | 5968 static HObjectAccess ForJSArrayBufferViewByteOffset() { |
5945 return HObjectAccess::ForJSObjectOffset( | 5969 return HObjectAccess::ForObservableJSObjectPropertyAt( |
5946 JSArrayBufferView::kByteOffsetOffset); | 5970 JSArrayBufferView::kByteOffsetOffset); |
5947 } | 5971 } |
5948 | 5972 |
5949 static HObjectAccess ForJSArrayBufferViewByteLength() { | 5973 static HObjectAccess ForJSArrayBufferViewByteLength() { |
5950 return HObjectAccess::ForJSObjectOffset( | 5974 return HObjectAccess::ForObservableJSObjectPropertyAt( |
5951 JSArrayBufferView::kByteLengthOffset); | 5975 JSArrayBufferView::kByteLengthOffset); |
5952 } | 5976 } |
5953 | 5977 |
5954 static HObjectAccess ForGlobalObjectNativeContext() { | 5978 static HObjectAccess ForGlobalObjectNativeContext() { |
5955 return HObjectAccess(kInobject, GlobalObject::kNativeContextOffset); | 5979 return HObjectAccess(kInobject, GlobalObject::kNativeContextOffset); |
5956 } | 5980 } |
5957 | 5981 |
5958 void PrintTo(StringStream* stream); | 5982 void PrintTo(StringStream* stream); |
5959 | 5983 |
5960 inline bool Equals(HObjectAccess that) const { | 5984 inline bool Equals(HObjectAccess that) const { |
(...skipping 12 matching lines...) Expand all Loading... |
5973 kElementsPointer, // elements pointer | 5997 kElementsPointer, // elements pointer |
5974 kBackingStore, // some field in the backing store | 5998 kBackingStore, // some field in the backing store |
5975 kDouble, // some double field | 5999 kDouble, // some double field |
5976 kInobject, // some other in-object field | 6000 kInobject, // some other in-object field |
5977 kExternalMemory // some field in external memory | 6001 kExternalMemory // some field in external memory |
5978 }; | 6002 }; |
5979 | 6003 |
5980 HObjectAccess(Portion portion, int offset, | 6004 HObjectAccess(Portion portion, int offset, |
5981 Representation representation = Representation::Tagged(), | 6005 Representation representation = Representation::Tagged(), |
5982 Handle<String> name = Handle<String>::null(), | 6006 Handle<String> name = Handle<String>::null(), |
5983 bool immutable = false) | 6007 bool immutable = false, |
| 6008 bool existing_inobject_property = true) |
5984 : value_(PortionField::encode(portion) | | 6009 : value_(PortionField::encode(portion) | |
5985 RepresentationField::encode(representation.kind()) | | 6010 RepresentationField::encode(representation.kind()) | |
5986 ImmutableField::encode(immutable ? 1 : 0) | | 6011 ImmutableField::encode(immutable ? 1 : 0) | |
| 6012 ExistingInobjectPropertyField::encode( |
| 6013 existing_inobject_property ? 1 : 0) | |
5987 OffsetField::encode(offset)), | 6014 OffsetField::encode(offset)), |
5988 name_(name) { | 6015 name_(name) { |
5989 // assert that the fields decode correctly | 6016 // assert that the fields decode correctly |
5990 ASSERT(this->offset() == offset); | 6017 ASSERT(this->offset() == offset); |
5991 ASSERT(this->portion() == portion); | 6018 ASSERT(this->portion() == portion); |
5992 ASSERT(this->immutable() == immutable); | 6019 ASSERT(this->immutable() == immutable); |
| 6020 ASSERT(this->existing_inobject_property() == existing_inobject_property); |
5993 ASSERT(RepresentationField::decode(value_) == representation.kind()); | 6021 ASSERT(RepresentationField::decode(value_) == representation.kind()); |
| 6022 ASSERT(!this->existing_inobject_property() || IsInobject()); |
5994 } | 6023 } |
5995 | 6024 |
5996 class PortionField : public BitField<Portion, 0, 3> {}; | 6025 class PortionField : public BitField<Portion, 0, 3> {}; |
5997 class RepresentationField : public BitField<Representation::Kind, 3, 4> {}; | 6026 class RepresentationField : public BitField<Representation::Kind, 3, 4> {}; |
5998 class ImmutableField : public BitField<bool, 7, 1> {}; | 6027 class ImmutableField : public BitField<bool, 7, 1> {}; |
5999 class OffsetField : public BitField<int, 8, 24> {}; | 6028 class ExistingInobjectPropertyField : public BitField<bool, 8, 1> {}; |
| 6029 class OffsetField : public BitField<int, 9, 23> {}; |
6000 | 6030 |
6001 uint32_t value_; // encodes portion, representation, immutable, and offset | 6031 uint32_t value_; // encodes portion, representation, immutable, and offset |
6002 Handle<String> name_; | 6032 Handle<String> name_; |
6003 | 6033 |
6004 friend class HLoadNamedField; | 6034 friend class HLoadNamedField; |
6005 friend class HStoreNamedField; | 6035 friend class HStoreNamedField; |
6006 | 6036 |
6007 inline Portion portion() const { | 6037 inline Portion portion() const { |
6008 return PortionField::decode(value_); | 6038 return PortionField::decode(value_); |
6009 } | 6039 } |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6375 SetOperandAt(1, key); | 6405 SetOperandAt(1, key); |
6376 SetOperandAt(2, context); | 6406 SetOperandAt(2, context); |
6377 SetAllSideEffects(); | 6407 SetAllSideEffects(); |
6378 } | 6408 } |
6379 }; | 6409 }; |
6380 | 6410 |
6381 | 6411 |
6382 // Indicates whether the store is a store to an entry that was previously | 6412 // Indicates whether the store is a store to an entry that was previously |
6383 // initialized or not. | 6413 // initialized or not. |
6384 enum StoreFieldOrKeyedMode { | 6414 enum StoreFieldOrKeyedMode { |
6385 // This is a store of either an undefined value to a field or a hole/NaN to | |
6386 // an entry of a newly allocated object. | |
6387 PREINITIALIZING_STORE, | |
6388 // The entry could be either previously initialized or not. | 6415 // The entry could be either previously initialized or not. |
6389 INITIALIZING_STORE, | 6416 INITIALIZING_STORE, |
6390 // At the time of this store it is guaranteed that the entry is already | 6417 // At the time of this store it is guaranteed that the entry is already |
6391 // initialized. | 6418 // initialized. |
6392 STORE_TO_INITIALIZED_ENTRY | 6419 STORE_TO_INITIALIZED_ENTRY |
6393 }; | 6420 }; |
6394 | 6421 |
6395 | 6422 |
6396 class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> { | 6423 class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> { |
6397 public: | 6424 public: |
| 6425 DECLARE_INSTRUCTION_FACTORY_P3(HStoreNamedField, HValue*, |
| 6426 HObjectAccess, HValue*); |
6398 DECLARE_INSTRUCTION_FACTORY_P4(HStoreNamedField, HValue*, | 6427 DECLARE_INSTRUCTION_FACTORY_P4(HStoreNamedField, HValue*, |
6399 HObjectAccess, HValue*, StoreFieldOrKeyedMode); | 6428 HObjectAccess, HValue*, StoreFieldOrKeyedMode); |
6400 | 6429 |
6401 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField) | 6430 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField) |
6402 | 6431 |
6403 virtual bool HasEscapingOperandAt(int index) V8_OVERRIDE { | 6432 virtual bool HasEscapingOperandAt(int index) V8_OVERRIDE { |
6404 return index == 1; | 6433 return index == 1; |
6405 } | 6434 } |
6406 virtual bool HasOutOfBoundsAccess(int size) V8_OVERRIDE { | 6435 virtual bool HasOutOfBoundsAccess(int size) V8_OVERRIDE { |
6407 return !access().IsInobject() || access().offset() >= size; | 6436 return !access().IsInobject() || access().offset() >= size; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6494 } | 6523 } |
6495 | 6524 |
6496 void UpdateValue(HValue* value) { | 6525 void UpdateValue(HValue* value) { |
6497 SetOperandAt(1, value); | 6526 SetOperandAt(1, value); |
6498 } | 6527 } |
6499 | 6528 |
6500 private: | 6529 private: |
6501 HStoreNamedField(HValue* obj, | 6530 HStoreNamedField(HValue* obj, |
6502 HObjectAccess access, | 6531 HObjectAccess access, |
6503 HValue* val, | 6532 HValue* val, |
6504 StoreFieldOrKeyedMode store_mode) | 6533 StoreFieldOrKeyedMode store_mode = INITIALIZING_STORE) |
6505 : access_(access), | 6534 : access_(access), |
6506 new_space_dominator_(NULL), | 6535 new_space_dominator_(NULL), |
6507 write_barrier_mode_(UPDATE_WRITE_BARRIER), | 6536 write_barrier_mode_(UPDATE_WRITE_BARRIER), |
6508 has_transition_(false), | 6537 has_transition_(false), |
6509 store_mode_(store_mode) { | 6538 store_mode_(store_mode) { |
6510 // PREINITIALIZING_STORE is only used to mark stores that initialize a | 6539 // Stores to a non existing in-object property are allowed only to the |
6511 // memory region resulting from HAllocate (possibly through an | 6540 // newly allocated objects (via HAllocate or HInnerAllocatedObject). |
6512 // HInnerAllocatedObject). | 6541 ASSERT(!access.IsInobject() || access.existing_inobject_property() || |
6513 ASSERT(store_mode != PREINITIALIZING_STORE || | |
6514 obj->IsAllocate() || obj->IsInnerAllocatedObject()); | 6542 obj->IsAllocate() || obj->IsInnerAllocatedObject()); |
6515 SetOperandAt(0, obj); | 6543 SetOperandAt(0, obj); |
6516 SetOperandAt(1, val); | 6544 SetOperandAt(1, val); |
6517 SetOperandAt(2, obj); | 6545 SetOperandAt(2, obj); |
6518 access.SetGVNFlags(this, true); | 6546 access.SetGVNFlags(this, true); |
6519 } | 6547 } |
6520 | 6548 |
6521 HObjectAccess access_; | 6549 HObjectAccess access_; |
6522 HValue* new_space_dominator_; | 6550 HValue* new_space_dominator_; |
6523 WriteBarrierMode write_barrier_mode_ : 1; | 6551 WriteBarrierMode write_barrier_mode_ : 1; |
6524 bool has_transition_ : 1; | 6552 bool has_transition_ : 1; |
6525 StoreFieldOrKeyedMode store_mode_ : 2; | 6553 StoreFieldOrKeyedMode store_mode_ : 1; |
6526 }; | 6554 }; |
6527 | 6555 |
6528 | 6556 |
6529 class HStoreNamedGeneric V8_FINAL : public HTemplateInstruction<3> { | 6557 class HStoreNamedGeneric V8_FINAL : public HTemplateInstruction<3> { |
6530 public: | 6558 public: |
6531 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreNamedGeneric, HValue*, | 6559 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreNamedGeneric, HValue*, |
6532 Handle<String>, HValue*, | 6560 Handle<String>, HValue*, |
6533 StrictModeFlag); | 6561 StrictModeFlag); |
6534 HValue* object() { return OperandAt(0); } | 6562 HValue* object() { return OperandAt(0); } |
6535 HValue* value() { return OperandAt(1); } | 6563 HValue* value() { return OperandAt(1); } |
(...skipping 24 matching lines...) Expand all Loading... |
6560 } | 6588 } |
6561 | 6589 |
6562 Handle<String> name_; | 6590 Handle<String> name_; |
6563 StrictModeFlag strict_mode_flag_; | 6591 StrictModeFlag strict_mode_flag_; |
6564 }; | 6592 }; |
6565 | 6593 |
6566 | 6594 |
6567 class HStoreKeyed V8_FINAL | 6595 class HStoreKeyed V8_FINAL |
6568 : public HTemplateInstruction<3>, public ArrayInstructionInterface { | 6596 : public HTemplateInstruction<3>, public ArrayInstructionInterface { |
6569 public: | 6597 public: |
| 6598 DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*, |
| 6599 ElementsKind); |
6570 DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*, | 6600 DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*, |
6571 ElementsKind, StoreFieldOrKeyedMode); | 6601 ElementsKind, StoreFieldOrKeyedMode); |
6572 | 6602 |
6573 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 6603 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
6574 // kind_fast: tagged[int32] = tagged | 6604 // kind_fast: tagged[int32] = tagged |
6575 // kind_double: tagged[int32] = double | 6605 // kind_double: tagged[int32] = double |
6576 // kind_smi : tagged[int32] = smi | 6606 // kind_smi : tagged[int32] = smi |
6577 // kind_fixed_typed_array: tagged[int32] = (double | int32) | 6607 // kind_fixed_typed_array: tagged[int32] = (double | int32) |
6578 // kind_external: external[int32] = (double | int32) | 6608 // kind_external: external[int32] = (double | int32) |
6579 if (index == 0) { | 6609 if (index == 0) { |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6679 | 6709 |
6680 bool NeedsCanonicalization(); | 6710 bool NeedsCanonicalization(); |
6681 | 6711 |
6682 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 6712 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
6683 | 6713 |
6684 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed) | 6714 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed) |
6685 | 6715 |
6686 private: | 6716 private: |
6687 HStoreKeyed(HValue* obj, HValue* key, HValue* val, | 6717 HStoreKeyed(HValue* obj, HValue* key, HValue* val, |
6688 ElementsKind elements_kind, | 6718 ElementsKind elements_kind, |
6689 StoreFieldOrKeyedMode store_mode) | 6719 StoreFieldOrKeyedMode store_mode = INITIALIZING_STORE) |
6690 : elements_kind_(elements_kind), | 6720 : elements_kind_(elements_kind), |
6691 index_offset_(0), | 6721 index_offset_(0), |
6692 is_dehoisted_(false), | 6722 is_dehoisted_(false), |
6693 is_uninitialized_(false), | 6723 is_uninitialized_(false), |
6694 store_mode_(store_mode), | 6724 store_mode_(store_mode), |
6695 new_space_dominator_(NULL) { | 6725 new_space_dominator_(NULL) { |
6696 SetOperandAt(0, obj); | 6726 SetOperandAt(0, obj); |
6697 SetOperandAt(1, key); | 6727 SetOperandAt(1, key); |
6698 SetOperandAt(2, val); | 6728 SetOperandAt(2, val); |
6699 | 6729 |
6700 // PREINITIALIZING_STORE is only used to mark stores that initialize a | |
6701 // memory region resulting from HAllocate (possibly through an | |
6702 // HInnerAllocatedObject). | |
6703 ASSERT(store_mode != PREINITIALIZING_STORE || | |
6704 obj->IsAllocate() || obj->IsInnerAllocatedObject()); | |
6705 | |
6706 ASSERT(store_mode != STORE_TO_INITIALIZED_ENTRY || | 6730 ASSERT(store_mode != STORE_TO_INITIALIZED_ENTRY || |
6707 elements_kind == FAST_SMI_ELEMENTS); | 6731 elements_kind == FAST_SMI_ELEMENTS); |
6708 | 6732 |
6709 if (IsFastObjectElementsKind(elements_kind)) { | 6733 if (IsFastObjectElementsKind(elements_kind)) { |
6710 SetFlag(kTrackSideEffectDominators); | 6734 SetFlag(kTrackSideEffectDominators); |
6711 SetGVNFlag(kDependsOnNewSpacePromotion); | 6735 SetGVNFlag(kDependsOnNewSpacePromotion); |
6712 } | 6736 } |
6713 if (is_external()) { | 6737 if (is_external()) { |
6714 SetGVNFlag(kChangesExternalMemory); | 6738 SetGVNFlag(kChangesExternalMemory); |
6715 SetFlag(kAllowUndefinedAsNaN); | 6739 SetFlag(kAllowUndefinedAsNaN); |
(...skipping 14 matching lines...) Expand all Loading... |
6730 (elements_kind >= UINT8_ELEMENTS && | 6754 (elements_kind >= UINT8_ELEMENTS && |
6731 elements_kind <= INT32_ELEMENTS)) { | 6755 elements_kind <= INT32_ELEMENTS)) { |
6732 SetFlag(kTruncatingToInt32); | 6756 SetFlag(kTruncatingToInt32); |
6733 } | 6757 } |
6734 } | 6758 } |
6735 | 6759 |
6736 ElementsKind elements_kind_; | 6760 ElementsKind elements_kind_; |
6737 uint32_t index_offset_; | 6761 uint32_t index_offset_; |
6738 bool is_dehoisted_ : 1; | 6762 bool is_dehoisted_ : 1; |
6739 bool is_uninitialized_ : 1; | 6763 bool is_uninitialized_ : 1; |
6740 StoreFieldOrKeyedMode store_mode_: 2; | 6764 StoreFieldOrKeyedMode store_mode_: 1; |
6741 HValue* new_space_dominator_; | 6765 HValue* new_space_dominator_; |
6742 }; | 6766 }; |
6743 | 6767 |
6744 | 6768 |
6745 class HStoreKeyedGeneric V8_FINAL : public HTemplateInstruction<4> { | 6769 class HStoreKeyedGeneric V8_FINAL : public HTemplateInstruction<4> { |
6746 public: | 6770 public: |
6747 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreKeyedGeneric, HValue*, | 6771 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreKeyedGeneric, HValue*, |
6748 HValue*, HValue*, StrictModeFlag); | 6772 HValue*, HValue*, StrictModeFlag); |
6749 | 6773 |
6750 HValue* object() { return OperandAt(0); } | 6774 HValue* object() { return OperandAt(0); } |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7411 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7435 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
7412 }; | 7436 }; |
7413 | 7437 |
7414 | 7438 |
7415 #undef DECLARE_INSTRUCTION | 7439 #undef DECLARE_INSTRUCTION |
7416 #undef DECLARE_CONCRETE_INSTRUCTION | 7440 #undef DECLARE_CONCRETE_INSTRUCTION |
7417 | 7441 |
7418 } } // namespace v8::internal | 7442 } } // namespace v8::internal |
7419 | 7443 |
7420 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7444 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |