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

Unified Diff: src/a64/lithium-a64.h

Issue 144963003: A64: add missing files. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/a64/instrument-a64.cc ('k') | src/a64/lithium-a64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/lithium-a64.h
diff --git a/src/mips/lithium-mips.h b/src/a64/lithium-a64.h
similarity index 79%
copy from src/mips/lithium-mips.h
copy to src/a64/lithium-a64.h
index 50feee0cb7e26477797f7a8e93534ced62bf662f..be9423beb0c13c6959bc16d13738176e29d4d6f2 100644
--- a/src/mips/lithium-mips.h
+++ b/src/a64/lithium-a64.h
@@ -1,4 +1,4 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
+// Copyright 2013 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_MIPS_LITHIUM_MIPS_H_
-#define V8_MIPS_LITHIUM_MIPS_H_
+#ifndef V8_A64_LITHIUM_A64_H_
+#define V8_A64_LITHIUM_A64_H_
#include "hydrogen.h"
#include "lithium-allocator.h"
@@ -71,49 +71,48 @@ class LCodeGen;
V(CallStub) \
V(CheckFunction) \
V(CheckInstanceType) \
- V(CheckMaps) \
V(CheckNonSmi) \
+ V(CheckMaps) \
V(CheckPrototypeMaps) \
V(CheckSmi) \
V(ClampDToUint8) \
V(ClampIToUint8) \
V(ClampTToUint8) \
V(ClassOfTestAndBranch) \
- V(CmpConstantEqAndBranch) \
V(CmpIDAndBranch) \
- V(CmpObjectEqAndBranch) \
V(CmpMapAndBranch) \
+ V(CmpObjectEqAndBranch) \
V(CmpT) \
V(ConstantD) \
V(ConstantI) \
V(ConstantS) \
V(ConstantT) \
V(Context) \
+ V(DateField) \
V(DebugBreak) \
- V(DeclareGlobals) \
- V(DeleteProperty) \
V(Deoptimize) \
V(DivI) \
V(DoubleToI) \
V(DoubleToSmi) \
+ V(Drop) \
V(DummyUse) \
V(ElementsKind) \
V(FixedArrayBaseLength) \
+ V(ForInCacheArray) \
+ V(ForInPrepareMap) \
V(FunctionLiteral) \
- V(GetCachedArrayIndex) \
V(GlobalObject) \
V(GlobalReceiver) \
V(Goto) \
- V(HasCachedArrayIndexAndBranch) \
V(HasInstanceTypeAndBranch) \
V(In) \
+ V(InnerAllocatedObject) \
V(InstanceOf) \
V(InstanceOfKnownGlobal) \
V(InstanceSize) \
V(InstructionGap) \
V(Integer32ToDouble) \
V(Integer32ToSmi) \
- V(Uint32ToDouble) \
V(InvokeFunction) \
V(IsConstructCallAndBranch) \
V(IsObjectAndBranch) \
@@ -127,7 +126,9 @@ class LCodeGen;
V(LoadFunctionPrototype) \
V(LoadGlobalCell) \
V(LoadGlobalGeneric) \
- V(LoadKeyed) \
+ V(LoadKeyedExternal) \
+ V(LoadKeyedFixed) \
+ V(LoadKeyedFixedDouble) \
V(LoadKeyedGeneric) \
V(LoadNamedField) \
V(LoadNamedFieldPolymorphic) \
@@ -135,6 +136,7 @@ class LCodeGen;
V(MapEnumLength) \
V(MathAbs) \
V(MathCos) \
+ V(MathAbsTagged) \
V(MathExp) \
V(MathFloor) \
V(MathLog) \
@@ -144,20 +146,15 @@ class LCodeGen;
V(MathSin) \
V(MathSqrt) \
V(MathTan) \
- V(ModI) \
+ V(MulConstI) \
V(MulI) \
- V(MultiplyAddD) \
V(NumberTagD) \
- V(NumberTagI) \
V(NumberTagU) \
V(NumberUntagD) \
V(OsrEntry) \
V(OuterContext) \
V(Parameter) \
- V(Power) \
V(PushArgument) \
- V(Random) \
- V(RegExpLiteral) \
V(Return) \
V(SeqStringSetChar) \
V(ShiftI) \
@@ -167,14 +164,15 @@ class LCodeGen;
V(StoreContextSlot) \
V(StoreGlobalCell) \
V(StoreGlobalGeneric) \
- V(StoreKeyed) \
+ V(StoreKeyedExternal) \
+ V(StoreKeyedFixed) \
+ V(StoreKeyedFixedDouble) \
V(StoreKeyedGeneric) \
V(StoreNamedField) \
V(StoreNamedGeneric) \
V(StringAdd) \
V(StringCharCodeAt) \
V(StringCharFromCode) \
- V(StringCompareAndBranch) \
V(StringLength) \
V(SubI) \
V(TaggedToI) \
@@ -185,16 +183,11 @@ class LCodeGen;
V(TrapAllocationMemento) \
V(Typeof) \
V(TypeofIsAndBranch) \
- V(UnknownOSRValue) \
+ V(Uint32ToDouble) \
V(ValueOf) \
- V(ForInPrepareMap) \
- V(ForInCacheArray) \
V(CheckMapValue) \
V(LoadFieldByIndex) \
- V(DateField) \
- V(WrapReceiver) \
- V(Drop) \
- V(InnerAllocatedObject)
+ V(WrapReceiver)
#define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \
@@ -207,9 +200,9 @@ class LCodeGen;
}
-#define DECLARE_HYDROGEN_ACCESSOR(type) \
- H##type* hydrogen() const { \
- return H##type::cast(hydrogen_value()); \
+#define DECLARE_HYDROGEN_ACCESSOR(type) \
+ H##type* hydrogen() const { \
+ return H##type::cast(this->hydrogen_value()); \
}
@@ -268,13 +261,16 @@ class LInstruction: public ZoneObject {
bool ClobbersTemps() const { return is_call_; }
bool ClobbersRegisters() const { return is_call_; }
bool ClobbersDoubleRegisters() const { return is_call_; }
-
- // Interface to the register allocator and iterators.
bool IsMarkedAsCall() const { return is_call_; }
virtual bool HasResult() const = 0;
virtual LOperand* result() = 0;
+ virtual int InputCount() = 0;
+ virtual LOperand* InputAt(int i) = 0;
+ virtual int TempCount() = 0;
+ virtual LOperand* TempAt(int i) = 0;
+
LOperand* FirstInput() { return InputAt(0); }
LOperand* Output() { return HasResult() ? result() : NULL; }
@@ -285,15 +281,6 @@ class LInstruction: public ZoneObject {
#endif
private:
- // Iterator interface.
- friend class InputIterator;
- virtual int InputCount() = 0;
- virtual LOperand* InputAt(int i) = 0;
-
- friend class TempIterator;
- virtual int TempCount() = 0;
- virtual LOperand* TempAt(int i) = 0;
-
LEnvironment* environment_;
SetOncePointer<LPointerMap> pointer_map_;
HValue* hydrogen_value_;
@@ -313,17 +300,60 @@ class LTemplateInstruction: public LInstruction {
void set_result(LOperand* operand) { results_[0] = operand; }
LOperand* result() { return results_[0]; }
+ int InputCount() { return I; }
+ LOperand* InputAt(int i) { return inputs_[i]; }
+
+ int TempCount() { return T; }
+ LOperand* TempAt(int i) { return temps_[i]; }
+
protected:
EmbeddedContainer<LOperand*, R> results_;
EmbeddedContainer<LOperand*, I> inputs_;
EmbeddedContainer<LOperand*, T> temps_;
+};
+
+
+template<int I, int T>
+class LControlInstruction: public LTemplateInstruction<0, I, T> {
+ public:
+ LControlInstruction() : false_label_(NULL), true_label_(NULL) { }
+
+ virtual bool IsControl() const { return true; }
+
+ int SuccessorCount() { return hydrogen()->SuccessorCount(); }
+ HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); }
+
+ int TrueDestination(LChunk* chunk) {
+ return chunk->LookupDestination(true_block_id());
+ }
+
+ int FalseDestination(LChunk* chunk) {
+ return chunk->LookupDestination(false_block_id());
+ }
+
+ Label* TrueLabel(LChunk* chunk) {
+ if (true_label_ == NULL) {
+ true_label_ = chunk->GetAssemblyLabel(TrueDestination(chunk));
+ }
+ return true_label_;
+ }
+
+ Label* FalseLabel(LChunk* chunk) {
+ if (false_label_ == NULL) {
+ false_label_ = chunk->GetAssemblyLabel(FalseDestination(chunk));
+ }
+ return false_label_;
+ }
+
+ protected:
+ int true_block_id() { return hydrogen()->SuccessorAt(0)->block_id(); }
+ int false_block_id() { return hydrogen()->SuccessorAt(1)->block_id(); }
private:
- virtual int InputCount() { return I; }
- virtual LOperand* InputAt(int i) { return inputs_[i]; }
+ DECLARE_HYDROGEN_ACCESSOR(ControlInstruction);
- virtual int TempCount() { return T; }
- virtual LOperand* TempAt(int i) { return temps_[i]; }
+ Label* false_label_;
+ Label* true_label_;
};
@@ -375,6 +405,19 @@ class LGap: public LTemplateInstruction<0, 0, 0> {
};
+class LInstanceSize: public LTemplateInstruction<1, 1, 0> {
+ public:
+ explicit LInstanceSize(LOperand* object) {
+ inputs_[0] = object;
+ }
+
+ LOperand* object() { return inputs_[0]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(InstanceSize, "instance-size")
+ DECLARE_HYDROGEN_ACCESSOR(InstanceSize)
+};
+
+
class LInstructionGap: public LGap {
public:
explicit LInstructionGap(HBasicBlock* block) : LGap(block) { }
@@ -387,6 +430,28 @@ class LInstructionGap: public LGap {
};
+class LDrop: public LTemplateInstruction<0, 0, 0> {
+ public:
+ explicit LDrop(int count) : count_(count) { }
+
+ int count() const { return count_; }
+
+ DECLARE_CONCRETE_INSTRUCTION(Drop, "drop")
+
+ private:
+ int count_;
+};
+
+
+class LDummyUse: public LTemplateInstruction<1, 1, 0> {
+ public:
+ explicit LDummyUse(LOperand* value) {
+ inputs_[0] = value;
+ }
+ DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use")
+};
+
+
class LGoto: public LTemplateInstruction<0, 0, 0> {
public:
explicit LGoto(int block_id) : block_id_(block_id) { }
@@ -419,21 +484,6 @@ class LLazyBailout: public LTemplateInstruction<0, 0, 0> {
};
-class LDummyUse: public LTemplateInstruction<1, 1, 0> {
- public:
- explicit LDummyUse(LOperand* value) {
- inputs_[0] = value;
- }
- DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use")
-};
-
-
-class LDeoptimize: public LTemplateInstruction<0, 0, 0> {
- public:
- DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
-};
-
-
class LLabel: public LGap {
public:
explicit LLabel(HBasicBlock* block)
@@ -458,59 +508,102 @@ class LLabel: public LGap {
};
-class LParameter: public LTemplateInstruction<1, 0, 0> {
+class LOsrEntry: public LTemplateInstruction<0, 0, 0> {
public:
+ LOsrEntry();
+
virtual bool HasInterestingComment(LCodeGen* gen) const { return false; }
- DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
+ DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry")
+
+ LOperand** SpilledRegisterArray() { return register_spills_; }
+ LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; }
+
+ void MarkSpilledRegister(int allocation_index, LOperand* spill_operand) {
+ UNIMPLEMENTED();
+ }
+ void MarkSpilledDoubleRegister(int allocation_index,
+ LOperand* spill_operand) {
+ UNIMPLEMENTED();
+ }
+
+ private:
+ // Arrays of spill slot operands for registers with an assigned spill
+ // slot, i.e., that must also be restored to the spill slot on OSR entry.
+ // NULL if the register has no assigned spill slot. Indexed by allocation
+ // index.
+ LOperand* register_spills_[Register::kMaxNumAllocatableRegisters];
+ LOperand*
+ double_register_spills_[DoubleRegister::kMaxNumAllocatableRegisters];
};
-class LCallStub: public LTemplateInstruction<1, 0, 0> {
+class LOuterContext: public LTemplateInstruction<1, 1, 0> {
public:
- DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
- DECLARE_HYDROGEN_ACCESSOR(CallStub)
-
- TranscendentalCache::Type transcendental_type() {
- return hydrogen()->transcendental_type();
+ explicit LOuterContext(LOperand* context) {
+ inputs_[0] = context;
}
+
+ LOperand* context() { return inputs_[0]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context")
};
-class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> {
+class LAccessArgumentsAt: public LTemplateInstruction<1, 3, 1> {
public:
- virtual bool HasInterestingComment(LCodeGen* gen) const { return false; }
- DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
+ LAccessArgumentsAt(LOperand* arguments,
+ LOperand* length,
+ LOperand* index,
+ LOperand* temp) {
+ inputs_[0] = arguments;
+ inputs_[1] = length;
+ inputs_[2] = index;
+ temps_[0] = temp;
+ }
+
+ DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at")
+
+ LOperand* arguments() { return inputs_[0]; }
+ LOperand* length() { return inputs_[1]; }
+ LOperand* index() { return inputs_[2]; }
+ LOperand* temp() { return temps_[0]; }
+
+ virtual void PrintDataTo(StringStream* stream);
};
-template<int I, int T>
-class LControlInstruction: public LTemplateInstruction<0, I, T> {
+class LAddI: public LTemplateInstruction<1, 2, 0> {
public:
- virtual bool IsControl() const { return true; }
+ LAddI(LOperand* left, LOperand* right) {
+ inputs_[0] = left;
+ inputs_[1] = right;
+ }
- int SuccessorCount() { return hydrogen()->SuccessorCount(); }
- HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); }
- int true_block_id() { return hydrogen()->SuccessorAt(0)->block_id(); }
- int false_block_id() { return hydrogen()->SuccessorAt(1)->block_id(); }
+ LOperand* left() { return inputs_[0]; }
+ LOperand* right() { return inputs_[1]; }
- private:
- HControlInstruction* hydrogen() {
- return HControlInstruction::cast(this->hydrogen_value());
- }
+ DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i")
+ DECLARE_HYDROGEN_ACCESSOR(Add)
};
-class LWrapReceiver: public LTemplateInstruction<1, 2, 0> {
+class LAllocate: public LTemplateInstruction<1, 1, 2> {
public:
- LWrapReceiver(LOperand* receiver, LOperand* function) {
- inputs_[0] = receiver;
- inputs_[1] = function;
+ // TODO(jbramley): On ia32, this takes a context, and it is used by the
+ // deferred code. On ARM, an LOperand is allocated for another input, but it
+ // is never used, and the deferred code doesn't need the context. Why?
+ LAllocate(LOperand* size, LOperand* temp1, LOperand* temp2) {
+ inputs_[0] = size;
+ temps_[0] = temp1;
+ temps_[1] = temp2;
}
- DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver")
+ LOperand* size() { return inputs_[0]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
- LOperand* receiver() { return inputs_[0]; }
- LOperand* function() { return inputs_[1]; }
+ DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate")
+ DECLARE_HYDROGEN_ACCESSOR(Allocate)
};
@@ -535,21 +628,16 @@ class LApplyArguments: public LTemplateInstruction<1, 4, 0> {
};
-class LAccessArgumentsAt: public LTemplateInstruction<1, 3, 0> {
+class LArgumentsElements: public LTemplateInstruction<1, 0, 1> {
public:
- LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index) {
- inputs_[0] = arguments;
- inputs_[1] = length;
- inputs_[2] = index;
+ explicit LArgumentsElements(LOperand* temp) {
+ temps_[0] = temp;
}
- DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at")
-
- LOperand* arguments() { return inputs_[0]; }
- LOperand* length() { return inputs_[1]; }
- LOperand* index() { return inputs_[2]; }
+ LOperand* temp() { return temps_[0]; }
- virtual void PrintDataTo(StringStream* stream);
+ DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements")
+ DECLARE_HYDROGEN_ACCESSOR(ArgumentsElements)
};
@@ -565,299 +653,248 @@ class LArgumentsLength: public LTemplateInstruction<1, 1, 0> {
};
-class LArgumentsElements: public LTemplateInstruction<1, 0, 0> {
- public:
- DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements")
- DECLARE_HYDROGEN_ACCESSOR(ArgumentsElements)
-};
-
-
-class LModI: public LTemplateInstruction<1, 2, 3> {
+class LArithmeticD: public LTemplateInstruction<1, 2, 0> {
public:
- // Used when the right hand is a constant power of 2.
- LModI(LOperand* left,
- LOperand* right) {
- inputs_[0] = left;
- inputs_[1] = right;
- temps_[0] = NULL;
- temps_[1] = NULL;
- temps_[2] = NULL;
- }
-
- // Used for the standard case.
- LModI(LOperand* left,
- LOperand* right,
- LOperand* temp,
- LOperand* temp2,
- LOperand* temp3) {
+ LArithmeticD(Token::Value op, LOperand* left, LOperand* right)
+ : op_(op) {
inputs_[0] = left;
inputs_[1] = right;
- temps_[0] = temp;
- temps_[1] = temp2;
- temps_[2] = temp3;
}
+ Token::Value op() const { return op_; }
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
- LOperand* temp() { return temps_[0]; }
- LOperand* temp2() { return temps_[1]; }
- LOperand* temp3() { return temps_[2]; }
- DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i")
- DECLARE_HYDROGEN_ACCESSOR(Mod)
+ virtual Opcode opcode() const { return LInstruction::kArithmeticD; }
+ virtual void CompileToNative(LCodeGen* generator);
+ virtual const char* Mnemonic() const;
+
+ private:
+ Token::Value op_;
};
-class LDivI: public LTemplateInstruction<1, 2, 0> {
+class LArithmeticT: public LTemplateInstruction<1, 2, 0> {
public:
- LDivI(LOperand* left, LOperand* right) {
+ LArithmeticT(Token::Value op, LOperand* left, LOperand* right)
+ : op_(op) {
inputs_[0] = left;
inputs_[1] = right;
}
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
+ Token::Value op() const { return op_; }
- DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
- DECLARE_HYDROGEN_ACCESSOR(Div)
+ virtual Opcode opcode() const { return LInstruction::kArithmeticT; }
+ virtual void CompileToNative(LCodeGen* generator);
+ virtual const char* Mnemonic() const;
+
+ private:
+ Token::Value op_;
};
-class LMulI: public LTemplateInstruction<1, 2, 1> {
+class LBoundsCheck: public LTemplateInstruction<0, 2, 0> {
public:
- LMulI(LOperand* left, LOperand* right, LOperand* temp) {
- inputs_[0] = left;
- inputs_[1] = right;
- temps_[0] = temp;
+ explicit LBoundsCheck(LOperand* index, LOperand* length) {
+ inputs_[0] = index;
+ inputs_[1] = length;
}
- LOperand* left() { return inputs_[0]; }
- LOperand* right() { return inputs_[1]; }
- LOperand* temp() { return temps_[0]; }
+ LOperand* index() { return inputs_[0]; }
+ LOperand* length() { return inputs_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
- DECLARE_HYDROGEN_ACCESSOR(Mul)
+ DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check")
+ DECLARE_HYDROGEN_ACCESSOR(BoundsCheck)
};
-// Instruction for computing multiplier * multiplicand + addend.
-class LMultiplyAddD: public LTemplateInstruction<1, 3, 0> {
+class LBitI: public LTemplateInstruction<1, 2, 0> {
public:
- LMultiplyAddD(LOperand* addend, LOperand* multiplier,
- LOperand* multiplicand) {
- inputs_[0] = addend;
- inputs_[1] = multiplier;
- inputs_[2] = multiplicand;
+ LBitI(LOperand* left, LOperand* right) {
+ inputs_[0] = left;
+ inputs_[1] = right;
}
- LOperand* addend() { return inputs_[0]; }
- LOperand* multiplier() { return inputs_[1]; }
- LOperand* multiplicand() { return inputs_[2]; }
+ LOperand* left() { return inputs_[0]; }
+ LOperand* right() { return inputs_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(MultiplyAddD, "multiply-add-d")
-};
+ Token::Value op() const { return hydrogen()->op(); }
-
-class LDebugBreak: public LTemplateInstruction<0, 0, 0> {
- public:
- DECLARE_CONCRETE_INSTRUCTION(DebugBreak, "break")
-};
-
-
-class LCmpIDAndBranch: public LControlInstruction<2, 0> {
- public:
- LCmpIDAndBranch(LOperand* left, LOperand* right) {
- inputs_[0] = left;
- inputs_[1] = right;
- }
-
- LOperand* left() { return inputs_[0]; }
- LOperand* right() { return inputs_[1]; }
-
- DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(CompareIDAndBranch)
-
- Token::Value op() const { return hydrogen()->token(); }
- bool is_double() const {
- return hydrogen()->representation().IsDouble();
- }
-
- virtual void PrintDataTo(StringStream* stream);
+ DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i")
+ DECLARE_HYDROGEN_ACCESSOR(Bitwise)
};
-class LMathFloor: public LTemplateInstruction<1, 1, 1> {
+class LBitNotI: public LTemplateInstruction<1, 1, 0> {
public:
- LMathFloor(LOperand* value, LOperand* temp) {
+ explicit LBitNotI(LOperand* value) {
inputs_[0] = value;
- temps_[0] = temp;
}
LOperand* value() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor")
- DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
+ DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i")
};
-class LMathRound: public LTemplateInstruction<1, 1, 1> {
+class LBranch: public LControlInstruction<1, 2> {
public:
- LMathRound(LOperand* value, LOperand* temp) {
+ explicit LBranch(LOperand* value, LOperand *temp1, LOperand *temp2) {
inputs_[0] = value;
- temps_[0] = temp;
+ temps_[0] = temp1;
+ temps_[1] = temp2;
}
LOperand* value() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round")
- DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
+ DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
+ DECLARE_HYDROGEN_ACCESSOR(Branch)
+
+ virtual void PrintDataTo(StringStream* stream);
};
-class LMathAbs: public LTemplateInstruction<1, 1, 0> {
+class LCallConstantFunction: public LTemplateInstruction<1, 0, 0> {
public:
- explicit LMathAbs(LOperand* value) {
- inputs_[0] = value;
- }
+ DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function")
+ DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction)
- LOperand* value() { return inputs_[0]; }
+ virtual void PrintDataTo(StringStream* stream);
- DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs")
- DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
+ Handle<JSFunction> function() { return hydrogen()->function(); }
+ int arity() const { return hydrogen()->argument_count() - 1; }
};
-class LMathLog: public LTemplateInstruction<1, 1, 0> {
+class LCallFunction: public LTemplateInstruction<1, 1, 0> {
public:
- explicit LMathLog(LOperand* value) {
- inputs_[0] = value;
+ explicit LCallFunction(LOperand* function) {
+ inputs_[0] = function;
}
- LOperand* value() { return inputs_[0]; }
+ LOperand* function() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log")
+ DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
+ DECLARE_HYDROGEN_ACCESSOR(CallFunction)
+
+ int arity() const { return hydrogen()->argument_count() - 1; }
};
-class LMathSin: public LTemplateInstruction<1, 1, 0> {
+class LCallKnownGlobal: public LTemplateInstruction<1, 0, 0> {
public:
- explicit LMathSin(LOperand* value) {
- inputs_[0] = value;
- }
+ DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global")
+ DECLARE_HYDROGEN_ACCESSOR(CallKnownGlobal)
- LOperand* value() { return inputs_[0]; }
+ virtual void PrintDataTo(StringStream* stream);
- DECLARE_CONCRETE_INSTRUCTION(MathSin, "math-sin")
+ int arity() const { return hydrogen()->argument_count() - 1; }
};
-class LMathCos: public LTemplateInstruction<1, 1, 0> {
+class LCallGlobal: public LTemplateInstruction<1, 0, 0> {
public:
- explicit LMathCos(LOperand* value) {
- inputs_[0] = value;
- }
+ DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global")
+ DECLARE_HYDROGEN_ACCESSOR(CallGlobal)
- LOperand* value() { return inputs_[0]; }
+ virtual void PrintDataTo(StringStream* stream);
- DECLARE_CONCRETE_INSTRUCTION(MathCos, "math-cos")
+ Handle<String> name() const { return hydrogen()->name(); }
+ int arity() const { return hydrogen()->argument_count() - 1; }
};
-class LMathTan: public LTemplateInstruction<1, 1, 0> {
+class LCallKeyed: public LTemplateInstruction<1, 1, 0> {
public:
- explicit LMathTan(LOperand* value) {
- inputs_[0] = value;
+ explicit LCallKeyed(LOperand* key) {
+ inputs_[0] = key;
}
- LOperand* value() { return inputs_[0]; }
+ LOperand* key() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(MathTan, "math-tan")
+ DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed")
+ DECLARE_HYDROGEN_ACCESSOR(CallKeyed)
+
+ virtual void PrintDataTo(StringStream* stream);
+
+ int arity() const { return hydrogen()->argument_count() - 1; }
};
-class LMathExp: public LTemplateInstruction<1, 1, 3> {
+class LCallNamed: public LTemplateInstruction<1, 0, 0> {
public:
- LMathExp(LOperand* value,
- LOperand* double_temp,
- LOperand* temp1,
- LOperand* temp2) {
- inputs_[0] = value;
- temps_[0] = temp1;
- temps_[1] = temp2;
- temps_[2] = double_temp;
- ExternalReference::InitializeMathExpData();
- }
+ DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call-named")
+ DECLARE_HYDROGEN_ACCESSOR(CallNamed)
- LOperand* value() { return inputs_[0]; }
- LOperand* temp1() { return temps_[0]; }
- LOperand* temp2() { return temps_[1]; }
- LOperand* double_temp() { return temps_[2]; }
+ virtual void PrintDataTo(StringStream* stream);
- DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp")
+ Handle<String> name() const { return hydrogen()->name(); }
+ int arity() const { return hydrogen()->argument_count() - 1; }
};
-class LMathSqrt: public LTemplateInstruction<1, 1, 0> {
+class LCallNew: public LTemplateInstruction<1, 1, 0> {
public:
- explicit LMathSqrt(LOperand* value) {
- inputs_[0] = value;
+ explicit LCallNew(LOperand* constructor) {
+ inputs_[0] = constructor;
}
- LOperand* value() { return inputs_[0]; }
+ LOperand* constructor() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt")
+ DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new")
+ DECLARE_HYDROGEN_ACCESSOR(CallNew)
+
+ virtual void PrintDataTo(StringStream* stream);
+
+ int arity() const { return hydrogen()->argument_count() - 1; }
};
-class LMathPowHalf: public LTemplateInstruction<1, 1, 1> {
+class LCallNewArray: public LTemplateInstruction<1, 1, 0> {
public:
- LMathPowHalf(LOperand* value, LOperand* temp) {
- inputs_[0] = value;
- temps_[0] = temp;
+ explicit LCallNewArray(LOperand* constructor) {
+ inputs_[0] = constructor;
}
- LOperand* value() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
+ LOperand* constructor() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half")
+ DECLARE_CONCRETE_INSTRUCTION(CallNewArray, "call-new-array")
+ DECLARE_HYDROGEN_ACCESSOR(CallNewArray)
+
+ virtual void PrintDataTo(StringStream* stream);
+
+ int arity() const { return hydrogen()->argument_count() - 1; }
};
-class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> {
+class LCallRuntime: public LTemplateInstruction<1, 0, 0> {
public:
- LCmpObjectEqAndBranch(LOperand* left, LOperand* right) {
- inputs_[0] = left;
- inputs_[1] = right;
- }
-
- LOperand* left() { return inputs_[0]; }
- LOperand* right() { return inputs_[1]; }
+ DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
+ DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
- DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch,
- "cmp-object-eq-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(CompareObjectEqAndBranch)
+ const Runtime::Function* function() const { return hydrogen()->function(); }
+ int arity() const { return hydrogen()->argument_count(); }
};
-class LCmpConstantEqAndBranch: public LControlInstruction<1, 0> {
+class LCallStub: public LTemplateInstruction<1, 0, 0> {
public:
- explicit LCmpConstantEqAndBranch(LOperand* left) {
- inputs_[0] = left;
- }
-
- LOperand* left() { return inputs_[0]; }
+ DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
+ DECLARE_HYDROGEN_ACCESSOR(CallStub)
- DECLARE_CONCRETE_INSTRUCTION(CmpConstantEqAndBranch,
- "cmp-constant-eq-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(CompareConstantEqAndBranch)
+ TranscendentalCache::Type transcendental_type() {
+ return hydrogen()->transcendental_type();
+ }
};
-class LIsObjectAndBranch: public LControlInstruction<1, 1> {
+class LCheckFunction: public LTemplateInstruction<0, 1, 1> {
public:
- LIsObjectAndBranch(LOperand* value, LOperand* temp) {
+ LCheckFunction(LOperand* value, LOperand* temp) {
inputs_[0] = value;
temps_[0] = temp;
}
@@ -865,16 +902,14 @@ class LIsObjectAndBranch: public LControlInstruction<1, 1> {
LOperand* value() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(IsObjectAndBranch)
-
- virtual void PrintDataTo(StringStream* stream);
+ DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function")
+ DECLARE_HYDROGEN_ACCESSOR(CheckFunction)
};
-class LIsStringAndBranch: public LControlInstruction<1, 1> {
+class LCheckInstanceType: public LTemplateInstruction<0, 1, 1> {
public:
- LIsStringAndBranch(LOperand* value, LOperand* temp) {
+ explicit LCheckInstanceType(LOperand* value, LOperand* temp) {
inputs_[0] = value;
temps_[0] = temp;
}
@@ -882,163 +917,133 @@ class LIsStringAndBranch: public LControlInstruction<1, 1> {
LOperand* value() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch)
-
- virtual void PrintDataTo(StringStream* stream);
+ DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
+ DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
};
-class LIsSmiAndBranch: public LControlInstruction<1, 0> {
+class LCheckMaps: public LTemplateInstruction<0, 1, 1> {
public:
- explicit LIsSmiAndBranch(LOperand* value) {
+ explicit LCheckMaps(LOperand* value, LOperand* temp) {
inputs_[0] = value;
+ temps_[0] = temp;
}
LOperand* value() { return inputs_[0]; }
+ LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch)
-
- virtual void PrintDataTo(StringStream* stream);
+ DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps")
+ DECLARE_HYDROGEN_ACCESSOR(CheckMaps)
};
-class LIsUndetectableAndBranch: public LControlInstruction<1, 1> {
+class LCheckNonSmi: public LTemplateInstruction<0, 1, 0> {
public:
- explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) {
+ explicit LCheckNonSmi(LOperand* value) {
inputs_[0] = value;
- temps_[0] = temp;
}
LOperand* value() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch,
- "is-undetectable-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch)
- virtual void PrintDataTo(StringStream* stream);
+ DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi")
};
-class LStringCompareAndBranch: public LControlInstruction<2, 0> {
+class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 2> {
public:
- LStringCompareAndBranch(LOperand* left, LOperand* right) {
- inputs_[0] = left;
- inputs_[1] = right;
+ explicit LCheckPrototypeMaps(LOperand* temp1, LOperand* temp2) {
+ temps_[0] = temp1;
+ temps_[1] = temp2;
}
- LOperand* left() { return inputs_[0]; }
- LOperand* right() { return inputs_[1]; }
-
- DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch,
- "string-compare-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch)
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
- Token::Value op() const { return hydrogen()->token(); }
+ DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps");
+ DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps)
- virtual void PrintDataTo(StringStream* stream);
+ ZoneList<Handle<JSObject> >* prototypes() const {
+ return hydrogen()->prototypes();
+ }
+ ZoneList<Handle<Map> >* maps() const { return hydrogen()->maps(); }
};
-class LHasInstanceTypeAndBranch: public LControlInstruction<1, 0> {
+class LCheckSmi: public LTemplateInstruction<1, 1, 0> {
public:
- explicit LHasInstanceTypeAndBranch(LOperand* value) {
+ explicit LCheckSmi(LOperand* value) {
inputs_[0] = value;
}
LOperand* value() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
- "has-instance-type-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch)
-
- virtual void PrintDataTo(StringStream* stream);
+ DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi")
};
-class LGetCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
+class LClampDToUint8: public LTemplateInstruction<1, 1, 0> {
public:
- explicit LGetCachedArrayIndex(LOperand* value) {
- inputs_[0] = value;
+ explicit LClampDToUint8(LOperand* unclamped) {
+ inputs_[0] = unclamped;
}
- LOperand* value() { return inputs_[0]; }
+ LOperand* unclamped() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index")
- DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex)
+ DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8")
};
-class LHasCachedArrayIndexAndBranch: public LControlInstruction<1, 0> {
+class LClampIToUint8: public LTemplateInstruction<1, 1, 0> {
public:
- explicit LHasCachedArrayIndexAndBranch(LOperand* value) {
- inputs_[0] = value;
+ explicit LClampIToUint8(LOperand* unclamped) {
+ inputs_[0] = unclamped;
}
- LOperand* value() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch,
- "has-cached-array-index-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch)
+ LOperand* unclamped() { return inputs_[0]; }
- virtual void PrintDataTo(StringStream* stream);
+ DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8")
};
-class LClassOfTestAndBranch: public LControlInstruction<1, 1> {
+class LClampTToUint8: public LTemplateInstruction<1, 1, 2> {
public:
- LClassOfTestAndBranch(LOperand* value, LOperand* temp) {
- inputs_[0] = value;
- temps_[0] = temp;
+ LClampTToUint8(LOperand* unclamped, LOperand* temp1, LOperand* temp2) {
+ inputs_[0] = unclamped;
+ temps_[0] = temp1;
+ temps_[1] = temp2;
}
- LOperand* value() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
+ LOperand* unclamped() { return inputs_[0]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch,
- "class-of-test-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch)
-
- virtual void PrintDataTo(StringStream* stream);
+ DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8")
};
-class LCmpT: public LTemplateInstruction<1, 2, 0> {
+class LClassOfTestAndBranch: public LControlInstruction<1, 2> {
public:
- LCmpT(LOperand* left, LOperand* right) {
- inputs_[0] = left;
- inputs_[1] = right;
+ LClassOfTestAndBranch(LOperand* value, LOperand* temp1, LOperand* temp2) {
+ inputs_[0] = value;
+ temps_[0] = temp1;
+ temps_[1] = temp2;
}
- LOperand* left() { return inputs_[0]; }
- LOperand* right() { return inputs_[1]; }
-
- DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
- DECLARE_HYDROGEN_ACCESSOR(CompareGeneric)
-
- Token::Value op() const { return hydrogen()->token(); }
-};
-
-
-class LInstanceOf: public LTemplateInstruction<1, 2, 0> {
- public:
- LInstanceOf(LOperand* left, LOperand* right) {
- inputs_[0] = left;
- inputs_[1] = right;
- }
+ LOperand* value() { return inputs_[0]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
- LOperand* left() { return inputs_[0]; }
- LOperand* right() { return inputs_[1]; }
+ DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch,
+ "class-of-test-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch)
- DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
+ virtual void PrintDataTo(StringStream* stream);
};
-class LInstanceOfKnownGlobal: public LTemplateInstruction<1, 1, 1> {
+class LCmpMapAndBranch: public LControlInstruction<1, 1> {
public:
- LInstanceOfKnownGlobal(LOperand* value, LOperand* temp) {
+ LCmpMapAndBranch(LOperand* value, LOperand* temp) {
inputs_[0] = value;
temps_[0] = temp;
}
@@ -1046,54 +1051,32 @@ class LInstanceOfKnownGlobal: public LTemplateInstruction<1, 1, 1> {
LOperand* value() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
- "instance-of-known-global")
- DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal)
-
- Handle<JSFunction> function() const { return hydrogen()->function(); }
- LEnvironment* GetDeferredLazyDeoptimizationEnvironment() {
- return lazy_deopt_env_;
- }
- virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) {
- lazy_deopt_env_ = env;
- }
-
- private:
- LEnvironment* lazy_deopt_env_;
-};
-
-
-class LInstanceSize: public LTemplateInstruction<1, 1, 0> {
- public:
- explicit LInstanceSize(LOperand* object) {
- inputs_[0] = object;
- }
-
- LOperand* object() { return inputs_[0]; }
+ DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(CompareMap)
- DECLARE_CONCRETE_INSTRUCTION(InstanceSize, "instance-size")
- DECLARE_HYDROGEN_ACCESSOR(InstanceSize)
+ Handle<Map> map() const { return hydrogen()->map(); }
};
-class LBoundsCheck: public LTemplateInstruction<0, 2, 0> {
+class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> {
public:
- LBoundsCheck(LOperand* index, LOperand* length) {
- inputs_[0] = index;
- inputs_[1] = length;
+ LCmpObjectEqAndBranch(LOperand* left, LOperand* right) {
+ inputs_[0] = left;
+ inputs_[1] = right;
}
- LOperand* index() { return inputs_[0]; }
- LOperand* length() { return inputs_[1]; }
+ LOperand* left() { return inputs_[0]; }
+ LOperand* right() { return inputs_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check")
- DECLARE_HYDROGEN_ACCESSOR(BoundsCheck)
+ DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch,
+ "cmp-object-eq-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(CompareObjectEqAndBranch)
};
-class LBitI: public LTemplateInstruction<1, 2, 0> {
+class LCmpT: public LTemplateInstruction<1, 2, 0> {
public:
- LBitI(LOperand* left, LOperand* right) {
+ LCmpT(LOperand* left, LOperand* right) {
inputs_[0] = left;
inputs_[1] = right;
}
@@ -1101,46 +1084,41 @@ class LBitI: public LTemplateInstruction<1, 2, 0> {
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
- Token::Value op() const { return hydrogen()->op(); }
+ DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
+ DECLARE_HYDROGEN_ACCESSOR(CompareGeneric)
- DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i")
- DECLARE_HYDROGEN_ACCESSOR(Bitwise)
+ Token::Value op() const { return hydrogen()->token(); }
};
-class LShiftI: public LTemplateInstruction<1, 2, 0> {
+class LCmpIDAndBranch: public LControlInstruction<2, 0> {
public:
- LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt)
- : op_(op), can_deopt_(can_deopt) {
+ LCmpIDAndBranch(LOperand* left, LOperand* right) {
inputs_[0] = left;
inputs_[1] = right;
}
- Token::Value op() const { return op_; }
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
- bool can_deopt() const { return can_deopt_; }
- DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i")
+ DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(CompareIDAndBranch)
- private:
- Token::Value op_;
- bool can_deopt_;
+ Token::Value op() const { return hydrogen()->token(); }
+ bool is_double() const {
+ return hydrogen()->representation().IsDouble();
+ }
+
+ virtual void PrintDataTo(StringStream* stream);
};
-class LSubI: public LTemplateInstruction<1, 2, 0> {
+class LConstantD: public LTemplateInstruction<1, 0, 0> {
public:
- LSubI(LOperand* left, LOperand* right) {
- inputs_[0] = left;
- inputs_[1] = right;
- }
-
- LOperand* left() { return inputs_[0]; }
- LOperand* right() { return inputs_[1]; }
+ DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
+ DECLARE_HYDROGEN_ACCESSOR(Constant)
- DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i")
- DECLARE_HYDROGEN_ACCESSOR(Sub)
+ double value() const { return hydrogen()->DoubleValue(); }
};
@@ -1162,87 +1140,103 @@ class LConstantS: public LTemplateInstruction<1, 0, 0> {
};
-class LConstantD: public LTemplateInstruction<1, 0, 0> {
+class LConstantT: public LTemplateInstruction<1, 0, 0> {
public:
- DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
+ DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
DECLARE_HYDROGEN_ACCESSOR(Constant)
- double value() const { return hydrogen()->DoubleValue(); }
+ Handle<Object> value() const { return hydrogen()->handle(); }
};
-class LConstantT: public LTemplateInstruction<1, 0, 0> {
+class LContext: public LTemplateInstruction<1, 0, 0> {
public:
- DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
- DECLARE_HYDROGEN_ACCESSOR(Constant)
-
- Handle<Object> value() const { return hydrogen()->handle(); }
+ DECLARE_CONCRETE_INSTRUCTION(Context, "context")
+ DECLARE_HYDROGEN_ACCESSOR(Context)
};
-class LBranch: public LControlInstruction<1, 0> {
+class LDateField: public LTemplateInstruction<1, 1, 0> {
public:
- explicit LBranch(LOperand* value) {
- inputs_[0] = value;
+ LDateField(LOperand* date, Smi* index) : index_(index) {
+ inputs_[0] = date;
}
- LOperand* value() { return inputs_[0]; }
+ LOperand* date() { return inputs_[0]; }
+ Smi* index() const { return index_; }
- DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
- DECLARE_HYDROGEN_ACCESSOR(Branch)
+ DECLARE_CONCRETE_INSTRUCTION(DateField, "date-field")
+ DECLARE_HYDROGEN_ACCESSOR(DateField)
- virtual void PrintDataTo(StringStream* stream);
+ private:
+ Smi* index_;
};
-class LCmpMapAndBranch: public LTemplateInstruction<0, 1, 1> {
+class LDebugBreak: public LTemplateInstruction<0, 0, 0> {
public:
- LCmpMapAndBranch(LOperand* value, LOperand* temp) {
- inputs_[0] = value;
- temps_[0] = temp;
- }
+ DECLARE_CONCRETE_INSTRUCTION(DebugBreak, "break")
+};
- LOperand* value() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(CompareMap)
+class LDeoptimize: public LTemplateInstruction<0, 0, 0> {
+ public:
+ DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
+};
- virtual bool IsControl() const { return true; }
- Handle<Map> map() const { return hydrogen()->map(); }
- int true_block_id() const {
- return hydrogen()->FirstSuccessor()->block_id();
- }
- int false_block_id() const {
- return hydrogen()->SecondSuccessor()->block_id();
+class LDivI: public LTemplateInstruction<1, 2, 1> {
+ public:
+ LDivI(LOperand* left, LOperand* right, LOperand* temp) {
+ inputs_[0] = left;
+ inputs_[1] = right;
+ temps_[0] = temp;
}
+
+ LOperand* left() { return inputs_[0]; }
+ LOperand* right() { return inputs_[1]; }
+ LOperand* temp() { return temps_[0]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
+ DECLARE_HYDROGEN_ACCESSOR(Div)
};
-class LFixedArrayBaseLength: public LTemplateInstruction<1, 1, 0> {
+class LDoubleToI: public LTemplateInstruction<1, 1, 2> {
public:
- explicit LFixedArrayBaseLength(LOperand* value) {
+ LDoubleToI(LOperand* value, LOperand* temp1, LOperand* temp2) {
inputs_[0] = value;
+ temps_[0] = temp1;
+ temps_[1] = temp2;
}
LOperand* value() { return inputs_[0]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(FixedArrayBaseLength,
- "fixed-array-base-length")
- DECLARE_HYDROGEN_ACCESSOR(FixedArrayBaseLength)
+ DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
+ DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
+
+ bool truncating() { return hydrogen()->CanTruncateToInt32(); }
};
-class LMapEnumLength: public LTemplateInstruction<1, 1, 0> {
+class LDoubleToSmi: public LTemplateInstruction<1, 1, 2> {
public:
- explicit LMapEnumLength(LOperand* value) {
+ LDoubleToSmi(LOperand* value, LOperand* temp1, LOperand* temp2) {
inputs_[0] = value;
+ temps_[0] = temp1;
+ temps_[1] = temp2;
}
LOperand* value() { return inputs_[0]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(MapEnumLength, "map-enum-length")
+ DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-smi")
+ DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
+
+ bool truncating() { return hydrogen()->CanTruncateToInt32(); }
};
@@ -1259,341 +1253,256 @@ class LElementsKind: public LTemplateInstruction<1, 1, 0> {
};
-class LValueOf: public LTemplateInstruction<1, 1, 1> {
+class LForInCacheArray: public LTemplateInstruction<1, 1, 0> {
public:
- LValueOf(LOperand* value, LOperand* temp) {
- inputs_[0] = value;
- temps_[0] = temp;
+ explicit LForInCacheArray(LOperand* map) {
+ inputs_[0] = map;
}
- LOperand* value() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
+ LOperand* map() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of")
- DECLARE_HYDROGEN_ACCESSOR(ValueOf)
+ DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array")
+
+ int idx() {
+ return HForInCacheArray::cast(this->hydrogen_value())->idx();
+ }
};
-class LDateField: public LTemplateInstruction<1, 1, 1> {
+class LForInPrepareMap: public LTemplateInstruction<1, 1, 0> {
public:
- LDateField(LOperand* date, LOperand* temp, Smi* index) : index_(index) {
- inputs_[0] = date;
- temps_[0] = temp;
+ explicit LForInPrepareMap(LOperand* object) {
+ inputs_[0] = object;
}
- LOperand* date() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
- Smi* index() const { return index_; }
-
- DECLARE_CONCRETE_INSTRUCTION(ValueOf, "date-field")
- DECLARE_HYDROGEN_ACCESSOR(ValueOf)
+ LOperand* object() { return inputs_[0]; }
- private:
- Smi* index_;
+ DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map")
};
-class LSeqStringSetChar: public LTemplateInstruction<1, 3, 0> {
+class LGlobalObject: public LTemplateInstruction<1, 1, 0> {
public:
- LSeqStringSetChar(String::Encoding encoding,
- LOperand* string,
- LOperand* index,
- LOperand* value) : encoding_(encoding) {
- inputs_[0] = string;
- inputs_[1] = index;
- inputs_[2] = value;
+ explicit LGlobalObject(LOperand* context) {
+ inputs_[0] = context;
}
- String::Encoding encoding() { return encoding_; }
- LOperand* string() { return inputs_[0]; }
- LOperand* index() { return inputs_[1]; }
- LOperand* value() { return inputs_[2]; }
-
- DECLARE_CONCRETE_INSTRUCTION(SeqStringSetChar, "seq-string-set-char")
- DECLARE_HYDROGEN_ACCESSOR(SeqStringSetChar)
+ DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object")
- private:
- String::Encoding encoding_;
+ LOperand* context() { return inputs_[0]; }
};
-class LThrow: public LTemplateInstruction<0, 1, 0> {
+class LGlobalReceiver: public LTemplateInstruction<1, 1, 0> {
public:
- explicit LThrow(LOperand* value) {
- inputs_[0] = value;
+ explicit LGlobalReceiver(LOperand* global_object) {
+ inputs_[0] = global_object;
}
- LOperand* value() { return inputs_[0]; }
+ LOperand* global_object() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
+ DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver")
};
-class LBitNotI: public LTemplateInstruction<1, 1, 0> {
+class LHasInstanceTypeAndBranch: public LControlInstruction<1, 1> {
public:
- explicit LBitNotI(LOperand* value) {
+ LHasInstanceTypeAndBranch(LOperand* value, LOperand* temp) {
inputs_[0] = value;
+ temps_[0] = temp;
}
LOperand* value() { return inputs_[0]; }
+ LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i")
-};
-
-
-class LAddI: public LTemplateInstruction<1, 2, 0> {
- public:
- LAddI(LOperand* left, LOperand* right) {
- inputs_[0] = left;
- inputs_[1] = right;
- }
-
- LOperand* left() { return inputs_[0]; }
- LOperand* right() { return inputs_[1]; }
-
- DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i")
- DECLARE_HYDROGEN_ACCESSOR(Add)
-};
-
-
-class LMathMinMax: public LTemplateInstruction<1, 2, 0> {
- public:
- LMathMinMax(LOperand* left, LOperand* right) {
- inputs_[0] = left;
- inputs_[1] = right;
- }
-
- LOperand* left() { return inputs_[0]; }
- LOperand* right() { return inputs_[1]; }
-
- DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "math-min-max")
- DECLARE_HYDROGEN_ACCESSOR(MathMinMax)
-};
-
-
-class LPower: public LTemplateInstruction<1, 2, 0> {
- public:
- LPower(LOperand* left, LOperand* right) {
- inputs_[0] = left;
- inputs_[1] = right;
- }
-
- LOperand* left() { return inputs_[0]; }
- LOperand* right() { return inputs_[1]; }
+ DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
+ "has-instance-type-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch)
- DECLARE_CONCRETE_INSTRUCTION(Power, "power")
- DECLARE_HYDROGEN_ACCESSOR(Power)
+ virtual void PrintDataTo(StringStream* stream);
};
-class LRandom: public LTemplateInstruction<1, 1, 0> {
+class LIn: public LTemplateInstruction<1, 2, 0> {
public:
- explicit LRandom(LOperand* global_object) {
- inputs_[0] = global_object;
+ LIn(LOperand* key, LOperand* object) {
+ inputs_[0] = key;
+ inputs_[1] = object;
}
- LOperand* global_object() { return inputs_[0]; }
+ LOperand* key() { return inputs_[0]; }
+ LOperand* object() { return inputs_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(Random, "random")
- DECLARE_HYDROGEN_ACCESSOR(Random)
+ DECLARE_CONCRETE_INSTRUCTION(In, "in")
};
-class LArithmeticD: public LTemplateInstruction<1, 2, 0> {
+class LInnerAllocatedObject: public LTemplateInstruction<1, 1, 0> {
public:
- LArithmeticD(Token::Value op, LOperand* left, LOperand* right)
- : op_(op) {
- inputs_[0] = left;
- inputs_[1] = right;
+ explicit LInnerAllocatedObject(LOperand* base_object) {
+ inputs_[0] = base_object;
}
- Token::Value op() const { return op_; }
- LOperand* left() { return inputs_[0]; }
- LOperand* right() { return inputs_[1]; }
+ LOperand* base_object() { return inputs_[0]; }
+ int offset() { return hydrogen()->offset(); }
- virtual Opcode opcode() const { return LInstruction::kArithmeticD; }
- virtual void CompileToNative(LCodeGen* generator);
- virtual const char* Mnemonic() const;
+ virtual void PrintDataTo(StringStream* stream);
- private:
- Token::Value op_;
+ DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject, "sub-allocated-object")
+ DECLARE_HYDROGEN_ACCESSOR(InnerAllocatedObject)
};
-class LArithmeticT: public LTemplateInstruction<1, 2, 0> {
+class LInstanceOf: public LTemplateInstruction<1, 2, 0> {
public:
- LArithmeticT(Token::Value op, LOperand* left, LOperand* right)
- : op_(op) {
+ LInstanceOf(LOperand* left, LOperand* right) {
inputs_[0] = left;
inputs_[1] = right;
}
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
- Token::Value op() const { return op_; }
-
- virtual Opcode opcode() const { return LInstruction::kArithmeticT; }
- virtual void CompileToNative(LCodeGen* generator);
- virtual const char* Mnemonic() const;
- private:
- Token::Value op_;
+ DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
};
-class LReturn: public LTemplateInstruction<0, 2, 0> {
+class LInstanceOfKnownGlobal: public LTemplateInstruction<1, 1, 0> {
public:
- explicit LReturn(LOperand* value, LOperand* parameter_count) {
+ explicit LInstanceOfKnownGlobal(LOperand* value) {
inputs_[0] = value;
- inputs_[1] = parameter_count;
}
LOperand* value() { return inputs_[0]; }
- bool has_constant_parameter_count() {
- return parameter_count()->IsConstantOperand();
- }
- LConstantOperand* constant_parameter_count() {
- ASSERT(has_constant_parameter_count());
- return LConstantOperand::cast(parameter_count());
- }
- LOperand* parameter_count() { return inputs_[1]; }
-
- DECLARE_CONCRETE_INSTRUCTION(Return, "return")
-};
-
+ DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
+ "instance-of-known-global")
+ DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal)
-class LLoadNamedField: public LTemplateInstruction<1, 1, 0> {
- public:
- explicit LLoadNamedField(LOperand* object) {
- inputs_[0] = object;
+ Handle<JSFunction> function() const { return hydrogen()->function(); }
+ LEnvironment* GetDeferredLazyDeoptimizationEnvironment() {
+ return lazy_deopt_env_;
+ }
+ virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) {
+ lazy_deopt_env_ = env;
}
- LOperand* object() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field")
- DECLARE_HYDROGEN_ACCESSOR(LoadNamedField)
+ private:
+ LEnvironment* lazy_deopt_env_;
};
-class LLoadNamedFieldPolymorphic: public LTemplateInstruction<1, 1, 0> {
+class LInteger32ToDouble: public LTemplateInstruction<1, 1, 0> {
public:
- explicit LLoadNamedFieldPolymorphic(LOperand* object) {
- inputs_[0] = object;
+ explicit LInteger32ToDouble(LOperand* value) {
+ inputs_[0] = value;
}
- LOperand* object() { return inputs_[0]; }
+ LOperand* value() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field-polymorphic")
- DECLARE_HYDROGEN_ACCESSOR(LoadNamedFieldPolymorphic)
+ DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double")
};
-class LLoadNamedGeneric: public LTemplateInstruction<1, 1, 0> {
+class LInteger32ToSmi: public LTemplateInstruction<1, 1, 0> {
public:
- explicit LLoadNamedGeneric(LOperand* object) {
- inputs_[0] = object;
+ explicit LInteger32ToSmi(LOperand* value) {
+ inputs_[0] = value;
}
- LOperand* object() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
- DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
+ LOperand* value() { return inputs_[0]; }
- Handle<Object> name() const { return hydrogen()->name(); }
+ DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-smi")
+ DECLARE_HYDROGEN_ACCESSOR(Change)
};
-class LLoadFunctionPrototype: public LTemplateInstruction<1, 1, 0> {
+class LInvokeFunction: public LTemplateInstruction<1, 1, 0> {
public:
- explicit LLoadFunctionPrototype(LOperand* function) {
+ explicit LInvokeFunction(LOperand* function) {
inputs_[0] = function;
}
LOperand* function() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype")
- DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype)
+ DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
+ DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
+
+ virtual void PrintDataTo(StringStream* stream);
+
+ int arity() const { return hydrogen()->argument_count() - 1; }
};
-class LLoadExternalArrayPointer: public LTemplateInstruction<1, 1, 0> {
+class LIsConstructCallAndBranch: public LControlInstruction<0, 2> {
public:
- explicit LLoadExternalArrayPointer(LOperand* object) {
- inputs_[0] = object;
+ LIsConstructCallAndBranch(LOperand* temp1, LOperand* temp2) {
+ temps_[0] = temp1;
+ temps_[1] = temp2;
}
- LOperand* object() { return inputs_[0]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer,
- "load-external-array-pointer")
+ DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch,
+ "is-construct-call-and-branch")
};
-class LLoadKeyed: public LTemplateInstruction<1, 2, 0> {
+class LIsObjectAndBranch: public LControlInstruction<1, 2> {
public:
- LLoadKeyed(LOperand* elements, LOperand* key) {
- inputs_[0] = elements;
- inputs_[1] = key;
+ LIsObjectAndBranch(LOperand* value, LOperand* temp1, LOperand* temp2) {
+ inputs_[0] = value;
+ temps_[0] = temp1;
+ temps_[1] = temp2;
}
- LOperand* elements() { return inputs_[0]; }
- LOperand* key() { return inputs_[1]; }
- ElementsKind elements_kind() const {
- return hydrogen()->elements_kind();
- }
- bool is_external() const {
- return hydrogen()->is_external();
- }
+ LOperand* value() { return inputs_[0]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed")
- DECLARE_HYDROGEN_ACCESSOR(LoadKeyed)
+ DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(IsObjectAndBranch)
virtual void PrintDataTo(StringStream* stream);
- uint32_t additional_index() const { return hydrogen()->index_offset(); }
};
-class LLoadKeyedGeneric: public LTemplateInstruction<1, 2, 0> {
+class LIsStringAndBranch: public LControlInstruction<1, 1> {
public:
- LLoadKeyedGeneric(LOperand* object, LOperand* key) {
- inputs_[0] = object;
- inputs_[1] = key;
+ LIsStringAndBranch(LOperand* value, LOperand* temp) {
+ inputs_[0] = value;
+ temps_[0] = temp;
}
- LOperand* object() { return inputs_[0]; }
- LOperand* key() { return inputs_[1]; }
-
- DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
-};
+ LOperand* value() { return inputs_[0]; }
+ LOperand* temp() { return temps_[0]; }
+ DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch)
-class LLoadGlobalCell: public LTemplateInstruction<1, 0, 0> {
- public:
- DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load-global-cell")
- DECLARE_HYDROGEN_ACCESSOR(LoadGlobalCell)
+ virtual void PrintDataTo(StringStream* stream);
};
-class LLoadGlobalGeneric: public LTemplateInstruction<1, 1, 0> {
+class LIsSmiAndBranch: public LControlInstruction<1, 0> {
public:
- explicit LLoadGlobalGeneric(LOperand* global_object) {
- inputs_[0] = global_object;
+ explicit LIsSmiAndBranch(LOperand* value) {
+ inputs_[0] = value;
}
- LOperand* global_object() { return inputs_[0]; }
+ LOperand* value() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic")
- DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric)
+ DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch)
- Handle<Object> name() const { return hydrogen()->name(); }
- bool for_typeof() const { return hydrogen()->for_typeof(); }
+ virtual void PrintDataTo(StringStream* stream);
};
-class LStoreGlobalCell: public LTemplateInstruction<0, 1, 1> {
+class LIsUndetectableAndBranch: public LControlInstruction<1, 1> {
public:
- LStoreGlobalCell(LOperand* value, LOperand* temp) {
+ explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) {
inputs_[0] = value;
temps_[0] = temp;
}
@@ -1601,27 +1510,11 @@ class LStoreGlobalCell: public LTemplateInstruction<0, 1, 1> {
LOperand* value() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell")
- DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell)
-};
-
-
-class LStoreGlobalGeneric: public LTemplateInstruction<0, 2, 0> {
- public:
- explicit LStoreGlobalGeneric(LOperand* global_object,
- LOperand* value) {
- inputs_[0] = global_object;
- inputs_[1] = value;
- }
-
- LOperand* global_object() { return inputs_[0]; }
- LOperand* value() { return inputs_[1]; }
-
- DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store-global-generic")
- DECLARE_HYDROGEN_ACCESSOR(StoreGlobalGeneric)
+ DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch,
+ "is-undetectable-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch)
- Handle<Object> name() const { return hydrogen()->name(); }
- StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); }
+ virtual void PrintDataTo(StringStream* stream);
};
@@ -1642,403 +1535,505 @@ class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> {
};
-class LStoreContextSlot: public LTemplateInstruction<0, 2, 0> {
+class LLoadNamedField: public LTemplateInstruction<1, 1, 0> {
public:
- LStoreContextSlot(LOperand* context, LOperand* value) {
- inputs_[0] = context;
- inputs_[1] = value;
+ explicit LLoadNamedField(LOperand* object) {
+ inputs_[0] = object;
}
- LOperand* context() { return inputs_[0]; }
- LOperand* value() { return inputs_[1]; }
+ LOperand* object() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
- DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
+ DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field")
+ DECLARE_HYDROGEN_ACCESSOR(LoadNamedField)
+};
- int slot_index() { return hydrogen()->slot_index(); }
- virtual void PrintDataTo(StringStream* stream);
+class LLoadNamedFieldPolymorphic: public LTemplateInstruction<1, 1, 0> {
+ public:
+ explicit LLoadNamedFieldPolymorphic(LOperand* object) {
+ inputs_[0] = object;
+ }
+
+ LOperand* object() { return inputs_[0]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field-polymorphic")
+ DECLARE_HYDROGEN_ACCESSOR(LoadNamedFieldPolymorphic)
+};
+
+
+class LFixedArrayBaseLength: public LTemplateInstruction<1, 1, 0> {
+ public:
+ explicit LFixedArrayBaseLength(LOperand* value) {
+ inputs_[0] = value;
+ }
+
+ LOperand* value() { return inputs_[0]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(FixedArrayBaseLength, "fixed-array-base-length")
+ DECLARE_HYDROGEN_ACCESSOR(FixedArrayBaseLength)
+};
+
+
+class LFunctionLiteral: public LTemplateInstruction<1, 0, 0> {
+ public:
+ DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal")
+ DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral)
};
-class LPushArgument: public LTemplateInstruction<0, 1, 0> {
+class LLoadExternalArrayPointer: public LTemplateInstruction<1, 1, 0> {
public:
- explicit LPushArgument(LOperand* value) {
- inputs_[0] = value;
+ explicit LLoadExternalArrayPointer(LOperand* object) {
+ inputs_[0] = object;
}
- LOperand* value() { return inputs_[0]; }
+ LOperand* object() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
+ DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer,
+ "load-external-array-pointer")
};
-class LDrop: public LTemplateInstruction<0, 0, 0> {
+class LLoadFunctionPrototype: public LTemplateInstruction<1, 1, 1> {
public:
- explicit LDrop(int count) : count_(count) { }
+ LLoadFunctionPrototype(LOperand* function, LOperand* temp) {
+ inputs_[0] = function;
+ temps_[0] = temp;
+ }
- int count() const { return count_; }
+ LOperand* function() { return inputs_[0]; }
+ LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(Drop, "drop")
+ DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype")
+ DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype)
+};
- private:
- int count_;
+
+class LLoadGlobalCell: public LTemplateInstruction<1, 0, 0> {
+ public:
+ DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load-global-cell")
+ DECLARE_HYDROGEN_ACCESSOR(LoadGlobalCell)
};
-class LInnerAllocatedObject: public LTemplateInstruction<1, 1, 0> {
+class LLoadGlobalGeneric: public LTemplateInstruction<1, 1, 0> {
public:
- explicit LInnerAllocatedObject(LOperand* base_object) {
- inputs_[0] = base_object;
+ explicit LLoadGlobalGeneric(LOperand* global_object) {
+ inputs_[0] = global_object;
}
- LOperand* base_object() { return inputs_[0]; }
- int offset() { return hydrogen()->offset(); }
+ LOperand* global_object() { return inputs_[0]; }
- virtual void PrintDataTo(StringStream* stream);
+ DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic")
+ DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric)
- DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject, "sub-allocated-object")
- DECLARE_HYDROGEN_ACCESSOR(InnerAllocatedObject)
+ Handle<Object> name() const { return hydrogen()->name(); }
+ bool for_typeof() const { return hydrogen()->for_typeof(); }
};
-class LThisFunction: public LTemplateInstruction<1, 0, 0> {
+template<int T>
+class LLoadKeyed: public LTemplateInstruction<1, 2, T> {
public:
- DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function")
- DECLARE_HYDROGEN_ACCESSOR(ThisFunction)
-};
+ LLoadKeyed(LOperand* elements, LOperand* key) {
+ this->inputs_[0] = elements;
+ this->inputs_[1] = key;
+ }
+ LOperand* elements() { return this->inputs_[0]; }
+ LOperand* key() { return this->inputs_[1]; }
+ ElementsKind elements_kind() const {
+ return this->hydrogen()->elements_kind();
+ }
+ bool is_external() const {
+ return this->hydrogen()->is_external();
+ }
+ uint32_t additional_index() const {
+ return this->hydrogen()->index_offset();
+ }
+ void PrintDataTo(StringStream* stream) {
+ this->elements()->PrintTo(stream);
+ stream->Add("[");
+ this->key()->PrintTo(stream);
+ if (this->hydrogen()->IsDehoisted()) {
+ stream->Add(" + %d]", this->additional_index());
+ } else {
+ stream->Add("]");
+ }
+ }
-class LContext: public LTemplateInstruction<1, 0, 0> {
- public:
- DECLARE_CONCRETE_INSTRUCTION(Context, "context")
- DECLARE_HYDROGEN_ACCESSOR(Context)
+ DECLARE_HYDROGEN_ACCESSOR(LoadKeyed)
};
-class LOuterContext: public LTemplateInstruction<1, 1, 0> {
+class LLoadKeyedExternal: public LLoadKeyed<1> {
public:
- explicit LOuterContext(LOperand* context) {
- inputs_[0] = context;
+ LLoadKeyedExternal(LOperand* elements, LOperand* key, LOperand* temp) :
+ LLoadKeyed<1>(elements, key) {
+ temps_[0] = temp;
}
- LOperand* context() { return inputs_[0]; }
+ LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context")
+ DECLARE_CONCRETE_INSTRUCTION(LoadKeyedExternal, "load-keyed-external");
};
-class LDeclareGlobals: public LTemplateInstruction<0, 0, 0> {
+class LLoadKeyedFixed: public LLoadKeyed<1> {
public:
- DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals")
- DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals)
+ LLoadKeyedFixed(LOperand* elements, LOperand* key, LOperand* temp) :
+ LLoadKeyed<1>(elements, key) {
+ temps_[0] = temp;
+ }
+
+ LOperand* temp() { return temps_[0]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFixed, "load-keyed-fixed");
};
-class LGlobalObject: public LTemplateInstruction<1, 1, 0> {
+class LLoadKeyedFixedDouble: public LLoadKeyed<1> {
public:
- explicit LGlobalObject(LOperand* context) {
- inputs_[0] = context;
+ LLoadKeyedFixedDouble(LOperand* elements, LOperand* key, LOperand* temp) :
+ LLoadKeyed<1>(elements, key) {
+ temps_[0] = temp;
}
- LOperand* context() { return inputs_[0]; }
+ LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object")
+ DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFixedDouble, "load-keyed-fixed-double");
};
-class LGlobalReceiver: public LTemplateInstruction<1, 1, 0> {
+class LLoadKeyedGeneric: public LTemplateInstruction<1, 2, 0> {
public:
- explicit LGlobalReceiver(LOperand* global_object) {
- inputs_[0] = global_object;
+ LLoadKeyedGeneric(LOperand* object, LOperand* key) {
+ inputs_[0] = object;
+ inputs_[1] = key;
}
- LOperand* global_object() { return inputs_[0]; }
+ LOperand* object() { return inputs_[0]; }
+ LOperand* key() { return inputs_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver")
+ DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
};
-class LCallConstantFunction: public LTemplateInstruction<1, 0, 0> {
+class LLoadNamedGeneric: public LTemplateInstruction<1, 1, 0> {
public:
- DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function")
- DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction)
+ explicit LLoadNamedGeneric(LOperand* object) {
+ inputs_[0] = object;
+ }
- virtual void PrintDataTo(StringStream* stream);
+ LOperand* object() { return inputs_[0]; }
- Handle<JSFunction> function() { return hydrogen()->function(); }
- int arity() const { return hydrogen()->argument_count() - 1; }
+ DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
+ DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
+
+ Handle<Object> name() const { return hydrogen()->name(); }
};
-class LInvokeFunction: public LTemplateInstruction<1, 1, 0> {
+class LMapEnumLength: public LTemplateInstruction<1, 1, 0> {
public:
- explicit LInvokeFunction(LOperand* function) {
- inputs_[0] = function;
+ explicit LMapEnumLength(LOperand* value) {
+ inputs_[0] = value;
}
- LOperand* function() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
- DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
-
- virtual void PrintDataTo(StringStream* stream);
+ LOperand* value() { return inputs_[0]; }
- int arity() const { return hydrogen()->argument_count() - 1; }
+ DECLARE_CONCRETE_INSTRUCTION(MapEnumLength, "map-enum-length")
};
-class LCallKeyed: public LTemplateInstruction<1, 1, 0> {
+template<int T>
+class LUnaryMathOperation: public LTemplateInstruction<1, 1, T> {
public:
- explicit LCallKeyed(LOperand* key) {
- inputs_[0] = key;
+ explicit LUnaryMathOperation(LOperand* value) {
+ this->inputs_[0] = value;
}
- LOperand* key() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed")
- DECLARE_HYDROGEN_ACCESSOR(CallKeyed)
+ LOperand* value() { return this->inputs_[0]; }
+ BuiltinFunctionId op() const { return this->hydrogen()->op(); }
- virtual void PrintDataTo(StringStream* stream);
+ void PrintDataTo(StringStream* stream);
- int arity() const { return hydrogen()->argument_count() - 1; }
+ DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
};
-
-class LCallNamed: public LTemplateInstruction<1, 0, 0> {
+class LMathAbs: public LUnaryMathOperation<0> {
public:
- DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call-named")
- DECLARE_HYDROGEN_ACCESSOR(CallNamed)
-
- virtual void PrintDataTo(StringStream* stream);
-
- Handle<String> name() const { return hydrogen()->name(); }
- int arity() const { return hydrogen()->argument_count() - 1; }
+ explicit LMathAbs(LOperand* value) : LUnaryMathOperation<0>(value) { }
+ DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs")
};
-class LCallFunction: public LTemplateInstruction<1, 1, 0> {
+class LMathAbsTagged: public LUnaryMathOperation<3> {
public:
- explicit LCallFunction(LOperand* function) {
- inputs_[0] = function;
+ LMathAbsTagged(LOperand* value,
+ LOperand* temp1, LOperand* temp2, LOperand* temp3)
+ : LUnaryMathOperation<3>(value) {
+ temps_[0] = temp1;
+ temps_[1] = temp2;
+ temps_[2] = temp3;
}
- LOperand* function() { return inputs_[0]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
+ LOperand* temp3() { return temps_[2]; }
- DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
- DECLARE_HYDROGEN_ACCESSOR(CallFunction)
+ DECLARE_CONCRETE_INSTRUCTION(MathAbsTagged, "math-abs-tagged")
+};
- int arity() const { return hydrogen()->argument_count() - 1; }
+
+class LMathCos: public LUnaryMathOperation<0> {
+ public:
+ explicit LMathCos(LOperand* value) : LUnaryMathOperation<0>(value) { }
+ DECLARE_CONCRETE_INSTRUCTION(MathCos, "math-cos")
};
-class LCallGlobal: public LTemplateInstruction<1, 0, 0> {
+class LMathExp: public LUnaryMathOperation<4> {
public:
- DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global")
- DECLARE_HYDROGEN_ACCESSOR(CallGlobal)
+ LMathExp(LOperand* value,
+ LOperand* double_temp1,
+ LOperand* temp1,
+ LOperand* temp2,
+ LOperand* temp3)
+ : LUnaryMathOperation<4>(value) {
+ temps_[0] = double_temp1;
+ temps_[1] = temp1;
+ temps_[2] = temp2;
+ temps_[3] = temp3;
+ ExternalReference::InitializeMathExpData();
+ }
- virtual void PrintDataTo(StringStream* stream);
+ LOperand* double_temp1() { return temps_[0]; }
+ LOperand* temp1() { return temps_[1]; }
+ LOperand* temp2() { return temps_[2]; }
+ LOperand* temp3() { return temps_[3]; }
- Handle<String> name() const {return hydrogen()->name(); }
- int arity() const { return hydrogen()->argument_count() - 1; }
+ DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp")
};
-class LCallKnownGlobal: public LTemplateInstruction<1, 0, 0> {
+class LMathFloor: public LUnaryMathOperation<0> {
public:
- DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global")
- DECLARE_HYDROGEN_ACCESSOR(CallKnownGlobal)
+ explicit LMathFloor(LOperand* value) : LUnaryMathOperation<0>(value) { }
+ DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor")
+};
- virtual void PrintDataTo(StringStream* stream);
- int arity() const { return hydrogen()->argument_count() - 1; }
+class LMathLog: public LUnaryMathOperation<0> {
+ public:
+ explicit LMathLog(LOperand* value) : LUnaryMathOperation<0>(value) { }
+ DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log")
};
-class LCallNew: public LTemplateInstruction<1, 1, 0> {
+class LMathMinMax: public LTemplateInstruction<1, 2, 0> {
public:
- explicit LCallNew(LOperand* constructor) {
- inputs_[0] = constructor;
+ LMathMinMax(LOperand* left, LOperand* right) {
+ inputs_[0] = left;
+ inputs_[1] = right;
}
- LOperand* constructor() { return inputs_[0]; }
+ LOperand* left() { return inputs_[0]; }
+ LOperand* right() { return inputs_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new")
- DECLARE_HYDROGEN_ACCESSOR(CallNew)
+ DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "math-min-max")
+ DECLARE_HYDROGEN_ACCESSOR(MathMinMax)
+};
- virtual void PrintDataTo(StringStream* stream);
- int arity() const { return hydrogen()->argument_count() - 1; }
+class LMathPowHalf: public LUnaryMathOperation<0> {
+ public:
+ explicit LMathPowHalf(LOperand* value) : LUnaryMathOperation<0>(value) { }
+ DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half")
};
-class LCallNewArray: public LTemplateInstruction<1, 1, 0> {
+class LMathRound: public LUnaryMathOperation<1> {
public:
- explicit LCallNewArray(LOperand* constructor) {
- inputs_[0] = constructor;
+ LMathRound(LOperand* value, LOperand* temp1)
+ : LUnaryMathOperation<1>(value) {
+ temps_[0] = temp1;
}
- LOperand* constructor() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(CallNewArray, "call-new-array")
- DECLARE_HYDROGEN_ACCESSOR(CallNewArray)
-
- virtual void PrintDataTo(StringStream* stream);
+ LOperand* temp1() { return temps_[0]; }
- int arity() const { return hydrogen()->argument_count() - 1; }
+ DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round")
};
-class LCallRuntime: public LTemplateInstruction<1, 0, 0> {
+class LMathSin: public LUnaryMathOperation<0> {
public:
- DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
- DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
-
- const Runtime::Function* function() const { return hydrogen()->function(); }
- int arity() const { return hydrogen()->argument_count(); }
+ explicit LMathSin(LOperand* value) : LUnaryMathOperation<0>(value) { }
+ DECLARE_CONCRETE_INSTRUCTION(MathSin, "math-sin")
};
-class LInteger32ToDouble: public LTemplateInstruction<1, 1, 0> {
+class LMathSqrt: public LUnaryMathOperation<0> {
public:
- explicit LInteger32ToDouble(LOperand* value) {
- inputs_[0] = value;
- }
+ explicit LMathSqrt(LOperand* value) : LUnaryMathOperation<0>(value) { }
+ DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt")
+};
- LOperand* value() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double")
+class LMathTan: public LUnaryMathOperation<0> {
+ public:
+ explicit LMathTan(LOperand* value) : LUnaryMathOperation<0>(value) { }
+ DECLARE_CONCRETE_INSTRUCTION(MathTan, "math-tan")
};
-class LInteger32ToSmi: public LTemplateInstruction<1, 1, 0> {
+class LMulConstI: public LTemplateInstruction<1, 2, 0> {
public:
- explicit LInteger32ToSmi(LOperand* value) {
- inputs_[0] = value;
+ LMulConstI(LOperand* left, LConstantOperand* right) {
+ inputs_[0] = left;
+ inputs_[1] = right;
}
- LOperand* value() { return inputs_[0]; }
+ LOperand* left() { return inputs_[0]; }
+ LConstantOperand* right() { return LConstantOperand::cast(inputs_[1]); }
- DECLARE_CONCRETE_INSTRUCTION(Integer32ToSmi, "int32-to-smi")
- DECLARE_HYDROGEN_ACCESSOR(Change)
+ DECLARE_CONCRETE_INSTRUCTION(MulConstI, "mul-const-i")
+ DECLARE_HYDROGEN_ACCESSOR(Mul)
};
-class LUint32ToDouble: public LTemplateInstruction<1, 1, 0> {
+class LMulI: public LTemplateInstruction<1, 2, 0> {
public:
- explicit LUint32ToDouble(LOperand* value) {
- inputs_[0] = value;
+ LMulI(LOperand* left, LOperand* right) {
+ inputs_[0] = left;
+ inputs_[1] = right;
}
- LOperand* value() { return inputs_[0]; }
+ LOperand* left() { return inputs_[0]; }
+ LOperand* right() { return inputs_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double")
+ DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
+ DECLARE_HYDROGEN_ACCESSOR(Mul)
};
-class LNumberTagI: public LTemplateInstruction<1, 1, 0> {
+class LNumberTagD: public LTemplateInstruction<1, 1, 2> {
public:
- explicit LNumberTagI(LOperand* value) {
+ LNumberTagD(LOperand* value, LOperand* temp1, LOperand* temp2) {
inputs_[0] = value;
+ temps_[0] = temp1;
+ temps_[1] = temp2;
}
LOperand* value() { return inputs_[0]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i")
+ DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d")
+ DECLARE_HYDROGEN_ACCESSOR(Change)
};
-class LNumberTagU: public LTemplateInstruction<1, 1, 0> {
+class LNumberTagU: public LTemplateInstruction<1, 1, 2> {
public:
- explicit LNumberTagU(LOperand* value) {
+ explicit LNumberTagU(LOperand* value,
+ LOperand* temp1,
+ LOperand* temp2) {
inputs_[0] = value;
+ temps_[0] = temp1;
+ temps_[1] = temp2;
}
LOperand* value() { return inputs_[0]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u")
};
-class LNumberTagD: public LTemplateInstruction<1, 1, 2> {
+class LNumberUntagD: public LTemplateInstruction<1, 1, 1> {
public:
- LNumberTagD(LOperand* value, LOperand* temp, LOperand* temp2) {
+ LNumberUntagD(LOperand* value, LOperand* temp) {
inputs_[0] = value;
temps_[0] = temp;
- temps_[1] = temp2;
}
LOperand* value() { return inputs_[0]; }
+
LOperand* temp() { return temps_[0]; }
- LOperand* temp2() { return temps_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d")
+ DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
DECLARE_HYDROGEN_ACCESSOR(Change)
};
-class LDoubleToSmi: public LTemplateInstruction<1, 1, 2> {
+class LParameter: public LTemplateInstruction<1, 0, 0> {
+ public:
+ virtual bool HasInterestingComment(LCodeGen* gen) const { return false; }
+ DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
+};
+
+
+class LPushArgument: public LTemplateInstruction<0, 1, 0> {
public:
- LDoubleToSmi(LOperand* value, LOperand* temp, LOperand* temp2) {
+ explicit LPushArgument(LOperand* value) {
inputs_[0] = value;
- temps_[0] = temp;
- temps_[1] = temp2;
}
LOperand* value() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
- LOperand* temp2() { return temps_[1]; }
-
- DECLARE_CONCRETE_INSTRUCTION(DoubleToSmi, "double-to-smi")
- DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
- bool truncating() { return hydrogen()->CanTruncateToInt32(); }
+ DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
};
-// Sometimes truncating conversion from a tagged value to an int32.
-class LDoubleToI: public LTemplateInstruction<1, 1, 2> {
+class LReturn: public LTemplateInstruction<0, 2, 0> {
public:
- LDoubleToI(LOperand* value, LOperand* temp, LOperand* temp2) {
+ LReturn(LOperand* value, LOperand* parameter_count) {
inputs_[0] = value;
- temps_[0] = temp;
- temps_[1] = temp2;
+ inputs_[1] = parameter_count;
}
LOperand* value() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
- LOperand* temp2() { return temps_[1]; }
+ LOperand* parameter_count() { return inputs_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
- DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
+ bool has_constant_parameter_count() {
+ return parameter_count()->IsConstantOperand();
+ }
+ LConstantOperand* constant_parameter_count() {
+ ASSERT(has_constant_parameter_count());
+ return LConstantOperand::cast(parameter_count());
+ }
- bool truncating() { return hydrogen()->CanTruncateToInt32(); }
+ DECLARE_CONCRETE_INSTRUCTION(Return, "return")
};
-// Truncating conversion from a tagged value to an int32.
-class LTaggedToI: public LTemplateInstruction<1, 1, 3> {
+class LSeqStringSetChar: public LTemplateInstruction<1, 3, 1> {
public:
- LTaggedToI(LOperand* value,
- LOperand* temp,
- LOperand* temp2,
- LOperand* temp3) {
- inputs_[0] = value;
+ LSeqStringSetChar(String::Encoding encoding,
+ LOperand* string,
+ LOperand* index,
+ LOperand* value,
+ LOperand* temp) : encoding_(encoding) {
+ inputs_[0] = string;
+ inputs_[1] = index;
+ inputs_[2] = value;
temps_[0] = temp;
- temps_[1] = temp2;
- temps_[2] = temp3;
}
- LOperand* value() { return inputs_[0]; }
+ String::Encoding encoding() { return encoding_; }
+ LOperand* string() { return inputs_[0]; }
+ LOperand* index() { return inputs_[1]; }
+ LOperand* value() { return inputs_[2]; }
LOperand* temp() { return temps_[0]; }
- LOperand* temp2() { return temps_[1]; }
- LOperand* temp3() { return temps_[2]; }
- DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
- DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
+ DECLARE_CONCRETE_INSTRUCTION(SeqStringSetChar, "seq-string-set-char")
+ DECLARE_HYDROGEN_ACCESSOR(SeqStringSetChar)
- bool truncating() { return hydrogen()->CanTruncateToInt32(); }
+ private:
+ String::Encoding encoding_;
};
@@ -2054,19 +2049,6 @@ class LSmiTag: public LTemplateInstruction<1, 1, 0> {
};
-class LNumberUntagD: public LTemplateInstruction<1, 1, 0> {
- public:
- explicit LNumberUntagD(LOperand* value) {
- inputs_[0] = value;
- }
-
- LOperand* value() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
- DECLARE_HYDROGEN_ACCESSOR(Change)
-};
-
-
class LSmiUntag: public LTemplateInstruction<1, 1, 0> {
public:
LSmiUntag(LOperand* value, bool needs_check)
@@ -2084,72 +2066,103 @@ class LSmiUntag: public LTemplateInstruction<1, 1, 0> {
};
-class LStoreNamedField: public LTemplateInstruction<0, 2, 1> {
+class LStackCheck: public LTemplateInstruction<0, 0, 0> {
public:
- LStoreNamedField(LOperand* object, LOperand* value, LOperand* temp) {
- inputs_[0] = object;
- inputs_[1] = value;
- temps_[0] = temp;
+ DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
+ DECLARE_HYDROGEN_ACCESSOR(StackCheck)
+
+ Label* done_label() { return &done_label_; }
+
+ private:
+ Label done_label_;
+};
+
+
+template<int T>
+class LStoreKeyed: public LTemplateInstruction<0, 3, T> {
+ public:
+ LStoreKeyed(LOperand* elements, LOperand* key, LOperand* value) {
+ this->inputs_[0] = elements;
+ this->inputs_[1] = key;
+ this->inputs_[2] = value;
}
- LOperand* object() { return inputs_[0]; }
- LOperand* value() { return inputs_[1]; }
- LOperand* temp() { return temps_[0]; }
+ bool is_external() const { return this->hydrogen()->is_external(); }
+ LOperand* elements() { return this->inputs_[0]; }
+ LOperand* key() { return this->inputs_[1]; }
+ LOperand* value() { return this->inputs_[2]; }
+ ElementsKind elements_kind() const {
+ return this->hydrogen()->elements_kind();
+ }
- DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
- DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
+ bool NeedsCanonicalization() {
+ return this->hydrogen()->NeedsCanonicalization();
+ }
+ uint32_t additional_index() const { return this->hydrogen()->index_offset(); }
- virtual void PrintDataTo(StringStream* stream);
+ void PrintDataTo(StringStream* stream) {
+ this->elements()->PrintTo(stream);
+ stream->Add("[");
+ this->key()->PrintTo(stream);
+ if (this->hydrogen()->IsDehoisted()) {
+ stream->Add(" + %d] <-", this->additional_index());
+ } else {
+ stream->Add("] <- ");
+ }
- Handle<Map> transition() const { return hydrogen()->transition(); }
- Representation representation() const {
- return hydrogen()->field_representation();
+ if (this->value() == NULL) {
+ ASSERT(hydrogen()->IsConstantHoleStore() &&
+ hydrogen()->value()->representation().IsDouble());
+ stream->Add("<the hole(nan)>");
+ } else {
+ this->value()->PrintTo(stream);
+ }
}
+
+ DECLARE_HYDROGEN_ACCESSOR(StoreKeyed)
};
-class LStoreNamedGeneric: public LTemplateInstruction<0, 2, 0> {
+class LStoreKeyedExternal: public LStoreKeyed<1> {
public:
- LStoreNamedGeneric(LOperand* object, LOperand* value) {
- inputs_[0] = object;
- inputs_[1] = value;
- }
+ LStoreKeyedExternal(LOperand* elements, LOperand* key, LOperand* value,
+ LOperand* temp) :
+ LStoreKeyed<1>(elements, key, value) {
+ temps_[0] = temp;
+ };
- LOperand* object() { return inputs_[0]; }
- LOperand* value() { return inputs_[1]; }
+ LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
- DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
+ DECLARE_CONCRETE_INSTRUCTION(StoreKeyedExternal, "store-keyed-external")
+};
- virtual void PrintDataTo(StringStream* stream);
- Handle<Object> name() const { return hydrogen()->name(); }
- StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); }
+class LStoreKeyedFixed: public LStoreKeyed<1> {
+ public:
+ LStoreKeyedFixed(LOperand* elements, LOperand* key, LOperand* value,
+ LOperand* temp) :
+ LStoreKeyed<1>(elements, key, value) {
+ temps_[0] = temp;
+ };
+
+ LOperand* temp() { return temps_[0]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFixed, "store-keyed-fixed")
};
-class LStoreKeyed: public LTemplateInstruction<0, 3, 0> {
+class LStoreKeyedFixedDouble: public LStoreKeyed<1> {
public:
- LStoreKeyed(LOperand* object, LOperand* key, LOperand* value) {
- inputs_[0] = object;
- inputs_[1] = key;
- inputs_[2] = value;
- }
-
- bool is_external() const { return hydrogen()->is_external(); }
- LOperand* elements() { return inputs_[0]; }
- LOperand* key() { return inputs_[1]; }
- LOperand* value() { return inputs_[2]; }
- ElementsKind elements_kind() const {
- return hydrogen()->elements_kind();
- }
+ LStoreKeyedFixedDouble(LOperand* elements, LOperand* key, LOperand* value,
+ LOperand* temp) :
+ LStoreKeyed<1>(elements, key, value) {
+ temps_[0] = temp;
+ };
- DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed")
- DECLARE_HYDROGEN_ACCESSOR(StoreKeyed)
+ LOperand* temp() { return temps_[0]; }
- virtual void PrintDataTo(StringStream* stream);
- bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); }
- uint32_t additional_index() const { return hydrogen()->index_offset(); }
+ DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFixedDouble,
+ "store-keyed-fixed-double")
};
@@ -2174,46 +2187,50 @@ class LStoreKeyedGeneric: public LTemplateInstruction<0, 3, 0> {
};
-class LTransitionElementsKind: public LTemplateInstruction<0, 1, 2> {
+class LStoreNamedField: public LTemplateInstruction<0, 2, 2> {
public:
- LTransitionElementsKind(LOperand* object,
- LOperand* new_map_temp,
- LOperand* fixed_object_temp) {
+ LStoreNamedField(LOperand* object, LOperand* value,
+ LOperand* temp0, LOperand* temp1) {
inputs_[0] = object;
- temps_[0] = new_map_temp;
- temps_[1] = fixed_object_temp;
+ inputs_[1] = value;
+ temps_[0] = temp0;
+ temps_[1] = temp1;
}
LOperand* object() { return inputs_[0]; }
- LOperand* new_map_temp() { return temps_[0]; }
- LOperand* temp() { return temps_[1]; }
+ LOperand* value() { return inputs_[1]; }
+ LOperand* temp0() { return temps_[0]; }
+ LOperand* temp1() { return temps_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind,
- "transition-elements-kind")
- DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind)
+ DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
+ DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
virtual void PrintDataTo(StringStream* stream);
- Handle<Map> original_map() { return hydrogen()->original_map(); }
- Handle<Map> transitioned_map() { return hydrogen()->transitioned_map(); }
- ElementsKind from_kind() { return hydrogen()->from_kind(); }
- ElementsKind to_kind() { return hydrogen()->to_kind(); }
+ Handle<Map> transition() const { return hydrogen()->transition(); }
+ Representation representation() const {
+ return hydrogen()->field_representation();
+ }
};
-class LTrapAllocationMemento : public LTemplateInstruction<0, 1, 1> {
+class LStoreNamedGeneric: public LTemplateInstruction<0, 2, 0> {
public:
- LTrapAllocationMemento(LOperand* object,
- LOperand* temp) {
+ LStoreNamedGeneric(LOperand* object, LOperand* value) {
inputs_[0] = object;
- temps_[0] = temp;
+ inputs_[1] = value;
}
LOperand* object() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
+ LOperand* value() { return inputs_[1]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
+ DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
+
+ virtual void PrintDataTo(StringStream* stream);
- DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento,
- "trap-allocation-memento")
+ Handle<Object> name() const { return hydrogen()->name(); }
+ StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); }
};
@@ -2264,327 +2281,274 @@ class LStringCharFromCode: public LTemplateInstruction<1, 1, 0> {
class LStringLength: public LTemplateInstruction<1, 1, 0> {
public:
explicit LStringLength(LOperand* string) {
- inputs_[0] = string;
- }
-
- LOperand* string() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length")
- DECLARE_HYDROGEN_ACCESSOR(StringLength)
-};
-
-
-class LCheckFunction: public LTemplateInstruction<0, 1, 0> {
- public:
- explicit LCheckFunction(LOperand* value) {
- inputs_[0] = value;
- }
-
- LOperand* value() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function")
- DECLARE_HYDROGEN_ACCESSOR(CheckFunction)
-};
-
-
-class LCheckInstanceType: public LTemplateInstruction<0, 1, 0> {
- public:
- explicit LCheckInstanceType(LOperand* value) {
- inputs_[0] = value;
- }
-
- LOperand* value() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
- DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
-};
-
-
-class LCheckMaps: public LTemplateInstruction<0, 1, 0> {
- public:
- explicit LCheckMaps(LOperand* value) {
- inputs_[0] = value;
- }
-
- LOperand* value() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps")
- DECLARE_HYDROGEN_ACCESSOR(CheckMaps)
-};
-
-
-class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 2> {
- public:
- LCheckPrototypeMaps(LOperand* temp, LOperand* temp2) {
- temps_[0] = temp;
- temps_[1] = temp2;
- }
-
- LOperand* temp() { return temps_[0]; }
- LOperand* temp2() { return temps_[1]; }
-
- DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps")
- DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps)
-
- ZoneList<Handle<JSObject> >* prototypes() const {
- return hydrogen()->prototypes();
- }
- ZoneList<Handle<Map> >* maps() const { return hydrogen()->maps(); }
-};
-
-
-class LCheckSmi: public LTemplateInstruction<1, 1, 0> {
- public:
- explicit LCheckSmi(LOperand* value) {
- inputs_[0] = value;
- }
-
- LOperand* value() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi")
-};
-
-
-class LCheckNonSmi: public LTemplateInstruction<0, 1, 0> {
- public:
- explicit LCheckNonSmi(LOperand* value) {
- inputs_[0] = value;
+ inputs_[0] = string;
}
- LOperand* value() { return inputs_[0]; }
+ LOperand* string() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi")
+ DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length")
+ DECLARE_HYDROGEN_ACCESSOR(StringLength)
};
-class LClampDToUint8: public LTemplateInstruction<1, 1, 1> {
+// Truncating conversion from a tagged value to an int32.
+class LTaggedToI: public LTemplateInstruction<1, 1, 2> {
public:
- LClampDToUint8(LOperand* unclamped, LOperand* temp) {
- inputs_[0] = unclamped;
- temps_[0] = temp;
+ explicit LTaggedToI(LOperand* value, LOperand* temp1, LOperand* temp2) {
+ inputs_[0] = value;
+ temps_[0] = temp1;
+ temps_[1] = temp2;
}
- LOperand* unclamped() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
+ LOperand* value() { return inputs_[0]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8")
+ DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
+ DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
+
+ bool truncating() { return hydrogen()->CanTruncateToInt32(); }
};
-class LClampIToUint8: public LTemplateInstruction<1, 1, 0> {
+class LShiftI: public LTemplateInstruction<1, 2, 0> {
public:
- explicit LClampIToUint8(LOperand* unclamped) {
- inputs_[0] = unclamped;
+ LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt)
+ : op_(op), can_deopt_(can_deopt) {
+ inputs_[0] = left;
+ inputs_[1] = right;
}
- LOperand* unclamped() { return inputs_[0]; }
+ Token::Value op() const { return op_; }
+ LOperand* left() { return inputs_[0]; }
+ LOperand* right() { return inputs_[1]; }
+ bool can_deopt() const { return can_deopt_; }
- DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8")
+ DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i")
+
+ private:
+ Token::Value op_;
+ bool can_deopt_;
};
-class LClampTToUint8: public LTemplateInstruction<1, 1, 1> {
+class LStoreContextSlot: public LTemplateInstruction<0, 2, 1> {
public:
- LClampTToUint8(LOperand* unclamped, LOperand* temp) {
- inputs_[0] = unclamped;
+ LStoreContextSlot(LOperand* context, LOperand* value, LOperand* temp) {
+ inputs_[0] = context;
+ inputs_[1] = value;
temps_[0] = temp;
}
- LOperand* unclamped() { return inputs_[0]; }
+ LOperand* context() { return inputs_[0]; }
+ LOperand* value() { return inputs_[1]; }
LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8")
+ DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
+ DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
+
+ int slot_index() { return hydrogen()->slot_index(); }
+
+ virtual void PrintDataTo(StringStream* stream);
};
-class LAllocate: public LTemplateInstruction<1, 2, 2> {
+class LStoreGlobalCell: public LTemplateInstruction<0, 1, 2> {
public:
- LAllocate(LOperand* size, LOperand* temp1, LOperand* temp2) {
- inputs_[1] = size;
+ LStoreGlobalCell(LOperand* value, LOperand* temp1, LOperand* temp2) {
+ inputs_[0] = value;
temps_[0] = temp1;
temps_[1] = temp2;
}
- LOperand* size() { return inputs_[1]; }
+ LOperand* value() { return inputs_[0]; }
LOperand* temp1() { return temps_[0]; }
LOperand* temp2() { return temps_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate")
- DECLARE_HYDROGEN_ACCESSOR(Allocate)
+ DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell")
+ DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell)
};
-class LRegExpLiteral: public LTemplateInstruction<1, 0, 0> {
+class LStoreGlobalGeneric: public LTemplateInstruction<0, 2, 0> {
public:
- DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal")
- DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral)
-};
+ LStoreGlobalGeneric(LOperand* global_object, LOperand* value) {
+ inputs_[0] = global_object;
+ inputs_[1] = value;
+ }
+ LOperand* global_object() { return inputs_[0]; }
+ LOperand* value() { return inputs_[1]; }
-class LFunctionLiteral: public LTemplateInstruction<1, 0, 0> {
- public:
- DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal")
- DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral)
+ DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store-global-generic")
+ DECLARE_HYDROGEN_ACCESSOR(StoreGlobalGeneric)
+
+ Handle<Object> name() const { return hydrogen()->name(); }
+ StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); }
};
-class LToFastProperties: public LTemplateInstruction<1, 1, 0> {
+class LSubI: public LTemplateInstruction<1, 2, 0> {
public:
- explicit LToFastProperties(LOperand* value) {
- inputs_[0] = value;
+ LSubI(LOperand* left, LOperand* right) {
+ inputs_[0] = left;
+ inputs_[1] = right;
}
- LOperand* value() { return inputs_[0]; }
+ LOperand* left() { return inputs_[0]; }
+ LOperand* right() { return inputs_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties")
- DECLARE_HYDROGEN_ACCESSOR(ToFastProperties)
+ DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i")
+ DECLARE_HYDROGEN_ACCESSOR(Sub)
};
-class LTypeof: public LTemplateInstruction<1, 1, 0> {
+class LThisFunction: public LTemplateInstruction<1, 0, 0> {
public:
- explicit LTypeof(LOperand* value) {
- inputs_[0] = value;
- }
-
- LOperand* value() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
+ DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function")
+ DECLARE_HYDROGEN_ACCESSOR(ThisFunction)
};
-class LTypeofIsAndBranch: public LControlInstruction<1, 0> {
+class LThrow: public LTemplateInstruction<0, 1, 0> {
public:
- explicit LTypeofIsAndBranch(LOperand* value) {
+ explicit LThrow(LOperand* value) {
inputs_[0] = value;
}
LOperand* value() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch)
-
- Handle<String> type_literal() { return hydrogen()->type_literal(); }
-
- virtual void PrintDataTo(StringStream* stream);
+ DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
};
-class LIsConstructCallAndBranch: public LControlInstruction<0, 1> {
+class LToFastProperties: public LTemplateInstruction<1, 1, 0> {
public:
- explicit LIsConstructCallAndBranch(LOperand* temp) {
- temps_[0] = temp;
+ explicit LToFastProperties(LOperand* value) {
+ inputs_[0] = value;
}
- LOperand* temp() { return temps_[0]; }
+ LOperand* value() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch,
- "is-construct-call-and-branch")
+ DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties")
+ DECLARE_HYDROGEN_ACCESSOR(ToFastProperties)
};
-class LDeleteProperty: public LTemplateInstruction<1, 2, 0> {
+class LTransitionElementsKind: public LTemplateInstruction<0, 1, 2> {
public:
- LDeleteProperty(LOperand* object, LOperand* key) {
+ LTransitionElementsKind(LOperand* object,
+ LOperand* temp1,
+ LOperand* temp2) {
inputs_[0] = object;
- inputs_[1] = key;
+ temps_[0] = temp1;
+ temps_[1] = temp2;
}
LOperand* object() { return inputs_[0]; }
- LOperand* key() { return inputs_[1]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property")
-};
+ DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind,
+ "transition-elements-kind")
+ DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind)
+ virtual void PrintDataTo(StringStream* stream);
-class LOsrEntry: public LTemplateInstruction<0, 0, 0> {
- public:
- LOsrEntry();
+ Handle<Map> original_map() { return hydrogen()->original_map(); }
+ Handle<Map> transitioned_map() { return hydrogen()->transitioned_map(); }
+ ElementsKind from_kind() { return hydrogen()->from_kind(); }
+ ElementsKind to_kind() { return hydrogen()->to_kind(); }
+};
- virtual bool HasInterestingComment(LCodeGen* gen) const { return false; }
- DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry")
- LOperand** SpilledRegisterArray() { return register_spills_; }
- LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; }
+class LTrapAllocationMemento : public LTemplateInstruction<0, 1, 2> {
+ public:
+ LTrapAllocationMemento(LOperand* object, LOperand* temp1, LOperand* temp2) {
+ inputs_[0] = object;
+ temps_[0] = temp1;
+ temps_[1] = temp2;
+ }
- void MarkSpilledRegister(int allocation_index, LOperand* spill_operand);
- void MarkSpilledDoubleRegister(int allocation_index,
- LOperand* spill_operand);
+ LOperand* object() { return inputs_[0]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
- private:
- // Arrays of spill slot operands for registers with an assigned spill
- // slot, i.e., that must also be restored to the spill slot on OSR entry.
- // NULL if the register has no assigned spill slot. Indexed by allocation
- // index.
- LOperand* register_spills_[Register::kMaxNumAllocatableRegisters];
- LOperand* double_register_spills_[
- DoubleRegister::kMaxNumAllocatableRegisters];
+ DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento, "trap-allocation-memento")
};
-class LStackCheck: public LTemplateInstruction<0, 0, 0> {
+class LTypeof: public LTemplateInstruction<1, 1, 0> {
public:
- DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
- DECLARE_HYDROGEN_ACCESSOR(StackCheck)
+ explicit LTypeof(LOperand* value) {
+ inputs_[0] = value;
+ }
- Label* done_label() { return &done_label_; }
+ LOperand* value() { return inputs_[0]; }
- private:
- Label done_label_;
+ DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
};
-class LIn: public LTemplateInstruction<1, 2, 0> {
+class LTypeofIsAndBranch: public LControlInstruction<1, 2> {
public:
- LIn(LOperand* key, LOperand* object) {
- inputs_[0] = key;
- inputs_[1] = object;
+ LTypeofIsAndBranch(LOperand* value, LOperand* temp1, LOperand* temp2) {
+ inputs_[0] = value;
+ temps_[0] = temp1;
+ temps_[1] = temp2;
}
- LOperand* key() { return inputs_[0]; }
- LOperand* object() { return inputs_[1]; }
+ LOperand* value() { return inputs_[0]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(In, "in")
+ DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch)
+
+ Handle<String> type_literal() { return hydrogen()->type_literal(); }
+
+ virtual void PrintDataTo(StringStream* stream);
};
-class LForInPrepareMap: public LTemplateInstruction<1, 1, 0> {
+class LUint32ToDouble: public LTemplateInstruction<1, 1, 0> {
public:
- explicit LForInPrepareMap(LOperand* object) {
- inputs_[0] = object;
+ explicit LUint32ToDouble(LOperand* value) {
+ inputs_[0] = value;
}
- LOperand* object() { return inputs_[0]; }
+ LOperand* value() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map")
+ DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double")
};
-class LForInCacheArray: public LTemplateInstruction<1, 1, 0> {
+class LValueOf: public LTemplateInstruction<1, 1, 1> {
public:
- explicit LForInCacheArray(LOperand* map) {
- inputs_[0] = map;
+ LValueOf(LOperand* value, LOperand* temp) {
+ inputs_[0] = value;
+ temps_[0] = temp;
}
- LOperand* map() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array")
+ LOperand* value() { return inputs_[0]; }
+ LOperand* temp() { return temps_[0]; }
- int idx() {
- return HForInCacheArray::cast(this->hydrogen_value())->idx();
- }
+ DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of")
+ DECLARE_HYDROGEN_ACCESSOR(ValueOf)
};
-class LCheckMapValue: public LTemplateInstruction<0, 2, 0> {
+class LCheckMapValue: public LTemplateInstruction<0, 2, 1> {
public:
- LCheckMapValue(LOperand* value, LOperand* map) {
+ LCheckMapValue(LOperand* value, LOperand* map, LOperand* temp) {
inputs_[0] = value;
inputs_[1] = map;
+ temps_[0] = temp;
}
LOperand* value() { return inputs_[0]; }
LOperand* map() { return inputs_[1]; }
+ LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(CheckMapValue, "check-map-value")
};
@@ -2604,13 +2568,29 @@ class LLoadFieldByIndex: public LTemplateInstruction<1, 2, 0> {
};
+class LWrapReceiver: public LTemplateInstruction<1, 2, 1> {
+ public:
+ LWrapReceiver(LOperand* receiver, LOperand* function, LOperand* temp) {
+ inputs_[0] = receiver;
+ inputs_[1] = function;
+ temps_[0] = temp;
+ }
+
+ DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver")
+
+ LOperand* receiver() { return inputs_[0]; }
+ LOperand* function() { return inputs_[1]; }
+ LOperand* temp() { return temps_[0]; }
+};
+
+
class LChunkBuilder;
class LPlatformChunk: public LChunk {
public:
LPlatformChunk(CompilationInfo* info, HGraph* graph)
: LChunk(info, graph) { }
- int GetNextSpillIndex(bool is_double);
+ int GetNextSpillIndex();
LOperand* GetNextSpillSlot(bool is_double);
};
@@ -2625,7 +2605,6 @@ class LChunkBuilder BASE_EMBEDDED {
status_(UNUSED),
current_instruction_(NULL),
current_block_(NULL),
- next_block_(NULL),
argument_count_(0),
allocator_(allocator),
position_(RelocInfo::kNoPosition),
@@ -2640,18 +2619,9 @@ class LChunkBuilder BASE_EMBEDDED {
HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
#undef DECLARE_DO
- LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend);
-
- LInstruction* DoMathFloor(HUnaryMathOperation* instr);
- LInstruction* DoMathRound(HUnaryMathOperation* instr);
- LInstruction* DoMathAbs(HUnaryMathOperation* instr);
- LInstruction* DoMathLog(HUnaryMathOperation* instr);
- LInstruction* DoMathSin(HUnaryMathOperation* instr);
- LInstruction* DoMathCos(HUnaryMathOperation* instr);
- LInstruction* DoMathTan(HUnaryMathOperation* instr);
- LInstruction* DoMathExp(HUnaryMathOperation* instr);
- LInstruction* DoMathSqrt(HUnaryMathOperation* instr);
- LInstruction* DoMathPowHalf(HUnaryMathOperation* instr);
+ static bool HasMagicNumberForDivision(int32_t divisor);
+ static HValue* SimplifiedDividendForMathFloorOfDiv(HValue* val);
+ static HValue* SimplifiedDivisorForMathFloorOfDiv(HValue* val);
private:
enum Status {
@@ -2661,16 +2631,19 @@ class LChunkBuilder BASE_EMBEDDED {
ABORTED
};
- LPlatformChunk* chunk() const { return chunk_; }
- CompilationInfo* info() const { return info_; }
HGraph* graph() const { return graph_; }
- Zone* zone() const { return zone_; }
+ Isolate* isolate() const { return info_->isolate(); }
bool is_unused() const { return status_ == UNUSED; }
bool is_building() const { return status_ == BUILDING; }
bool is_done() const { return status_ == DONE; }
bool is_aborted() const { return status_ == ABORTED; }
+ Zone* zone() const { return zone_; }
+ int argument_count() const { return argument_count_; }
+ CompilationInfo* info() const { return info_; }
+ Heap* heap() const { return isolate()->heap(); }
+
void Abort(const char* reason);
// Methods for getting operands for Use / Define / Temp.
@@ -2684,33 +2657,32 @@ class LChunkBuilder BASE_EMBEDDED {
DoubleRegister fixed_register);
// A value that is guaranteed to be allocated to a register.
- // Operand created by UseRegister is guaranteed to be live until the end of
- // instruction. This means that register allocator will not reuse it's
+ // The operand created by UseRegister is guaranteed to be live until the end
+ // of the instruction. This means that register allocator will not reuse its
// register for any other operand inside instruction.
- // Operand created by UseRegisterAtStart is guaranteed to be live only at
- // instruction start. Register allocator is free to assign the same register
- // to some other operand used inside instruction (i.e. temporary or
- // output).
MUST_USE_RESULT LOperand* UseRegister(HValue* value);
- MUST_USE_RESULT LOperand* UseRegisterAtStart(HValue* value);
-
- // An input operand in a register that may be trashed.
- MUST_USE_RESULT LOperand* UseTempRegister(HValue* value);
- // An input operand in a register or stack slot.
- MUST_USE_RESULT LOperand* Use(HValue* value);
- MUST_USE_RESULT LOperand* UseAtStart(HValue* value);
-
- // An input operand in a register, stack slot or a constant operand.
- MUST_USE_RESULT LOperand* UseOrConstant(HValue* value);
- MUST_USE_RESULT LOperand* UseOrConstantAtStart(HValue* value);
+ // The operand created by UseRegisterAndClobber is guaranteed to be live until
+ // the end of the end of the instruction, and it may also be used as a scratch
+ // register by the instruction implementation.
+ //
+ // This behaves identically to ARM's UseTempRegister. However, it is renamed
+ // to discourage its use in A64, since in most cases it is better to allocate
+ // a temporary register for the Lithium instruction.
+ MUST_USE_RESULT LOperand* UseRegisterAndClobber(HValue* value);
+
+ // The operand created by UseRegisterAtStart is guaranteed to be live only at
+ // instruction start. The register allocator is free to assign the same
+ // register to some other operand used inside instruction (i.e. temporary or
+ // output).
+ MUST_USE_RESULT LOperand* UseRegisterAtStart(HValue* value);
// An input operand in a register or a constant operand.
MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value);
MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value);
- // An input operand in a constant operand.
- MUST_USE_RESULT LOperand* UseConstant(HValue* value);
+ // A constant operand.
+ MUST_USE_RESULT LConstantOperand* UseConstant(HValue* value);
// An input operand in register, stack slot or a constant operand.
// Will not be moved to a register even if one is freely available.
@@ -2718,7 +2690,8 @@ class LChunkBuilder BASE_EMBEDDED {
// Temporary operand that must be in a register.
MUST_USE_RESULT LUnallocated* TempRegister();
- MUST_USE_RESULT LOperand* FixedTemp(Register reg);
+
+ // Temporary operand that must be in a fixed double register.
MUST_USE_RESULT LOperand* FixedTemp(DoubleRegister reg);
// Methods for setting up define-use relationships.
@@ -2728,19 +2701,20 @@ class LChunkBuilder BASE_EMBEDDED {
LUnallocated* result);
template<int I, int T>
LInstruction* DefineAsRegister(LTemplateInstruction<1, I, T>* instr);
+
template<int I, int T>
LInstruction* DefineAsSpilled(LTemplateInstruction<1, I, T>* instr,
int index);
+
template<int I, int T>
LInstruction* DefineSameAsFirst(LTemplateInstruction<1, I, T>* instr);
+
template<int I, int T>
LInstruction* DefineFixed(LTemplateInstruction<1, I, T>* instr,
Register reg);
template<int I, int T>
LInstruction* DefineFixedDouble(LTemplateInstruction<1, I, T>* instr,
DoubleRegister reg);
- LInstruction* AssignEnvironment(LInstruction* instr);
- LInstruction* AssignPointerMap(LInstruction* instr);
enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY };
@@ -2752,18 +2726,19 @@ class LChunkBuilder BASE_EMBEDDED {
HInstruction* hinstr,
CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
+ LInstruction* AssignPointerMap(LInstruction* instr);
+ LInstruction* AssignEnvironment(LInstruction* instr);
LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env,
int* argument_index_accumulator);
void VisitInstruction(HInstruction* current);
+ void DoBasicBlock(HBasicBlock* block);
- void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
- LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr);
LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
LInstruction* DoArithmeticD(Token::Value op,
HArithmeticBinaryOperation* instr);
LInstruction* DoArithmeticT(Token::Value op,
- HArithmeticBinaryOperation* instr);
+ HBinaryOperation* instr);
LPlatformChunk* chunk_;
CompilationInfo* info_;
@@ -2772,7 +2747,6 @@ class LChunkBuilder BASE_EMBEDDED {
Status status_;
HInstruction* current_instruction_;
HBasicBlock* current_block_;
- HBasicBlock* next_block_;
int argument_count_;
LAllocator* allocator_;
int position_;
@@ -2787,4 +2761,4 @@ class LChunkBuilder BASE_EMBEDDED {
} } // namespace v8::internal
-#endif // V8_MIPS_LITHIUM_MIPS_H_
+#endif // V8_A64_LITHIUM_A64_H_
« no previous file with comments | « src/a64/instrument-a64.cc ('k') | src/a64/lithium-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698