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

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

Issue 535873002: Encapsulate megamorphic load/tail-call in hydrogen (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE. Created 6 years, 3 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/code-stubs-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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_
6 #define V8_HYDROGEN_INSTRUCTIONS_H_ 6 #define V8_HYDROGEN_INSTRUCTIONS_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 19 matching lines...) Expand all
30 class HEnvironment; 30 class HEnvironment;
31 class HInferRepresentationPhase; 31 class HInferRepresentationPhase;
32 class HInstruction; 32 class HInstruction;
33 class HLoopInformation; 33 class HLoopInformation;
34 class HStoreNamedField; 34 class HStoreNamedField;
35 class HValue; 35 class HValue;
36 class LInstruction; 36 class LInstruction;
37 class LChunkBuilder; 37 class LChunkBuilder;
38 class OStream; 38 class OStream;
39 39
40 #define HYDROGEN_ABSTRACT_INSTRUCTION_LIST(V) \ 40 #define HYDROGEN_ABSTRACT_INSTRUCTION_LIST(V) \
41 V(ArithmeticBinaryOperation) \ 41 V(ArithmeticBinaryOperation) \
42 V(BinaryOperation) \ 42 V(BinaryOperation) \
43 V(BitwiseBinaryOperation) \ 43 V(BitwiseBinaryOperation) \
44 V(ControlInstruction) \ 44 V(ControlInstruction) \
45 V(Instruction) \ 45 V(Instruction)
46 46
47 47
48 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \ 48 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \
49 V(AbnormalExit) \ 49 V(AbnormalExit) \
50 V(AccessArgumentsAt) \ 50 V(AccessArgumentsAt) \
51 V(Add) \ 51 V(Add) \
52 V(AllocateBlockContext) \ 52 V(AllocateBlockContext) \
53 V(Allocate) \ 53 V(Allocate) \
54 V(ApplyArguments) \ 54 V(ApplyArguments) \
55 V(ArgumentsElements) \ 55 V(ArgumentsElements) \
56 V(ArgumentsLength) \ 56 V(ArgumentsLength) \
57 V(ArgumentsObject) \ 57 V(ArgumentsObject) \
58 V(Bitwise) \ 58 V(Bitwise) \
59 V(BlockEntry) \ 59 V(BlockEntry) \
60 V(BoundsCheck) \ 60 V(BoundsCheck) \
61 V(BoundsCheckBaseIndexInformation) \ 61 V(BoundsCheckBaseIndexInformation) \
62 V(Branch) \ 62 V(Branch) \
63 V(CallWithDescriptor) \ 63 V(CallWithDescriptor) \
64 V(CallJSFunction) \ 64 V(CallJSFunction) \
65 V(CallFunction) \ 65 V(CallFunction) \
66 V(CallNew) \ 66 V(CallNew) \
67 V(CallNewArray) \ 67 V(CallNewArray) \
68 V(CallRuntime) \ 68 V(CallRuntime) \
69 V(CallStub) \ 69 V(CallStub) \
70 V(CapturedObject) \ 70 V(CapturedObject) \
71 V(Change) \ 71 V(Change) \
72 V(CheckHeapObject) \ 72 V(CheckHeapObject) \
73 V(CheckInstanceType) \ 73 V(CheckInstanceType) \
74 V(CheckMaps) \ 74 V(CheckMaps) \
75 V(CheckMapValue) \ 75 V(CheckMapValue) \
76 V(CheckSmi) \ 76 V(CheckSmi) \
77 V(CheckValue) \ 77 V(CheckValue) \
78 V(ClampToUint8) \ 78 V(ClampToUint8) \
79 V(ClassOfTestAndBranch) \ 79 V(ClassOfTestAndBranch) \
80 V(CompareNumericAndBranch) \ 80 V(CompareNumericAndBranch) \
81 V(CompareHoleAndBranch) \ 81 V(CompareHoleAndBranch) \
82 V(CompareGeneric) \ 82 V(CompareGeneric) \
83 V(CompareMinusZeroAndBranch) \ 83 V(CompareMinusZeroAndBranch) \
84 V(CompareObjectEqAndBranch) \ 84 V(CompareObjectEqAndBranch) \
85 V(CompareMap) \ 85 V(CompareMap) \
86 V(Constant) \ 86 V(Constant) \
87 V(ConstructDouble) \ 87 V(ConstructDouble) \
88 V(Context) \ 88 V(Context) \
89 V(DateField) \ 89 V(DateField) \
90 V(DebugBreak) \ 90 V(DebugBreak) \
91 V(DeclareGlobals) \ 91 V(DeclareGlobals) \
92 V(Deoptimize) \ 92 V(Deoptimize) \
93 V(Div) \ 93 V(Div) \
94 V(DoubleBits) \ 94 V(DoubleBits) \
95 V(DummyUse) \ 95 V(DummyUse) \
96 V(EnterInlined) \ 96 V(EnterInlined) \
97 V(EnvironmentMarker) \ 97 V(EnvironmentMarker) \
98 V(ForceRepresentation) \ 98 V(ForceRepresentation) \
99 V(ForInCacheArray) \ 99 V(ForInCacheArray) \
100 V(ForInPrepareMap) \ 100 V(ForInPrepareMap) \
101 V(FunctionLiteral) \ 101 V(FunctionLiteral) \
102 V(GetCachedArrayIndex) \ 102 V(GetCachedArrayIndex) \
103 V(Goto) \ 103 V(Goto) \
104 V(HasCachedArrayIndexAndBranch) \ 104 V(HasCachedArrayIndexAndBranch) \
105 V(HasInstanceTypeAndBranch) \ 105 V(HasInstanceTypeAndBranch) \
106 V(InnerAllocatedObject) \ 106 V(InnerAllocatedObject) \
107 V(InstanceOf) \ 107 V(InstanceOf) \
108 V(InstanceOfKnownGlobal) \ 108 V(InstanceOfKnownGlobal) \
109 V(InvokeFunction) \ 109 V(InvokeFunction) \
110 V(IsConstructCallAndBranch) \ 110 V(IsConstructCallAndBranch) \
111 V(IsObjectAndBranch) \ 111 V(IsObjectAndBranch) \
112 V(IsStringAndBranch) \ 112 V(IsStringAndBranch) \
113 V(IsSmiAndBranch) \ 113 V(IsSmiAndBranch) \
114 V(IsUndetectableAndBranch) \ 114 V(IsUndetectableAndBranch) \
115 V(LeaveInlined) \ 115 V(LeaveInlined) \
116 V(LoadContextSlot) \ 116 V(LoadContextSlot) \
117 V(LoadFieldByIndex) \ 117 V(LoadFieldByIndex) \
118 V(LoadFunctionPrototype) \ 118 V(LoadFunctionPrototype) \
119 V(LoadGlobalCell) \ 119 V(LoadGlobalCell) \
120 V(LoadGlobalGeneric) \ 120 V(LoadGlobalGeneric) \
121 V(LoadKeyed) \ 121 V(LoadKeyed) \
122 V(LoadKeyedGeneric) \ 122 V(LoadKeyedGeneric) \
123 V(LoadNamedField) \ 123 V(LoadNamedField) \
124 V(LoadNamedGeneric) \ 124 V(LoadNamedGeneric) \
125 V(LoadRoot) \ 125 V(LoadRoot) \
126 V(MapEnumLength) \ 126 V(MapEnumLength) \
127 V(MathFloorOfDiv) \ 127 V(MathFloorOfDiv) \
128 V(MathMinMax) \ 128 V(MathMinMax) \
129 V(Mod) \ 129 V(Mod) \
130 V(Mul) \ 130 V(Mul) \
131 V(OsrEntry) \ 131 V(OsrEntry) \
132 V(Parameter) \ 132 V(Parameter) \
133 V(Power) \ 133 V(Power) \
134 V(PushArguments) \ 134 V(PushArguments) \
135 V(RegExpLiteral) \ 135 V(RegExpLiteral) \
136 V(Return) \ 136 V(Return) \
137 V(Ror) \ 137 V(Ror) \
138 V(Sar) \ 138 V(Sar) \
139 V(SeqStringGetChar) \ 139 V(SeqStringGetChar) \
140 V(SeqStringSetChar) \ 140 V(SeqStringSetChar) \
141 V(Shl) \ 141 V(Shl) \
142 V(Shr) \ 142 V(Shr) \
143 V(Simulate) \ 143 V(Simulate) \
144 V(StackCheck) \ 144 V(StackCheck) \
145 V(StoreCodeEntry) \ 145 V(StoreCodeEntry) \
146 V(StoreContextSlot) \ 146 V(StoreContextSlot) \
147 V(StoreFrameContext) \ 147 V(StoreFrameContext) \
148 V(StoreGlobalCell) \ 148 V(StoreGlobalCell) \
149 V(StoreKeyed) \ 149 V(StoreKeyed) \
150 V(StoreKeyedGeneric) \ 150 V(StoreKeyedGeneric) \
151 V(StoreNamedField) \ 151 V(StoreNamedField) \
152 V(StoreNamedGeneric) \ 152 V(StoreNamedGeneric) \
153 V(StringAdd) \ 153 V(StringAdd) \
154 V(StringCharCodeAt) \ 154 V(StringCharCodeAt) \
155 V(StringCharFromCode) \ 155 V(StringCharFromCode) \
156 V(StringCompareAndBranch) \ 156 V(StringCompareAndBranch) \
157 V(Sub) \ 157 V(Sub) \
158 V(ThisFunction) \ 158 V(TailCallThroughMegamorphicCache) \
159 V(ToFastProperties) \ 159 V(ThisFunction) \
160 V(TransitionElementsKind) \ 160 V(ToFastProperties) \
161 V(TrapAllocationMemento) \ 161 V(TransitionElementsKind) \
162 V(Typeof) \ 162 V(TrapAllocationMemento) \
163 V(TypeofIsAndBranch) \ 163 V(Typeof) \
164 V(UnaryMathOperation) \ 164 V(TypeofIsAndBranch) \
165 V(UnknownOSRValue) \ 165 V(UnaryMathOperation) \
166 V(UseConst) \ 166 V(UnknownOSRValue) \
167 V(UseConst) \
167 V(WrapReceiver) 168 V(WrapReceiver)
168 169
169 #define GVN_TRACKED_FLAG_LIST(V) \ 170 #define GVN_TRACKED_FLAG_LIST(V) \
170 V(NewSpacePromotion) 171 V(NewSpacePromotion)
171 172
172 #define GVN_UNTRACKED_FLAG_LIST(V) \ 173 #define GVN_UNTRACKED_FLAG_LIST(V) \
173 V(ArrayElements) \ 174 V(ArrayElements) \
174 V(ArrayLengths) \ 175 V(ArrayLengths) \
175 V(StringLengths) \ 176 V(StringLengths) \
176 V(BackingStoreFields) \ 177 V(BackingStoreFields) \
(...skipping 2140 matching lines...) Expand 10 before | Expand all | Expand 10 after
2317 }; 2318 };
2318 2319
2319 2320
2320 class HCallWithDescriptor FINAL : public HInstruction { 2321 class HCallWithDescriptor FINAL : public HInstruction {
2321 public: 2322 public:
2322 static HCallWithDescriptor* New(Zone* zone, HValue* context, HValue* target, 2323 static HCallWithDescriptor* New(Zone* zone, HValue* context, HValue* target,
2323 int argument_count, 2324 int argument_count,
2324 CallInterfaceDescriptor descriptor, 2325 CallInterfaceDescriptor descriptor,
2325 const Vector<HValue*>& operands) { 2326 const Vector<HValue*>& operands) {
2326 DCHECK(operands.length() == descriptor.GetEnvironmentLength()); 2327 DCHECK(operands.length() == descriptor.GetEnvironmentLength());
2327 HCallWithDescriptor* res = 2328 HCallWithDescriptor* res = new (zone)
2328 new(zone) HCallWithDescriptor(target, argument_count, 2329 HCallWithDescriptor(target, argument_count, descriptor, operands, zone);
2329 descriptor, operands, zone);
2330 return res; 2330 return res;
2331 } 2331 }
2332 2332
2333 virtual int OperandCount() const FINAL OVERRIDE { 2333 virtual int OperandCount() const FINAL OVERRIDE {
2334 return values_.length(); 2334 return values_.length();
2335 } 2335 }
2336 virtual HValue* OperandAt(int index) const FINAL OVERRIDE { 2336 virtual HValue* OperandAt(int index) const FINAL OVERRIDE {
2337 return values_[index]; 2337 return values_[index];
2338 } 2338 }
2339 2339
(...skipping 3005 matching lines...) Expand 10 before | Expand all | Expand 10 after
5345 private: 5345 private:
5346 HCallStub(HValue* context, CodeStub::Major major_key, int argument_count) 5346 HCallStub(HValue* context, CodeStub::Major major_key, int argument_count)
5347 : HUnaryCall(context, argument_count), 5347 : HUnaryCall(context, argument_count),
5348 major_key_(major_key) { 5348 major_key_(major_key) {
5349 } 5349 }
5350 5350
5351 CodeStub::Major major_key_; 5351 CodeStub::Major major_key_;
5352 }; 5352 };
5353 5353
5354 5354
5355 class HTailCallThroughMegamorphicCache FINAL : public HTemplateInstruction<3> {
5356 public:
5357 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HTailCallThroughMegamorphicCache,
5358 HValue*, HValue*, Code::Flags);
5359
5360 virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
5361 return Representation::Tagged();
5362 }
5363
5364 HValue* context() const { return OperandAt(0); }
5365 HValue* receiver() const { return OperandAt(1); }
5366 HValue* name() const { return OperandAt(2); }
5367 Code::Flags flags() const { return flags_; }
5368
5369 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT
5370
5371 DECLARE_CONCRETE_INSTRUCTION(TailCallThroughMegamorphicCache)
5372
5373 private:
5374 HTailCallThroughMegamorphicCache(HValue* context, HValue* receiver,
5375 HValue* name, Code::Flags flags)
5376 : flags_(flags) {
5377 SetOperandAt(0, context);
5378 SetOperandAt(1, receiver);
5379 SetOperandAt(2, name);
5380 }
5381
5382 Code::Flags flags_;
5383 };
5384
5385
5355 class HUnknownOSRValue FINAL : public HTemplateInstruction<0> { 5386 class HUnknownOSRValue FINAL : public HTemplateInstruction<0> {
5356 public: 5387 public:
5357 DECLARE_INSTRUCTION_FACTORY_P2(HUnknownOSRValue, HEnvironment*, int); 5388 DECLARE_INSTRUCTION_FACTORY_P2(HUnknownOSRValue, HEnvironment*, int);
5358 5389
5359 virtual OStream& PrintDataTo(OStream& os) const; // NOLINT 5390 virtual OStream& PrintDataTo(OStream& os) const; // NOLINT
5360 5391
5361 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { 5392 virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
5362 return Representation::None(); 5393 return Representation::None();
5363 } 5394 }
5364 5395
(...skipping 2496 matching lines...) Expand 10 before | Expand all | Expand 10 after
7861 }; 7892 };
7862 7893
7863 7894
7864 7895
7865 #undef DECLARE_INSTRUCTION 7896 #undef DECLARE_INSTRUCTION
7866 #undef DECLARE_CONCRETE_INSTRUCTION 7897 #undef DECLARE_CONCRETE_INSTRUCTION
7867 7898
7868 } } // namespace v8::internal 7899 } } // namespace v8::internal
7869 7900
7870 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7901 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698