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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 V(Sar) \ | 164 V(Sar) \ |
165 V(SeqStringSetChar) \ | 165 V(SeqStringSetChar) \ |
166 V(Shl) \ | 166 V(Shl) \ |
167 V(Shr) \ | 167 V(Shr) \ |
168 V(Simulate) \ | 168 V(Simulate) \ |
169 V(SoftDeoptimize) \ | 169 V(SoftDeoptimize) \ |
170 V(StackCheck) \ | 170 V(StackCheck) \ |
171 V(StoreContextSlot) \ | 171 V(StoreContextSlot) \ |
172 V(StoreGlobalCell) \ | 172 V(StoreGlobalCell) \ |
173 V(StoreGlobalGeneric) \ | 173 V(StoreGlobalGeneric) \ |
174 V(SubAllocatedObject) \ | |
Hannes Payer (out of office)
2013/03/13 08:48:39
alphabetic order.
mvstanton
2013/03/13 10:14:40
Done.
| |
174 V(StoreKeyed) \ | 175 V(StoreKeyed) \ |
175 V(StoreKeyedGeneric) \ | 176 V(StoreKeyedGeneric) \ |
176 V(StoreNamedField) \ | 177 V(StoreNamedField) \ |
177 V(StoreNamedGeneric) \ | 178 V(StoreNamedGeneric) \ |
178 V(StringAdd) \ | 179 V(StringAdd) \ |
179 V(StringCharCodeAt) \ | 180 V(StringCharCodeAt) \ |
180 V(StringCharFromCode) \ | 181 V(StringCharFromCode) \ |
181 V(StringCompareAndBranch) \ | 182 V(StringCompareAndBranch) \ |
182 V(StringLength) \ | 183 V(StringLength) \ |
183 V(Sub) \ | 184 V(Sub) \ |
(...skipping 4500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4684 }; | 4685 }; |
4685 | 4686 |
4686 | 4687 |
4687 inline bool StoringValueNeedsWriteBarrier(HValue* value) { | 4688 inline bool StoringValueNeedsWriteBarrier(HValue* value) { |
4688 return !value->type().IsBoolean() | 4689 return !value->type().IsBoolean() |
4689 && !value->type().IsSmi() | 4690 && !value->type().IsSmi() |
4690 && !(value->IsConstant() && HConstant::cast(value)->ImmortalImmovable()); | 4691 && !(value->IsConstant() && HConstant::cast(value)->ImmortalImmovable()); |
4691 } | 4692 } |
4692 | 4693 |
4693 | 4694 |
4694 inline bool ReceiverObjectNeedsWriteBarrier(HValue* object, | |
4695 HValue* new_space_dominator) { | |
4696 if (object != new_space_dominator) return true; | |
4697 if (object->IsFastLiteral()) return false; | |
4698 if (object->IsAllocateObject()) return false; | |
4699 if (object->IsAllocate()) { | |
4700 return !HAllocate::cast(object)->GuaranteedInNewSpace(); | |
4701 } | |
4702 return true; | |
4703 } | |
4704 | |
4705 | |
4706 class HStoreGlobalCell: public HUnaryOperation { | 4695 class HStoreGlobalCell: public HUnaryOperation { |
4707 public: | 4696 public: |
4708 HStoreGlobalCell(HValue* value, | 4697 HStoreGlobalCell(HValue* value, |
4709 Handle<JSGlobalPropertyCell> cell, | 4698 Handle<JSGlobalPropertyCell> cell, |
4710 PropertyDetails details) | 4699 PropertyDetails details) |
4711 : HUnaryOperation(value), | 4700 : HUnaryOperation(value), |
4712 cell_(cell), | 4701 cell_(cell), |
4713 details_(details) { | 4702 details_(details) { |
4714 SetGVNFlag(kChangesGlobalVars); | 4703 SetGVNFlag(kChangesGlobalVars); |
4715 } | 4704 } |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5208 // tagged[tagged] | 5197 // tagged[tagged] |
5209 return Representation::Tagged(); | 5198 return Representation::Tagged(); |
5210 } | 5199 } |
5211 | 5200 |
5212 virtual HValue* Canonicalize(); | 5201 virtual HValue* Canonicalize(); |
5213 | 5202 |
5214 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric) | 5203 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric) |
5215 }; | 5204 }; |
5216 | 5205 |
5217 | 5206 |
5207 bool ReceiverObjectNeedsWriteBarrier(HValue* object, | |
5208 HValue* new_space_dominator); | |
5209 | |
Hannes Payer (out of office)
2013/03/13 08:48:39
Can you move code around that you do not need this
mvstanton
2013/03/13 10:14:40
That is much better, thx...I was lazy :).
| |
5210 | |
5218 class HStoreNamedField: public HTemplateInstruction<2> { | 5211 class HStoreNamedField: public HTemplateInstruction<2> { |
5219 public: | 5212 public: |
5220 HStoreNamedField(HValue* obj, | 5213 HStoreNamedField(HValue* obj, |
5221 Handle<String> name, | 5214 Handle<String> name, |
5222 HValue* val, | 5215 HValue* val, |
5223 bool in_object, | 5216 bool in_object, |
5224 int offset) | 5217 int offset) |
5225 : name_(name), | 5218 : name_(name), |
5226 is_in_object_(in_object), | 5219 is_in_object_(in_object), |
5227 offset_(offset), | 5220 offset_(offset), |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5304 } | 5297 } |
5305 | 5298 |
5306 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric) | 5299 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric) |
5307 | 5300 |
5308 private: | 5301 private: |
5309 Handle<String> name_; | 5302 Handle<String> name_; |
5310 StrictModeFlag strict_mode_flag_; | 5303 StrictModeFlag strict_mode_flag_; |
5311 }; | 5304 }; |
5312 | 5305 |
5313 | 5306 |
5307 class HSubAllocatedObject: public HTemplateInstruction<1> { | |
5308 public: | |
5309 HSubAllocatedObject(HValue* value, int offset) | |
5310 : offset_(offset) { | |
5311 ASSERT(value->IsAllocate()); | |
5312 SetOperandAt(0, value); | |
5313 set_representation(Representation::Tagged()); | |
5314 } | |
5315 | |
5316 HValue* base_object() { return OperandAt(0); } | |
5317 int offset() { return offset_; } | |
5318 | |
5319 virtual Representation RequiredInputRepresentation(int index) { | |
5320 return Representation::Tagged(); | |
5321 } | |
5322 | |
5323 virtual void PrintDataTo(StringStream* stream); | |
5324 | |
5325 DECLARE_CONCRETE_INSTRUCTION(SubAllocatedObject) | |
Michael Starzinger
2013/03/13 09:12:35
Empty newline before the "private:" block.
mvstanton
2013/03/13 10:14:40
Done.
| |
5326 private: | |
5327 int offset_; | |
5328 }; | |
5329 | |
5330 | |
5331 inline bool ReceiverObjectNeedsWriteBarrier(HValue* object, | |
5332 HValue* new_space_dominator) { | |
5333 if (object->IsSubAllocatedObject()) { | |
5334 return ReceiverObjectNeedsWriteBarrier( | |
5335 HSubAllocatedObject::cast(object)->base_object(), | |
5336 new_space_dominator); | |
5337 } | |
5338 if (object != new_space_dominator) return true; | |
5339 if (object->IsFastLiteral()) return false; | |
5340 if (object->IsAllocateObject()) return false; | |
5341 if (object->IsAllocate()) { | |
5342 return !HAllocate::cast(object)->GuaranteedInNewSpace(); | |
5343 } | |
5344 return true; | |
5345 } | |
5346 | |
5347 | |
5314 class HStoreKeyed | 5348 class HStoreKeyed |
5315 : public HTemplateInstruction<3>, public ArrayInstructionInterface { | 5349 : public HTemplateInstruction<3>, public ArrayInstructionInterface { |
5316 public: | 5350 public: |
5317 HStoreKeyed(HValue* obj, HValue* key, HValue* val, | 5351 HStoreKeyed(HValue* obj, HValue* key, HValue* val, |
5318 ElementsKind elements_kind) | 5352 ElementsKind elements_kind) |
5319 : elements_kind_(elements_kind), | 5353 : elements_kind_(elements_kind), |
5320 index_offset_(0), | 5354 index_offset_(0), |
5321 is_dehoisted_(false), | 5355 is_dehoisted_(false), |
5322 new_space_dominator_(NULL) { | 5356 new_space_dominator_(NULL) { |
5323 SetOperandAt(0, obj); | 5357 SetOperandAt(0, obj); |
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6167 virtual bool IsDeletable() const { return true; } | 6201 virtual bool IsDeletable() const { return true; } |
6168 }; | 6202 }; |
6169 | 6203 |
6170 | 6204 |
6171 #undef DECLARE_INSTRUCTION | 6205 #undef DECLARE_INSTRUCTION |
6172 #undef DECLARE_CONCRETE_INSTRUCTION | 6206 #undef DECLARE_CONCRETE_INSTRUCTION |
6173 | 6207 |
6174 } } // namespace v8::internal | 6208 } } // namespace v8::internal |
6175 | 6209 |
6176 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6210 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |