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 // HBranch | 99 // HBranch |
100 // HCompareMapAndBranch | 100 // HCompareMapAndBranch |
101 // HReturn | 101 // HReturn |
102 // HThrow | 102 // HThrow |
103 // HDeoptimize | 103 // HDeoptimize |
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
206 V(GlobalObject) \ | 207 V(GlobalObject) \ |
207 V(GlobalReceiver) \ | 208 V(GlobalReceiver) \ |
208 V(Goto) \ | 209 V(Goto) \ |
209 V(InstanceOf) \ | 210 V(InstanceOf) \ |
210 V(IsNull) \ | 211 V(IsNull) \ |
211 V(IsSmi) \ | 212 V(IsSmi) \ |
212 V(HasInstanceType) \ | 213 V(HasInstanceType) \ |
213 V(HasCachedArrayIndex) \ | 214 V(HasCachedArrayIndex) \ |
214 V(ClassOfTest) \ | 215 V(ClassOfTest) \ |
215 V(LeaveInlined) \ | 216 V(LeaveInlined) \ |
217 V(LoadContextSlot) \ | |
216 V(LoadElements) \ | 218 V(LoadElements) \ |
217 V(LoadGlobal) \ | 219 V(LoadGlobal) \ |
218 V(LoadKeyedFastElement) \ | 220 V(LoadKeyedFastElement) \ |
219 V(LoadKeyedGeneric) \ | 221 V(LoadKeyedGeneric) \ |
220 V(LoadNamedField) \ | 222 V(LoadNamedField) \ |
221 V(LoadNamedGeneric) \ | 223 V(LoadNamedGeneric) \ |
222 V(Mod) \ | 224 V(Mod) \ |
223 V(Mul) \ | 225 V(Mul) \ |
224 V(ObjectLiteral) \ | 226 V(ObjectLiteral) \ |
225 V(OsrEntry) \ | 227 V(OsrEntry) \ |
(...skipping 2270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2496 virtual bool DataEquals(HValue* other) const { | 2498 virtual bool DataEquals(HValue* other) const { |
2497 HStoreGlobal* b = HStoreGlobal::cast(other); | 2499 HStoreGlobal* b = HStoreGlobal::cast(other); |
2498 return cell_.is_identical_to(b->cell()); | 2500 return cell_.is_identical_to(b->cell()); |
2499 } | 2501 } |
2500 | 2502 |
2501 private: | 2503 private: |
2502 Handle<JSGlobalPropertyCell> cell_; | 2504 Handle<JSGlobalPropertyCell> cell_; |
2503 }; | 2505 }; |
2504 | 2506 |
2505 | 2507 |
2508 class HLoadContextSlot: public HInstruction { | |
2509 public: | |
2510 HLoadContextSlot(Handle<Context> context, int index) | |
2511 : context_(context), index_(index) { | |
2512 set_representation(Representation::Tagged()); | |
2513 SetFlag(kUseGVN); | |
2514 SetFlag(kDependsOnCalls); | |
2515 } | |
2516 | |
2517 Handle<Context> context() const { return context_; } | |
2518 int index() const { return index_; } | |
2519 | |
2520 virtual Representation RequiredInputRepresentation(int index) const { | |
fschneider
2010/12/13 19:00:18
Since HLoadContextSlot does not have any input ope
antonm
2010/12/13 22:41:04
Done
| |
2521 return Representation::Tagged(); | |
2522 } | |
2523 virtual void PrintDataTo(StringStream* stream) const; | |
2524 | |
2525 virtual intptr_t Hashcode() const { | |
2526 ASSERT(!Heap::allow_allocation(false)); | |
2527 return reinterpret_cast<intptr_t>(*context_) * 7 + index_; | |
2528 } | |
2529 | |
2530 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load_context_slot") | |
2531 | |
2532 protected: | |
2533 virtual bool DataEquals(HValue* other) const { | |
2534 HLoadContextSlot* b = HLoadContextSlot::cast(other); | |
2535 return context_.is_identical_to(b->context()) && index_ == b->index(); | |
2536 } | |
2537 | |
2538 private: | |
2539 Handle<Context> context_; | |
2540 int index_; | |
2541 }; | |
2542 | |
2543 | |
2506 class HLoadNamedField: public HUnaryOperation { | 2544 class HLoadNamedField: public HUnaryOperation { |
2507 public: | 2545 public: |
2508 HLoadNamedField(HValue* object, bool is_in_object, int offset) | 2546 HLoadNamedField(HValue* object, bool is_in_object, int offset) |
2509 : HUnaryOperation(object), | 2547 : HUnaryOperation(object), |
2510 is_in_object_(is_in_object), | 2548 is_in_object_(is_in_object), |
2511 offset_(offset) { | 2549 offset_(offset) { |
2512 set_representation(Representation::Tagged()); | 2550 set_representation(Representation::Tagged()); |
2513 SetFlag(kUseGVN); | 2551 SetFlag(kUseGVN); |
2514 if (is_in_object) { | 2552 if (is_in_object) { |
2515 SetFlag(kDependsOnInobjectFields); | 2553 SetFlag(kDependsOnInobjectFields); |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2896 HValue* object() const { return left(); } | 2934 HValue* object() const { return left(); } |
2897 HValue* key() const { return right(); } | 2935 HValue* key() const { return right(); } |
2898 }; | 2936 }; |
2899 | 2937 |
2900 #undef DECLARE_INSTRUCTION | 2938 #undef DECLARE_INSTRUCTION |
2901 #undef DECLARE_CONCRETE_INSTRUCTION | 2939 #undef DECLARE_CONCRETE_INSTRUCTION |
2902 | 2940 |
2903 } } // namespace v8::internal | 2941 } } // namespace v8::internal |
2904 | 2942 |
2905 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 2943 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |