OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 V(IsNull) \ | 115 V(IsNull) \ |
116 V(IsObject) \ | 116 V(IsObject) \ |
117 V(IsSmi) \ | 117 V(IsSmi) \ |
118 V(IsConstructCall) \ | 118 V(IsConstructCall) \ |
119 V(JSArrayLength) \ | 119 V(JSArrayLength) \ |
120 V(LeaveInlined) \ | 120 V(LeaveInlined) \ |
121 V(LoadContextSlot) \ | 121 V(LoadContextSlot) \ |
122 V(LoadElements) \ | 122 V(LoadElements) \ |
123 V(LoadExternalArrayPointer) \ | 123 V(LoadExternalArrayPointer) \ |
124 V(LoadFunctionPrototype) \ | 124 V(LoadFunctionPrototype) \ |
125 V(LoadGlobal) \ | 125 V(LoadGlobalCell) \ |
| 126 V(LoadGlobalGeneric) \ |
126 V(LoadKeyedFastElement) \ | 127 V(LoadKeyedFastElement) \ |
127 V(LoadKeyedGeneric) \ | 128 V(LoadKeyedGeneric) \ |
128 V(LoadNamedField) \ | 129 V(LoadNamedField) \ |
129 V(LoadNamedGeneric) \ | 130 V(LoadNamedGeneric) \ |
130 V(LoadPixelArrayElement) \ | 131 V(LoadPixelArrayElement) \ |
131 V(Mod) \ | 132 V(Mod) \ |
132 V(Mul) \ | 133 V(Mul) \ |
133 V(ObjectLiteral) \ | 134 V(ObjectLiteral) \ |
134 V(OsrEntry) \ | 135 V(OsrEntry) \ |
135 V(OuterContext) \ | 136 V(OuterContext) \ |
(...skipping 2642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2778 HUnknownOSRValue() { set_representation(Representation::Tagged()); } | 2779 HUnknownOSRValue() { set_representation(Representation::Tagged()); } |
2779 | 2780 |
2780 virtual Representation RequiredInputRepresentation(int index) const { | 2781 virtual Representation RequiredInputRepresentation(int index) const { |
2781 return Representation::None(); | 2782 return Representation::None(); |
2782 } | 2783 } |
2783 | 2784 |
2784 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown_osr_value") | 2785 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown_osr_value") |
2785 }; | 2786 }; |
2786 | 2787 |
2787 | 2788 |
2788 class HLoadGlobal: public HTemplateInstruction<0> { | 2789 class HLoadGlobalCell: public HTemplateInstruction<0> { |
2789 public: | 2790 public: |
2790 HLoadGlobal(Handle<JSGlobalPropertyCell> cell, bool check_hole_value) | 2791 HLoadGlobalCell(Handle<JSGlobalPropertyCell> cell, bool check_hole_value) |
2791 : cell_(cell), check_hole_value_(check_hole_value) { | 2792 : cell_(cell), check_hole_value_(check_hole_value) { |
2792 set_representation(Representation::Tagged()); | 2793 set_representation(Representation::Tagged()); |
2793 SetFlag(kUseGVN); | 2794 SetFlag(kUseGVN); |
2794 SetFlag(kDependsOnGlobalVars); | 2795 SetFlag(kDependsOnGlobalVars); |
2795 } | 2796 } |
2796 | 2797 |
2797 Handle<JSGlobalPropertyCell> cell() const { return cell_; } | 2798 Handle<JSGlobalPropertyCell> cell() const { return cell_; } |
2798 bool check_hole_value() const { return check_hole_value_; } | 2799 bool check_hole_value() const { return check_hole_value_; } |
2799 | 2800 |
2800 virtual void PrintDataTo(StringStream* stream); | 2801 virtual void PrintDataTo(StringStream* stream); |
2801 | 2802 |
2802 virtual intptr_t Hashcode() { | 2803 virtual intptr_t Hashcode() { |
2803 ASSERT(!Heap::allow_allocation(false)); | 2804 ASSERT(!Heap::allow_allocation(false)); |
2804 return reinterpret_cast<intptr_t>(*cell_); | 2805 return reinterpret_cast<intptr_t>(*cell_); |
2805 } | 2806 } |
2806 | 2807 |
2807 virtual Representation RequiredInputRepresentation(int index) const { | 2808 virtual Representation RequiredInputRepresentation(int index) const { |
2808 return Representation::None(); | 2809 return Representation::None(); |
2809 } | 2810 } |
2810 | 2811 |
2811 DECLARE_CONCRETE_INSTRUCTION(LoadGlobal, "load_global") | 2812 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load_global_cell") |
2812 | 2813 |
2813 protected: | 2814 protected: |
2814 virtual bool DataEquals(HValue* other) { | 2815 virtual bool DataEquals(HValue* other) { |
2815 HLoadGlobal* b = HLoadGlobal::cast(other); | 2816 HLoadGlobalCell* b = HLoadGlobalCell::cast(other); |
2816 return cell_.is_identical_to(b->cell()); | 2817 return cell_.is_identical_to(b->cell()); |
2817 } | 2818 } |
2818 | 2819 |
2819 private: | 2820 private: |
2820 Handle<JSGlobalPropertyCell> cell_; | 2821 Handle<JSGlobalPropertyCell> cell_; |
2821 bool check_hole_value_; | 2822 bool check_hole_value_; |
2822 }; | 2823 }; |
2823 | 2824 |
2824 | 2825 |
| 2826 class HLoadGlobalGeneric: public HUnaryOperation { |
| 2827 public: |
| 2828 HLoadGlobalGeneric(HValue* context, Handle<Object> name, bool for_typeof) |
| 2829 : HUnaryOperation(context), name_(name), for_typeof_(for_typeof) { |
| 2830 set_representation(Representation::Tagged()); |
| 2831 SetAllSideEffects(); |
| 2832 } |
| 2833 |
| 2834 HValue* context() { return OperandAt(0); } |
| 2835 Handle<Object> name() const { return name_; } |
| 2836 bool for_typeof() const { return for_typeof_; } |
| 2837 |
| 2838 virtual void PrintDataTo(StringStream* stream); |
| 2839 |
| 2840 virtual Representation RequiredInputRepresentation(int index) const { |
| 2841 return Representation::Tagged(); |
| 2842 } |
| 2843 |
| 2844 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load_global_generic") |
| 2845 |
| 2846 private: |
| 2847 Handle<Object> name_; |
| 2848 bool for_typeof_; |
| 2849 }; |
| 2850 |
| 2851 |
2825 class HStoreGlobal: public HUnaryOperation { | 2852 class HStoreGlobal: public HUnaryOperation { |
2826 public: | 2853 public: |
2827 HStoreGlobal(HValue* value, | 2854 HStoreGlobal(HValue* value, |
2828 Handle<JSGlobalPropertyCell> cell, | 2855 Handle<JSGlobalPropertyCell> cell, |
2829 bool check_hole_value) | 2856 bool check_hole_value) |
2830 : HUnaryOperation(value), | 2857 : HUnaryOperation(value), |
2831 cell_(cell), | 2858 cell_(cell), |
2832 check_hole_value_(check_hole_value) { | 2859 check_hole_value_(check_hole_value) { |
2833 SetFlag(kChangesGlobalVars); | 2860 SetFlag(kChangesGlobalVars); |
2834 } | 2861 } |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3479 HValue* object() { return left(); } | 3506 HValue* object() { return left(); } |
3480 HValue* key() { return right(); } | 3507 HValue* key() { return right(); } |
3481 }; | 3508 }; |
3482 | 3509 |
3483 #undef DECLARE_INSTRUCTION | 3510 #undef DECLARE_INSTRUCTION |
3484 #undef DECLARE_CONCRETE_INSTRUCTION | 3511 #undef DECLARE_CONCRETE_INSTRUCTION |
3485 | 3512 |
3486 } } // namespace v8::internal | 3513 } } // namespace v8::internal |
3487 | 3514 |
3488 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 3515 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |