Chromium Code Reviews| 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* js_function, | |
| 5157 HValue* code) { | |
| 5158 return new(zone) HStoreCodeEntry(js_function, code); | |
| 5159 } | |
| 5160 | |
| 5161 virtual Representation RequiredInputRepresentation(int index) { | |
| 5162 return Representation::Tagged(); | |
| 5163 } | |
| 5164 | |
| 5165 HValue* js_function() { return OperandAt(0); } | |
|
Michael Starzinger
2013/08/27 08:12:51
nit: s/js_function/function/ ... or ... s/js_funct
mvstanton
2013/08/27 09:23:04
Done.
| |
| 5166 HValue* code_object() { return OperandAt(1); } | |
| 5167 | |
| 5168 DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry) | |
| 5169 private: | |
|
Michael Starzinger
2013/08/27 08:12:51
nit: Empty new-line before the "private:" header.
mvstanton
2013/08/27 09:23:04
Done.
| |
| 5170 HStoreCodeEntry(HValue* js_function, HValue* code) { | |
| 5171 SetOperandAt(0, js_function); | |
| 5172 SetOperandAt(1, code); | |
| 5173 } | |
| 5174 }; | |
| 5175 | |
| 5176 | |
| 5177 class HInnerAllocatedObject V8_FINAL: public HTemplateInstruction<1> { | |
| 5152 public: | 5178 public: |
| 5153 static HInnerAllocatedObject* New(Zone* zone, | 5179 static HInnerAllocatedObject* New(Zone* zone, |
| 5154 HValue* context, | 5180 HValue* context, |
| 5155 HValue* value, | 5181 HValue* value, |
| 5156 int offset, | 5182 int offset, |
| 5157 HType type = HType::Tagged()) { | 5183 HType type = HType::Tagged()) { |
| 5158 return new(zone) HInnerAllocatedObject(value, offset, type); | 5184 return new(zone) HInnerAllocatedObject(value, offset, type); |
| 5159 } | 5185 } |
| 5160 | 5186 |
| 5161 HValue* base_object() { return OperandAt(0); } | 5187 HValue* base_object() { return OperandAt(0); } |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5450 | 5476 |
| 5451 static HObjectAccess ForHeapNumberValue() { | 5477 static HObjectAccess ForHeapNumberValue() { |
| 5452 return HObjectAccess( | 5478 return HObjectAccess( |
| 5453 kDouble, HeapNumber::kValueOffset, Representation::Double()); | 5479 kDouble, HeapNumber::kValueOffset, Representation::Double()); |
| 5454 } | 5480 } |
| 5455 | 5481 |
| 5456 static HObjectAccess ForElementsPointer() { | 5482 static HObjectAccess ForElementsPointer() { |
| 5457 return HObjectAccess(kElementsPointer, JSObject::kElementsOffset); | 5483 return HObjectAccess(kElementsPointer, JSObject::kElementsOffset); |
| 5458 } | 5484 } |
| 5459 | 5485 |
| 5486 static HObjectAccess ForLiteralsPointer() { | |
| 5487 return HObjectAccess(kInobject, JSFunction::kLiteralsOffset); | |
| 5488 } | |
| 5489 | |
| 5490 static HObjectAccess ForNextFunctionLinkPointer() { | |
| 5491 return HObjectAccess(kInobject, JSFunction::kNextFunctionLinkOffset); | |
| 5492 } | |
| 5493 | |
| 5460 static HObjectAccess ForArrayLength(ElementsKind elements_kind) { | 5494 static HObjectAccess ForArrayLength(ElementsKind elements_kind) { |
| 5461 return HObjectAccess( | 5495 return HObjectAccess( |
| 5462 kArrayLengths, | 5496 kArrayLengths, |
| 5463 JSArray::kLengthOffset, | 5497 JSArray::kLengthOffset, |
| 5464 IsFastElementsKind(elements_kind) && | 5498 IsFastElementsKind(elements_kind) && |
| 5465 FLAG_track_fields | 5499 FLAG_track_fields |
| 5466 ? Representation::Smi() : Representation::Tagged()); | 5500 ? Representation::Smi() : Representation::Tagged()); |
| 5467 } | 5501 } |
| 5468 | 5502 |
| 5469 static HObjectAccess ForAllocationSiteTransitionInfo() { | 5503 static HObjectAccess ForAllocationSiteTransitionInfo() { |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 5494 } | 5528 } |
| 5495 | 5529 |
| 5496 static HObjectAccess ForPropertiesPointer() { | 5530 static HObjectAccess ForPropertiesPointer() { |
| 5497 return HObjectAccess(kInobject, JSObject::kPropertiesOffset); | 5531 return HObjectAccess(kInobject, JSObject::kPropertiesOffset); |
| 5498 } | 5532 } |
| 5499 | 5533 |
| 5500 static HObjectAccess ForPrototypeOrInitialMap() { | 5534 static HObjectAccess ForPrototypeOrInitialMap() { |
| 5501 return HObjectAccess(kInobject, JSFunction::kPrototypeOrInitialMapOffset); | 5535 return HObjectAccess(kInobject, JSFunction::kPrototypeOrInitialMapOffset); |
| 5502 } | 5536 } |
| 5503 | 5537 |
| 5538 static HObjectAccess ForSharedFunctionInfoPointer() { | |
| 5539 return HObjectAccess(kInobject, JSFunction::kSharedFunctionInfoOffset); | |
| 5540 } | |
| 5541 | |
| 5542 static HObjectAccess ForCodeEntryPointer() { | |
| 5543 return HObjectAccess(kInobject, JSFunction::kCodeEntryOffset); | |
| 5544 } | |
| 5545 | |
| 5546 static HObjectAccess ForCodeOffset() { | |
| 5547 return HObjectAccess(kInobject, SharedFunctionInfo::kCodeOffset); | |
| 5548 } | |
| 5549 | |
| 5550 static HObjectAccess ForFirstCodeSlot() { | |
| 5551 return HObjectAccess(kInobject, SharedFunctionInfo::kFirstCodeSlot); | |
| 5552 } | |
| 5553 | |
| 5554 static HObjectAccess ForFirstContextSlot() { | |
| 5555 return HObjectAccess(kInobject, SharedFunctionInfo::kFirstContextSlot); | |
| 5556 } | |
| 5557 | |
| 5558 static HObjectAccess ForOptimizedCodeMap() { | |
| 5559 return HObjectAccess(kInobject, | |
| 5560 SharedFunctionInfo::kOptimizedCodeMapOffset); | |
| 5561 } | |
| 5562 | |
| 5563 static HObjectAccess ForFunctionContextPointer() { | |
| 5564 return HObjectAccess(kInobject, JSFunction::kContextOffset); | |
| 5565 } | |
| 5566 | |
| 5504 static HObjectAccess ForMap() { | 5567 static HObjectAccess ForMap() { |
| 5505 return HObjectAccess(kMaps, JSObject::kMapOffset); | 5568 return HObjectAccess(kMaps, JSObject::kMapOffset); |
| 5506 } | 5569 } |
| 5507 | 5570 |
| 5508 static HObjectAccess ForPropertyCellValue() { | 5571 static HObjectAccess ForPropertyCellValue() { |
| 5509 return HObjectAccess(kInobject, PropertyCell::kValueOffset); | 5572 return HObjectAccess(kInobject, PropertyCell::kValueOffset); |
| 5510 } | 5573 } |
| 5511 | 5574 |
| 5512 static HObjectAccess ForCellValue() { | 5575 static HObjectAccess ForCellValue() { |
| 5513 return HObjectAccess(kInobject, Cell::kValueOffset); | 5576 return HObjectAccess(kInobject, Cell::kValueOffset); |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 5524 // Create an access to an offset in a fixed array header. | 5587 // Create an access to an offset in a fixed array header. |
| 5525 static HObjectAccess ForFixedArrayHeader(int offset); | 5588 static HObjectAccess ForFixedArrayHeader(int offset); |
| 5526 | 5589 |
| 5527 // Create an access to an in-object property in a JSObject. | 5590 // Create an access to an in-object property in a JSObject. |
| 5528 static HObjectAccess ForJSObjectOffset(int offset, | 5591 static HObjectAccess ForJSObjectOffset(int offset, |
| 5529 Representation representation = Representation::Tagged()); | 5592 Representation representation = Representation::Tagged()); |
| 5530 | 5593 |
| 5531 // Create an access to an in-object property in a JSArray. | 5594 // Create an access to an in-object property in a JSArray. |
| 5532 static HObjectAccess ForJSArrayOffset(int offset); | 5595 static HObjectAccess ForJSArrayOffset(int offset); |
| 5533 | 5596 |
| 5597 static HObjectAccess ForContextSlot(int index); | |
| 5598 | |
| 5534 // Create an access to the backing store of an object. | 5599 // Create an access to the backing store of an object. |
| 5535 static HObjectAccess ForBackingStoreOffset(int offset, | 5600 static HObjectAccess ForBackingStoreOffset(int offset, |
| 5536 Representation representation = Representation::Tagged()); | 5601 Representation representation = Representation::Tagged()); |
| 5537 | 5602 |
| 5538 // Create an access to a resolved field (in-object or backing store). | 5603 // Create an access to a resolved field (in-object or backing store). |
| 5539 static HObjectAccess ForField(Handle<Map> map, | 5604 static HObjectAccess ForField(Handle<Map> map, |
| 5540 LookupResult *lookup, Handle<String> name = Handle<String>::null()); | 5605 LookupResult *lookup, Handle<String> name = Handle<String>::null()); |
| 5541 | 5606 |
| 5542 // Create an access for the payload of a Cell or JSGlobalPropertyCell. | 5607 // Create an access for the payload of a Cell or JSGlobalPropertyCell. |
| 5543 static HObjectAccess ForCellPayload(Isolate* isolate); | 5608 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; } | 6857 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
| 6793 }; | 6858 }; |
| 6794 | 6859 |
| 6795 | 6860 |
| 6796 #undef DECLARE_INSTRUCTION | 6861 #undef DECLARE_INSTRUCTION |
| 6797 #undef DECLARE_CONCRETE_INSTRUCTION | 6862 #undef DECLARE_CONCRETE_INSTRUCTION |
| 6798 | 6863 |
| 6799 } } // namespace v8::internal | 6864 } } // namespace v8::internal |
| 6800 | 6865 |
| 6801 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6866 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |