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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // HUnaryControlInstruction | 99 // HUnaryControlInstruction |
100 // HBranch | 100 // HBranch |
101 // HCompareMapAndBranch | 101 // HCompareMapAndBranch |
102 // HReturn | 102 // HReturn |
103 // HThrow | 103 // HThrow |
104 // HEnterInlined | 104 // HEnterInlined |
105 // HFunctionLiteral | 105 // HFunctionLiteral |
106 // HGlobalObject | 106 // HGlobalObject |
107 // HGlobalReceiver | 107 // HGlobalReceiver |
108 // HLeaveInlined | 108 // HLeaveInlined |
| 109 // HLoadContextSlot |
109 // HLoadGlobal | 110 // HLoadGlobal |
110 // HMaterializedLiteral | 111 // HMaterializedLiteral |
111 // HArrayLiteral | 112 // HArrayLiteral |
112 // HObjectLiteral | 113 // HObjectLiteral |
113 // HRegExpLiteral | 114 // HRegExpLiteral |
114 // HOsrEntry | 115 // HOsrEntry |
115 // HParameter | 116 // HParameter |
116 // HSimulate | 117 // HSimulate |
117 // HStackCheck | 118 // HStackCheck |
118 // HStoreKeyed | 119 // HStoreKeyed |
(...skipping 94 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 2361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2594 virtual bool DataEquals(HValue* other) const { | 2596 virtual bool DataEquals(HValue* other) const { |
2595 HStoreGlobal* b = HStoreGlobal::cast(other); | 2597 HStoreGlobal* b = HStoreGlobal::cast(other); |
2596 return cell_.is_identical_to(b->cell()); | 2598 return cell_.is_identical_to(b->cell()); |
2597 } | 2599 } |
2598 | 2600 |
2599 private: | 2601 private: |
2600 Handle<JSGlobalPropertyCell> cell_; | 2602 Handle<JSGlobalPropertyCell> cell_; |
2601 }; | 2603 }; |
2602 | 2604 |
2603 | 2605 |
| 2606 class HLoadContextSlot: public HInstruction { |
| 2607 public: |
| 2608 HLoadContextSlot(int context_chain_length , int slot_index) |
| 2609 : context_chain_length_(context_chain_length), slot_index_(slot_index) { |
| 2610 set_representation(Representation::Tagged()); |
| 2611 SetFlag(kUseGVN); |
| 2612 SetFlag(kDependsOnCalls); |
| 2613 } |
| 2614 |
| 2615 int context_chain_length() const { return context_chain_length_; } |
| 2616 int slot_index() const { return slot_index_; } |
| 2617 |
| 2618 virtual void PrintDataTo(StringStream* stream) const; |
| 2619 |
| 2620 virtual intptr_t Hashcode() const { |
| 2621 return context_chain_length() * 29 + slot_index(); |
| 2622 } |
| 2623 |
| 2624 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load_context_slot") |
| 2625 |
| 2626 protected: |
| 2627 virtual bool DataEquals(HValue* other) const { |
| 2628 HLoadContextSlot* b = HLoadContextSlot::cast(other); |
| 2629 return (context_chain_length() == b->context_chain_length()) |
| 2630 && (slot_index() == b->slot_index()); |
| 2631 } |
| 2632 |
| 2633 private: |
| 2634 int context_chain_length_; |
| 2635 int slot_index_; |
| 2636 }; |
| 2637 |
| 2638 |
2604 class HLoadNamedField: public HUnaryOperation { | 2639 class HLoadNamedField: public HUnaryOperation { |
2605 public: | 2640 public: |
2606 HLoadNamedField(HValue* object, bool is_in_object, int offset) | 2641 HLoadNamedField(HValue* object, bool is_in_object, int offset) |
2607 : HUnaryOperation(object), | 2642 : HUnaryOperation(object), |
2608 is_in_object_(is_in_object), | 2643 is_in_object_(is_in_object), |
2609 offset_(offset) { | 2644 offset_(offset) { |
2610 set_representation(Representation::Tagged()); | 2645 set_representation(Representation::Tagged()); |
2611 SetFlag(kUseGVN); | 2646 SetFlag(kUseGVN); |
2612 if (is_in_object) { | 2647 if (is_in_object) { |
2613 SetFlag(kDependsOnInobjectFields); | 2648 SetFlag(kDependsOnInobjectFields); |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3025 HValue* object() const { return left(); } | 3060 HValue* object() const { return left(); } |
3026 HValue* key() const { return right(); } | 3061 HValue* key() const { return right(); } |
3027 }; | 3062 }; |
3028 | 3063 |
3029 #undef DECLARE_INSTRUCTION | 3064 #undef DECLARE_INSTRUCTION |
3030 #undef DECLARE_CONCRETE_INSTRUCTION | 3065 #undef DECLARE_CONCRETE_INSTRUCTION |
3031 | 3066 |
3032 } } // namespace v8::internal | 3067 } } // namespace v8::internal |
3033 | 3068 |
3034 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 3069 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |