blob: 7c5a4afda376b0208e84b520301bc7e8a88b3e76 [file] [log] [blame]
erik.corry@gmail.comf2038fb2012-01-16 11:42:08 +00001// Copyright 2012 the V8 project authors. All rights reserved.
lrn@chromium.org7516f052011-03-30 08:52:27 +00002// Redistribution and use in source and binary forms, with or without
3// modification, are permitted provided that the following conditions are
4// met:
5//
6// * Redistributions of source code must retain the above copyright
7// notice, this list of conditions and the following disclaimer.
8// * Redistributions in binary form must reproduce the above
9// copyright notice, this list of conditions and the following
10// disclaimer in the documentation and/or other materials provided
11// with the distribution.
12// * Neither the name of Google Inc. nor the names of its
13// contributors may be used to endorse or promote products derived
14// from this software without specific prior written permission.
15//
16// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28#ifndef V8_MIPS_LITHIUM_MIPS_H_
29#define V8_MIPS_LITHIUM_MIPS_H_
30
31#include "hydrogen.h"
32#include "lithium-allocator.h"
33#include "lithium.h"
34#include "safepoint-table.h"
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +000035#include "utils.h"
lrn@chromium.org7516f052011-03-30 08:52:27 +000036
37namespace v8 {
38namespace internal {
39
40// Forward declarations.
41class LCodeGen;
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +000042
43#define LITHIUM_ALL_INSTRUCTION_LIST(V) \
44 V(ControlInstruction) \
45 V(Call) \
46 LITHIUM_CONCRETE_INSTRUCTION_LIST(V)
47
48
49#define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \
50 V(AccessArgumentsAt) \
51 V(AddI) \
ulan@chromium.org967e2702012-02-28 09:49:15 +000052 V(AllocateObject) \
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +000053 V(ApplyArguments) \
54 V(ArgumentsElements) \
55 V(ArgumentsLength) \
56 V(ArithmeticD) \
57 V(ArithmeticT) \
58 V(ArrayLiteral) \
59 V(BitI) \
60 V(BitNotI) \
61 V(BoundsCheck) \
62 V(Branch) \
63 V(CallConstantFunction) \
64 V(CallFunction) \
65 V(CallGlobal) \
66 V(CallKeyed) \
67 V(CallKnownGlobal) \
68 V(CallNamed) \
69 V(CallNew) \
70 V(CallRuntime) \
71 V(CallStub) \
72 V(CheckFunction) \
73 V(CheckInstanceType) \
74 V(CheckMap) \
75 V(CheckNonSmi) \
76 V(CheckPrototypeMaps) \
77 V(CheckSmi) \
78 V(ClampDToUint8) \
79 V(ClampIToUint8) \
80 V(ClampTToUint8) \
81 V(ClassOfTestAndBranch) \
82 V(CmpConstantEqAndBranch) \
83 V(CmpIDAndBranch) \
84 V(CmpObjectEqAndBranch) \
85 V(CmpMapAndBranch) \
86 V(CmpT) \
87 V(ConstantD) \
88 V(ConstantI) \
89 V(ConstantT) \
90 V(Context) \
jkummerow@chromium.orgf7a58842012-02-21 10:08:21 +000091 V(DeclareGlobals) \
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +000092 V(DeleteProperty) \
93 V(Deoptimize) \
94 V(DivI) \
95 V(DoubleToI) \
96 V(ElementsKind) \
jkummerow@chromium.orgf7a58842012-02-21 10:08:21 +000097 V(FastLiteral) \
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +000098 V(FixedArrayBaseLength) \
99 V(FunctionLiteral) \
100 V(GetCachedArrayIndex) \
101 V(GlobalObject) \
102 V(GlobalReceiver) \
103 V(Goto) \
104 V(HasCachedArrayIndexAndBranch) \
105 V(HasInstanceTypeAndBranch) \
106 V(In) \
107 V(InstanceOf) \
108 V(InstanceOfKnownGlobal) \
109 V(InstructionGap) \
110 V(Integer32ToDouble) \
111 V(InvokeFunction) \
112 V(IsConstructCallAndBranch) \
113 V(IsNilAndBranch) \
114 V(IsObjectAndBranch) \
mstarzinger@chromium.orgf8c6bd52011-11-23 12:13:52 +0000115 V(IsStringAndBranch) \
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000116 V(IsSmiAndBranch) \
117 V(IsUndetectableAndBranch) \
mstarzinger@chromium.orgf8c6bd52011-11-23 12:13:52 +0000118 V(StringCompareAndBranch) \
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000119 V(JSArrayLength) \
120 V(Label) \
121 V(LazyBailout) \
122 V(LoadContextSlot) \
123 V(LoadElements) \
124 V(LoadExternalArrayPointer) \
125 V(LoadFunctionPrototype) \
126 V(LoadGlobalCell) \
127 V(LoadGlobalGeneric) \
128 V(LoadKeyedFastDoubleElement) \
129 V(LoadKeyedFastElement) \
130 V(LoadKeyedGeneric) \
131 V(LoadKeyedSpecializedArrayElement) \
132 V(LoadNamedField) \
133 V(LoadNamedFieldPolymorphic) \
134 V(LoadNamedGeneric) \
135 V(ModI) \
136 V(MulI) \
137 V(NumberTagD) \
138 V(NumberTagI) \
139 V(NumberUntagD) \
jkummerow@chromium.orgf7a58842012-02-21 10:08:21 +0000140 V(ObjectLiteral) \
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000141 V(OsrEntry) \
142 V(OuterContext) \
143 V(Parameter) \
144 V(Power) \
145 V(PushArgument) \
erik.corry@gmail.comf2038fb2012-01-16 11:42:08 +0000146 V(Random) \
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000147 V(RegExpLiteral) \
148 V(Return) \
149 V(ShiftI) \
150 V(SmiTag) \
151 V(SmiUntag) \
152 V(StackCheck) \
153 V(StoreContextSlot) \
154 V(StoreGlobalCell) \
155 V(StoreGlobalGeneric) \
156 V(StoreKeyedFastDoubleElement) \
157 V(StoreKeyedFastElement) \
158 V(StoreKeyedGeneric) \
159 V(StoreKeyedSpecializedArrayElement) \
160 V(StoreNamedField) \
161 V(StoreNamedGeneric) \
162 V(StringAdd) \
163 V(StringCharCodeAt) \
164 V(StringCharFromCode) \
165 V(StringLength) \
166 V(SubI) \
167 V(TaggedToI) \
168 V(ThisFunction) \
169 V(Throw) \
170 V(ToFastProperties) \
171 V(TransitionElementsKind) \
172 V(Typeof) \
173 V(TypeofIsAndBranch) \
174 V(UnaryMathOperation) \
175 V(UnknownOSRValue) \
ulan@chromium.org812308e2012-02-29 15:58:45 +0000176 V(ValueOf) \
177 V(ForInPrepareMap) \
178 V(ForInCacheArray) \
179 V(CheckMapValue) \
yangguo@chromium.org154ff992012-03-13 08:09:54 +0000180 V(LoadFieldByIndex) \
181 V(DateField)
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000182
183#define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \
184 virtual Opcode opcode() const { return LInstruction::k##type; } \
185 virtual void CompileToNative(LCodeGen* generator); \
186 virtual const char* Mnemonic() const { return mnemonic; } \
187 static L##type* cast(LInstruction* instr) { \
188 ASSERT(instr->Is##type()); \
189 return reinterpret_cast<L##type*>(instr); \
190 }
191
192
193#define DECLARE_HYDROGEN_ACCESSOR(type) \
194 H##type* hydrogen() const { \
195 return H##type::cast(hydrogen_value()); \
196 }
197
lrn@chromium.org7516f052011-03-30 08:52:27 +0000198
199class LInstruction: public ZoneObject {
200 public:
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000201 LInstruction()
202 : environment_(NULL),
203 hydrogen_value_(NULL),
204 is_call_(false),
205 is_save_doubles_(false) { }
lrn@chromium.org7516f052011-03-30 08:52:27 +0000206 virtual ~LInstruction() { }
207
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000208 virtual void CompileToNative(LCodeGen* generator) = 0;
209 virtual const char* Mnemonic() const = 0;
210 virtual void PrintTo(StringStream* stream);
211 virtual void PrintDataTo(StringStream* stream) = 0;
212 virtual void PrintOutputOperandTo(StringStream* stream) = 0;
213
214 enum Opcode {
215 // Declare a unique enum value for each instruction.
216#define DECLARE_OPCODE(type) k##type,
217 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_OPCODE)
218 kNumberOfInstructions
219#undef DECLARE_OPCODE
220 };
221
222 virtual Opcode opcode() const = 0;
223
224 // Declare non-virtual type testers for all leaf IR classes.
225#define DECLARE_PREDICATE(type) \
226 bool Is##type() const { return opcode() == k##type; }
227 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_PREDICATE)
228#undef DECLARE_PREDICATE
229
230 // Declare virtual predicates for instructions that don't have
231 // an opcode.
232 virtual bool IsGap() const { return false; }
233
234 virtual bool IsControl() const { return false; }
235
236 void set_environment(LEnvironment* env) { environment_ = env; }
237 LEnvironment* environment() const { return environment_; }
238 bool HasEnvironment() const { return environment_ != NULL; }
239
240 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); }
241 LPointerMap* pointer_map() const { return pointer_map_.get(); }
242 bool HasPointerMap() const { return pointer_map_.is_set(); }
243
244 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
245 HValue* hydrogen_value() const { return hydrogen_value_; }
246
247 void set_deoptimization_environment(LEnvironment* env) {
248 deoptimization_environment_.set(env);
lrn@chromium.org7516f052011-03-30 08:52:27 +0000249 }
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000250 LEnvironment* deoptimization_environment() const {
251 return deoptimization_environment_.get();
252 }
253 bool HasDeoptimizationEnvironment() const {
254 return deoptimization_environment_.is_set();
lrn@chromium.org7516f052011-03-30 08:52:27 +0000255 }
256
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000257 void MarkAsCall() { is_call_ = true; }
258 void MarkAsSaveDoubles() { is_save_doubles_ = true; }
lrn@chromium.org7516f052011-03-30 08:52:27 +0000259
260 // Interface to the register allocator and iterators.
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000261 bool IsMarkedAsCall() const { return is_call_; }
262 bool IsMarkedAsSaveDoubles() const { return is_save_doubles_; }
lrn@chromium.org7516f052011-03-30 08:52:27 +0000263
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000264 virtual bool HasResult() const = 0;
265 virtual LOperand* result() = 0;
lrn@chromium.org7516f052011-03-30 08:52:27 +0000266
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000267 virtual int InputCount() = 0;
268 virtual LOperand* InputAt(int i) = 0;
269 virtual int TempCount() = 0;
270 virtual LOperand* TempAt(int i) = 0;
lrn@chromium.org7516f052011-03-30 08:52:27 +0000271
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000272 LOperand* FirstInput() { return InputAt(0); }
273 LOperand* Output() { return HasResult() ? result() : NULL; }
lrn@chromium.org7516f052011-03-30 08:52:27 +0000274
275#ifdef DEBUG
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000276 void VerifyCall();
lrn@chromium.org7516f052011-03-30 08:52:27 +0000277#endif
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000278
279 private:
280 LEnvironment* environment_;
281 SetOncePointer<LPointerMap> pointer_map_;
282 HValue* hydrogen_value_;
283 SetOncePointer<LEnvironment> deoptimization_environment_;
284 bool is_call_;
285 bool is_save_doubles_;
lrn@chromium.org7516f052011-03-30 08:52:27 +0000286};
287
288
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000289// R = number of result operands (0 or 1).
290// I = number of input operands.
291// T = number of temporary operands.
292template<int R, int I, int T>
293class LTemplateInstruction: public LInstruction {
lrn@chromium.org7516f052011-03-30 08:52:27 +0000294 public:
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000295 // Allow 0 or 1 output operands.
296 STATIC_ASSERT(R == 0 || R == 1);
297 virtual bool HasResult() const { return R != 0; }
298 void set_result(LOperand* operand) { results_[0] = operand; }
299 LOperand* result() { return results_[0]; }
lrn@chromium.org7516f052011-03-30 08:52:27 +0000300
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000301 int InputCount() { return I; }
302 LOperand* InputAt(int i) { return inputs_[i]; }
303
304 int TempCount() { return T; }
305 LOperand* TempAt(int i) { return temps_[i]; }
306
307 virtual void PrintDataTo(StringStream* stream);
308 virtual void PrintOutputOperandTo(StringStream* stream);
309
310 protected:
311 EmbeddedContainer<LOperand*, R> results_;
312 EmbeddedContainer<LOperand*, I> inputs_;
313 EmbeddedContainer<LOperand*, T> temps_;
314};
315
316
317class LGap: public LTemplateInstruction<0, 0, 0> {
318 public:
319 explicit LGap(HBasicBlock* block)
320 : block_(block) {
321 parallel_moves_[BEFORE] = NULL;
322 parallel_moves_[START] = NULL;
323 parallel_moves_[END] = NULL;
324 parallel_moves_[AFTER] = NULL;
lrn@chromium.org7516f052011-03-30 08:52:27 +0000325 }
326
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000327 // Can't use the DECLARE-macro here because of sub-classes.
328 virtual bool IsGap() const { return true; }
329 virtual void PrintDataTo(StringStream* stream);
330 static LGap* cast(LInstruction* instr) {
331 ASSERT(instr->IsGap());
332 return reinterpret_cast<LGap*>(instr);
333 }
334
335 bool IsRedundant() const;
336
337 HBasicBlock* block() const { return block_; }
338
lrn@chromium.org7516f052011-03-30 08:52:27 +0000339 enum InnerPosition {
340 BEFORE,
341 START,
342 END,
343 AFTER,
344 FIRST_INNER_POSITION = BEFORE,
345 LAST_INNER_POSITION = AFTER
346 };
347
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000348 LParallelMove* GetOrCreateParallelMove(InnerPosition pos) {
349 if (parallel_moves_[pos] == NULL) parallel_moves_[pos] = new LParallelMove;
350 return parallel_moves_[pos];
lrn@chromium.org7516f052011-03-30 08:52:27 +0000351 }
352
353 LParallelMove* GetParallelMove(InnerPosition pos) {
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000354 return parallel_moves_[pos];
lrn@chromium.org7516f052011-03-30 08:52:27 +0000355 }
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000356
357 private:
358 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1];
359 HBasicBlock* block_;
360};
361
362
363class LInstructionGap: public LGap {
364 public:
365 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { }
366
367 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap")
368};
369
370
371class LGoto: public LTemplateInstruction<0, 0, 0> {
372 public:
373 explicit LGoto(int block_id) : block_id_(block_id) { }
374
375 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
376 virtual void PrintDataTo(StringStream* stream);
377 virtual bool IsControl() const { return true; }
378
379 int block_id() const { return block_id_; }
380
381 private:
382 int block_id_;
383};
384
385
386class LLazyBailout: public LTemplateInstruction<0, 0, 0> {
387 public:
388 LLazyBailout() : gap_instructions_size_(0) { }
389
390 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout")
391
392 void set_gap_instructions_size(int gap_instructions_size) {
393 gap_instructions_size_ = gap_instructions_size;
394 }
395 int gap_instructions_size() { return gap_instructions_size_; }
396
397 private:
398 int gap_instructions_size_;
399};
400
401
402class LDeoptimize: public LTemplateInstruction<0, 0, 0> {
403 public:
404 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
lrn@chromium.org7516f052011-03-30 08:52:27 +0000405};
406
407
408class LLabel: public LGap {
409 public:
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000410 explicit LLabel(HBasicBlock* block)
411 : LGap(block), replacement_(NULL) { }
412
413 DECLARE_CONCRETE_INSTRUCTION(Label, "label")
414
415 virtual void PrintDataTo(StringStream* stream);
416
417 int block_id() const { return block()->block_id(); }
418 bool is_loop_header() const { return block()->IsLoopHeader(); }
419 Label* label() { return &label_; }
420 LLabel* replacement() const { return replacement_; }
421 void set_replacement(LLabel* label) { replacement_ = label; }
422 bool HasReplacement() const { return replacement_ != NULL; }
423
424 private:
425 Label label_;
426 LLabel* replacement_;
lrn@chromium.org7516f052011-03-30 08:52:27 +0000427};
428
429
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000430class LParameter: public LTemplateInstruction<1, 0, 0> {
lrn@chromium.org7516f052011-03-30 08:52:27 +0000431 public:
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000432 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
433};
lrn@chromium.org7516f052011-03-30 08:52:27 +0000434
lrn@chromium.org7516f052011-03-30 08:52:27 +0000435
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000436class LCallStub: public LTemplateInstruction<1, 0, 0> {
437 public:
438 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
439 DECLARE_HYDROGEN_ACCESSOR(CallStub)
440
441 TranscendentalCache::Type transcendental_type() {
442 return hydrogen()->transcendental_type();
lrn@chromium.org7516f052011-03-30 08:52:27 +0000443 }
444};
445
446
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000447class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> {
448 public:
449 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
450};
451
452
453template<int I, int T>
454class LControlInstruction: public LTemplateInstruction<0, I, T> {
455 public:
456 virtual bool IsControl() const { return true; }
457
458 int SuccessorCount() { return hydrogen()->SuccessorCount(); }
459 HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); }
460 int true_block_id() { return hydrogen()->SuccessorAt(0)->block_id(); }
461 int false_block_id() { return hydrogen()->SuccessorAt(1)->block_id(); }
462
463 private:
464 HControlInstruction* hydrogen() {
465 return HControlInstruction::cast(this->hydrogen_value());
466 }
467};
468
469
470class LApplyArguments: public LTemplateInstruction<1, 4, 0> {
471 public:
472 LApplyArguments(LOperand* function,
473 LOperand* receiver,
474 LOperand* length,
475 LOperand* elements) {
476 inputs_[0] = function;
477 inputs_[1] = receiver;
478 inputs_[2] = length;
479 inputs_[3] = elements;
480 }
481
482 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments")
483
484 LOperand* function() { return inputs_[0]; }
485 LOperand* receiver() { return inputs_[1]; }
486 LOperand* length() { return inputs_[2]; }
487 LOperand* elements() { return inputs_[3]; }
488};
489
490
491class LAccessArgumentsAt: public LTemplateInstruction<1, 3, 0> {
492 public:
493 LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index) {
494 inputs_[0] = arguments;
495 inputs_[1] = length;
496 inputs_[2] = index;
497 }
498
499 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at")
500
501 LOperand* arguments() { return inputs_[0]; }
502 LOperand* length() { return inputs_[1]; }
503 LOperand* index() { return inputs_[2]; }
504
505 virtual void PrintDataTo(StringStream* stream);
506};
507
508
509class LArgumentsLength: public LTemplateInstruction<1, 1, 0> {
510 public:
511 explicit LArgumentsLength(LOperand* elements) {
512 inputs_[0] = elements;
513 }
514
515 DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length")
516};
517
518
519class LArgumentsElements: public LTemplateInstruction<1, 0, 0> {
520 public:
521 LArgumentsElements() { }
522
523 DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements")
524};
525
526
527class LModI: public LTemplateInstruction<1, 2, 3> {
528 public:
529 // Used when the right hand is a constant power of 2.
530 LModI(LOperand* left,
531 LOperand* right) {
532 inputs_[0] = left;
533 inputs_[1] = right;
534 temps_[0] = NULL;
535 temps_[1] = NULL;
536 temps_[2] = NULL;
537 }
538
539 // Used for the standard case.
540 LModI(LOperand* left,
541 LOperand* right,
542 LOperand* temp1,
543 LOperand* temp2,
544 LOperand* temp3) {
545 inputs_[0] = left;
546 inputs_[1] = right;
547 temps_[0] = temp1;
548 temps_[1] = temp2;
549 temps_[2] = temp3;
550 }
551
552 DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i")
553 DECLARE_HYDROGEN_ACCESSOR(Mod)
554};
555
556
557class LDivI: public LTemplateInstruction<1, 2, 0> {
558 public:
559 LDivI(LOperand* left, LOperand* right) {
560 inputs_[0] = left;
561 inputs_[1] = right;
562 }
563
564 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
565 DECLARE_HYDROGEN_ACCESSOR(Div)
566};
567
568
569class LMulI: public LTemplateInstruction<1, 2, 1> {
570 public:
571 LMulI(LOperand* left, LOperand* right, LOperand* temp) {
572 inputs_[0] = left;
573 inputs_[1] = right;
574 temps_[0] = temp;
575 }
576
577 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
578 DECLARE_HYDROGEN_ACCESSOR(Mul)
579};
580
581
582class LCmpIDAndBranch: public LControlInstruction<2, 0> {
583 public:
584 LCmpIDAndBranch(LOperand* left, LOperand* right) {
585 inputs_[0] = left;
586 inputs_[1] = right;
587 }
588
589 DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch")
590 DECLARE_HYDROGEN_ACCESSOR(CompareIDAndBranch)
591
592 Token::Value op() const { return hydrogen()->token(); }
593 bool is_double() const {
594 return hydrogen()->GetInputRepresentation().IsDouble();
595 }
596
597 virtual void PrintDataTo(StringStream* stream);
598};
599
600
601class LUnaryMathOperation: public LTemplateInstruction<1, 1, 1> {
602 public:
603 LUnaryMathOperation(LOperand* value, LOperand* temp) {
604 inputs_[0] = value;
605 temps_[0] = temp;
606 }
607
608 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation")
609 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
610
611 virtual void PrintDataTo(StringStream* stream);
612 BuiltinFunctionId op() const { return hydrogen()->op(); }
613};
614
615
616class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> {
617 public:
618 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) {
619 inputs_[0] = left;
620 inputs_[1] = right;
621 }
622
623 DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch,
624 "cmp-object-eq-and-branch")
625 DECLARE_HYDROGEN_ACCESSOR(CompareObjectEqAndBranch)
626};
627
628
629class LCmpConstantEqAndBranch: public LControlInstruction<1, 0> {
630 public:
631 explicit LCmpConstantEqAndBranch(LOperand* left) {
632 inputs_[0] = left;
633 }
634
635 DECLARE_CONCRETE_INSTRUCTION(CmpConstantEqAndBranch,
636 "cmp-constant-eq-and-branch")
637 DECLARE_HYDROGEN_ACCESSOR(CompareConstantEqAndBranch)
638};
639
640
641class LIsNilAndBranch: public LControlInstruction<1, 0> {
642 public:
643 explicit LIsNilAndBranch(LOperand* value) {
644 inputs_[0] = value;
645 }
646
647 DECLARE_CONCRETE_INSTRUCTION(IsNilAndBranch, "is-nil-and-branch")
648 DECLARE_HYDROGEN_ACCESSOR(IsNilAndBranch)
649
650 EqualityKind kind() const { return hydrogen()->kind(); }
651 NilValue nil() const { return hydrogen()->nil(); }
652
653 virtual void PrintDataTo(StringStream* stream);
654};
655
656
657class LIsObjectAndBranch: public LControlInstruction<1, 1> {
658 public:
659 LIsObjectAndBranch(LOperand* value, LOperand* temp) {
660 inputs_[0] = value;
661 temps_[0] = temp;
662 }
663
664 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch")
665 DECLARE_HYDROGEN_ACCESSOR(IsObjectAndBranch)
666
667 virtual void PrintDataTo(StringStream* stream);
668};
669
670
mstarzinger@chromium.orgf8c6bd52011-11-23 12:13:52 +0000671class LIsStringAndBranch: public LControlInstruction<1, 1> {
672 public:
673 LIsStringAndBranch(LOperand* value, LOperand* temp) {
674 inputs_[0] = value;
675 temps_[0] = temp;
676 }
677
678 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch")
679 DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch)
680
681 virtual void PrintDataTo(StringStream* stream);
682};
683
684
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000685class LIsSmiAndBranch: public LControlInstruction<1, 0> {
686 public:
687 explicit LIsSmiAndBranch(LOperand* value) {
688 inputs_[0] = value;
689 }
690
691 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
692 DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch)
693
694 virtual void PrintDataTo(StringStream* stream);
695};
696
697
698class LIsUndetectableAndBranch: public LControlInstruction<1, 1> {
699 public:
700 explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) {
701 inputs_[0] = value;
702 temps_[0] = temp;
703 }
704
705 DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch,
706 "is-undetectable-and-branch")
707 DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch)
708
709 virtual void PrintDataTo(StringStream* stream);
710};
711
712
mstarzinger@chromium.orgf8c6bd52011-11-23 12:13:52 +0000713class LStringCompareAndBranch: public LControlInstruction<2, 0> {
714 public:
715 LStringCompareAndBranch(LOperand* left, LOperand* right) {
716 inputs_[0] = left;
717 inputs_[1] = right;
718 }
719
720 DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch,
721 "string-compare-and-branch")
722 DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch)
723
724 Token::Value op() const { return hydrogen()->token(); }
725
726 virtual void PrintDataTo(StringStream* stream);
727};
728
729
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +0000730class LHasInstanceTypeAndBranch: public LControlInstruction<1, 0> {
731 public:
732 explicit LHasInstanceTypeAndBranch(LOperand* value) {
733 inputs_[0] = value;
734 }
735
736 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
737 "has-instance-type-and-branch")
738 DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch)
739
740 virtual void PrintDataTo(StringStream* stream);
741};
742
743
744class LGetCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
745 public:
746 explicit LGetCachedArrayIndex(LOperand* value) {
747 inputs_[0] = value;
748 }
749
750 DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index")
751 DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex)
752};
753
754
755class LHasCachedArrayIndexAndBranch: public LControlInstruction<1, 0> {
756 public:
757 explicit LHasCachedArrayIndexAndBranch(LOperand* value) {
758 inputs_[0] = value;
759 }
760
761 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch,
762 "has-cached-array-index-and-branch")
763 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch)
764
765 virtual void PrintDataTo(StringStream* stream);
766};
767
768
769class LClassOfTestAndBranch: public LControlInstruction<1, 1> {
770 public:
771 LClassOfTestAndBranch(LOperand* value, LOperand* temp) {
772 inputs_[0] = value;
773 temps_[0] = temp;
774 }
775
776 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch,
777 "class-of-test-and-branch")
778 DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch)
779
780 virtual void PrintDataTo(StringStream* stream);
781};
782
783
784class LCmpT: public LTemplateInstruction<1, 2, 0> {
785 public:
786 LCmpT(LOperand* left, LOperand* right) {
787 inputs_[0] = left;
788 inputs_[1] = right;
789 }
790
791 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
792 DECLARE_HYDROGEN_ACCESSOR(CompareGeneric)
793
794 Token::Value op() const { return hydrogen()->token(); }
795};
796
797
798class LInstanceOf: public LTemplateInstruction<1, 2, 0> {
799 public:
800 LInstanceOf(LOperand* left, LOperand* right) {
801 inputs_[0] = left;
802 inputs_[1] = right;
803 }
804
805 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
806};
807
808
809class LInstanceOfKnownGlobal: public LTemplateInstruction<1, 1, 1> {
810 public:
811 LInstanceOfKnownGlobal(LOperand* value, LOperand* temp) {
812 inputs_[0] = value;
813 temps_[0] = temp;
814 }
815
816 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
817 "instance-of-known-global")
818 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal)
819
820 Handle<JSFunction> function() const { return hydrogen()->function(); }
821};
822
823
824class LBoundsCheck: public LTemplateInstruction<0, 2, 0> {
825 public:
826 LBoundsCheck(LOperand* index, LOperand* length) {
827 inputs_[0] = index;
828 inputs_[1] = length;
829 }
830
831 LOperand* index() { return inputs_[0]; }
832 LOperand* length() { return inputs_[1]; }
833
834 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check")
835};
836
837
838class LBitI: public LTemplateInstruction<1, 2, 0> {
839 public:
840 LBitI(LOperand* left, LOperand* right) {
841 inputs_[0] = left;
842 inputs_[1] = right;
843 }
844
845 Token::Value op() const { return hydrogen()->op(); }
846
847 DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i")
848 DECLARE_HYDROGEN_ACCESSOR(Bitwise)
849};
850
851
852class LShiftI: public LTemplateInstruction<1, 2, 0> {
853 public:
854 LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt)
855 : op_(op), can_deopt_(can_deopt) {
856 inputs_[0] = left;
857 inputs_[1] = right;
858 }
859
860 Token::Value op() const { return op_; }
861
862 bool can_deopt() const { return can_deopt_; }
863
864 DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i")
865
866 private:
867 Token::Value op_;
868 bool can_deopt_;
869};
870
871
872class LSubI: public LTemplateInstruction<1, 2, 0> {
873 public:
874 LSubI(LOperand* left, LOperand* right) {
875 inputs_[0] = left;
876 inputs_[1] = right;
877 }
878
879 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i")
880 DECLARE_HYDROGEN_ACCESSOR(Sub)
881};
882
883
884class LConstantI: public LTemplateInstruction<1, 0, 0> {
885 public:
886 DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i")
887 DECLARE_HYDROGEN_ACCESSOR(Constant)
888
889 int32_t value() const { return hydrogen()->Integer32Value(); }
890};
891
892
893class LConstantD: public LTemplateInstruction<1, 0, 0> {
894 public:
895 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
896 DECLARE_HYDROGEN_ACCESSOR(Constant)
897
898 double value() const { return hydrogen()->DoubleValue(); }
899};
900
901
902class LConstantT: public LTemplateInstruction<1, 0, 0> {
903 public:
904 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
905 DECLARE_HYDROGEN_ACCESSOR(Constant)
906
907 Handle<Object> value() const { return hydrogen()->handle(); }
908};
909
910
911class LBranch: public LControlInstruction<1, 0> {
912 public:
913 explicit LBranch(LOperand* value) {
914 inputs_[0] = value;
915 }
916
917 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
918 DECLARE_HYDROGEN_ACCESSOR(Branch)
919
920 virtual void PrintDataTo(StringStream* stream);
921};
922
923
924class LCmpMapAndBranch: public LTemplateInstruction<0, 1, 1> {
925 public:
926 LCmpMapAndBranch(LOperand* value, LOperand* temp) {
927 inputs_[0] = value;
928 temps_[0] = temp;
929 }
930
931 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
932 DECLARE_HYDROGEN_ACCESSOR(CompareMap)
933
934 virtual bool IsControl() const { return true; }
935
936 Handle<Map> map() const { return hydrogen()->map(); }
937 int true_block_id() const {
938 return hydrogen()->FirstSuccessor()->block_id();
939 }
940 int false_block_id() const {
941 return hydrogen()->SecondSuccessor()->block_id();
942 }
943};
944
945
946class LJSArrayLength: public LTemplateInstruction<1, 1, 0> {
947 public:
948 explicit LJSArrayLength(LOperand* value) {
949 inputs_[0] = value;
950 }
951
952 DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length")
953 DECLARE_HYDROGEN_ACCESSOR(JSArrayLength)
954};
955
956
957class LFixedArrayBaseLength: public LTemplateInstruction<1, 1, 0> {
958 public:
959 explicit LFixedArrayBaseLength(LOperand* value) {
960 inputs_[0] = value;
961 }
962
963 DECLARE_CONCRETE_INSTRUCTION(FixedArrayBaseLength,
964 "fixed-array-base-length")
965 DECLARE_HYDROGEN_ACCESSOR(FixedArrayBaseLength)
966};
967
968
969class LElementsKind: public LTemplateInstruction<1, 1, 0> {
970 public:
971 explicit LElementsKind(LOperand* value) {
972 inputs_[0] = value;
973 }
974
975 DECLARE_CONCRETE_INSTRUCTION(ElementsKind, "elements-kind")
976 DECLARE_HYDROGEN_ACCESSOR(ElementsKind)
977};
978
979
980class LValueOf: public LTemplateInstruction<1, 1, 1> {
981 public:
982 LValueOf(LOperand* value, LOperand* temp) {
983 inputs_[0] = value;
984 temps_[0] = temp;
985 }
986
987 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of")
988 DECLARE_HYDROGEN_ACCESSOR(ValueOf)
989};
990
991
yangguo@chromium.org154ff992012-03-13 08:09:54 +0000992class LDateField: public LTemplateInstruction<1, 1, 1> {
993 public:
994 LDateField(LOperand* date, LOperand* temp, Smi* index) : index_(index) {
995 inputs_[0] = date;
996 temps_[0] = temp;
997 }
998
999 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "date-field")
1000 DECLARE_HYDROGEN_ACCESSOR(ValueOf)
1001 Smi* index() const { return index_; }
1002
1003 private:
1004 Smi* index_;
1005};
1006
1007
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00001008class LThrow: public LTemplateInstruction<0, 1, 0> {
1009 public:
1010 explicit LThrow(LOperand* value) {
1011 inputs_[0] = value;
1012 }
1013
1014 DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
1015};
1016
1017
1018class LBitNotI: public LTemplateInstruction<1, 1, 0> {
1019 public:
1020 explicit LBitNotI(LOperand* value) {
1021 inputs_[0] = value;
1022 }
1023
1024 DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i")
1025};
1026
1027
1028class LAddI: public LTemplateInstruction<1, 2, 0> {
1029 public:
1030 LAddI(LOperand* left, LOperand* right) {
1031 inputs_[0] = left;
1032 inputs_[1] = right;
1033 }
1034
1035 DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i")
1036 DECLARE_HYDROGEN_ACCESSOR(Add)
1037};
1038
1039
1040class LPower: public LTemplateInstruction<1, 2, 0> {
1041 public:
1042 LPower(LOperand* left, LOperand* right) {
1043 inputs_[0] = left;
1044 inputs_[1] = right;
1045 }
1046
1047 DECLARE_CONCRETE_INSTRUCTION(Power, "power")
1048 DECLARE_HYDROGEN_ACCESSOR(Power)
1049};
1050
1051
erik.corry@gmail.comf2038fb2012-01-16 11:42:08 +00001052class LRandom: public LTemplateInstruction<1, 1, 0> {
1053 public:
1054 explicit LRandom(LOperand* global_object) {
1055 inputs_[0] = global_object;
1056 }
1057
1058 DECLARE_CONCRETE_INSTRUCTION(Random, "random")
1059 DECLARE_HYDROGEN_ACCESSOR(Random)
1060};
1061
1062
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00001063class LArithmeticD: public LTemplateInstruction<1, 2, 0> {
1064 public:
1065 LArithmeticD(Token::Value op, LOperand* left, LOperand* right)
1066 : op_(op) {
1067 inputs_[0] = left;
1068 inputs_[1] = right;
1069 }
1070
1071 Token::Value op() const { return op_; }
1072
1073 virtual Opcode opcode() const { return LInstruction::kArithmeticD; }
1074 virtual void CompileToNative(LCodeGen* generator);
1075 virtual const char* Mnemonic() const;
1076
1077 private:
1078 Token::Value op_;
1079};
1080
1081
1082class LArithmeticT: public LTemplateInstruction<1, 2, 0> {
1083 public:
1084 LArithmeticT(Token::Value op, LOperand* left, LOperand* right)
1085 : op_(op) {
1086 inputs_[0] = left;
1087 inputs_[1] = right;
1088 }
1089
1090 virtual Opcode opcode() const { return LInstruction::kArithmeticT; }
1091 virtual void CompileToNative(LCodeGen* generator);
1092 virtual const char* Mnemonic() const;
1093
1094 Token::Value op() const { return op_; }
1095
1096 private:
1097 Token::Value op_;
1098};
1099
1100
1101class LReturn: public LTemplateInstruction<0, 1, 0> {
1102 public:
1103 explicit LReturn(LOperand* value) {
1104 inputs_[0] = value;
1105 }
1106
1107 DECLARE_CONCRETE_INSTRUCTION(Return, "return")
1108};
1109
1110
1111class LLoadNamedField: public LTemplateInstruction<1, 1, 0> {
1112 public:
1113 explicit LLoadNamedField(LOperand* object) {
1114 inputs_[0] = object;
1115 }
1116
1117 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field")
1118 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField)
1119};
1120
1121
1122class LLoadNamedFieldPolymorphic: public LTemplateInstruction<1, 1, 0> {
1123 public:
1124 explicit LLoadNamedFieldPolymorphic(LOperand* object) {
1125 inputs_[0] = object;
1126 }
1127
1128 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field-polymorphic")
1129 DECLARE_HYDROGEN_ACCESSOR(LoadNamedFieldPolymorphic)
1130
1131 LOperand* object() { return inputs_[0]; }
1132};
1133
1134
1135class LLoadNamedGeneric: public LTemplateInstruction<1, 1, 0> {
1136 public:
1137 explicit LLoadNamedGeneric(LOperand* object) {
1138 inputs_[0] = object;
1139 }
1140
1141 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
1142 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
1143
1144 LOperand* object() { return inputs_[0]; }
1145 Handle<Object> name() const { return hydrogen()->name(); }
1146};
1147
1148
1149class LLoadFunctionPrototype: public LTemplateInstruction<1, 1, 0> {
1150 public:
1151 explicit LLoadFunctionPrototype(LOperand* function) {
1152 inputs_[0] = function;
1153 }
1154
1155 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype")
1156 DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype)
1157
1158 LOperand* function() { return inputs_[0]; }
1159};
1160
1161
1162class LLoadElements: public LTemplateInstruction<1, 1, 0> {
1163 public:
1164 explicit LLoadElements(LOperand* object) {
1165 inputs_[0] = object;
1166 }
1167
1168 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements")
1169};
1170
1171
1172class LLoadExternalArrayPointer: public LTemplateInstruction<1, 1, 0> {
1173 public:
1174 explicit LLoadExternalArrayPointer(LOperand* object) {
1175 inputs_[0] = object;
1176 }
1177
1178 DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer,
1179 "load-external-array-pointer")
1180};
1181
1182
1183class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> {
1184 public:
1185 LLoadKeyedFastElement(LOperand* elements, LOperand* key) {
1186 inputs_[0] = elements;
1187 inputs_[1] = key;
1188 }
1189
1190 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element")
1191 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement)
1192
1193 LOperand* elements() { return inputs_[0]; }
1194 LOperand* key() { return inputs_[1]; }
1195};
1196
1197
1198class LLoadKeyedFastDoubleElement: public LTemplateInstruction<1, 2, 0> {
1199 public:
1200 LLoadKeyedFastDoubleElement(LOperand* elements, LOperand* key) {
1201 inputs_[0] = elements;
1202 inputs_[1] = key;
1203 }
1204
1205 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastDoubleElement,
1206 "load-keyed-fast-double-element")
1207 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastDoubleElement)
1208
1209 LOperand* elements() { return inputs_[0]; }
1210 LOperand* key() { return inputs_[1]; }
1211};
1212
1213
1214class LLoadKeyedSpecializedArrayElement: public LTemplateInstruction<1, 2, 0> {
1215 public:
1216 LLoadKeyedSpecializedArrayElement(LOperand* external_pointer,
1217 LOperand* key) {
1218 inputs_[0] = external_pointer;
1219 inputs_[1] = key;
1220 }
1221
1222 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedSpecializedArrayElement,
1223 "load-keyed-specialized-array-element")
1224 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedSpecializedArrayElement)
1225
1226 LOperand* external_pointer() { return inputs_[0]; }
1227 LOperand* key() { return inputs_[1]; }
1228 ElementsKind elements_kind() const {
1229 return hydrogen()->elements_kind();
1230 }
1231};
1232
1233
1234class LLoadKeyedGeneric: public LTemplateInstruction<1, 2, 0> {
1235 public:
1236 LLoadKeyedGeneric(LOperand* obj, LOperand* key) {
1237 inputs_[0] = obj;
1238 inputs_[1] = key;
1239 }
1240
1241 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
1242
1243 LOperand* object() { return inputs_[0]; }
1244 LOperand* key() { return inputs_[1]; }
1245};
1246
1247
1248class LLoadGlobalCell: public LTemplateInstruction<1, 0, 0> {
1249 public:
1250 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load-global-cell")
1251 DECLARE_HYDROGEN_ACCESSOR(LoadGlobalCell)
1252};
1253
1254
1255class LLoadGlobalGeneric: public LTemplateInstruction<1, 1, 0> {
1256 public:
1257 explicit LLoadGlobalGeneric(LOperand* global_object) {
1258 inputs_[0] = global_object;
1259 }
1260
1261 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic")
1262 DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric)
1263
1264 LOperand* global_object() { return inputs_[0]; }
1265 Handle<Object> name() const { return hydrogen()->name(); }
1266 bool for_typeof() const { return hydrogen()->for_typeof(); }
1267};
1268
1269
1270class LStoreGlobalCell: public LTemplateInstruction<0, 1, 1> {
1271 public:
1272 LStoreGlobalCell(LOperand* value, LOperand* temp) {
1273 inputs_[0] = value;
1274 temps_[0] = temp;
1275 }
1276
1277 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell")
1278 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell)
danno@chromium.orge78f9fc2011-12-21 08:29:34 +00001279
1280 LOperand* value() { return inputs_[0]; }
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00001281};
1282
1283
1284class LStoreGlobalGeneric: public LTemplateInstruction<0, 2, 0> {
1285 public:
1286 explicit LStoreGlobalGeneric(LOperand* global_object,
1287 LOperand* value) {
1288 inputs_[0] = global_object;
1289 inputs_[1] = value;
1290 }
1291
1292 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store-global-generic")
1293 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalGeneric)
1294
1295 LOperand* global_object() { return InputAt(0); }
1296 Handle<Object> name() const { return hydrogen()->name(); }
1297 LOperand* value() { return InputAt(1); }
mstarzinger@chromium.org1b3afd12011-11-29 14:28:56 +00001298 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); }
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00001299};
1300
1301
1302class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> {
1303 public:
1304 explicit LLoadContextSlot(LOperand* context) {
1305 inputs_[0] = context;
1306 }
1307
1308 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot")
1309 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot)
1310
1311 LOperand* context() { return InputAt(0); }
1312 int slot_index() { return hydrogen()->slot_index(); }
1313
1314 virtual void PrintDataTo(StringStream* stream);
1315};
1316
1317
1318class LStoreContextSlot: public LTemplateInstruction<0, 2, 0> {
1319 public:
1320 LStoreContextSlot(LOperand* context, LOperand* value) {
1321 inputs_[0] = context;
1322 inputs_[1] = value;
1323 }
1324
1325 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
1326 DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
1327
1328 LOperand* context() { return InputAt(0); }
1329 LOperand* value() { return InputAt(1); }
1330 int slot_index() { return hydrogen()->slot_index(); }
1331
1332 virtual void PrintDataTo(StringStream* stream);
1333};
1334
1335
1336class LPushArgument: public LTemplateInstruction<0, 1, 0> {
1337 public:
1338 explicit LPushArgument(LOperand* value) {
1339 inputs_[0] = value;
1340 }
1341
1342 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
1343};
1344
1345
1346class LThisFunction: public LTemplateInstruction<1, 0, 0> {
1347 public:
1348 DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function")
1349 DECLARE_HYDROGEN_ACCESSOR(ThisFunction)
1350};
1351
1352
1353class LContext: public LTemplateInstruction<1, 0, 0> {
1354 public:
1355 DECLARE_CONCRETE_INSTRUCTION(Context, "context")
1356};
1357
1358
1359class LOuterContext: public LTemplateInstruction<1, 1, 0> {
1360 public:
1361 explicit LOuterContext(LOperand* context) {
1362 inputs_[0] = context;
1363 }
1364
1365 DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context")
1366
1367 LOperand* context() { return InputAt(0); }
1368};
1369
1370
jkummerow@chromium.orgf7a58842012-02-21 10:08:21 +00001371class LDeclareGlobals: public LTemplateInstruction<0, 0, 0> {
1372 public:
1373 DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals")
1374 DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals)
1375};
1376
1377
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00001378class LGlobalObject: public LTemplateInstruction<1, 1, 0> {
1379 public:
1380 explicit LGlobalObject(LOperand* context) {
1381 inputs_[0] = context;
1382 }
1383
1384 DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object")
1385
1386 LOperand* context() { return InputAt(0); }
1387};
1388
1389
1390class LGlobalReceiver: public LTemplateInstruction<1, 1, 0> {
1391 public:
1392 explicit LGlobalReceiver(LOperand* global_object) {
1393 inputs_[0] = global_object;
1394 }
1395
1396 DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver")
1397
1398 LOperand* global() { return InputAt(0); }
1399};
1400
1401
1402class LCallConstantFunction: public LTemplateInstruction<1, 0, 0> {
1403 public:
1404 DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function")
1405 DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction)
1406
1407 virtual void PrintDataTo(StringStream* stream);
1408
1409 Handle<JSFunction> function() { return hydrogen()->function(); }
1410 int arity() const { return hydrogen()->argument_count() - 1; }
1411};
1412
1413
1414class LInvokeFunction: public LTemplateInstruction<1, 1, 0> {
1415 public:
1416 explicit LInvokeFunction(LOperand* function) {
1417 inputs_[0] = function;
1418 }
1419
1420 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
1421 DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
1422
1423 LOperand* function() { return inputs_[0]; }
1424
1425 virtual void PrintDataTo(StringStream* stream);
1426
1427 int arity() const { return hydrogen()->argument_count() - 1; }
1428};
1429
1430
1431class LCallKeyed: public LTemplateInstruction<1, 1, 0> {
1432 public:
1433 explicit LCallKeyed(LOperand* key) {
1434 inputs_[0] = key;
1435 }
1436
1437 DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed")
1438 DECLARE_HYDROGEN_ACCESSOR(CallKeyed)
1439
1440 virtual void PrintDataTo(StringStream* stream);
1441
1442 int arity() const { return hydrogen()->argument_count() - 1; }
1443};
1444
1445
1446
1447class LCallNamed: public LTemplateInstruction<1, 0, 0> {
1448 public:
1449 DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call-named")
1450 DECLARE_HYDROGEN_ACCESSOR(CallNamed)
1451
1452 virtual void PrintDataTo(StringStream* stream);
1453
1454 Handle<String> name() const { return hydrogen()->name(); }
1455 int arity() const { return hydrogen()->argument_count() - 1; }
1456};
1457
1458
danno@chromium.orgc612e022011-11-10 11:38:15 +00001459class LCallFunction: public LTemplateInstruction<1, 1, 0> {
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00001460 public:
danno@chromium.orgc612e022011-11-10 11:38:15 +00001461 explicit LCallFunction(LOperand* function) {
1462 inputs_[0] = function;
1463 }
1464
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00001465 DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
1466 DECLARE_HYDROGEN_ACCESSOR(CallFunction)
1467
danno@chromium.orgc612e022011-11-10 11:38:15 +00001468 LOperand* function() { return inputs_[0]; }
1469 int arity() const { return hydrogen()->argument_count() - 1; }
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00001470};
1471
1472
1473class LCallGlobal: public LTemplateInstruction<1, 0, 0> {
1474 public:
1475 DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global")
1476 DECLARE_HYDROGEN_ACCESSOR(CallGlobal)
1477
1478 virtual void PrintDataTo(StringStream* stream);
1479
1480 Handle<String> name() const {return hydrogen()->name(); }
1481 int arity() const { return hydrogen()->argument_count() - 1; }
1482};
1483
1484
1485class LCallKnownGlobal: public LTemplateInstruction<1, 0, 0> {
1486 public:
1487 DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global")
1488 DECLARE_HYDROGEN_ACCESSOR(CallKnownGlobal)
1489
1490 virtual void PrintDataTo(StringStream* stream);
1491
1492 Handle<JSFunction> target() const { return hydrogen()->target(); }
1493 int arity() const { return hydrogen()->argument_count() - 1; }
1494};
1495
1496
1497class LCallNew: public LTemplateInstruction<1, 1, 0> {
1498 public:
1499 explicit LCallNew(LOperand* constructor) {
1500 inputs_[0] = constructor;
1501 }
1502
1503 DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new")
1504 DECLARE_HYDROGEN_ACCESSOR(CallNew)
1505
1506 virtual void PrintDataTo(StringStream* stream);
1507
1508 int arity() const { return hydrogen()->argument_count() - 1; }
1509};
1510
1511
1512class LCallRuntime: public LTemplateInstruction<1, 0, 0> {
1513 public:
1514 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
1515 DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
1516
1517 const Runtime::Function* function() const { return hydrogen()->function(); }
1518 int arity() const { return hydrogen()->argument_count(); }
1519};
1520
1521
1522class LInteger32ToDouble: public LTemplateInstruction<1, 1, 0> {
1523 public:
1524 explicit LInteger32ToDouble(LOperand* value) {
1525 inputs_[0] = value;
1526 }
1527
1528 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double")
1529};
1530
1531
1532class LNumberTagI: public LTemplateInstruction<1, 1, 0> {
1533 public:
1534 explicit LNumberTagI(LOperand* value) {
1535 inputs_[0] = value;
1536 }
1537
1538 DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i")
1539};
1540
1541
1542class LNumberTagD: public LTemplateInstruction<1, 1, 2> {
1543 public:
1544 LNumberTagD(LOperand* value, LOperand* temp1, LOperand* temp2) {
1545 inputs_[0] = value;
1546 temps_[0] = temp1;
1547 temps_[1] = temp2;
1548 }
1549
1550 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d")
1551};
1552
1553
1554// Sometimes truncating conversion from a tagged value to an int32.
1555class LDoubleToI: public LTemplateInstruction<1, 1, 2> {
1556 public:
1557 LDoubleToI(LOperand* value, LOperand* temp1, LOperand* temp2) {
1558 inputs_[0] = value;
1559 temps_[0] = temp1;
1560 temps_[1] = temp2;
1561 }
1562
1563 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
1564 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
1565
1566 bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1567};
1568
1569
1570// Truncating conversion from a tagged value to an int32.
1571class LTaggedToI: public LTemplateInstruction<1, 1, 3> {
1572 public:
1573 LTaggedToI(LOperand* value,
1574 LOperand* temp1,
1575 LOperand* temp2,
1576 LOperand* temp3) {
1577 inputs_[0] = value;
1578 temps_[0] = temp1;
1579 temps_[1] = temp2;
1580 temps_[2] = temp3;
1581 }
1582
1583 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
1584 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
1585
1586 bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1587};
1588
1589
1590class LSmiTag: public LTemplateInstruction<1, 1, 0> {
1591 public:
1592 explicit LSmiTag(LOperand* value) {
1593 inputs_[0] = value;
1594 }
1595
1596 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag")
1597};
1598
1599
1600class LNumberUntagD: public LTemplateInstruction<1, 1, 0> {
1601 public:
1602 explicit LNumberUntagD(LOperand* value) {
1603 inputs_[0] = value;
1604 }
1605
1606 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
1607 DECLARE_HYDROGEN_ACCESSOR(Change)
1608};
1609
1610
1611class LSmiUntag: public LTemplateInstruction<1, 1, 0> {
1612 public:
1613 LSmiUntag(LOperand* value, bool needs_check)
1614 : needs_check_(needs_check) {
1615 inputs_[0] = value;
1616 }
1617
1618 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag")
1619
1620 bool needs_check() const { return needs_check_; }
1621
1622 private:
1623 bool needs_check_;
1624};
1625
1626
1627class LStoreNamedField: public LTemplateInstruction<0, 2, 0> {
1628 public:
1629 LStoreNamedField(LOperand* obj, LOperand* val) {
1630 inputs_[0] = obj;
1631 inputs_[1] = val;
1632 }
1633
1634 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
1635 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
1636
1637 virtual void PrintDataTo(StringStream* stream);
1638
1639 LOperand* object() { return inputs_[0]; }
1640 LOperand* value() { return inputs_[1]; }
1641
1642 Handle<Object> name() const { return hydrogen()->name(); }
1643 bool is_in_object() { return hydrogen()->is_in_object(); }
1644 int offset() { return hydrogen()->offset(); }
1645 Handle<Map> transition() const { return hydrogen()->transition(); }
1646};
1647
1648
1649class LStoreNamedGeneric: public LTemplateInstruction<0, 2, 0> {
1650 public:
1651 LStoreNamedGeneric(LOperand* obj, LOperand* val) {
1652 inputs_[0] = obj;
1653 inputs_[1] = val;
1654 }
1655
1656 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
1657 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
1658
1659 virtual void PrintDataTo(StringStream* stream);
1660
1661 LOperand* object() { return inputs_[0]; }
1662 LOperand* value() { return inputs_[1]; }
1663 Handle<Object> name() const { return hydrogen()->name(); }
1664 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); }
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00001665};
1666
1667
1668class LStoreKeyedFastElement: public LTemplateInstruction<0, 3, 0> {
1669 public:
1670 LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val) {
1671 inputs_[0] = obj;
1672 inputs_[1] = key;
1673 inputs_[2] = val;
1674 }
1675
1676 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
1677 "store-keyed-fast-element")
1678 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement)
1679
1680 virtual void PrintDataTo(StringStream* stream);
1681
1682 LOperand* object() { return inputs_[0]; }
1683 LOperand* key() { return inputs_[1]; }
1684 LOperand* value() { return inputs_[2]; }
1685};
1686
1687
1688class LStoreKeyedFastDoubleElement: public LTemplateInstruction<0, 3, 0> {
1689 public:
1690 LStoreKeyedFastDoubleElement(LOperand* elements,
1691 LOperand* key,
1692 LOperand* val) {
1693 inputs_[0] = elements;
1694 inputs_[1] = key;
1695 inputs_[2] = val;
1696 }
1697
1698 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastDoubleElement,
1699 "store-keyed-fast-double-element")
1700 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastDoubleElement)
1701
1702 virtual void PrintDataTo(StringStream* stream);
1703
1704 LOperand* elements() { return inputs_[0]; }
1705 LOperand* key() { return inputs_[1]; }
1706 LOperand* value() { return inputs_[2]; }
1707};
1708
1709
1710class LStoreKeyedGeneric: public LTemplateInstruction<0, 3, 0> {
1711 public:
1712 LStoreKeyedGeneric(LOperand* obj, LOperand* key, LOperand* val) {
1713 inputs_[0] = obj;
1714 inputs_[1] = key;
1715 inputs_[2] = val;
1716 }
1717
1718 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
1719 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric)
1720
1721 virtual void PrintDataTo(StringStream* stream);
1722
1723 LOperand* object() { return inputs_[0]; }
1724 LOperand* key() { return inputs_[1]; }
1725 LOperand* value() { return inputs_[2]; }
mstarzinger@chromium.org1b3afd12011-11-29 14:28:56 +00001726 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); }
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00001727};
1728
1729class LStoreKeyedSpecializedArrayElement: public LTemplateInstruction<0, 3, 0> {
1730 public:
1731 LStoreKeyedSpecializedArrayElement(LOperand* external_pointer,
1732 LOperand* key,
1733 LOperand* val) {
1734 inputs_[0] = external_pointer;
1735 inputs_[1] = key;
1736 inputs_[2] = val;
1737 }
1738
1739 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedSpecializedArrayElement,
1740 "store-keyed-specialized-array-element")
1741 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedSpecializedArrayElement)
1742
1743 LOperand* external_pointer() { return inputs_[0]; }
1744 LOperand* key() { return inputs_[1]; }
1745 LOperand* value() { return inputs_[2]; }
1746 ElementsKind elements_kind() const {
1747 return hydrogen()->elements_kind();
1748 }
1749};
1750
1751
1752class LTransitionElementsKind: public LTemplateInstruction<1, 1, 2> {
1753 public:
1754 LTransitionElementsKind(LOperand* object,
1755 LOperand* new_map_temp,
1756 LOperand* temp_reg) {
1757 inputs_[0] = object;
1758 temps_[0] = new_map_temp;
1759 temps_[1] = temp_reg;
1760 }
1761
1762 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind,
1763 "transition-elements-kind")
1764 DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind)
1765
1766 virtual void PrintDataTo(StringStream* stream);
1767
1768 LOperand* object() { return inputs_[0]; }
1769 LOperand* new_map_reg() { return temps_[0]; }
1770 LOperand* temp_reg() { return temps_[1]; }
1771 Handle<Map> original_map() { return hydrogen()->original_map(); }
1772 Handle<Map> transitioned_map() { return hydrogen()->transitioned_map(); }
1773};
1774
1775
1776class LStringAdd: public LTemplateInstruction<1, 2, 0> {
1777 public:
1778 LStringAdd(LOperand* left, LOperand* right) {
1779 inputs_[0] = left;
1780 inputs_[1] = right;
1781 }
1782
1783 DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add")
1784 DECLARE_HYDROGEN_ACCESSOR(StringAdd)
1785
1786 LOperand* left() { return inputs_[0]; }
1787 LOperand* right() { return inputs_[1]; }
1788};
1789
1790
1791
1792class LStringCharCodeAt: public LTemplateInstruction<1, 2, 0> {
1793 public:
1794 LStringCharCodeAt(LOperand* string, LOperand* index) {
1795 inputs_[0] = string;
1796 inputs_[1] = index;
1797 }
1798
1799 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at")
1800 DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt)
1801
1802 LOperand* string() { return inputs_[0]; }
1803 LOperand* index() { return inputs_[1]; }
1804};
1805
1806
1807class LStringCharFromCode: public LTemplateInstruction<1, 1, 0> {
1808 public:
1809 explicit LStringCharFromCode(LOperand* char_code) {
1810 inputs_[0] = char_code;
1811 }
1812
1813 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code")
1814 DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode)
1815
1816 LOperand* char_code() { return inputs_[0]; }
1817};
1818
1819
1820class LStringLength: public LTemplateInstruction<1, 1, 0> {
1821 public:
1822 explicit LStringLength(LOperand* string) {
1823 inputs_[0] = string;
1824 }
1825
1826 DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length")
1827 DECLARE_HYDROGEN_ACCESSOR(StringLength)
1828
1829 LOperand* string() { return inputs_[0]; }
1830};
1831
1832
1833class LCheckFunction: public LTemplateInstruction<0, 1, 0> {
1834 public:
1835 explicit LCheckFunction(LOperand* value) {
1836 inputs_[0] = value;
1837 }
1838
ricow@chromium.org64e3a4b2011-12-13 08:07:27 +00001839 LOperand* value() { return InputAt(0); }
1840
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00001841 DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function")
1842 DECLARE_HYDROGEN_ACCESSOR(CheckFunction)
1843};
1844
1845
1846class LCheckInstanceType: public LTemplateInstruction<0, 1, 0> {
1847 public:
1848 explicit LCheckInstanceType(LOperand* value) {
1849 inputs_[0] = value;
1850 }
1851
1852 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
1853 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
1854};
1855
1856
1857class LCheckMap: public LTemplateInstruction<0, 1, 0> {
1858 public:
1859 explicit LCheckMap(LOperand* value) {
1860 inputs_[0] = value;
1861 }
1862
1863 DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check-map")
1864 DECLARE_HYDROGEN_ACCESSOR(CheckMap)
1865};
1866
1867
1868class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 2> {
1869 public:
1870 LCheckPrototypeMaps(LOperand* temp1, LOperand* temp2) {
1871 temps_[0] = temp1;
1872 temps_[1] = temp2;
1873 }
1874
1875 DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps")
1876 DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps)
1877
1878 Handle<JSObject> prototype() const { return hydrogen()->prototype(); }
1879 Handle<JSObject> holder() const { return hydrogen()->holder(); }
1880};
1881
1882
1883class LCheckSmi: public LTemplateInstruction<0, 1, 0> {
1884 public:
1885 explicit LCheckSmi(LOperand* value) {
1886 inputs_[0] = value;
1887 }
1888
1889 DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi")
1890};
1891
1892
1893class LCheckNonSmi: public LTemplateInstruction<0, 1, 0> {
1894 public:
1895 explicit LCheckNonSmi(LOperand* value) {
1896 inputs_[0] = value;
1897 }
1898
1899 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi")
1900};
1901
1902
1903class LClampDToUint8: public LTemplateInstruction<1, 1, 1> {
1904 public:
1905 LClampDToUint8(LOperand* value, LOperand* temp) {
1906 inputs_[0] = value;
1907 temps_[0] = temp;
1908 }
1909
1910 LOperand* unclamped() { return inputs_[0]; }
1911
1912 DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8")
1913};
1914
1915
1916class LClampIToUint8: public LTemplateInstruction<1, 1, 0> {
1917 public:
1918 explicit LClampIToUint8(LOperand* value) {
1919 inputs_[0] = value;
1920 }
1921
1922 LOperand* unclamped() { return inputs_[0]; }
1923
1924 DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8")
1925};
1926
1927
1928class LClampTToUint8: public LTemplateInstruction<1, 1, 1> {
1929 public:
1930 LClampTToUint8(LOperand* value, LOperand* temp) {
1931 inputs_[0] = value;
1932 temps_[0] = temp;
1933 }
1934
1935 LOperand* unclamped() { return inputs_[0]; }
1936
1937 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8")
1938};
1939
1940
fschneider@chromium.org35814e52012-03-01 15:43:35 +00001941class LAllocateObject: public LTemplateInstruction<1, 0, 2> {
ulan@chromium.org967e2702012-02-28 09:49:15 +00001942 public:
fschneider@chromium.org35814e52012-03-01 15:43:35 +00001943 LAllocateObject(LOperand* temp1, LOperand* temp2) {
1944 temps_[0] = temp1;
1945 temps_[1] = temp2;
1946 }
1947
ulan@chromium.org967e2702012-02-28 09:49:15 +00001948 DECLARE_CONCRETE_INSTRUCTION(AllocateObject, "allocate-object")
1949 DECLARE_HYDROGEN_ACCESSOR(AllocateObject)
1950};
1951
1952
jkummerow@chromium.orgf7a58842012-02-21 10:08:21 +00001953class LFastLiteral: public LTemplateInstruction<1, 0, 0> {
1954 public:
1955 DECLARE_CONCRETE_INSTRUCTION(FastLiteral, "fast-literal")
1956 DECLARE_HYDROGEN_ACCESSOR(FastLiteral)
1957};
1958
1959
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00001960class LArrayLiteral: public LTemplateInstruction<1, 0, 0> {
1961 public:
1962 DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral, "array-literal")
1963 DECLARE_HYDROGEN_ACCESSOR(ArrayLiteral)
1964};
1965
1966
jkummerow@chromium.orgf7a58842012-02-21 10:08:21 +00001967class LObjectLiteral: public LTemplateInstruction<1, 0, 0> {
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00001968 public:
jkummerow@chromium.orgf7a58842012-02-21 10:08:21 +00001969 DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object-literal")
1970 DECLARE_HYDROGEN_ACCESSOR(ObjectLiteral)
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00001971};
1972
1973
1974class LRegExpLiteral: public LTemplateInstruction<1, 0, 0> {
1975 public:
1976 DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal")
1977 DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral)
1978};
1979
1980
1981class LFunctionLiteral: public LTemplateInstruction<1, 0, 0> {
1982 public:
1983 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal")
1984 DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral)
1985
1986 Handle<SharedFunctionInfo> shared_info() { return hydrogen()->shared_info(); }
1987};
1988
1989
1990class LToFastProperties: public LTemplateInstruction<1, 1, 0> {
1991 public:
1992 explicit LToFastProperties(LOperand* value) {
1993 inputs_[0] = value;
1994 }
1995
1996 DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties")
1997 DECLARE_HYDROGEN_ACCESSOR(ToFastProperties)
1998};
1999
2000
2001class LTypeof: public LTemplateInstruction<1, 1, 0> {
2002 public:
2003 explicit LTypeof(LOperand* value) {
2004 inputs_[0] = value;
2005 }
2006
2007 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
2008};
2009
2010
2011class LTypeofIsAndBranch: public LControlInstruction<1, 0> {
2012 public:
2013 explicit LTypeofIsAndBranch(LOperand* value) {
2014 inputs_[0] = value;
2015 }
2016
2017 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch")
2018 DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch)
2019
2020 Handle<String> type_literal() { return hydrogen()->type_literal(); }
2021
2022 virtual void PrintDataTo(StringStream* stream);
2023};
2024
2025
2026class LIsConstructCallAndBranch: public LControlInstruction<0, 1> {
2027 public:
2028 explicit LIsConstructCallAndBranch(LOperand* temp) {
2029 temps_[0] = temp;
2030 }
2031
2032 DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch,
2033 "is-construct-call-and-branch")
2034};
2035
2036
2037class LDeleteProperty: public LTemplateInstruction<1, 2, 0> {
2038 public:
2039 LDeleteProperty(LOperand* obj, LOperand* key) {
2040 inputs_[0] = obj;
2041 inputs_[1] = key;
2042 }
2043
2044 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property")
2045
2046 LOperand* object() { return inputs_[0]; }
2047 LOperand* key() { return inputs_[1]; }
2048};
2049
2050
2051class LOsrEntry: public LTemplateInstruction<0, 0, 0> {
2052 public:
2053 LOsrEntry();
2054
2055 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry")
2056
2057 LOperand** SpilledRegisterArray() { return register_spills_; }
2058 LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; }
2059
2060 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand);
2061 void MarkSpilledDoubleRegister(int allocation_index,
2062 LOperand* spill_operand);
2063
2064 private:
2065 // Arrays of spill slot operands for registers with an assigned spill
2066 // slot, i.e., that must also be restored to the spill slot on OSR entry.
2067 // NULL if the register has no assigned spill slot. Indexed by allocation
2068 // index.
2069 LOperand* register_spills_[Register::kNumAllocatableRegisters];
2070 LOperand* double_register_spills_[DoubleRegister::kNumAllocatableRegisters];
2071};
2072
2073
2074class LStackCheck: public LTemplateInstruction<0, 0, 0> {
2075 public:
2076 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
2077 DECLARE_HYDROGEN_ACCESSOR(StackCheck)
2078
2079 Label* done_label() { return &done_label_; }
2080
2081 private:
2082 Label done_label_;
2083};
2084
2085
2086class LIn: public LTemplateInstruction<1, 2, 0> {
2087 public:
2088 LIn(LOperand* key, LOperand* object) {
2089 inputs_[0] = key;
2090 inputs_[1] = object;
2091 }
2092
2093 LOperand* key() { return inputs_[0]; }
2094 LOperand* object() { return inputs_[1]; }
2095
2096 DECLARE_CONCRETE_INSTRUCTION(In, "in")
2097};
2098
2099
ulan@chromium.org812308e2012-02-29 15:58:45 +00002100class LForInPrepareMap: public LTemplateInstruction<1, 1, 0> {
2101 public:
2102 explicit LForInPrepareMap(LOperand* object) {
2103 inputs_[0] = object;
2104 }
2105
2106 LOperand* object() { return inputs_[0]; }
2107
2108 DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map")
2109};
2110
2111
2112class LForInCacheArray: public LTemplateInstruction<1, 1, 0> {
2113 public:
2114 explicit LForInCacheArray(LOperand* map) {
2115 inputs_[0] = map;
2116 }
2117
2118 LOperand* map() { return inputs_[0]; }
2119
2120 DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array")
2121
2122 int idx() {
2123 return HForInCacheArray::cast(this->hydrogen_value())->idx();
2124 }
2125};
2126
2127
2128class LCheckMapValue: public LTemplateInstruction<0, 2, 0> {
2129 public:
2130 LCheckMapValue(LOperand* value, LOperand* map) {
2131 inputs_[0] = value;
2132 inputs_[1] = map;
2133 }
2134
2135 LOperand* value() { return inputs_[0]; }
2136 LOperand* map() { return inputs_[1]; }
2137
2138 DECLARE_CONCRETE_INSTRUCTION(CheckMapValue, "check-map-value")
2139};
2140
2141
2142class LLoadFieldByIndex: public LTemplateInstruction<1, 2, 0> {
2143 public:
2144 LLoadFieldByIndex(LOperand* object, LOperand* index) {
2145 inputs_[0] = object;
2146 inputs_[1] = index;
2147 }
2148
2149 LOperand* object() { return inputs_[0]; }
2150 LOperand* index() { return inputs_[1]; }
2151
2152 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index")
2153};
2154
2155
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00002156class LChunkBuilder;
lrn@chromium.org7516f052011-03-30 08:52:27 +00002157class LChunk: public ZoneObject {
2158 public:
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00002159 explicit LChunk(CompilationInfo* info, HGraph* graph);
lrn@chromium.org7516f052011-03-30 08:52:27 +00002160
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00002161 void AddInstruction(LInstruction* instruction, HBasicBlock* block);
2162 LConstantOperand* DefineConstantOperand(HConstant* constant);
2163 Handle<Object> LookupLiteral(LConstantOperand* operand) const;
2164 Representation LookupLiteralRepresentation(LConstantOperand* operand) const;
lrn@chromium.org7516f052011-03-30 08:52:27 +00002165
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00002166 int GetNextSpillIndex(bool is_double);
2167 LOperand* GetNextSpillSlot(bool is_double);
lrn@chromium.org7516f052011-03-30 08:52:27 +00002168
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00002169 int ParameterAt(int index);
2170 int GetParameterStackSlot(int index) const;
2171 int spill_slot_count() const { return spill_slot_count_; }
2172 CompilationInfo* info() const { return info_; }
2173 HGraph* graph() const { return graph_; }
2174 const ZoneList<LInstruction*>* instructions() const { return &instructions_; }
2175 void AddGapMove(int index, LOperand* from, LOperand* to);
2176 LGap* GetGapAt(int index) const;
2177 bool IsGapAt(int index) const;
2178 int NearestGapPos(int index) const;
2179 void MarkEmptyBlocks();
2180 const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; }
lrn@chromium.org7516f052011-03-30 08:52:27 +00002181 LLabel* GetLabel(int block_id) const {
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00002182 HBasicBlock* block = graph_->blocks()->at(block_id);
2183 int first_instruction = block->first_instruction_index();
2184 return LLabel::cast(instructions_[first_instruction]);
2185 }
2186 int LookupDestination(int block_id) const {
2187 LLabel* cur = GetLabel(block_id);
2188 while (cur->replacement() != NULL) {
2189 cur = cur->replacement();
2190 }
2191 return cur->block_id();
2192 }
2193 Label* GetAssemblyLabel(int block_id) const {
2194 LLabel* label = GetLabel(block_id);
2195 ASSERT(!label->HasReplacement());
2196 return label->label();
lrn@chromium.org7516f052011-03-30 08:52:27 +00002197 }
2198
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00002199 const ZoneList<Handle<JSFunction> >* inlined_closures() const {
2200 return &inlined_closures_;
lrn@chromium.org7516f052011-03-30 08:52:27 +00002201 }
2202
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00002203 void AddInlinedClosure(Handle<JSFunction> closure) {
2204 inlined_closures_.Add(closure);
lrn@chromium.org7516f052011-03-30 08:52:27 +00002205 }
2206
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00002207 private:
2208 int spill_slot_count_;
2209 CompilationInfo* info_;
2210 HGraph* const graph_;
2211 ZoneList<LInstruction*> instructions_;
2212 ZoneList<LPointerMap*> pointer_maps_;
2213 ZoneList<Handle<JSFunction> > inlined_closures_;
lrn@chromium.org7516f052011-03-30 08:52:27 +00002214};
2215
2216
2217class LChunkBuilder BASE_EMBEDDED {
2218 public:
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00002219 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator)
2220 : chunk_(NULL),
2221 info_(info),
2222 graph_(graph),
ulan@chromium.org812308e2012-02-29 15:58:45 +00002223 zone_(graph->isolate()->zone()),
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00002224 status_(UNUSED),
2225 current_instruction_(NULL),
2226 current_block_(NULL),
2227 next_block_(NULL),
2228 argument_count_(0),
2229 allocator_(allocator),
2230 position_(RelocInfo::kNoPosition),
2231 instruction_pending_deoptimization_environment_(NULL),
2232 pending_deoptimization_ast_id_(AstNode::kNoNumber) { }
lrn@chromium.org7516f052011-03-30 08:52:27 +00002233
2234 // Build the sequence for the graph.
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00002235 LChunk* Build();
lrn@chromium.org7516f052011-03-30 08:52:27 +00002236
2237 // Declare methods that deal with the individual node types.
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00002238#define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
lrn@chromium.org7516f052011-03-30 08:52:27 +00002239 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
2240#undef DECLARE_DO
2241
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00002242 private:
2243 enum Status {
2244 UNUSED,
2245 BUILDING,
2246 DONE,
2247 ABORTED
2248 };
2249
2250 LChunk* chunk() const { return chunk_; }
2251 CompilationInfo* info() const { return info_; }
2252 HGraph* graph() const { return graph_; }
ulan@chromium.org812308e2012-02-29 15:58:45 +00002253 Zone* zone() const { return zone_; }
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00002254
2255 bool is_unused() const { return status_ == UNUSED; }
2256 bool is_building() const { return status_ == BUILDING; }
2257 bool is_done() const { return status_ == DONE; }
2258 bool is_aborted() const { return status_ == ABORTED; }
2259
2260 void Abort(const char* format, ...);
2261
2262 // Methods for getting operands for Use / Define / Temp.
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00002263 LUnallocated* ToUnallocated(Register reg);
2264 LUnallocated* ToUnallocated(DoubleRegister reg);
2265
2266 // Methods for setting up define-use relationships.
2267 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand);
2268 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register);
2269 MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value,
2270 DoubleRegister fixed_register);
2271
2272 // A value that is guaranteed to be allocated to a register.
2273 // Operand created by UseRegister is guaranteed to be live until the end of
2274 // instruction. This means that register allocator will not reuse it's
2275 // register for any other operand inside instruction.
2276 // Operand created by UseRegisterAtStart is guaranteed to be live only at
2277 // instruction start. Register allocator is free to assign the same register
2278 // to some other operand used inside instruction (i.e. temporary or
2279 // output).
2280 MUST_USE_RESULT LOperand* UseRegister(HValue* value);
2281 MUST_USE_RESULT LOperand* UseRegisterAtStart(HValue* value);
2282
2283 // An input operand in a register that may be trashed.
2284 MUST_USE_RESULT LOperand* UseTempRegister(HValue* value);
2285
2286 // An input operand in a register or stack slot.
2287 MUST_USE_RESULT LOperand* Use(HValue* value);
2288 MUST_USE_RESULT LOperand* UseAtStart(HValue* value);
2289
2290 // An input operand in a register, stack slot or a constant operand.
2291 MUST_USE_RESULT LOperand* UseOrConstant(HValue* value);
2292 MUST_USE_RESULT LOperand* UseOrConstantAtStart(HValue* value);
2293
2294 // An input operand in a register or a constant operand.
2295 MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value);
2296 MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value);
2297
2298 // An input operand in register, stack slot or a constant operand.
2299 // Will not be moved to a register even if one is freely available.
2300 MUST_USE_RESULT LOperand* UseAny(HValue* value);
2301
2302 // Temporary operand that must be in a register.
2303 MUST_USE_RESULT LUnallocated* TempRegister();
2304 MUST_USE_RESULT LOperand* FixedTemp(Register reg);
2305 MUST_USE_RESULT LOperand* FixedTemp(DoubleRegister reg);
2306
2307 // Methods for setting up define-use relationships.
2308 // Return the same instruction that they are passed.
2309 template<int I, int T>
2310 LInstruction* Define(LTemplateInstruction<1, I, T>* instr,
2311 LUnallocated* result);
2312 template<int I, int T>
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00002313 LInstruction* DefineAsRegister(LTemplateInstruction<1, I, T>* instr);
2314 template<int I, int T>
2315 LInstruction* DefineAsSpilled(LTemplateInstruction<1, I, T>* instr,
2316 int index);
2317 template<int I, int T>
2318 LInstruction* DefineSameAsFirst(LTemplateInstruction<1, I, T>* instr);
2319 template<int I, int T>
2320 LInstruction* DefineFixed(LTemplateInstruction<1, I, T>* instr,
2321 Register reg);
2322 template<int I, int T>
2323 LInstruction* DefineFixedDouble(LTemplateInstruction<1, I, T>* instr,
2324 DoubleRegister reg);
2325 LInstruction* AssignEnvironment(LInstruction* instr);
2326 LInstruction* AssignPointerMap(LInstruction* instr);
2327
2328 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY };
2329
2330 // By default we assume that instruction sequences generated for calls
2331 // cannot deoptimize eagerly and we do not attach environment to this
2332 // instruction.
2333 LInstruction* MarkAsCall(
2334 LInstruction* instr,
2335 HInstruction* hinstr,
2336 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
2337 LInstruction* MarkAsSaveDoubles(LInstruction* instr);
2338
2339 LInstruction* SetInstructionPendingDeoptimizationEnvironment(
2340 LInstruction* instr, int ast_id);
2341 void ClearInstructionPendingDeoptimizationEnvironment();
2342
2343 LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env,
2344 int* argument_index_accumulator);
2345
2346 void VisitInstruction(HInstruction* current);
2347
2348 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
2349 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr);
2350 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
2351 LInstruction* DoArithmeticD(Token::Value op,
2352 HArithmeticBinaryOperation* instr);
2353 LInstruction* DoArithmeticT(Token::Value op,
2354 HArithmeticBinaryOperation* instr);
2355
2356 LChunk* chunk_;
2357 CompilationInfo* info_;
2358 HGraph* const graph_;
ulan@chromium.org812308e2012-02-29 15:58:45 +00002359 Zone* zone_;
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00002360 Status status_;
2361 HInstruction* current_instruction_;
2362 HBasicBlock* current_block_;
2363 HBasicBlock* next_block_;
2364 int argument_count_;
2365 LAllocator* allocator_;
2366 int position_;
2367 LInstruction* instruction_pending_deoptimization_environment_;
2368 int pending_deoptimization_ast_id_;
2369
lrn@chromium.org7516f052011-03-30 08:52:27 +00002370 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2371};
2372
jkummerow@chromium.orgc3b37122011-11-07 10:14:12 +00002373#undef DECLARE_HYDROGEN_ACCESSOR
2374#undef DECLARE_CONCRETE_INSTRUCTION
lrn@chromium.org7516f052011-03-30 08:52:27 +00002375
2376} } // namespace v8::internal
2377
2378#endif // V8_MIPS_LITHIUM_MIPS_H_