OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // HUnaryControlInstruction | 100 // HUnaryControlInstruction |
101 // HBranch | 101 // HBranch |
102 // HCompareMapAndBranch | 102 // HCompareMapAndBranch |
103 // HReturn | 103 // HReturn |
104 // HThrow | 104 // HThrow |
105 // HEnterInlined | 105 // HEnterInlined |
106 // HFunctionLiteral | 106 // HFunctionLiteral |
107 // HGlobalObject | 107 // HGlobalObject |
108 // HGlobalReceiver | 108 // HGlobalReceiver |
109 // HLeaveInlined | 109 // HLeaveInlined |
| 110 // HLoadContextSlot |
110 // HLoadGlobal | 111 // HLoadGlobal |
111 // HMaterializedLiteral | 112 // HMaterializedLiteral |
112 // HArrayLiteral | 113 // HArrayLiteral |
113 // HObjectLiteral | 114 // HObjectLiteral |
114 // HRegExpLiteral | 115 // HRegExpLiteral |
115 // HOsrEntry | 116 // HOsrEntry |
116 // HParameter | 117 // HParameter |
117 // HSimulate | 118 // HSimulate |
118 // HStackCheck | 119 // HStackCheck |
119 // HStoreKeyed | 120 // HStoreKeyed |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 V(InstanceOf) \ | 214 V(InstanceOf) \ |
214 V(InstanceOfKnownGlobal) \ | 215 V(InstanceOfKnownGlobal) \ |
215 V(IsNull) \ | 216 V(IsNull) \ |
216 V(IsObject) \ | 217 V(IsObject) \ |
217 V(IsSmi) \ | 218 V(IsSmi) \ |
218 V(HasInstanceType) \ | 219 V(HasInstanceType) \ |
219 V(HasCachedArrayIndex) \ | 220 V(HasCachedArrayIndex) \ |
220 V(JSArrayLength) \ | 221 V(JSArrayLength) \ |
221 V(ClassOfTest) \ | 222 V(ClassOfTest) \ |
222 V(LeaveInlined) \ | 223 V(LeaveInlined) \ |
| 224 V(LoadContextSlot) \ |
223 V(LoadElements) \ | 225 V(LoadElements) \ |
224 V(LoadGlobal) \ | 226 V(LoadGlobal) \ |
225 V(LoadKeyedFastElement) \ | 227 V(LoadKeyedFastElement) \ |
226 V(LoadKeyedGeneric) \ | 228 V(LoadKeyedGeneric) \ |
227 V(LoadNamedField) \ | 229 V(LoadNamedField) \ |
228 V(LoadNamedGeneric) \ | 230 V(LoadNamedGeneric) \ |
229 V(LoadFunctionPrototype) \ | 231 V(LoadFunctionPrototype) \ |
230 V(Mod) \ | 232 V(Mod) \ |
231 V(Mul) \ | 233 V(Mul) \ |
232 V(ObjectLiteral) \ | 234 V(ObjectLiteral) \ |
(...skipping 2359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2592 virtual bool DataEquals(HValue* other) const { | 2594 virtual bool DataEquals(HValue* other) const { |
2593 HStoreGlobal* b = HStoreGlobal::cast(other); | 2595 HStoreGlobal* b = HStoreGlobal::cast(other); |
2594 return cell_.is_identical_to(b->cell()); | 2596 return cell_.is_identical_to(b->cell()); |
2595 } | 2597 } |
2596 | 2598 |
2597 private: | 2599 private: |
2598 Handle<JSGlobalPropertyCell> cell_; | 2600 Handle<JSGlobalPropertyCell> cell_; |
2599 }; | 2601 }; |
2600 | 2602 |
2601 | 2603 |
| 2604 class HLoadContextSlot: public HInstruction { |
| 2605 public: |
| 2606 HLoadContextSlot(int context_chain_length , int slot_index) |
| 2607 : context_chain_length_(context_chain_length), slot_index_(slot_index) { |
| 2608 set_representation(Representation::Tagged()); |
| 2609 SetFlag(kUseGVN); |
| 2610 SetFlag(kDependsOnCalls); |
| 2611 } |
| 2612 |
| 2613 int context_chain_length() const { return context_chain_length_; } |
| 2614 int slot_index() const { return slot_index_; } |
| 2615 |
| 2616 virtual void PrintDataTo(StringStream* stream) const; |
| 2617 |
| 2618 virtual intptr_t Hashcode() const { |
| 2619 return context_chain_length() * 29 + slot_index(); |
| 2620 } |
| 2621 |
| 2622 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load_context_slot") |
| 2623 |
| 2624 protected: |
| 2625 virtual bool DataEquals(HValue* other) const { |
| 2626 HLoadContextSlot* b = HLoadContextSlot::cast(other); |
| 2627 return (context_chain_length() == b->context_chain_length()) |
| 2628 && (slot_index() == b->slot_index()); |
| 2629 } |
| 2630 |
| 2631 private: |
| 2632 int context_chain_length_; |
| 2633 int slot_index_; |
| 2634 }; |
| 2635 |
| 2636 |
2602 class HLoadNamedField: public HUnaryOperation { | 2637 class HLoadNamedField: public HUnaryOperation { |
2603 public: | 2638 public: |
2604 HLoadNamedField(HValue* object, bool is_in_object, int offset) | 2639 HLoadNamedField(HValue* object, bool is_in_object, int offset) |
2605 : HUnaryOperation(object), | 2640 : HUnaryOperation(object), |
2606 is_in_object_(is_in_object), | 2641 is_in_object_(is_in_object), |
2607 offset_(offset) { | 2642 offset_(offset) { |
2608 set_representation(Representation::Tagged()); | 2643 set_representation(Representation::Tagged()); |
2609 SetFlag(kUseGVN); | 2644 SetFlag(kUseGVN); |
2610 if (is_in_object) { | 2645 if (is_in_object) { |
2611 SetFlag(kDependsOnInobjectFields); | 2646 SetFlag(kDependsOnInobjectFields); |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3023 HValue* object() const { return left(); } | 3058 HValue* object() const { return left(); } |
3024 HValue* key() const { return right(); } | 3059 HValue* key() const { return right(); } |
3025 }; | 3060 }; |
3026 | 3061 |
3027 #undef DECLARE_INSTRUCTION | 3062 #undef DECLARE_INSTRUCTION |
3028 #undef DECLARE_CONCRETE_INSTRUCTION | 3063 #undef DECLARE_CONCRETE_INSTRUCTION |
3029 | 3064 |
3030 } } // namespace v8::internal | 3065 } } // namespace v8::internal |
3031 | 3066 |
3032 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 3067 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |