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

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

Issue 148293020: Merge experimental/a64 to bleeding_edge. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove ARM from OWNERS Created 6 years, 10 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/arm/lithium-arm.h b/src/a64/lithium-a64.h
similarity index 78%
copy from src/arm/lithium-arm.h
copy to src/a64/lithium-a64.h
index 29a176628ec15ecd7cf7c3277db78fe0a9163704..dddb0ad009e7ea50f171f40bda26faf093819aea 100644
--- a/src/arm/lithium-arm.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_ARM_LITHIUM_ARM_H_
-#define V8_ARM_LITHIUM_ARM_H_
+#ifndef V8_A64_LITHIUM_A64_H_
+#define V8_A64_LITHIUM_A64_H_
#include "hydrogen.h"
#include "lithium-allocator.h"
@@ -42,7 +42,9 @@ class LCodeGen;
#define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \
V(AccessArgumentsAt) \
+ V(AddE) \
V(AddI) \
+ V(AddS) \
V(Allocate) \
V(ApplyArguments) \
V(ArgumentsElements) \
@@ -50,31 +52,33 @@ class LCodeGen;
V(ArithmeticD) \
V(ArithmeticT) \
V(BitI) \
+ V(BitS) \
V(BoundsCheck) \
V(Branch) \
- V(CallJSFunction) \
- V(CallWithDescriptor) \
V(CallFunction) \
+ V(CallJSFunction) \
V(CallNew) \
V(CallNewArray) \
V(CallRuntime) \
V(CallStub) \
+ V(CallWithDescriptor) \
V(CheckInstanceType) \
- V(CheckNonSmi) \
- V(CheckMaps) \
V(CheckMapValue) \
+ V(CheckMaps) \
+ V(CheckNonSmi) \
V(CheckSmi) \
V(CheckValue) \
V(ClampDToUint8) \
V(ClampIToUint8) \
V(ClampTToUint8) \
V(ClassOfTestAndBranch) \
- V(CompareMinusZeroAndBranch) \
- V(CompareNumericAndBranch) \
- V(CmpObjectEqAndBranch) \
- V(CmpHoleAndBranch) \
+ V(CmpHoleAndBranchD) \
+ V(CmpHoleAndBranchT) \
V(CmpMapAndBranch) \
+ V(CmpObjectEqAndBranch) \
V(CmpT) \
+ V(CompareMinusZeroAndBranch) \
+ V(CompareNumericAndBranch) \
V(ConstantD) \
V(ConstantE) \
V(ConstantI) \
@@ -86,8 +90,7 @@ class LCodeGen;
V(DeclareGlobals) \
V(Deoptimize) \
V(DivI) \
- V(DoubleToI) \
- V(DoubleToSmi) \
+ V(DoubleToIntOrSmi) \
V(Drop) \
V(Dummy) \
V(DummyUse) \
@@ -107,23 +110,26 @@ class LCodeGen;
V(InvokeFunction) \
V(IsConstructCallAndBranch) \
V(IsObjectAndBranch) \
- V(IsStringAndBranch) \
V(IsSmiAndBranch) \
+ V(IsStringAndBranch) \
V(IsUndetectableAndBranch) \
V(Label) \
V(LazyBailout) \
V(LoadContextSlot) \
- V(LoadRoot) \
V(LoadFieldByIndex) \
V(LoadFunctionPrototype) \
V(LoadGlobalCell) \
V(LoadGlobalGeneric) \
- V(LoadKeyed) \
+ V(LoadKeyedExternal) \
+ V(LoadKeyedFixed) \
+ V(LoadKeyedFixedDouble) \
V(LoadKeyedGeneric) \
V(LoadNamedField) \
V(LoadNamedGeneric) \
+ V(LoadRoot) \
V(MapEnumLength) \
V(MathAbs) \
+ V(MathAbsTagged) \
V(MathExp) \
V(MathFloor) \
V(MathFloorOfDiv) \
@@ -133,11 +139,10 @@ class LCodeGen;
V(MathRound) \
V(MathSqrt) \
V(ModI) \
+ V(MulConstIS) \
V(MulI) \
- V(MultiplyAddD) \
- V(MultiplySubD) \
+ V(MulS) \
V(NumberTagD) \
- V(NumberTagI) \
V(NumberTagU) \
V(NumberUntagD) \
V(OsrEntry) \
@@ -149,13 +154,16 @@ class LCodeGen;
V(SeqStringGetChar) \
V(SeqStringSetChar) \
V(ShiftI) \
+ V(ShiftS) \
V(SmiTag) \
V(SmiUntag) \
V(StackCheck) \
V(StoreCodeEntry) \
V(StoreContextSlot) \
V(StoreGlobalCell) \
- V(StoreKeyed) \
+ V(StoreKeyedExternal) \
+ V(StoreKeyedFixed) \
+ V(StoreKeyedFixedDouble) \
V(StoreKeyedGeneric) \
V(StoreNamedField) \
V(StoreNamedGeneric) \
@@ -164,12 +172,13 @@ class LCodeGen;
V(StringCharFromCode) \
V(StringCompareAndBranch) \
V(SubI) \
- V(RSubI) \
+ V(SubS) \
V(TaggedToI) \
V(ThisFunction) \
V(ToFastProperties) \
V(TransitionElementsKind) \
V(TrapAllocationMemento) \
+ V(TruncateDoubleToIntOrSmi) \
V(Typeof) \
V(TypeofIsAndBranch) \
V(Uint32ToDouble) \
@@ -192,9 +201,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()); \
}
@@ -203,10 +212,9 @@ class LInstruction : public ZoneObject {
LInstruction()
: environment_(NULL),
hydrogen_value_(NULL),
- bit_field_(IsCallBits::encode(false)) {
- }
+ bit_field_(IsCallBits::encode(false)) { }
- virtual ~LInstruction() {}
+ virtual ~LInstruction() { }
virtual void CompileToNative(LCodeGen* generator) = 0;
virtual const char* Mnemonic() const = 0;
@@ -256,13 +264,16 @@ class LInstruction : public ZoneObject {
bool ClobbersTemps() const { return IsCall(); }
bool ClobbersRegisters() const { return IsCall(); }
virtual bool ClobbersDoubleRegisters() const { return IsCall(); }
-
- // Interface to the register allocator and iterators.
bool IsMarkedAsCall() const { return IsCall(); }
virtual bool HasResult() const = 0;
virtual LOperand* result() const = 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; }
@@ -273,21 +284,12 @@ class LInstruction : public ZoneObject {
#endif
private:
- // Iterator support.
- 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;
-
class IsCallBits: public BitField<bool, 0, 1> {};
LEnvironment* environment_;
SetOncePointer<LPointerMap> pointer_map_;
HValue* hydrogen_value_;
- int bit_field_;
+ int32_t bit_field_;
};
@@ -298,7 +300,7 @@ class LTemplateResultInstruction : public LInstruction {
// Allow 0 or 1 output operands.
STATIC_ASSERT(R == 0 || R == 1);
virtual bool HasResult() const V8_FINAL V8_OVERRIDE {
- return R != 0 && result() != NULL;
+ return (R != 0) && (result() != NULL);
}
void set_result(LOperand* operand) { results_[0] = operand; }
LOperand* result() const { return results_[0]; }
@@ -327,6 +329,59 @@ class LTemplateInstruction : public LTemplateResultInstruction<R> {
};
+class LUnknownOSRValue V8_FINAL : public LTemplateInstruction<1, 0, 0> {
+ public:
+ virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE {
+ return false;
+ }
+ DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
+};
+
+
+template<int I, int T>
+class LControlInstruction : public LTemplateInstruction<0, I, T> {
+ public:
+ LControlInstruction() : false_label_(NULL), true_label_(NULL) { }
+
+ virtual bool IsControl() const V8_FINAL V8_OVERRIDE { 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 SuccessorAt(0)->block_id(); }
+ int false_block_id() { return SuccessorAt(1)->block_id(); }
+
+ private:
+ DECLARE_HYDROGEN_ACCESSOR(ControlInstruction);
+
+ Label* false_label_;
+ Label* true_label_;
+};
+
+
class LGap : public LTemplateInstruction<0, 0, 0> {
public:
explicit LGap(HBasicBlock* block)
@@ -387,6 +442,35 @@ class LInstructionGap V8_FINAL : public LGap {
};
+class LDrop V8_FINAL : 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 LDummy V8_FINAL : public LTemplateInstruction<1, 0, 0> {
+ public:
+ explicit LDummy() { }
+ DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy")
+};
+
+
+class LDummyUse V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+ public:
+ explicit LDummyUse(LOperand* value) {
+ inputs_[0] = value;
+ }
+ DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use")
+};
+
+
class LGoto V8_FINAL : public LTemplateInstruction<0, 0, 0> {
public:
explicit LGoto(HBasicBlock* block) : block_(block) { }
@@ -419,29 +503,6 @@ class LLazyBailout V8_FINAL : public LTemplateInstruction<0, 0, 0> {
};
-class LDummy V8_FINAL : public LTemplateInstruction<1, 0, 0> {
- public:
- explicit LDummy() { }
- DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy")
-};
-
-
-class LDummyUse V8_FINAL : public LTemplateInstruction<1, 1, 0> {
- public:
- explicit LDummyUse(LOperand* value) {
- inputs_[0] = value;
- }
- DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use")
-};
-
-
-class LDeoptimize V8_FINAL : public LTemplateInstruction<0, 0, 0> {
- public:
- DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
- DECLARE_HYDROGEN_ACCESSOR(Deoptimize)
-};
-
-
class LLabel V8_FINAL : public LGap {
public:
explicit LLabel(HBasicBlock* block)
@@ -468,91 +529,104 @@ class LLabel V8_FINAL : public LGap {
};
-class LParameter V8_FINAL : public LTemplateInstruction<1, 0, 0> {
+class LOsrEntry V8_FINAL : public LTemplateInstruction<0, 0, 0> {
public:
- virtual bool HasInterestingComment(LCodeGen* gen) const { return false; }
- DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
+ LOsrEntry() {}
+
+ virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE {
+ return false;
+ }
+ DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry")
};
-class LCallStub V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LAccessArgumentsAt V8_FINAL : public LTemplateInstruction<1, 3, 1> {
public:
- explicit LCallStub(LOperand* context) {
- inputs_[0] = context;
+ LAccessArgumentsAt(LOperand* arguments,
+ LOperand* length,
+ LOperand* index,
+ LOperand* temp) {
+ inputs_[0] = arguments;
+ inputs_[1] = length;
+ inputs_[2] = index;
+ temps_[0] = temp;
}
- LOperand* context() { return inputs_[0]; }
+ DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at")
- DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
- DECLARE_HYDROGEN_ACCESSOR(CallStub)
+ 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) V8_OVERRIDE;
};
-class LUnknownOSRValue V8_FINAL : public LTemplateInstruction<1, 0, 0> {
+class LAddE V8_FINAL : public LTemplateInstruction<1, 2, 0> {
public:
- virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE {
- return false;
+ LAddE(LOperand* left, LOperand* right) {
+ inputs_[0] = left;
+ inputs_[1] = right;
}
- DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
+
+ LOperand* left() { return inputs_[0]; }
+ LOperand* right() { return inputs_[1]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(AddE, "add-e")
+ DECLARE_HYDROGEN_ACCESSOR(Add)
};
-template<int I, int T>
-class LControlInstruction : public LTemplateInstruction<0, I, T> {
+class LAddI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
public:
- LControlInstruction() : false_label_(NULL), true_label_(NULL) { }
+ LAddI(LOperand* left, LOperand* right) {
+ inputs_[0] = left;
+ inputs_[1] = right;
+ }
- virtual bool IsControl() const V8_FINAL V8_OVERRIDE { return true; }
+ LOperand* left() { return inputs_[0]; }
+ LOperand* right() { return inputs_[1]; }
- int SuccessorCount() { return hydrogen()->SuccessorCount(); }
- HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); }
+ DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i")
+ DECLARE_HYDROGEN_ACCESSOR(Add)
+};
- 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_;
+class LAddS V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+ public:
+ LAddS(LOperand* left, LOperand* right) {
+ inputs_[0] = left;
+ inputs_[1] = right;
}
- protected:
- int true_block_id() { return SuccessorAt(0)->block_id(); }
- int false_block_id() { return SuccessorAt(1)->block_id(); }
-
- private:
- HControlInstruction* hydrogen() {
- return HControlInstruction::cast(this->hydrogen_value());
- }
+ LOperand* left() { return inputs_[0]; }
+ LOperand* right() { return inputs_[1]; }
- Label* false_label_;
- Label* true_label_;
+ DECLARE_CONCRETE_INSTRUCTION(AddS, "add-s")
+ DECLARE_HYDROGEN_ACCESSOR(Add)
};
-class LWrapReceiver V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LAllocate V8_FINAL : public LTemplateInstruction<1, 2, 2> {
public:
- LWrapReceiver(LOperand* receiver, LOperand* function) {
- inputs_[0] = receiver;
- inputs_[1] = function;
+ LAllocate(LOperand* context,
+ LOperand* size,
+ LOperand* temp1,
+ LOperand* temp2) {
+ inputs_[0] = context;
+ inputs_[1] = size;
+ temps_[0] = temp1;
+ temps_[1] = temp2;
}
- DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver")
- DECLARE_HYDROGEN_ACCESSOR(WrapReceiver)
+ LOperand* context() { return inputs_[0]; }
+ LOperand* size() { return inputs_[1]; }
+ 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)
};
@@ -577,21 +651,16 @@ class LApplyArguments V8_FINAL : public LTemplateInstruction<1, 4, 0> {
};
-class LAccessArgumentsAt V8_FINAL : public LTemplateInstruction<1, 3, 0> {
+class LArgumentsElements V8_FINAL : 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) V8_OVERRIDE;
+ DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements")
+ DECLARE_HYDROGEN_ACCESSOR(ArgumentsElements)
};
@@ -607,76 +676,94 @@ class LArgumentsLength V8_FINAL : public LTemplateInstruction<1, 1, 0> {
};
-class LArgumentsElements V8_FINAL : public LTemplateInstruction<1, 0, 0> {
- public:
- DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements")
- DECLARE_HYDROGEN_ACCESSOR(ArgumentsElements)
-};
-
-
-class LModI V8_FINAL : public LTemplateInstruction<1, 2, 2> {
+class LArithmeticD V8_FINAL : public LTemplateInstruction<1, 2, 0> {
public:
- LModI(LOperand* left,
- LOperand* right,
- LOperand* temp = NULL,
- LOperand* temp2 = NULL) {
+ LArithmeticD(Token::Value op,
+ LOperand* left,
+ LOperand* right)
+ : op_(op) {
inputs_[0] = left;
inputs_[1] = right;
- temps_[0] = temp;
- temps_[1] = temp2;
}
+ 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]; }
- DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i")
- DECLARE_HYDROGEN_ACCESSOR(Mod)
+ virtual Opcode opcode() const V8_OVERRIDE {
+ return LInstruction::kArithmeticD;
+ }
+ virtual void CompileToNative(LCodeGen* generator) V8_OVERRIDE;
+ virtual const char* Mnemonic() const V8_OVERRIDE;
+
+ private:
+ Token::Value op_;
};
-class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> {
+class LArithmeticT V8_FINAL : public LTemplateInstruction<1, 3, 0> {
public:
- LDivI(LOperand* left, LOperand* right, LOperand* temp) {
- inputs_[0] = left;
- inputs_[1] = right;
- temps_[0] = temp;
+ LArithmeticT(Token::Value op,
+ LOperand* context,
+ LOperand* left,
+ LOperand* right)
+ : op_(op) {
+ inputs_[0] = context;
+ inputs_[1] = left;
+ inputs_[2] = right;
}
- LOperand* left() { return inputs_[0]; }
- LOperand* right() { return inputs_[1]; }
- LOperand* temp() { return temps_[0]; }
+ LOperand* context() { return inputs_[0]; }
+ LOperand* left() { return inputs_[1]; }
+ LOperand* right() { return inputs_[2]; }
+ Token::Value op() const { return op_; }
- bool is_flooring() { return hydrogen_value()->IsMathFloorOfDiv(); }
+ virtual Opcode opcode() const V8_OVERRIDE {
+ return LInstruction::kArithmeticT;
+ }
+ virtual void CompileToNative(LCodeGen* generator) V8_OVERRIDE;
+ virtual const char* Mnemonic() const V8_OVERRIDE;
- DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
- DECLARE_HYDROGEN_ACCESSOR(Div)
+ private:
+ Token::Value op_;
};
-class LMathFloorOfDiv V8_FINAL : public LTemplateInstruction<1, 2, 1> {
+class LBoundsCheck V8_FINAL : public LTemplateInstruction<0, 2, 0> {
public:
- LMathFloorOfDiv(LOperand* left,
- LOperand* right,
- LOperand* temp = NULL) {
+ explicit LBoundsCheck(LOperand* index, LOperand* length) {
+ inputs_[0] = index;
+ inputs_[1] = length;
+ }
+
+ LOperand* index() { return inputs_[0]; }
+ LOperand* length() { return inputs_[1]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check")
+ DECLARE_HYDROGEN_ACCESSOR(BoundsCheck)
+};
+
+
+class LBitI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+ public:
+ LBitI(LOperand* left, LOperand* right) {
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(MathFloorOfDiv, "math-floor-of-div")
- DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
+ Token::Value op() const { return hydrogen()->op(); }
+
+ DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i")
+ DECLARE_HYDROGEN_ACCESSOR(Bitwise)
};
-class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LBitS V8_FINAL : public LTemplateInstruction<1, 2, 0> {
public:
- LMulI(LOperand* left, LOperand* right) {
+ LBitS(LOperand* left, LOperand* right) {
inputs_[0] = left;
inputs_[1] = right;
}
@@ -684,273 +771,299 @@ class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
- DECLARE_HYDROGEN_ACCESSOR(Mul)
+ Token::Value op() const { return hydrogen()->op(); }
+
+ DECLARE_CONCRETE_INSTRUCTION(BitS, "bit-s")
+ DECLARE_HYDROGEN_ACCESSOR(Bitwise)
};
-// Instruction for computing multiplier * multiplicand + addend.
-class LMultiplyAddD V8_FINAL : public LTemplateInstruction<1, 3, 0> {
+class LBranch V8_FINAL : public LControlInstruction<1, 2> {
public:
- LMultiplyAddD(LOperand* addend, LOperand* multiplier,
- LOperand* multiplicand) {
- inputs_[0] = addend;
- inputs_[1] = multiplier;
- inputs_[2] = multiplicand;
+ explicit LBranch(LOperand* value, LOperand *temp1, LOperand *temp2) {
+ inputs_[0] = value;
+ temps_[0] = temp1;
+ temps_[1] = temp2;
}
- LOperand* addend() { return inputs_[0]; }
- LOperand* multiplier() { return inputs_[1]; }
- LOperand* multiplicand() { return inputs_[2]; }
+ LOperand* value() { return inputs_[0]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
+ DECLARE_HYDROGEN_ACCESSOR(Branch)
- DECLARE_CONCRETE_INSTRUCTION(MultiplyAddD, "multiply-add-d")
+ virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
};
-// Instruction for computing minuend - multiplier * multiplicand.
-class LMultiplySubD V8_FINAL : public LTemplateInstruction<1, 3, 0> {
+class LCallJSFunction V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- LMultiplySubD(LOperand* minuend, LOperand* multiplier,
- LOperand* multiplicand) {
- inputs_[0] = minuend;
- inputs_[1] = multiplier;
- inputs_[2] = multiplicand;
+ explicit LCallJSFunction(LOperand* function) {
+ inputs_[0] = function;
}
- LOperand* minuend() { return inputs_[0]; }
- LOperand* multiplier() { return inputs_[1]; }
- LOperand* multiplicand() { return inputs_[2]; }
+ LOperand* function() { return inputs_[0]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(CallJSFunction, "call-js-function")
+ DECLARE_HYDROGEN_ACCESSOR(CallJSFunction)
+
+ virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
- DECLARE_CONCRETE_INSTRUCTION(MultiplySubD, "multiply-sub-d")
+ int arity() const { return hydrogen()->argument_count() - 1; }
};
-class LDebugBreak V8_FINAL : public LTemplateInstruction<0, 0, 0> {
+class LCallFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
public:
- DECLARE_CONCRETE_INSTRUCTION(DebugBreak, "break")
+ LCallFunction(LOperand* context, LOperand* function) {
+ inputs_[0] = context;
+ inputs_[1] = function;
+ }
+
+ LOperand* context() { return inputs_[0]; }
+ LOperand* function() { return inputs_[1]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
+ DECLARE_HYDROGEN_ACCESSOR(CallFunction)
+
+ int arity() const { return hydrogen()->argument_count() - 1; }
};
-class LCompareNumericAndBranch V8_FINAL : public LControlInstruction<2, 0> {
+class LCallNew V8_FINAL : public LTemplateInstruction<1, 2, 0> {
public:
- LCompareNumericAndBranch(LOperand* left, LOperand* right) {
- inputs_[0] = left;
- inputs_[1] = right;
+ LCallNew(LOperand* context, LOperand* constructor) {
+ inputs_[0] = context;
+ inputs_[1] = constructor;
}
- LOperand* left() { return inputs_[0]; }
- LOperand* right() { return inputs_[1]; }
+ LOperand* context() { return inputs_[0]; }
+ LOperand* constructor() { return inputs_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch,
- "compare-numeric-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch)
+ DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new")
+ DECLARE_HYDROGEN_ACCESSOR(CallNew)
- Token::Value op() const { return hydrogen()->token(); }
- bool is_double() const {
- return hydrogen()->representation().IsDouble();
+ virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
+
+ int arity() const { return hydrogen()->argument_count() - 1; }
+};
+
+
+class LCallNewArray V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+ public:
+ LCallNewArray(LOperand* context, LOperand* constructor) {
+ inputs_[0] = context;
+ inputs_[1] = constructor;
}
+ LOperand* context() { return inputs_[0]; }
+ LOperand* constructor() { return inputs_[1]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(CallNewArray, "call-new-array")
+ DECLARE_HYDROGEN_ACCESSOR(CallNewArray)
+
virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
+
+ int arity() const { return hydrogen()->argument_count() - 1; }
};
-class LMathFloor V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LCallRuntime V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- explicit LMathFloor(LOperand* value) {
- inputs_[0] = value;
+ explicit LCallRuntime(LOperand* context) {
+ inputs_[0] = context;
}
- LOperand* value() { return inputs_[0]; }
+ LOperand* context() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor")
- DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
+ DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
+ DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
+
+ virtual bool ClobbersDoubleRegisters() const V8_OVERRIDE {
+ return save_doubles() == kDontSaveFPRegs;
+ }
+
+ const Runtime::Function* function() const { return hydrogen()->function(); }
+ int arity() const { return hydrogen()->argument_count(); }
+ SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); }
};
-class LMathRound V8_FINAL : public LTemplateInstruction<1, 1, 1> {
+class LCallStub V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- LMathRound(LOperand* value, LOperand* temp) {
- inputs_[0] = value;
- temps_[0] = temp;
+ explicit LCallStub(LOperand* context) {
+ inputs_[0] = context;
}
- LOperand* value() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
+ LOperand* context() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round")
- DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
+ DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
+ DECLARE_HYDROGEN_ACCESSOR(CallStub)
};
-class LMathAbs V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LCheckInstanceType V8_FINAL : public LTemplateInstruction<0, 1, 1> {
public:
- LMathAbs(LOperand* context, LOperand* value) {
- inputs_[1] = context;
+ explicit LCheckInstanceType(LOperand* value, LOperand* temp) {
inputs_[0] = value;
+ temps_[0] = temp;
}
- LOperand* context() { return inputs_[1]; }
LOperand* value() { return inputs_[0]; }
+ LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs")
- DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
+ DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
+ DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
};
-class LMathLog V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LCheckMaps V8_FINAL : public LTemplateInstruction<0, 1, 1> {
public:
- explicit LMathLog(LOperand* value) {
+ explicit LCheckMaps(LOperand* value, LOperand* temp = NULL) {
inputs_[0] = value;
+ temps_[0] = temp;
}
LOperand* value() { return inputs_[0]; }
+ LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log")
+ DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps")
+ DECLARE_HYDROGEN_ACCESSOR(CheckMaps)
};
-class LMathExp V8_FINAL : public LTemplateInstruction<1, 1, 3> {
+class LCheckNonSmi V8_FINAL : public LTemplateInstruction<0, 1, 0> {
public:
- LMathExp(LOperand* value,
- LOperand* double_temp,
- LOperand* temp1,
- LOperand* temp2) {
+ explicit LCheckNonSmi(LOperand* value) {
inputs_[0] = value;
- temps_[0] = temp1;
- temps_[1] = temp2;
- temps_[2] = double_temp;
- ExternalReference::InitializeMathExpData();
}
LOperand* value() { return inputs_[0]; }
- LOperand* temp1() { return temps_[0]; }
- LOperand* temp2() { return temps_[1]; }
- LOperand* double_temp() { return temps_[2]; }
- DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp")
+ DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi")
+ DECLARE_HYDROGEN_ACCESSOR(CheckHeapObject)
};
-class LMathSqrt V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LCheckSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- explicit LMathSqrt(LOperand* value) {
+ explicit LCheckSmi(LOperand* value) {
inputs_[0] = value;
}
LOperand* value() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt")
+ DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi")
};
-class LMathPowHalf V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LCheckValue V8_FINAL : public LTemplateInstruction<0, 1, 1> {
public:
- explicit LMathPowHalf(LOperand* value) {
+ LCheckValue(LOperand* value, LOperand* temp) {
inputs_[0] = value;
+ temps_[0] = temp;
}
LOperand* value() { return inputs_[0]; }
+ LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half")
+ DECLARE_CONCRETE_INSTRUCTION(CheckValue, "check-value")
+ DECLARE_HYDROGEN_ACCESSOR(CheckValue)
};
-class LCmpObjectEqAndBranch V8_FINAL : public LControlInstruction<2, 0> {
+class LClampDToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- LCmpObjectEqAndBranch(LOperand* left, LOperand* right) {
- inputs_[0] = left;
- inputs_[1] = right;
+ explicit LClampDToUint8(LOperand* unclamped) {
+ inputs_[0] = unclamped;
}
- LOperand* left() { return inputs_[0]; }
- LOperand* right() { return inputs_[1]; }
+ LOperand* unclamped() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch, "cmp-object-eq-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(CompareObjectEqAndBranch)
+ DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8")
};
-class LCmpHoleAndBranch V8_FINAL : public LControlInstruction<1, 0> {
+class LClampIToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- explicit LCmpHoleAndBranch(LOperand* object) {
- inputs_[0] = object;
+ explicit LClampIToUint8(LOperand* unclamped) {
+ inputs_[0] = unclamped;
}
- LOperand* object() { return inputs_[0]; }
+ LOperand* unclamped() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(CmpHoleAndBranch, "cmp-hole-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(CompareHoleAndBranch)
+ DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8")
};
-class LCompareMinusZeroAndBranch V8_FINAL : public LControlInstruction<1, 1> {
+class LClampTToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 2> {
public:
- LCompareMinusZeroAndBranch(LOperand* value, LOperand* temp) {
- inputs_[0] = value;
- temps_[0] = temp;
- }
-
- LOperand* value() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
+ LClampTToUint8(LOperand* unclamped, LOperand* temp1, LOperand* temp2) {
+ inputs_[0] = unclamped;
+ temps_[0] = temp1;
+ temps_[1] = temp2;
+ }
- DECLARE_CONCRETE_INSTRUCTION(CompareMinusZeroAndBranch,
- "cmp-minus-zero-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(CompareMinusZeroAndBranch)
+ LOperand* unclamped() { return inputs_[0]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8")
};
-class LIsObjectAndBranch V8_FINAL : public LControlInstruction<1, 1> {
+class LClassOfTestAndBranch V8_FINAL : public LControlInstruction<1, 2> {
public:
- LIsObjectAndBranch(LOperand* value, LOperand* temp) {
+ LClassOfTestAndBranch(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(IsObjectAndBranch, "is-object-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(IsObjectAndBranch)
+ DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch,
+ "class-of-test-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch)
virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
};
-class LIsStringAndBranch V8_FINAL : public LControlInstruction<1, 1> {
+class LCmpHoleAndBranchD V8_FINAL : public LControlInstruction<1, 1> {
public:
- LIsStringAndBranch(LOperand* value, LOperand* temp) {
- inputs_[0] = value;
+ explicit LCmpHoleAndBranchD(LOperand* object, LOperand* temp) {
+ inputs_[0] = object;
temps_[0] = temp;
}
- LOperand* value() { return inputs_[0]; }
+ LOperand* object() { 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) V8_OVERRIDE;
+ DECLARE_CONCRETE_INSTRUCTION(CmpHoleAndBranchD, "cmp-hole-and-branch-d")
+ DECLARE_HYDROGEN_ACCESSOR(CompareHoleAndBranch)
};
-class LIsSmiAndBranch V8_FINAL : public LControlInstruction<1, 0> {
+class LCmpHoleAndBranchT V8_FINAL : public LControlInstruction<1, 0> {
public:
- explicit LIsSmiAndBranch(LOperand* value) {
- inputs_[0] = value;
+ explicit LCmpHoleAndBranchT(LOperand* object) {
+ inputs_[0] = object;
}
- LOperand* value() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch)
+ LOperand* object() { return inputs_[0]; }
- virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
+ DECLARE_CONCRETE_INSTRUCTION(CmpHoleAndBranchT, "cmp-hole-and-branch-t")
+ DECLARE_HYDROGEN_ACCESSOR(CompareHoleAndBranch)
};
-class LIsUndetectableAndBranch V8_FINAL : public LControlInstruction<1, 1> {
+class LCmpMapAndBranch V8_FINAL : public LControlInstruction<1, 1> {
public:
- explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) {
+ LCmpMapAndBranch(LOperand* value, LOperand* temp) {
inputs_[0] = value;
temps_[0] = temp;
}
@@ -958,17 +1071,31 @@ class LIsUndetectableAndBranch V8_FINAL : public LControlInstruction<1, 1> {
LOperand* value() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch,
- "is-undetectable-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch)
+ DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(CompareMap)
- virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
+ Handle<Map> map() const { return hydrogen()->map().handle(); }
};
-class LStringCompareAndBranch V8_FINAL : public LControlInstruction<3, 0> {
+class LCmpObjectEqAndBranch V8_FINAL : public LControlInstruction<2, 0> {
public:
- LStringCompareAndBranch(LOperand* context, LOperand* left, LOperand* right) {
+ LCmpObjectEqAndBranch(LOperand* left, LOperand* right) {
+ inputs_[0] = left;
+ inputs_[1] = right;
+ }
+
+ LOperand* left() { return inputs_[0]; }
+ LOperand* right() { return inputs_[1]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch, "cmp-object-eq-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(CompareObjectEqAndBranch)
+};
+
+
+class LCmpT V8_FINAL : public LTemplateInstruction<1, 3, 0> {
+ public:
+ LCmpT(LOperand* context, LOperand* left, LOperand* right) {
inputs_[0] = context;
inputs_[1] = left;
inputs_[2] = right;
@@ -978,295 +1105,248 @@ class LStringCompareAndBranch V8_FINAL : public LControlInstruction<3, 0> {
LOperand* left() { return inputs_[1]; }
LOperand* right() { return inputs_[2]; }
- DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch,
- "string-compare-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch)
+ DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
+ DECLARE_HYDROGEN_ACCESSOR(CompareGeneric)
Token::Value op() const { return hydrogen()->token(); }
-
- virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
};
-class LHasInstanceTypeAndBranch V8_FINAL : public LControlInstruction<1, 0> {
+class LCompareMinusZeroAndBranch V8_FINAL : public LControlInstruction<1, 1> {
public:
- explicit LHasInstanceTypeAndBranch(LOperand* value) {
+ LCompareMinusZeroAndBranch(LOperand* value, LOperand* temp) {
inputs_[0] = value;
+ temps_[0] = temp;
}
LOperand* value() { return inputs_[0]; }
+ LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
- "has-instance-type-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch)
-
- virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
+ DECLARE_CONCRETE_INSTRUCTION(CompareMinusZeroAndBranch,
+ "cmp-minus-zero-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(CompareMinusZeroAndBranch)
};
-class LGetCachedArrayIndex V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LCompareNumericAndBranch V8_FINAL : public LControlInstruction<2, 0> {
public:
- explicit LGetCachedArrayIndex(LOperand* value) {
- inputs_[0] = value;
+ LCompareNumericAndBranch(LOperand* left, LOperand* right) {
+ inputs_[0] = left;
+ inputs_[1] = right;
}
- LOperand* value() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index")
- DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex)
-};
+ LOperand* left() { return inputs_[0]; }
+ LOperand* right() { return inputs_[1]; }
+ DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch,
+ "compare-numeric-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch)
-class LHasCachedArrayIndexAndBranch V8_FINAL
- : public LControlInstruction<1, 0> {
- public:
- explicit LHasCachedArrayIndexAndBranch(LOperand* value) {
- inputs_[0] = value;
+ Token::Value op() const { return hydrogen()->token(); }
+ bool is_double() const {
+ return hydrogen()->representation().IsDouble();
}
- LOperand* value() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch,
- "has-cached-array-index-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch)
-
virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
};
-class LClassOfTestAndBranch V8_FINAL : public LControlInstruction<1, 1> {
+class LConstantD V8_FINAL : public LTemplateInstruction<1, 0, 0> {
public:
- LClassOfTestAndBranch(LOperand* value, LOperand* temp) {
- inputs_[0] = value;
- temps_[0] = temp;
- }
+ DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
+ DECLARE_HYDROGEN_ACCESSOR(Constant)
- LOperand* value() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
+ double value() const { return hydrogen()->DoubleValue(); }
+};
- DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch,
- "class-of-test-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch)
- virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
+class LConstantE V8_FINAL : public LTemplateInstruction<1, 0, 0> {
+ public:
+ DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e")
+ DECLARE_HYDROGEN_ACCESSOR(Constant)
+
+ ExternalReference value() const {
+ return hydrogen()->ExternalReferenceValue();
+ }
};
-class LCmpT V8_FINAL : public LTemplateInstruction<1, 3, 0> {
+class LConstantI V8_FINAL : public LTemplateInstruction<1, 0, 0> {
public:
- LCmpT(LOperand* context, LOperand* left, LOperand* right) {
- inputs_[0] = context;
- inputs_[1] = left;
- inputs_[2] = right;
- }
+ DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i")
+ DECLARE_HYDROGEN_ACCESSOR(Constant)
- LOperand* context() { return inputs_[0]; }
- LOperand* left() { return inputs_[1]; }
- LOperand* right() { return inputs_[2]; }
+ int32_t value() const { return hydrogen()->Integer32Value(); }
+};
- DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
- DECLARE_HYDROGEN_ACCESSOR(CompareGeneric)
- Token::Value op() const { return hydrogen()->token(); }
+class LConstantS V8_FINAL : public LTemplateInstruction<1, 0, 0> {
+ public:
+ DECLARE_CONCRETE_INSTRUCTION(ConstantS, "constant-s")
+ DECLARE_HYDROGEN_ACCESSOR(Constant)
+
+ Smi* value() const { return Smi::FromInt(hydrogen()->Integer32Value()); }
};
-class LInstanceOf V8_FINAL : public LTemplateInstruction<1, 3, 0> {
+class LConstantT V8_FINAL : public LTemplateInstruction<1, 0, 0> {
public:
- LInstanceOf(LOperand* context, LOperand* left, LOperand* right) {
- inputs_[0] = context;
- inputs_[1] = left;
- inputs_[2] = right;
+ DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
+ DECLARE_HYDROGEN_ACCESSOR(Constant)
+
+ Handle<Object> value(Isolate* isolate) const {
+ return hydrogen()->handle(isolate);
}
+};
- LOperand* context() { return inputs_[0]; }
- LOperand* left() { return inputs_[1]; }
- LOperand* right() { return inputs_[2]; }
- DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
+class LContext V8_FINAL : public LTemplateInstruction<1, 0, 0> {
+ public:
+ DECLARE_CONCRETE_INSTRUCTION(Context, "context")
+ DECLARE_HYDROGEN_ACCESSOR(Context)
};
-class LInstanceOfKnownGlobal V8_FINAL : public LTemplateInstruction<1, 2, 1> {
+class LDateField V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- LInstanceOfKnownGlobal(LOperand* context, LOperand* value, LOperand* temp) {
- inputs_[0] = context;
- inputs_[1] = value;
- temps_[0] = temp;
+ LDateField(LOperand* date, Smi* index) : index_(index) {
+ inputs_[0] = date;
}
- LOperand* context() { return inputs_[0]; }
- LOperand* value() { return inputs_[1]; }
- LOperand* temp() { return temps_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
- "instance-of-known-global")
- DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal)
+ LOperand* date() { return inputs_[0]; }
+ Smi* index() const { return index_; }
- Handle<JSFunction> function() const { return hydrogen()->function(); }
- LEnvironment* GetDeferredLazyDeoptimizationEnvironment() {
- return lazy_deopt_env_;
- }
- virtual void SetDeferredLazyDeoptimizationEnvironment(
- LEnvironment* env) V8_OVERRIDE {
- lazy_deopt_env_ = env;
- }
+ DECLARE_CONCRETE_INSTRUCTION(DateField, "date-field")
+ DECLARE_HYDROGEN_ACCESSOR(DateField)
private:
- LEnvironment* lazy_deopt_env_;
+ Smi* index_;
};
-class LBoundsCheck V8_FINAL : public LTemplateInstruction<0, 2, 0> {
+class LDebugBreak V8_FINAL : public LTemplateInstruction<0, 0, 0> {
public:
- LBoundsCheck(LOperand* index, LOperand* length) {
- inputs_[0] = index;
- inputs_[1] = length;
- }
-
- LOperand* index() { return inputs_[0]; }
- LOperand* length() { return inputs_[1]; }
-
- DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check")
- DECLARE_HYDROGEN_ACCESSOR(BoundsCheck)
+ DECLARE_CONCRETE_INSTRUCTION(DebugBreak, "break")
};
-class LBitI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LDeclareGlobals V8_FINAL : public LTemplateInstruction<0, 1, 0> {
public:
- LBitI(LOperand* left, LOperand* right) {
- inputs_[0] = left;
- inputs_[1] = right;
+ explicit LDeclareGlobals(LOperand* context) {
+ inputs_[0] = context;
}
- LOperand* left() { return inputs_[0]; }
- LOperand* right() { return inputs_[1]; }
-
- Token::Value op() const { return hydrogen()->op(); }
+ LOperand* context() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i")
- DECLARE_HYDROGEN_ACCESSOR(Bitwise)
+ DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals")
+ DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals)
};
-class LShiftI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LDeoptimize V8_FINAL : public LTemplateInstruction<0, 0, 0> {
public:
- LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt)
- : op_(op), can_deopt_(can_deopt) {
- 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")
-
- private:
- Token::Value op_;
- bool can_deopt_;
+ DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
+ DECLARE_HYDROGEN_ACCESSOR(Deoptimize)
};
-class LSubI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> {
public:
- LSubI(LOperand* left, LOperand* right) {
+ 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(SubI, "sub-i")
- DECLARE_HYDROGEN_ACCESSOR(Sub)
+ DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
+ DECLARE_HYDROGEN_ACCESSOR(Div)
};
-class LRSubI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LDoubleToIntOrSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- LRSubI(LOperand* left, LOperand* right) {
- inputs_[0] = left;
- inputs_[1] = right;
+ explicit LDoubleToIntOrSmi(LOperand* value) {
+ inputs_[0] = value;
}
- LOperand* left() { return inputs_[0]; }
- LOperand* right() { return inputs_[1]; }
+ LOperand* value() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(RSubI, "rsub-i")
- DECLARE_HYDROGEN_ACCESSOR(Sub)
+ DECLARE_CONCRETE_INSTRUCTION(DoubleToIntOrSmi, "double-to-int-or-smi")
+ DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
+
+ bool tag_result() { return hydrogen()->representation().IsSmi(); }
};
-class LConstantI V8_FINAL : public LTemplateInstruction<1, 0, 0> {
+class LForInCacheArray V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i")
- DECLARE_HYDROGEN_ACCESSOR(Constant)
-
- int32_t value() const { return hydrogen()->Integer32Value(); }
-};
+ explicit LForInCacheArray(LOperand* map) {
+ inputs_[0] = map;
+ }
+ LOperand* map() { return inputs_[0]; }
-class LConstantS V8_FINAL : public LTemplateInstruction<1, 0, 0> {
- public:
- DECLARE_CONCRETE_INSTRUCTION(ConstantS, "constant-s")
- DECLARE_HYDROGEN_ACCESSOR(Constant)
+ DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array")
- Smi* value() const { return Smi::FromInt(hydrogen()->Integer32Value()); }
+ int idx() {
+ return HForInCacheArray::cast(this->hydrogen_value())->idx();
+ }
};
-class LConstantD V8_FINAL : public LTemplateInstruction<1, 0, 0> {
+class LForInPrepareMap V8_FINAL : public LTemplateInstruction<1, 2, 0> {
public:
- DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
- DECLARE_HYDROGEN_ACCESSOR(Constant)
+ LForInPrepareMap(LOperand* context, LOperand* object) {
+ inputs_[0] = context;
+ inputs_[1] = object;
+ }
- double value() const { return hydrogen()->DoubleValue(); }
+ LOperand* context() { return inputs_[0]; }
+ LOperand* object() { return inputs_[1]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map")
};
-class LConstantE V8_FINAL : public LTemplateInstruction<1, 0, 0> {
+class LGetCachedArrayIndex V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e")
- DECLARE_HYDROGEN_ACCESSOR(Constant)
-
- ExternalReference value() const {
- return hydrogen()->ExternalReferenceValue();
+ explicit LGetCachedArrayIndex(LOperand* value) {
+ inputs_[0] = value;
}
-};
+ LOperand* value() { return inputs_[0]; }
-class LConstantT V8_FINAL : public LTemplateInstruction<1, 0, 0> {
- public:
- DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
- DECLARE_HYDROGEN_ACCESSOR(Constant)
-
- Handle<Object> value(Isolate* isolate) const {
- return hydrogen()->handle(isolate);
- }
+ DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index")
+ DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex)
};
-class LBranch V8_FINAL : public LControlInstruction<1, 0> {
+class LHasCachedArrayIndexAndBranch V8_FINAL
+ : public LControlInstruction<1, 1> {
public:
- explicit LBranch(LOperand* value) {
+ LHasCachedArrayIndexAndBranch(LOperand* value, LOperand* temp) {
inputs_[0] = value;
+ temps_[0] = temp;
}
LOperand* value() { return inputs_[0]; }
+ LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
- DECLARE_HYDROGEN_ACCESSOR(Branch)
+ DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch,
+ "has-cached-array-index-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch)
virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
};
-class LCmpMapAndBranch V8_FINAL : public LControlInstruction<1, 1> {
+class LHasInstanceTypeAndBranch V8_FINAL : public LControlInstruction<1, 1> {
public:
- LCmpMapAndBranch(LOperand* value, LOperand* temp) {
+ LHasInstanceTypeAndBranch(LOperand* value, LOperand* temp) {
inputs_[0] = value;
temps_[0] = temp;
}
@@ -1274,196 +1354,251 @@ class LCmpMapAndBranch V8_FINAL : public LControlInstruction<1, 1> {
LOperand* value() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
- DECLARE_HYDROGEN_ACCESSOR(CompareMap)
+ DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
+ "has-instance-type-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch)
- Handle<Map> map() const { return hydrogen()->map().handle(); }
+ virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
};
-class LMapEnumLength V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LInnerAllocatedObject V8_FINAL : public LTemplateInstruction<1, 2, 0> {
public:
- explicit LMapEnumLength(LOperand* value) {
- inputs_[0] = value;
+ LInnerAllocatedObject(LOperand* base_object, LOperand* offset) {
+ inputs_[0] = base_object;
+ inputs_[1] = offset;
}
- LOperand* value() { return inputs_[0]; }
+ LOperand* base_object() const { return inputs_[0]; }
+ LOperand* offset() const { return inputs_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(MapEnumLength, "map-enum-length")
+ virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
+
+ DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject, "inner-allocated-object")
};
-class LDateField V8_FINAL : public LTemplateInstruction<1, 1, 1> {
+class LInstanceOf V8_FINAL : public LTemplateInstruction<1, 3, 0> {
public:
- LDateField(LOperand* date, LOperand* temp, Smi* index) : index_(index) {
- inputs_[0] = date;
- temps_[0] = temp;
+ LInstanceOf(LOperand* context, LOperand* left, LOperand* right) {
+ inputs_[0] = context;
+ inputs_[1] = left;
+ inputs_[2] = right;
}
- LOperand* date() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
- Smi* index() const { return index_; }
+ LOperand* context() { return inputs_[0]; }
+ LOperand* left() { return inputs_[1]; }
+ LOperand* right() { return inputs_[2]; }
- DECLARE_CONCRETE_INSTRUCTION(DateField, "date-field")
- DECLARE_HYDROGEN_ACCESSOR(DateField)
+ DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
+};
+
+
+class LInstanceOfKnownGlobal V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+ public:
+ LInstanceOfKnownGlobal(LOperand* context, LOperand* value) {
+ inputs_[0] = context;
+ inputs_[1] = value;
+ }
+
+ LOperand* context() { return inputs_[0]; }
+ LOperand* value() { return inputs_[1]; }
+
+ 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) V8_OVERRIDE {
+ lazy_deopt_env_ = env;
+ }
private:
- Smi* index_;
+ LEnvironment* lazy_deopt_env_;
};
-class LSeqStringGetChar V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LInteger32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- LSeqStringGetChar(LOperand* string, LOperand* index) {
- inputs_[0] = string;
- inputs_[1] = index;
+ explicit LInteger32ToDouble(LOperand* value) {
+ inputs_[0] = value;
}
- LOperand* string() const { return inputs_[0]; }
- LOperand* index() const { return inputs_[1]; }
+ LOperand* value() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(SeqStringGetChar, "seq-string-get-char")
- DECLARE_HYDROGEN_ACCESSOR(SeqStringGetChar)
+ DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double")
};
-class LSeqStringSetChar V8_FINAL : public LTemplateInstruction<1, 4, 0> {
+class LInteger32ToSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- LSeqStringSetChar(LOperand* context,
- LOperand* string,
- LOperand* index,
- LOperand* value) {
- inputs_[0] = context;
- inputs_[1] = string;
- inputs_[2] = index;
- inputs_[3] = value;
+ explicit LInteger32ToSmi(LOperand* value) {
+ inputs_[0] = value;
}
- LOperand* string() { return inputs_[1]; }
- LOperand* index() { return inputs_[2]; }
- LOperand* value() { return inputs_[3]; }
+ LOperand* value() { return inputs_[0]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-smi")
+ DECLARE_HYDROGEN_ACCESSOR(Change)
+};
+
+
+class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> {
+ public:
+ LCallWithDescriptor(const CallInterfaceDescriptor* descriptor,
+ ZoneList<LOperand*>& operands,
+ Zone* zone)
+ : descriptor_(descriptor),
+ inputs_(descriptor->environment_length() + 1, zone) {
+ ASSERT(descriptor->environment_length() + 1 == operands.length());
+ inputs_.AddAll(operands, zone);
+ }
+
+ LOperand* target() const { return inputs_[0]; }
+
+ const CallInterfaceDescriptor* descriptor() { return descriptor_; }
+
+ private:
+ DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor")
+ DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor)
+
+ virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
+
+ int arity() const { return hydrogen()->argument_count() - 1; }
+
+ const CallInterfaceDescriptor* descriptor_;
+ ZoneList<LOperand*> inputs_;
+
+ // Iterator support.
+ virtual int InputCount() V8_FINAL V8_OVERRIDE { return inputs_.length(); }
+ virtual LOperand* InputAt(int i) V8_FINAL V8_OVERRIDE { return inputs_[i]; }
- DECLARE_CONCRETE_INSTRUCTION(SeqStringSetChar, "seq-string-set-char")
- DECLARE_HYDROGEN_ACCESSOR(SeqStringSetChar)
+ virtual int TempCount() V8_FINAL V8_OVERRIDE { return 0; }
+ virtual LOperand* TempAt(int i) V8_FINAL V8_OVERRIDE { return NULL; }
};
-class LAddI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LInvokeFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
public:
- LAddI(LOperand* left, LOperand* right) {
- inputs_[0] = left;
- inputs_[1] = right;
+ LInvokeFunction(LOperand* context, LOperand* function) {
+ inputs_[0] = context;
+ inputs_[1] = function;
}
- LOperand* left() { return inputs_[0]; }
- LOperand* right() { return inputs_[1]; }
+ LOperand* context() { return inputs_[0]; }
+ LOperand* function() { return inputs_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i")
- DECLARE_HYDROGEN_ACCESSOR(Add)
+ DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
+ DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
+
+ virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
+
+ int arity() const { return hydrogen()->argument_count() - 1; }
};
-class LMathMinMax V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LIsConstructCallAndBranch V8_FINAL : public LControlInstruction<0, 2> {
public:
- LMathMinMax(LOperand* left, LOperand* right) {
- inputs_[0] = left;
- inputs_[1] = right;
+ LIsConstructCallAndBranch(LOperand* temp1, LOperand* temp2) {
+ temps_[0] = temp1;
+ temps_[1] = temp2;
}
- LOperand* left() { return inputs_[0]; }
- LOperand* right() { return inputs_[1]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "math-min-max")
- DECLARE_HYDROGEN_ACCESSOR(MathMinMax)
+ DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch,
+ "is-construct-call-and-branch")
};
-class LPower V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LIsObjectAndBranch V8_FINAL : public LControlInstruction<1, 2> {
public:
- LPower(LOperand* left, LOperand* right) {
- inputs_[0] = left;
- inputs_[1] = right;
+ LIsObjectAndBranch(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]; }
+ LOperand* value() { return inputs_[0]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(Power, "power")
- DECLARE_HYDROGEN_ACCESSOR(Power)
+ DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(IsObjectAndBranch)
+
+ virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
};
-class LArithmeticD V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LIsStringAndBranch V8_FINAL : public LControlInstruction<1, 1> {
public:
- LArithmeticD(Token::Value op, LOperand* left, LOperand* right)
- : op_(op) {
- inputs_[0] = left;
- inputs_[1] = right;
+ LIsStringAndBranch(LOperand* value, LOperand* temp) {
+ inputs_[0] = value;
+ temps_[0] = temp;
}
- Token::Value op() const { return op_; }
- LOperand* left() { return inputs_[0]; }
- LOperand* right() { return inputs_[1]; }
+ LOperand* value() { return inputs_[0]; }
+ LOperand* temp() { return temps_[0]; }
- virtual Opcode opcode() const V8_OVERRIDE {
- return LInstruction::kArithmeticD;
- }
- virtual void CompileToNative(LCodeGen* generator) V8_OVERRIDE;
- virtual const char* Mnemonic() const V8_OVERRIDE;
+ DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch)
- private:
- Token::Value op_;
+ virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
};
-class LArithmeticT V8_FINAL : public LTemplateInstruction<1, 3, 0> {
+class LIsSmiAndBranch V8_FINAL : public LControlInstruction<1, 0> {
public:
- LArithmeticT(Token::Value op,
- LOperand* context,
- LOperand* left,
- LOperand* right)
- : op_(op) {
- inputs_[0] = context;
- inputs_[1] = left;
- inputs_[2] = right;
+ explicit LIsSmiAndBranch(LOperand* value) {
+ inputs_[0] = value;
}
- LOperand* context() { return inputs_[0]; }
- LOperand* left() { return inputs_[1]; }
- LOperand* right() { return inputs_[2]; }
- Token::Value op() const { return op_; }
+ LOperand* value() { return inputs_[0]; }
- virtual Opcode opcode() const V8_OVERRIDE {
- return LInstruction::kArithmeticT;
- }
- virtual void CompileToNative(LCodeGen* generator) V8_OVERRIDE;
- virtual const char* Mnemonic() const V8_OVERRIDE;
+ DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch)
- private:
- Token::Value op_;
+ virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
};
-class LReturn V8_FINAL : public LTemplateInstruction<0, 3, 0> {
+class LIsUndetectableAndBranch V8_FINAL : public LControlInstruction<1, 1> {
public:
- LReturn(LOperand* value, LOperand* context, LOperand* parameter_count) {
+ explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) {
inputs_[0] = value;
- inputs_[1] = context;
- inputs_[2] = parameter_count;
+ temps_[0] = temp;
}
LOperand* value() { return inputs_[0]; }
+ LOperand* temp() { return temps_[0]; }
- bool has_constant_parameter_count() {
- return parameter_count()->IsConstantOperand();
- }
- LConstantOperand* constant_parameter_count() {
- ASSERT(has_constant_parameter_count());
- return LConstantOperand::cast(parameter_count());
+ DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch,
+ "is-undetectable-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch)
+
+ virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
+};
+
+
+class LLoadContextSlot V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+ public:
+ explicit LLoadContextSlot(LOperand* context) {
+ inputs_[0] = context;
}
- LOperand* parameter_count() { return inputs_[2]; }
- DECLARE_CONCRETE_INSTRUCTION(Return, "return")
+ LOperand* context() { return inputs_[0]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot")
+ DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot)
+
+ int slot_index() const { return hydrogen()->slot_index(); }
+
+ virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
};
@@ -1480,59 +1615,74 @@ class LLoadNamedField V8_FINAL : public LTemplateInstruction<1, 1, 0> {
};
-class LLoadNamedGeneric V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LFunctionLiteral V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- LLoadNamedGeneric(LOperand* context, LOperand* object) {
+ explicit LFunctionLiteral(LOperand* context) {
inputs_[0] = context;
- inputs_[1] = object;
}
LOperand* context() { return inputs_[0]; }
- LOperand* object() { return inputs_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
- DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
-
- Handle<Object> name() const { return hydrogen()->name(); }
+ DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal")
+ DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral)
};
-class LLoadFunctionPrototype V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LLoadFunctionPrototype V8_FINAL : public LTemplateInstruction<1, 1, 1> {
public:
- explicit LLoadFunctionPrototype(LOperand* function) {
+ LLoadFunctionPrototype(LOperand* function, LOperand* temp) {
inputs_[0] = function;
+ temps_[0] = temp;
}
LOperand* function() { return inputs_[0]; }
+ LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype")
DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype)
};
-class LLoadRoot V8_FINAL : public LTemplateInstruction<1, 0, 0> {
+class LLoadGlobalCell V8_FINAL : public LTemplateInstruction<1, 0, 0> {
public:
- DECLARE_CONCRETE_INSTRUCTION(LoadRoot, "load-root")
- DECLARE_HYDROGEN_ACCESSOR(LoadRoot)
+ DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load-global-cell")
+ DECLARE_HYDROGEN_ACCESSOR(LoadGlobalCell)
+};
- Heap::RootListIndex index() const { return hydrogen()->index(); }
+
+class LLoadGlobalGeneric V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+ public:
+ LLoadGlobalGeneric(LOperand* context, LOperand* global_object) {
+ inputs_[0] = context;
+ inputs_[1] = global_object;
+ }
+
+ LOperand* context() { return inputs_[0]; }
+ LOperand* global_object() { return inputs_[1]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic")
+ DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric)
+
+ Handle<Object> name() const { return hydrogen()->name(); }
+ bool for_typeof() const { return hydrogen()->for_typeof(); }
};
-class LLoadKeyed V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+template<int T>
+class LLoadKeyed : public LTemplateInstruction<1, 2, T> {
public:
LLoadKeyed(LOperand* elements, LOperand* key) {
- inputs_[0] = elements;
- inputs_[1] = key;
+ this->inputs_[0] = elements;
+ this->inputs_[1] = key;
}
- LOperand* elements() { return inputs_[0]; }
- LOperand* key() { return inputs_[1]; }
+ LOperand* elements() { return this->inputs_[0]; }
+ LOperand* key() { return this->inputs_[1]; }
ElementsKind elements_kind() const {
- return hydrogen()->elements_kind();
+ return this->hydrogen()->elements_kind();
}
bool is_external() const {
- return hydrogen()->is_external();
+ return this->hydrogen()->is_external();
}
bool is_fixed_typed_array() const {
return hydrogen()->is_fixed_typed_array();
@@ -1540,505 +1690,496 @@ class LLoadKeyed V8_FINAL : public LTemplateInstruction<1, 2, 0> {
bool is_typed_elements() const {
return is_external() || is_fixed_typed_array();
}
+ uint32_t additional_index() const {
+ return this->hydrogen()->index_offset();
+ }
+ void PrintDataTo(StringStream* stream) V8_OVERRIDE {
+ this->elements()->PrintTo(stream);
+ stream->Add("[");
+ this->key()->PrintTo(stream);
+ if (this->hydrogen()->IsDehoisted()) {
+ stream->Add(" + %d]", this->additional_index());
+ } else {
+ stream->Add("]");
+ }
+ }
- DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed")
DECLARE_HYDROGEN_ACCESSOR(LoadKeyed)
-
- virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
- uint32_t additional_index() const { return hydrogen()->index_offset(); }
};
-class LLoadKeyedGeneric V8_FINAL : public LTemplateInstruction<1, 3, 0> {
+class LLoadKeyedExternal: public LLoadKeyed<1> {
public:
- LLoadKeyedGeneric(LOperand* context, LOperand* object, LOperand* key) {
- inputs_[0] = context;
- inputs_[1] = object;
- inputs_[2] = key;
+ LLoadKeyedExternal(LOperand* elements, LOperand* key, LOperand* temp) :
+ LLoadKeyed<1>(elements, key) {
+ temps_[0] = temp;
}
- LOperand* context() { return inputs_[0]; }
- LOperand* object() { return inputs_[1]; }
- LOperand* key() { return inputs_[2]; }
-
- DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
-};
-
+ LOperand* temp() { return temps_[0]; }
-class LLoadGlobalCell V8_FINAL : public LTemplateInstruction<1, 0, 0> {
- public:
- DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load-global-cell")
- DECLARE_HYDROGEN_ACCESSOR(LoadGlobalCell)
+ DECLARE_CONCRETE_INSTRUCTION(LoadKeyedExternal, "load-keyed-external");
};
-class LLoadGlobalGeneric V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LLoadKeyedFixed: public LLoadKeyed<1> {
public:
- LLoadGlobalGeneric(LOperand* context, LOperand* global_object) {
- inputs_[0] = context;
- inputs_[1] = global_object;
+ LLoadKeyedFixed(LOperand* elements, LOperand* key, LOperand* temp) :
+ LLoadKeyed<1>(elements, key) {
+ temps_[0] = temp;
}
- LOperand* context() { return inputs_[0]; }
- LOperand* global_object() { return inputs_[1]; }
-
- DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic")
- DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric)
+ LOperand* temp() { return temps_[0]; }
- Handle<Object> name() const { return hydrogen()->name(); }
- bool for_typeof() const { return hydrogen()->for_typeof(); }
+ DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFixed, "load-keyed-fixed");
};
-class LStoreGlobalCell V8_FINAL : public LTemplateInstruction<0, 1, 1> {
+class LLoadKeyedFixedDouble: public LLoadKeyed<1> {
public:
- LStoreGlobalCell(LOperand* value, LOperand* temp) {
- inputs_[0] = value;
+ LLoadKeyedFixedDouble(LOperand* elements, LOperand* key, LOperand* temp) :
+ LLoadKeyed<1>(elements, key) {
temps_[0] = temp;
}
- LOperand* value() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell")
- DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell)
+ DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFixedDouble, "load-keyed-fixed-double");
};
-class LLoadContextSlot V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LLoadKeyedGeneric V8_FINAL : public LTemplateInstruction<1, 3, 0> {
public:
- explicit LLoadContextSlot(LOperand* context) {
+ LLoadKeyedGeneric(LOperand* context, LOperand* object, LOperand* key) {
inputs_[0] = context;
+ inputs_[1] = object;
+ inputs_[2] = key;
}
LOperand* context() { return inputs_[0]; }
+ LOperand* object() { return inputs_[1]; }
+ LOperand* key() { return inputs_[2]; }
- DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot")
- DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot)
-
- int slot_index() { return hydrogen()->slot_index(); }
-
- virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
+ DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
};
-class LStoreContextSlot V8_FINAL : public LTemplateInstruction<0, 2, 0> {
+class LLoadNamedGeneric V8_FINAL : public LTemplateInstruction<1, 2, 0> {
public:
- LStoreContextSlot(LOperand* context, LOperand* value) {
+ LLoadNamedGeneric(LOperand* context, LOperand* object) {
inputs_[0] = context;
- inputs_[1] = value;
+ inputs_[1] = object;
}
LOperand* context() { return inputs_[0]; }
- LOperand* value() { return inputs_[1]; }
-
- DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
- DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
-
- int slot_index() { return hydrogen()->slot_index(); }
-
- virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
-};
-
-
-class LPushArgument V8_FINAL : public LTemplateInstruction<0, 1, 0> {
- public:
- explicit LPushArgument(LOperand* value) {
- inputs_[0] = value;
- }
+ LOperand* object() { return inputs_[1]; }
- LOperand* value() { return inputs_[0]; }
+ DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
+ DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
- DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
+ Handle<Object> name() const { return hydrogen()->name(); }
};
-class LDrop V8_FINAL : public LTemplateInstruction<0, 0, 0> {
+class LLoadRoot V8_FINAL : public LTemplateInstruction<1, 0, 0> {
public:
- explicit LDrop(int count) : count_(count) { }
-
- int count() const { return count_; }
-
- DECLARE_CONCRETE_INSTRUCTION(Drop, "drop")
+ DECLARE_CONCRETE_INSTRUCTION(LoadRoot, "load-root")
+ DECLARE_HYDROGEN_ACCESSOR(LoadRoot)
- private:
- int count_;
+ Heap::RootListIndex index() const { return hydrogen()->index(); }
};
-class LStoreCodeEntry V8_FINAL: public LTemplateInstruction<0, 1, 1> {
+class LMapEnumLength V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- LStoreCodeEntry(LOperand* function, LOperand* code_object) {
- inputs_[0] = function;
- temps_[0] = code_object;
+ explicit LMapEnumLength(LOperand* value) {
+ inputs_[0] = value;
}
- LOperand* function() { return inputs_[0]; }
- LOperand* code_object() { return temps_[0]; }
-
- virtual void PrintDataTo(StringStream* stream);
+ LOperand* value() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry, "store-code-entry")
- DECLARE_HYDROGEN_ACCESSOR(StoreCodeEntry)
+ DECLARE_CONCRETE_INSTRUCTION(MapEnumLength, "map-enum-length")
};
-class LInnerAllocatedObject V8_FINAL: public LTemplateInstruction<1, 2, 0> {
+template<int T>
+class LUnaryMathOperation : public LTemplateInstruction<1, 1, T> {
public:
- LInnerAllocatedObject(LOperand* base_object, LOperand* offset) {
- inputs_[0] = base_object;
- inputs_[1] = offset;
+ explicit LUnaryMathOperation(LOperand* value) {
+ this->inputs_[0] = value;
}
- LOperand* base_object() const { return inputs_[0]; }
- LOperand* offset() const { return inputs_[1]; }
+ LOperand* value() { return this->inputs_[0]; }
+ BuiltinFunctionId op() const { return this->hydrogen()->op(); }
- virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
+ void PrintDataTo(StringStream* stream) V8_OVERRIDE;
- DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject, "inner-allocated-object")
+ DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
};
-class LThisFunction V8_FINAL : public LTemplateInstruction<1, 0, 0> {
+class LMathAbs V8_FINAL : public LUnaryMathOperation<0> {
public:
- DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function")
- DECLARE_HYDROGEN_ACCESSOR(ThisFunction)
-};
-
+ explicit LMathAbs(LOperand* value) : LUnaryMathOperation<0>(value) {}
-class LContext V8_FINAL : public LTemplateInstruction<1, 0, 0> {
- public:
- DECLARE_CONCRETE_INSTRUCTION(Context, "context")
- DECLARE_HYDROGEN_ACCESSOR(Context)
+ DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs")
};
-class LDeclareGlobals V8_FINAL : public LTemplateInstruction<0, 1, 0> {
+class LMathAbsTagged: public LTemplateInstruction<1, 2, 3> {
public:
- explicit LDeclareGlobals(LOperand* context) {
+ LMathAbsTagged(LOperand* context, LOperand* value,
+ LOperand* temp1, LOperand* temp2, LOperand* temp3) {
inputs_[0] = context;
+ inputs_[1] = value;
+ temps_[0] = temp1;
+ temps_[1] = temp2;
+ temps_[2] = temp3;
}
LOperand* context() { return inputs_[0]; }
+ LOperand* value() { return inputs_[1]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
+ LOperand* temp3() { return temps_[2]; }
- DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals")
- DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals)
+ DECLARE_CONCRETE_INSTRUCTION(MathAbsTagged, "math-abs-tagged")
+ DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
};
-class LCallJSFunction V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LMathExp V8_FINAL : public LUnaryMathOperation<4> {
public:
- explicit LCallJSFunction(LOperand* function) {
- inputs_[0] = function;
+ 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();
}
- LOperand* function() { return inputs_[0]; }
+ LOperand* double_temp1() { return temps_[0]; }
+ LOperand* temp1() { return temps_[1]; }
+ LOperand* temp2() { return temps_[2]; }
+ LOperand* temp3() { return temps_[3]; }
- DECLARE_CONCRETE_INSTRUCTION(CallJSFunction, "call-js-function")
- DECLARE_HYDROGEN_ACCESSOR(CallJSFunction)
+ DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp")
+};
- virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
- int arity() const { return hydrogen()->argument_count() - 1; }
+class LMathFloor V8_FINAL : public LUnaryMathOperation<0> {
+ public:
+ explicit LMathFloor(LOperand* value) : LUnaryMathOperation<0>(value) { }
+ DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor")
};
-class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> {
+class LMathFloorOfDiv V8_FINAL : public LTemplateInstruction<1, 2, 1> {
public:
- LCallWithDescriptor(const CallInterfaceDescriptor* descriptor,
- ZoneList<LOperand*>& operands,
- Zone* zone)
- : descriptor_(descriptor),
- inputs_(descriptor->environment_length() + 1, zone) {
- ASSERT(descriptor->environment_length() + 1 == operands.length());
- inputs_.AddAll(operands, zone);
+ LMathFloorOfDiv(LOperand* left,
+ LOperand* right,
+ LOperand* temp = NULL) {
+ inputs_[0] = left;
+ inputs_[1] = right;
+ temps_[0] = temp;
}
- LOperand* target() const { return inputs_[0]; }
-
- const CallInterfaceDescriptor* descriptor() { return descriptor_; }
-
- private:
- DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor")
- DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor)
-
- virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
-
- int arity() const { return hydrogen()->argument_count() - 1; }
+ LOperand* left() { return inputs_[0]; }
+ LOperand* right() { return inputs_[1]; }
+ LOperand* temp() { return temps_[0]; }
- const CallInterfaceDescriptor* descriptor_;
- ZoneList<LOperand*> inputs_;
+ DECLARE_CONCRETE_INSTRUCTION(MathFloorOfDiv, "math-floor-of-div")
+ DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
+};
- // Iterator support.
- virtual int InputCount() V8_FINAL V8_OVERRIDE { return inputs_.length(); }
- virtual LOperand* InputAt(int i) V8_FINAL V8_OVERRIDE { return inputs_[i]; }
- virtual int TempCount() V8_FINAL V8_OVERRIDE { return 0; }
- virtual LOperand* TempAt(int i) V8_FINAL V8_OVERRIDE { return NULL; }
+class LMathLog V8_FINAL : public LUnaryMathOperation<0> {
+ public:
+ explicit LMathLog(LOperand* value) : LUnaryMathOperation<0>(value) { }
+ DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log")
};
-class LInvokeFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LMathMinMax V8_FINAL : public LTemplateInstruction<1, 2, 0> {
public:
- LInvokeFunction(LOperand* context, LOperand* function) {
- inputs_[0] = context;
- inputs_[1] = function;
+ LMathMinMax(LOperand* left, LOperand* right) {
+ inputs_[0] = left;
+ inputs_[1] = right;
}
- LOperand* context() { return inputs_[0]; }
- LOperand* function() { return inputs_[1]; }
+ LOperand* left() { return inputs_[0]; }
+ LOperand* right() { return inputs_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
- DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
+ DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "math-min-max")
+ DECLARE_HYDROGEN_ACCESSOR(MathMinMax)
+};
- virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
- int arity() const { return hydrogen()->argument_count() - 1; }
+class LMathPowHalf V8_FINAL : public LUnaryMathOperation<0> {
+ public:
+ explicit LMathPowHalf(LOperand* value) : LUnaryMathOperation<0>(value) { }
+ DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half")
};
-class LCallFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LMathRound V8_FINAL : public LUnaryMathOperation<1> {
public:
- LCallFunction(LOperand* context, LOperand* function) {
- inputs_[0] = context;
- inputs_[1] = function;
+ LMathRound(LOperand* value, LOperand* temp1)
+ : LUnaryMathOperation<1>(value) {
+ temps_[0] = temp1;
}
- LOperand* context() { return inputs_[0]; }
- LOperand* function() { return inputs_[1]; }
-
- DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
- DECLARE_HYDROGEN_ACCESSOR(CallFunction)
+ LOperand* temp1() { return temps_[0]; }
- int arity() const { return hydrogen()->argument_count() - 1; }
+ DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round")
};
-class LCallNew V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LMathSqrt V8_FINAL : public LUnaryMathOperation<0> {
public:
- LCallNew(LOperand* context, LOperand* constructor) {
- inputs_[0] = context;
- inputs_[1] = constructor;
- }
+ explicit LMathSqrt(LOperand* value) : LUnaryMathOperation<0>(value) { }
+ DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt")
+};
- LOperand* context() { return inputs_[0]; }
- LOperand* constructor() { return inputs_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new")
- DECLARE_HYDROGEN_ACCESSOR(CallNew)
+class LModI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+ public:
+ LModI(LOperand* left, LOperand* right) {
+ inputs_[0] = left;
+ inputs_[1] = right;
+ }
- virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
+ LOperand* left() { return inputs_[0]; }
+ LOperand* right() { return inputs_[1]; }
- int arity() const { return hydrogen()->argument_count() - 1; }
+ DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i")
+ DECLARE_HYDROGEN_ACCESSOR(Mod)
};
-class LCallNewArray V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LMulConstIS V8_FINAL : public LTemplateInstruction<1, 2, 0> {
public:
- LCallNewArray(LOperand* context, LOperand* constructor) {
- inputs_[0] = context;
- inputs_[1] = constructor;
+ LMulConstIS(LOperand* left, LConstantOperand* right) {
+ inputs_[0] = left;
+ inputs_[1] = right;
}
- LOperand* context() { return inputs_[0]; }
- LOperand* constructor() { return inputs_[1]; }
-
- DECLARE_CONCRETE_INSTRUCTION(CallNewArray, "call-new-array")
- DECLARE_HYDROGEN_ACCESSOR(CallNewArray)
-
- virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
+ LOperand* left() { return inputs_[0]; }
+ LConstantOperand* right() { return LConstantOperand::cast(inputs_[1]); }
- int arity() const { return hydrogen()->argument_count() - 1; }
+ DECLARE_CONCRETE_INSTRUCTION(MulConstIS, "mul-const-i-s")
+ DECLARE_HYDROGEN_ACCESSOR(Mul)
};
-class LCallRuntime V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
public:
- explicit LCallRuntime(LOperand* context) {
- inputs_[0] = context;
+ LMulI(LOperand* left, LOperand* right) {
+ inputs_[0] = left;
+ inputs_[1] = right;
}
- LOperand* context() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
- DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
-
- virtual bool ClobbersDoubleRegisters() const V8_OVERRIDE {
- return save_doubles() == kDontSaveFPRegs;
- }
+ LOperand* left() { return inputs_[0]; }
+ LOperand* right() { return inputs_[1]; }
- const Runtime::Function* function() const { return hydrogen()->function(); }
- int arity() const { return hydrogen()->argument_count(); }
- SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); }
+ DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
+ DECLARE_HYDROGEN_ACCESSOR(Mul)
};
-class LInteger32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LMulS V8_FINAL : public LTemplateInstruction<1, 2, 0> {
public:
- explicit LInteger32ToDouble(LOperand* value) {
- inputs_[0] = value;
+ LMulS(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(Integer32ToDouble, "int32-to-double")
+ DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-s")
+ DECLARE_HYDROGEN_ACCESSOR(Mul)
};
-class LInteger32ToSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LNumberTagD V8_FINAL : public LTemplateInstruction<1, 1, 2> {
public:
- explicit LInteger32ToSmi(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(Integer32ToSmi, "int32-to-smi")
+ DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d")
DECLARE_HYDROGEN_ACCESSOR(Change)
};
-class LUint32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LNumberTagU V8_FINAL : public LTemplateInstruction<1, 1, 2> {
public:
- explicit LUint32ToDouble(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(Uint32ToDouble, "uint32-to-double")
+ DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u")
};
-class LUint32ToSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LNumberUntagD V8_FINAL : public LTemplateInstruction<1, 1, 1> {
public:
- explicit LUint32ToSmi(LOperand* value) {
+ LNumberUntagD(LOperand* value, LOperand* temp) {
inputs_[0] = value;
+ temps_[0] = temp;
}
LOperand* value() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(Uint32ToSmi, "uint32-to-smi")
+ LOperand* temp() { return temps_[0]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
DECLARE_HYDROGEN_ACCESSOR(Change)
};
-class LNumberTagI V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LParameter V8_FINAL : public LTemplateInstruction<1, 0, 0> {
public:
- explicit LNumberTagI(LOperand* value) {
- inputs_[0] = value;
- }
-
- LOperand* value() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i")
+ virtual bool HasInterestingComment(LCodeGen* gen) const { return false; }
+ DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
};
-class LNumberTagU V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LPower V8_FINAL : public LTemplateInstruction<1, 2, 0> {
public:
- explicit LNumberTagU(LOperand* value) {
- inputs_[0] = value;
+ LPower(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(NumberTagU, "number-tag-u")
+ DECLARE_CONCRETE_INSTRUCTION(Power, "power")
+ DECLARE_HYDROGEN_ACCESSOR(Power)
};
-class LNumberTagD V8_FINAL : public LTemplateInstruction<1, 1, 2> {
+class LPushArgument V8_FINAL : public LTemplateInstruction<0, 1, 0> {
public:
- LNumberTagD(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(NumberTagD, "number-tag-d")
- DECLARE_HYDROGEN_ACCESSOR(Change)
+ DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
};
-class LDoubleToSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LRegExpLiteral V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- explicit LDoubleToSmi(LOperand* value) {
- inputs_[0] = value;
+ explicit LRegExpLiteral(LOperand* context) {
+ inputs_[0] = context;
}
- LOperand* value() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(DoubleToSmi, "double-to-smi")
- DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
+ LOperand* context() { return inputs_[0]; }
- bool truncating() { return hydrogen()->CanTruncateToInt32(); }
+ DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal")
+ DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral)
};
-// Sometimes truncating conversion from a tagged value to an int32.
-class LDoubleToI V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LReturn V8_FINAL : public LTemplateInstruction<0, 3, 0> {
public:
- explicit LDoubleToI(LOperand* value) {
+ LReturn(LOperand* value, LOperand* context, LOperand* parameter_count) {
inputs_[0] = value;
+ inputs_[1] = context;
+ inputs_[2] = parameter_count;
}
LOperand* value() { return inputs_[0]; }
+ LOperand* parameter_count() { return inputs_[2]; }
- 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 V8_FINAL : public LTemplateInstruction<1, 1, 2> {
+class LSeqStringGetChar V8_FINAL : public LTemplateInstruction<1, 2, 1> {
public:
- LTaggedToI(LOperand* value,
- LOperand* temp,
- LOperand* temp2) {
- inputs_[0] = value;
+ LSeqStringGetChar(LOperand* string,
+ LOperand* index,
+ LOperand* temp) {
+ inputs_[0] = string;
+ inputs_[1] = index;
temps_[0] = temp;
- temps_[1] = temp2;
}
- LOperand* value() { return inputs_[0]; }
+ LOperand* string() { return inputs_[0]; }
+ LOperand* index() { return inputs_[1]; }
LOperand* temp() { return temps_[0]; }
- LOperand* temp2() { return temps_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
- DECLARE_HYDROGEN_ACCESSOR(Change)
-
- bool truncating() { return hydrogen()->CanTruncateToInt32(); }
+ DECLARE_CONCRETE_INSTRUCTION(SeqStringGetChar, "seq-string-get-char")
+ DECLARE_HYDROGEN_ACCESSOR(SeqStringGetChar)
};
-class LSmiTag V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LSeqStringSetChar V8_FINAL : public LTemplateInstruction<1, 4, 1> {
public:
- explicit LSmiTag(LOperand* value) {
- inputs_[0] = value;
+ LSeqStringSetChar(LOperand* context,
+ LOperand* string,
+ LOperand* index,
+ LOperand* value,
+ LOperand* temp) {
+ inputs_[0] = context;
+ inputs_[1] = string;
+ inputs_[2] = index;
+ inputs_[3] = value;
+ temps_[0] = temp;
}
- LOperand* value() { return inputs_[0]; }
+ LOperand* context() { return inputs_[0]; }
+ LOperand* string() { return inputs_[1]; }
+ LOperand* index() { return inputs_[2]; }
+ LOperand* value() { return inputs_[3]; }
+ LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag")
+ DECLARE_CONCRETE_INSTRUCTION(SeqStringSetChar, "seq-string-set-char")
+ DECLARE_HYDROGEN_ACCESSOR(SeqStringSetChar)
};
-class LNumberUntagD V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LSmiTag V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- explicit LNumberUntagD(LOperand* value) {
+ explicit LSmiTag(LOperand* value) {
inputs_[0] = value;
}
LOperand* value() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
- DECLARE_HYDROGEN_ACCESSOR(Change)
+ DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag")
};
@@ -2059,86 +2200,115 @@ class LSmiUntag V8_FINAL : public LTemplateInstruction<1, 1, 0> {
};
-class LStoreNamedField V8_FINAL : public LTemplateInstruction<0, 2, 1> {
- public:
- LStoreNamedField(LOperand* object, LOperand* value, LOperand* temp) {
- inputs_[0] = object;
- inputs_[1] = value;
- temps_[0] = temp;
- }
-
- LOperand* object() { return inputs_[0]; }
- LOperand* value() { return inputs_[1]; }
- LOperand* temp() { return temps_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
- DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
-
- virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
-
- Handle<Map> transition() const { return hydrogen()->transition_map(); }
- Representation representation() const {
- return hydrogen()->field_representation();
- }
-};
-
-
-class LStoreNamedGeneric V8_FINAL : public LTemplateInstruction<0, 3, 0> {
+class LStackCheck V8_FINAL : public LTemplateInstruction<0, 1, 0> {
public:
- LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value) {
+ explicit LStackCheck(LOperand* context) {
inputs_[0] = context;
- inputs_[1] = object;
- inputs_[2] = value;
}
LOperand* context() { return inputs_[0]; }
- LOperand* object() { return inputs_[1]; }
- LOperand* value() { return inputs_[2]; }
- DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
- DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
+ DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
+ DECLARE_HYDROGEN_ACCESSOR(StackCheck)
- virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
+ Label* done_label() { return &done_label_; }
- Handle<Object> name() const { return hydrogen()->name(); }
- StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); }
+ private:
+ Label done_label_;
};
-class LStoreKeyed V8_FINAL : public LTemplateInstruction<0, 3, 0> {
+template<int T>
+class LStoreKeyed : public LTemplateInstruction<0, 3, T> {
public:
- LStoreKeyed(LOperand* object, LOperand* key, LOperand* value) {
- inputs_[0] = object;
- inputs_[1] = key;
- inputs_[2] = value;
+ LStoreKeyed(LOperand* elements, LOperand* key, LOperand* value) {
+ this->inputs_[0] = elements;
+ this->inputs_[1] = key;
+ this->inputs_[2] = value;
}
- bool is_external() const { return hydrogen()->is_external(); }
+ bool is_external() const { return this->hydrogen()->is_external(); }
bool is_fixed_typed_array() const {
return hydrogen()->is_fixed_typed_array();
}
bool is_typed_elements() const {
return is_external() || is_fixed_typed_array();
}
- LOperand* elements() { return inputs_[0]; }
- LOperand* key() { return inputs_[1]; }
- LOperand* value() { return inputs_[2]; }
+ LOperand* elements() { return this->inputs_[0]; }
+ LOperand* key() { return this->inputs_[1]; }
+ LOperand* value() { return this->inputs_[2]; }
ElementsKind elements_kind() const {
- return hydrogen()->elements_kind();
+ return this->hydrogen()->elements_kind();
}
- DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed")
- DECLARE_HYDROGEN_ACCESSOR(StoreKeyed)
-
- virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
bool NeedsCanonicalization() {
- if (hydrogen()->value()->IsAdd() || hydrogen()->value()->IsSub() ||
- hydrogen()->value()->IsMul() || hydrogen()->value()->IsDiv()) {
- return false;
+ return this->hydrogen()->NeedsCanonicalization();
+ }
+ uint32_t additional_index() const { return this->hydrogen()->index_offset(); }
+
+ void PrintDataTo(StringStream* stream) V8_OVERRIDE {
+ this->elements()->PrintTo(stream);
+ stream->Add("[");
+ this->key()->PrintTo(stream);
+ if (this->hydrogen()->IsDehoisted()) {
+ stream->Add(" + %d] <-", this->additional_index());
+ } else {
+ stream->Add("] <- ");
+ }
+
+ if (this->value() == NULL) {
+ ASSERT(hydrogen()->IsConstantHoleStore() &&
+ hydrogen()->value()->representation().IsDouble());
+ stream->Add("<the hole(nan)>");
+ } else {
+ this->value()->PrintTo(stream);
}
- return hydrogen()->NeedsCanonicalization();
}
- uint32_t additional_index() const { return hydrogen()->index_offset(); }
+
+ DECLARE_HYDROGEN_ACCESSOR(StoreKeyed)
+};
+
+
+class LStoreKeyedExternal V8_FINAL : public LStoreKeyed<1> {
+ public:
+ LStoreKeyedExternal(LOperand* elements, LOperand* key, LOperand* value,
+ LOperand* temp) :
+ LStoreKeyed<1>(elements, key, value) {
+ temps_[0] = temp;
+ };
+
+ LOperand* temp() { return temps_[0]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(StoreKeyedExternal, "store-keyed-external")
+};
+
+
+class LStoreKeyedFixed V8_FINAL : 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 LStoreKeyedFixedDouble V8_FINAL : public LStoreKeyed<1> {
+ public:
+ LStoreKeyedFixedDouble(LOperand* elements, LOperand* key, LOperand* value,
+ LOperand* temp) :
+ LStoreKeyed<1>(elements, key, value) {
+ temps_[0] = temp;
+ };
+
+ LOperand* temp() { return temps_[0]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFixedDouble,
+ "store-keyed-fixed-double")
};
@@ -2168,48 +2338,52 @@ class LStoreKeyedGeneric V8_FINAL : public LTemplateInstruction<0, 4, 0> {
};
-class LTransitionElementsKind V8_FINAL : public LTemplateInstruction<0, 2, 1> {
+class LStoreNamedField V8_FINAL : public LTemplateInstruction<0, 2, 2> {
public:
- LTransitionElementsKind(LOperand* object,
- LOperand* context,
- LOperand* new_map_temp) {
+ LStoreNamedField(LOperand* object, LOperand* value,
+ LOperand* temp0, LOperand* temp1) {
inputs_[0] = object;
- inputs_[1] = context;
- temps_[0] = new_map_temp;
+ inputs_[1] = value;
+ temps_[0] = temp0;
+ temps_[1] = temp1;
}
- LOperand* context() { return inputs_[1]; }
LOperand* object() { return inputs_[0]; }
- LOperand* new_map_temp() { return temps_[0]; }
+ 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) V8_OVERRIDE;
- Handle<Map> original_map() { return hydrogen()->original_map().handle(); }
- Handle<Map> transitioned_map() {
- return hydrogen()->transitioned_map().handle();
+ Handle<Map> transition() const { return hydrogen()->transition_map(); }
+ Representation representation() const {
+ return hydrogen()->field_representation();
}
- ElementsKind from_kind() { return hydrogen()->from_kind(); }
- ElementsKind to_kind() { return hydrogen()->to_kind(); }
};
-class LTrapAllocationMemento V8_FINAL : public LTemplateInstruction<0, 1, 1> {
+class LStoreNamedGeneric V8_FINAL: public LTemplateInstruction<0, 3, 0> {
public:
- LTrapAllocationMemento(LOperand* object,
- LOperand* temp) {
- inputs_[0] = object;
- temps_[0] = temp;
+ LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value) {
+ inputs_[0] = context;
+ inputs_[1] = object;
+ inputs_[2] = value;
}
- LOperand* object() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
+ LOperand* context() { return inputs_[0]; }
+ LOperand* object() { return inputs_[1]; }
+ LOperand* value() { return inputs_[2]; }
- DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento,
- "trap-allocation-memento")
+ DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
+ DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
+
+ virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
+
+ Handle<Object> name() const { return hydrogen()->name(); }
+ StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); }
};
@@ -2250,7 +2424,7 @@ class LStringCharCodeAt V8_FINAL : public LTemplateInstruction<1, 3, 0> {
class LStringCharFromCode V8_FINAL : public LTemplateInstruction<1, 2, 0> {
public:
- explicit LStringCharFromCode(LOperand* context, LOperand* char_code) {
+ LStringCharFromCode(LOperand* context, LOperand* char_code) {
inputs_[0] = context;
inputs_[1] = char_code;
}
@@ -2263,166 +2437,266 @@ class LStringCharFromCode V8_FINAL : public LTemplateInstruction<1, 2, 0> {
};
-class LCheckValue V8_FINAL : public LTemplateInstruction<0, 1, 0> {
+class LStringCompareAndBranch V8_FINAL : public LControlInstruction<3, 0> {
+ public:
+ LStringCompareAndBranch(LOperand* context, LOperand* left, LOperand* right) {
+ inputs_[0] = context;
+ inputs_[1] = left;
+ inputs_[2] = right;
+ }
+
+ LOperand* context() { return inputs_[0]; }
+ LOperand* left() { return inputs_[1]; }
+ LOperand* right() { return inputs_[2]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch,
+ "string-compare-and-branch")
+ DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch)
+
+ Token::Value op() const { return hydrogen()->token(); }
+
+ virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
+};
+
+
+// Truncating conversion from a tagged value to an int32.
+class LTaggedToI V8_FINAL : public LTemplateInstruction<1, 1, 2> {
public:
- explicit LCheckValue(LOperand* value) {
+ explicit LTaggedToI(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(TaggedToI, "tagged-to-i")
+ DECLARE_HYDROGEN_ACCESSOR(Change)
+
+ bool truncating() { return hydrogen()->CanTruncateToInt32(); }
+};
+
+
+class LShiftI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+ public:
+ LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt)
+ : op_(op), can_deopt_(can_deopt) {
+ 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")
+
+ private:
+ Token::Value op_;
+ bool can_deopt_;
+};
+
+
+class LShiftS V8_FINAL : public LTemplateInstruction<1, 2, 1> {
+ public:
+ LShiftS(Token::Value op, LOperand* left, LOperand* right, LOperand* temp,
+ bool can_deopt) : op_(op), can_deopt_(can_deopt) {
+ inputs_[0] = left;
+ inputs_[1] = right;
+ temps_[0] = temp;
}
- LOperand* value() { return inputs_[0]; }
+ Token::Value op() const { return op_; }
+ LOperand* left() { return inputs_[0]; }
+ LOperand* right() { return inputs_[1]; }
+ LOperand* temp() { return temps_[0]; }
+ bool can_deopt() const { return can_deopt_; }
+
+ DECLARE_CONCRETE_INSTRUCTION(ShiftS, "shift-s")
- DECLARE_CONCRETE_INSTRUCTION(CheckValue, "check-value")
- DECLARE_HYDROGEN_ACCESSOR(CheckValue)
+ private:
+ Token::Value op_;
+ bool can_deopt_;
};
-class LCheckInstanceType V8_FINAL : public LTemplateInstruction<0, 1, 0> {
+class LStoreCodeEntry V8_FINAL: public LTemplateInstruction<0, 2, 1> {
public:
- explicit LCheckInstanceType(LOperand* value) {
- inputs_[0] = value;
+ LStoreCodeEntry(LOperand* function, LOperand* code_object,
+ LOperand* temp) {
+ inputs_[0] = function;
+ inputs_[1] = code_object;
+ temps_[0] = temp;
}
- LOperand* value() { return inputs_[0]; }
+ LOperand* function() { return inputs_[0]; }
+ LOperand* code_object() { return inputs_[1]; }
+ LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
- DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
+ virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
+
+ DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry, "store-code-entry")
+ DECLARE_HYDROGEN_ACCESSOR(StoreCodeEntry)
};
-class LCheckMaps V8_FINAL : public LTemplateInstruction<0, 1, 0> {
+class LStoreContextSlot V8_FINAL : public LTemplateInstruction<0, 2, 1> {
public:
- explicit LCheckMaps(LOperand* value) {
- inputs_[0] = value;
+ LStoreContextSlot(LOperand* context, LOperand* value, LOperand* temp) {
+ inputs_[0] = context;
+ inputs_[1] = value;
+ temps_[0] = temp;
}
- LOperand* value() { return inputs_[0]; }
+ LOperand* context() { return inputs_[0]; }
+ LOperand* value() { return inputs_[1]; }
+ LOperand* temp() { return temps_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps")
- DECLARE_HYDROGEN_ACCESSOR(CheckMaps)
+ DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
+ DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
+
+ int slot_index() { return hydrogen()->slot_index(); }
+
+ virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
};
-class LCheckSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LStoreGlobalCell V8_FINAL : public LTemplateInstruction<0, 1, 2> {
public:
- explicit LCheckSmi(LOperand* value) {
+ LStoreGlobalCell(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(CheckSmi, "check-smi")
+ DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell")
+ DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell)
};
-class LCheckNonSmi V8_FINAL : public LTemplateInstruction<0, 1, 0> {
+class LSubI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
public:
- explicit LCheckNonSmi(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(CheckNonSmi, "check-non-smi")
- DECLARE_HYDROGEN_ACCESSOR(CheckHeapObject)
+ DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i")
+ DECLARE_HYDROGEN_ACCESSOR(Sub)
};
-class LClampDToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LSubS: public LTemplateInstruction<1, 2, 0> {
public:
- explicit LClampDToUint8(LOperand* unclamped) {
- inputs_[0] = unclamped;
+ LSubS(LOperand* left, LOperand* right) {
+ inputs_[0] = left;
+ inputs_[1] = right;
}
- LOperand* unclamped() { return inputs_[0]; }
+ LOperand* left() { return inputs_[0]; }
+ LOperand* right() { return inputs_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8")
+ DECLARE_CONCRETE_INSTRUCTION(SubS, "sub-s")
+ DECLARE_HYDROGEN_ACCESSOR(Sub)
};
-class LClampIToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LThisFunction V8_FINAL : public LTemplateInstruction<1, 0, 0> {
public:
- explicit LClampIToUint8(LOperand* unclamped) {
- inputs_[0] = unclamped;
- }
-
- LOperand* unclamped() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8")
+ DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function")
+ DECLARE_HYDROGEN_ACCESSOR(ThisFunction)
};
-class LClampTToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 1> {
+class LToFastProperties V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- LClampTToUint8(LOperand* unclamped, LOperand* temp) {
- inputs_[0] = unclamped;
- temps_[0] = temp;
+ explicit LToFastProperties(LOperand* value) {
+ inputs_[0] = value;
}
- LOperand* unclamped() { return inputs_[0]; }
- LOperand* temp() { return temps_[0]; }
+ LOperand* value() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8")
+ DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties")
+ DECLARE_HYDROGEN_ACCESSOR(ToFastProperties)
};
-class LAllocate V8_FINAL : public LTemplateInstruction<1, 2, 2> {
+class LTransitionElementsKind V8_FINAL : public LTemplateInstruction<0, 2, 2> {
public:
- LAllocate(LOperand* context,
- LOperand* size,
- LOperand* temp1,
- LOperand* temp2) {
- inputs_[0] = context;
- inputs_[1] = size;
+ LTransitionElementsKind(LOperand* object,
+ LOperand* context,
+ LOperand* temp1,
+ LOperand* temp2 = NULL) {
+ inputs_[0] = object;
+ inputs_[1] = context;
temps_[0] = temp1;
temps_[1] = temp2;
}
- LOperand* context() { return inputs_[0]; }
- LOperand* size() { return inputs_[1]; }
+ LOperand* object() { return inputs_[0]; }
+ LOperand* context() { return inputs_[1]; }
LOperand* temp1() { return temps_[0]; }
LOperand* temp2() { return temps_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate")
- DECLARE_HYDROGEN_ACCESSOR(Allocate)
-};
+ DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind,
+ "transition-elements-kind")
+ DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind)
+ virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
-class LRegExpLiteral V8_FINAL : public LTemplateInstruction<1, 1, 0> {
- public:
- explicit LRegExpLiteral(LOperand* context) {
- inputs_[0] = context;
+ Handle<Map> original_map() { return hydrogen()->original_map().handle(); }
+ Handle<Map> transitioned_map() {
+ return hydrogen()->transitioned_map().handle();
}
-
- LOperand* context() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal")
- DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral)
+ ElementsKind from_kind() const { return hydrogen()->from_kind(); }
+ ElementsKind to_kind() const { return hydrogen()->to_kind(); }
};
-class LFunctionLiteral V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LTrapAllocationMemento V8_FINAL : public LTemplateInstruction<0, 1, 2> {
public:
- explicit LFunctionLiteral(LOperand* context) {
- inputs_[0] = context;
+ LTrapAllocationMemento(LOperand* object, LOperand* temp1, LOperand* temp2) {
+ inputs_[0] = object;
+ temps_[0] = temp1;
+ temps_[1] = temp2;
}
- LOperand* context() { return inputs_[0]; }
+ LOperand* object() { return inputs_[0]; }
+ LOperand* temp1() { return temps_[0]; }
+ LOperand* temp2() { return temps_[1]; }
- DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal")
- DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral)
+ DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento, "trap-allocation-memento")
};
-class LToFastProperties V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LTruncateDoubleToIntOrSmi V8_FINAL
+ : public LTemplateInstruction<1, 1, 2> {
public:
- explicit LToFastProperties(LOperand* value) {
+ LTruncateDoubleToIntOrSmi(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(ToFastProperties, "to-fast-properties")
- DECLARE_HYDROGEN_ACCESSOR(ToFastProperties)
+ DECLARE_CONCRETE_INSTRUCTION(TruncateDoubleToIntOrSmi,
+ "truncate-double-to-int-or-smi")
+ DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
+
+ bool tag_result() { return hydrogen()->representation().IsSmi(); }
};
@@ -2440,104 +2714,63 @@ class LTypeof V8_FINAL : public LTemplateInstruction<1, 2, 0> {
};
-class LTypeofIsAndBranch V8_FINAL : public LControlInstruction<1, 0> {
+class LTypeofIsAndBranch V8_FINAL : public LControlInstruction<1, 2> {
public:
- explicit LTypeofIsAndBranch(LOperand* value) {
+ LTypeofIsAndBranch(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(TypeofIsAndBranch, "typeof-is-and-branch")
DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch)
- Handle<String> type_literal() { return hydrogen()->type_literal(); }
+ Handle<String> type_literal() const { return hydrogen()->type_literal(); }
virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
};
-class LIsConstructCallAndBranch V8_FINAL : public LControlInstruction<0, 1> {
- public:
- explicit LIsConstructCallAndBranch(LOperand* temp) {
- temps_[0] = temp;
- }
-
- LOperand* temp() { return temps_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch,
- "is-construct-call-and-branch")
-};
-
-
-class LOsrEntry V8_FINAL : public LTemplateInstruction<0, 0, 0> {
- public:
- LOsrEntry() {}
-
- virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE {
- return false;
- }
- DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry")
-};
-
-
-class LStackCheck V8_FINAL : public LTemplateInstruction<0, 1, 0> {
- public:
- explicit LStackCheck(LOperand* context) {
- inputs_[0] = context;
- }
-
- LOperand* context() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
- DECLARE_HYDROGEN_ACCESSOR(StackCheck)
-
- Label* done_label() { return &done_label_; }
-
- private:
- Label done_label_;
-};
-
-
-class LForInPrepareMap V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+class LUint32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- LForInPrepareMap(LOperand* context, LOperand* object) {
- inputs_[0] = context;
- inputs_[1] = object;
+ explicit LUint32ToDouble(LOperand* value) {
+ inputs_[0] = value;
}
- LOperand* context() { return inputs_[0]; }
- LOperand* object() { return inputs_[1]; }
+ LOperand* value() { return inputs_[0]; }
- DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map")
+ DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double")
};
-class LForInCacheArray V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+class LUint32ToSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
- explicit LForInCacheArray(LOperand* map) {
- inputs_[0] = map;
+ explicit LUint32ToSmi(LOperand* value) {
+ inputs_[0] = value;
}
- LOperand* map() { return inputs_[0]; }
-
- DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array")
+ LOperand* value() { return inputs_[0]; }
- int idx() {
- return HForInCacheArray::cast(this->hydrogen_value())->idx();
- }
+ DECLARE_CONCRETE_INSTRUCTION(Uint32ToSmi, "uint32-to-smi")
+ DECLARE_HYDROGEN_ACCESSOR(Change)
};
-class LCheckMapValue V8_FINAL : public LTemplateInstruction<0, 2, 0> {
+class LCheckMapValue V8_FINAL : 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")
};
@@ -2557,13 +2790,28 @@ class LLoadFieldByIndex V8_FINAL : public LTemplateInstruction<1, 2, 0> {
};
+class LWrapReceiver V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+ public:
+ LWrapReceiver(LOperand* receiver, LOperand* function) {
+ inputs_[0] = receiver;
+ inputs_[1] = function;
+ }
+
+ DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver")
+ DECLARE_HYDROGEN_ACCESSOR(WrapReceiver)
+
+ LOperand* receiver() { return inputs_[0]; }
+ LOperand* function() { return inputs_[1]; }
+};
+
+
class LChunkBuilder;
class LPlatformChunk V8_FINAL : public LChunk {
public:
LPlatformChunk(CompilationInfo* info, HGraph* graph)
: LChunk(info, graph) { }
- int GetNextSpillIndex(RegisterKind kind);
+ int GetNextSpillIndex();
LOperand* GetNextSpillSlot(RegisterKind kind);
};
@@ -2578,7 +2826,6 @@ class LChunkBuilder V8_FINAL : public LChunkBuilderBase {
status_(UNUSED),
current_instruction_(NULL),
current_block_(NULL),
- next_block_(NULL),
allocator_(allocator),
position_(RelocInfo::kNoPosition),
instruction_pending_deoptimization_environment_(NULL),
@@ -2594,19 +2841,7 @@ class LChunkBuilder V8_FINAL : public LChunkBuilderBase {
HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
#undef DECLARE_DO
- LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend);
- LInstruction* DoMultiplySub(HValue* minuend, HMul* mul);
- LInstruction* DoRSub(HSub* instr);
-
- static bool HasMagicNumberForDivisor(int32_t divisor);
-
- LInstruction* DoMathFloor(HUnaryMathOperation* instr);
- LInstruction* DoMathRound(HUnaryMathOperation* instr);
- LInstruction* DoMathAbs(HUnaryMathOperation* instr);
- LInstruction* DoMathLog(HUnaryMathOperation* instr);
- LInstruction* DoMathExp(HUnaryMathOperation* instr);
- LInstruction* DoMathSqrt(HUnaryMathOperation* instr);
- LInstruction* DoMathPowHalf(HUnaryMathOperation* instr);
+ static bool HasMagicNumberForDivision(int32_t divisor);
private:
enum Status {
@@ -2616,15 +2851,18 @@ class LChunkBuilder V8_FINAL : public LChunkBuilderBase {
ABORTED
};
- LPlatformChunk* chunk() const { return chunk_; }
- CompilationInfo* info() const { return info_; }
HGraph* graph() const { return graph_; }
+ 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; }
+ int argument_count() const { return argument_count_; }
+ CompilationInfo* info() const { return info_; }
+ Heap* heap() const { return isolate()->heap(); }
+
void Abort(BailoutReason reason);
// Methods for getting operands for Use / Define / Temp.
@@ -2638,41 +2876,41 @@ class LChunkBuilder V8_FINAL : public LChunkBuilderBase {
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.
- virtual MUST_USE_RESULT LOperand* UseAny(HValue* value) V8_OVERRIDE;
+ virtual MUST_USE_RESULT LOperand* UseAny(HValue* value);
// 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.
@@ -2682,13 +2920,12 @@ class LChunkBuilder V8_FINAL : public LChunkBuilderBase {
LInstruction* DefineAsRegister(LTemplateResultInstruction<1>* instr);
LInstruction* DefineAsSpilled(LTemplateResultInstruction<1>* instr,
int index);
+
LInstruction* DefineSameAsFirst(LTemplateResultInstruction<1>* instr);
LInstruction* DefineFixed(LTemplateResultInstruction<1>* instr,
Register reg);
LInstruction* DefineFixedDouble(LTemplateResultInstruction<1>* instr,
DoubleRegister reg);
- LInstruction* AssignEnvironment(LInstruction* instr);
- LInstruction* AssignPointerMap(LInstruction* instr);
enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY };
@@ -2700,9 +2937,12 @@ class LChunkBuilder V8_FINAL : public LChunkBuilderBase {
HInstruction* hinstr,
CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
+ LInstruction* AssignPointerMap(LInstruction* instr);
+ LInstruction* AssignEnvironment(LInstruction* instr);
+
void VisitInstruction(HInstruction* current);
+ void DoBasicBlock(HBasicBlock* block);
- void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
LInstruction* DoArithmeticD(Token::Value op,
HArithmeticBinaryOperation* instr);
@@ -2715,7 +2955,6 @@ class LChunkBuilder V8_FINAL : public LChunkBuilderBase {
Status status_;
HInstruction* current_instruction_;
HBasicBlock* current_block_;
- HBasicBlock* next_block_;
LAllocator* allocator_;
int position_;
LInstruction* instruction_pending_deoptimization_environment_;
@@ -2729,4 +2968,4 @@ class LChunkBuilder V8_FINAL : public LChunkBuilderBase {
} } // namespace v8::internal
-#endif // V8_ARM_LITHIUM_ARM_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