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

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

Issue 6009005: Support load function prototype in hydrogen/lithium. (Closed)
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
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // HSar 69 // HSar
70 // HShl 70 // HShl
71 // HShr 71 // HShr
72 // HBoundsCheck 72 // HBoundsCheck
73 // HCompare 73 // HCompare
74 // HCompareJSObjectEq 74 // HCompareJSObjectEq
75 // HInstanceOf 75 // HInstanceOf
76 // HLoadKeyed 76 // HLoadKeyed
77 // HLoadKeyedFastElement 77 // HLoadKeyedFastElement
78 // HLoadKeyedGeneric 78 // HLoadKeyedGeneric
79 // HLoadNamedGeneric
80 // HPower 79 // HPower
81 // HStoreNamed 80 // HStoreNamed
82 // HStoreNamedField 81 // HStoreNamedField
83 // HStoreNamedGeneric 82 // HStoreNamedGeneric
84 // HBlockEntry 83 // HBlockEntry
85 // HCall 84 // HCall
86 // HCallConstantFunction 85 // HCallConstantFunction
87 // HCallFunction 86 // HCallFunction
88 // HCallGlobal 87 // HCallGlobal
89 // HCallKeyed 88 // HCallKeyed
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // HCheckFunction 124 // HCheckFunction
126 // HCheckInstanceType 125 // HCheckInstanceType
127 // HCheckMap 126 // HCheckMap
128 // HCheckNonSmi 127 // HCheckNonSmi
129 // HCheckPrototypeMaps 128 // HCheckPrototypeMaps
130 // HCheckSmi 129 // HCheckSmi
131 // HDeleteProperty 130 // HDeleteProperty
132 // HLoadElements 131 // HLoadElements
133 // HTypeofIs 132 // HTypeofIs
134 // HLoadNamedField 133 // HLoadNamedField
134 // HLoadNamedGeneric
135 // HLoadFunctionPrototype
Kevin Millikin (Chromium) 2011/01/26 11:54:00 These are intended to be alphabetized.
Vitaly Repeshko 2011/01/26 14:06:23 Actually do we need this comment at all? It's a PI
135 // HPushArgument 136 // HPushArgument
136 // HTypeof 137 // HTypeof
137 // HUnaryMathOperation 138 // HUnaryMathOperation
138 // HUnaryPredicate 139 // HUnaryPredicate
139 // HClassOfTest 140 // HClassOfTest
140 // HHasCachedArrayIndex 141 // HHasCachedArrayIndex
141 // HHasInstanceType 142 // HHasInstanceType
142 // HIsNull 143 // HIsNull
143 // HIsObject 144 // HIsObject
144 // HIsSmi 145 // HIsSmi
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 V(HasInstanceType) \ 215 V(HasInstanceType) \
215 V(HasCachedArrayIndex) \ 216 V(HasCachedArrayIndex) \
216 V(ClassOfTest) \ 217 V(ClassOfTest) \
217 V(LeaveInlined) \ 218 V(LeaveInlined) \
218 V(LoadElements) \ 219 V(LoadElements) \
219 V(LoadGlobal) \ 220 V(LoadGlobal) \
220 V(LoadKeyedFastElement) \ 221 V(LoadKeyedFastElement) \
221 V(LoadKeyedGeneric) \ 222 V(LoadKeyedGeneric) \
222 V(LoadNamedField) \ 223 V(LoadNamedField) \
223 V(LoadNamedGeneric) \ 224 V(LoadNamedGeneric) \
225 V(LoadFunctionPrototype) \
Kevin Millikin (Chromium) 2011/01/26 11:54:00 So are these.
224 V(Mod) \ 226 V(Mod) \
225 V(Mul) \ 227 V(Mul) \
226 V(ObjectLiteral) \ 228 V(ObjectLiteral) \
227 V(OsrEntry) \ 229 V(OsrEntry) \
228 V(Parameter) \ 230 V(Parameter) \
229 V(Power) \ 231 V(Power) \
230 V(PushArgument) \ 232 V(PushArgument) \
231 V(RegExpLiteral) \ 233 V(RegExpLiteral) \
232 V(Return) \ 234 V(Return) \
233 V(Sar) \ 235 V(Sar) \
(...skipping 15 matching lines...) Expand all
249 V(ValueOf) 251 V(ValueOf)
250 252
251 #define GVN_FLAG_LIST(V) \ 253 #define GVN_FLAG_LIST(V) \
252 V(Calls) \ 254 V(Calls) \
253 V(InobjectFields) \ 255 V(InobjectFields) \
254 V(BackingStoreFields) \ 256 V(BackingStoreFields) \
255 V(ArrayElements) \ 257 V(ArrayElements) \
256 V(GlobalVars) \ 258 V(GlobalVars) \
257 V(Maps) \ 259 V(Maps) \
258 V(ArrayLengths) \ 260 V(ArrayLengths) \
261 V(FunctionPrototypes) \
259 V(OsrEntries) 262 V(OsrEntries)
260 263
261 #define DECLARE_INSTRUCTION(type) \ 264 #define DECLARE_INSTRUCTION(type) \
262 virtual bool Is##type() const { return true; } \ 265 virtual bool Is##type() const { return true; } \
263 static H##type* cast(HValue* value) { \ 266 static H##type* cast(HValue* value) { \
264 ASSERT(value->Is##type()); \ 267 ASSERT(value->Is##type()); \
265 return reinterpret_cast<H##type*>(value); \ 268 return reinterpret_cast<H##type*>(value); \
266 } \ 269 } \
267 Opcode opcode() const { return HValue::k##type; } 270 Opcode opcode() const { return HValue::k##type; }
268 271
(...skipping 2341 matching lines...) Expand 10 before | Expand all | Expand 10 after
2610 virtual bool DataEquals(HValue* other) const { 2613 virtual bool DataEquals(HValue* other) const {
2611 HLoadNamedGeneric* b = HLoadNamedGeneric::cast(other); 2614 HLoadNamedGeneric* b = HLoadNamedGeneric::cast(other);
2612 return name_.is_identical_to(b->name_); 2615 return name_.is_identical_to(b->name_);
2613 } 2616 }
2614 2617
2615 private: 2618 private:
2616 Handle<Object> name_; 2619 Handle<Object> name_;
2617 }; 2620 };
2618 2621
2619 2622
2623 class HLoadFunctionPrototype: public HUnaryOperation {
2624 public:
2625 explicit HLoadFunctionPrototype(HValue* function)
2626 : HUnaryOperation(function) {
2627 set_representation(Representation::Tagged());
2628 SetFlagMask(kDependsOnFunctionPrototypes);
Kevin Millikin (Chromium) 2011/01/26 11:54:00 1. Don't introduce a new kDependsOn... flag if the
Vitaly Repeshko 2011/01/26 14:06:23 There's DependsOnMaps and no ChangesMaps. We actua
2629 }
2630
2631 HValue* function() const { return OperandAt(0); }
2632
2633 virtual Representation RequiredInputRepresentation(int index) const {
2634 return Representation::Tagged();
2635 }
2636
2637 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load_function_prototype")
2638
2639 protected:
2640 virtual bool DataEquals(HValue* other) const { return true; }
fschneider 2010/12/21 17:57:52 I think you can just rely on the implementation th
Vitaly Repeshko 2010/12/22 15:43:41 I just wanted to make it explicit that it's requir
Kevin Millikin (Chromium) 2011/01/26 11:54:00 1. It's not required unless the instruction has kU
Vitaly Repeshko 2011/01/26 14:06:23 Yeah, see above.
2641 };
2642
2643
2620 class HLoadKeyed: public HBinaryOperation { 2644 class HLoadKeyed: public HBinaryOperation {
2621 public: 2645 public:
2622 HLoadKeyed(HValue* obj, HValue* key) : HBinaryOperation(obj, key) { 2646 HLoadKeyed(HValue* obj, HValue* key) : HBinaryOperation(obj, key) {
2623 set_representation(Representation::Tagged()); 2647 set_representation(Representation::Tagged());
2624 } 2648 }
2625 2649
2626 virtual void PrintDataTo(StringStream* stream) const; 2650 virtual void PrintDataTo(StringStream* stream) const;
2627 2651
2628 virtual Representation RequiredInputRepresentation(int index) const { 2652 virtual Representation RequiredInputRepresentation(int index) const {
2629 return Representation::Tagged(); 2653 return Representation::Tagged();
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
2944 HValue* object() const { return left(); } 2968 HValue* object() const { return left(); }
2945 HValue* key() const { return right(); } 2969 HValue* key() const { return right(); }
2946 }; 2970 };
2947 2971
2948 #undef DECLARE_INSTRUCTION 2972 #undef DECLARE_INSTRUCTION
2949 #undef DECLARE_CONCRETE_INSTRUCTION 2973 #undef DECLARE_CONCRETE_INSTRUCTION
2950 2974
2951 } } // namespace v8::internal 2975 } } // namespace v8::internal
2952 2976
2953 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 2977 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698