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

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

Issue 5550003: Add optimized compiler support for generic global loads.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years 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 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
99 // HCompareMapAndBranch 99 // HCompareMapAndBranch
100 // HReturn 100 // HReturn
101 // HThrow 101 // HThrow
102 // HDeoptimize 102 // HDeoptimize
103 // HEnterInlined 103 // HEnterInlined
104 // HFunctionLiteral 104 // HFunctionLiteral
105 // HGlobalObject 105 // HGlobalObject
106 // HGlobalReceiver 106 // HGlobalReceiver
107 // HLeaveInlined 107 // HLeaveInlined
108 // HLoadGlobal 108 // HLoadGlobal
109 // HLoadGlobalGeneric
109 // HMaterializedLiteral 110 // HMaterializedLiteral
110 // HArrayLiteral 111 // HArrayLiteral
111 // HObjectLiteral 112 // HObjectLiteral
112 // HRegExpLiteral 113 // HRegExpLiteral
113 // HOsrEntry 114 // HOsrEntry
114 // HParameter 115 // HParameter
115 // HSimulate 116 // HSimulate
116 // HStackCheck 117 // HStackCheck
117 // HStoreKeyed 118 // HStoreKeyed
118 // HStoreKeyedFastElement 119 // HStoreKeyedFastElement
119 // HStoreKeyedGeneric 120 // HStoreKeyedGeneric
120 // HUnaryOperation 121 // HUnaryOperation
121 // HArrayLength 122 // HArrayLength
122 // HBitNot 123 // HBitNot
123 // HChange 124 // HChange
124 // HCheckFunction 125 // HCheckFunction
125 // HCheckInstanceType 126 // HCheckInstanceType
126 // HCheckMap 127 // HCheckMap
127 // HCheckNonSmi 128 // HCheckNonSmi
128 // HCheckPrototypeMaps 129 // HCheckPrototypeMaps
129 // HCheckSmi 130 // HCheckSmi
130 // HDeleteProperty 131 // HDeleteProperty
131 // HLoadElements 132 // HLoadElements
132 // HTypeofIs 133 // HTypeofIs
133 // HLoadNamedField 134 // HLoadNamedField
134 // HPushArgument 135 // HPushArgument
136 // HStoreGlobal
135 // HTypeof 137 // HTypeof
136 // HUnaryMathOperation 138 // HUnaryMathOperation
137 // HUnaryPredicate 139 // HUnaryPredicate
138 // HClassOfTest 140 // HClassOfTest
139 // HHasCachedArrayIndex 141 // HHasCachedArrayIndex
140 // HHasInstanceType 142 // HHasInstanceType
141 // HIsNull 143 // HIsNull
142 // HIsSmi 144 // HIsSmi
143 // HValueOf 145 // HValueOf
144 // HUnknownOSRValue 146 // HUnknownOSRValue
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 V(Goto) \ 209 V(Goto) \
208 V(InstanceOf) \ 210 V(InstanceOf) \
209 V(IsNull) \ 211 V(IsNull) \
210 V(IsSmi) \ 212 V(IsSmi) \
211 V(HasInstanceType) \ 213 V(HasInstanceType) \
212 V(HasCachedArrayIndex) \ 214 V(HasCachedArrayIndex) \
213 V(ClassOfTest) \ 215 V(ClassOfTest) \
214 V(LeaveInlined) \ 216 V(LeaveInlined) \
215 V(LoadElements) \ 217 V(LoadElements) \
216 V(LoadGlobal) \ 218 V(LoadGlobal) \
219 V(LoadGlobalGeneric) \
217 V(LoadKeyedFastElement) \ 220 V(LoadKeyedFastElement) \
218 V(LoadKeyedGeneric) \ 221 V(LoadKeyedGeneric) \
219 V(LoadNamedField) \ 222 V(LoadNamedField) \
220 V(LoadNamedGeneric) \ 223 V(LoadNamedGeneric) \
221 V(Mod) \ 224 V(Mod) \
222 V(Mul) \ 225 V(Mul) \
223 V(ObjectLiteral) \ 226 V(ObjectLiteral) \
224 V(OsrEntry) \ 227 V(OsrEntry) \
225 V(Parameter) \ 228 V(Parameter) \
226 V(PushArgument) \ 229 V(PushArgument) \
(...skipping 2198 matching lines...) Expand 10 before | Expand all | Expand 10 after
2425 HLoadGlobal(Handle<JSGlobalPropertyCell> cell, bool check_hole_value) 2428 HLoadGlobal(Handle<JSGlobalPropertyCell> cell, bool check_hole_value)
2426 : cell_(cell), check_hole_value_(check_hole_value) { 2429 : cell_(cell), check_hole_value_(check_hole_value) {
2427 set_representation(Representation::Tagged()); 2430 set_representation(Representation::Tagged());
2428 SetFlag(kUseGVN); 2431 SetFlag(kUseGVN);
2429 SetFlag(kDependsOnGlobalVars); 2432 SetFlag(kDependsOnGlobalVars);
2430 } 2433 }
2431 2434
2432 Handle<JSGlobalPropertyCell> cell() const { return cell_; } 2435 Handle<JSGlobalPropertyCell> cell() const { return cell_; }
2433 bool check_hole_value() const { return check_hole_value_; } 2436 bool check_hole_value() const { return check_hole_value_; }
2434 2437
2435 virtual Representation RequiredInputRepresentation(int index) const {
2436 return Representation::Tagged();
2437 }
2438 virtual void PrintDataTo(StringStream* stream) const; 2438 virtual void PrintDataTo(StringStream* stream) const;
2439 2439
2440 virtual intptr_t Hashcode() const { 2440 virtual intptr_t Hashcode() const {
2441 ASSERT(!Heap::allow_allocation(false)); 2441 ASSERT(!Heap::allow_allocation(false));
2442 return reinterpret_cast<intptr_t>(*cell_); 2442 return reinterpret_cast<intptr_t>(*cell_);
2443 } 2443 }
2444 2444
2445 DECLARE_CONCRETE_INSTRUCTION(LoadGlobal, "load_global") 2445 DECLARE_CONCRETE_INSTRUCTION(LoadGlobal, "load_global")
2446 2446
2447 protected: 2447 protected:
2448 virtual bool DataEquals(HValue* other) const { 2448 virtual bool DataEquals(HValue* other) const {
2449 HLoadGlobal* b = HLoadGlobal::cast(other); 2449 HLoadGlobal* b = HLoadGlobal::cast(other);
2450 return cell_.is_identical_to(b->cell()); 2450 return cell_.is_identical_to(b->cell());
2451 } 2451 }
2452 2452
2453 private: 2453 private:
2454 Handle<JSGlobalPropertyCell> cell_; 2454 Handle<JSGlobalPropertyCell> cell_;
2455 bool check_hole_value_; 2455 bool check_hole_value_;
2456 }; 2456 };
2457 2457
2458 2458
2459 class HLoadGlobalGeneric: public HInstruction {
2460 public:
2461 HLoadGlobalGeneric(Handle<String> name, bool inside_typeof)
2462 : name_(name), inside_typeof_(inside_typeof) {
2463 set_representation(Representation::Tagged());
2464 SetFlagMask(AllSideEffects());
2465 }
2466
2467 virtual void PrintDataTo(StringStream* stream) const;
2468
2469 Handle<String> name() const { return name_; }
2470 bool inside_typeof() const { return inside_typeof_; }
2471
2472 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load_global_generic")
2473
2474 private:
2475 Handle<String> name_;
2476 bool inside_typeof_;
2477 };
2478
2479
2459 class HStoreGlobal: public HUnaryOperation { 2480 class HStoreGlobal: public HUnaryOperation {
2460 public: 2481 public:
2461 HStoreGlobal(HValue* value, Handle<JSGlobalPropertyCell> cell) 2482 HStoreGlobal(HValue* value, Handle<JSGlobalPropertyCell> cell)
2462 : HUnaryOperation(value), cell_(cell) { 2483 : HUnaryOperation(value), cell_(cell) {
2463 SetFlag(kChangesGlobalVars); 2484 SetFlag(kChangesGlobalVars);
2464 } 2485 }
2465 2486
2466 Handle<JSGlobalPropertyCell> cell() const { return cell_; } 2487 Handle<JSGlobalPropertyCell> cell() const { return cell_; }
2467 2488
2468 virtual Representation RequiredInputRepresentation(int index) const { 2489 virtual Representation RequiredInputRepresentation(int index) const {
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
2876 HValue* object() const { return left(); } 2897 HValue* object() const { return left(); }
2877 HValue* key() const { return right(); } 2898 HValue* key() const { return right(); }
2878 }; 2899 };
2879 2900
2880 #undef DECLARE_INSTRUCTION 2901 #undef DECLARE_INSTRUCTION
2881 #undef DECLARE_CONCRETE_INSTRUCTION 2902 #undef DECLARE_CONCRETE_INSTRUCTION
2882 2903
2883 } } // namespace v8::internal 2904 } } // namespace v8::internal
2884 2905
2885 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 2906 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« src/hydrogen.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