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

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

Issue 9643001: Inline functions that use arguments object in f.apply(o, arguments) pattern. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: regression test Created 8 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 V(TransitionElementsKind) \ 177 V(TransitionElementsKind) \
178 V(Typeof) \ 178 V(Typeof) \
179 V(TypeofIsAndBranch) \ 179 V(TypeofIsAndBranch) \
180 V(UnaryMathOperation) \ 180 V(UnaryMathOperation) \
181 V(UnknownOSRValue) \ 181 V(UnknownOSRValue) \
182 V(UseConst) \ 182 V(UseConst) \
183 V(ValueOf) \ 183 V(ValueOf) \
184 V(ForInPrepareMap) \ 184 V(ForInPrepareMap) \
185 V(ForInCacheArray) \ 185 V(ForInCacheArray) \
186 V(CheckMapValue) \ 186 V(CheckMapValue) \
187 V(LoadFieldByIndex) 187 V(LoadFieldByIndex) \
188 V(WrapReceiver)
188 189
189 #define GVN_FLAG_LIST(V) \ 190 #define GVN_FLAG_LIST(V) \
190 V(Calls) \ 191 V(Calls) \
191 V(InobjectFields) \ 192 V(InobjectFields) \
192 V(BackingStoreFields) \ 193 V(BackingStoreFields) \
193 V(ElementsKind) \ 194 V(ElementsKind) \
194 V(ElementsPointer) \ 195 V(ElementsPointer) \
195 V(ArrayElements) \ 196 V(ArrayElements) \
196 V(DoubleArrayElements) \ 197 V(DoubleArrayElements) \
197 V(SpecializedArrayElements) \ 198 V(SpecializedArrayElements) \
(...skipping 2297 matching lines...) Expand 10 before | Expand all | Expand 10 after
2495 if (IsCommutative() && left()->IsConstant()) return left(); 2496 if (IsCommutative() && left()->IsConstant()) return left();
2496 return right(); 2497 return right();
2497 } 2498 }
2498 2499
2499 virtual bool IsCommutative() const { return false; } 2500 virtual bool IsCommutative() const { return false; }
2500 2501
2501 virtual void PrintDataTo(StringStream* stream); 2502 virtual void PrintDataTo(StringStream* stream);
2502 }; 2503 };
2503 2504
2504 2505
2506 class HWrapReceiver: public HTemplateInstruction<2> {
2507 public:
2508 HWrapReceiver(HValue* receiver, HValue* function) {
2509 set_representation(Representation::Tagged());
2510 SetOperandAt(0, receiver);
2511 SetOperandAt(1, function);
2512 }
2513
2514 virtual Representation RequiredInputRepresentation(int index) {
2515 return Representation::Tagged();
2516 }
2517
2518 HValue* receiver() { return OperandAt(0); }
2519 HValue* function() { return OperandAt(1); }
2520
2521 DECLARE_CONCRETE_INSTRUCTION(WrapReceiver)
2522 };
2523
2524
2505 class HApplyArguments: public HTemplateInstruction<4> { 2525 class HApplyArguments: public HTemplateInstruction<4> {
2506 public: 2526 public:
2507 HApplyArguments(HValue* function, 2527 HApplyArguments(HValue* function,
2508 HValue* receiver, 2528 HValue* receiver,
2509 HValue* length, 2529 HValue* length,
2510 HValue* elements) { 2530 HValue* elements) {
2511 set_representation(Representation::Tagged()); 2531 set_representation(Representation::Tagged());
2512 SetOperandAt(0, function); 2532 SetOperandAt(0, function);
2513 SetOperandAt(1, receiver); 2533 SetOperandAt(1, receiver);
2514 SetOperandAt(2, length); 2534 SetOperandAt(2, length);
(...skipping 2262 matching lines...) Expand 10 before | Expand all | Expand 10 after
4777 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); 4797 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex);
4778 }; 4798 };
4779 4799
4780 4800
4781 #undef DECLARE_INSTRUCTION 4801 #undef DECLARE_INSTRUCTION
4782 #undef DECLARE_CONCRETE_INSTRUCTION 4802 #undef DECLARE_CONCRETE_INSTRUCTION
4783 4803
4784 } } // namespace v8::internal 4804 } } // namespace v8::internal
4785 4805
4786 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 4806 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698