Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: src/hydrogen-instructions.h

Issue 6758007: Increase coverage of global loads in optimized code (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 V(IsNull) \ 117 V(IsNull) \
118 V(IsObject) \ 118 V(IsObject) \
119 V(IsSmi) \ 119 V(IsSmi) \
120 V(IsConstructCall) \ 120 V(IsConstructCall) \
121 V(JSArrayLength) \ 121 V(JSArrayLength) \
122 V(LeaveInlined) \ 122 V(LeaveInlined) \
123 V(LoadContextSlot) \ 123 V(LoadContextSlot) \
124 V(LoadElements) \ 124 V(LoadElements) \
125 V(LoadExternalArrayPointer) \ 125 V(LoadExternalArrayPointer) \
126 V(LoadFunctionPrototype) \ 126 V(LoadFunctionPrototype) \
127 V(LoadGlobal) \ 127 V(LoadGlobalCell) \
128 V(LoadGlobalGeneric) \
128 V(LoadKeyedFastElement) \ 129 V(LoadKeyedFastElement) \
129 V(LoadKeyedGeneric) \ 130 V(LoadKeyedGeneric) \
130 V(LoadKeyedSpecializedArrayElement) \ 131 V(LoadKeyedSpecializedArrayElement) \
131 V(LoadNamedField) \ 132 V(LoadNamedField) \
132 V(LoadNamedFieldPolymorphic) \ 133 V(LoadNamedFieldPolymorphic) \
133 V(LoadNamedGeneric) \ 134 V(LoadNamedGeneric) \
134 V(Mod) \ 135 V(Mod) \
135 V(Mul) \ 136 V(Mul) \
136 V(ObjectLiteral) \ 137 V(ObjectLiteral) \
137 V(OsrEntry) \ 138 V(OsrEntry) \
(...skipping 2664 matching lines...) Expand 10 before | Expand all | Expand 10 after
2802 HUnknownOSRValue() { set_representation(Representation::Tagged()); } 2803 HUnknownOSRValue() { set_representation(Representation::Tagged()); }
2803 2804
2804 virtual Representation RequiredInputRepresentation(int index) const { 2805 virtual Representation RequiredInputRepresentation(int index) const {
2805 return Representation::None(); 2806 return Representation::None();
2806 } 2807 }
2807 2808
2808 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown_osr_value") 2809 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown_osr_value")
2809 }; 2810 };
2810 2811
2811 2812
2812 class HLoadGlobal: public HTemplateInstruction<0> { 2813 class HLoadGlobalCell: public HTemplateInstruction<0> {
2813 public: 2814 public:
2814 HLoadGlobal(Handle<JSGlobalPropertyCell> cell, bool check_hole_value) 2815 HLoadGlobalCell(Handle<JSGlobalPropertyCell> cell, bool check_hole_value)
2815 : cell_(cell), check_hole_value_(check_hole_value) { 2816 : cell_(cell), check_hole_value_(check_hole_value) {
2816 set_representation(Representation::Tagged()); 2817 set_representation(Representation::Tagged());
2817 SetFlag(kUseGVN); 2818 SetFlag(kUseGVN);
2818 SetFlag(kDependsOnGlobalVars); 2819 SetFlag(kDependsOnGlobalVars);
2819 } 2820 }
2820 2821
2821 Handle<JSGlobalPropertyCell> cell() const { return cell_; } 2822 Handle<JSGlobalPropertyCell> cell() const { return cell_; }
2822 bool check_hole_value() const { return check_hole_value_; } 2823 bool check_hole_value() const { return check_hole_value_; }
2823 2824
2824 virtual void PrintDataTo(StringStream* stream); 2825 virtual void PrintDataTo(StringStream* stream);
2825 2826
2826 virtual intptr_t Hashcode() { 2827 virtual intptr_t Hashcode() {
2827 ASSERT(!HEAP->allow_allocation(false)); 2828 ASSERT(!HEAP->allow_allocation(false));
2828 return reinterpret_cast<intptr_t>(*cell_); 2829 return reinterpret_cast<intptr_t>(*cell_);
2829 } 2830 }
2830 2831
2831 virtual Representation RequiredInputRepresentation(int index) const { 2832 virtual Representation RequiredInputRepresentation(int index) const {
2832 return Representation::None(); 2833 return Representation::None();
2833 } 2834 }
2834 2835
2835 DECLARE_CONCRETE_INSTRUCTION(LoadGlobal, "load_global") 2836 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load_global_cell")
2836 2837
2837 protected: 2838 protected:
2838 virtual bool DataEquals(HValue* other) { 2839 virtual bool DataEquals(HValue* other) {
2839 HLoadGlobal* b = HLoadGlobal::cast(other); 2840 HLoadGlobalCell* b = HLoadGlobalCell::cast(other);
2840 return cell_.is_identical_to(b->cell()); 2841 return cell_.is_identical_to(b->cell());
2841 } 2842 }
2842 2843
2843 private: 2844 private:
2844 Handle<JSGlobalPropertyCell> cell_; 2845 Handle<JSGlobalPropertyCell> cell_;
2845 bool check_hole_value_; 2846 bool check_hole_value_;
2846 }; 2847 };
2847 2848
2848 2849
2850 class HLoadGlobalGeneric: public HBinaryOperation {
2851 public:
2852 HLoadGlobalGeneric(HValue* context,
2853 HValue* global_object,
2854 Handle<Object> name,
2855 bool for_typeof)
2856 : HBinaryOperation(context, global_object),
2857 name_(name),
2858 for_typeof_(for_typeof) {
2859 set_representation(Representation::Tagged());
2860 SetAllSideEffects();
2861 }
2862
2863 HValue* context() { return OperandAt(0); }
2864 HValue* global_object() { return OperandAt(1); }
2865 Handle<Object> name() const { return name_; }
2866 bool for_typeof() const { return for_typeof_; }
2867
2868 virtual void PrintDataTo(StringStream* stream);
2869
2870 virtual Representation RequiredInputRepresentation(int index) const {
2871 return Representation::Tagged();
2872 }
2873
2874 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load_global_generic")
2875
2876 private:
2877 Handle<Object> name_;
2878 bool for_typeof_;
2879 };
2880
2881
2849 class HStoreGlobal: public HUnaryOperation { 2882 class HStoreGlobal: public HUnaryOperation {
2850 public: 2883 public:
2851 HStoreGlobal(HValue* value, 2884 HStoreGlobal(HValue* value,
2852 Handle<JSGlobalPropertyCell> cell, 2885 Handle<JSGlobalPropertyCell> cell,
2853 bool check_hole_value) 2886 bool check_hole_value)
2854 : HUnaryOperation(value), 2887 : HUnaryOperation(value),
2855 cell_(cell), 2888 cell_(cell),
2856 check_hole_value_(check_hole_value) { 2889 check_hole_value_(check_hole_value) {
2857 SetFlag(kChangesGlobalVars); 2890 SetFlag(kChangesGlobalVars);
2858 } 2891 }
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
3586 HValue* object() { return left(); } 3619 HValue* object() { return left(); }
3587 HValue* key() { return right(); } 3620 HValue* key() { return right(); }
3588 }; 3621 };
3589 3622
3590 #undef DECLARE_INSTRUCTION 3623 #undef DECLARE_INSTRUCTION
3591 #undef DECLARE_CONCRETE_INSTRUCTION 3624 #undef DECLARE_CONCRETE_INSTRUCTION
3592 3625
3593 } } // namespace v8::internal 3626 } } // namespace v8::internal
3594 3627
3595 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 3628 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« src/ast.cc ('K') | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698