1 // Copyright 2013 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.
5 #ifndef V8_ARM64_LITHIUM_ARM64_H_
6 #define V8_ARM64_LITHIUM_ARM64_H_
8 #include "src/hydrogen.h"
9 #include "src/lithium.h"
10 #include "src/lithium-allocator.h"
11 #include "src/safepoint-table.h"
12 #include "src/utils.h"
17 // Forward declarations.
20 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \
21 V(AccessArgumentsAt) \
26 V(AllocateBlockContext) \
28 V(ArgumentsElements) \
42 V(CallWithDescriptor) \
43 V(CheckInstanceType) \
52 V(ClassOfTestAndBranch) \
53 V(CmpHoleAndBranchD) \
54 V(CmpHoleAndBranchT) \
56 V(CmpObjectEqAndBranch) \
58 V(CompareMinusZeroAndBranch) \
59 V(CompareNumericAndBranch) \
79 V(FlooringDivByConstI) \
80 V(FlooringDivByPowerOf2I) \
85 V(GetCachedArrayIndex) \
87 V(HasCachedArrayIndexAndBranch) \
88 V(HasInstanceTypeAndBranch) \
89 V(InnerAllocatedObject) \
91 V(InstanceOfKnownGlobal) \
93 V(Integer32ToDouble) \
95 V(IsConstructCallAndBranch) \
96 V(IsObjectAndBranch) \
98 V(IsStringAndBranch) \
99 V(IsUndetectableAndBranch) \
103 V(LoadFieldByIndex) \
104 V(LoadFunctionPrototype) \
106 V(LoadGlobalGeneric) \
107 V(LoadKeyedExternal) \
109 V(LoadKeyedFixedDouble) \
110 V(LoadKeyedGeneric) \
112 V(LoadNamedGeneric) \
140 V(PreparePushArguments) \
144 V(SeqStringGetChar) \
145 V(SeqStringSetChar) \
152 V(StoreContextSlot) \
153 V(StoreFrameContext) \
155 V(StoreKeyedExternal) \
157 V(StoreKeyedFixedDouble) \
158 V(StoreKeyedGeneric) \
160 V(StoreNamedGeneric) \
162 V(StringCharCodeAt) \
163 V(StringCharFromCode) \
164 V(StringCompareAndBranch) \
168 V(TailCallThroughMegamorphicCache) \
170 V(ToFastProperties) \
171 V(TransitionElementsKind) \
172 V(TrapAllocationMemento) \
173 V(TruncateDoubleToIntOrSmi) \
175 V(TypeofIsAndBranch) \
181 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \
182 Opcode opcode() const FINAL { return LInstruction::k##type; } \
183 void CompileToNative(LCodeGen* generator) FINAL; \
184 const char* Mnemonic() const FINAL { return mnemonic; } \
185 static L##type* cast(LInstruction* instr) { \
186 DCHECK(instr->Is##type()); \
187 return reinterpret_cast<L##type*>(instr); \
191 #define DECLARE_HYDROGEN_ACCESSOR(type) \
192 H##type* hydrogen() const { \
193 return H##type::cast(this->hydrogen_value()); \
197 class LInstruction : public ZoneObject {
200 : environment_(NULL),
201 hydrogen_value_(NULL),
202 bit_field_(IsCallBits::encode(false)) { }
204 virtual ~LInstruction() { }
206 virtual void CompileToNative(LCodeGen* generator) = 0;
207 virtual const char* Mnemonic() const = 0;
208 virtual void PrintTo(StringStream* stream);
209 virtual void PrintDataTo(StringStream* stream);
210 virtual void PrintOutputOperandTo(StringStream* stream);
213 // Declare a unique enum value for each instruction.
214 #define DECLARE_OPCODE(type) k##type,
215 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_OPCODE)
216 kNumberOfInstructions
217 #undef DECLARE_OPCODE
220 virtual Opcode opcode() const = 0;
222 // Declare non-virtual type testers for all leaf IR classes.
223 #define DECLARE_PREDICATE(type) \
224 bool Is##type() const { return opcode() == k##type; }
225 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_PREDICATE)
226 #undef DECLARE_PREDICATE
228 // Declare virtual predicates for instructions that don't have
230 virtual bool IsGap() const { return false; }
232 virtual bool IsControl() const { return false; }
234 // Try deleting this instruction if possible.
235 virtual bool TryDelete() { return false; }
237 void set_environment(LEnvironment* env) { environment_ = env; }
238 LEnvironment* environment() const { return environment_; }
239 bool HasEnvironment() const { return environment_ != NULL; }
241 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); }
242 LPointerMap* pointer_map() const { return pointer_map_.get(); }
243 bool HasPointerMap() const { return pointer_map_.is_set(); }
245 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
246 HValue* hydrogen_value() const { return hydrogen_value_; }
248 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { }
250 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); }
251 bool IsCall() const { return IsCallBits::decode(bit_field_); }
253 // Interface to the register allocator and iterators.
254 bool ClobbersTemps() const { return IsCall(); }
255 bool ClobbersRegisters() const { return IsCall(); }
256 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const {
259 bool IsMarkedAsCall() const { return IsCall(); }
261 virtual bool HasResult() const = 0;
262 virtual LOperand* result() const = 0;
264 virtual int InputCount() = 0;
265 virtual LOperand* InputAt(int i) = 0;
266 virtual int TempCount() = 0;
267 virtual LOperand* TempAt(int i) = 0;
269 LOperand* FirstInput() { return InputAt(0); }
270 LOperand* Output() { return HasResult() ? result() : NULL; }
272 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; }
279 class IsCallBits: public BitField<bool, 0, 1> {};
281 LEnvironment* environment_;
282 SetOncePointer<LPointerMap> pointer_map_;
283 HValue* hydrogen_value_;
288 // R = number of result operands (0 or 1).
290 class LTemplateResultInstruction : public LInstruction {
292 // Allow 0 or 1 output operands.
293 STATIC_ASSERT(R == 0 || R == 1);
294 bool HasResult() const FINAL { return (R != 0) && (result() != NULL); }
295 void set_result(LOperand* operand) { results_[0] = operand; }
296 LOperand* result() const OVERRIDE { return results_[0]; }
299 EmbeddedContainer<LOperand*, R> results_;
303 // R = number of result operands (0 or 1).
304 // I = number of input operands.
305 // T = number of temporary operands.
306 template<int R, int I, int T>
307 class LTemplateInstruction : public LTemplateResultInstruction<R> {
309 EmbeddedContainer<LOperand*, I> inputs_;
310 EmbeddedContainer<LOperand*, T> temps_;
314 int InputCount() FINAL { return I; }
315 LOperand* InputAt(int i) FINAL { return inputs_[i]; }
317 int TempCount() FINAL { return T; }
318 LOperand* TempAt(int i) FINAL { return temps_[i]; }
322 class LTailCallThroughMegamorphicCache FINAL
323 : public LTemplateInstruction<0, 5, 0> {
325 LTailCallThroughMegamorphicCache(LOperand* context, LOperand* receiver,
326 LOperand* name, LOperand* slot,
328 inputs_[0] = context;
329 inputs_[1] = receiver;
335 LOperand* context() { return inputs_[0]; }
336 LOperand* receiver() { return inputs_[1]; }
337 LOperand* name() { return inputs_[2]; }
338 LOperand* slot() { return inputs_[3]; }
339 LOperand* vector() { return inputs_[4]; }
341 DECLARE_CONCRETE_INSTRUCTION(TailCallThroughMegamorphicCache,
342 "tail-call-through-megamorphic-cache")
343 DECLARE_HYDROGEN_ACCESSOR(TailCallThroughMegamorphicCache)
347 class LUnknownOSRValue FINAL : public LTemplateInstruction<1, 0, 0> {
349 bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { return false; }
350 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
354 template<int I, int T>
355 class LControlInstruction : public LTemplateInstruction<0, I, T> {
357 LControlInstruction() : false_label_(NULL), true_label_(NULL) { }
359 bool IsControl() const FINAL { return true; }
361 int SuccessorCount() { return hydrogen()->SuccessorCount(); }
362 HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); }
364 int TrueDestination(LChunk* chunk) {
365 return chunk->LookupDestination(true_block_id());
368 int FalseDestination(LChunk* chunk) {
369 return chunk->LookupDestination(false_block_id());
372 Label* TrueLabel(LChunk* chunk) {
373 if (true_label_ == NULL) {
374 true_label_ = chunk->GetAssemblyLabel(TrueDestination(chunk));
379 Label* FalseLabel(LChunk* chunk) {
380 if (false_label_ == NULL) {
381 false_label_ = chunk->GetAssemblyLabel(FalseDestination(chunk));
387 int true_block_id() { return SuccessorAt(0)->block_id(); }
388 int false_block_id() { return SuccessorAt(1)->block_id(); }
391 DECLARE_HYDROGEN_ACCESSOR(ControlInstruction);
398 class LGap : public LTemplateInstruction<0, 0, 0> {
400 explicit LGap(HBasicBlock* block)
402 parallel_moves_[BEFORE] = NULL;
403 parallel_moves_[START] = NULL;
404 parallel_moves_[END] = NULL;
405 parallel_moves_[AFTER] = NULL;
408 // Can't use the DECLARE-macro here because of sub-classes.
409 bool IsGap() const OVERRIDE { return true; }
410 void PrintDataTo(StringStream* stream) OVERRIDE;
411 static LGap* cast(LInstruction* instr) {
412 DCHECK(instr->IsGap());
413 return reinterpret_cast<LGap*>(instr);
416 bool IsRedundant() const;
418 HBasicBlock* block() const { return block_; }
425 FIRST_INNER_POSITION = BEFORE,
426 LAST_INNER_POSITION = AFTER
429 LParallelMove* GetOrCreateParallelMove(InnerPosition pos, Zone* zone) {
430 if (parallel_moves_[pos] == NULL) {
431 parallel_moves_[pos] = new(zone) LParallelMove(zone);
433 return parallel_moves_[pos];
436 LParallelMove* GetParallelMove(InnerPosition pos) {
437 return parallel_moves_[pos];
441 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1];
446 class LInstructionGap FINAL : public LGap {
448 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { }
450 bool HasInterestingComment(LCodeGen* gen) const OVERRIDE {
451 return !IsRedundant();
454 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap")
458 class LDrop FINAL : public LTemplateInstruction<0, 0, 0> {
460 explicit LDrop(int count) : count_(count) { }
462 int count() const { return count_; }
464 DECLARE_CONCRETE_INSTRUCTION(Drop, "drop")
471 class LDummy FINAL : public LTemplateInstruction<1, 0, 0> {
474 DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy")
478 class LDummyUse FINAL : public LTemplateInstruction<1, 1, 0> {
480 explicit LDummyUse(LOperand* value) {
483 DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use")
487 class LGoto FINAL : public LTemplateInstruction<0, 0, 0> {
489 explicit LGoto(HBasicBlock* block) : block_(block) { }
491 bool HasInterestingComment(LCodeGen* gen) const OVERRIDE;
492 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
493 void PrintDataTo(StringStream* stream) OVERRIDE;
494 bool IsControl() const OVERRIDE { return true; }
496 int block_id() const { return block_->block_id(); }
503 class LLazyBailout FINAL : public LTemplateInstruction<0, 0, 0> {
505 LLazyBailout() : gap_instructions_size_(0) { }
507 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout")
509 void set_gap_instructions_size(int gap_instructions_size) {
510 gap_instructions_size_ = gap_instructions_size;
512 int gap_instructions_size() { return gap_instructions_size_; }
515 int gap_instructions_size_;
519 class LLabel FINAL : public LGap {
521 explicit LLabel(HBasicBlock* block)
522 : LGap(block), replacement_(NULL) { }
524 bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { return false; }
525 DECLARE_CONCRETE_INSTRUCTION(Label, "label")
527 void PrintDataTo(StringStream* stream) OVERRIDE;
529 int block_id() const { return block()->block_id(); }
530 bool is_loop_header() const { return block()->IsLoopHeader(); }
531 bool is_osr_entry() const { return block()->is_osr_entry(); }
532 Label* label() { return &label_; }
533 LLabel* replacement() const { return replacement_; }
534 void set_replacement(LLabel* label) { replacement_ = label; }
535 bool HasReplacement() const { return replacement_ != NULL; }
539 LLabel* replacement_;
543 class LOsrEntry FINAL : public LTemplateInstruction<0, 0, 0> {
547 bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { return false; }
548 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry")
552 class LAccessArgumentsAt FINAL : public LTemplateInstruction<1, 3, 0> {
554 LAccessArgumentsAt(LOperand* arguments,
557 inputs_[0] = arguments;
562 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at")
564 LOperand* arguments() { return inputs_[0]; }
565 LOperand* length() { return inputs_[1]; }
566 LOperand* index() { return inputs_[2]; }
568 void PrintDataTo(StringStream* stream) OVERRIDE;
572 class LAddE FINAL : public LTemplateInstruction<1, 2, 0> {
574 LAddE(LOperand* left, LOperand* right) {
579 LOperand* left() { return inputs_[0]; }
580 LOperand* right() { return inputs_[1]; }
582 DECLARE_CONCRETE_INSTRUCTION(AddE, "add-e")
583 DECLARE_HYDROGEN_ACCESSOR(Add)
587 class LAddI FINAL : public LTemplateInstruction<1, 2, 0> {
589 LAddI(LOperand* left, LOperand* right)
590 : shift_(NO_SHIFT), shift_amount_(0) {
595 LAddI(LOperand* left, LOperand* right, Shift shift, LOperand* shift_amount)
596 : shift_(shift), shift_amount_(shift_amount) {
601 LOperand* left() { return inputs_[0]; }
602 LOperand* right() { return inputs_[1]; }
604 Shift shift() const { return shift_; }
605 LOperand* shift_amount() const { return shift_amount_; }
607 DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i")
608 DECLARE_HYDROGEN_ACCESSOR(Add)
612 LOperand* shift_amount_;
616 class LAddS FINAL : public LTemplateInstruction<1, 2, 0> {
618 LAddS(LOperand* left, LOperand* right) {
623 LOperand* left() { return inputs_[0]; }
624 LOperand* right() { return inputs_[1]; }
626 DECLARE_CONCRETE_INSTRUCTION(AddS, "add-s")
627 DECLARE_HYDROGEN_ACCESSOR(Add)
631 class LAllocate FINAL : public LTemplateInstruction<1, 2, 3> {
633 LAllocate(LOperand* context,
638 inputs_[0] = context;
645 LOperand* context() { return inputs_[0]; }
646 LOperand* size() { return inputs_[1]; }
647 LOperand* temp1() { return temps_[0]; }
648 LOperand* temp2() { return temps_[1]; }
649 LOperand* temp3() { return temps_[2]; }
651 DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate")
652 DECLARE_HYDROGEN_ACCESSOR(Allocate)
656 class LApplyArguments FINAL : public LTemplateInstruction<1, 4, 0> {
658 LApplyArguments(LOperand* function,
661 LOperand* elements) {
662 inputs_[0] = function;
663 inputs_[1] = receiver;
665 inputs_[3] = elements;
668 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments")
670 LOperand* function() { return inputs_[0]; }
671 LOperand* receiver() { return inputs_[1]; }
672 LOperand* length() { return inputs_[2]; }
673 LOperand* elements() { return inputs_[3]; }
677 class LArgumentsElements FINAL : public LTemplateInstruction<1, 0, 1> {
679 explicit LArgumentsElements(LOperand* temp) {
683 LOperand* temp() { return temps_[0]; }
685 DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements")
686 DECLARE_HYDROGEN_ACCESSOR(ArgumentsElements)
690 class LArgumentsLength FINAL : public LTemplateInstruction<1, 1, 0> {
692 explicit LArgumentsLength(LOperand* elements) {
693 inputs_[0] = elements;
696 LOperand* elements() { return inputs_[0]; }
698 DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length")
702 class LArithmeticD FINAL : public LTemplateInstruction<1, 2, 0> {
704 LArithmeticD(Token::Value op,
712 Token::Value op() const { return op_; }
713 LOperand* left() { return inputs_[0]; }
714 LOperand* right() { return inputs_[1]; }
716 Opcode opcode() const OVERRIDE { return LInstruction::kArithmeticD; }
717 void CompileToNative(LCodeGen* generator) OVERRIDE;
718 const char* Mnemonic() const OVERRIDE;
725 class LArithmeticT FINAL : public LTemplateInstruction<1, 3, 0> {
727 LArithmeticT(Token::Value op,
732 inputs_[0] = context;
737 LOperand* context() { return inputs_[0]; }
738 LOperand* left() { return inputs_[1]; }
739 LOperand* right() { return inputs_[2]; }
740 Token::Value op() const { return op_; }
742 Opcode opcode() const OVERRIDE { return LInstruction::kArithmeticT; }
743 void CompileToNative(LCodeGen* generator) OVERRIDE;
744 const char* Mnemonic() const OVERRIDE;
751 class LBoundsCheck FINAL : public LTemplateInstruction<0, 2, 0> {
753 explicit LBoundsCheck(LOperand* index, LOperand* length) {
758 LOperand* index() { return inputs_[0]; }
759 LOperand* length() { return inputs_[1]; }
761 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check")
762 DECLARE_HYDROGEN_ACCESSOR(BoundsCheck)
766 class LBitI FINAL : public LTemplateInstruction<1, 2, 0> {
768 LBitI(LOperand* left, LOperand* right)
769 : shift_(NO_SHIFT), shift_amount_(0) {
774 LBitI(LOperand* left, LOperand* right, Shift shift, LOperand* shift_amount)
775 : shift_(shift), shift_amount_(shift_amount) {
780 LOperand* left() { return inputs_[0]; }
781 LOperand* right() { return inputs_[1]; }
783 Shift shift() const { return shift_; }
784 LOperand* shift_amount() const { return shift_amount_; }
786 Token::Value op() const { return hydrogen()->op(); }
788 DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i")
789 DECLARE_HYDROGEN_ACCESSOR(Bitwise)
793 LOperand* shift_amount_;
797 class LBitS FINAL : public LTemplateInstruction<1, 2, 0> {
799 LBitS(LOperand* left, LOperand* right) {
804 LOperand* left() { return inputs_[0]; }
805 LOperand* right() { return inputs_[1]; }
807 Token::Value op() const { return hydrogen()->op(); }
809 DECLARE_CONCRETE_INSTRUCTION(BitS, "bit-s")
810 DECLARE_HYDROGEN_ACCESSOR(Bitwise)
814 class LBranch FINAL : public LControlInstruction<1, 2> {
816 explicit LBranch(LOperand* value, LOperand *temp1, LOperand *temp2) {
822 LOperand* value() { return inputs_[0]; }
823 LOperand* temp1() { return temps_[0]; }
824 LOperand* temp2() { return temps_[1]; }
826 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
827 DECLARE_HYDROGEN_ACCESSOR(Branch)
829 void PrintDataTo(StringStream* stream) OVERRIDE;
833 class LCallJSFunction FINAL : public LTemplateInstruction<1, 1, 0> {
835 explicit LCallJSFunction(LOperand* function) {
836 inputs_[0] = function;
839 LOperand* function() { return inputs_[0]; }
841 DECLARE_CONCRETE_INSTRUCTION(CallJSFunction, "call-js-function")
842 DECLARE_HYDROGEN_ACCESSOR(CallJSFunction)
844 void PrintDataTo(StringStream* stream) OVERRIDE;
846 int arity() const { return hydrogen()->argument_count() - 1; }
850 class LCallFunction FINAL : public LTemplateInstruction<1, 2, 2> {
852 LCallFunction(LOperand* context, LOperand* function, LOperand* slot,
854 inputs_[0] = context;
855 inputs_[1] = function;
860 LOperand* context() { return inputs_[0]; }
861 LOperand* function() { return inputs_[1]; }
862 LOperand* temp_slot() { return temps_[0]; }
863 LOperand* temp_vector() { return temps_[1]; }
865 DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
866 DECLARE_HYDROGEN_ACCESSOR(CallFunction)
868 int arity() const { return hydrogen()->argument_count() - 1; }
869 void PrintDataTo(StringStream* stream) OVERRIDE;
873 class LCallNew FINAL : public LTemplateInstruction<1, 2, 0> {
875 LCallNew(LOperand* context, LOperand* constructor) {
876 inputs_[0] = context;
877 inputs_[1] = constructor;
880 LOperand* context() { return inputs_[0]; }
881 LOperand* constructor() { return inputs_[1]; }
883 DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new")
884 DECLARE_HYDROGEN_ACCESSOR(CallNew)
886 void PrintDataTo(StringStream* stream) OVERRIDE;
888 int arity() const { return hydrogen()->argument_count() - 1; }
892 class LCallNewArray FINAL : public LTemplateInstruction<1, 2, 0> {
894 LCallNewArray(LOperand* context, LOperand* constructor) {
895 inputs_[0] = context;
896 inputs_[1] = constructor;
899 LOperand* context() { return inputs_[0]; }
900 LOperand* constructor() { return inputs_[1]; }
902 DECLARE_CONCRETE_INSTRUCTION(CallNewArray, "call-new-array")
903 DECLARE_HYDROGEN_ACCESSOR(CallNewArray)
905 void PrintDataTo(StringStream* stream) OVERRIDE;
907 int arity() const { return hydrogen()->argument_count() - 1; }
911 class LCallRuntime FINAL : public LTemplateInstruction<1, 1, 0> {
913 explicit LCallRuntime(LOperand* context) {
914 inputs_[0] = context;
917 LOperand* context() { return inputs_[0]; }
919 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
920 DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
922 bool ClobbersDoubleRegisters(Isolate* isolate) const OVERRIDE {
923 return save_doubles() == kDontSaveFPRegs;
926 const Runtime::Function* function() const { return hydrogen()->function(); }
927 int arity() const { return hydrogen()->argument_count(); }
928 SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); }
932 class LCallStub FINAL : public LTemplateInstruction<1, 1, 0> {
934 explicit LCallStub(LOperand* context) {
935 inputs_[0] = context;
938 LOperand* context() { return inputs_[0]; }
940 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
941 DECLARE_HYDROGEN_ACCESSOR(CallStub)
945 class LCheckInstanceType FINAL : public LTemplateInstruction<0, 1, 1> {
947 explicit LCheckInstanceType(LOperand* value, LOperand* temp) {
952 LOperand* value() { return inputs_[0]; }
953 LOperand* temp() { return temps_[0]; }
955 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
956 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
960 class LCheckMaps FINAL : public LTemplateInstruction<0, 1, 1> {
962 explicit LCheckMaps(LOperand* value = NULL, LOperand* temp = NULL) {
967 LOperand* value() { return inputs_[0]; }
968 LOperand* temp() { return temps_[0]; }
970 DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps")
971 DECLARE_HYDROGEN_ACCESSOR(CheckMaps)
975 class LCheckNonSmi FINAL : public LTemplateInstruction<0, 1, 0> {
977 explicit LCheckNonSmi(LOperand* value) {
981 LOperand* value() { return inputs_[0]; }
983 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi")
984 DECLARE_HYDROGEN_ACCESSOR(CheckHeapObject)
988 class LCheckSmi FINAL : public LTemplateInstruction<1, 1, 0> {
990 explicit LCheckSmi(LOperand* value) {
994 LOperand* value() { return inputs_[0]; }
996 DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi")
1000 class LCheckValue FINAL : public LTemplateInstruction<0, 1, 0> {
1002 explicit LCheckValue(LOperand* value) {
1006 LOperand* value() { return inputs_[0]; }
1008 DECLARE_CONCRETE_INSTRUCTION(CheckValue, "check-value")
1009 DECLARE_HYDROGEN_ACCESSOR(CheckValue)
1013 class LClampDToUint8 FINAL : public LTemplateInstruction<1, 1, 0> {
1015 explicit LClampDToUint8(LOperand* unclamped) {
1016 inputs_[0] = unclamped;
1019 LOperand* unclamped() { return inputs_[0]; }
1021 DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8")
1025 class LClampIToUint8 FINAL : public LTemplateInstruction<1, 1, 0> {
1027 explicit LClampIToUint8(LOperand* unclamped) {
1028 inputs_[0] = unclamped;
1031 LOperand* unclamped() { return inputs_[0]; }
1033 DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8")
1037 class LClampTToUint8 FINAL : public LTemplateInstruction<1, 1, 1> {
1039 LClampTToUint8(LOperand* unclamped, LOperand* temp1) {
1040 inputs_[0] = unclamped;
1044 LOperand* unclamped() { return inputs_[0]; }
1045 LOperand* temp1() { return temps_[0]; }
1047 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8")
1051 class LDoubleBits FINAL : public LTemplateInstruction<1, 1, 0> {
1053 explicit LDoubleBits(LOperand* value) {
1057 LOperand* value() { return inputs_[0]; }
1059 DECLARE_CONCRETE_INSTRUCTION(DoubleBits, "double-bits")
1060 DECLARE_HYDROGEN_ACCESSOR(DoubleBits)
1064 class LConstructDouble FINAL : public LTemplateInstruction<1, 2, 0> {
1066 LConstructDouble(LOperand* hi, LOperand* lo) {
1071 LOperand* hi() { return inputs_[0]; }
1072 LOperand* lo() { return inputs_[1]; }
1074 DECLARE_CONCRETE_INSTRUCTION(ConstructDouble, "construct-double")
1078 class LClassOfTestAndBranch FINAL : public LControlInstruction<1, 2> {
1080 LClassOfTestAndBranch(LOperand* value, LOperand* temp1, LOperand* temp2) {
1086 LOperand* value() { return inputs_[0]; }
1087 LOperand* temp1() { return temps_[0]; }
1088 LOperand* temp2() { return temps_[1]; }
1090 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch,
1091 "class-of-test-and-branch")
1092 DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch)
1094 void PrintDataTo(StringStream* stream) OVERRIDE;
1098 class LCmpHoleAndBranchD FINAL : public LControlInstruction<1, 1> {
1100 explicit LCmpHoleAndBranchD(LOperand* object, LOperand* temp) {
1101 inputs_[0] = object;
1105 LOperand* object() { return inputs_[0]; }
1106 LOperand* temp() { return temps_[0]; }
1108 DECLARE_CONCRETE_INSTRUCTION(CmpHoleAndBranchD, "cmp-hole-and-branch-d")
1109 DECLARE_HYDROGEN_ACCESSOR(CompareHoleAndBranch)
1113 class LCmpHoleAndBranchT FINAL : public LControlInstruction<1, 0> {
1115 explicit LCmpHoleAndBranchT(LOperand* object) {
1116 inputs_[0] = object;
1119 LOperand* object() { return inputs_[0]; }
1121 DECLARE_CONCRETE_INSTRUCTION(CmpHoleAndBranchT, "cmp-hole-and-branch-t")
1122 DECLARE_HYDROGEN_ACCESSOR(CompareHoleAndBranch)
1126 class LCmpMapAndBranch FINAL : public LControlInstruction<1, 1> {
1128 LCmpMapAndBranch(LOperand* value, LOperand* temp) {
1133 LOperand* value() { return inputs_[0]; }
1134 LOperand* temp() { return temps_[0]; }
1136 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
1137 DECLARE_HYDROGEN_ACCESSOR(CompareMap)
1139 Handle<Map> map() const { return hydrogen()->map().handle(); }
1143 class LCmpObjectEqAndBranch FINAL : public LControlInstruction<2, 0> {
1145 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) {
1150 LOperand* left() { return inputs_[0]; }
1151 LOperand* right() { return inputs_[1]; }
1153 DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch, "cmp-object-eq-and-branch")
1154 DECLARE_HYDROGEN_ACCESSOR(CompareObjectEqAndBranch)
1158 class LCmpT FINAL : public LTemplateInstruction<1, 3, 0> {
1160 LCmpT(LOperand* context, LOperand* left, LOperand* right) {
1161 inputs_[0] = context;
1166 LOperand* context() { return inputs_[0]; }
1167 LOperand* left() { return inputs_[1]; }
1168 LOperand* right() { return inputs_[2]; }
1170 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
1171 DECLARE_HYDROGEN_ACCESSOR(CompareGeneric)
1173 Token::Value op() const { return hydrogen()->token(); }
1177 class LCompareMinusZeroAndBranch FINAL : public LControlInstruction<1, 1> {
1179 LCompareMinusZeroAndBranch(LOperand* value, LOperand* temp) {
1184 LOperand* value() { return inputs_[0]; }
1185 LOperand* temp() { return temps_[0]; }
1187 DECLARE_CONCRETE_INSTRUCTION(CompareMinusZeroAndBranch,
1188 "cmp-minus-zero-and-branch")
1189 DECLARE_HYDROGEN_ACCESSOR(CompareMinusZeroAndBranch)
1193 class LCompareNumericAndBranch FINAL : public LControlInstruction<2, 0> {
1195 LCompareNumericAndBranch(LOperand* left, LOperand* right) {
1200 LOperand* left() { return inputs_[0]; }
1201 LOperand* right() { return inputs_[1]; }
1203 DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch,
1204 "compare-numeric-and-branch")
1205 DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch)
1207 Token::Value op() const { return hydrogen()->token(); }
1208 bool is_double() const {
1209 return hydrogen()->representation().IsDouble();
1212 void PrintDataTo(StringStream* stream) OVERRIDE;
1216 class LConstantD FINAL : public LTemplateInstruction<1, 0, 0> {
1218 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
1219 DECLARE_HYDROGEN_ACCESSOR(Constant)
1221 double value() const { return hydrogen()->DoubleValue(); }
1225 class LConstantE FINAL : public LTemplateInstruction<1, 0, 0> {
1227 DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e")
1228 DECLARE_HYDROGEN_ACCESSOR(Constant)
1230 ExternalReference value() const {
1231 return hydrogen()->ExternalReferenceValue();
1236 class LConstantI FINAL : public LTemplateInstruction<1, 0, 0> {
1238 DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i")
1239 DECLARE_HYDROGEN_ACCESSOR(Constant)
1241 int32_t value() const { return hydrogen()->Integer32Value(); }
1245 class LConstantS FINAL : public LTemplateInstruction<1, 0, 0> {
1247 DECLARE_CONCRETE_INSTRUCTION(ConstantS, "constant-s")
1248 DECLARE_HYDROGEN_ACCESSOR(Constant)
1250 Smi* value() const { return Smi::FromInt(hydrogen()->Integer32Value()); }
1254 class LConstantT FINAL : public LTemplateInstruction<1, 0, 0> {
1256 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
1257 DECLARE_HYDROGEN_ACCESSOR(Constant)
1259 Handle<Object> value(Isolate* isolate) const {
1260 return hydrogen()->handle(isolate);
1265 class LContext FINAL : public LTemplateInstruction<1, 0, 0> {
1267 DECLARE_CONCRETE_INSTRUCTION(Context, "context")
1268 DECLARE_HYDROGEN_ACCESSOR(Context)
1272 class LDateField FINAL : public LTemplateInstruction<1, 1, 0> {
1274 LDateField(LOperand* date, Smi* index) : index_(index) {
1278 LOperand* date() { return inputs_[0]; }
1279 Smi* index() const { return index_; }
1281 DECLARE_CONCRETE_INSTRUCTION(DateField, "date-field")
1282 DECLARE_HYDROGEN_ACCESSOR(DateField)
1289 class LDebugBreak FINAL : public LTemplateInstruction<0, 0, 0> {
1291 DECLARE_CONCRETE_INSTRUCTION(DebugBreak, "break")
1295 class LDeclareGlobals FINAL : public LTemplateInstruction<0, 1, 0> {
1297 explicit LDeclareGlobals(LOperand* context) {
1298 inputs_[0] = context;
1301 LOperand* context() { return inputs_[0]; }
1303 DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals")
1304 DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals)
1308 class LDeoptimize FINAL : public LTemplateInstruction<0, 0, 0> {
1310 bool IsControl() const OVERRIDE { return true; }
1311 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
1312 DECLARE_HYDROGEN_ACCESSOR(Deoptimize)
1316 class LDivByPowerOf2I FINAL : public LTemplateInstruction<1, 1, 0> {
1318 LDivByPowerOf2I(LOperand* dividend, int32_t divisor) {
1319 inputs_[0] = dividend;
1323 LOperand* dividend() { return inputs_[0]; }
1324 int32_t divisor() const { return divisor_; }
1326 DECLARE_CONCRETE_INSTRUCTION(DivByPowerOf2I, "div-by-power-of-2-i")
1327 DECLARE_HYDROGEN_ACCESSOR(Div)
1334 class LDivByConstI FINAL : public LTemplateInstruction<1, 1, 1> {
1336 LDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) {
1337 inputs_[0] = dividend;
1342 LOperand* dividend() { return inputs_[0]; }
1343 int32_t divisor() const { return divisor_; }
1344 LOperand* temp() { return temps_[0]; }
1346 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i")
1347 DECLARE_HYDROGEN_ACCESSOR(Div)
1354 class LDivI FINAL : public LTemplateInstruction<1, 2, 1> {
1356 LDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) {
1357 inputs_[0] = dividend;
1358 inputs_[1] = divisor;
1362 LOperand* dividend() { return inputs_[0]; }
1363 LOperand* divisor() { return inputs_[1]; }
1364 LOperand* temp() { return temps_[0]; }
1366 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
1367 DECLARE_HYDROGEN_ACCESSOR(BinaryOperation)
1371 class LDoubleToIntOrSmi FINAL : public LTemplateInstruction<1, 1, 0> {
1373 explicit LDoubleToIntOrSmi(LOperand* value) {
1377 LOperand* value() { return inputs_[0]; }
1379 DECLARE_CONCRETE_INSTRUCTION(DoubleToIntOrSmi, "double-to-int-or-smi")
1380 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
1382 bool tag_result() { return hydrogen()->representation().IsSmi(); }
1386 class LForInCacheArray FINAL : public LTemplateInstruction<1, 1, 0> {
1388 explicit LForInCacheArray(LOperand* map) {
1392 LOperand* map() { return inputs_[0]; }
1394 DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array")
1397 return HForInCacheArray::cast(this->hydrogen_value())->idx();
1402 class LForInPrepareMap FINAL : public LTemplateInstruction<1, 2, 0> {
1404 LForInPrepareMap(LOperand* context, LOperand* object) {
1405 inputs_[0] = context;
1406 inputs_[1] = object;
1409 LOperand* context() { return inputs_[0]; }
1410 LOperand* object() { return inputs_[1]; }
1412 DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map")
1416 class LGetCachedArrayIndex FINAL : public LTemplateInstruction<1, 1, 0> {
1418 explicit LGetCachedArrayIndex(LOperand* value) {
1422 LOperand* value() { return inputs_[0]; }
1424 DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index")
1425 DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex)
1429 class LHasCachedArrayIndexAndBranch FINAL
1430 : public LControlInstruction<1, 1> {
1432 LHasCachedArrayIndexAndBranch(LOperand* value, LOperand* temp) {
1437 LOperand* value() { return inputs_[0]; }
1438 LOperand* temp() { return temps_[0]; }
1440 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch,
1441 "has-cached-array-index-and-branch")
1442 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch)
1444 void PrintDataTo(StringStream* stream) OVERRIDE;
1448 class LHasInstanceTypeAndBranch FINAL : public LControlInstruction<1, 1> {
1450 LHasInstanceTypeAndBranch(LOperand* value, LOperand* temp) {
1455 LOperand* value() { return inputs_[0]; }
1456 LOperand* temp() { return temps_[0]; }
1458 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
1459 "has-instance-type-and-branch")
1460 DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch)
1462 void PrintDataTo(StringStream* stream) OVERRIDE;
1466 class LInnerAllocatedObject FINAL : public LTemplateInstruction<1, 2, 0> {
1468 LInnerAllocatedObject(LOperand* base_object, LOperand* offset) {
1469 inputs_[0] = base_object;
1470 inputs_[1] = offset;
1473 LOperand* base_object() const { return inputs_[0]; }
1474 LOperand* offset() const { return inputs_[1]; }
1476 void PrintDataTo(StringStream* stream) OVERRIDE;
1478 DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject, "inner-allocated-object")
1482 class LInstanceOf FINAL : public LTemplateInstruction<1, 3, 0> {
1484 LInstanceOf(LOperand* context, LOperand* left, LOperand* right) {
1485 inputs_[0] = context;
1490 LOperand* context() { return inputs_[0]; }
1491 LOperand* left() { return inputs_[1]; }
1492 LOperand* right() { return inputs_[2]; }
1494 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
1498 class LInstanceOfKnownGlobal FINAL : public LTemplateInstruction<1, 2, 0> {
1500 LInstanceOfKnownGlobal(LOperand* context, LOperand* value) {
1501 inputs_[0] = context;
1505 LOperand* context() { return inputs_[0]; }
1506 LOperand* value() { return inputs_[1]; }
1508 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
1509 "instance-of-known-global")
1510 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal)
1512 Handle<JSFunction> function() const { return hydrogen()->function(); }
1513 LEnvironment* GetDeferredLazyDeoptimizationEnvironment() {
1514 return lazy_deopt_env_;
1516 virtual void SetDeferredLazyDeoptimizationEnvironment(
1517 LEnvironment* env) OVERRIDE {
1518 lazy_deopt_env_ = env;
1522 LEnvironment* lazy_deopt_env_;
1526 class LInteger32ToDouble FINAL : public LTemplateInstruction<1, 1, 0> {
1528 explicit LInteger32ToDouble(LOperand* value) {
1532 LOperand* value() { return inputs_[0]; }
1534 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double")
1538 class LCallWithDescriptor FINAL : public LTemplateResultInstruction<1> {
1540 LCallWithDescriptor(CallInterfaceDescriptor descriptor,
1541 const ZoneList<LOperand*>& operands, Zone* zone)
1542 : descriptor_(descriptor),
1543 inputs_(descriptor.GetRegisterParameterCount() + 1, zone) {
1544 DCHECK(descriptor.GetRegisterParameterCount() + 1 == operands.length());
1545 inputs_.AddAll(operands, zone);
1548 LOperand* target() const { return inputs_[0]; }
1550 CallInterfaceDescriptor descriptor() { return descriptor_; }
1552 DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor)
1555 DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor")
1557 void PrintDataTo(StringStream* stream) OVERRIDE;
1559 int arity() const { return hydrogen()->argument_count() - 1; }
1561 CallInterfaceDescriptor descriptor_;
1562 ZoneList<LOperand*> inputs_;
1564 // Iterator support.
1565 int InputCount() FINAL { return inputs_.length(); }
1566 LOperand* InputAt(int i) FINAL { return inputs_[i]; }
1568 int TempCount() FINAL { return 0; }
1569 LOperand* TempAt(int i) FINAL { return NULL; }
1573 class LInvokeFunction FINAL : public LTemplateInstruction<1, 2, 0> {
1575 LInvokeFunction(LOperand* context, LOperand* function) {
1576 inputs_[0] = context;
1577 inputs_[1] = function;
1580 LOperand* context() { return inputs_[0]; }
1581 LOperand* function() { return inputs_[1]; }
1583 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
1584 DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
1586 void PrintDataTo(StringStream* stream) OVERRIDE;
1588 int arity() const { return hydrogen()->argument_count() - 1; }
1592 class LIsConstructCallAndBranch FINAL : public LControlInstruction<0, 2> {
1594 LIsConstructCallAndBranch(LOperand* temp1, LOperand* temp2) {
1599 LOperand* temp1() { return temps_[0]; }
1600 LOperand* temp2() { return temps_[1]; }
1602 DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch,
1603 "is-construct-call-and-branch")
1607 class LIsObjectAndBranch FINAL : public LControlInstruction<1, 2> {
1609 LIsObjectAndBranch(LOperand* value, LOperand* temp1, LOperand* temp2) {
1615 LOperand* value() { return inputs_[0]; }
1616 LOperand* temp1() { return temps_[0]; }
1617 LOperand* temp2() { return temps_[1]; }
1619 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch")
1620 DECLARE_HYDROGEN_ACCESSOR(IsObjectAndBranch)
1622 void PrintDataTo(StringStream* stream) OVERRIDE;
1626 class LIsStringAndBranch FINAL : public LControlInstruction<1, 1> {
1628 LIsStringAndBranch(LOperand* value, LOperand* temp) {
1633 LOperand* value() { return inputs_[0]; }
1634 LOperand* temp() { return temps_[0]; }
1636 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch")
1637 DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch)
1639 void PrintDataTo(StringStream* stream) OVERRIDE;
1643 class LIsSmiAndBranch FINAL : public LControlInstruction<1, 0> {
1645 explicit LIsSmiAndBranch(LOperand* value) {
1649 LOperand* value() { return inputs_[0]; }
1651 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
1652 DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch)
1654 void PrintDataTo(StringStream* stream) OVERRIDE;
1658 class LIsUndetectableAndBranch FINAL : public LControlInstruction<1, 1> {
1660 explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) {
1665 LOperand* value() { return inputs_[0]; }
1666 LOperand* temp() { return temps_[0]; }
1668 DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch,
1669 "is-undetectable-and-branch")
1670 DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch)
1672 void PrintDataTo(StringStream* stream) OVERRIDE;
1676 class LLoadContextSlot FINAL : public LTemplateInstruction<1, 1, 0> {
1678 explicit LLoadContextSlot(LOperand* context) {
1679 inputs_[0] = context;
1682 LOperand* context() { return inputs_[0]; }
1684 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot")
1685 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot)
1687 int slot_index() const { return hydrogen()->slot_index(); }
1689 void PrintDataTo(StringStream* stream) OVERRIDE;
1693 class LLoadNamedField FINAL : public LTemplateInstruction<1, 1, 0> {
1695 explicit LLoadNamedField(LOperand* object) {
1696 inputs_[0] = object;
1699 LOperand* object() { return inputs_[0]; }
1701 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field")
1702 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField)
1706 class LFunctionLiteral FINAL : public LTemplateInstruction<1, 1, 0> {
1708 explicit LFunctionLiteral(LOperand* context) {
1709 inputs_[0] = context;
1712 LOperand* context() { return inputs_[0]; }
1714 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal")
1715 DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral)
1719 class LLoadFunctionPrototype FINAL : public LTemplateInstruction<1, 1, 1> {
1721 LLoadFunctionPrototype(LOperand* function, LOperand* temp) {
1722 inputs_[0] = function;
1726 LOperand* function() { return inputs_[0]; }
1727 LOperand* temp() { return temps_[0]; }
1729 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype")
1730 DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype)
1734 class LLoadGlobalCell FINAL : public LTemplateInstruction<1, 0, 0> {
1736 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load-global-cell")
1737 DECLARE_HYDROGEN_ACCESSOR(LoadGlobalCell)
1741 class LLoadGlobalGeneric FINAL : public LTemplateInstruction<1, 2, 1> {
1743 LLoadGlobalGeneric(LOperand* context, LOperand* global_object,
1745 inputs_[0] = context;
1746 inputs_[1] = global_object;
1750 LOperand* context() { return inputs_[0]; }
1751 LOperand* global_object() { return inputs_[1]; }
1752 LOperand* temp_vector() { return temps_[0]; }
1754 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic")
1755 DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric)
1757 Handle<Object> name() const { return hydrogen()->name(); }
1758 bool for_typeof() const { return hydrogen()->for_typeof(); }
1763 class LLoadKeyed : public LTemplateInstruction<1, 2, T> {
1765 LLoadKeyed(LOperand* elements, LOperand* key) {
1766 this->inputs_[0] = elements;
1767 this->inputs_[1] = key;
1770 LOperand* elements() { return this->inputs_[0]; }
1771 LOperand* key() { return this->inputs_[1]; }
1772 ElementsKind elements_kind() const {
1773 return this->hydrogen()->elements_kind();
1775 bool is_external() const {
1776 return this->hydrogen()->is_external();
1778 bool is_fixed_typed_array() const {
1779 return hydrogen()->is_fixed_typed_array();
1781 bool is_typed_elements() const {
1782 return is_external() || is_fixed_typed_array();
1784 uint32_t base_offset() const {
1785 return this->hydrogen()->base_offset();
1787 void PrintDataTo(StringStream* stream) OVERRIDE {
1788 this->elements()->PrintTo(stream);
1790 this->key()->PrintTo(stream);
1791 if (this->base_offset() != 0) {
1792 stream->Add(" + %d]", this->base_offset());
1798 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed)
1802 class LLoadKeyedExternal: public LLoadKeyed<1> {
1804 LLoadKeyedExternal(LOperand* elements, LOperand* key, LOperand* temp) :
1805 LLoadKeyed<1>(elements, key) {
1809 LOperand* temp() { return temps_[0]; }
1811 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedExternal, "load-keyed-external");
1815 class LLoadKeyedFixed: public LLoadKeyed<1> {
1817 LLoadKeyedFixed(LOperand* elements, LOperand* key, LOperand* temp) :
1818 LLoadKeyed<1>(elements, key) {
1822 LOperand* temp() { return temps_[0]; }
1824 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFixed, "load-keyed-fixed");
1828 class LLoadKeyedFixedDouble: public LLoadKeyed<1> {
1830 LLoadKeyedFixedDouble(LOperand* elements, LOperand* key, LOperand* temp) :
1831 LLoadKeyed<1>(elements, key) {
1835 LOperand* temp() { return temps_[0]; }
1837 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFixedDouble, "load-keyed-fixed-double");
1841 class LLoadKeyedGeneric FINAL : public LTemplateInstruction<1, 3, 1> {
1843 LLoadKeyedGeneric(LOperand* context, LOperand* object, LOperand* key,
1845 inputs_[0] = context;
1846 inputs_[1] = object;
1851 LOperand* context() { return inputs_[0]; }
1852 LOperand* object() { return inputs_[1]; }
1853 LOperand* key() { return inputs_[2]; }
1854 LOperand* temp_vector() { return temps_[0]; }
1856 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
1857 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedGeneric)
1861 class LLoadNamedGeneric FINAL : public LTemplateInstruction<1, 2, 1> {
1863 LLoadNamedGeneric(LOperand* context, LOperand* object, LOperand* vector) {
1864 inputs_[0] = context;
1865 inputs_[1] = object;
1869 LOperand* context() { return inputs_[0]; }
1870 LOperand* object() { return inputs_[1]; }
1871 LOperand* temp_vector() { return temps_[0]; }
1873 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
1874 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
1876 Handle<Object> name() const { return hydrogen()->name(); }
1880 class LLoadRoot FINAL : public LTemplateInstruction<1, 0, 0> {
1882 DECLARE_CONCRETE_INSTRUCTION(LoadRoot, "load-root")
1883 DECLARE_HYDROGEN_ACCESSOR(LoadRoot)
1885 Heap::RootListIndex index() const { return hydrogen()->index(); }
1889 class LMapEnumLength FINAL : public LTemplateInstruction<1, 1, 0> {
1891 explicit LMapEnumLength(LOperand* value) {
1895 LOperand* value() { return inputs_[0]; }
1897 DECLARE_CONCRETE_INSTRUCTION(MapEnumLength, "map-enum-length")
1902 class LUnaryMathOperation : public LTemplateInstruction<1, 1, T> {
1904 explicit LUnaryMathOperation(LOperand* value) {
1905 this->inputs_[0] = value;
1908 LOperand* value() { return this->inputs_[0]; }
1909 BuiltinFunctionId op() const { return this->hydrogen()->op(); }
1911 void PrintDataTo(StringStream* stream) OVERRIDE;
1913 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
1917 class LMathAbs FINAL : public LUnaryMathOperation<0> {
1919 explicit LMathAbs(LOperand* value) : LUnaryMathOperation<0>(value) {}
1921 DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs")
1925 class LMathAbsTagged: public LTemplateInstruction<1, 2, 3> {
1927 LMathAbsTagged(LOperand* context, LOperand* value,
1928 LOperand* temp1, LOperand* temp2, LOperand* temp3) {
1929 inputs_[0] = context;
1936 LOperand* context() { return inputs_[0]; }
1937 LOperand* value() { return inputs_[1]; }
1938 LOperand* temp1() { return temps_[0]; }
1939 LOperand* temp2() { return temps_[1]; }
1940 LOperand* temp3() { return temps_[2]; }
1942 DECLARE_CONCRETE_INSTRUCTION(MathAbsTagged, "math-abs-tagged")
1943 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
1947 class LMathExp FINAL : public LUnaryMathOperation<4> {
1949 LMathExp(LOperand* value,
1950 LOperand* double_temp1,
1954 : LUnaryMathOperation<4>(value) {
1955 temps_[0] = double_temp1;
1959 ExternalReference::InitializeMathExpData();
1962 LOperand* double_temp1() { return temps_[0]; }
1963 LOperand* temp1() { return temps_[1]; }
1964 LOperand* temp2() { return temps_[2]; }
1965 LOperand* temp3() { return temps_[3]; }
1967 DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp")
1971 // Math.floor with a double result.
1972 class LMathFloorD FINAL : public LUnaryMathOperation<0> {
1974 explicit LMathFloorD(LOperand* value) : LUnaryMathOperation<0>(value) { }
1975 DECLARE_CONCRETE_INSTRUCTION(MathFloorD, "math-floor-d")
1979 // Math.floor with an integer result.
1980 class LMathFloorI FINAL : public LUnaryMathOperation<0> {
1982 explicit LMathFloorI(LOperand* value) : LUnaryMathOperation<0>(value) { }
1983 DECLARE_CONCRETE_INSTRUCTION(MathFloorI, "math-floor-i")
1987 class LFlooringDivByPowerOf2I FINAL : public LTemplateInstruction<1, 1, 0> {
1989 LFlooringDivByPowerOf2I(LOperand* dividend, int32_t divisor) {
1990 inputs_[0] = dividend;
1994 LOperand* dividend() { return inputs_[0]; }
1995 int32_t divisor() const { return divisor_; }
1997 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I,
1998 "flooring-div-by-power-of-2-i")
1999 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
2006 class LFlooringDivByConstI FINAL : public LTemplateInstruction<1, 1, 2> {
2008 LFlooringDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) {
2009 inputs_[0] = dividend;
2014 LOperand* dividend() { return inputs_[0]; }
2015 int32_t divisor() const { return divisor_; }
2016 LOperand* temp() { return temps_[0]; }
2018 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i")
2019 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
2026 class LFlooringDivI FINAL : public LTemplateInstruction<1, 2, 1> {
2028 LFlooringDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) {
2029 inputs_[0] = dividend;
2030 inputs_[1] = divisor;
2034 LOperand* dividend() { return inputs_[0]; }
2035 LOperand* divisor() { return inputs_[1]; }
2036 LOperand* temp() { return temps_[0]; }
2038 DECLARE_CONCRETE_INSTRUCTION(FlooringDivI, "flooring-div-i")
2039 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
2043 class LMathLog FINAL : public LUnaryMathOperation<0> {
2045 explicit LMathLog(LOperand* value) : LUnaryMathOperation<0>(value) { }
2046 DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log")
2050 class LMathClz32 FINAL : public LUnaryMathOperation<0> {
2052 explicit LMathClz32(LOperand* value) : LUnaryMathOperation<0>(value) { }
2053 DECLARE_CONCRETE_INSTRUCTION(MathClz32, "math-clz32")
2057 class LMathMinMax FINAL : public LTemplateInstruction<1, 2, 0> {
2059 LMathMinMax(LOperand* left, LOperand* right) {
2064 LOperand* left() { return inputs_[0]; }
2065 LOperand* right() { return inputs_[1]; }
2067 DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "math-min-max")
2068 DECLARE_HYDROGEN_ACCESSOR(MathMinMax)
2072 class LMathPowHalf FINAL : public LUnaryMathOperation<0> {
2074 explicit LMathPowHalf(LOperand* value) : LUnaryMathOperation<0>(value) { }
2075 DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half")
2079 // Math.round with an integer result.
2080 class LMathRoundD FINAL : public LUnaryMathOperation<0> {
2082 explicit LMathRoundD(LOperand* value)
2083 : LUnaryMathOperation<0>(value) {
2086 DECLARE_CONCRETE_INSTRUCTION(MathRoundD, "math-round-d")
2090 // Math.round with an integer result.
2091 class LMathRoundI FINAL : public LUnaryMathOperation<1> {
2093 LMathRoundI(LOperand* value, LOperand* temp1)
2094 : LUnaryMathOperation<1>(value) {
2098 LOperand* temp1() { return temps_[0]; }
2100 DECLARE_CONCRETE_INSTRUCTION(MathRoundI, "math-round-i")
2104 class LMathFround FINAL : public LUnaryMathOperation<0> {
2106 explicit LMathFround(LOperand* value) : LUnaryMathOperation<0>(value) {}
2108 DECLARE_CONCRETE_INSTRUCTION(MathFround, "math-fround")
2112 class LMathSqrt FINAL : public LUnaryMathOperation<0> {
2114 explicit LMathSqrt(LOperand* value) : LUnaryMathOperation<0>(value) { }
2115 DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt")
2119 class LModByPowerOf2I FINAL : public LTemplateInstruction<1, 1, 0> {
2121 LModByPowerOf2I(LOperand* dividend, int32_t divisor) {
2122 inputs_[0] = dividend;
2126 LOperand* dividend() { return inputs_[0]; }
2127 int32_t divisor() const { return divisor_; }
2129 DECLARE_CONCRETE_INSTRUCTION(ModByPowerOf2I, "mod-by-power-of-2-i")
2130 DECLARE_HYDROGEN_ACCESSOR(Mod)
2137 class LModByConstI FINAL : public LTemplateInstruction<1, 1, 1> {
2139 LModByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) {
2140 inputs_[0] = dividend;
2145 LOperand* dividend() { return inputs_[0]; }
2146 int32_t divisor() const { return divisor_; }
2147 LOperand* temp() { return temps_[0]; }
2149 DECLARE_CONCRETE_INSTRUCTION(ModByConstI, "mod-by-const-i")
2150 DECLARE_HYDROGEN_ACCESSOR(Mod)
2157 class LModI FINAL : public LTemplateInstruction<1, 2, 0> {
2159 LModI(LOperand* left, LOperand* right) {
2164 LOperand* left() { return inputs_[0]; }
2165 LOperand* right() { return inputs_[1]; }
2167 DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i")
2168 DECLARE_HYDROGEN_ACCESSOR(Mod)
2172 class LMulConstIS FINAL : public LTemplateInstruction<1, 2, 0> {
2174 LMulConstIS(LOperand* left, LConstantOperand* right) {
2179 LOperand* left() { return inputs_[0]; }
2180 LConstantOperand* right() { return LConstantOperand::cast(inputs_[1]); }
2182 DECLARE_CONCRETE_INSTRUCTION(MulConstIS, "mul-const-i-s")
2183 DECLARE_HYDROGEN_ACCESSOR(Mul)
2187 class LMulI FINAL : public LTemplateInstruction<1, 2, 0> {
2189 LMulI(LOperand* left, LOperand* right) {
2194 LOperand* left() { return inputs_[0]; }
2195 LOperand* right() { return inputs_[1]; }
2197 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
2198 DECLARE_HYDROGEN_ACCESSOR(Mul)
2202 class LMulS FINAL : public LTemplateInstruction<1, 2, 0> {
2204 LMulS(LOperand* left, LOperand* right) {
2209 LOperand* left() { return inputs_[0]; }
2210 LOperand* right() { return inputs_[1]; }
2212 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-s")
2213 DECLARE_HYDROGEN_ACCESSOR(Mul)
2217 class LNumberTagD FINAL : public LTemplateInstruction<1, 1, 2> {
2219 LNumberTagD(LOperand* value, LOperand* temp1, LOperand* temp2) {
2225 LOperand* value() { return inputs_[0]; }
2226 LOperand* temp1() { return temps_[0]; }
2227 LOperand* temp2() { return temps_[1]; }
2229 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d")
2230 DECLARE_HYDROGEN_ACCESSOR(Change)
2234 class LNumberTagU FINAL : public LTemplateInstruction<1, 1, 2> {
2236 explicit LNumberTagU(LOperand* value,
2244 LOperand* value() { return inputs_[0]; }
2245 LOperand* temp1() { return temps_[0]; }
2246 LOperand* temp2() { return temps_[1]; }
2248 DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u")
2252 class LNumberUntagD FINAL : public LTemplateInstruction<1, 1, 1> {
2254 LNumberUntagD(LOperand* value, LOperand* temp) {
2259 LOperand* value() { return inputs_[0]; }
2261 LOperand* temp() { return temps_[0]; }
2263 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
2264 DECLARE_HYDROGEN_ACCESSOR(Change)
2268 class LParameter FINAL : public LTemplateInstruction<1, 0, 0> {
2270 bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { return false; }
2271 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
2275 class LPower FINAL : public LTemplateInstruction<1, 2, 0> {
2277 LPower(LOperand* left, LOperand* right) {
2282 LOperand* left() { return inputs_[0]; }
2283 LOperand* right() { return inputs_[1]; }
2285 DECLARE_CONCRETE_INSTRUCTION(Power, "power")
2286 DECLARE_HYDROGEN_ACCESSOR(Power)
2290 class LPreparePushArguments FINAL : public LTemplateInstruction<0, 0, 0> {
2292 explicit LPreparePushArguments(int argc) : argc_(argc) {}
2294 inline int argc() const { return argc_; }
2296 DECLARE_CONCRETE_INSTRUCTION(PreparePushArguments, "prepare-push-arguments")
2303 class LPushArguments FINAL : public LTemplateResultInstruction<0> {
2305 explicit LPushArguments(Zone* zone,
2306 int capacity = kRecommendedMaxPushedArgs)
2307 : zone_(zone), inputs_(capacity, zone) {}
2309 LOperand* argument(int i) { return inputs_[i]; }
2310 int ArgumentCount() const { return inputs_.length(); }
2312 void AddArgument(LOperand* arg) { inputs_.Add(arg, zone_); }
2314 DECLARE_CONCRETE_INSTRUCTION(PushArguments, "push-arguments")
2316 // It is better to limit the number of arguments pushed simultaneously to
2317 // avoid pressure on the register allocator.
2318 static const int kRecommendedMaxPushedArgs = 4;
2319 bool ShouldSplitPush() const {
2320 return inputs_.length() >= kRecommendedMaxPushedArgs;
2325 ZoneList<LOperand*> inputs_;
2328 // Iterator support.
2329 int InputCount() FINAL { return inputs_.length(); }
2330 LOperand* InputAt(int i) FINAL { return inputs_[i]; }
2332 int TempCount() FINAL { return 0; }
2333 LOperand* TempAt(int i) FINAL { return NULL; }
2337 class LRegExpLiteral FINAL : public LTemplateInstruction<1, 1, 0> {
2339 explicit LRegExpLiteral(LOperand* context) {
2340 inputs_[0] = context;
2343 LOperand* context() { return inputs_[0]; }
2345 DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal")
2346 DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral)
2350 class LReturn FINAL : public LTemplateInstruction<0, 3, 0> {
2352 LReturn(LOperand* value, LOperand* context, LOperand* parameter_count) {
2354 inputs_[1] = context;
2355 inputs_[2] = parameter_count;
2358 LOperand* value() { return inputs_[0]; }
2359 LOperand* parameter_count() { return inputs_[2]; }
2361 bool has_constant_parameter_count() {
2362 return parameter_count()->IsConstantOperand();
2364 LConstantOperand* constant_parameter_count() {
2365 DCHECK(has_constant_parameter_count());
2366 return LConstantOperand::cast(parameter_count());
2369 DECLARE_CONCRETE_INSTRUCTION(Return, "return")
2373 class LSeqStringGetChar FINAL : public LTemplateInstruction<1, 2, 1> {
2375 LSeqStringGetChar(LOperand* string,
2378 inputs_[0] = string;
2383 LOperand* string() { return inputs_[0]; }
2384 LOperand* index() { return inputs_[1]; }
2385 LOperand* temp() { return temps_[0]; }
2387 DECLARE_CONCRETE_INSTRUCTION(SeqStringGetChar, "seq-string-get-char")
2388 DECLARE_HYDROGEN_ACCESSOR(SeqStringGetChar)
2392 class LSeqStringSetChar FINAL : public LTemplateInstruction<1, 4, 1> {
2394 LSeqStringSetChar(LOperand* context,
2399 inputs_[0] = context;
2400 inputs_[1] = string;
2406 LOperand* context() { return inputs_[0]; }
2407 LOperand* string() { return inputs_[1]; }
2408 LOperand* index() { return inputs_[2]; }
2409 LOperand* value() { return inputs_[3]; }
2410 LOperand* temp() { return temps_[0]; }
2412 DECLARE_CONCRETE_INSTRUCTION(SeqStringSetChar, "seq-string-set-char")
2413 DECLARE_HYDROGEN_ACCESSOR(SeqStringSetChar)
2417 class LSmiTag FINAL : public LTemplateInstruction<1, 1, 0> {
2419 explicit LSmiTag(LOperand* value) {
2423 LOperand* value() { return inputs_[0]; }
2425 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag")
2426 DECLARE_HYDROGEN_ACCESSOR(Change)
2430 class LSmiUntag FINAL : public LTemplateInstruction<1, 1, 0> {
2432 LSmiUntag(LOperand* value, bool needs_check)
2433 : needs_check_(needs_check) {
2437 LOperand* value() { return inputs_[0]; }
2438 bool needs_check() const { return needs_check_; }
2440 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag")
2447 class LStackCheck FINAL : public LTemplateInstruction<0, 1, 0> {
2449 explicit LStackCheck(LOperand* context) {
2450 inputs_[0] = context;
2453 LOperand* context() { return inputs_[0]; }
2455 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
2456 DECLARE_HYDROGEN_ACCESSOR(StackCheck)
2458 Label* done_label() { return &done_label_; }
2466 class LStoreKeyed : public LTemplateInstruction<0, 3, T> {
2468 LStoreKeyed(LOperand* elements, LOperand* key, LOperand* value) {
2469 this->inputs_[0] = elements;
2470 this->inputs_[1] = key;
2471 this->inputs_[2] = value;
2474 bool is_external() const { return this->hydrogen()->is_external(); }
2475 bool is_fixed_typed_array() const {
2476 return hydrogen()->is_fixed_typed_array();
2478 bool is_typed_elements() const {
2479 return is_external() || is_fixed_typed_array();
2481 LOperand* elements() { return this->inputs_[0]; }
2482 LOperand* key() { return this->inputs_[1]; }
2483 LOperand* value() { return this->inputs_[2]; }
2484 ElementsKind elements_kind() const {
2485 return this->hydrogen()->elements_kind();
2488 bool NeedsCanonicalization() {
2489 if (hydrogen()->value()->IsAdd() || hydrogen()->value()->IsSub() ||
2490 hydrogen()->value()->IsMul() || hydrogen()->value()->IsDiv()) {
2493 return this->hydrogen()->NeedsCanonicalization();
2495 uint32_t base_offset() const { return this->hydrogen()->base_offset(); }
2497 void PrintDataTo(StringStream* stream) OVERRIDE {
2498 this->elements()->PrintTo(stream);
2500 this->key()->PrintTo(stream);
2501 if (this->base_offset() != 0) {
2502 stream->Add(" + %d] <-", this->base_offset());
2504 stream->Add("] <- ");
2507 if (this->value() == NULL) {
2508 DCHECK(hydrogen()->IsConstantHoleStore() &&
2509 hydrogen()->value()->representation().IsDouble());
2510 stream->Add("<the hole(nan)>");
2512 this->value()->PrintTo(stream);
2516 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed)
2520 class LStoreKeyedExternal FINAL : public LStoreKeyed<1> {
2522 LStoreKeyedExternal(LOperand* elements, LOperand* key, LOperand* value,
2524 LStoreKeyed<1>(elements, key, value) {
2528 LOperand* temp() { return temps_[0]; }
2530 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedExternal, "store-keyed-external")
2534 class LStoreKeyedFixed FINAL : public LStoreKeyed<1> {
2536 LStoreKeyedFixed(LOperand* elements, LOperand* key, LOperand* value,
2538 LStoreKeyed<1>(elements, key, value) {
2542 LOperand* temp() { return temps_[0]; }
2544 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFixed, "store-keyed-fixed")
2548 class LStoreKeyedFixedDouble FINAL : public LStoreKeyed<1> {
2550 LStoreKeyedFixedDouble(LOperand* elements, LOperand* key, LOperand* value,
2552 LStoreKeyed<1>(elements, key, value) {
2556 LOperand* temp() { return temps_[0]; }
2558 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFixedDouble,
2559 "store-keyed-fixed-double")
2563 class LStoreKeyedGeneric FINAL : public LTemplateInstruction<0, 4, 0> {
2565 LStoreKeyedGeneric(LOperand* context,
2569 inputs_[0] = context;
2575 LOperand* context() { return inputs_[0]; }
2576 LOperand* object() { return inputs_[1]; }
2577 LOperand* key() { return inputs_[2]; }
2578 LOperand* value() { return inputs_[3]; }
2580 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
2581 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric)
2583 void PrintDataTo(StringStream* stream) OVERRIDE;
2585 LanguageMode language_mode() { return hydrogen()->language_mode(); }
2589 class LStoreNamedField FINAL : public LTemplateInstruction<0, 2, 2> {
2591 LStoreNamedField(LOperand* object, LOperand* value,
2592 LOperand* temp0, LOperand* temp1) {
2593 inputs_[0] = object;
2599 LOperand* object() { return inputs_[0]; }
2600 LOperand* value() { return inputs_[1]; }
2601 LOperand* temp0() { return temps_[0]; }
2602 LOperand* temp1() { return temps_[1]; }
2604 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
2605 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
2607 void PrintDataTo(StringStream* stream) OVERRIDE;
2609 Representation representation() const {
2610 return hydrogen()->field_representation();
2615 class LStoreNamedGeneric FINAL: public LTemplateInstruction<0, 3, 0> {
2617 LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value) {
2618 inputs_[0] = context;
2619 inputs_[1] = object;
2623 LOperand* context() { return inputs_[0]; }
2624 LOperand* object() { return inputs_[1]; }
2625 LOperand* value() { return inputs_[2]; }
2627 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
2628 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
2630 void PrintDataTo(StringStream* stream) OVERRIDE;
2632 Handle<Object> name() const { return hydrogen()->name(); }
2633 LanguageMode language_mode() { return hydrogen()->language_mode(); }
2637 class LStringAdd FINAL : public LTemplateInstruction<1, 3, 0> {
2639 LStringAdd(LOperand* context, LOperand* left, LOperand* right) {
2640 inputs_[0] = context;
2645 LOperand* context() { return inputs_[0]; }
2646 LOperand* left() { return inputs_[1]; }
2647 LOperand* right() { return inputs_[2]; }
2649 DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add")
2650 DECLARE_HYDROGEN_ACCESSOR(StringAdd)
2655 class LStringCharCodeAt FINAL : public LTemplateInstruction<1, 3, 0> {
2657 LStringCharCodeAt(LOperand* context, LOperand* string, LOperand* index) {
2658 inputs_[0] = context;
2659 inputs_[1] = string;
2663 LOperand* context() { return inputs_[0]; }
2664 LOperand* string() { return inputs_[1]; }
2665 LOperand* index() { return inputs_[2]; }
2667 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at")
2668 DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt)
2672 class LStringCharFromCode FINAL : public LTemplateInstruction<1, 2, 0> {
2674 LStringCharFromCode(LOperand* context, LOperand* char_code) {
2675 inputs_[0] = context;
2676 inputs_[1] = char_code;
2679 LOperand* context() { return inputs_[0]; }
2680 LOperand* char_code() { return inputs_[1]; }
2682 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code")
2683 DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode)
2687 class LStringCompareAndBranch FINAL : public LControlInstruction<3, 0> {
2689 LStringCompareAndBranch(LOperand* context, LOperand* left, LOperand* right) {
2690 inputs_[0] = context;
2695 LOperand* context() { return inputs_[0]; }
2696 LOperand* left() { return inputs_[1]; }
2697 LOperand* right() { return inputs_[2]; }
2699 DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch,
2700 "string-compare-and-branch")
2701 DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch)
2703 Token::Value op() const { return hydrogen()->token(); }
2705 void PrintDataTo(StringStream* stream) OVERRIDE;
2709 // Truncating conversion from a tagged value to an int32.
2710 class LTaggedToI FINAL : public LTemplateInstruction<1, 1, 2> {
2712 explicit LTaggedToI(LOperand* value, LOperand* temp1, LOperand* temp2) {
2718 LOperand* value() { return inputs_[0]; }
2719 LOperand* temp1() { return temps_[0]; }
2720 LOperand* temp2() { return temps_[1]; }
2722 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
2723 DECLARE_HYDROGEN_ACCESSOR(Change)
2725 bool truncating() { return hydrogen()->CanTruncateToInt32(); }
2729 class LShiftI FINAL : public LTemplateInstruction<1, 2, 0> {
2731 LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt)
2732 : op_(op), can_deopt_(can_deopt) {
2737 Token::Value op() const { return op_; }
2738 LOperand* left() { return inputs_[0]; }
2739 LOperand* right() { return inputs_[1]; }
2740 bool can_deopt() const { return can_deopt_; }
2742 DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i")
2750 class LShiftS FINAL : public LTemplateInstruction<1, 2, 0> {
2752 LShiftS(Token::Value op, LOperand* left, LOperand* right, bool can_deopt)
2753 : op_(op), can_deopt_(can_deopt) {
2758 Token::Value op() const { return op_; }
2759 LOperand* left() { return inputs_[0]; }
2760 LOperand* right() { return inputs_[1]; }
2761 bool can_deopt() const { return can_deopt_; }
2763 DECLARE_CONCRETE_INSTRUCTION(ShiftS, "shift-s")
2771 class LStoreCodeEntry FINAL: public LTemplateInstruction<0, 2, 1> {
2773 LStoreCodeEntry(LOperand* function, LOperand* code_object,
2775 inputs_[0] = function;
2776 inputs_[1] = code_object;
2780 LOperand* function() { return inputs_[0]; }
2781 LOperand* code_object() { return inputs_[1]; }
2782 LOperand* temp() { return temps_[0]; }
2784 void PrintDataTo(StringStream* stream) OVERRIDE;
2786 DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry, "store-code-entry")
2787 DECLARE_HYDROGEN_ACCESSOR(StoreCodeEntry)
2791 class LStoreContextSlot FINAL : public LTemplateInstruction<0, 2, 1> {
2793 LStoreContextSlot(LOperand* context, LOperand* value, LOperand* temp) {
2794 inputs_[0] = context;
2799 LOperand* context() { return inputs_[0]; }
2800 LOperand* value() { return inputs_[1]; }
2801 LOperand* temp() { return temps_[0]; }
2803 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
2804 DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
2806 int slot_index() { return hydrogen()->slot_index(); }
2808 void PrintDataTo(StringStream* stream) OVERRIDE;
2812 class LStoreGlobalCell FINAL : public LTemplateInstruction<0, 1, 2> {
2814 LStoreGlobalCell(LOperand* value, LOperand* temp1, LOperand* temp2) {
2820 LOperand* value() { return inputs_[0]; }
2821 LOperand* temp1() { return temps_[0]; }
2822 LOperand* temp2() { return temps_[1]; }
2824 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell")
2825 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell)
2829 class LSubI FINAL : public LTemplateInstruction<1, 2, 0> {
2831 LSubI(LOperand* left, LOperand* right)
2832 : shift_(NO_SHIFT), shift_amount_(0) {
2837 LSubI(LOperand* left, LOperand* right, Shift shift, LOperand* shift_amount)
2838 : shift_(shift), shift_amount_(shift_amount) {
2843 LOperand* left() { return inputs_[0]; }
2844 LOperand* right() { return inputs_[1]; }
2846 Shift shift() const { return shift_; }
2847 LOperand* shift_amount() const { return shift_amount_; }
2849 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i")
2850 DECLARE_HYDROGEN_ACCESSOR(Sub)
2854 LOperand* shift_amount_;
2858 class LSubS: public LTemplateInstruction<1, 2, 0> {
2860 LSubS(LOperand* left, LOperand* right) {
2865 LOperand* left() { return inputs_[0]; }
2866 LOperand* right() { return inputs_[1]; }
2868 DECLARE_CONCRETE_INSTRUCTION(SubS, "sub-s")
2869 DECLARE_HYDROGEN_ACCESSOR(Sub)
2873 class LThisFunction FINAL : public LTemplateInstruction<1, 0, 0> {
2875 DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function")
2876 DECLARE_HYDROGEN_ACCESSOR(ThisFunction)
2880 class LToFastProperties FINAL : public LTemplateInstruction<1, 1, 0> {
2882 explicit LToFastProperties(LOperand* value) {
2886 LOperand* value() { return inputs_[0]; }
2888 DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties")
2889 DECLARE_HYDROGEN_ACCESSOR(ToFastProperties)
2893 class LTransitionElementsKind FINAL : public LTemplateInstruction<0, 2, 2> {
2895 LTransitionElementsKind(LOperand* object,
2899 inputs_[0] = object;
2900 inputs_[1] = context;
2905 LOperand* object() { return inputs_[0]; }
2906 LOperand* context() { return inputs_[1]; }
2907 LOperand* temp1() { return temps_[0]; }
2908 LOperand* temp2() { return temps_[1]; }
2910 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind,
2911 "transition-elements-kind")
2912 DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind)
2914 void PrintDataTo(StringStream* stream) OVERRIDE;
2916 Handle<Map> original_map() { return hydrogen()->original_map().handle(); }
2917 Handle<Map> transitioned_map() {
2918 return hydrogen()->transitioned_map().handle();
2920 ElementsKind from_kind() const { return hydrogen()->from_kind(); }
2921 ElementsKind to_kind() const { return hydrogen()->to_kind(); }
2925 class LTrapAllocationMemento FINAL : public LTemplateInstruction<0, 1, 2> {
2927 LTrapAllocationMemento(LOperand* object, LOperand* temp1, LOperand* temp2) {
2928 inputs_[0] = object;
2933 LOperand* object() { return inputs_[0]; }
2934 LOperand* temp1() { return temps_[0]; }
2935 LOperand* temp2() { return temps_[1]; }
2937 DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento, "trap-allocation-memento")
2941 class LTruncateDoubleToIntOrSmi FINAL
2942 : public LTemplateInstruction<1, 1, 0> {
2944 explicit LTruncateDoubleToIntOrSmi(LOperand* value) {
2948 LOperand* value() { return inputs_[0]; }
2950 DECLARE_CONCRETE_INSTRUCTION(TruncateDoubleToIntOrSmi,
2951 "truncate-double-to-int-or-smi")
2952 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
2954 bool tag_result() { return hydrogen()->representation().IsSmi(); }
2958 class LTypeof FINAL : public LTemplateInstruction<1, 2, 0> {
2960 LTypeof(LOperand* context, LOperand* value) {
2961 inputs_[0] = context;
2965 LOperand* context() { return inputs_[0]; }
2966 LOperand* value() { return inputs_[1]; }
2968 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
2972 class LTypeofIsAndBranch FINAL : public LControlInstruction<1, 2> {
2974 LTypeofIsAndBranch(LOperand* value, LOperand* temp1, LOperand* temp2) {
2980 LOperand* value() { return inputs_[0]; }
2981 LOperand* temp1() { return temps_[0]; }
2982 LOperand* temp2() { return temps_[1]; }
2984 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch")
2985 DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch)
2987 Handle<String> type_literal() const { return hydrogen()->type_literal(); }
2989 void PrintDataTo(StringStream* stream) OVERRIDE;
2993 class LUint32ToDouble FINAL : public LTemplateInstruction<1, 1, 0> {
2995 explicit LUint32ToDouble(LOperand* value) {
2999 LOperand* value() { return inputs_[0]; }
3001 DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double")
3005 class LCheckMapValue FINAL : public LTemplateInstruction<0, 2, 1> {
3007 LCheckMapValue(LOperand* value, LOperand* map, LOperand* temp) {
3013 LOperand* value() { return inputs_[0]; }
3014 LOperand* map() { return inputs_[1]; }
3015 LOperand* temp() { return temps_[0]; }
3017 DECLARE_CONCRETE_INSTRUCTION(CheckMapValue, "check-map-value")
3021 class LLoadFieldByIndex FINAL : public LTemplateInstruction<1, 2, 0> {
3023 LLoadFieldByIndex(LOperand* object, LOperand* index) {
3024 inputs_[0] = object;
3028 LOperand* object() { return inputs_[0]; }
3029 LOperand* index() { return inputs_[1]; }
3031 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index")
3035 class LStoreFrameContext: public LTemplateInstruction<0, 1, 0> {
3037 explicit LStoreFrameContext(LOperand* context) {
3038 inputs_[0] = context;
3041 LOperand* context() { return inputs_[0]; }
3043 DECLARE_CONCRETE_INSTRUCTION(StoreFrameContext, "store-frame-context")
3047 class LAllocateBlockContext: public LTemplateInstruction<1, 2, 0> {
3049 LAllocateBlockContext(LOperand* context, LOperand* function) {
3050 inputs_[0] = context;
3051 inputs_[1] = function;
3054 LOperand* context() { return inputs_[0]; }
3055 LOperand* function() { return inputs_[1]; }
3057 Handle<ScopeInfo> scope_info() { return hydrogen()->scope_info(); }
3059 DECLARE_CONCRETE_INSTRUCTION(AllocateBlockContext, "allocate-block-context")
3060 DECLARE_HYDROGEN_ACCESSOR(AllocateBlockContext)
3064 class LWrapReceiver FINAL : public LTemplateInstruction<1, 2, 0> {
3066 LWrapReceiver(LOperand* receiver, LOperand* function) {
3067 inputs_[0] = receiver;
3068 inputs_[1] = function;
3071 DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver")
3072 DECLARE_HYDROGEN_ACCESSOR(WrapReceiver)
3074 LOperand* receiver() { return inputs_[0]; }
3075 LOperand* function() { return inputs_[1]; }
3079 class LChunkBuilder;
3080 class LPlatformChunk FINAL : public LChunk {
3082 LPlatformChunk(CompilationInfo* info, HGraph* graph)
3083 : LChunk(info, graph) { }
3085 int GetNextSpillIndex();
3086 LOperand* GetNextSpillSlot(RegisterKind kind);
3090 class LChunkBuilder FINAL : public LChunkBuilderBase {
3092 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator)
3093 : LChunkBuilderBase(info, graph),
3094 current_instruction_(NULL),
3095 current_block_(NULL),
3096 allocator_(allocator) {}
3098 // Build the sequence for the graph.
3099 LPlatformChunk* Build();
3101 // Declare methods that deal with the individual node types.
3102 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
3103 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
3106 LInstruction* DoDivByPowerOf2I(HDiv* instr);
3107 LInstruction* DoDivByConstI(HDiv* instr);
3108 LInstruction* DoDivI(HBinaryOperation* instr);
3109 LInstruction* DoModByPowerOf2I(HMod* instr);
3110 LInstruction* DoModByConstI(HMod* instr);
3111 LInstruction* DoModI(HMod* instr);
3112 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr);
3113 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr);
3114 LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr);
3116 static bool HasMagicNumberForDivision(int32_t divisor);
3119 // Methods for getting operands for Use / Define / Temp.
3120 LUnallocated* ToUnallocated(Register reg);
3121 LUnallocated* ToUnallocated(DoubleRegister reg);
3123 // Methods for setting up define-use relationships.
3124 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand);
3125 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register);
3126 MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value,
3127 DoubleRegister fixed_register);
3129 // A value that is guaranteed to be allocated to a register.
3130 // The operand created by UseRegister is guaranteed to be live until the end
3131 // of the instruction. This means that register allocator will not reuse its
3132 // register for any other operand inside instruction.
3133 MUST_USE_RESULT LOperand* UseRegister(HValue* value);
3135 // The operand created by UseRegisterAndClobber is guaranteed to be live until
3136 // the end of the end of the instruction, and it may also be used as a scratch
3137 // register by the instruction implementation.
3139 // This behaves identically to ARM's UseTempRegister. However, it is renamed
3140 // to discourage its use in ARM64, since in most cases it is better to
3141 // allocate a temporary register for the Lithium instruction.
3142 MUST_USE_RESULT LOperand* UseRegisterAndClobber(HValue* value);
3144 // The operand created by UseRegisterAtStart is guaranteed to be live only at
3145 // instruction start. The register allocator is free to assign the same
3146 // register to some other operand used inside instruction (i.e. temporary or
3148 MUST_USE_RESULT LOperand* UseRegisterAtStart(HValue* value);
3150 // An input operand in a register or a constant operand.
3151 MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value);
3152 MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value);
3154 // A constant operand.
3155 MUST_USE_RESULT LConstantOperand* UseConstant(HValue* value);
3157 // An input operand in register, stack slot or a constant operand.
3158 // Will not be moved to a register even if one is freely available.
3159 virtual MUST_USE_RESULT LOperand* UseAny(HValue* value);
3161 // Temporary operand that must be in a register.
3162 MUST_USE_RESULT LUnallocated* TempRegister();
3164 // Temporary operand that must be in a double register.
3165 MUST_USE_RESULT LUnallocated* TempDoubleRegister();
3167 MUST_USE_RESULT LOperand* FixedTemp(Register reg);
3169 // Temporary operand that must be in a fixed double register.
3170 MUST_USE_RESULT LOperand* FixedTemp(DoubleRegister reg);
3172 // Methods for setting up define-use relationships.
3173 // Return the same instruction that they are passed.
3174 LInstruction* Define(LTemplateResultInstruction<1>* instr,
3175 LUnallocated* result);
3176 LInstruction* DefineAsRegister(LTemplateResultInstruction<1>* instr);
3177 LInstruction* DefineAsSpilled(LTemplateResultInstruction<1>* instr,
3180 LInstruction* DefineSameAsFirst(LTemplateResultInstruction<1>* instr);
3181 LInstruction* DefineFixed(LTemplateResultInstruction<1>* instr,
3183 LInstruction* DefineFixedDouble(LTemplateResultInstruction<1>* instr,
3184 DoubleRegister reg);
3186 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY };
3188 // By default we assume that instruction sequences generated for calls
3189 // cannot deoptimize eagerly and we do not attach environment to this
3191 LInstruction* MarkAsCall(
3192 LInstruction* instr,
3193 HInstruction* hinstr,
3194 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
3196 LInstruction* AssignPointerMap(LInstruction* instr);
3197 LInstruction* AssignEnvironment(LInstruction* instr);
3199 void VisitInstruction(HInstruction* current);
3200 void AddInstruction(LInstruction* instr, HInstruction* current);
3201 void DoBasicBlock(HBasicBlock* block);
3203 int JSShiftAmountFromHConstant(HValue* constant) {
3204 return HConstant::cast(constant)->Integer32Value() & 0x1f;
3206 bool LikelyFitsImmField(HInstruction* instr, int imm) {
3207 if (instr->IsAdd() || instr->IsSub()) {
3208 return Assembler::IsImmAddSub(imm) || Assembler::IsImmAddSub(-imm);
3210 DCHECK(instr->IsBitwise());
3211 unsigned unused_n, unused_imm_s, unused_imm_r;
3212 return Assembler::IsImmLogical(imm, kWRegSizeInBits,
3213 &unused_n, &unused_imm_s, &unused_imm_r);
3217 // Indicates if a sequence of the form
3220 // can be replaced with:
3221 // add x0, x1, x9 LSL #imm
3222 // If this is not possible, the function returns NULL. Otherwise it returns a
3223 // pointer to the shift instruction that would be optimized away.
3224 HBitwiseBinaryOperation* CanTransformToShiftedOp(HValue* val,
3225 HValue** left = NULL);
3226 // Checks if all uses of the shift operation can optimize it away.
3227 bool ShiftCanBeOptimizedAway(HBitwiseBinaryOperation* shift);
3228 // Attempts to merge the binary operation and an eventual previous shift
3229 // operation into a single operation. Returns the merged instruction on
3230 // success, and NULL otherwise.
3231 LInstruction* TryDoOpWithShiftedRightOperand(HBinaryOperation* op);
3232 LInstruction* DoShiftedBinaryOp(HBinaryOperation* instr,
3234 HBitwiseBinaryOperation* shift);
3236 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
3237 LInstruction* DoArithmeticD(Token::Value op,
3238 HArithmeticBinaryOperation* instr);
3239 LInstruction* DoArithmeticT(Token::Value op,
3240 HBinaryOperation* instr);
3242 HInstruction* current_instruction_;
3243 HBasicBlock* current_block_;
3244 LAllocator* allocator_;
3246 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
3249 #undef DECLARE_HYDROGEN_ACCESSOR
3250 #undef DECLARE_CONCRETE_INSTRUCTION
3252 } } // namespace v8::internal
3254 #endif // V8_ARM64_LITHIUM_ARM64_H_