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

Side by Side Diff: src/hydrogen-instructions.h

Issue 898723002: Use weak cell to embed property cell in StoreGlobal. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add comment about weak cells in FindAndReplace Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_
6 #define V8_HYDROGEN_INSTRUCTIONS_H_ 6 #define V8_HYDROGEN_INSTRUCTIONS_H_
7 7
8 #include <cstring> 8 #include <cstring>
9 #include <iosfwd> 9 #include <iosfwd>
10 10
(...skipping 6951 matching lines...) Expand 10 before | Expand all | Expand 10 after
6962 } 6962 }
6963 } 6963 }
6964 6964
6965 void SetTransition(HConstant* transition) { 6965 void SetTransition(HConstant* transition) {
6966 DCHECK(!has_transition()); // Only set once. 6966 DCHECK(!has_transition()); // Only set once.
6967 SetOperandAt(2, transition); 6967 SetOperandAt(2, transition);
6968 bit_field_ = HasTransitionField::update(bit_field_, true); 6968 bit_field_ = HasTransitionField::update(bit_field_, true);
6969 SetChangesFlag(kMaps); 6969 SetChangesFlag(kMaps);
6970 } 6970 }
6971 6971
6972 void MarkReceiverAsCell() {
6973 bit_field_ = ReceiverIsCellField::update(bit_field_, true);
6974 }
6975
6976 bool receiver_is_cell() const {
6977 return ReceiverIsCellField::decode(bit_field_);
6978 }
6979
6972 bool NeedsWriteBarrier() const { 6980 bool NeedsWriteBarrier() const {
6973 DCHECK(!field_representation().IsDouble() || 6981 DCHECK(!field_representation().IsDouble() ||
6974 (FLAG_unbox_double_fields && access_.IsInobject()) || 6982 (FLAG_unbox_double_fields && access_.IsInobject()) ||
6975 !has_transition()); 6983 !has_transition());
6976 if (field_representation().IsDouble()) return false; 6984 if (field_representation().IsDouble()) return false;
6977 if (field_representation().IsSmi()) return false; 6985 if (field_representation().IsSmi()) return false;
6978 if (field_representation().IsInteger32()) return false; 6986 if (field_representation().IsInteger32()) return false;
6979 if (field_representation().IsExternal()) return false; 6987 if (field_representation().IsExternal()) return false;
6988 if (receiver_is_cell()) return false;
6980 return StoringValueNeedsWriteBarrier(value()) && 6989 return StoringValueNeedsWriteBarrier(value()) &&
6981 ReceiverObjectNeedsWriteBarrier(object(), value(), dominator()); 6990 ReceiverObjectNeedsWriteBarrier(object(), value(), dominator());
6982 } 6991 }
6983 6992
6984 bool NeedsWriteBarrierForMap() { 6993 bool NeedsWriteBarrierForMap() {
6985 return ReceiverObjectNeedsWriteBarrier(object(), transition(), 6994 return ReceiverObjectNeedsWriteBarrier(object(), transition(),
6986 dominator()); 6995 dominator());
6987 } 6996 }
6988 6997
6989 SmiCheck SmiCheckForWriteBarrier() const { 6998 SmiCheck SmiCheckForWriteBarrier() const {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
7029 DCHECK(!access.IsInobject() || access.existing_inobject_property() || 7038 DCHECK(!access.IsInobject() || access.existing_inobject_property() ||
7030 obj->IsAllocate() || obj->IsInnerAllocatedObject()); 7039 obj->IsAllocate() || obj->IsInnerAllocatedObject());
7031 SetOperandAt(0, obj); 7040 SetOperandAt(0, obj);
7032 SetOperandAt(1, val); 7041 SetOperandAt(1, val);
7033 SetOperandAt(2, obj); 7042 SetOperandAt(2, obj);
7034 access.SetGVNFlags(this, STORE); 7043 access.SetGVNFlags(this, STORE);
7035 } 7044 }
7036 7045
7037 class HasTransitionField : public BitField<bool, 0, 1> {}; 7046 class HasTransitionField : public BitField<bool, 0, 1> {};
7038 class StoreModeField : public BitField<StoreFieldOrKeyedMode, 1, 1> {}; 7047 class StoreModeField : public BitField<StoreFieldOrKeyedMode, 1, 1> {};
7048 class ReceiverIsCellField : public BitField<bool, 2, 1> {};
7039 7049
7040 HObjectAccess access_; 7050 HObjectAccess access_;
7041 HValue* dominator_; 7051 HValue* dominator_;
7042 uint32_t bit_field_; 7052 uint32_t bit_field_;
7043 }; 7053 };
7044 7054
7045 7055
7046 class HStoreNamedGeneric FINAL : public HTemplateInstruction<3> { 7056 class HStoreNamedGeneric FINAL : public HTemplateInstruction<3> {
7047 public: 7057 public:
7048 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreNamedGeneric, HValue*, 7058 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreNamedGeneric, HValue*,
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after
7989 }; 7999 };
7990 8000
7991 8001
7992 8002
7993 #undef DECLARE_INSTRUCTION 8003 #undef DECLARE_INSTRUCTION
7994 #undef DECLARE_CONCRETE_INSTRUCTION 8004 #undef DECLARE_CONCRETE_INSTRUCTION
7995 8005
7996 } } // namespace v8::internal 8006 } } // namespace v8::internal
7997 8007
7998 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 8008 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698