OLD | NEW |
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 5688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5699 && !(value->IsConstant() && HConstant::cast(value)->ImmortalImmovable()); | 5699 && !(value->IsConstant() && HConstant::cast(value)->ImmortalImmovable()); |
5700 } | 5700 } |
5701 | 5701 |
5702 | 5702 |
5703 inline bool ReceiverObjectNeedsWriteBarrier(HValue* object, | 5703 inline bool ReceiverObjectNeedsWriteBarrier(HValue* object, |
5704 HValue* value, | 5704 HValue* value, |
5705 HValue* dominator) { | 5705 HValue* dominator) { |
5706 while (object->IsInnerAllocatedObject()) { | 5706 while (object->IsInnerAllocatedObject()) { |
5707 object = HInnerAllocatedObject::cast(object)->base_object(); | 5707 object = HInnerAllocatedObject::cast(object)->base_object(); |
5708 } | 5708 } |
5709 if (object->IsConstant() && HConstant::cast(object)->IsCell()) { | |
5710 return false; | |
5711 } | |
5712 if (object->IsConstant() && | 5709 if (object->IsConstant() && |
5713 HConstant::cast(object)->HasExternalReferenceValue()) { | 5710 HConstant::cast(object)->HasExternalReferenceValue()) { |
5714 // Stores to external references require no write barriers | 5711 // Stores to external references require no write barriers |
5715 return false; | 5712 return false; |
5716 } | 5713 } |
5717 // We definitely need a write barrier unless the object is the allocation | 5714 // We definitely need a write barrier unless the object is the allocation |
5718 // dominator. | 5715 // dominator. |
5719 if (object == dominator && object->IsAllocate()) { | 5716 if (object == dominator && object->IsAllocate()) { |
5720 // Stores to new space allocations require no write barriers. | 5717 // Stores to new space allocations require no write barriers. |
5721 if (HAllocate::cast(object)->IsNewSpaceAllocation()) { | 5718 if (HAllocate::cast(object)->IsNewSpaceAllocation()) { |
(...skipping 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7876 }; | 7873 }; |
7877 | 7874 |
7878 | 7875 |
7879 | 7876 |
7880 #undef DECLARE_INSTRUCTION | 7877 #undef DECLARE_INSTRUCTION |
7881 #undef DECLARE_CONCRETE_INSTRUCTION | 7878 #undef DECLARE_CONCRETE_INSTRUCTION |
7882 | 7879 |
7883 } } // namespace v8::internal | 7880 } } // namespace v8::internal |
7884 | 7881 |
7885 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7882 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |