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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 V(Random) \ | 157 V(Random) \ |
158 V(RegExpLiteral) \ | 158 V(RegExpLiteral) \ |
159 V(Return) \ | 159 V(Return) \ |
160 V(Ror) \ | 160 V(Ror) \ |
161 V(Sar) \ | 161 V(Sar) \ |
162 V(SeqStringSetChar) \ | 162 V(SeqStringSetChar) \ |
163 V(Shl) \ | 163 V(Shl) \ |
164 V(Shr) \ | 164 V(Shr) \ |
165 V(Simulate) \ | 165 V(Simulate) \ |
166 V(StackCheck) \ | 166 V(StackCheck) \ |
| 167 V(StoreCodeEntry) \ |
167 V(StoreContextSlot) \ | 168 V(StoreContextSlot) \ |
168 V(StoreGlobalCell) \ | 169 V(StoreGlobalCell) \ |
169 V(StoreGlobalGeneric) \ | 170 V(StoreGlobalGeneric) \ |
170 V(StoreKeyed) \ | 171 V(StoreKeyed) \ |
171 V(StoreKeyedGeneric) \ | 172 V(StoreKeyedGeneric) \ |
172 V(StoreNamedField) \ | 173 V(StoreNamedField) \ |
173 V(StoreNamedGeneric) \ | 174 V(StoreNamedGeneric) \ |
174 V(StringAdd) \ | 175 V(StringAdd) \ |
175 V(StringCharCodeAt) \ | 176 V(StringCharCodeAt) \ |
176 V(StringCharFromCode) \ | 177 V(StringCharFromCode) \ |
(...skipping 4964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5141 flags_ = static_cast<HAllocate::Flags>(flags_ | | 5142 flags_ = static_cast<HAllocate::Flags>(flags_ | |
5142 ALLOCATE_DOUBLE_ALIGNED); | 5143 ALLOCATE_DOUBLE_ALIGNED); |
5143 } | 5144 } |
5144 } | 5145 } |
5145 | 5146 |
5146 Flags flags_; | 5147 Flags flags_; |
5147 Handle<Map> known_initial_map_; | 5148 Handle<Map> known_initial_map_; |
5148 }; | 5149 }; |
5149 | 5150 |
5150 | 5151 |
5151 class HInnerAllocatedObject V8_FINAL : public HTemplateInstruction<1> { | 5152 class HStoreCodeEntry V8_FINAL: public HTemplateInstruction<2> { |
| 5153 public: |
| 5154 static HStoreCodeEntry* New(Zone* zone, |
| 5155 HValue* context, |
| 5156 HValue* function, |
| 5157 HValue* code) { |
| 5158 return new(zone) HStoreCodeEntry(function, code); |
| 5159 } |
| 5160 |
| 5161 virtual Representation RequiredInputRepresentation(int index) { |
| 5162 return Representation::Tagged(); |
| 5163 } |
| 5164 |
| 5165 HValue* function() { return OperandAt(0); } |
| 5166 HValue* code_object() { return OperandAt(1); } |
| 5167 |
| 5168 DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry) |
| 5169 |
| 5170 private: |
| 5171 HStoreCodeEntry(HValue* function, HValue* code) { |
| 5172 SetOperandAt(0, function); |
| 5173 SetOperandAt(1, code); |
| 5174 } |
| 5175 }; |
| 5176 |
| 5177 |
| 5178 class HInnerAllocatedObject V8_FINAL: public HTemplateInstruction<1> { |
5152 public: | 5179 public: |
5153 static HInnerAllocatedObject* New(Zone* zone, | 5180 static HInnerAllocatedObject* New(Zone* zone, |
5154 HValue* context, | 5181 HValue* context, |
5155 HValue* value, | 5182 HValue* value, |
5156 int offset, | 5183 int offset, |
5157 HType type = HType::Tagged()) { | 5184 HType type = HType::Tagged()) { |
5158 return new(zone) HInnerAllocatedObject(value, offset, type); | 5185 return new(zone) HInnerAllocatedObject(value, offset, type); |
5159 } | 5186 } |
5160 | 5187 |
5161 HValue* base_object() { return OperandAt(0); } | 5188 HValue* base_object() { return OperandAt(0); } |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5450 | 5477 |
5451 static HObjectAccess ForHeapNumberValue() { | 5478 static HObjectAccess ForHeapNumberValue() { |
5452 return HObjectAccess( | 5479 return HObjectAccess( |
5453 kDouble, HeapNumber::kValueOffset, Representation::Double()); | 5480 kDouble, HeapNumber::kValueOffset, Representation::Double()); |
5454 } | 5481 } |
5455 | 5482 |
5456 static HObjectAccess ForElementsPointer() { | 5483 static HObjectAccess ForElementsPointer() { |
5457 return HObjectAccess(kElementsPointer, JSObject::kElementsOffset); | 5484 return HObjectAccess(kElementsPointer, JSObject::kElementsOffset); |
5458 } | 5485 } |
5459 | 5486 |
| 5487 static HObjectAccess ForLiteralsPointer() { |
| 5488 return HObjectAccess(kInobject, JSFunction::kLiteralsOffset); |
| 5489 } |
| 5490 |
| 5491 static HObjectAccess ForNextFunctionLinkPointer() { |
| 5492 return HObjectAccess(kInobject, JSFunction::kNextFunctionLinkOffset); |
| 5493 } |
| 5494 |
5460 static HObjectAccess ForArrayLength(ElementsKind elements_kind) { | 5495 static HObjectAccess ForArrayLength(ElementsKind elements_kind) { |
5461 return HObjectAccess( | 5496 return HObjectAccess( |
5462 kArrayLengths, | 5497 kArrayLengths, |
5463 JSArray::kLengthOffset, | 5498 JSArray::kLengthOffset, |
5464 IsFastElementsKind(elements_kind) && | 5499 IsFastElementsKind(elements_kind) && |
5465 FLAG_track_fields | 5500 FLAG_track_fields |
5466 ? Representation::Smi() : Representation::Tagged()); | 5501 ? Representation::Smi() : Representation::Tagged()); |
5467 } | 5502 } |
5468 | 5503 |
5469 static HObjectAccess ForAllocationSiteTransitionInfo() { | 5504 static HObjectAccess ForAllocationSiteTransitionInfo() { |
(...skipping 24 matching lines...) Expand all Loading... |
5494 } | 5529 } |
5495 | 5530 |
5496 static HObjectAccess ForPropertiesPointer() { | 5531 static HObjectAccess ForPropertiesPointer() { |
5497 return HObjectAccess(kInobject, JSObject::kPropertiesOffset); | 5532 return HObjectAccess(kInobject, JSObject::kPropertiesOffset); |
5498 } | 5533 } |
5499 | 5534 |
5500 static HObjectAccess ForPrototypeOrInitialMap() { | 5535 static HObjectAccess ForPrototypeOrInitialMap() { |
5501 return HObjectAccess(kInobject, JSFunction::kPrototypeOrInitialMapOffset); | 5536 return HObjectAccess(kInobject, JSFunction::kPrototypeOrInitialMapOffset); |
5502 } | 5537 } |
5503 | 5538 |
| 5539 static HObjectAccess ForSharedFunctionInfoPointer() { |
| 5540 return HObjectAccess(kInobject, JSFunction::kSharedFunctionInfoOffset); |
| 5541 } |
| 5542 |
| 5543 static HObjectAccess ForCodeEntryPointer() { |
| 5544 return HObjectAccess(kInobject, JSFunction::kCodeEntryOffset); |
| 5545 } |
| 5546 |
| 5547 static HObjectAccess ForCodeOffset() { |
| 5548 return HObjectAccess(kInobject, SharedFunctionInfo::kCodeOffset); |
| 5549 } |
| 5550 |
| 5551 static HObjectAccess ForFirstCodeSlot() { |
| 5552 return HObjectAccess(kInobject, SharedFunctionInfo::kFirstCodeSlot); |
| 5553 } |
| 5554 |
| 5555 static HObjectAccess ForFirstContextSlot() { |
| 5556 return HObjectAccess(kInobject, SharedFunctionInfo::kFirstContextSlot); |
| 5557 } |
| 5558 |
| 5559 static HObjectAccess ForOptimizedCodeMap() { |
| 5560 return HObjectAccess(kInobject, |
| 5561 SharedFunctionInfo::kOptimizedCodeMapOffset); |
| 5562 } |
| 5563 |
| 5564 static HObjectAccess ForFunctionContextPointer() { |
| 5565 return HObjectAccess(kInobject, JSFunction::kContextOffset); |
| 5566 } |
| 5567 |
5504 static HObjectAccess ForMap() { | 5568 static HObjectAccess ForMap() { |
5505 return HObjectAccess(kMaps, JSObject::kMapOffset); | 5569 return HObjectAccess(kMaps, JSObject::kMapOffset); |
5506 } | 5570 } |
5507 | 5571 |
5508 static HObjectAccess ForPropertyCellValue() { | 5572 static HObjectAccess ForPropertyCellValue() { |
5509 return HObjectAccess(kInobject, PropertyCell::kValueOffset); | 5573 return HObjectAccess(kInobject, PropertyCell::kValueOffset); |
5510 } | 5574 } |
5511 | 5575 |
5512 static HObjectAccess ForCellValue() { | 5576 static HObjectAccess ForCellValue() { |
5513 return HObjectAccess(kInobject, Cell::kValueOffset); | 5577 return HObjectAccess(kInobject, Cell::kValueOffset); |
(...skipping 10 matching lines...) Expand all Loading... |
5524 // Create an access to an offset in a fixed array header. | 5588 // Create an access to an offset in a fixed array header. |
5525 static HObjectAccess ForFixedArrayHeader(int offset); | 5589 static HObjectAccess ForFixedArrayHeader(int offset); |
5526 | 5590 |
5527 // Create an access to an in-object property in a JSObject. | 5591 // Create an access to an in-object property in a JSObject. |
5528 static HObjectAccess ForJSObjectOffset(int offset, | 5592 static HObjectAccess ForJSObjectOffset(int offset, |
5529 Representation representation = Representation::Tagged()); | 5593 Representation representation = Representation::Tagged()); |
5530 | 5594 |
5531 // Create an access to an in-object property in a JSArray. | 5595 // Create an access to an in-object property in a JSArray. |
5532 static HObjectAccess ForJSArrayOffset(int offset); | 5596 static HObjectAccess ForJSArrayOffset(int offset); |
5533 | 5597 |
| 5598 static HObjectAccess ForContextSlot(int index); |
| 5599 |
5534 // Create an access to the backing store of an object. | 5600 // Create an access to the backing store of an object. |
5535 static HObjectAccess ForBackingStoreOffset(int offset, | 5601 static HObjectAccess ForBackingStoreOffset(int offset, |
5536 Representation representation = Representation::Tagged()); | 5602 Representation representation = Representation::Tagged()); |
5537 | 5603 |
5538 // Create an access to a resolved field (in-object or backing store). | 5604 // Create an access to a resolved field (in-object or backing store). |
5539 static HObjectAccess ForField(Handle<Map> map, | 5605 static HObjectAccess ForField(Handle<Map> map, |
5540 LookupResult *lookup, Handle<String> name = Handle<String>::null()); | 5606 LookupResult *lookup, Handle<String> name = Handle<String>::null()); |
5541 | 5607 |
5542 // Create an access for the payload of a Cell or JSGlobalPropertyCell. | 5608 // Create an access for the payload of a Cell or JSGlobalPropertyCell. |
5543 static HObjectAccess ForCellPayload(Isolate* isolate); | 5609 static HObjectAccess ForCellPayload(Isolate* isolate); |
(...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6792 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 6858 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
6793 }; | 6859 }; |
6794 | 6860 |
6795 | 6861 |
6796 #undef DECLARE_INSTRUCTION | 6862 #undef DECLARE_INSTRUCTION |
6797 #undef DECLARE_CONCRETE_INSTRUCTION | 6863 #undef DECLARE_CONCRETE_INSTRUCTION |
6798 | 6864 |
6799 } } // namespace v8::internal | 6865 } } // namespace v8::internal |
6800 | 6866 |
6801 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6867 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |