13ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch// Copyright 2012 the V8 project authors. All rights reserved. 2b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch// Use of this source code is governed by a BSD-style license that can be 3b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch// found in the LICENSE file. 4b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 5014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch#ifndef V8_CRANKSHAFT_IA32_LITHIUM_IA32_H_ 6014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch#define V8_CRANKSHAFT_IA32_LITHIUM_IA32_H_ 7b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 8014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch#include "src/crankshaft/hydrogen.h" 9014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch#include "src/crankshaft/lithium.h" 10014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch#include "src/crankshaft/lithium-allocator.h" 11b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#include "src/safepoint-table.h" 12b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#include "src/utils.h" 13b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 14b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdochnamespace v8 { 15b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdochnamespace internal { 16b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 17b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdochnamespace compiler { 18b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdochclass RCodeVisualizer; 19b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch} 20b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 21b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch// Forward declarations. 22b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdochclass LCodeGen; 23b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 24b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ 25b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(AccessArgumentsAt) \ 26b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(AddI) \ 27b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(Allocate) \ 28b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ApplyArguments) \ 29b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ArgumentsElements) \ 30b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ArgumentsLength) \ 31b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ArithmeticD) \ 32b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ArithmeticT) \ 33b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(BitI) \ 34b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(BoundsCheck) \ 35b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(Branch) \ 36b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(CallWithDescriptor) \ 37b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(CallNewArray) \ 38b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(CallRuntime) \ 39014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch V(CheckArrayBufferNotNeutered) \ 40b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(CheckInstanceType) \ 41b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(CheckMaps) \ 42b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(CheckMapValue) \ 43b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(CheckNonSmi) \ 44b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(CheckSmi) \ 45b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(CheckValue) \ 46b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ClampDToUint8) \ 47b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ClampIToUint8) \ 48b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ClampTToUint8) \ 49b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ClassOfTestAndBranch) \ 50b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(CompareNumericAndBranch) \ 51b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(CmpObjectEqAndBranch) \ 52b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(CmpHoleAndBranch) \ 53b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(CmpMapAndBranch) \ 54b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(CmpT) \ 55b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ConstantD) \ 56b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ConstantE) \ 57b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ConstantI) \ 58b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ConstantS) \ 59b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ConstantT) \ 60b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(Context) \ 61b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(DebugBreak) \ 62b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(DeclareGlobals) \ 63b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(Deoptimize) \ 64b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(DivByConstI) \ 65b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(DivByPowerOf2I) \ 66b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(DivI) \ 67b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(DoubleBits) \ 68b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(DoubleToI) \ 69b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(DoubleToSmi) \ 70b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(Drop) \ 71b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(Dummy) \ 72b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(DummyUse) \ 73537ba893e2530051ec7f296e769fdd37bb4ae4a0Ben Murdoch V(FastAllocate) \ 74b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(FlooringDivByConstI) \ 75b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(FlooringDivByPowerOf2I) \ 76b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(FlooringDivI) \ 77b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ForInCacheArray) \ 78b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ForInPrepareMap) \ 79b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(GetCachedArrayIndex) \ 80b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(Goto) \ 81b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(HasCachedArrayIndexAndBranch) \ 82014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch V(HasInPrototypeChainAndBranch) \ 83b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(HasInstanceTypeAndBranch) \ 84b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(InnerAllocatedObject) \ 85b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(InstructionGap) \ 86b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(Integer32ToDouble) \ 87b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(InvokeFunction) \ 88b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(IsStringAndBranch) \ 89b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(IsSmiAndBranch) \ 90b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(IsUndetectableAndBranch) \ 91b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(Label) \ 92b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(LazyBailout) \ 93b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(LoadContextSlot) \ 94b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(LoadFieldByIndex) \ 95b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(LoadFunctionPrototype) \ 96b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(LoadGlobalGeneric) \ 97b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(LoadKeyed) \ 98b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(LoadKeyedGeneric) \ 99b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(LoadNamedField) \ 100b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(LoadNamedGeneric) \ 101b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(LoadRoot) \ 102b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(MathAbs) \ 103b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(MathClz32) \ 10421efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch V(MathCos) \ 105b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(MathExp) \ 1061b268ca467c924004286c97bac133db489cf43d0Ben Murdoch V(MathFloorD) \ 1071b268ca467c924004286c97bac133db489cf43d0Ben Murdoch V(MathFloorI) \ 108b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(MathFround) \ 109b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(MathLog) \ 110b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(MathMinMax) \ 111b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(MathPowHalf) \ 1121b268ca467c924004286c97bac133db489cf43d0Ben Murdoch V(MathRoundD) \ 1131b268ca467c924004286c97bac133db489cf43d0Ben Murdoch V(MathRoundI) \ 11421efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch V(MathSin) \ 115b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(MathSqrt) \ 116014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch V(MaybeGrowElements) \ 117b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ModByConstI) \ 118b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ModByPowerOf2I) \ 119b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ModI) \ 120b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(MulI) \ 121b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(NumberTagD) \ 122b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(NumberTagI) \ 123b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(NumberTagU) \ 124b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(NumberUntagD) \ 125b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(OsrEntry) \ 126b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(Parameter) \ 127b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(Power) \ 128014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch V(Prologue) \ 129b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(PushArgument) \ 130b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(Return) \ 131b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(SeqStringGetChar) \ 132b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(SeqStringSetChar) \ 133b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ShiftI) \ 134b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(SmiTag) \ 135b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(SmiUntag) \ 136b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(StackCheck) \ 137b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(StoreCodeEntry) \ 138b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(StoreContextSlot) \ 139b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(StoreKeyed) \ 140b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(StoreKeyedGeneric) \ 141b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(StoreNamedField) \ 142b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(StoreNamedGeneric) \ 143b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(StringAdd) \ 144b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(StringCharCodeAt) \ 145b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(StringCharFromCode) \ 146b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(StringCompareAndBranch) \ 147b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(SubI) \ 148b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(TaggedToI) \ 149b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(ThisFunction) \ 150b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(TransitionElementsKind) \ 151b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(TrapAllocationMemento) \ 152b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(Typeof) \ 153b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(TypeofIsAndBranch) \ 154b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(Uint32ToDouble) \ 155b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch V(UnknownOSRValue) \ 1563ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch V(WrapReceiver) 157b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 158958fae7ec3f466955f8e5b50fa5b8d38b9e91675Emily Bernier#define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ 159014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch Opcode opcode() const final { return LInstruction::k##type; } \ 160014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void CompileToNative(LCodeGen* generator) final; \ 161014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch const char* Mnemonic() const final { return mnemonic; } \ 162958fae7ec3f466955f8e5b50fa5b8d38b9e91675Emily Bernier static L##type* cast(LInstruction* instr) { \ 163958fae7ec3f466955f8e5b50fa5b8d38b9e91675Emily Bernier DCHECK(instr->Is##type()); \ 164958fae7ec3f466955f8e5b50fa5b8d38b9e91675Emily Bernier return reinterpret_cast<L##type*>(instr); \ 165b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch } 166b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 167b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 168b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch#define DECLARE_HYDROGEN_ACCESSOR(type) \ 169b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch H##type* hydrogen() const { \ 170b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch return H##type::cast(hydrogen_value()); \ 171b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch } 172b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 173b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 174b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdochclass LInstruction : public ZoneObject { 175b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 176b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LInstruction() 1771e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block : environment_(NULL), 1781e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block hydrogen_value_(NULL), 179b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch bit_field_(IsCallBits::encode(false)) { 180b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 181b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 182b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch virtual ~LInstruction() {} 183b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 184b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch virtual void CompileToNative(LCodeGen* generator) = 0; 185b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch virtual const char* Mnemonic() const = 0; 186b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch virtual void PrintTo(StringStream* stream); 1873ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch virtual void PrintDataTo(StringStream* stream); 1883ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch virtual void PrintOutputOperandTo(StringStream* stream); 189b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 190257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch enum Opcode { 191257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch // Declare a unique enum value for each instruction. 192257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch#define DECLARE_OPCODE(type) k##type, 193b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_OPCODE) kAdapter, 194257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch kNumberOfInstructions 195257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch#undef DECLARE_OPCODE 196257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch }; 197257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 198257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch virtual Opcode opcode() const = 0; 199257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 200257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch // Declare non-virtual type testers for all leaf IR classes. 201257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch#define DECLARE_PREDICATE(type) \ 202257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch bool Is##type() const { return opcode() == k##type; } 203257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_PREDICATE) 204257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch#undef DECLARE_PREDICATE 205257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 206257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch // Declare virtual predicates for instructions that don't have 207257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch // an opcode. 208257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch virtual bool IsGap() const { return false; } 209b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch 210b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch virtual bool IsControl() const { return false; } 211b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 212b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch // Try deleting this instruction if possible. 213b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch virtual bool TryDelete() { return false; } 214b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2151e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block void set_environment(LEnvironment* env) { environment_ = env; } 2161e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block LEnvironment* environment() const { return environment_; } 2171e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block bool HasEnvironment() const { return environment_ != NULL; } 218b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 219b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } 220b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LPointerMap* pointer_map() const { return pointer_map_.get(); } 221b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch bool HasPointerMap() const { return pointer_map_.is_set(); } 222b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 223b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } 224b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch HValue* hydrogen_value() const { return hydrogen_value_; } 225b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 226b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } 227b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch bool IsCall() const { return IsCallBits::decode(bit_field_); } 2281e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 2291b268ca467c924004286c97bac133db489cf43d0Ben Murdoch void MarkAsSyntacticTailCall() { 2301b268ca467c924004286c97bac133db489cf43d0Ben Murdoch bit_field_ = IsSyntacticTailCallBits::update(bit_field_, true); 2311b268ca467c924004286c97bac133db489cf43d0Ben Murdoch } 2321b268ca467c924004286c97bac133db489cf43d0Ben Murdoch bool IsSyntacticTailCall() const { 2331b268ca467c924004286c97bac133db489cf43d0Ben Murdoch return IsSyntacticTailCallBits::decode(bit_field_); 2341b268ca467c924004286c97bac133db489cf43d0Ben Murdoch } 2351b268ca467c924004286c97bac133db489cf43d0Ben Murdoch 2361e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block // Interface to the register allocator and iterators. 237b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch bool ClobbersTemps() const { return IsCall(); } 238b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch bool ClobbersRegisters() const { return IsCall(); } 239b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch virtual bool ClobbersDoubleRegisters(Isolate* isolate) const { 240b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch return IsCall(); 241b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 2421e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 2431e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block virtual bool HasResult() const = 0; 244b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch virtual LOperand* result() const = 0; 2451e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 246b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch bool HasDoubleRegisterResult(); 247b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch bool HasDoubleRegisterInput(); 2481e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 2491e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block LOperand* FirstInput() { return InputAt(0); } 2501e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block LOperand* Output() { return HasResult() ? result() : NULL; } 2511e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 252b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } 253b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2541e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block#ifdef DEBUG 2551e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block void VerifyCall(); 2561e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block#endif 2571e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 258b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch virtual int InputCount() = 0; 259b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch virtual LOperand* InputAt(int i) = 0; 260b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 261b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch private: 262b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch // Iterator support. 263b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch friend class InputIterator; 264b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 265b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch friend class TempIterator; 266b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch virtual int TempCount() = 0; 267b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch virtual LOperand* TempAt(int i) = 0; 268b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 269b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch class IsCallBits: public BitField<bool, 0, 1> {}; 2701b268ca467c924004286c97bac133db489cf43d0Ben Murdoch class IsSyntacticTailCallBits : public BitField<bool, IsCallBits::kNext, 1> { 2711b268ca467c924004286c97bac133db489cf43d0Ben Murdoch }; 272b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2731e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block LEnvironment* environment_; 274b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch SetOncePointer<LPointerMap> pointer_map_; 275b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch HValue* hydrogen_value_; 276b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int bit_field_; 277b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 278b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 279b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2801e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block// R = number of result operands (0 or 1). 281b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdochtemplate<int R> 282b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdochclass LTemplateResultInstruction : public LInstruction { 283b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch public: 284b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch // Allow 0 or 1 output operands. 285b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch STATIC_ASSERT(R == 0 || R == 1); 286014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch bool HasResult() const final { return R != 0 && result() != NULL; } 287b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch void set_result(LOperand* operand) { results_[0] = operand; } 288014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* result() const override { return results_[0]; } 289b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch 290b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch protected: 291b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch EmbeddedContainer<LOperand*, R> results_; 292b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}; 293b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch 294b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch 295b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch// R = number of result operands (0 or 1). 296b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch// I = number of input operands. 297b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch// T = number of temporary operands. 298b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdochtemplate<int R, int I, int T> 299b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdochclass LTemplateInstruction : public LTemplateResultInstruction<R> { 300b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch protected: 3013fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch EmbeddedContainer<LOperand*, I> inputs_; 3023fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch EmbeddedContainer<LOperand*, T> temps_; 303b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 304b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch private: 305b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch // Iterator support. 306014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch int InputCount() final { return I; } 307014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* InputAt(int i) final { return inputs_[i]; } 308b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 309014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch int TempCount() final { return T; } 310014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* TempAt(int i) final { return temps_[i]; } 311b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 312b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 313b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 314b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdochclass LGap : public LTemplateInstruction<0, 0, 0> { 315b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 316257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch explicit LGap(HBasicBlock* block) : block_(block) { 317b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch parallel_moves_[BEFORE] = NULL; 318b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch parallel_moves_[START] = NULL; 319b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch parallel_moves_[END] = NULL; 320b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch parallel_moves_[AFTER] = NULL; 321b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch } 322b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 323257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch // Can't use the DECLARE-macro here because of sub-classes. 324014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch bool IsGap() const final { return true; } 325014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 326257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch static LGap* cast(LInstruction* instr) { 327b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DCHECK(instr->IsGap()); 328257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch return reinterpret_cast<LGap*>(instr); 329257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch } 330b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 331b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch bool IsRedundant() const; 332b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 333b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch HBasicBlock* block() const { return block_; } 334b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 335b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch enum InnerPosition { 336b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch BEFORE, 337b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch START, 338b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch END, 339b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch AFTER, 340b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch FIRST_INNER_POSITION = BEFORE, 341b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LAST_INNER_POSITION = AFTER 342b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch }; 343b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 344b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LParallelMove* GetOrCreateParallelMove(InnerPosition pos, Zone* zone) { 345b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch if (parallel_moves_[pos] == NULL) { 346b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch parallel_moves_[pos] = new(zone) LParallelMove(zone); 347b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 348b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch return parallel_moves_[pos]; 349b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch } 350b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 351b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LParallelMove* GetParallelMove(InnerPosition pos) { 352b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch return parallel_moves_[pos]; 353b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch } 354b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 355b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch private: 356b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; 357b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch HBasicBlock* block_; 358b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 359b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 360b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 361014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LInstructionGap final : public LGap { 362257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch public: 363257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } 364257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 365014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch bool HasInterestingComment(LCodeGen* gen) const override { 366b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch return !IsRedundant(); 367b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 368b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 369257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") 370257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch}; 371257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 372257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 373014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LGoto final : public LTemplateInstruction<0, 0, 0> { 374b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 375b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch explicit LGoto(HBasicBlock* block) : block_(block) { } 376b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 377014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch bool HasInterestingComment(LCodeGen* gen) const override; 378b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") 379014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 380014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch bool IsControl() const override { return true; } 381b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 382b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int block_id() const { return block_->block_id(); } 383014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch bool ClobbersDoubleRegisters(Isolate* isolate) const override { 384b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch return false; 385b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 386b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 387b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch bool jumps_to_join() const { return block_->predecessors()->length() > 1; } 388b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 389b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch private: 390b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch HBasicBlock* block_; 391b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 392b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 393b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 394014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LPrologue final : public LTemplateInstruction<0, 0, 0> { 395014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch public: 396014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(Prologue, "prologue") 397014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch}; 398014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch 399014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch 400014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LLazyBailout final : public LTemplateInstruction<0, 0, 0> { 401b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 402b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") 403b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 404b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 405b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 406014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LDummy final : public LTemplateInstruction<1, 0, 0> { 407b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 408b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LDummy() {} 409b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy") 410b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}; 411b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 412b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 413014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LDummyUse final : public LTemplateInstruction<1, 1, 0> { 414b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 415b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch explicit LDummyUse(LOperand* value) { 416b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = value; 417b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 418b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use") 419b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}; 420b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 421b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 422014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LDeoptimize final : public LTemplateInstruction<0, 0, 0> { 423b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 424014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch bool IsControl() const override { return true; } 425b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") 426b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(Deoptimize) 427b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 428b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 429b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 430014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LLabel final : public LGap { 431b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 432b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch explicit LLabel(HBasicBlock* block) 433b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch : LGap(block), replacement_(NULL) { } 434b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 435014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch bool HasInterestingComment(LCodeGen* gen) const override { return false; } 436b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(Label, "label") 437b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 438014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 439b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 440b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch int block_id() const { return block()->block_id(); } 441b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch bool is_loop_header() const { return block()->IsLoopHeader(); } 442b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch bool is_osr_entry() const { return block()->is_osr_entry(); } 443b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch Label* label() { return &label_; } 444b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LLabel* replacement() const { return replacement_; } 445b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch void set_replacement(LLabel* label) { replacement_ = label; } 446b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch bool HasReplacement() const { return replacement_ != NULL; } 447b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 448b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch private: 449b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch Label label_; 450b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LLabel* replacement_; 451b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 452b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 453b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 454014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LParameter final : public LTemplateInstruction<1, 0, 0> { 455b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 456014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch bool HasInterestingComment(LCodeGen* gen) const override { return false; } 457b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") 458b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 459b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 460b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 461014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LUnknownOSRValue final : public LTemplateInstruction<1, 0, 0> { 462b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 463014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch bool HasInterestingComment(LCodeGen* gen) const override { return false; } 464b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") 465b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 466b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 467b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 4681e0659c275bb392c045087af4f6b0d7565cb3d77Steve Blocktemplate<int I, int T> 469b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdochclass LControlInstruction: public LTemplateInstruction<0, I, T> { 470b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 471b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LControlInstruction() : false_label_(NULL), true_label_(NULL) { } 472b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 473014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch bool IsControl() const final { return true; } 474b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 4753fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch int SuccessorCount() { return hydrogen()->SuccessorCount(); } 4763fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); } 477b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 478b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int TrueDestination(LChunk* chunk) { 479b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch return chunk->LookupDestination(true_block_id()); 480b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 481b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int FalseDestination(LChunk* chunk) { 482b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch return chunk->LookupDestination(false_block_id()); 483b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 484b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 485b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch Label* TrueLabel(LChunk* chunk) { 486b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch if (true_label_ == NULL) { 487b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch true_label_ = chunk->GetAssemblyLabel(TrueDestination(chunk)); 488b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 489b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch return true_label_; 490b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 491b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch Label* FalseLabel(LChunk* chunk) { 492b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch if (false_label_ == NULL) { 493b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch false_label_ = chunk->GetAssemblyLabel(FalseDestination(chunk)); 494b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 495b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch return false_label_; 496b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 497b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 498b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch protected: 499b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int true_block_id() { return SuccessorAt(0)->block_id(); } 500b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int false_block_id() { return SuccessorAt(1)->block_id(); } 501b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 502b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch private: 5033fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch HControlInstruction* hydrogen() { 5043fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch return HControlInstruction::cast(this->hydrogen_value()); 5053fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch } 506b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 507b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch Label* false_label_; 508b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch Label* true_label_; 509b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 510b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 511b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 512014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LWrapReceiver final : public LTemplateInstruction<1, 2, 1> { 5133ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch public: 5143ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LWrapReceiver(LOperand* receiver, 5153ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LOperand* function, 5163ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LOperand* temp) { 5173ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch inputs_[0] = receiver; 5183ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch inputs_[1] = function; 5193ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch temps_[0] = temp; 5203ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch } 5213ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 5223ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LOperand* receiver() { return inputs_[0]; } 5233ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LOperand* function() { return inputs_[1]; } 524b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 525b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 526b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver") 527b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(WrapReceiver) 5283ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch}; 5293ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 5303ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 531014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LApplyArguments final : public LTemplateInstruction<1, 4, 0> { 532b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 533b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LApplyArguments(LOperand* function, 534b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LOperand* receiver, 535b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LOperand* length, 5363ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LOperand* elements) { 537b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = function; 538b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[1] = receiver; 539b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[2] = length; 540b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[3] = elements; 541b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 542b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 543b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LOperand* function() { return inputs_[0]; } 544b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LOperand* receiver() { return inputs_[1]; } 545b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LOperand* length() { return inputs_[2]; } 546b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LOperand* elements() { return inputs_[3]; } 547b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 548b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments") 5491b268ca467c924004286c97bac133db489cf43d0Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(ApplyArguments) 550b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 551b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 552b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 553014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LAccessArgumentsAt final : public LTemplateInstruction<1, 3, 0> { 554b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 555b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index) { 556b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = arguments; 557b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[1] = length; 558b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[2] = index; 559b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 560b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 561b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LOperand* arguments() { return inputs_[0]; } 562b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LOperand* length() { return inputs_[1]; } 563b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LOperand* index() { return inputs_[2]; } 564b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 565b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at") 566b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 567014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 568b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 569b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 570b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 571014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LArgumentsLength final : public LTemplateInstruction<1, 1, 0> { 572b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 573b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch explicit LArgumentsLength(LOperand* elements) { 574b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = elements; 575b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 576b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 577b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* elements() { return inputs_[0]; } 578b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 579b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length") 580b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 581b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 582b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 583014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LArgumentsElements final : public LTemplateInstruction<1, 0, 0> { 584b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 585b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements") 586b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(ArgumentsElements) 587b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 588b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 589b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 590014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LDebugBreak final : public LTemplateInstruction<0, 0, 0> { 591b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 592b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(DebugBreak, "break") 593b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}; 594b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 595b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 596014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LModByPowerOf2I final : public LTemplateInstruction<1, 1, 0> { 597b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 598b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LModByPowerOf2I(LOperand* dividend, int32_t divisor) { 599b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = dividend; 600b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch divisor_ = divisor; 601b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 602b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 603b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* dividend() { return inputs_[0]; } 604b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int32_t divisor() const { return divisor_; } 605b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 606b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(ModByPowerOf2I, "mod-by-power-of-2-i") 607b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(Mod) 608b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 609b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch private: 610b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int32_t divisor_; 611b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 612b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 613b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 614014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LModByConstI final : public LTemplateInstruction<1, 1, 2> { 615b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 616b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LModByConstI(LOperand* dividend, 617b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int32_t divisor, 618b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp1, 619b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp2) { 620b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = dividend; 621b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch divisor_ = divisor; 622b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[0] = temp1; 623b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[1] = temp2; 624b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 625b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 626b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* dividend() { return inputs_[0]; } 627b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int32_t divisor() const { return divisor_; } 628b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp1() { return temps_[0]; } 629b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp2() { return temps_[1]; } 630b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 631b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(ModByConstI, "mod-by-const-i") 632b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(Mod) 633b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 634b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch private: 635b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int32_t divisor_; 636b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 637b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 638b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 639014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LModI final : public LTemplateInstruction<1, 2, 1> { 640b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 641b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LModI(LOperand* left, LOperand* right, LOperand* temp) { 642b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = left; 643b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[1] = right; 644b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch temps_[0] = temp; 645b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 646b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 647b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* left() { return inputs_[0]; } 648b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* right() { return inputs_[1]; } 649b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 650b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 651b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i") 652b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(Mod) 653b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 654b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 655b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 656014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LDivByPowerOf2I final : public LTemplateInstruction<1, 1, 0> { 657b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 658b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LDivByPowerOf2I(LOperand* dividend, int32_t divisor) { 659b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = dividend; 660b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch divisor_ = divisor; 661b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 662b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 663b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* dividend() { return inputs_[0]; } 664b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int32_t divisor() const { return divisor_; } 665b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 666b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(DivByPowerOf2I, "div-by-power-of-2-i") 667b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(Div) 668b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 669b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch private: 670b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int32_t divisor_; 671b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 672b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 673b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 674014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LDivByConstI final : public LTemplateInstruction<1, 1, 2> { 675b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 676b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LDivByConstI(LOperand* dividend, 677b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int32_t divisor, 678b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp1, 679b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp2) { 680b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = dividend; 681b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch divisor_ = divisor; 682b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[0] = temp1; 683b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[1] = temp2; 684b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 685b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 686b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* dividend() { return inputs_[0]; } 687b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int32_t divisor() const { return divisor_; } 688b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp1() { return temps_[0]; } 689b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp2() { return temps_[1]; } 6903fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch 691b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i") 692b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(Div) 693b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 694b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch private: 695b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int32_t divisor_; 696b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 697b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 698b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 699014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LDivI final : public LTemplateInstruction<1, 2, 1> { 7003ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch public: 701b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) { 702b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = dividend; 703b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[1] = divisor; 7043ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch temps_[0] = temp; 7053ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch } 7063ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 707b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* dividend() { return inputs_[0]; } 708b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* divisor() { return inputs_[1]; } 7093ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LOperand* temp() { return temps_[0]; } 7103ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 711b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") 712b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(BinaryOperation) 7133ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch}; 7143ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 7153ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 716014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LFlooringDivByPowerOf2I final : public LTemplateInstruction<1, 1, 0> { 717b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 718b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LFlooringDivByPowerOf2I(LOperand* dividend, int32_t divisor) { 719b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = dividend; 720b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch divisor_ = divisor; 721b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 722b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 723b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* dividend() { return inputs_[0]; } 724b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int32_t divisor() const { return divisor_; } 725b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 726b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I, 727b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch "flooring-div-by-power-of-2-i") 728b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) 729b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 730b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch private: 731b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int32_t divisor_; 732b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 733b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 734b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 735014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LFlooringDivByConstI final : public LTemplateInstruction<1, 1, 3> { 736257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch public: 737b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LFlooringDivByConstI(LOperand* dividend, 738b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int32_t divisor, 739b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp1, 740b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp2, 741b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp3) { 742b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = dividend; 743b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch divisor_ = divisor; 744b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[0] = temp1; 745b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[1] = temp2; 746b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[2] = temp3; 747257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch } 748257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 749b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* dividend() { return inputs_[0]; } 750b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int32_t divisor() const { return divisor_; } 751b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp1() { return temps_[0]; } 752b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp2() { return temps_[1]; } 753b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp3() { return temps_[2]; } 754b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 755b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i") 756b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) 757b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 758b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch private: 759b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int32_t divisor_; 760b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 761b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 762b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 763014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LFlooringDivI final : public LTemplateInstruction<1, 2, 1> { 764b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 765b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LFlooringDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) { 766b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = dividend; 767b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[1] = divisor; 768b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch temps_[0] = temp; 769b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 770b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 771b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* dividend() { return inputs_[0]; } 772b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* divisor() { return inputs_[1]; } 773b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 774b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 775b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(FlooringDivI, "flooring-div-i") 776b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) 777b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 778b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 779b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 780014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LMulI final : public LTemplateInstruction<1, 2, 1> { 781b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 782b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LMulI(LOperand* left, LOperand* right, LOperand* temp) { 783b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = left; 784b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[1] = right; 785b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch temps_[0] = temp; 786b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 787b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 788b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* left() { return inputs_[0]; } 789b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* right() { return inputs_[1]; } 790b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 791b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 792b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i") 793b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(Mul) 794b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 795b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 796b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 797014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LCompareNumericAndBranch final : public LControlInstruction<2, 0> { 7983ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch public: 799b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LCompareNumericAndBranch(LOperand* left, LOperand* right) { 800b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = left; 801b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[1] = right; 8023ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch } 8033ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 804b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* left() { return inputs_[0]; } 805b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* right() { return inputs_[1]; } 806b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 807b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch, 808b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch "compare-numeric-and-branch") 809b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch) 810b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 811b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch Token::Value op() const { return hydrogen()->token(); } 812b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch bool is_double() const { 813b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch return hydrogen()->representation().IsDouble(); 814b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 8153ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 816014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 8173ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch}; 8183ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 8191b268ca467c924004286c97bac133db489cf43d0Ben Murdoch// Math.floor with a double result. 8201b268ca467c924004286c97bac133db489cf43d0Ben Murdochclass LMathFloorD final : public LTemplateInstruction<1, 1, 0> { 8211b268ca467c924004286c97bac133db489cf43d0Ben Murdoch public: 8221b268ca467c924004286c97bac133db489cf43d0Ben Murdoch explicit LMathFloorD(LOperand* value) { inputs_[0] = value; } 8231b268ca467c924004286c97bac133db489cf43d0Ben Murdoch 8241b268ca467c924004286c97bac133db489cf43d0Ben Murdoch LOperand* value() { return inputs_[0]; } 8253ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 8261b268ca467c924004286c97bac133db489cf43d0Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(MathFloorD, "math-floor-d") 8271b268ca467c924004286c97bac133db489cf43d0Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) 8281b268ca467c924004286c97bac133db489cf43d0Ben Murdoch}; 8291b268ca467c924004286c97bac133db489cf43d0Ben Murdoch 8301b268ca467c924004286c97bac133db489cf43d0Ben Murdoch// Math.floor with an integer result. 8311b268ca467c924004286c97bac133db489cf43d0Ben Murdochclass LMathFloorI final : public LTemplateInstruction<1, 1, 0> { 832b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 8331b268ca467c924004286c97bac133db489cf43d0Ben Murdoch explicit LMathFloorI(LOperand* value) { inputs_[0] = value; } 834b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 835b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 836b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 8371b268ca467c924004286c97bac133db489cf43d0Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(MathFloorI, "math-floor-i") 838b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) 839b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 840b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 8411b268ca467c924004286c97bac133db489cf43d0Ben Murdoch// Math.round with a double result. 8421b268ca467c924004286c97bac133db489cf43d0Ben Murdochclass LMathRoundD final : public LTemplateInstruction<1, 1, 0> { 8431b268ca467c924004286c97bac133db489cf43d0Ben Murdoch public: 8441b268ca467c924004286c97bac133db489cf43d0Ben Murdoch explicit LMathRoundD(LOperand* value) { inputs_[0] = value; } 8451b268ca467c924004286c97bac133db489cf43d0Ben Murdoch 8461b268ca467c924004286c97bac133db489cf43d0Ben Murdoch LOperand* value() { return inputs_[0]; } 8471b268ca467c924004286c97bac133db489cf43d0Ben Murdoch 8481b268ca467c924004286c97bac133db489cf43d0Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(MathRoundD, "math-round-d") 8491b268ca467c924004286c97bac133db489cf43d0Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) 8501b268ca467c924004286c97bac133db489cf43d0Ben Murdoch}; 851b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 8521b268ca467c924004286c97bac133db489cf43d0Ben Murdoch// Math.round with an integer result. 8531b268ca467c924004286c97bac133db489cf43d0Ben Murdochclass LMathRoundI final : public LTemplateInstruction<1, 1, 1> { 854257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch public: 8551b268ca467c924004286c97bac133db489cf43d0Ben Murdoch LMathRoundI(LOperand* value, LOperand* temp) { 856257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch inputs_[0] = value; 857257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch temps_[0] = temp; 858257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch } 859257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 860b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 861b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 862257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 8631b268ca467c924004286c97bac133db489cf43d0Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(MathRoundI, "math-round-i") 864b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) 865257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch}; 866257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 867257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 868014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LMathFround final : public LTemplateInstruction<1, 1, 0> { 8693ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch public: 870b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch explicit LMathFround(LOperand* value) { inputs_[0] = value; } 8713ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 872b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 8733ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 874b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(MathFround, "math-fround") 8753ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch}; 8763ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 8773ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 878014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LMathAbs final : public LTemplateInstruction<1, 2, 0> { 879b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 880b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LMathAbs(LOperand* context, LOperand* value) { 881b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[1] = context; 882b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = value; 883b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 884b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 885b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* context() { return inputs_[1]; } 886b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 887b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 888b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs") 889b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) 890b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 891b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 892b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 893014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LMathLog final : public LTemplateInstruction<1, 1, 0> { 894e0cee9b3ed82e2391fd85d118aeaa4ea361c687dBen Murdoch public: 895b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch explicit LMathLog(LOperand* value) { 896e0cee9b3ed82e2391fd85d118aeaa4ea361c687dBen Murdoch inputs_[0] = value; 897e0cee9b3ed82e2391fd85d118aeaa4ea361c687dBen Murdoch } 898e0cee9b3ed82e2391fd85d118aeaa4ea361c687dBen Murdoch 899b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 900b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 901b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log") 902e0cee9b3ed82e2391fd85d118aeaa4ea361c687dBen Murdoch}; 903e0cee9b3ed82e2391fd85d118aeaa4ea361c687dBen Murdoch 904e0cee9b3ed82e2391fd85d118aeaa4ea361c687dBen Murdoch 905014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LMathClz32 final : public LTemplateInstruction<1, 1, 0> { 906b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 907b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch explicit LMathClz32(LOperand* value) { 908b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = value; 909b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 910b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 911b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 912b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 913b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(MathClz32, "math-clz32") 914b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 915b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 91621efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdochclass LMathCos final : public LTemplateInstruction<1, 1, 0> { 91721efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch public: 91821efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch explicit LMathCos(LOperand* value) { inputs_[0] = value; } 91921efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch 92021efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch LOperand* value() { return inputs_[0]; } 921b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 92221efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch DECLARE_CONCRETE_INSTRUCTION(MathCos, "math-cos") 92321efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch}; 92421efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch 92521efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdochclass LMathSin final : public LTemplateInstruction<1, 1, 0> { 9261e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block public: 92721efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch explicit LMathSin(LOperand* value) { inputs_[0] = value; } 92821efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch 92921efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch LOperand* value() { return inputs_[0]; } 93021efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch 93121efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch DECLARE_CONCRETE_INSTRUCTION(MathSin, "math-sin") 93221efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch}; 93321efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch 93421efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdochclass LMathExp final : public LTemplateInstruction<1, 1, 0> { 93521efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch public: 93621efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch explicit LMathExp(LOperand* value) { inputs_[0] = value; } 9371e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 938b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 939b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 940b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp") 9411e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block}; 9421e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 9431e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 944014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LMathSqrt final : public LTemplateInstruction<1, 1, 0> { 945b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 946b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch explicit LMathSqrt(LOperand* value) { 947b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = value; 948b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 949b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 950b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 951b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 952b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt") 953b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 954b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 955b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 956014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LMathPowHalf final : public LTemplateInstruction<1, 1, 1> { 957b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 958b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LMathPowHalf(LOperand* value, LOperand* temp) { 959b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = value; 960b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[0] = temp; 961b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 962b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 963b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 964b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 965b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 966b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half") 967b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}; 968b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 969b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 970014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LCmpObjectEqAndBranch final : public LControlInstruction<2, 0> { 971b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 972b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LCmpObjectEqAndBranch(LOperand* left, LOperand* right) { 973b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = left; 974b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[1] = right; 975b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 976b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 977b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* left() { return inputs_[0]; } 978b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* right() { return inputs_[1]; } 979b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 980b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch, "cmp-object-eq-and-branch") 981b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}; 982b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 983b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 984014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LCmpHoleAndBranch final : public LControlInstruction<1, 0> { 985b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 986b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch explicit LCmpHoleAndBranch(LOperand* object) { 987b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = object; 988b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 989b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 990b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* object() { return inputs_[0]; } 991b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 992b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(CmpHoleAndBranch, "cmp-hole-and-branch") 993b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(CompareHoleAndBranch) 994b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}; 995b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 996b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 997014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LIsStringAndBranch final : public LControlInstruction<1, 1> { 998b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 999b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LIsStringAndBranch(LOperand* value, LOperand* temp) { 1000b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = value; 1001b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[0] = temp; 1002b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 1003b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1004b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1005b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 1006b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1007b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch") 1008b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch) 1009b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1010014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 1011b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}; 1012b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1013b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1014014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LIsSmiAndBranch final : public LControlInstruction<1, 0> { 1015b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 1016b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch explicit LIsSmiAndBranch(LOperand* value) { 1017b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = value; 1018b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 1019b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1020b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1021b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1022b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") 1023b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch) 1024b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1025014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 1026b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}; 1027b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1028b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1029014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LIsUndetectableAndBranch final : public LControlInstruction<1, 1> { 1030b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 1031b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LIsUndetectableAndBranch(LOperand* value, LOperand* temp) { 1032b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = value; 1033b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[0] = temp; 1034b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 1035b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1036b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1037b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 1038b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1039b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch, 1040b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch "is-undetectable-and-branch") 1041b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch) 1042b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1043014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 1044b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}; 1045b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1046b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1047014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LStringCompareAndBranch final : public LControlInstruction<3, 0> { 1048b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 1049b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LStringCompareAndBranch(LOperand* context, LOperand* left, LOperand* right) { 1050b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = context; 1051b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[1] = left; 1052b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[2] = right; 1053b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 1054b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1055014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* context() { return inputs_[0]; } 1056b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* left() { return inputs_[1]; } 1057b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* right() { return inputs_[2]; } 1058b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1059b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch, 1060b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch "string-compare-and-branch") 1061b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch) 1062b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1063014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 1064b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1065b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch Token::Value op() const { return hydrogen()->token(); } 1066b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}; 1067b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1068b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1069014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LHasInstanceTypeAndBranch final : public LControlInstruction<1, 1> { 1070b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 1071b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LHasInstanceTypeAndBranch(LOperand* value, LOperand* temp) { 1072b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = value; 1073b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[0] = temp; 1074b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 1075b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1076b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1077b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 1078b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1079b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, 1080b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch "has-instance-type-and-branch") 1081b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch) 1082b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1083014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 1084b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}; 1085b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1086b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1087014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LGetCachedArrayIndex final : public LTemplateInstruction<1, 1, 0> { 1088b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 1089b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch explicit LGetCachedArrayIndex(LOperand* value) { 1090b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = value; 1091b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 1092b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1093b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1094b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1095b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index") 1096b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex) 1097b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}; 1098b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1099b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1100014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LHasCachedArrayIndexAndBranch final : public LControlInstruction<1, 0> { 1101b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 1102b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch explicit LHasCachedArrayIndexAndBranch(LOperand* value) { 1103b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = value; 1104b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 1105b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1106b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1107b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1108b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, 1109b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch "has-cached-array-index-and-branch") 1110b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1111014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 1112b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}; 1113b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1114b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1115014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LClassOfTestAndBranch final : public LControlInstruction<1, 2> { 1116b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 1117b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LClassOfTestAndBranch(LOperand* value, LOperand* temp, LOperand* temp2) { 1118b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = value; 1119b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[0] = temp; 1120b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[1] = temp2; 1121b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 1122b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1123b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1124b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 1125b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp2() { return temps_[1]; } 1126b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1127b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, 1128b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch "class-of-test-and-branch") 1129b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch) 1130b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1131014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 1132b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}; 1133b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1134b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1135014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LCmpT final : public LTemplateInstruction<1, 3, 0> { 1136b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 1137b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LCmpT(LOperand* context, LOperand* left, LOperand* right) { 1138b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = context; 1139b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[1] = left; 1140b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[2] = right; 1141b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1142b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1143b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t") 11443fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(CompareGeneric) 1145b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1146b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* context() { return inputs_[0]; } 1147b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch Token::Value op() const { return hydrogen()->token(); } 1148b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1149b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1150b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1151014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LHasInPrototypeChainAndBranch final : public LControlInstruction<2, 1> { 1152b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1153014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LHasInPrototypeChainAndBranch(LOperand* object, LOperand* prototype, 1154014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* scratch) { 1155014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch inputs_[0] = object; 1156014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch inputs_[1] = prototype; 1157014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch temps_[0] = scratch; 1158b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1159086aeeaae12517475c22695a200be45495516549Ben Murdoch 1160014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* object() const { return inputs_[0]; } 1161014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* prototype() const { return inputs_[1]; } 1162014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* scratch() const { return temps_[0]; } 1163b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1164014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(HasInPrototypeChainAndBranch, 1165014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch "has-in-prototype-chain-and-branch") 1166014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(HasInPrototypeChainAndBranch) 1167086aeeaae12517475c22695a200be45495516549Ben Murdoch}; 1168086aeeaae12517475c22695a200be45495516549Ben Murdoch 1169086aeeaae12517475c22695a200be45495516549Ben Murdoch 1170014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LBoundsCheck final : public LTemplateInstruction<0, 2, 0> { 1171b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1172b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LBoundsCheck(LOperand* index, LOperand* length) { 1173b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = index; 1174b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[1] = length; 1175b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1176b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1177b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LOperand* index() { return inputs_[0]; } 1178b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LOperand* length() { return inputs_[1]; } 1179b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1180b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check") 1181b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(BoundsCheck) 1182b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1183b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1184b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1185014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LBitI final : public LTemplateInstruction<1, 2, 0> { 1186b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 11873ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LBitI(LOperand* left, LOperand* right) { 1188b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = left; 1189b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[1] = right; 1190b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1191b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1192b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* left() { return inputs_[0]; } 1193b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* right() { return inputs_[1]; } 1194b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1195b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i") 11963ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch DECLARE_HYDROGEN_ACCESSOR(Bitwise) 1197b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1198b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch Token::Value op() const { return hydrogen()->op(); } 1199b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1200b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1201b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1202014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LShiftI final : public LTemplateInstruction<1, 2, 0> { 1203b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1204b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt) 1205b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch : op_(op), can_deopt_(can_deopt) { 1206b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = left; 1207b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[1] = right; 1208b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1209b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1210b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* left() { return inputs_[0]; } 1211b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* right() { return inputs_[1]; } 1212b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1213b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i") 1214b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1215b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch Token::Value op() const { return op_; } 1216b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch bool can_deopt() const { return can_deopt_; } 1217b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1218b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch private: 1219b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch Token::Value op_; 1220b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch bool can_deopt_; 1221b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1222b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1223b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1224014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LSubI final : public LTemplateInstruction<1, 2, 0> { 1225b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1226b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LSubI(LOperand* left, LOperand* right) { 1227b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = left; 1228b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[1] = right; 1229b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1230b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1231b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* left() { return inputs_[0]; } 1232b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* right() { return inputs_[1]; } 1233b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1234b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i") 1235b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(Sub) 1236b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1237b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1238b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1239014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LConstantI final : public LTemplateInstruction<1, 0, 0> { 1240b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1241b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i") 12421e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block DECLARE_HYDROGEN_ACCESSOR(Constant) 1243b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 12441e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block int32_t value() const { return hydrogen()->Integer32Value(); } 1245b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1246b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1247b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1248014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LConstantS final : public LTemplateInstruction<1, 0, 0> { 1249b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 1250b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(ConstantS, "constant-s") 1251b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(Constant) 1252b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1253b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch Smi* value() const { return Smi::FromInt(hydrogen()->Integer32Value()); } 1254b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}; 1255b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1256b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1257014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LConstantD final : public LTemplateInstruction<1, 0, 1> { 1258b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 12591e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block explicit LConstantD(LOperand* temp) { 12601e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block temps_[0] = temp; 12611e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block } 1262b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1263b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 1264b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1265b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") 12661e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block DECLARE_HYDROGEN_ACCESSOR(Constant) 1267b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1268014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch uint64_t bits() const { return hydrogen()->DoubleValueAsBits(); } 1269b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1270b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1271b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1272014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LConstantE final : public LTemplateInstruction<1, 0, 0> { 1273b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1274b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e") 12751e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block DECLARE_HYDROGEN_ACCESSOR(Constant) 1276b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1277b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch ExternalReference value() const { 1278b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch return hydrogen()->ExternalReferenceValue(); 1279b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 1280b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1281b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1282b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1283014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LConstantT final : public LTemplateInstruction<1, 0, 0> { 1284b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1285b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") 1286b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(Constant) 1287b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1288b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch Handle<Object> value(Isolate* isolate) const { 1289b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch return hydrogen()->handle(isolate); 1290b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 1291b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1292b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1293b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1294014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LBranch final : public LControlInstruction<1, 1> { 1295b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1296b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LBranch(LOperand* value, LOperand* temp) { 1297b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = value; 1298b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[0] = temp; 1299b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1300b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1301b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1302b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 1303b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1304b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") 1305b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(Branch) 1306b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1307014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 1308b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1309b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1310b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1311014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LCmpMapAndBranch final : public LControlInstruction<1, 0> { 1312b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1313b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch explicit LCmpMapAndBranch(LOperand* value) { 1314b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = value; 1315b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1316b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1317b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1318b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1319b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") 1320b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(CompareMap) 13219fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 1322b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch Handle<Map> map() const { return hydrogen()->map().handle(); } 1323b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1324b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1325b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1326014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LSeqStringGetChar final : public LTemplateInstruction<1, 2, 0> { 1327b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1328b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LSeqStringGetChar(LOperand* string, LOperand* index) { 1329b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = string; 1330b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[1] = index; 1331b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1332b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1333b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* string() const { return inputs_[0]; } 1334b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* index() const { return inputs_[1]; } 13353fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch 1336b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(SeqStringGetChar, "seq-string-get-char") 1337b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(SeqStringGetChar) 1338b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1339b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1340b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1341014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LSeqStringSetChar final : public LTemplateInstruction<1, 4, 0> { 1342b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1343b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LSeqStringSetChar(LOperand* context, 1344b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* string, 1345b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* index, 1346b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value) { 1347b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = context; 1348b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[1] = string; 1349b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[2] = index; 1350b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[3] = value; 1351b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1352b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1353b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* string() { return inputs_[1]; } 1354b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* index() { return inputs_[2]; } 1355b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[3]; } 1356b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1357b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(SeqStringSetChar, "seq-string-set-char") 1358b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(SeqStringSetChar) 1359b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1360b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1361b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1362014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LAddI final : public LTemplateInstruction<1, 2, 0> { 1363b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1364b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LAddI(LOperand* left, LOperand* right) { 1365b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = left; 1366b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[1] = right; 1367b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1368b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1369b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* left() { return inputs_[0]; } 1370b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* right() { return inputs_[1]; } 1371b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1372b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch static bool UseLea(HAdd* add) { 1373b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch return !add->CheckFlag(HValue::kCanOverflow) && 1374b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch add->BetterLeftOperand()->UseCount() > 1; 1375b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 1376b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1377b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i") 1378b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(Add) 1379b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1380b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1381b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1382014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LMathMinMax final : public LTemplateInstruction<1, 2, 0> { 1383b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1384b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LMathMinMax(LOperand* left, LOperand* right) { 1385b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = left; 1386b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[1] = right; 1387b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1388b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1389b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* left() { return inputs_[0]; } 1390b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* right() { return inputs_[1]; } 1391b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1392b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "math-min-max") 1393b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(MathMinMax) 1394b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1395b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1396b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1397014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LPower final : public LTemplateInstruction<1, 2, 0> { 13983ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch public: 1399b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LPower(LOperand* left, LOperand* right) { 1400b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = left; 1401b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[1] = right; 14023ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch } 14033ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 1404b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* left() { return inputs_[0]; } 1405b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* right() { return inputs_[1]; } 1406b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1407b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(Power, "power") 1408b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(Power) 14093ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch}; 14103ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 14113ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 1412014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LArithmeticD final : public LTemplateInstruction<1, 2, 0> { 1413b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1414b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LArithmeticD(Token::Value op, LOperand* left, LOperand* right) 1415b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch : op_(op) { 1416b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = left; 1417b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[1] = right; 1418b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1419b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1420b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* left() { return inputs_[0]; } 1421b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* right() { return inputs_[1]; } 1422b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1423b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch Token::Value op() const { return op_; } 1424b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1425014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch Opcode opcode() const override { return LInstruction::kArithmeticD; } 1426014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void CompileToNative(LCodeGen* generator) override; 1427014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch const char* Mnemonic() const override; 1428b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1429b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch private: 1430b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch Token::Value op_; 1431b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1432b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1433b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1434014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LArithmeticT final : public LTemplateInstruction<1, 3, 0> { 1435b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 14363fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LArithmeticT(Token::Value op, 14373fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LOperand* context, 14383fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LOperand* left, 14393fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LOperand* right) 1440b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch : op_(op) { 14413fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch inputs_[0] = context; 14423fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch inputs_[1] = left; 14433fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch inputs_[2] = right; 1444b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1445b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 14463fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LOperand* context() { return inputs_[0]; } 14473fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LOperand* left() { return inputs_[1]; } 14483fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LOperand* right() { return inputs_[2]; } 1449014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch Token::Value op() const { return op_; } 1450b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1451014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch Opcode opcode() const override { return LInstruction::kArithmeticT; } 1452014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void CompileToNative(LCodeGen* generator) override; 1453014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch const char* Mnemonic() const override; 1454b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1455014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(BinaryOperation) 1456014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch 1457b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch private: 1458b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch Token::Value op_; 1459b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1460b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1461b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1462014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LReturn final : public LTemplateInstruction<0, 3, 0> { 1463b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1464b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch explicit LReturn(LOperand* value, 1465b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* context, 1466b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* parameter_count) { 1467b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = value; 1468b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[1] = context; 1469b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[2] = parameter_count; 1470b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 1471b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1472b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch bool has_constant_parameter_count() { 1473b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch return parameter_count()->IsConstantOperand(); 1474b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1475b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LConstantOperand* constant_parameter_count() { 1476b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DCHECK(has_constant_parameter_count()); 1477b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch return LConstantOperand::cast(parameter_count()); 1478b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 1479b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* parameter_count() { return inputs_[2]; } 1480b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1481b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(Return, "return") 1482b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(Return) 1483b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1484b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1485b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1486014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LLoadNamedField final : public LTemplateInstruction<1, 1, 0> { 1487b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1488b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch explicit LLoadNamedField(LOperand* object) { 1489b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = object; 1490b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1491b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1492b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* object() { return inputs_[0]; } 1493b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1494b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") 1495b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) 149644f0eee88ff00398ff7f715fab053374d808c90dSteve Block}; 149744f0eee88ff00398ff7f715fab053374d808c90dSteve Block 149844f0eee88ff00398ff7f715fab053374d808c90dSteve Block 1499014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LLoadNamedGeneric final : public LTemplateInstruction<1, 2, 1> { 150044f0eee88ff00398ff7f715fab053374d808c90dSteve Block public: 1501b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LLoadNamedGeneric(LOperand* context, LOperand* object, LOperand* vector) { 15023fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch inputs_[0] = context; 15033fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch inputs_[1] = object; 1504b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[0] = vector; 150544f0eee88ff00398ff7f715fab053374d808c90dSteve Block } 150644f0eee88ff00398ff7f715fab053374d808c90dSteve Block 15073fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LOperand* context() { return inputs_[0]; } 15083fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LOperand* object() { return inputs_[1]; } 1509b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp_vector() { return temps_[0]; } 1510b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1511b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic") 1512b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric) 1513b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1514b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch Handle<Object> name() const { return hydrogen()->name(); } 1515b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1516b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1517b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1518014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LLoadFunctionPrototype final : public LTemplateInstruction<1, 1, 1> { 15199fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block public: 1520b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LLoadFunctionPrototype(LOperand* function, LOperand* temp) { 1521b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = function; 1522b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch temps_[0] = temp; 1523b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 15249fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 1525b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LOperand* function() { return inputs_[0]; } 1526b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 1527b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1528b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype") 1529b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype) 1530b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1531b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1532b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1533014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LLoadRoot final : public LTemplateInstruction<1, 0, 0> { 15341e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block public: 1535b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(LoadRoot, "load-root") 1536b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(LoadRoot) 15371e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 1538b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch Heap::RootListIndex index() const { return hydrogen()->index(); } 15391e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block}; 15401e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 15411e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 1542014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LLoadKeyed final : public LTemplateInstruction<1, 3, 0> { 1543b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1544014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LLoadKeyed(LOperand* elements, LOperand* key, LOperand* backing_store_owner) { 1545b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = elements; 1546b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[1] = key; 1547014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch inputs_[2] = backing_store_owner; 1548b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1549b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LOperand* elements() { return inputs_[0]; } 1550b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LOperand* key() { return inputs_[1]; } 1551014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* backing_store_owner() { return inputs_[2]; } 1552b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch ElementsKind elements_kind() const { 1553b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch return hydrogen()->elements_kind(); 15543fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch } 1555b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch bool is_fixed_typed_array() const { 1556b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch return hydrogen()->is_fixed_typed_array(); 1557b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 1558b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1559b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") 1560b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) 1561b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1562014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 1563b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch uint32_t base_offset() const { return hydrogen()->base_offset(); } 1564b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch bool key_is_smi() { 1565b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch return hydrogen()->key()->representation().IsTagged(); 156644f0eee88ff00398ff7f715fab053374d808c90dSteve Block } 1567b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1568b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1569b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1570b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdochinline static bool ExternalArrayOpRequiresTemp( 1571b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch Representation key_representation, 1572b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch ElementsKind elements_kind) { 1573b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch // Operations that require the key to be divided by two to be converted into 1574b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch // an index cannot fold the scale operation into a load and need an extra 1575b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch // temp register to do the work. 1576b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch return key_representation.IsSmi() && 1577014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch (elements_kind == UINT8_ELEMENTS || elements_kind == INT8_ELEMENTS || 1578014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch elements_kind == UINT8_CLAMPED_ELEMENTS); 1579b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch} 1580b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1581b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1582014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LLoadKeyedGeneric final : public LTemplateInstruction<1, 3, 1> { 15831e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block public: 1584b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key, 1585b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* vector) { 15861e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block inputs_[0] = context; 15871e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block inputs_[1] = obj; 15881e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block inputs_[2] = key; 1589b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[0] = vector; 15901e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block } 15911e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 15921e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block LOperand* context() { return inputs_[0]; } 15931e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block LOperand* object() { return inputs_[1]; } 15941e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block LOperand* key() { return inputs_[2]; } 1595b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp_vector() { return temps_[0]; } 1596b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1597b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic") 1598b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(LoadKeyedGeneric) 15991e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block}; 16001e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 160121efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdochclass LLoadGlobalGeneric final : public LTemplateInstruction<1, 1, 1> { 1602b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 160321efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch LLoadGlobalGeneric(LOperand* context, LOperand* vector) { 16048b112d2025046f85ef7f6be087c6129c872ebad2Ben Murdoch inputs_[0] = context; 1605b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[0] = vector; 16068b112d2025046f85ef7f6be087c6129c872ebad2Ben Murdoch } 16078b112d2025046f85ef7f6be087c6129c872ebad2Ben Murdoch 1608b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* context() { return inputs_[0]; } 1609b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp_vector() { return temps_[0]; } 1610b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 16118b112d2025046f85ef7f6be087c6129c872ebad2Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic") 16128b112d2025046f85ef7f6be087c6129c872ebad2Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric) 16138b112d2025046f85ef7f6be087c6129c872ebad2Ben Murdoch 16148b112d2025046f85ef7f6be087c6129c872ebad2Ben Murdoch Handle<Object> name() const { return hydrogen()->name(); } 1615014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch TypeofMode typeof_mode() const { return hydrogen()->typeof_mode(); } 1616b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1617b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1618b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1619014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LLoadContextSlot final : public LTemplateInstruction<1, 1, 0> { 1620b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 16211e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block explicit LLoadContextSlot(LOperand* context) { 16221e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block inputs_[0] = context; 16231e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block } 16241e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 1625b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* context() { return inputs_[0]; } 1626b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1627b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") 1628b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) 1629b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch 1630b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch int slot_index() { return hydrogen()->slot_index(); } 1631b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch 1632014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 1633b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch}; 1634b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch 1635b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch 1636014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LStoreContextSlot final : public LTemplateInstruction<0, 2, 1> { 16371e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block public: 16381e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block LStoreContextSlot(LOperand* context, LOperand* value, LOperand* temp) { 16391e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block inputs_[0] = context; 16401e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block inputs_[1] = value; 16411e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block temps_[0] = temp; 16421e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block } 16431e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 1644b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* context() { return inputs_[0]; } 1645b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[1]; } 1646b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 1647b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 16481e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot") 16491e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot) 16501e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 16511e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block int slot_index() { return hydrogen()->slot_index(); } 16521e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 1653014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 16541e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block}; 16551e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 16561e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 1657014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LPushArgument final : public LTemplateInstruction<0, 1, 0> { 1658b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch public: 1659b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch explicit LPushArgument(LOperand* value) { 1660b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = value; 1661b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1662b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1663b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1664b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1665b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") 1666b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1667b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1668b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1669014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LDrop final : public LTemplateInstruction<0, 0, 0> { 16703ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch public: 1671b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch explicit LDrop(int count) : count_(count) { } 1672b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1673b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int count() const { return count_; } 1674b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1675b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(Drop, "drop") 1676b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1677b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch private: 1678b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int count_; 16793fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch}; 16803fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch 16813fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch 1682014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LStoreCodeEntry final : public LTemplateInstruction<0, 2, 0> { 16831e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block public: 1684b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LStoreCodeEntry(LOperand* function, LOperand* code_object) { 1685b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = function; 1686b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[1] = code_object; 1687b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 1688b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1689b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* function() { return inputs_[0]; } 1690b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* code_object() { return inputs_[1]; } 1691b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1692014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 1693b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1694b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry, "store-code-entry") 1695b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(StoreCodeEntry) 16961e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block}; 16971e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 16981e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 1699014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LInnerAllocatedObject final : public LTemplateInstruction<1, 2, 0> { 1700b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1701b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInnerAllocatedObject(LOperand* base_object, LOperand* offset) { 1702b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = base_object; 1703b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[1] = offset; 17041e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block } 17051e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 1706b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* base_object() const { return inputs_[0]; } 1707b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* offset() const { return inputs_[1]; } 1708b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1709014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 17101e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 1711b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject, "inner-allocated-object") 17121e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block}; 17131e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 17141e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 1715014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LThisFunction final : public LTemplateInstruction<1, 0, 0> { 1716b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 1717b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function") 1718b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(ThisFunction) 1719b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}; 1720b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1721b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1722014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LContext final : public LTemplateInstruction<1, 0, 0> { 1723b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 1724b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(Context, "context") 1725b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(Context) 1726b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}; 1727b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1728b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1729014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LDeclareGlobals final : public LTemplateInstruction<0, 1, 0> { 17303ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch public: 17313ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch explicit LDeclareGlobals(LOperand* context) { 17323ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch inputs_[0] = context; 17333ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch } 17343ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 1735b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* context() { return inputs_[0]; } 1736b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 17373ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals") 17383ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals) 17393ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch}; 17403ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 17413ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 1742014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LCallWithDescriptor final : public LTemplateResultInstruction<1> { 1743b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1744b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LCallWithDescriptor(CallInterfaceDescriptor descriptor, 1745b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch const ZoneList<LOperand*>& operands, Zone* zone) 1746014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch : inputs_(descriptor.GetRegisterParameterCount() + 1747014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch kImplicitRegisterParameterCount, 1748014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch zone) { 1749014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch DCHECK(descriptor.GetRegisterParameterCount() + 1750014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch kImplicitRegisterParameterCount == 1751014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch operands.length()); 1752b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_.AddAll(operands, zone); 17531e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block } 17541e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 1755b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* target() const { return inputs_[0]; } 1756b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1757b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor) 1758b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1759014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch // The target and context are passed as implicit parameters that are not 1760014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch // explicitly listed in the descriptor. 1761014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch static const int kImplicitRegisterParameterCount = 2; 1762014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch 1763b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch private: 1764b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor") 1765b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1766014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 1767b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1768b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch int arity() const { return hydrogen()->argument_count() - 1; } 1769b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1770b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch ZoneList<LOperand*> inputs_; 1771b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1772b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch // Iterator support. 1773014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch int InputCount() final { return inputs_.length(); } 1774014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* InputAt(int i) final { return inputs_[i]; } 1775b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1776014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch int TempCount() final { return 0; } 1777014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* TempAt(int i) final { return NULL; } 1778b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1779b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1780b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1781014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LInvokeFunction final : public LTemplateInstruction<1, 2, 0> { 1782257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch public: 1783257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch LInvokeFunction(LOperand* context, LOperand* function) { 1784257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch inputs_[0] = context; 1785257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch inputs_[1] = function; 1786257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch } 1787257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 1788257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch LOperand* context() { return inputs_[0]; } 1789257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch LOperand* function() { return inputs_[1]; } 1790257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 1791b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function") 1792b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(InvokeFunction) 1793b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1794014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 1795257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 1796257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch int arity() const { return hydrogen()->argument_count() - 1; } 1797257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch}; 1798257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 1799257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 1800014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LCallNewArray final : public LTemplateInstruction<1, 2, 0> { 1801b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1802b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LCallNewArray(LOperand* context, LOperand* constructor) { 18031e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block inputs_[0] = context; 1804b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[1] = constructor; 18051e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block } 18061e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 18071e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block LOperand* context() { return inputs_[0]; } 1808b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* constructor() { return inputs_[1]; } 1809b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1810b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(CallNewArray, "call-new-array") 1811b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(CallNewArray) 1812b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1813014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 1814b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 18153ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch int arity() const { return hydrogen()->argument_count() - 1; } 1816b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1817b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1818b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1819014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LCallRuntime final : public LTemplateInstruction<1, 1, 0> { 1820b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1821b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch explicit LCallRuntime(LOperand* context) { 18221e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block inputs_[0] = context; 18231e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block } 18241e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 18251e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block LOperand* context() { return inputs_[0]; } 1826b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1827b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") 1828b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(CallRuntime) 1829b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1830014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch bool ClobbersDoubleRegisters(Isolate* isolate) const override { 1831b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch return save_doubles() == kDontSaveFPRegs; 1832b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 1833b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1834b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch const Runtime::Function* function() const { return hydrogen()->function(); } 1835b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int arity() const { return hydrogen()->argument_count(); } 1836b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); } 1837b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1838b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1839b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1840014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LInteger32ToDouble final : public LTemplateInstruction<1, 1, 0> { 1841b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1842b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch explicit LInteger32ToDouble(LOperand* value) { 1843b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = value; 1844b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1845b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1846b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1847b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1848b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") 1849b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1850b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1851b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1852014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LUint32ToDouble final : public LTemplateInstruction<1, 1, 0> { 1853b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1854b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch explicit LUint32ToDouble(LOperand* value) { 1855b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = value; 18563fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch } 1857b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1858b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1859b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1860b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double") 1861b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1862b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1863b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1864014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LNumberTagI final : public LTemplateInstruction<1, 1, 1> { 1865b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1866b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LNumberTagI(LOperand* value, LOperand* temp) { 1867b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = value; 1868b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[0] = temp; 1869b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1870b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1871b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1872b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 1873b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1874b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i") 1875b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1876b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1877b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1878014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LNumberTagU final : public LTemplateInstruction<1, 1, 1> { 1879b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1880b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LNumberTagU(LOperand* value, LOperand* temp) { 1881b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = value; 1882b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[0] = temp; 1883b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1884b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1885b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1886b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 1887b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1888b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u") 1889b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1890b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1891b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1892014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LNumberTagD final : public LTemplateInstruction<1, 1, 1> { 1893b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 18941e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block LNumberTagD(LOperand* value, LOperand* temp) { 1895b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = value; 1896b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch temps_[0] = temp; 1897b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1898b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1899b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1900b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 1901b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1902b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") 1903b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(Change) 1904b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1905b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1906b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1907b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch// Sometimes truncating conversion from a tagged value to an int32. 1908014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LDoubleToI final : public LTemplateInstruction<1, 1, 1> { 1909b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1910b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LDoubleToI(LOperand* value, LOperand* temp) { 1911b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = value; 1912b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch temps_[0] = temp; 1913b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1914b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1915b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1916b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 1917b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1918b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") 19193fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) 1920b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1921b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch bool truncating() { return hydrogen()->CanTruncateToInt32(); } 1922b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1923b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1924b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1925014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LDoubleToSmi final : public LTemplateInstruction<1, 1, 0> { 1926b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 1927b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch explicit LDoubleToSmi(LOperand* value) { 1928b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = value; 1929b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 1930b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1931b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1932b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1933b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(DoubleToSmi, "double-to-smi") 1934b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) 1935b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}; 1936b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1937b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1938b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch// Truncating conversion from a tagged value to an int32. 1939014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LTaggedToI final : public LTemplateInstruction<1, 1, 1> { 1940b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1941b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LTaggedToI(LOperand* value, LOperand* temp) { 1942b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = value; 1943b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch temps_[0] = temp; 1944b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1945b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1946b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1947b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 1948b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1949b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") 1950b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(Change) 1951b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1952b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch bool truncating() { return hydrogen()->CanTruncateToInt32(); } 1953b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1954b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1955b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1956014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LSmiTag final : public LTemplateInstruction<1, 1, 0> { 1957b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1958b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch explicit LSmiTag(LOperand* value) { 1959b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = value; 1960b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1961b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1962b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1963b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1964b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") 1965b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(Change) 1966b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1967b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1968b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1969014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LNumberUntagD final : public LTemplateInstruction<1, 1, 1> { 1970b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 19713ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch explicit LNumberUntagD(LOperand* value, LOperand* temp) { 1972b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = value; 19733ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch temps_[0] = temp; 1974b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1975b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1976b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1977b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 1978b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1979b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") 19807d3e7fc4b65010eabe860313ee0c64f50843f6e3Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(Change); 1981b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 1982b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1983b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1984014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LSmiUntag final : public LTemplateInstruction<1, 1, 0> { 1985b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 1986b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LSmiUntag(LOperand* value, bool needs_check) 1987b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch : needs_check_(needs_check) { 1988b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = value; 1989b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 1990b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1991b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 1992b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 1993b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") 1994b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1995b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch bool needs_check() const { return needs_check_; } 1996b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 1997b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch private: 1998b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch bool needs_check_; 1999b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 2000b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2001b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2002014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LStoreNamedField final : public LTemplateInstruction<0, 2, 2> { 2003b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 2004b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LStoreNamedField(LOperand* obj, 2005b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* val, 2006b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp, 2007b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp_map) { 2008b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = obj; 2009b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[1] = val; 2010e0cee9b3ed82e2391fd85d118aeaa4ea361c687dBen Murdoch temps_[0] = temp; 2011b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[1] = temp_map; 2012b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 2013b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2014b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LOperand* object() { return inputs_[0]; } 2015b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LOperand* value() { return inputs_[1]; } 2016b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 2017b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp_map() { return temps_[1]; } 2018b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2019b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field") 2020b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(StoreNamedField) 2021b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2022014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 2023b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 2024b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2025b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2026014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LStoreNamedGeneric final : public LTemplateInstruction<0, 3, 2> { 2027b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 2028014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value, 2029014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* slot, LOperand* vector) { 20301e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block inputs_[0] = context; 20311e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block inputs_[1] = object; 20321e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block inputs_[2] = value; 2033014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch temps_[0] = slot; 2034014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch temps_[1] = vector; 20351e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block } 2036b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 20371e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block LOperand* context() { return inputs_[0]; } 20381e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block LOperand* object() { return inputs_[1]; } 20391e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block LOperand* value() { return inputs_[2]; } 2040014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* temp_slot() { return temps_[0]; } 2041014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* temp_vector() { return temps_[1]; } 2042b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2043b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") 2044b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) 2045b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2046014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 20471e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block Handle<Object> name() const { return hydrogen()->name(); } 2048014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LanguageMode language_mode() { return hydrogen()->language_mode(); } 2049b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 2050b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2051b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2052014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LStoreKeyed final : public LTemplateInstruction<0, 4, 0> { 2053b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 2054014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val, 2055014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* backing_store_owner) { 2056b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = obj; 2057b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[1] = key; 2058b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[2] = val; 2059014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch inputs_[3] = backing_store_owner; 2060b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 2061b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2062b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch bool is_fixed_typed_array() const { 2063b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch return hydrogen()->is_fixed_typed_array(); 20643fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch } 2065b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* elements() { return inputs_[0]; } 2066e0cee9b3ed82e2391fd85d118aeaa4ea361c687dBen Murdoch LOperand* key() { return inputs_[1]; } 2067e0cee9b3ed82e2391fd85d118aeaa4ea361c687dBen Murdoch LOperand* value() { return inputs_[2]; } 2068014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* backing_store_owner() { return inputs_[3]; } 2069589d6979ff2ef66fca2d8fa51404c369ca5e9250Ben Murdoch ElementsKind elements_kind() const { 20703fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch return hydrogen()->elements_kind(); 207144f0eee88ff00398ff7f715fab053374d808c90dSteve Block } 2072b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2073b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") 2074b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) 2075b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2076014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 2077b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch uint32_t base_offset() const { return hydrogen()->base_offset(); } 2078b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); } 2079b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 2080b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2081b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2082014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LStoreKeyedGeneric final : public LTemplateInstruction<0, 4, 2> { 2083b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 2084014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LStoreKeyedGeneric(LOperand* context, LOperand* object, LOperand* key, 2085014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* value, LOperand* slot, LOperand* vector) { 20861e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block inputs_[0] = context; 20871e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block inputs_[1] = object; 20881e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block inputs_[2] = key; 20891e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block inputs_[3] = value; 2090014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch temps_[0] = slot; 2091014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch temps_[1] = vector; 20921e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block } 2093b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 20941e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block LOperand* context() { return inputs_[0]; } 20951e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block LOperand* object() { return inputs_[1]; } 20961e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block LOperand* key() { return inputs_[2]; } 20971e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block LOperand* value() { return inputs_[3]; } 2098014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* temp_slot() { return temps_[0]; } 2099014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* temp_vector() { return temps_[1]; } 2100b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2101b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") 2102b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) 2103b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2104014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 2105b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2106014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LanguageMode language_mode() { return hydrogen()->language_mode(); } 21073ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch}; 21083ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 21093ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 2110014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LTransitionElementsKind final : public LTemplateInstruction<0, 2, 2> { 21113ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch public: 21123ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LTransitionElementsKind(LOperand* object, 2113b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* context, 21143ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LOperand* new_map_temp, 2115b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp) { 21163ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch inputs_[0] = object; 2117b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[1] = context; 21183ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch temps_[0] = new_map_temp; 2119b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[1] = temp; 21203ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch } 21213ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 2122b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* context() { return inputs_[1]; } 2123b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* object() { return inputs_[0]; } 2124b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* new_map_temp() { return temps_[0]; } 2125b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[1]; } 2126b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 21273ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind, 21283ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch "transition-elements-kind") 21293ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind) 21303ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 2131014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 2132b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2133b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch Handle<Map> original_map() { return hydrogen()->original_map().handle(); } 2134b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch Handle<Map> transitioned_map() { 2135b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch return hydrogen()->transitioned_map().handle(); 2136b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 2137b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch ElementsKind from_kind() { return hydrogen()->from_kind(); } 2138b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch ElementsKind to_kind() { return hydrogen()->to_kind(); } 2139b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}; 2140b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2141b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2142014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LTrapAllocationMemento final : public LTemplateInstruction<0, 1, 1> { 2143b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 2144b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LTrapAllocationMemento(LOperand* object, 2145b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp) { 2146b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = object; 2147b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[0] = temp; 2148b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch } 21493ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 21503ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LOperand* object() { return inputs_[0]; } 2151b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 2152b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2153b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento, 2154b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch "trap-allocation-memento") 21558b112d2025046f85ef7f6be087c6129c872ebad2Ben Murdoch}; 21568b112d2025046f85ef7f6be087c6129c872ebad2Ben Murdoch 21578b112d2025046f85ef7f6be087c6129c872ebad2Ben Murdoch 2158014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LMaybeGrowElements final : public LTemplateInstruction<1, 5, 0> { 2159014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch public: 2160014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LMaybeGrowElements(LOperand* context, LOperand* object, LOperand* elements, 2161014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* key, LOperand* current_capacity) { 2162014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch inputs_[0] = context; 2163014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch inputs_[1] = object; 2164014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch inputs_[2] = elements; 2165014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch inputs_[3] = key; 2166014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch inputs_[4] = current_capacity; 2167014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch } 2168014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch 2169014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* context() { return inputs_[0]; } 2170014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* object() { return inputs_[1]; } 2171014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* elements() { return inputs_[2]; } 2172014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* key() { return inputs_[3]; } 2173014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* current_capacity() { return inputs_[4]; } 2174014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch 2175014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(MaybeGrowElements) 2176014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(MaybeGrowElements, "maybe-grow-elements") 2177014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch}; 2178014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch 2179014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch 2180014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LStringAdd final : public LTemplateInstruction<1, 3, 0> { 2181257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch public: 21823fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LStringAdd(LOperand* context, LOperand* left, LOperand* right) { 21833fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch inputs_[0] = context; 21843fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch inputs_[1] = left; 21853fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch inputs_[2] = right; 2186257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch } 2187257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 21883fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LOperand* context() { return inputs_[0]; } 21893fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LOperand* left() { return inputs_[1]; } 21903fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LOperand* right() { return inputs_[2]; } 2191b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2192b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add") 2193b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(StringAdd) 2194257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch}; 2195257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 2196257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 2197014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LStringCharCodeAt final : public LTemplateInstruction<1, 3, 0> { 21981e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block public: 21993fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LStringCharCodeAt(LOperand* context, LOperand* string, LOperand* index) { 22003fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch inputs_[0] = context; 22013fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch inputs_[1] = string; 22023fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch inputs_[2] = index; 22031e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block } 22041e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 22053fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LOperand* context() { return inputs_[0]; } 22063fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LOperand* string() { return inputs_[1]; } 22073fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LOperand* index() { return inputs_[2]; } 2208b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2209b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at") 2210b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt) 22111e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block}; 22121e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 22131e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 2214014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LStringCharFromCode final : public LTemplateInstruction<1, 2, 0> { 221544f0eee88ff00398ff7f715fab053374d808c90dSteve Block public: 22163fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LStringCharFromCode(LOperand* context, LOperand* char_code) { 22173fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch inputs_[0] = context; 22183fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch inputs_[1] = char_code; 221944f0eee88ff00398ff7f715fab053374d808c90dSteve Block } 222044f0eee88ff00398ff7f715fab053374d808c90dSteve Block 22213fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LOperand* context() { return inputs_[0]; } 22223fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LOperand* char_code() { return inputs_[1]; } 22231e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 2224b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code") 2225b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode) 2226b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 2227b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2228b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2229014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LCheckValue final : public LTemplateInstruction<0, 1, 0> { 2230b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 2231b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch explicit LCheckValue(LOperand* value) { 2232b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = value; 2233b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 2234b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 22353ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LOperand* value() { return inputs_[0]; } 22363ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 2237b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(CheckValue, "check-value") 2238b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(CheckValue) 2239b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 2240b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2241b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2242014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LCheckArrayBufferNotNeutered final 2243014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch : public LTemplateInstruction<0, 1, 1> { 2244014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch public: 2245014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch explicit LCheckArrayBufferNotNeutered(LOperand* view, LOperand* scratch) { 2246014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch inputs_[0] = view; 2247014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch temps_[0] = scratch; 2248014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch } 2249014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch 2250014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* view() { return inputs_[0]; } 2251014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch LOperand* scratch() { return temps_[0]; } 2252014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch 2253014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(CheckArrayBufferNotNeutered, 2254014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch "check-array-buffer-not-neutered") 2255014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(CheckArrayBufferNotNeutered) 2256014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch}; 2257014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch 2258014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch 2259014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LCheckInstanceType final : public LTemplateInstruction<0, 1, 1> { 2260b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 2261b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch LCheckInstanceType(LOperand* value, LOperand* temp) { 2262b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = value; 2263b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch temps_[0] = temp; 2264b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 2265b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2266b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 2267b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 2268b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2269b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type") 2270b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType) 2271b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 2272b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2273b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2274014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LCheckMaps final : public LTemplateInstruction<0, 1, 0> { 2275b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 2276b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch explicit LCheckMaps(LOperand* value = NULL) { 2277b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = value; 2278b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 2279b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2280b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 2281b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2282b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps") 2283b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(CheckMaps) 2284b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 2285b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2286b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2287014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LCheckSmi final : public LTemplateInstruction<1, 1, 0> { 2288b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 228944f0eee88ff00398ff7f715fab053374d808c90dSteve Block explicit LCheckSmi(LOperand* value) { 2290b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = value; 2291b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 2292b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2293b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 2294b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 229544f0eee88ff00398ff7f715fab053374d808c90dSteve Block DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi") 229644f0eee88ff00398ff7f715fab053374d808c90dSteve Block}; 2297b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 229844f0eee88ff00398ff7f715fab053374d808c90dSteve Block 2299014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LClampDToUint8 final : public LTemplateInstruction<1, 1, 0> { 2300257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch public: 2301257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch explicit LClampDToUint8(LOperand* value) { 2302257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch inputs_[0] = value; 2303257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch } 2304257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 2305257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch LOperand* unclamped() { return inputs_[0]; } 2306257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 2307257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8") 2308257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch}; 2309257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 2310257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 2311014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LClampIToUint8 final : public LTemplateInstruction<1, 1, 0> { 2312257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch public: 2313257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch explicit LClampIToUint8(LOperand* value) { 2314257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch inputs_[0] = value; 2315257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch } 2316257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 2317257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch LOperand* unclamped() { return inputs_[0]; } 2318257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 2319257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8") 2320257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch}; 2321257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 2322257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 2323014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LClampTToUint8 final : public LTemplateInstruction<1, 1, 1> { 2324257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch public: 2325b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LClampTToUint8(LOperand* value, LOperand* temp_xmm) { 2326257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch inputs_[0] = value; 2327b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[0] = temp_xmm; 2328257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch } 2329257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 2330257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch LOperand* unclamped() { return inputs_[0]; } 2331b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp_xmm() { return temps_[0]; } 2332257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 2333257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8") 2334257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch}; 2335257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 2336257744e915dfc84d6d07a6b2accf8402d9ffc708Ben Murdoch 2337014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LCheckNonSmi final : public LTemplateInstruction<0, 1, 0> { 233844f0eee88ff00398ff7f715fab053374d808c90dSteve Block public: 233944f0eee88ff00398ff7f715fab053374d808c90dSteve Block explicit LCheckNonSmi(LOperand* value) { 234044f0eee88ff00398ff7f715fab053374d808c90dSteve Block inputs_[0] = value; 2341b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch } 2342b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2343b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 23443ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 2345b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi") 2346b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(CheckHeapObject) 23473ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch}; 23483ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 23493ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 2350014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LDoubleBits final : public LTemplateInstruction<1, 1, 0> { 23513ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch public: 2352b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch explicit LDoubleBits(LOperand* value) { 2353b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[0] = value; 23543ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch } 23553ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 2356b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 23573ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 2358b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(DoubleBits, "double-bits") 2359b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(DoubleBits) 23603ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch}; 23613ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 23623ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 2363014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LAllocate final : public LTemplateInstruction<1, 2, 1> { 2364592a9fc1d8ea420377a2e7efd0600e20b058be2bBen Murdoch public: 2365b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LAllocate(LOperand* context, LOperand* size, LOperand* temp) { 2366592a9fc1d8ea420377a2e7efd0600e20b058be2bBen Murdoch inputs_[0] = context; 2367b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch inputs_[1] = size; 2368b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch temps_[0] = temp; 2369592a9fc1d8ea420377a2e7efd0600e20b058be2bBen Murdoch } 2370592a9fc1d8ea420377a2e7efd0600e20b058be2bBen Murdoch 2371592a9fc1d8ea420377a2e7efd0600e20b058be2bBen Murdoch LOperand* context() { return inputs_[0]; } 2372b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* size() { return inputs_[1]; } 2373b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* temp() { return temps_[0]; } 2374592a9fc1d8ea420377a2e7efd0600e20b058be2bBen Murdoch 2375b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate") 2376b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch DECLARE_HYDROGEN_ACCESSOR(Allocate) 2377b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 2378b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2379537ba893e2530051ec7f296e769fdd37bb4ae4a0Ben Murdochclass LFastAllocate final : public LTemplateInstruction<1, 1, 1> { 2380537ba893e2530051ec7f296e769fdd37bb4ae4a0Ben Murdoch public: 2381537ba893e2530051ec7f296e769fdd37bb4ae4a0Ben Murdoch LFastAllocate(LOperand* size, LOperand* temp) { 2382537ba893e2530051ec7f296e769fdd37bb4ae4a0Ben Murdoch inputs_[0] = size; 2383537ba893e2530051ec7f296e769fdd37bb4ae4a0Ben Murdoch temps_[0] = temp; 2384537ba893e2530051ec7f296e769fdd37bb4ae4a0Ben Murdoch } 2385537ba893e2530051ec7f296e769fdd37bb4ae4a0Ben Murdoch 2386537ba893e2530051ec7f296e769fdd37bb4ae4a0Ben Murdoch LOperand* size() const { return inputs_[0]; } 2387537ba893e2530051ec7f296e769fdd37bb4ae4a0Ben Murdoch LOperand* temp() { return temps_[0]; } 2388537ba893e2530051ec7f296e769fdd37bb4ae4a0Ben Murdoch 2389537ba893e2530051ec7f296e769fdd37bb4ae4a0Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(FastAllocate, "fast-allocate") 2390537ba893e2530051ec7f296e769fdd37bb4ae4a0Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(Allocate) 2391537ba893e2530051ec7f296e769fdd37bb4ae4a0Ben Murdoch}; 2392b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2393014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LTypeof final : public LTemplateInstruction<1, 2, 0> { 2394b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 23953fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LTypeof(LOperand* context, LOperand* value) { 23963fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch inputs_[0] = context; 23973fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch inputs_[1] = value; 2398b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 2399b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2400b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* context() { return inputs_[0]; } 2401b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[1]; } 2402b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2403b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") 2404b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 2405b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2406b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2407014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LTypeofIsAndBranch final : public LControlInstruction<1, 0> { 2408b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 2409b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch explicit LTypeofIsAndBranch(LOperand* value) { 2410b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch inputs_[0] = value; 2411b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch } 2412b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2413b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* value() { return inputs_[0]; } 2414b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2415b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") 24163fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch) 2417b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2418b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch Handle<String> type_literal() { return hydrogen()->type_literal(); } 2419b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2420014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch void PrintDataTo(StringStream* stream) override; 2421b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 2422b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2423b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2424014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LOsrEntry final : public LTemplateInstruction<0, 0, 0> { 2425b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 2426014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch bool HasInterestingComment(LCodeGen* gen) const override { return false; } 2427b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") 2428b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 2429b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2430b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2431014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LStackCheck final : public LTemplateInstruction<0, 1, 0> { 2432b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 24333fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch explicit LStackCheck(LOperand* context) { 24343fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch inputs_[0] = context; 24353fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch } 24363fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch 24373fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch LOperand* context() { return inputs_[0]; } 24383fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch 2439b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") 24403fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch DECLARE_HYDROGEN_ACCESSOR(StackCheck) 24413fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch 24423fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch Label* done_label() { return &done_label_; } 24433fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch 24443fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch private: 24453fb3ca8c7ca439d408449a395897395c0faae8d1Ben Murdoch Label done_label_; 2446b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 2447b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2448b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2449014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LForInPrepareMap final : public LTemplateInstruction<1, 2, 0> { 24503ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch public: 24513ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LForInPrepareMap(LOperand* context, LOperand* object) { 24523ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch inputs_[0] = context; 24533ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch inputs_[1] = object; 24543ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch } 24553ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 24563ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LOperand* context() { return inputs_[0]; } 24573ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LOperand* object() { return inputs_[1]; } 24583ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 24593ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map") 24603ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch}; 24613ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 24623ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 2463014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LForInCacheArray final : public LTemplateInstruction<1, 1, 0> { 24643ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch public: 24653ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch explicit LForInCacheArray(LOperand* map) { 24663ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch inputs_[0] = map; 24673ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch } 24683ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 24693ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LOperand* map() { return inputs_[0]; } 24703ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 24713ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array") 24723ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 24733ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch int idx() { 24743ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch return HForInCacheArray::cast(this->hydrogen_value())->idx(); 24753ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch } 24763ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch}; 24773ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 24783ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 2479014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LCheckMapValue final : public LTemplateInstruction<0, 2, 0> { 24803ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch public: 24813ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LCheckMapValue(LOperand* value, LOperand* map) { 24823ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch inputs_[0] = value; 24833ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch inputs_[1] = map; 24843ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch } 24853ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 24863ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LOperand* value() { return inputs_[0]; } 24873ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LOperand* map() { return inputs_[1]; } 24883ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 24893ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch DECLARE_CONCRETE_INSTRUCTION(CheckMapValue, "check-map-value") 24903ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch}; 24913ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 24923ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 2493014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LLoadFieldByIndex final : public LTemplateInstruction<1, 2, 0> { 24943ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch public: 24953ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LLoadFieldByIndex(LOperand* object, LOperand* index) { 24963ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch inputs_[0] = object; 24973ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch inputs_[1] = index; 24983ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch } 24993ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 25003ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LOperand* object() { return inputs_[0]; } 25013ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch LOperand* index() { return inputs_[1]; } 25023ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 25033ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") 25043ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch}; 25053ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 25063ef787dbeca8a5fb1086949cda830dccee07bfbdBen Murdoch 2507b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdochclass LChunkBuilder; 2508014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LPlatformChunk final : public LChunk { 2509b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch public: 2510b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LPlatformChunk(CompilationInfo* info, HGraph* graph) 2511b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch : LChunk(info, graph), 2512b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch num_double_slots_(0) { } 2513b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2514b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int GetNextSpillIndex(RegisterKind kind); 2515b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* GetNextSpillSlot(RegisterKind kind); 2516b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2517b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int num_double_slots() const { return num_double_slots_; } 2518b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2519b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch private: 2520b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int num_double_slots_; 2521b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 2522b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2523b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2524014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdochclass LChunkBuilder final : public LChunkBuilderBase { 2525b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch public: 2526e0cee9b3ed82e2391fd85d118aeaa4ea361c687dBen Murdoch LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) 2527b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch : LChunkBuilderBase(info, graph), 2528b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch current_instruction_(NULL), 2529b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch current_block_(NULL), 2530b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch next_block_(NULL), 2531b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch allocator_(allocator) {} 2532b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2533b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch // Build the sequence for the graph. 2534b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LPlatformChunk* Build(); 2535b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2536b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch // Declare methods that deal with the individual node types. 2537b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch#define DECLARE_DO(type) LInstruction* Do##type(H##type* node); 2538b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) 2539b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch#undef DECLARE_DO 2540b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2541b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DoMathFloor(HUnaryMathOperation* instr); 2542b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DoMathRound(HUnaryMathOperation* instr); 2543b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DoMathFround(HUnaryMathOperation* instr); 2544b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DoMathAbs(HUnaryMathOperation* instr); 2545b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DoMathLog(HUnaryMathOperation* instr); 254621efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch LInstruction* DoMathCos(HUnaryMathOperation* instr); 254721efce637eb329c94f1323b6a2334a1c977e1a9dBen Murdoch LInstruction* DoMathSin(HUnaryMathOperation* instr); 2548b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DoMathExp(HUnaryMathOperation* instr); 2549b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DoMathSqrt(HUnaryMathOperation* instr); 2550b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DoMathPowHalf(HUnaryMathOperation* instr); 2551b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DoMathClz32(HUnaryMathOperation* instr); 2552b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DoDivByPowerOf2I(HDiv* instr); 2553b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DoDivByConstI(HDiv* instr); 2554b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DoDivI(HDiv* instr); 2555b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DoModByPowerOf2I(HMod* instr); 2556b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DoModByConstI(HMod* instr); 2557b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DoModI(HMod* instr); 2558b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); 2559b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr); 2560b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr); 2561b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2562b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch private: 2563b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch // Methods for getting operands for Use / Define / Temp. 2564b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LUnallocated* ToUnallocated(Register reg); 2565b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LUnallocated* ToUnallocated(XMMRegister reg); 2566b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2567b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch // Methods for setting up define-use relationships. 2568b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand); 2569b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register); 2570b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value, 2571b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch XMMRegister fixed_register); 2572b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2573b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch // A value that is guaranteed to be allocated to a register. 2574b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch // Operand created by UseRegister is guaranteed to be live until the end of 2575b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch // instruction. This means that register allocator will not reuse it's 2576b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch // register for any other operand inside instruction. 2577b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch // Operand created by UseRegisterAtStart is guaranteed to be live only at 2578b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch // instruction start. Register allocator is free to assign the same register 2579b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch // to some other operand used inside instruction (i.e. temporary or 2580b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch // output). 2581b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch MUST_USE_RESULT LOperand* UseRegister(HValue* value); 2582b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch MUST_USE_RESULT LOperand* UseRegisterAtStart(HValue* value); 2583b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch 2584b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch // An input operand in a register that may be trashed. 2585b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch MUST_USE_RESULT LOperand* UseTempRegister(HValue* value); 2586b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch 2587b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch // An input operand in a register or stack slot. 2588b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch MUST_USE_RESULT LOperand* Use(HValue* value); 2589b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch MUST_USE_RESULT LOperand* UseAtStart(HValue* value); 2590b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch 2591b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch // An input operand in a register, stack slot or a constant operand. 2592b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch MUST_USE_RESULT LOperand* UseOrConstant(HValue* value); 2593b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch MUST_USE_RESULT LOperand* UseOrConstantAtStart(HValue* value); 2594b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch 2595b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch // An input operand in a fixed register or a constant operand. 2596b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch MUST_USE_RESULT LOperand* UseFixedOrConstant(HValue* value, 2597b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch Register fixed_register); 2598b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2599b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch // An input operand in a register or a constant operand. 2600b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value); 2601b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value); 2602b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch 2603b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch // An input operand in a constant operand. 2604b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch MUST_USE_RESULT LOperand* UseConstant(HValue* value); 2605b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2606b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch // An input operand in register, stack slot or a constant operand. 2607b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch // Will not be moved to a register even if one is freely available. 2608014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch MUST_USE_RESULT LOperand* UseAny(HValue* value) override; 2609b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch 2610b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch // Temporary operand that must be in a register. 2611b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch MUST_USE_RESULT LUnallocated* TempRegister(); 2612b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch MUST_USE_RESULT LOperand* FixedTemp(Register reg); 2613b8e0da25ee8efac3bb05cd6b2730aafbd96119f4Ben Murdoch MUST_USE_RESULT LOperand* FixedTemp(XMMRegister reg); 2614b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2615b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch // Methods for setting up define-use relationships. 2616b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch // Return the same instruction that they are passed. 2617b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* Define(LTemplateResultInstruction<1>* instr, 2618b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LUnallocated* result); 2619b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DefineAsRegister(LTemplateResultInstruction<1>* instr); 2620b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DefineAsSpilled(LTemplateResultInstruction<1>* instr, 2621b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch int index); 2622b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DefineSameAsFirst(LTemplateResultInstruction<1>* instr); 2623b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DefineFixed(LTemplateResultInstruction<1>* instr, 2624b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch Register reg); 2625b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LInstruction* DefineFixedDouble(LTemplateResultInstruction<1>* instr, 2626b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch XMMRegister reg); 262769a99ed0b2b2ef69d393c371b03db3a98aaf880eBen Murdoch // Assigns an environment to an instruction. An instruction which can 262869a99ed0b2b2ef69d393c371b03db3a98aaf880eBen Murdoch // deoptimize must have an environment. 2629b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LInstruction* AssignEnvironment(LInstruction* instr); 263069a99ed0b2b2ef69d393c371b03db3a98aaf880eBen Murdoch // Assigns a pointer map to an instruction. An instruction which can 263169a99ed0b2b2ef69d393c371b03db3a98aaf880eBen Murdoch // trigger a GC or a lazy deoptimization must have a pointer map. 2632b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LInstruction* AssignPointerMap(LInstruction* instr); 2633b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2634b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; 2635b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2636b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* GetSeqStringSetCharOperand(HSeqStringSetChar* instr); 2637b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 263869a99ed0b2b2ef69d393c371b03db3a98aaf880eBen Murdoch // Marks a call for the register allocator. Assigns a pointer map to 263969a99ed0b2b2ef69d393c371b03db3a98aaf880eBen Murdoch // support GC and lazy deoptimization. Assigns an environment to support 264069a99ed0b2b2ef69d393c371b03db3a98aaf880eBen Murdoch // eager deoptimization if CAN_DEOPTIMIZE_EAGERLY. 2641b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LInstruction* MarkAsCall( 2642b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LInstruction* instr, 2643b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch HInstruction* hinstr, 2644b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); 2645b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2646b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch void VisitInstruction(HInstruction* current); 2647b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch void AddInstruction(LInstruction* instr, HInstruction* current); 2648b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2649b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); 2650b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); 2651b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LInstruction* DoArithmeticD(Token::Value op, 2652b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch HArithmeticBinaryOperation* instr); 2653b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LInstruction* DoArithmeticT(Token::Value op, 2654b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch HBinaryOperation* instr); 2655b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch 2656b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch LOperand* GetStoreKeyedValueOperand(HStoreKeyed* instr); 2657b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2658b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch HInstruction* current_instruction_; 2659b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch HBasicBlock* current_block_; 2660b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch HBasicBlock* next_block_; 2661b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch LAllocator* allocator_; 2662b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2663b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2664b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch}; 2665b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2666b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch#undef DECLARE_HYDROGEN_ACCESSOR 2667b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch#undef DECLARE_CONCRETE_INSTRUCTION 2668b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2669014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch} // namespace internal 2670014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch} // namespace v8 2671b0fe1620dcb4135ac3ab2d66ff93072373911299Ben Murdoch 2672014dc512cdd3e367bee49a713fdc5ed92584a3e5Ben Murdoch#endif // V8_CRANKSHAFT_IA32_LITHIUM_IA32_H_ 2673