blob: 7d41093be11fc331f37e0d1a76343d82a643b89c [file] [log] [blame]
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001// 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
3// found in the LICENSE file.
4
5#ifndef V8_CRANKSHAFT_MIPS_LITHIUM_MIPS_H_
6#define V8_CRANKSHAFT_MIPS_LITHIUM_MIPS_H_
7
8#include "src/crankshaft/hydrogen.h"
9#include "src/crankshaft/lithium.h"
10#include "src/crankshaft/lithium-allocator.h"
11#include "src/safepoint-table.h"
12#include "src/utils.h"
13
14namespace v8 {
15namespace internal {
16
17// Forward declarations.
18class LCodeGen;
19
20#define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \
21 V(AccessArgumentsAt) \
22 V(AddI) \
23 V(Allocate) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000024 V(ApplyArguments) \
25 V(ArgumentsElements) \
26 V(ArgumentsLength) \
27 V(ArithmeticD) \
28 V(ArithmeticT) \
29 V(BitI) \
30 V(BoundsCheck) \
31 V(Branch) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000032 V(CallWithDescriptor) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000033 V(CallNewArray) \
34 V(CallRuntime) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000035 V(CheckArrayBufferNotNeutered) \
36 V(CheckInstanceType) \
37 V(CheckMaps) \
38 V(CheckMapValue) \
39 V(CheckNonSmi) \
40 V(CheckSmi) \
41 V(CheckValue) \
42 V(ClampDToUint8) \
43 V(ClampIToUint8) \
44 V(ClampTToUint8) \
45 V(ClassOfTestAndBranch) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000046 V(CompareNumericAndBranch) \
47 V(CmpObjectEqAndBranch) \
48 V(CmpHoleAndBranch) \
49 V(CmpMapAndBranch) \
50 V(CmpT) \
51 V(ConstantD) \
52 V(ConstantE) \
53 V(ConstantI) \
54 V(ConstantS) \
55 V(ConstantT) \
56 V(ConstructDouble) \
57 V(Context) \
58 V(DebugBreak) \
59 V(DeclareGlobals) \
60 V(Deoptimize) \
61 V(DivByConstI) \
62 V(DivByPowerOf2I) \
63 V(DivI) \
64 V(DoubleToI) \
65 V(DoubleBits) \
66 V(DoubleToSmi) \
67 V(Drop) \
68 V(Dummy) \
69 V(DummyUse) \
70 V(FlooringDivByConstI) \
71 V(FlooringDivByPowerOf2I) \
72 V(FlooringDivI) \
73 V(ForInCacheArray) \
74 V(ForInPrepareMap) \
75 V(GetCachedArrayIndex) \
76 V(Goto) \
77 V(HasCachedArrayIndexAndBranch) \
78 V(HasInPrototypeChainAndBranch) \
79 V(HasInstanceTypeAndBranch) \
80 V(InnerAllocatedObject) \
81 V(InstanceOf) \
82 V(InstructionGap) \
83 V(Integer32ToDouble) \
84 V(InvokeFunction) \
85 V(IsStringAndBranch) \
86 V(IsSmiAndBranch) \
87 V(IsUndetectableAndBranch) \
88 V(Label) \
89 V(LazyBailout) \
90 V(LoadContextSlot) \
91 V(LoadRoot) \
92 V(LoadFieldByIndex) \
93 V(LoadFunctionPrototype) \
94 V(LoadGlobalGeneric) \
95 V(LoadKeyed) \
96 V(LoadKeyedGeneric) \
97 V(LoadNamedField) \
98 V(LoadNamedGeneric) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000099 V(MathAbs) \
100 V(MathExp) \
101 V(MathClz32) \
102 V(MathFloor) \
103 V(MathFround) \
104 V(MathLog) \
105 V(MathMinMax) \
106 V(MathPowHalf) \
107 V(MathRound) \
108 V(MathSqrt) \
109 V(MaybeGrowElements) \
110 V(ModByConstI) \
111 V(ModByPowerOf2I) \
112 V(ModI) \
113 V(MulI) \
114 V(MultiplyAddD) \
115 V(NumberTagD) \
116 V(NumberTagI) \
117 V(NumberTagU) \
118 V(NumberUntagD) \
119 V(OsrEntry) \
120 V(Parameter) \
121 V(Power) \
122 V(Prologue) \
123 V(PushArgument) \
124 V(Return) \
125 V(SeqStringGetChar) \
126 V(SeqStringSetChar) \
127 V(ShiftI) \
128 V(SmiTag) \
129 V(SmiUntag) \
130 V(StackCheck) \
131 V(StoreCodeEntry) \
132 V(StoreContextSlot) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000133 V(StoreKeyed) \
134 V(StoreKeyedGeneric) \
135 V(StoreNamedField) \
136 V(StoreNamedGeneric) \
137 V(StringAdd) \
138 V(StringCharCodeAt) \
139 V(StringCharFromCode) \
140 V(StringCompareAndBranch) \
141 V(SubI) \
142 V(TaggedToI) \
143 V(ThisFunction) \
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000144 V(TransitionElementsKind) \
145 V(TrapAllocationMemento) \
146 V(Typeof) \
147 V(TypeofIsAndBranch) \
148 V(Uint32ToDouble) \
149 V(UnknownOSRValue) \
150 V(WrapReceiver)
151
152#define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \
153 Opcode opcode() const final { return LInstruction::k##type; } \
154 void CompileToNative(LCodeGen* generator) final; \
155 const char* Mnemonic() const final { return mnemonic; } \
156 static L##type* cast(LInstruction* instr) { \
157 DCHECK(instr->Is##type()); \
158 return reinterpret_cast<L##type*>(instr); \
159 }
160
161
162#define DECLARE_HYDROGEN_ACCESSOR(type) \
163 H##type* hydrogen() const { \
164 return H##type::cast(hydrogen_value()); \
165 }
166
167
168class LInstruction : public ZoneObject {
169 public:
170 LInstruction()
171 : environment_(NULL),
172 hydrogen_value_(NULL),
173 bit_field_(IsCallBits::encode(false)) {
174 }
175
176 virtual ~LInstruction() {}
177
178 virtual void CompileToNative(LCodeGen* generator) = 0;
179 virtual const char* Mnemonic() const = 0;
180 virtual void PrintTo(StringStream* stream);
181 virtual void PrintDataTo(StringStream* stream);
182 virtual void PrintOutputOperandTo(StringStream* stream);
183
184 enum Opcode {
185 // Declare a unique enum value for each instruction.
186#define DECLARE_OPCODE(type) k##type,
187 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_OPCODE)
188 kNumberOfInstructions
189#undef DECLARE_OPCODE
190 };
191
192 virtual Opcode opcode() const = 0;
193
194 // Declare non-virtual type testers for all leaf IR classes.
195#define DECLARE_PREDICATE(type) \
196 bool Is##type() const { return opcode() == k##type; }
197 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_PREDICATE)
198#undef DECLARE_PREDICATE
199
200 // Declare virtual predicates for instructions that don't have
201 // an opcode.
202 virtual bool IsGap() const { return false; }
203
204 virtual bool IsControl() const { return false; }
205
206 // Try deleting this instruction if possible.
207 virtual bool TryDelete() { return false; }
208
209 void set_environment(LEnvironment* env) { environment_ = env; }
210 LEnvironment* environment() const { return environment_; }
211 bool HasEnvironment() const { return environment_ != NULL; }
212
213 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); }
214 LPointerMap* pointer_map() const { return pointer_map_.get(); }
215 bool HasPointerMap() const { return pointer_map_.is_set(); }
216
217 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
218 HValue* hydrogen_value() const { return hydrogen_value_; }
219
220 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); }
221 bool IsCall() const { return IsCallBits::decode(bit_field_); }
222
Ben Murdochda12d292016-06-02 14:46:10 +0100223 void MarkAsSyntacticTailCall() {
224 bit_field_ = IsSyntacticTailCallBits::update(bit_field_, true);
225 }
226 bool IsSyntacticTailCall() const {
227 return IsSyntacticTailCallBits::decode(bit_field_);
228 }
229
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000230 // Interface to the register allocator and iterators.
231 bool ClobbersTemps() const { return IsCall(); }
232 bool ClobbersRegisters() const { return IsCall(); }
233 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const {
234 return IsCall();
235 }
236
237 // Interface to the register allocator and iterators.
238 bool IsMarkedAsCall() const { return IsCall(); }
239
240 virtual bool HasResult() const = 0;
241 virtual LOperand* result() const = 0;
242
243 LOperand* FirstInput() { return InputAt(0); }
244 LOperand* Output() { return HasResult() ? result() : NULL; }
245
246 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; }
247
248#ifdef DEBUG
249 void VerifyCall();
250#endif
251
252 virtual int InputCount() = 0;
253 virtual LOperand* InputAt(int i) = 0;
254
255 private:
256 // Iterator interface.
257 friend class InputIterator;
258
259 friend class TempIterator;
260 virtual int TempCount() = 0;
261 virtual LOperand* TempAt(int i) = 0;
262
263 class IsCallBits: public BitField<bool, 0, 1> {};
Ben Murdochda12d292016-06-02 14:46:10 +0100264 class IsSyntacticTailCallBits : public BitField<bool, IsCallBits::kNext, 1> {
265 };
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000266
267 LEnvironment* environment_;
268 SetOncePointer<LPointerMap> pointer_map_;
269 HValue* hydrogen_value_;
270 int bit_field_;
271};
272
273
274// R = number of result operands (0 or 1).
275template<int R>
276class LTemplateResultInstruction : public LInstruction {
277 public:
278 // Allow 0 or 1 output operands.
279 STATIC_ASSERT(R == 0 || R == 1);
280 bool HasResult() const final { return R != 0 && result() != NULL; }
281 void set_result(LOperand* operand) { results_[0] = operand; }
282 LOperand* result() const override { return results_[0]; }
283
284 protected:
285 EmbeddedContainer<LOperand*, R> results_;
286};
287
288
289// 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 LTemplateResultInstruction<R> {
294 protected:
295 EmbeddedContainer<LOperand*, I> inputs_;
296 EmbeddedContainer<LOperand*, T> temps_;
297
298 private:
299 // Iterator support.
300 int InputCount() final { return I; }
301 LOperand* InputAt(int i) final { return inputs_[i]; }
302
303 int TempCount() final { return T; }
304 LOperand* TempAt(int i) final { return temps_[i]; }
305};
306
307
308class LGap : public LTemplateInstruction<0, 0, 0> {
309 public:
310 explicit LGap(HBasicBlock* block)
311 : block_(block) {
312 parallel_moves_[BEFORE] = NULL;
313 parallel_moves_[START] = NULL;
314 parallel_moves_[END] = NULL;
315 parallel_moves_[AFTER] = NULL;
316 }
317
318 // Can't use the DECLARE-macro here because of sub-classes.
319 bool IsGap() const final { return true; }
320 void PrintDataTo(StringStream* stream) override;
321 static LGap* cast(LInstruction* instr) {
322 DCHECK(instr->IsGap());
323 return reinterpret_cast<LGap*>(instr);
324 }
325
326 bool IsRedundant() const;
327
328 HBasicBlock* block() const { return block_; }
329
330 enum InnerPosition {
331 BEFORE,
332 START,
333 END,
334 AFTER,
335 FIRST_INNER_POSITION = BEFORE,
336 LAST_INNER_POSITION = AFTER
337 };
338
339 LParallelMove* GetOrCreateParallelMove(InnerPosition pos, Zone* zone) {
340 if (parallel_moves_[pos] == NULL) {
341 parallel_moves_[pos] = new(zone) LParallelMove(zone);
342 }
343 return parallel_moves_[pos];
344 }
345
346 LParallelMove* GetParallelMove(InnerPosition pos) {
347 return parallel_moves_[pos];
348 }
349
350 private:
351 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1];
352 HBasicBlock* block_;
353};
354
355
356class LInstructionGap final : public LGap {
357 public:
358 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { }
359
360 bool HasInterestingComment(LCodeGen* gen) const override {
361 return !IsRedundant();
362 }
363
364 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap")
365};
366
367
368class LGoto final : public LTemplateInstruction<0, 0, 0> {
369 public:
370 explicit LGoto(HBasicBlock* block) : block_(block) { }
371
372 bool HasInterestingComment(LCodeGen* gen) const override;
373 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
374 void PrintDataTo(StringStream* stream) override;
375 bool IsControl() const override { return true; }
376
377 int block_id() const { return block_->block_id(); }
378
379 private:
380 HBasicBlock* block_;
381};
382
383
384class LPrologue final : public LTemplateInstruction<0, 0, 0> {
385 public:
386 DECLARE_CONCRETE_INSTRUCTION(Prologue, "prologue")
387};
388
389
390class LLazyBailout final : public LTemplateInstruction<0, 0, 0> {
391 public:
392 LLazyBailout() : gap_instructions_size_(0) { }
393
394 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout")
395
396 void set_gap_instructions_size(int gap_instructions_size) {
397 gap_instructions_size_ = gap_instructions_size;
398 }
399 int gap_instructions_size() { return gap_instructions_size_; }
400
401 private:
402 int gap_instructions_size_;
403};
404
405
406class LDummy final : public LTemplateInstruction<1, 0, 0> {
407 public:
408 LDummy() {}
409 DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy")
410};
411
412
413class LDummyUse final : public LTemplateInstruction<1, 1, 0> {
414 public:
415 explicit LDummyUse(LOperand* value) {
416 inputs_[0] = value;
417 }
418 DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use")
419};
420
421
422class LDeoptimize final : public LTemplateInstruction<0, 0, 0> {
423 public:
424 bool IsControl() const override { return true; }
425 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
426 DECLARE_HYDROGEN_ACCESSOR(Deoptimize)
427};
428
429
430class LLabel final : public LGap {
431 public:
432 explicit LLabel(HBasicBlock* block)
433 : LGap(block), replacement_(NULL) { }
434
435 bool HasInterestingComment(LCodeGen* gen) const override { return false; }
436 DECLARE_CONCRETE_INSTRUCTION(Label, "label")
437
438 void PrintDataTo(StringStream* stream) override;
439
440 int block_id() const { return block()->block_id(); }
441 bool is_loop_header() const { return block()->IsLoopHeader(); }
442 bool is_osr_entry() const { return block()->is_osr_entry(); }
443 Label* label() { return &label_; }
444 LLabel* replacement() const { return replacement_; }
445 void set_replacement(LLabel* label) { replacement_ = label; }
446 bool HasReplacement() const { return replacement_ != NULL; }
447
448 private:
449 Label label_;
450 LLabel* replacement_;
451};
452
453
454class LParameter final : public LTemplateInstruction<1, 0, 0> {
455 public:
456 bool HasInterestingComment(LCodeGen* gen) const override { return false; }
457 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
458};
459
460
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000461class LUnknownOSRValue final : public LTemplateInstruction<1, 0, 0> {
462 public:
463 bool HasInterestingComment(LCodeGen* gen) const override { return false; }
464 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
465};
466
467
468template<int I, int T>
469class LControlInstruction : public LTemplateInstruction<0, I, T> {
470 public:
471 LControlInstruction() : false_label_(NULL), true_label_(NULL) { }
472
473 bool IsControl() const final { return true; }
474
475 int SuccessorCount() { return hydrogen()->SuccessorCount(); }
476 HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); }
477
478 int TrueDestination(LChunk* chunk) {
479 return chunk->LookupDestination(true_block_id());
480 }
481 int FalseDestination(LChunk* chunk) {
482 return chunk->LookupDestination(false_block_id());
483 }
484
485 Label* TrueLabel(LChunk* chunk) {
486 if (true_label_ == NULL) {
487 true_label_ = chunk->GetAssemblyLabel(TrueDestination(chunk));
488 }
489 return true_label_;
490 }
491 Label* FalseLabel(LChunk* chunk) {
492 if (false_label_ == NULL) {
493 false_label_ = chunk->GetAssemblyLabel(FalseDestination(chunk));
494 }
495 return false_label_;
496 }
497
498 protected:
499 int true_block_id() { return SuccessorAt(0)->block_id(); }
500 int false_block_id() { return SuccessorAt(1)->block_id(); }
501
502 private:
503 HControlInstruction* hydrogen() {
504 return HControlInstruction::cast(this->hydrogen_value());
505 }
506
507 Label* false_label_;
508 Label* true_label_;
509};
510
511
512class LWrapReceiver final : public LTemplateInstruction<1, 2, 0> {
513 public:
514 LWrapReceiver(LOperand* receiver, LOperand* function) {
515 inputs_[0] = receiver;
516 inputs_[1] = function;
517 }
518
519 DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver")
520 DECLARE_HYDROGEN_ACCESSOR(WrapReceiver)
521
522 LOperand* receiver() { return inputs_[0]; }
523 LOperand* function() { return inputs_[1]; }
524};
525
526
527class LApplyArguments final : public LTemplateInstruction<1, 4, 0> {
528 public:
529 LApplyArguments(LOperand* function,
530 LOperand* receiver,
531 LOperand* length,
532 LOperand* elements) {
533 inputs_[0] = function;
534 inputs_[1] = receiver;
535 inputs_[2] = length;
536 inputs_[3] = elements;
537 }
538
539 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments")
Ben Murdochda12d292016-06-02 14:46:10 +0100540 DECLARE_HYDROGEN_ACCESSOR(ApplyArguments)
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000541
542 LOperand* function() { return inputs_[0]; }
543 LOperand* receiver() { return inputs_[1]; }
544 LOperand* length() { return inputs_[2]; }
545 LOperand* elements() { return inputs_[3]; }
546};
547
548
549class LAccessArgumentsAt final : public LTemplateInstruction<1, 3, 0> {
550 public:
551 LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index) {
552 inputs_[0] = arguments;
553 inputs_[1] = length;
554 inputs_[2] = index;
555 }
556
557 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at")
558
559 LOperand* arguments() { return inputs_[0]; }
560 LOperand* length() { return inputs_[1]; }
561 LOperand* index() { return inputs_[2]; }
562
563 void PrintDataTo(StringStream* stream) override;
564};
565
566
567class LArgumentsLength final : public LTemplateInstruction<1, 1, 0> {
568 public:
569 explicit LArgumentsLength(LOperand* elements) {
570 inputs_[0] = elements;
571 }
572
573 LOperand* elements() { return inputs_[0]; }
574
575 DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length")
576};
577
578
579class LArgumentsElements final : public LTemplateInstruction<1, 0, 0> {
580 public:
581 DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements")
582 DECLARE_HYDROGEN_ACCESSOR(ArgumentsElements)
583};
584
585
586class LModByPowerOf2I final : public LTemplateInstruction<1, 1, 0> {
587 public:
588 LModByPowerOf2I(LOperand* dividend, int32_t divisor) {
589 inputs_[0] = dividend;
590 divisor_ = divisor;
591 }
592
593 LOperand* dividend() { return inputs_[0]; }
594 int32_t divisor() const { return divisor_; }
595
596 DECLARE_CONCRETE_INSTRUCTION(ModByPowerOf2I, "mod-by-power-of-2-i")
597 DECLARE_HYDROGEN_ACCESSOR(Mod)
598
599 private:
600 int32_t divisor_;
601};
602
603
604class LModByConstI final : public LTemplateInstruction<1, 1, 0> {
605 public:
606 LModByConstI(LOperand* dividend, int32_t divisor) {
607 inputs_[0] = dividend;
608 divisor_ = divisor;
609 }
610
611 LOperand* dividend() { return inputs_[0]; }
612 int32_t divisor() const { return divisor_; }
613
614 DECLARE_CONCRETE_INSTRUCTION(ModByConstI, "mod-by-const-i")
615 DECLARE_HYDROGEN_ACCESSOR(Mod)
616
617 private:
618 int32_t divisor_;
619};
620
621
622class LModI final : public LTemplateInstruction<1, 2, 3> {
623 public:
624 LModI(LOperand* left,
625 LOperand* right) {
626 inputs_[0] = left;
627 inputs_[1] = right;
628 }
629
630 LOperand* left() { return inputs_[0]; }
631 LOperand* right() { return inputs_[1]; }
632
633 DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i")
634 DECLARE_HYDROGEN_ACCESSOR(Mod)
635};
636
637
638class LDivByPowerOf2I final : public LTemplateInstruction<1, 1, 0> {
639 public:
640 LDivByPowerOf2I(LOperand* dividend, int32_t divisor) {
641 inputs_[0] = dividend;
642 divisor_ = divisor;
643 }
644
645 LOperand* dividend() { return inputs_[0]; }
646 int32_t divisor() const { return divisor_; }
647
648 DECLARE_CONCRETE_INSTRUCTION(DivByPowerOf2I, "div-by-power-of-2-i")
649 DECLARE_HYDROGEN_ACCESSOR(Div)
650
651 private:
652 int32_t divisor_;
653};
654
655
656class LDivByConstI final : public LTemplateInstruction<1, 1, 0> {
657 public:
658 LDivByConstI(LOperand* dividend, int32_t divisor) {
659 inputs_[0] = dividend;
660 divisor_ = divisor;
661 }
662
663 LOperand* dividend() { return inputs_[0]; }
664 int32_t divisor() const { return divisor_; }
665
666 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i")
667 DECLARE_HYDROGEN_ACCESSOR(Div)
668
669 private:
670 int32_t divisor_;
671};
672
673
674class LDivI final : public LTemplateInstruction<1, 2, 1> {
675 public:
676 LDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) {
677 inputs_[0] = dividend;
678 inputs_[1] = divisor;
679 temps_[0] = temp;
680 }
681
682 LOperand* dividend() { return inputs_[0]; }
683 LOperand* divisor() { return inputs_[1]; }
684 LOperand* temp() { return temps_[0]; }
685
686 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
687 DECLARE_HYDROGEN_ACCESSOR(BinaryOperation)
688};
689
690
691class LFlooringDivByPowerOf2I final : public LTemplateInstruction<1, 1, 0> {
692 public:
693 LFlooringDivByPowerOf2I(LOperand* dividend, int32_t divisor) {
694 inputs_[0] = dividend;
695 divisor_ = divisor;
696 }
697
698 LOperand* dividend() { return inputs_[0]; }
699 int32_t divisor() { return divisor_; }
700
701 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I,
702 "flooring-div-by-power-of-2-i")
703 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
704
705 private:
706 int32_t divisor_;
707};
708
709
710class LFlooringDivByConstI final : public LTemplateInstruction<1, 1, 2> {
711 public:
712 LFlooringDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) {
713 inputs_[0] = dividend;
714 divisor_ = divisor;
715 temps_[0] = temp;
716 }
717
718 LOperand* dividend() { return inputs_[0]; }
719 int32_t divisor() const { return divisor_; }
720 LOperand* temp() { return temps_[0]; }
721
722 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i")
723 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
724
725 private:
726 int32_t divisor_;
727};
728
729
730class LFlooringDivI final : public LTemplateInstruction<1, 2, 0> {
731 public:
732 LFlooringDivI(LOperand* dividend, LOperand* divisor) {
733 inputs_[0] = dividend;
734 inputs_[1] = divisor;
735 }
736
737 LOperand* dividend() { return inputs_[0]; }
738 LOperand* divisor() { return inputs_[1]; }
739
740 DECLARE_CONCRETE_INSTRUCTION(FlooringDivI, "flooring-div-i")
741 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
742};
743
744
745class LMulI final : public LTemplateInstruction<1, 2, 0> {
746 public:
747 LMulI(LOperand* left, LOperand* right) {
748 inputs_[0] = left;
749 inputs_[1] = right;
750 }
751
752 LOperand* left() { return inputs_[0]; }
753 LOperand* right() { return inputs_[1]; }
754
755 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
756 DECLARE_HYDROGEN_ACCESSOR(Mul)
757};
758
759
760// Instruction for computing multiplier * multiplicand + addend.
761class LMultiplyAddD final : public LTemplateInstruction<1, 3, 0> {
762 public:
763 LMultiplyAddD(LOperand* addend, LOperand* multiplier,
764 LOperand* multiplicand) {
765 inputs_[0] = addend;
766 inputs_[1] = multiplier;
767 inputs_[2] = multiplicand;
768 }
769
770 LOperand* addend() { return inputs_[0]; }
771 LOperand* multiplier() { return inputs_[1]; }
772 LOperand* multiplicand() { return inputs_[2]; }
773
774 DECLARE_CONCRETE_INSTRUCTION(MultiplyAddD, "multiply-add-d")
775};
776
777
778class LDebugBreak final : public LTemplateInstruction<0, 0, 0> {
779 public:
780 DECLARE_CONCRETE_INSTRUCTION(DebugBreak, "break")
781};
782
783
784class LCompareNumericAndBranch final : public LControlInstruction<2, 0> {
785 public:
786 LCompareNumericAndBranch(LOperand* left, LOperand* right) {
787 inputs_[0] = left;
788 inputs_[1] = right;
789 }
790
791 LOperand* left() { return inputs_[0]; }
792 LOperand* right() { return inputs_[1]; }
793
794 DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch,
795 "compare-numeric-and-branch")
796 DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch)
797
798 Token::Value op() const { return hydrogen()->token(); }
799 bool is_double() const {
800 return hydrogen()->representation().IsDouble();
801 }
802
803 void PrintDataTo(StringStream* stream) override;
804};
805
806
807class LMathFloor final : public LTemplateInstruction<1, 1, 1> {
808 public:
809 LMathFloor(LOperand* value, LOperand* temp) {
810 inputs_[0] = value;
811 temps_[0] = temp;
812 }
813
814 LOperand* value() { return inputs_[0]; }
815 LOperand* temp() { return temps_[0]; }
816
817 DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor")
818 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
819};
820
821
822class LMathRound final : public LTemplateInstruction<1, 1, 1> {
823 public:
824 LMathRound(LOperand* value, LOperand* temp) {
825 inputs_[0] = value;
826 temps_[0] = temp;
827 }
828
829 LOperand* value() { return inputs_[0]; }
830 LOperand* temp() { return temps_[0]; }
831
832 DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round")
833 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
834};
835
836
837class LMathFround final : public LTemplateInstruction<1, 1, 0> {
838 public:
839 explicit LMathFround(LOperand* value) { inputs_[0] = value; }
840
841 LOperand* value() { return inputs_[0]; }
842
843 DECLARE_CONCRETE_INSTRUCTION(MathFround, "math-fround")
844};
845
846
847class LMathAbs final : public LTemplateInstruction<1, 2, 0> {
848 public:
849 LMathAbs(LOperand* context, LOperand* value) {
850 inputs_[1] = context;
851 inputs_[0] = value;
852 }
853
854 LOperand* context() { return inputs_[1]; }
855 LOperand* value() { return inputs_[0]; }
856
857 DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs")
858 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
859};
860
861
862class LMathLog final : public LTemplateInstruction<1, 1, 0> {
863 public:
864 explicit LMathLog(LOperand* value) {
865 inputs_[0] = value;
866 }
867
868 LOperand* value() { return inputs_[0]; }
869
870 DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log")
871};
872
873
874class LMathClz32 final : public LTemplateInstruction<1, 1, 0> {
875 public:
876 explicit LMathClz32(LOperand* value) {
877 inputs_[0] = value;
878 }
879
880 LOperand* value() { return inputs_[0]; }
881
882 DECLARE_CONCRETE_INSTRUCTION(MathClz32, "math-clz32")
883};
884
885
886class LMathExp final : public LTemplateInstruction<1, 1, 3> {
887 public:
888 LMathExp(LOperand* value,
889 LOperand* double_temp,
890 LOperand* temp1,
891 LOperand* temp2) {
892 inputs_[0] = value;
893 temps_[0] = temp1;
894 temps_[1] = temp2;
895 temps_[2] = double_temp;
896 ExternalReference::InitializeMathExpData();
897 }
898
899 LOperand* value() { return inputs_[0]; }
900 LOperand* temp1() { return temps_[0]; }
901 LOperand* temp2() { return temps_[1]; }
902 LOperand* double_temp() { return temps_[2]; }
903
904 DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp")
905};
906
907
908class LMathSqrt final : public LTemplateInstruction<1, 1, 0> {
909 public:
910 explicit LMathSqrt(LOperand* value) {
911 inputs_[0] = value;
912 }
913
914 LOperand* value() { return inputs_[0]; }
915
916 DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt")
917};
918
919
920class LMathPowHalf final : public LTemplateInstruction<1, 1, 1> {
921 public:
922 LMathPowHalf(LOperand* value, LOperand* temp) {
923 inputs_[0] = value;
924 temps_[0] = temp;
925 }
926
927 LOperand* value() { return inputs_[0]; }
928 LOperand* temp() { return temps_[0]; }
929
930 DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half")
931};
932
933
934class LCmpObjectEqAndBranch final : public LControlInstruction<2, 0> {
935 public:
936 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) {
937 inputs_[0] = left;
938 inputs_[1] = right;
939 }
940
941 LOperand* left() { return inputs_[0]; }
942 LOperand* right() { return inputs_[1]; }
943
944 DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch, "cmp-object-eq-and-branch")
945 DECLARE_HYDROGEN_ACCESSOR(CompareObjectEqAndBranch)
946};
947
948
949class LCmpHoleAndBranch final : public LControlInstruction<1, 0> {
950 public:
951 explicit LCmpHoleAndBranch(LOperand* object) {
952 inputs_[0] = object;
953 }
954
955 LOperand* object() { return inputs_[0]; }
956
957 DECLARE_CONCRETE_INSTRUCTION(CmpHoleAndBranch, "cmp-hole-and-branch")
958 DECLARE_HYDROGEN_ACCESSOR(CompareHoleAndBranch)
959};
960
961
Ben Murdoch4a90d5f2016-03-22 12:00:34 +0000962class LIsStringAndBranch final : public LControlInstruction<1, 1> {
963 public:
964 LIsStringAndBranch(LOperand* value, LOperand* temp) {
965 inputs_[0] = value;
966 temps_[0] = temp;
967 }
968
969 LOperand* value() { return inputs_[0]; }
970 LOperand* temp() { return temps_[0]; }
971
972 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch")
973 DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch)
974
975 void PrintDataTo(StringStream* stream) override;
976};
977
978
979class LIsSmiAndBranch final : public LControlInstruction<1, 0> {
980 public:
981 explicit LIsSmiAndBranch(LOperand* value) {
982 inputs_[0] = value;
983 }
984
985 LOperand* value() { return inputs_[0]; }
986
987 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
988 DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch)
989
990 void PrintDataTo(StringStream* stream) override;
991};
992
993
994class LIsUndetectableAndBranch final : public LControlInstruction<1, 1> {
995 public:
996 explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) {
997 inputs_[0] = value;
998 temps_[0] = temp;
999 }
1000
1001 LOperand* value() { return inputs_[0]; }
1002 LOperand* temp() { return temps_[0]; }
1003
1004 DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch,
1005 "is-undetectable-and-branch")
1006 DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch)
1007
1008 void PrintDataTo(StringStream* stream) override;
1009};
1010
1011
1012class LStringCompareAndBranch final : public LControlInstruction<3, 0> {
1013 public:
1014 LStringCompareAndBranch(LOperand* context, LOperand* left, LOperand* right) {
1015 inputs_[0] = context;
1016 inputs_[1] = left;
1017 inputs_[2] = right;
1018 }
1019
1020 LOperand* context() { return inputs_[0]; }
1021 LOperand* left() { return inputs_[1]; }
1022 LOperand* right() { return inputs_[2]; }
1023
1024 DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch,
1025 "string-compare-and-branch")
1026 DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch)
1027
1028 Token::Value op() const { return hydrogen()->token(); }
1029
1030 void PrintDataTo(StringStream* stream) override;
1031};
1032
1033
1034class LHasInstanceTypeAndBranch final : public LControlInstruction<1, 0> {
1035 public:
1036 explicit LHasInstanceTypeAndBranch(LOperand* value) {
1037 inputs_[0] = value;
1038 }
1039
1040 LOperand* value() { return inputs_[0]; }
1041
1042 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
1043 "has-instance-type-and-branch")
1044 DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch)
1045
1046 void PrintDataTo(StringStream* stream) override;
1047};
1048
1049
1050class LGetCachedArrayIndex final : public LTemplateInstruction<1, 1, 0> {
1051 public:
1052 explicit LGetCachedArrayIndex(LOperand* value) {
1053 inputs_[0] = value;
1054 }
1055
1056 LOperand* value() { return inputs_[0]; }
1057
1058 DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index")
1059 DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex)
1060};
1061
1062
1063class LHasCachedArrayIndexAndBranch final : public LControlInstruction<1, 0> {
1064 public:
1065 explicit LHasCachedArrayIndexAndBranch(LOperand* value) {
1066 inputs_[0] = value;
1067 }
1068
1069 LOperand* value() { return inputs_[0]; }
1070
1071 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch,
1072 "has-cached-array-index-and-branch")
1073 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch)
1074
1075 void PrintDataTo(StringStream* stream) override;
1076};
1077
1078
1079class LClassOfTestAndBranch final : public LControlInstruction<1, 1> {
1080 public:
1081 LClassOfTestAndBranch(LOperand* value, LOperand* temp) {
1082 inputs_[0] = value;
1083 temps_[0] = temp;
1084 }
1085
1086 LOperand* value() { return inputs_[0]; }
1087 LOperand* temp() { return temps_[0]; }
1088
1089 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch,
1090 "class-of-test-and-branch")
1091 DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch)
1092
1093 void PrintDataTo(StringStream* stream) override;
1094};
1095
1096
1097class LCmpT final : public LTemplateInstruction<1, 3, 0> {
1098 public:
1099 LCmpT(LOperand* context, LOperand* left, LOperand* right) {
1100 inputs_[0] = context;
1101 inputs_[1] = left;
1102 inputs_[2] = right;
1103 }
1104
1105 LOperand* context() { return inputs_[0]; }
1106 LOperand* left() { return inputs_[1]; }
1107 LOperand* right() { return inputs_[2]; }
1108
1109 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
1110 DECLARE_HYDROGEN_ACCESSOR(CompareGeneric)
1111
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001112 Token::Value op() const { return hydrogen()->token(); }
1113};
1114
1115
1116class LInstanceOf final : public LTemplateInstruction<1, 3, 0> {
1117 public:
1118 LInstanceOf(LOperand* context, LOperand* left, LOperand* right) {
1119 inputs_[0] = context;
1120 inputs_[1] = left;
1121 inputs_[2] = right;
1122 }
1123
1124 LOperand* context() const { return inputs_[0]; }
1125 LOperand* left() const { return inputs_[1]; }
1126 LOperand* right() const { return inputs_[2]; }
1127
1128 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
1129};
1130
1131
1132class LHasInPrototypeChainAndBranch final : public LControlInstruction<2, 0> {
1133 public:
1134 LHasInPrototypeChainAndBranch(LOperand* object, LOperand* prototype) {
1135 inputs_[0] = object;
1136 inputs_[1] = prototype;
1137 }
1138
1139 LOperand* object() const { return inputs_[0]; }
1140 LOperand* prototype() const { return inputs_[1]; }
1141
1142 DECLARE_CONCRETE_INSTRUCTION(HasInPrototypeChainAndBranch,
1143 "has-in-prototype-chain-and-branch")
1144 DECLARE_HYDROGEN_ACCESSOR(HasInPrototypeChainAndBranch)
1145};
1146
1147
1148class LBoundsCheck final : public LTemplateInstruction<0, 2, 0> {
1149 public:
1150 LBoundsCheck(LOperand* index, LOperand* length) {
1151 inputs_[0] = index;
1152 inputs_[1] = length;
1153 }
1154
1155 LOperand* index() { return inputs_[0]; }
1156 LOperand* length() { return inputs_[1]; }
1157
1158 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check")
1159 DECLARE_HYDROGEN_ACCESSOR(BoundsCheck)
1160};
1161
1162
1163class LBitI final : public LTemplateInstruction<1, 2, 0> {
1164 public:
1165 LBitI(LOperand* left, LOperand* right) {
1166 inputs_[0] = left;
1167 inputs_[1] = right;
1168 }
1169
1170 LOperand* left() { return inputs_[0]; }
1171 LOperand* right() { return inputs_[1]; }
1172
1173 Token::Value op() const { return hydrogen()->op(); }
1174
1175 DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i")
1176 DECLARE_HYDROGEN_ACCESSOR(Bitwise)
1177};
1178
1179
1180class LShiftI final : public LTemplateInstruction<1, 2, 0> {
1181 public:
1182 LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt)
1183 : op_(op), can_deopt_(can_deopt) {
1184 inputs_[0] = left;
1185 inputs_[1] = right;
1186 }
1187
1188 Token::Value op() const { return op_; }
1189 LOperand* left() { return inputs_[0]; }
1190 LOperand* right() { return inputs_[1]; }
1191 bool can_deopt() const { return can_deopt_; }
1192
1193 DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i")
1194
1195 private:
1196 Token::Value op_;
1197 bool can_deopt_;
1198};
1199
1200
1201class LSubI final : public LTemplateInstruction<1, 2, 0> {
1202 public:
1203 LSubI(LOperand* left, LOperand* right) {
1204 inputs_[0] = left;
1205 inputs_[1] = right;
1206 }
1207
1208 LOperand* left() { return inputs_[0]; }
1209 LOperand* right() { return inputs_[1]; }
1210
1211 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i")
1212 DECLARE_HYDROGEN_ACCESSOR(Sub)
1213};
1214
1215
1216class LConstantI final : public LTemplateInstruction<1, 0, 0> {
1217 public:
1218 DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i")
1219 DECLARE_HYDROGEN_ACCESSOR(Constant)
1220
1221 int32_t value() const { return hydrogen()->Integer32Value(); }
1222};
1223
1224
1225class LConstantS final : public LTemplateInstruction<1, 0, 0> {
1226 public:
1227 DECLARE_CONCRETE_INSTRUCTION(ConstantS, "constant-s")
1228 DECLARE_HYDROGEN_ACCESSOR(Constant)
1229
1230 Smi* value() const { return Smi::FromInt(hydrogen()->Integer32Value()); }
1231};
1232
1233
1234class LConstantD final : public LTemplateInstruction<1, 0, 0> {
1235 public:
1236 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
1237 DECLARE_HYDROGEN_ACCESSOR(Constant)
1238
1239 double value() const { return hydrogen()->DoubleValue(); }
1240 uint64_t bits() const { return hydrogen()->DoubleValueAsBits(); }
1241};
1242
1243
1244class LConstantE final : public LTemplateInstruction<1, 0, 0> {
1245 public:
1246 DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e")
1247 DECLARE_HYDROGEN_ACCESSOR(Constant)
1248
1249 ExternalReference value() const {
1250 return hydrogen()->ExternalReferenceValue();
1251 }
1252};
1253
1254
1255class LConstantT final : public LTemplateInstruction<1, 0, 0> {
1256 public:
1257 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
1258 DECLARE_HYDROGEN_ACCESSOR(Constant)
1259
1260 Handle<Object> value(Isolate* isolate) const {
1261 return hydrogen()->handle(isolate);
1262 }
1263};
1264
1265
1266class LBranch final : public LControlInstruction<1, 0> {
1267 public:
1268 explicit LBranch(LOperand* value) {
1269 inputs_[0] = value;
1270 }
1271
1272 LOperand* value() { return inputs_[0]; }
1273
1274 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
1275 DECLARE_HYDROGEN_ACCESSOR(Branch)
1276
1277 void PrintDataTo(StringStream* stream) override;
1278};
1279
1280
1281class LCmpMapAndBranch final : public LControlInstruction<1, 1> {
1282 public:
1283 LCmpMapAndBranch(LOperand* value, LOperand* temp) {
1284 inputs_[0] = value;
1285 temps_[0] = temp;
1286 }
1287
1288 LOperand* value() { return inputs_[0]; }
1289 LOperand* temp() { return temps_[0]; }
1290
1291 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
1292 DECLARE_HYDROGEN_ACCESSOR(CompareMap)
1293
1294 Handle<Map> map() const { return hydrogen()->map().handle(); }
1295};
1296
1297
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001298class LSeqStringGetChar final : public LTemplateInstruction<1, 2, 0> {
1299 public:
1300 LSeqStringGetChar(LOperand* string, LOperand* index) {
1301 inputs_[0] = string;
1302 inputs_[1] = index;
1303 }
1304
1305 LOperand* string() const { return inputs_[0]; }
1306 LOperand* index() const { return inputs_[1]; }
1307
1308 DECLARE_CONCRETE_INSTRUCTION(SeqStringGetChar, "seq-string-get-char")
1309 DECLARE_HYDROGEN_ACCESSOR(SeqStringGetChar)
1310};
1311
1312
1313class LSeqStringSetChar final : public LTemplateInstruction<1, 4, 0> {
1314 public:
1315 LSeqStringSetChar(LOperand* context,
1316 LOperand* string,
1317 LOperand* index,
1318 LOperand* value) {
1319 inputs_[0] = context;
1320 inputs_[1] = string;
1321 inputs_[2] = index;
1322 inputs_[3] = value;
1323 }
1324
1325 LOperand* string() { return inputs_[1]; }
1326 LOperand* index() { return inputs_[2]; }
1327 LOperand* value() { return inputs_[3]; }
1328
1329 DECLARE_CONCRETE_INSTRUCTION(SeqStringSetChar, "seq-string-set-char")
1330 DECLARE_HYDROGEN_ACCESSOR(SeqStringSetChar)
1331};
1332
1333
1334class LAddI final : public LTemplateInstruction<1, 2, 0> {
1335 public:
1336 LAddI(LOperand* left, LOperand* right) {
1337 inputs_[0] = left;
1338 inputs_[1] = right;
1339 }
1340
1341 LOperand* left() { return inputs_[0]; }
1342 LOperand* right() { return inputs_[1]; }
1343
1344 DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i")
1345 DECLARE_HYDROGEN_ACCESSOR(Add)
1346};
1347
1348
1349class LMathMinMax final : public LTemplateInstruction<1, 2, 0> {
1350 public:
1351 LMathMinMax(LOperand* left, LOperand* right) {
1352 inputs_[0] = left;
1353 inputs_[1] = right;
1354 }
1355
1356 LOperand* left() { return inputs_[0]; }
1357 LOperand* right() { return inputs_[1]; }
1358
1359 DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "math-min-max")
1360 DECLARE_HYDROGEN_ACCESSOR(MathMinMax)
1361};
1362
1363
1364class LPower final : public LTemplateInstruction<1, 2, 0> {
1365 public:
1366 LPower(LOperand* left, LOperand* right) {
1367 inputs_[0] = left;
1368 inputs_[1] = right;
1369 }
1370
1371 LOperand* left() { return inputs_[0]; }
1372 LOperand* right() { return inputs_[1]; }
1373
1374 DECLARE_CONCRETE_INSTRUCTION(Power, "power")
1375 DECLARE_HYDROGEN_ACCESSOR(Power)
1376};
1377
1378
1379class LArithmeticD final : public LTemplateInstruction<1, 2, 0> {
1380 public:
1381 LArithmeticD(Token::Value op, LOperand* left, LOperand* right)
1382 : op_(op) {
1383 inputs_[0] = left;
1384 inputs_[1] = right;
1385 }
1386
1387 Token::Value op() const { return op_; }
1388 LOperand* left() { return inputs_[0]; }
1389 LOperand* right() { return inputs_[1]; }
1390
1391 Opcode opcode() const override { return LInstruction::kArithmeticD; }
1392 void CompileToNative(LCodeGen* generator) override;
1393 const char* Mnemonic() const override;
1394
1395 private:
1396 Token::Value op_;
1397};
1398
1399
1400class LArithmeticT final : public LTemplateInstruction<1, 3, 0> {
1401 public:
1402 LArithmeticT(Token::Value op,
1403 LOperand* context,
1404 LOperand* left,
1405 LOperand* right)
1406 : op_(op) {
1407 inputs_[0] = context;
1408 inputs_[1] = left;
1409 inputs_[2] = right;
1410 }
1411
1412 LOperand* context() { return inputs_[0]; }
1413 LOperand* left() { return inputs_[1]; }
1414 LOperand* right() { return inputs_[2]; }
1415 Token::Value op() const { return op_; }
1416
1417 Opcode opcode() const final { return LInstruction::kArithmeticT; }
1418 void CompileToNative(LCodeGen* generator) override;
1419 const char* Mnemonic() const override;
1420
1421 DECLARE_HYDROGEN_ACCESSOR(BinaryOperation)
1422
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001423 private:
1424 Token::Value op_;
1425};
1426
1427
1428class LReturn final : public LTemplateInstruction<0, 3, 0> {
1429 public:
1430 LReturn(LOperand* value, LOperand* context, LOperand* parameter_count) {
1431 inputs_[0] = value;
1432 inputs_[1] = context;
1433 inputs_[2] = parameter_count;
1434 }
1435
1436 LOperand* value() { return inputs_[0]; }
1437
1438 bool has_constant_parameter_count() {
1439 return parameter_count()->IsConstantOperand();
1440 }
1441 LConstantOperand* constant_parameter_count() {
1442 DCHECK(has_constant_parameter_count());
1443 return LConstantOperand::cast(parameter_count());
1444 }
1445 LOperand* parameter_count() { return inputs_[2]; }
1446
1447 DECLARE_CONCRETE_INSTRUCTION(Return, "return")
1448};
1449
1450
1451class LLoadNamedField final : public LTemplateInstruction<1, 1, 0> {
1452 public:
1453 explicit LLoadNamedField(LOperand* object) {
1454 inputs_[0] = object;
1455 }
1456
1457 LOperand* object() { return inputs_[0]; }
1458
1459 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field")
1460 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField)
1461};
1462
1463
1464class LLoadNamedGeneric final : public LTemplateInstruction<1, 2, 1> {
1465 public:
1466 LLoadNamedGeneric(LOperand* context, LOperand* object, LOperand* vector) {
1467 inputs_[0] = context;
1468 inputs_[1] = object;
1469 temps_[0] = vector;
1470 }
1471
1472 LOperand* context() { return inputs_[0]; }
1473 LOperand* object() { return inputs_[1]; }
1474 LOperand* temp_vector() { return temps_[0]; }
1475
1476 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
1477 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
1478
1479 Handle<Object> name() const { return hydrogen()->name(); }
1480};
1481
1482
1483class LLoadFunctionPrototype final : public LTemplateInstruction<1, 1, 0> {
1484 public:
1485 explicit LLoadFunctionPrototype(LOperand* function) {
1486 inputs_[0] = function;
1487 }
1488
1489 LOperand* function() { return inputs_[0]; }
1490
1491 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype")
1492 DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype)
1493};
1494
1495
1496class LLoadRoot final : public LTemplateInstruction<1, 0, 0> {
1497 public:
1498 DECLARE_CONCRETE_INSTRUCTION(LoadRoot, "load-root")
1499 DECLARE_HYDROGEN_ACCESSOR(LoadRoot)
1500
1501 Heap::RootListIndex index() const { return hydrogen()->index(); }
1502};
1503
1504
1505class LLoadKeyed final : public LTemplateInstruction<1, 3, 0> {
1506 public:
1507 LLoadKeyed(LOperand* elements, LOperand* key, LOperand* backing_store_owner) {
1508 inputs_[0] = elements;
1509 inputs_[1] = key;
1510 inputs_[2] = backing_store_owner;
1511 }
1512
1513 LOperand* elements() { return inputs_[0]; }
1514 LOperand* key() { return inputs_[1]; }
1515 LOperand* backing_store_owner() { return inputs_[2]; }
1516 ElementsKind elements_kind() const {
1517 return hydrogen()->elements_kind();
1518 }
1519 bool is_fixed_typed_array() const {
1520 return hydrogen()->is_fixed_typed_array();
1521 }
1522
1523 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed")
1524 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed)
1525
1526 void PrintDataTo(StringStream* stream) override;
1527 uint32_t base_offset() const { return hydrogen()->base_offset(); }
1528};
1529
1530
1531class LLoadKeyedGeneric final : public LTemplateInstruction<1, 3, 1> {
1532 public:
1533 LLoadKeyedGeneric(LOperand* context, LOperand* object, LOperand* key,
1534 LOperand* vector) {
1535 inputs_[0] = context;
1536 inputs_[1] = object;
1537 inputs_[2] = key;
1538 temps_[0] = vector;
1539 }
1540
1541 LOperand* context() { return inputs_[0]; }
1542 LOperand* object() { return inputs_[1]; }
1543 LOperand* key() { return inputs_[2]; }
1544 LOperand* temp_vector() { return temps_[0]; }
1545
1546 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
1547 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedGeneric)
1548};
1549
1550
1551class LLoadGlobalGeneric final : public LTemplateInstruction<1, 2, 1> {
1552 public:
1553 LLoadGlobalGeneric(LOperand* context, LOperand* global_object,
1554 LOperand* vector) {
1555 inputs_[0] = context;
1556 inputs_[1] = global_object;
1557 temps_[0] = vector;
1558 }
1559
1560 LOperand* context() { return inputs_[0]; }
1561 LOperand* global_object() { return inputs_[1]; }
1562 LOperand* temp_vector() { return temps_[0]; }
1563
1564 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic")
1565 DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric)
1566
1567 Handle<Object> name() const { return hydrogen()->name(); }
1568 TypeofMode typeof_mode() const { return hydrogen()->typeof_mode(); }
1569};
1570
1571
1572class LLoadContextSlot final : public LTemplateInstruction<1, 1, 0> {
1573 public:
1574 explicit LLoadContextSlot(LOperand* context) {
1575 inputs_[0] = context;
1576 }
1577
1578 LOperand* context() { return inputs_[0]; }
1579
1580 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot")
1581 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot)
1582
1583 int slot_index() { return hydrogen()->slot_index(); }
1584
1585 void PrintDataTo(StringStream* stream) override;
1586};
1587
1588
1589class LStoreContextSlot final : public LTemplateInstruction<0, 2, 0> {
1590 public:
1591 LStoreContextSlot(LOperand* context, LOperand* value) {
1592 inputs_[0] = context;
1593 inputs_[1] = value;
1594 }
1595
1596 LOperand* context() { return inputs_[0]; }
1597 LOperand* value() { return inputs_[1]; }
1598
1599 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
1600 DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
1601
1602 int slot_index() { return hydrogen()->slot_index(); }
1603
1604 void PrintDataTo(StringStream* stream) override;
1605};
1606
1607
1608class LPushArgument final : public LTemplateInstruction<0, 1, 0> {
1609 public:
1610 explicit LPushArgument(LOperand* value) {
1611 inputs_[0] = value;
1612 }
1613
1614 LOperand* value() { return inputs_[0]; }
1615
1616 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
1617};
1618
1619
1620class LDrop final : public LTemplateInstruction<0, 0, 0> {
1621 public:
1622 explicit LDrop(int count) : count_(count) { }
1623
1624 int count() const { return count_; }
1625
1626 DECLARE_CONCRETE_INSTRUCTION(Drop, "drop")
1627
1628 private:
1629 int count_;
1630};
1631
1632
1633class LStoreCodeEntry final : public LTemplateInstruction<0, 2, 0> {
1634 public:
1635 LStoreCodeEntry(LOperand* function, LOperand* code_object) {
1636 inputs_[0] = function;
1637 inputs_[1] = code_object;
1638 }
1639
1640 LOperand* function() { return inputs_[0]; }
1641 LOperand* code_object() { return inputs_[1]; }
1642
1643 void PrintDataTo(StringStream* stream) override;
1644
1645 DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry, "store-code-entry")
1646 DECLARE_HYDROGEN_ACCESSOR(StoreCodeEntry)
1647};
1648
1649
1650class LInnerAllocatedObject final : public LTemplateInstruction<1, 2, 0> {
1651 public:
1652 LInnerAllocatedObject(LOperand* base_object, LOperand* offset) {
1653 inputs_[0] = base_object;
1654 inputs_[1] = offset;
1655 }
1656
1657 LOperand* base_object() const { return inputs_[0]; }
1658 LOperand* offset() const { return inputs_[1]; }
1659
1660 void PrintDataTo(StringStream* stream) override;
1661
1662 DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject, "inner-allocated-object")
1663};
1664
1665
1666class LThisFunction final : public LTemplateInstruction<1, 0, 0> {
1667 public:
1668 DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function")
1669 DECLARE_HYDROGEN_ACCESSOR(ThisFunction)
1670};
1671
1672
1673class LContext final : public LTemplateInstruction<1, 0, 0> {
1674 public:
1675 DECLARE_CONCRETE_INSTRUCTION(Context, "context")
1676 DECLARE_HYDROGEN_ACCESSOR(Context)
1677};
1678
1679
1680class LDeclareGlobals final : public LTemplateInstruction<0, 1, 0> {
1681 public:
1682 explicit LDeclareGlobals(LOperand* context) {
1683 inputs_[0] = context;
1684 }
1685
1686 LOperand* context() { return inputs_[0]; }
1687
1688 DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals")
1689 DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals)
1690};
1691
1692
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001693class LCallWithDescriptor final : public LTemplateResultInstruction<1> {
1694 public:
1695 LCallWithDescriptor(CallInterfaceDescriptor descriptor,
1696 const ZoneList<LOperand*>& operands, Zone* zone)
1697 : descriptor_(descriptor),
1698 inputs_(descriptor.GetRegisterParameterCount() +
1699 kImplicitRegisterParameterCount,
1700 zone) {
1701 DCHECK(descriptor.GetRegisterParameterCount() +
1702 kImplicitRegisterParameterCount ==
1703 operands.length());
1704 inputs_.AddAll(operands, zone);
1705 }
1706
1707 LOperand* target() const { return inputs_[0]; }
1708
1709 const CallInterfaceDescriptor descriptor() { return descriptor_; }
1710
1711 DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor)
1712
1713 // The target and context are passed as implicit parameters that are not
1714 // explicitly listed in the descriptor.
1715 static const int kImplicitRegisterParameterCount = 2;
1716
1717 private:
1718 DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor")
1719
1720 void PrintDataTo(StringStream* stream) override;
1721
1722 int arity() const { return hydrogen()->argument_count() - 1; }
1723
1724 CallInterfaceDescriptor descriptor_;
1725 ZoneList<LOperand*> inputs_;
1726
1727 // Iterator support.
1728 int InputCount() final { return inputs_.length(); }
1729 LOperand* InputAt(int i) final { return inputs_[i]; }
1730
1731 int TempCount() final { return 0; }
1732 LOperand* TempAt(int i) final { return NULL; }
1733};
1734
1735
1736class LInvokeFunction final : public LTemplateInstruction<1, 2, 0> {
1737 public:
1738 LInvokeFunction(LOperand* context, LOperand* function) {
1739 inputs_[0] = context;
1740 inputs_[1] = function;
1741 }
1742
1743 LOperand* context() { return inputs_[0]; }
1744 LOperand* function() { return inputs_[1]; }
1745
1746 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
1747 DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
1748
1749 void PrintDataTo(StringStream* stream) override;
1750
1751 int arity() const { return hydrogen()->argument_count() - 1; }
1752};
1753
1754
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001755class LCallNewArray final : public LTemplateInstruction<1, 2, 0> {
1756 public:
1757 LCallNewArray(LOperand* context, LOperand* constructor) {
1758 inputs_[0] = context;
1759 inputs_[1] = constructor;
1760 }
1761
1762 LOperand* context() { return inputs_[0]; }
1763 LOperand* constructor() { return inputs_[1]; }
1764
1765 DECLARE_CONCRETE_INSTRUCTION(CallNewArray, "call-new-array")
1766 DECLARE_HYDROGEN_ACCESSOR(CallNewArray)
1767
1768 void PrintDataTo(StringStream* stream) override;
1769
1770 int arity() const { return hydrogen()->argument_count() - 1; }
1771};
1772
1773
1774class LCallRuntime final : public LTemplateInstruction<1, 1, 0> {
1775 public:
1776 explicit LCallRuntime(LOperand* context) {
1777 inputs_[0] = context;
1778 }
1779
1780 LOperand* context() { return inputs_[0]; }
1781
1782 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
1783 DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
1784
1785 bool ClobbersDoubleRegisters(Isolate* isolate) const override {
1786 return save_doubles() == kDontSaveFPRegs;
1787 }
1788
1789 const Runtime::Function* function() const { return hydrogen()->function(); }
1790 int arity() const { return hydrogen()->argument_count(); }
1791 SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); }
1792};
1793
1794
1795class LInteger32ToDouble final : public LTemplateInstruction<1, 1, 0> {
1796 public:
1797 explicit LInteger32ToDouble(LOperand* value) {
1798 inputs_[0] = value;
1799 }
1800
1801 LOperand* value() { return inputs_[0]; }
1802
1803 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double")
1804};
1805
1806
1807class LUint32ToDouble final : public LTemplateInstruction<1, 1, 0> {
1808 public:
1809 explicit LUint32ToDouble(LOperand* value) {
1810 inputs_[0] = value;
1811 }
1812
1813 LOperand* value() { return inputs_[0]; }
1814
1815 DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double")
1816};
1817
1818
1819class LNumberTagI final : public LTemplateInstruction<1, 1, 2> {
1820 public:
1821 LNumberTagI(LOperand* value, LOperand* temp1, LOperand* temp2) {
1822 inputs_[0] = value;
1823 temps_[0] = temp1;
1824 temps_[1] = temp2;
1825 }
1826
1827 LOperand* value() { return inputs_[0]; }
1828 LOperand* temp1() { return temps_[0]; }
1829 LOperand* temp2() { return temps_[1]; }
1830
1831 DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i")
1832};
1833
1834
1835class LNumberTagU final : public LTemplateInstruction<1, 1, 2> {
1836 public:
1837 LNumberTagU(LOperand* value, LOperand* temp1, LOperand* temp2) {
1838 inputs_[0] = value;
1839 temps_[0] = temp1;
1840 temps_[1] = temp2;
1841 }
1842
1843 LOperand* value() { return inputs_[0]; }
1844 LOperand* temp1() { return temps_[0]; }
1845 LOperand* temp2() { return temps_[1]; }
1846
1847 DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u")
1848};
1849
1850
1851class LNumberTagD final : public LTemplateInstruction<1, 1, 2> {
1852 public:
1853 LNumberTagD(LOperand* value, LOperand* temp, LOperand* temp2) {
1854 inputs_[0] = value;
1855 temps_[0] = temp;
1856 temps_[1] = temp2;
1857 }
1858
1859 LOperand* value() { return inputs_[0]; }
1860 LOperand* temp() { return temps_[0]; }
1861 LOperand* temp2() { return temps_[1]; }
1862
1863 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d")
1864 DECLARE_HYDROGEN_ACCESSOR(Change)
1865};
1866
1867
1868class LDoubleToSmi final : public LTemplateInstruction<1, 1, 0> {
1869 public:
1870 explicit LDoubleToSmi(LOperand* value) {
1871 inputs_[0] = value;
1872 }
1873
1874 LOperand* value() { return inputs_[0]; }
1875
1876 DECLARE_CONCRETE_INSTRUCTION(DoubleToSmi, "double-to-smi")
1877 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
1878
1879 bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1880};
1881
1882
1883// Sometimes truncating conversion from a tagged value to an int32.
1884class LDoubleToI final : public LTemplateInstruction<1, 1, 0> {
1885 public:
1886 explicit LDoubleToI(LOperand* value) {
1887 inputs_[0] = value;
1888 }
1889
1890 LOperand* value() { return inputs_[0]; }
1891
1892 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
1893 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
1894
1895 bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1896};
1897
1898
1899// Truncating conversion from a tagged value to an int32.
1900class LTaggedToI final : public LTemplateInstruction<1, 1, 2> {
1901 public:
1902 LTaggedToI(LOperand* value,
1903 LOperand* temp,
1904 LOperand* temp2) {
1905 inputs_[0] = value;
1906 temps_[0] = temp;
1907 temps_[1] = temp2;
1908 }
1909
1910 LOperand* value() { return inputs_[0]; }
1911 LOperand* temp() { return temps_[0]; }
1912 LOperand* temp2() { return temps_[1]; }
1913
1914 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
1915 DECLARE_HYDROGEN_ACCESSOR(Change)
1916
1917 bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1918};
1919
1920
1921class LSmiTag final : public LTemplateInstruction<1, 1, 0> {
1922 public:
1923 explicit LSmiTag(LOperand* value) {
1924 inputs_[0] = value;
1925 }
1926
1927 LOperand* value() { return inputs_[0]; }
1928
1929 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag")
1930 DECLARE_HYDROGEN_ACCESSOR(Change)
1931};
1932
1933
1934class LNumberUntagD final : public LTemplateInstruction<1, 1, 0> {
1935 public:
1936 explicit LNumberUntagD(LOperand* value) {
1937 inputs_[0] = value;
1938 }
1939
1940 LOperand* value() { return inputs_[0]; }
1941
1942 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
1943 DECLARE_HYDROGEN_ACCESSOR(Change)
1944};
1945
1946
1947class LSmiUntag final : public LTemplateInstruction<1, 1, 0> {
1948 public:
1949 LSmiUntag(LOperand* value, bool needs_check)
1950 : needs_check_(needs_check) {
1951 inputs_[0] = value;
1952 }
1953
1954 LOperand* value() { return inputs_[0]; }
1955 bool needs_check() const { return needs_check_; }
1956
1957 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag")
1958
1959 private:
1960 bool needs_check_;
1961};
1962
1963
1964class LStoreNamedField final : public LTemplateInstruction<0, 2, 1> {
1965 public:
1966 LStoreNamedField(LOperand* object, LOperand* value, LOperand* temp) {
1967 inputs_[0] = object;
1968 inputs_[1] = value;
1969 temps_[0] = temp;
1970 }
1971
1972 LOperand* object() { return inputs_[0]; }
1973 LOperand* value() { return inputs_[1]; }
1974 LOperand* temp() { return temps_[0]; }
1975
1976 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
1977 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
1978
1979 void PrintDataTo(StringStream* stream) override;
1980
1981 Representation representation() const {
1982 return hydrogen()->field_representation();
1983 }
1984};
1985
1986
1987class LStoreNamedGeneric final : public LTemplateInstruction<0, 3, 2> {
1988 public:
1989 LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value,
1990 LOperand* slot, LOperand* vector) {
1991 inputs_[0] = context;
1992 inputs_[1] = object;
1993 inputs_[2] = value;
1994 temps_[0] = slot;
1995 temps_[1] = vector;
1996 }
1997
1998 LOperand* context() { return inputs_[0]; }
1999 LOperand* object() { return inputs_[1]; }
2000 LOperand* value() { return inputs_[2]; }
2001 LOperand* temp_slot() { return temps_[0]; }
2002 LOperand* temp_vector() { return temps_[1]; }
2003
2004 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
2005 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
2006
2007 void PrintDataTo(StringStream* stream) override;
2008
2009 Handle<Object> name() const { return hydrogen()->name(); }
2010 LanguageMode language_mode() { return hydrogen()->language_mode(); }
2011};
2012
2013
2014class LStoreKeyed final : public LTemplateInstruction<0, 4, 0> {
2015 public:
2016 LStoreKeyed(LOperand* object, LOperand* key, LOperand* value,
2017 LOperand* backing_store_owner) {
2018 inputs_[0] = object;
2019 inputs_[1] = key;
2020 inputs_[2] = value;
2021 inputs_[3] = backing_store_owner;
2022 }
2023
2024 bool is_fixed_typed_array() const {
2025 return hydrogen()->is_fixed_typed_array();
2026 }
2027 LOperand* elements() { return inputs_[0]; }
2028 LOperand* key() { return inputs_[1]; }
2029 LOperand* value() { return inputs_[2]; }
2030 LOperand* backing_store_owner() { return inputs_[3]; }
2031 ElementsKind elements_kind() const {
2032 return hydrogen()->elements_kind();
2033 }
2034
2035 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed")
2036 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed)
2037
2038 void PrintDataTo(StringStream* stream) override;
2039 bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); }
2040 uint32_t base_offset() const { return hydrogen()->base_offset(); }
2041};
2042
2043
2044class LStoreKeyedGeneric final : public LTemplateInstruction<0, 4, 2> {
2045 public:
2046 LStoreKeyedGeneric(LOperand* context, LOperand* object, LOperand* key,
2047 LOperand* value, LOperand* slot, LOperand* vector) {
2048 inputs_[0] = context;
2049 inputs_[1] = object;
2050 inputs_[2] = key;
2051 inputs_[3] = value;
2052 temps_[0] = slot;
2053 temps_[1] = vector;
2054 }
2055
2056 LOperand* context() { return inputs_[0]; }
2057 LOperand* object() { return inputs_[1]; }
2058 LOperand* key() { return inputs_[2]; }
2059 LOperand* value() { return inputs_[3]; }
2060 LOperand* temp_slot() { return temps_[0]; }
2061 LOperand* temp_vector() { return temps_[1]; }
2062
2063 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
2064 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric)
2065
2066 void PrintDataTo(StringStream* stream) override;
2067
2068 LanguageMode language_mode() { return hydrogen()->language_mode(); }
2069};
2070
2071
2072class LTransitionElementsKind final : public LTemplateInstruction<0, 2, 1> {
2073 public:
2074 LTransitionElementsKind(LOperand* object,
2075 LOperand* context,
2076 LOperand* new_map_temp) {
2077 inputs_[0] = object;
2078 inputs_[1] = context;
2079 temps_[0] = new_map_temp;
2080 }
2081
2082 LOperand* context() { return inputs_[1]; }
2083 LOperand* object() { return inputs_[0]; }
2084 LOperand* new_map_temp() { return temps_[0]; }
2085
2086 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind,
2087 "transition-elements-kind")
2088 DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind)
2089
2090 void PrintDataTo(StringStream* stream) override;
2091
2092 Handle<Map> original_map() { return hydrogen()->original_map().handle(); }
2093 Handle<Map> transitioned_map() {
2094 return hydrogen()->transitioned_map().handle();
2095 }
2096 ElementsKind from_kind() { return hydrogen()->from_kind(); }
2097 ElementsKind to_kind() { return hydrogen()->to_kind(); }
2098};
2099
2100
2101class LTrapAllocationMemento final : public LTemplateInstruction<0, 1, 1> {
2102 public:
2103 LTrapAllocationMemento(LOperand* object,
2104 LOperand* temp) {
2105 inputs_[0] = object;
2106 temps_[0] = temp;
2107 }
2108
2109 LOperand* object() { return inputs_[0]; }
2110 LOperand* temp() { return temps_[0]; }
2111
2112 DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento,
2113 "trap-allocation-memento")
2114};
2115
2116
2117class LMaybeGrowElements final : public LTemplateInstruction<1, 5, 0> {
2118 public:
2119 LMaybeGrowElements(LOperand* context, LOperand* object, LOperand* elements,
2120 LOperand* key, LOperand* current_capacity) {
2121 inputs_[0] = context;
2122 inputs_[1] = object;
2123 inputs_[2] = elements;
2124 inputs_[3] = key;
2125 inputs_[4] = current_capacity;
2126 }
2127
2128 LOperand* context() { return inputs_[0]; }
2129 LOperand* object() { return inputs_[1]; }
2130 LOperand* elements() { return inputs_[2]; }
2131 LOperand* key() { return inputs_[3]; }
2132 LOperand* current_capacity() { return inputs_[4]; }
2133
2134 DECLARE_HYDROGEN_ACCESSOR(MaybeGrowElements)
2135 DECLARE_CONCRETE_INSTRUCTION(MaybeGrowElements, "maybe-grow-elements")
2136};
2137
2138
2139class LStringAdd final : public LTemplateInstruction<1, 3, 0> {
2140 public:
2141 LStringAdd(LOperand* context, LOperand* left, LOperand* right) {
2142 inputs_[0] = context;
2143 inputs_[1] = left;
2144 inputs_[2] = right;
2145 }
2146
2147 LOperand* context() { return inputs_[0]; }
2148 LOperand* left() { return inputs_[1]; }
2149 LOperand* right() { return inputs_[2]; }
2150
2151 DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add")
2152 DECLARE_HYDROGEN_ACCESSOR(StringAdd)
2153};
2154
2155
2156class LStringCharCodeAt final : public LTemplateInstruction<1, 3, 0> {
2157 public:
2158 LStringCharCodeAt(LOperand* context, LOperand* string, LOperand* index) {
2159 inputs_[0] = context;
2160 inputs_[1] = string;
2161 inputs_[2] = index;
2162 }
2163
2164 LOperand* context() { return inputs_[0]; }
2165 LOperand* string() { return inputs_[1]; }
2166 LOperand* index() { return inputs_[2]; }
2167
2168 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at")
2169 DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt)
2170};
2171
2172
2173class LStringCharFromCode final : public LTemplateInstruction<1, 2, 0> {
2174 public:
2175 explicit LStringCharFromCode(LOperand* context, LOperand* char_code) {
2176 inputs_[0] = context;
2177 inputs_[1] = char_code;
2178 }
2179
2180 LOperand* context() { return inputs_[0]; }
2181 LOperand* char_code() { return inputs_[1]; }
2182
2183 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code")
2184 DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode)
2185};
2186
2187
2188class LCheckValue final : public LTemplateInstruction<0, 1, 0> {
2189 public:
2190 explicit LCheckValue(LOperand* value) {
2191 inputs_[0] = value;
2192 }
2193
2194 LOperand* value() { return inputs_[0]; }
2195
2196 DECLARE_CONCRETE_INSTRUCTION(CheckValue, "check-value")
2197 DECLARE_HYDROGEN_ACCESSOR(CheckValue)
2198};
2199
2200
2201class LCheckArrayBufferNotNeutered final
2202 : public LTemplateInstruction<0, 1, 0> {
2203 public:
2204 explicit LCheckArrayBufferNotNeutered(LOperand* view) { inputs_[0] = view; }
2205
2206 LOperand* view() { return inputs_[0]; }
2207
2208 DECLARE_CONCRETE_INSTRUCTION(CheckArrayBufferNotNeutered,
2209 "check-array-buffer-not-neutered")
2210 DECLARE_HYDROGEN_ACCESSOR(CheckArrayBufferNotNeutered)
2211};
2212
2213
2214class LCheckInstanceType final : public LTemplateInstruction<0, 1, 0> {
2215 public:
2216 explicit LCheckInstanceType(LOperand* value) {
2217 inputs_[0] = value;
2218 }
2219
2220 LOperand* value() { return inputs_[0]; }
2221
2222 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
2223 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
2224};
2225
2226
2227class LCheckMaps final : public LTemplateInstruction<0, 1, 0> {
2228 public:
2229 explicit LCheckMaps(LOperand* value = NULL) {
2230 inputs_[0] = value;
2231 }
2232
2233 LOperand* value() { return inputs_[0]; }
2234
2235 DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps")
2236 DECLARE_HYDROGEN_ACCESSOR(CheckMaps)
2237};
2238
2239
2240class LCheckSmi final : public LTemplateInstruction<1, 1, 0> {
2241 public:
2242 explicit LCheckSmi(LOperand* value) {
2243 inputs_[0] = value;
2244 }
2245
2246 LOperand* value() { return inputs_[0]; }
2247
2248 DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi")
2249};
2250
2251
2252class LCheckNonSmi final : public LTemplateInstruction<0, 1, 0> {
2253 public:
2254 explicit LCheckNonSmi(LOperand* value) {
2255 inputs_[0] = value;
2256 }
2257
2258 LOperand* value() { return inputs_[0]; }
2259
2260 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi")
2261 DECLARE_HYDROGEN_ACCESSOR(CheckHeapObject)
2262};
2263
2264
2265class LClampDToUint8 final : public LTemplateInstruction<1, 1, 1> {
2266 public:
2267 LClampDToUint8(LOperand* unclamped, LOperand* temp) {
2268 inputs_[0] = unclamped;
2269 temps_[0] = temp;
2270 }
2271
2272 LOperand* unclamped() { return inputs_[0]; }
2273 LOperand* temp() { return temps_[0]; }
2274
2275 DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8")
2276};
2277
2278
2279class LClampIToUint8 final : public LTemplateInstruction<1, 1, 0> {
2280 public:
2281 explicit LClampIToUint8(LOperand* unclamped) {
2282 inputs_[0] = unclamped;
2283 }
2284
2285 LOperand* unclamped() { return inputs_[0]; }
2286
2287 DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8")
2288};
2289
2290
2291class LClampTToUint8 final : public LTemplateInstruction<1, 1, 1> {
2292 public:
2293 LClampTToUint8(LOperand* unclamped, LOperand* temp) {
2294 inputs_[0] = unclamped;
2295 temps_[0] = temp;
2296 }
2297
2298 LOperand* unclamped() { return inputs_[0]; }
2299 LOperand* temp() { return temps_[0]; }
2300
2301 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8")
2302};
2303
2304
2305class LDoubleBits final : public LTemplateInstruction<1, 1, 0> {
2306 public:
2307 explicit LDoubleBits(LOperand* value) {
2308 inputs_[0] = value;
2309 }
2310
2311 LOperand* value() { return inputs_[0]; }
2312
2313 DECLARE_CONCRETE_INSTRUCTION(DoubleBits, "double-bits")
2314 DECLARE_HYDROGEN_ACCESSOR(DoubleBits)
2315};
2316
2317
2318class LConstructDouble final : public LTemplateInstruction<1, 2, 0> {
2319 public:
2320 LConstructDouble(LOperand* hi, LOperand* lo) {
2321 inputs_[0] = hi;
2322 inputs_[1] = lo;
2323 }
2324
2325 LOperand* hi() { return inputs_[0]; }
2326 LOperand* lo() { return inputs_[1]; }
2327
2328 DECLARE_CONCRETE_INSTRUCTION(ConstructDouble, "construct-double")
2329};
2330
2331
2332class LAllocate final : public LTemplateInstruction<1, 2, 2> {
2333 public:
2334 LAllocate(LOperand* context,
2335 LOperand* size,
2336 LOperand* temp1,
2337 LOperand* temp2) {
2338 inputs_[0] = context;
2339 inputs_[1] = size;
2340 temps_[0] = temp1;
2341 temps_[1] = temp2;
2342 }
2343
2344 LOperand* context() { return inputs_[0]; }
2345 LOperand* size() { return inputs_[1]; }
2346 LOperand* temp1() { return temps_[0]; }
2347 LOperand* temp2() { return temps_[1]; }
2348
2349 DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate")
2350 DECLARE_HYDROGEN_ACCESSOR(Allocate)
2351};
2352
2353
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00002354class LTypeof final : public LTemplateInstruction<1, 2, 0> {
2355 public:
2356 LTypeof(LOperand* context, LOperand* value) {
2357 inputs_[0] = context;
2358 inputs_[1] = value;
2359 }
2360
2361 LOperand* context() { return inputs_[0]; }
2362 LOperand* value() { return inputs_[1]; }
2363
2364 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
2365};
2366
2367
2368class LTypeofIsAndBranch final : public LControlInstruction<1, 0> {
2369 public:
2370 explicit LTypeofIsAndBranch(LOperand* value) {
2371 inputs_[0] = value;
2372 }
2373
2374 LOperand* value() { return inputs_[0]; }
2375
2376 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch")
2377 DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch)
2378
2379 Handle<String> type_literal() { return hydrogen()->type_literal(); }
2380
2381 void PrintDataTo(StringStream* stream) override;
2382};
2383
2384
2385class LOsrEntry final : public LTemplateInstruction<0, 0, 0> {
2386 public:
2387 LOsrEntry() {}
2388
2389 bool HasInterestingComment(LCodeGen* gen) const override { return false; }
2390 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry")
2391};
2392
2393
2394class LStackCheck final : public LTemplateInstruction<0, 1, 0> {
2395 public:
2396 explicit LStackCheck(LOperand* context) {
2397 inputs_[0] = context;
2398 }
2399
2400 LOperand* context() { return inputs_[0]; }
2401
2402 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
2403 DECLARE_HYDROGEN_ACCESSOR(StackCheck)
2404
2405 Label* done_label() { return &done_label_; }
2406
2407 private:
2408 Label done_label_;
2409};
2410
2411
2412class LForInPrepareMap final : public LTemplateInstruction<1, 2, 0> {
2413 public:
2414 LForInPrepareMap(LOperand* context, LOperand* object) {
2415 inputs_[0] = context;
2416 inputs_[1] = object;
2417 }
2418
2419 LOperand* context() { return inputs_[0]; }
2420 LOperand* object() { return inputs_[1]; }
2421
2422 DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map")
2423};
2424
2425
2426class LForInCacheArray final : public LTemplateInstruction<1, 1, 0> {
2427 public:
2428 explicit LForInCacheArray(LOperand* map) {
2429 inputs_[0] = map;
2430 }
2431
2432 LOperand* map() { return inputs_[0]; }
2433
2434 DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array")
2435
2436 int idx() {
2437 return HForInCacheArray::cast(this->hydrogen_value())->idx();
2438 }
2439};
2440
2441
2442class LCheckMapValue final : public LTemplateInstruction<0, 2, 0> {
2443 public:
2444 LCheckMapValue(LOperand* value, LOperand* map) {
2445 inputs_[0] = value;
2446 inputs_[1] = map;
2447 }
2448
2449 LOperand* value() { return inputs_[0]; }
2450 LOperand* map() { return inputs_[1]; }
2451
2452 DECLARE_CONCRETE_INSTRUCTION(CheckMapValue, "check-map-value")
2453};
2454
2455
2456class LLoadFieldByIndex final : public LTemplateInstruction<1, 2, 0> {
2457 public:
2458 LLoadFieldByIndex(LOperand* object, LOperand* index) {
2459 inputs_[0] = object;
2460 inputs_[1] = index;
2461 }
2462
2463 LOperand* object() { return inputs_[0]; }
2464 LOperand* index() { return inputs_[1]; }
2465
2466 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index")
2467};
2468
2469
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00002470class LChunkBuilder;
2471class LPlatformChunk final : public LChunk {
2472 public:
2473 LPlatformChunk(CompilationInfo* info, HGraph* graph)
2474 : LChunk(info, graph) { }
2475
2476 int GetNextSpillIndex(RegisterKind kind);
2477 LOperand* GetNextSpillSlot(RegisterKind kind);
2478};
2479
2480
2481class LChunkBuilder final : public LChunkBuilderBase {
2482 public:
2483 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator)
2484 : LChunkBuilderBase(info, graph),
2485 current_instruction_(NULL),
2486 current_block_(NULL),
2487 next_block_(NULL),
2488 allocator_(allocator) {}
2489
2490 // Build the sequence for the graph.
2491 LPlatformChunk* Build();
2492
2493 // Declare methods that deal with the individual node types.
2494#define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
2495 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
2496#undef DECLARE_DO
2497
2498 LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend);
2499
2500 static bool HasMagicNumberForDivisor(int32_t divisor);
2501
2502 LInstruction* DoMathFloor(HUnaryMathOperation* instr);
2503 LInstruction* DoMathRound(HUnaryMathOperation* instr);
2504 LInstruction* DoMathFround(HUnaryMathOperation* instr);
2505 LInstruction* DoMathAbs(HUnaryMathOperation* instr);
2506 LInstruction* DoMathLog(HUnaryMathOperation* instr);
2507 LInstruction* DoMathExp(HUnaryMathOperation* instr);
2508 LInstruction* DoMathSqrt(HUnaryMathOperation* instr);
2509 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr);
2510 LInstruction* DoMathClz32(HUnaryMathOperation* instr);
2511 LInstruction* DoDivByPowerOf2I(HDiv* instr);
2512 LInstruction* DoDivByConstI(HDiv* instr);
2513 LInstruction* DoDivI(HDiv* instr);
2514 LInstruction* DoModByPowerOf2I(HMod* instr);
2515 LInstruction* DoModByConstI(HMod* instr);
2516 LInstruction* DoModI(HMod* instr);
2517 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr);
2518 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr);
2519 LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr);
2520
2521 private:
2522 // Methods for getting operands for Use / Define / Temp.
2523 LUnallocated* ToUnallocated(Register reg);
2524 LUnallocated* ToUnallocated(DoubleRegister reg);
2525
2526 // Methods for setting up define-use relationships.
2527 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand);
2528 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register);
2529 MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value,
2530 DoubleRegister fixed_register);
2531
2532 // A value that is guaranteed to be allocated to a register.
2533 // Operand created by UseRegister is guaranteed to be live until the end of
2534 // instruction. This means that register allocator will not reuse it's
2535 // register for any other operand inside instruction.
2536 // Operand created by UseRegisterAtStart is guaranteed to be live only at
2537 // instruction start. Register allocator is free to assign the same register
2538 // to some other operand used inside instruction (i.e. temporary or
2539 // output).
2540 MUST_USE_RESULT LOperand* UseRegister(HValue* value);
2541 MUST_USE_RESULT LOperand* UseRegisterAtStart(HValue* value);
2542
2543 // An input operand in a register that may be trashed.
2544 MUST_USE_RESULT LOperand* UseTempRegister(HValue* value);
2545
2546 // An input operand in a register or stack slot.
2547 MUST_USE_RESULT LOperand* Use(HValue* value);
2548 MUST_USE_RESULT LOperand* UseAtStart(HValue* value);
2549
2550 // An input operand in a register, stack slot or a constant operand.
2551 MUST_USE_RESULT LOperand* UseOrConstant(HValue* value);
2552 MUST_USE_RESULT LOperand* UseOrConstantAtStart(HValue* value);
2553
2554 // An input operand in a register or a constant operand.
2555 MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value);
2556 MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value);
2557
2558 // An input operand in a constant operand.
2559 MUST_USE_RESULT LOperand* UseConstant(HValue* value);
2560
2561 // An input operand in register, stack slot or a constant operand.
2562 // Will not be moved to a register even if one is freely available.
2563 MUST_USE_RESULT LOperand* UseAny(HValue* value) override;
2564
2565 // Temporary operand that must be in a register.
2566 MUST_USE_RESULT LUnallocated* TempRegister();
2567 MUST_USE_RESULT LUnallocated* TempDoubleRegister();
2568 MUST_USE_RESULT LOperand* FixedTemp(Register reg);
2569 MUST_USE_RESULT LOperand* FixedTemp(DoubleRegister reg);
2570
2571 // Methods for setting up define-use relationships.
2572 // Return the same instruction that they are passed.
2573 LInstruction* Define(LTemplateResultInstruction<1>* instr,
2574 LUnallocated* result);
2575 LInstruction* DefineAsRegister(LTemplateResultInstruction<1>* instr);
2576 LInstruction* DefineAsSpilled(LTemplateResultInstruction<1>* instr,
2577 int index);
2578 LInstruction* DefineSameAsFirst(LTemplateResultInstruction<1>* instr);
2579 LInstruction* DefineFixed(LTemplateResultInstruction<1>* instr,
2580 Register reg);
2581 LInstruction* DefineFixedDouble(LTemplateResultInstruction<1>* instr,
2582 DoubleRegister reg);
2583 LInstruction* AssignEnvironment(LInstruction* instr);
2584 LInstruction* AssignPointerMap(LInstruction* instr);
2585
2586 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY };
2587
2588 // By default we assume that instruction sequences generated for calls
2589 // cannot deoptimize eagerly and we do not attach environment to this
2590 // instruction.
2591 LInstruction* MarkAsCall(
2592 LInstruction* instr,
2593 HInstruction* hinstr,
2594 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
2595
2596 void VisitInstruction(HInstruction* current);
2597 void AddInstruction(LInstruction* instr, HInstruction* current);
2598
2599 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
2600 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr);
2601 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
2602 LInstruction* DoArithmeticD(Token::Value op,
2603 HArithmeticBinaryOperation* instr);
2604 LInstruction* DoArithmeticT(Token::Value op,
2605 HBinaryOperation* instr);
2606
2607 HInstruction* current_instruction_;
2608 HBasicBlock* current_block_;
2609 HBasicBlock* next_block_;
2610 LAllocator* allocator_;
2611
2612 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2613};
2614
2615#undef DECLARE_HYDROGEN_ACCESSOR
2616#undef DECLARE_CONCRETE_INSTRUCTION
2617
2618} // namespace internal
2619} // namespace v8
2620
2621#endif // V8_CRANKSHAFT_MIPS_LITHIUM_MIPS_H_