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

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

Issue 6665026: Increase coverage of global loads in optimized code... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 9 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
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 HBinaryOperation {
2827 public:
2828 HLoadGlobalGeneric(HValue* context,
2829 HValue* global_object,
2830 Handle<Object> name,
2831 bool for_typeof)
2832 : HBinaryOperation(context, global_object),
2833 name_(name),
2834 for_typeof_(for_typeof) {
2835 set_representation(Representation::Tagged());
2836 SetAllSideEffects();
2837 }
2838
2839 HValue* context() { return OperandAt(0); }
2840 HValue* global_object() { return OperandAt(1); }
2841 Handle<Object> name() const { return name_; }
2842 bool for_typeof() const { return for_typeof_; }
2843
2844 virtual void PrintDataTo(StringStream* stream);
2845
2846 virtual Representation RequiredInputRepresentation(int index) const {
2847 return Representation::Tagged();
2848 }
2849
2850 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load_global_generic")
2851
2852 private:
2853 Handle<Object> name_;
2854 bool for_typeof_;
2855 };
2856
2857
2825 class HStoreGlobal: public HUnaryOperation { 2858 class HStoreGlobal: public HUnaryOperation {
2826 public: 2859 public:
2827 HStoreGlobal(HValue* value, 2860 HStoreGlobal(HValue* value,
2828 Handle<JSGlobalPropertyCell> cell, 2861 Handle<JSGlobalPropertyCell> cell,
2829 bool check_hole_value) 2862 bool check_hole_value)
2830 : HUnaryOperation(value), 2863 : HUnaryOperation(value),
2831 cell_(cell), 2864 cell_(cell),
2832 check_hole_value_(check_hole_value) { 2865 check_hole_value_(check_hole_value) {
2833 SetFlag(kChangesGlobalVars); 2866 SetFlag(kChangesGlobalVars);
2834 } 2867 }
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
3479 HValue* object() { return left(); } 3512 HValue* object() { return left(); }
3480 HValue* key() { return right(); } 3513 HValue* key() { return right(); }
3481 }; 3514 };
3482 3515
3483 #undef DECLARE_INSTRUCTION 3516 #undef DECLARE_INSTRUCTION
3484 #undef DECLARE_CONCRETE_INSTRUCTION 3517 #undef DECLARE_CONCRETE_INSTRUCTION
3485 3518
3486 } } // namespace v8::internal 3519 } } // namespace v8::internal
3487 3520
3488 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 3521 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698