Consistently use named getters for Lithium operands on ARM.

Removed a dead Lithium instruction on the way.

Review URL: https://codereview.chromium.org/10907234

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12527 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 3018b875
...@@ -194,22 +194,22 @@ void LGoto::PrintDataTo(StringStream* stream) { ...@@ -194,22 +194,22 @@ void LGoto::PrintDataTo(StringStream* stream) {
void LBranch::PrintDataTo(StringStream* stream) { void LBranch::PrintDataTo(StringStream* stream) {
stream->Add("B%d | B%d on ", true_block_id(), false_block_id()); stream->Add("B%d | B%d on ", true_block_id(), false_block_id());
InputAt(0)->PrintTo(stream); value()->PrintTo(stream);
} }
void LCmpIDAndBranch::PrintDataTo(StringStream* stream) { void LCmpIDAndBranch::PrintDataTo(StringStream* stream) {
stream->Add("if "); stream->Add("if ");
InputAt(0)->PrintTo(stream); left()->PrintTo(stream);
stream->Add(" %s ", Token::String(op())); stream->Add(" %s ", Token::String(op()));
InputAt(1)->PrintTo(stream); right()->PrintTo(stream);
stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); stream->Add(" then B%d else B%d", true_block_id(), false_block_id());
} }
void LIsNilAndBranch::PrintDataTo(StringStream* stream) { void LIsNilAndBranch::PrintDataTo(StringStream* stream) {
stream->Add("if "); stream->Add("if ");
InputAt(0)->PrintTo(stream); value()->PrintTo(stream);
stream->Add(kind() == kStrictEquality ? " === " : " == "); stream->Add(kind() == kStrictEquality ? " === " : " == ");
stream->Add(nil() == kNullValue ? "null" : "undefined"); stream->Add(nil() == kNullValue ? "null" : "undefined");
stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); stream->Add(" then B%d else B%d", true_block_id(), false_block_id());
...@@ -218,57 +218,57 @@ void LIsNilAndBranch::PrintDataTo(StringStream* stream) { ...@@ -218,57 +218,57 @@ void LIsNilAndBranch::PrintDataTo(StringStream* stream) {
void LIsObjectAndBranch::PrintDataTo(StringStream* stream) { void LIsObjectAndBranch::PrintDataTo(StringStream* stream) {
stream->Add("if is_object("); stream->Add("if is_object(");
InputAt(0)->PrintTo(stream); value()->PrintTo(stream);
stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
} }
void LIsStringAndBranch::PrintDataTo(StringStream* stream) { void LIsStringAndBranch::PrintDataTo(StringStream* stream) {
stream->Add("if is_string("); stream->Add("if is_string(");
InputAt(0)->PrintTo(stream); value()->PrintTo(stream);
stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
} }
void LIsSmiAndBranch::PrintDataTo(StringStream* stream) { void LIsSmiAndBranch::PrintDataTo(StringStream* stream) {
stream->Add("if is_smi("); stream->Add("if is_smi(");
InputAt(0)->PrintTo(stream); value()->PrintTo(stream);
stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
} }
void LIsUndetectableAndBranch::PrintDataTo(StringStream* stream) { void LIsUndetectableAndBranch::PrintDataTo(StringStream* stream) {
stream->Add("if is_undetectable("); stream->Add("if is_undetectable(");
InputAt(0)->PrintTo(stream); value()->PrintTo(stream);
stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
} }
void LStringCompareAndBranch::PrintDataTo(StringStream* stream) { void LStringCompareAndBranch::PrintDataTo(StringStream* stream) {
stream->Add("if string_compare("); stream->Add("if string_compare(");
InputAt(0)->PrintTo(stream); left()->PrintTo(stream);
InputAt(1)->PrintTo(stream); right()->PrintTo(stream);
stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
} }
void LHasInstanceTypeAndBranch::PrintDataTo(StringStream* stream) { void LHasInstanceTypeAndBranch::PrintDataTo(StringStream* stream) {
stream->Add("if has_instance_type("); stream->Add("if has_instance_type(");
InputAt(0)->PrintTo(stream); value()->PrintTo(stream);
stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
} }
void LHasCachedArrayIndexAndBranch::PrintDataTo(StringStream* stream) { void LHasCachedArrayIndexAndBranch::PrintDataTo(StringStream* stream) {
stream->Add("if has_cached_array_index("); stream->Add("if has_cached_array_index(");
InputAt(0)->PrintTo(stream); value()->PrintTo(stream);
stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); stream->Add(") then B%d else B%d", true_block_id(), false_block_id());
} }
void LClassOfTestAndBranch::PrintDataTo(StringStream* stream) { void LClassOfTestAndBranch::PrintDataTo(StringStream* stream) {
stream->Add("if class_of_test("); stream->Add("if class_of_test(");
InputAt(0)->PrintTo(stream); value()->PrintTo(stream);
stream->Add(", \"%o\") then B%d else B%d", stream->Add(", \"%o\") then B%d else B%d",
*hydrogen()->class_name(), *hydrogen()->class_name(),
true_block_id(), true_block_id(),
...@@ -278,7 +278,7 @@ void LClassOfTestAndBranch::PrintDataTo(StringStream* stream) { ...@@ -278,7 +278,7 @@ void LClassOfTestAndBranch::PrintDataTo(StringStream* stream) {
void LTypeofIsAndBranch::PrintDataTo(StringStream* stream) { void LTypeofIsAndBranch::PrintDataTo(StringStream* stream) {
stream->Add("if typeof "); stream->Add("if typeof ");
InputAt(0)->PrintTo(stream); value()->PrintTo(stream);
stream->Add(" == \"%s\" then B%d else B%d", stream->Add(" == \"%s\" then B%d else B%d",
*hydrogen()->type_literal()->ToCString(), *hydrogen()->type_literal()->ToCString(),
true_block_id(), false_block_id()); true_block_id(), false_block_id());
...@@ -292,26 +292,26 @@ void LCallConstantFunction::PrintDataTo(StringStream* stream) { ...@@ -292,26 +292,26 @@ void LCallConstantFunction::PrintDataTo(StringStream* stream) {
void LUnaryMathOperation::PrintDataTo(StringStream* stream) { void LUnaryMathOperation::PrintDataTo(StringStream* stream) {
stream->Add("/%s ", hydrogen()->OpName()); stream->Add("/%s ", hydrogen()->OpName());
InputAt(0)->PrintTo(stream); value()->PrintTo(stream);
} }
void LLoadContextSlot::PrintDataTo(StringStream* stream) { void LLoadContextSlot::PrintDataTo(StringStream* stream) {
InputAt(0)->PrintTo(stream); context()->PrintTo(stream);
stream->Add("[%d]", slot_index()); stream->Add("[%d]", slot_index());
} }
void LStoreContextSlot::PrintDataTo(StringStream* stream) { void LStoreContextSlot::PrintDataTo(StringStream* stream) {
InputAt(0)->PrintTo(stream); context()->PrintTo(stream);
stream->Add("[%d] <- ", slot_index()); stream->Add("[%d] <- ", slot_index());
InputAt(1)->PrintTo(stream); value()->PrintTo(stream);
} }
void LInvokeFunction::PrintDataTo(StringStream* stream) { void LInvokeFunction::PrintDataTo(StringStream* stream) {
stream->Add("= "); stream->Add("= ");
InputAt(0)->PrintTo(stream); function()->PrintTo(stream);
stream->Add(" #%d / ", arity()); stream->Add(" #%d / ", arity());
} }
...@@ -340,17 +340,15 @@ void LCallKnownGlobal::PrintDataTo(StringStream* stream) { ...@@ -340,17 +340,15 @@ void LCallKnownGlobal::PrintDataTo(StringStream* stream) {
void LCallNew::PrintDataTo(StringStream* stream) { void LCallNew::PrintDataTo(StringStream* stream) {
stream->Add("= "); stream->Add("= ");
InputAt(0)->PrintTo(stream); constructor()->PrintTo(stream);
stream->Add(" #%d / ", arity()); stream->Add(" #%d / ", arity());
} }
void LAccessArgumentsAt::PrintDataTo(StringStream* stream) { void LAccessArgumentsAt::PrintDataTo(StringStream* stream) {
arguments()->PrintTo(stream); arguments()->PrintTo(stream);
stream->Add(" length "); stream->Add(" length ");
length()->PrintTo(stream); length()->PrintTo(stream);
stream->Add(" index "); stream->Add(" index ");
index()->PrintTo(stream); index()->PrintTo(stream);
} }
......
...@@ -261,9 +261,6 @@ class LInstruction: public ZoneObject { ...@@ -261,9 +261,6 @@ class LInstruction: public ZoneObject {
virtual bool HasResult() const = 0; virtual bool HasResult() const = 0;
virtual LOperand* result() = 0; virtual LOperand* result() = 0;
virtual int TempCount() = 0;
virtual LOperand* TempAt(int i) = 0;
LOperand* FirstInput() { return InputAt(0); } LOperand* FirstInput() { return InputAt(0); }
LOperand* Output() { return HasResult() ? result() : NULL; } LOperand* Output() { return HasResult() ? result() : NULL; }
...@@ -277,6 +274,10 @@ class LInstruction: public ZoneObject { ...@@ -277,6 +274,10 @@ class LInstruction: public ZoneObject {
virtual int InputCount() = 0; virtual int InputCount() = 0;
virtual LOperand* InputAt(int i) = 0; virtual LOperand* InputAt(int i) = 0;
friend class TempIterator;
virtual int TempCount() = 0;
virtual LOperand* TempAt(int i) = 0;
LEnvironment* environment_; LEnvironment* environment_;
SetOncePointer<LPointerMap> pointer_map_; SetOncePointer<LPointerMap> pointer_map_;
HValue* hydrogen_value_; HValue* hydrogen_value_;
...@@ -296,11 +297,6 @@ class LTemplateInstruction: public LInstruction { ...@@ -296,11 +297,6 @@ class LTemplateInstruction: public LInstruction {
void set_result(LOperand* operand) { results_[0] = operand; } void set_result(LOperand* operand) { results_[0] = operand; }
LOperand* result() { return results_[0]; } LOperand* result() { return results_[0]; }
LOperand* InputAt(int i) { return inputs_[i]; }
int TempCount() { return T; }
LOperand* TempAt(int i) { return temps_[i]; }
protected: protected:
EmbeddedContainer<LOperand*, R> results_; EmbeddedContainer<LOperand*, R> results_;
EmbeddedContainer<LOperand*, I> inputs_; EmbeddedContainer<LOperand*, I> inputs_;
...@@ -308,6 +304,10 @@ class LTemplateInstruction: public LInstruction { ...@@ -308,6 +304,10 @@ class LTemplateInstruction: public LInstruction {
private: private:
virtual int InputCount() { return I; } virtual int InputCount() { return I; }
virtual LOperand* InputAt(int i) { return inputs_[i]; }
virtual int TempCount() { return T; }
virtual LOperand* TempAt(int i) { return temps_[i]; }
}; };
...@@ -525,6 +525,8 @@ class LArgumentsLength: public LTemplateInstruction<1, 1, 0> { ...@@ -525,6 +525,8 @@ class LArgumentsLength: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = elements; inputs_[0] = elements;
} }
LOperand* elements() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length") DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length")
}; };
...@@ -551,16 +553,22 @@ class LModI: public LTemplateInstruction<1, 2, 3> { ...@@ -551,16 +553,22 @@ class LModI: public LTemplateInstruction<1, 2, 3> {
// Used for the standard case. // Used for the standard case.
LModI(LOperand* left, LModI(LOperand* left,
LOperand* right, LOperand* right,
LOperand* temp1, LOperand* temp,
LOperand* temp2, LOperand* temp2,
LOperand* temp3) { LOperand* temp3) {
inputs_[0] = left; inputs_[0] = left;
inputs_[1] = right; inputs_[1] = right;
temps_[0] = temp1; temps_[0] = temp;
temps_[1] = temp2; temps_[1] = temp2;
temps_[2] = temp3; temps_[2] = temp3;
} }
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
LOperand* temp() { return temps_[0]; }
LOperand* temp2() { return temps_[1]; }
LOperand* temp3() { return temps_[2]; }
DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i") DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i")
DECLARE_HYDROGEN_ACCESSOR(Mod) DECLARE_HYDROGEN_ACCESSOR(Mod)
}; };
...@@ -573,6 +581,9 @@ class LDivI: public LTemplateInstruction<1, 2, 0> { ...@@ -573,6 +581,9 @@ class LDivI: public LTemplateInstruction<1, 2, 0> {
inputs_[1] = right; inputs_[1] = right;
} }
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
DECLARE_HYDROGEN_ACCESSOR(Div) DECLARE_HYDROGEN_ACCESSOR(Div)
}; };
...@@ -588,6 +599,10 @@ class LMathFloorOfDiv: public LTemplateInstruction<1, 2, 1> { ...@@ -588,6 +599,10 @@ class LMathFloorOfDiv: public LTemplateInstruction<1, 2, 1> {
temps_[0] = temp; 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_CONCRETE_INSTRUCTION(MathFloorOfDiv, "math-floor-of-div")
DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
}; };
...@@ -601,6 +616,10 @@ class LMulI: public LTemplateInstruction<1, 2, 1> { ...@@ -601,6 +616,10 @@ class LMulI: public LTemplateInstruction<1, 2, 1> {
temps_[0] = temp; temps_[0] = temp;
} }
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i") DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
DECLARE_HYDROGEN_ACCESSOR(Mul) DECLARE_HYDROGEN_ACCESSOR(Mul)
}; };
...@@ -613,6 +632,9 @@ class LCmpIDAndBranch: public LControlInstruction<2, 0> { ...@@ -613,6 +632,9 @@ class LCmpIDAndBranch: public LControlInstruction<2, 0> {
inputs_[1] = right; inputs_[1] = right;
} }
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch") DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch")
DECLARE_HYDROGEN_ACCESSOR(CompareIDAndBranch) DECLARE_HYDROGEN_ACCESSOR(CompareIDAndBranch)
...@@ -632,6 +654,9 @@ class LUnaryMathOperation: public LTemplateInstruction<1, 1, 1> { ...@@ -632,6 +654,9 @@ class LUnaryMathOperation: public LTemplateInstruction<1, 1, 1> {
temps_[0] = temp; temps_[0] = temp;
} }
LOperand* value() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation") DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation")
DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
...@@ -647,6 +672,9 @@ class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> { ...@@ -647,6 +672,9 @@ class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> {
inputs_[1] = right; inputs_[1] = right;
} }
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch, DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch,
"cmp-object-eq-and-branch") "cmp-object-eq-and-branch")
DECLARE_HYDROGEN_ACCESSOR(CompareObjectEqAndBranch) DECLARE_HYDROGEN_ACCESSOR(CompareObjectEqAndBranch)
...@@ -659,6 +687,8 @@ class LCmpConstantEqAndBranch: public LControlInstruction<1, 0> { ...@@ -659,6 +687,8 @@ class LCmpConstantEqAndBranch: public LControlInstruction<1, 0> {
inputs_[0] = left; inputs_[0] = left;
} }
LOperand* left() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(CmpConstantEqAndBranch, DECLARE_CONCRETE_INSTRUCTION(CmpConstantEqAndBranch,
"cmp-constant-eq-and-branch") "cmp-constant-eq-and-branch")
DECLARE_HYDROGEN_ACCESSOR(CompareConstantEqAndBranch) DECLARE_HYDROGEN_ACCESSOR(CompareConstantEqAndBranch)
...@@ -671,6 +701,8 @@ class LIsNilAndBranch: public LControlInstruction<1, 0> { ...@@ -671,6 +701,8 @@ class LIsNilAndBranch: public LControlInstruction<1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(IsNilAndBranch, "is-nil-and-branch") DECLARE_CONCRETE_INSTRUCTION(IsNilAndBranch, "is-nil-and-branch")
DECLARE_HYDROGEN_ACCESSOR(IsNilAndBranch) DECLARE_HYDROGEN_ACCESSOR(IsNilAndBranch)
...@@ -688,6 +720,9 @@ class LIsObjectAndBranch: public LControlInstruction<1, 1> { ...@@ -688,6 +720,9 @@ class LIsObjectAndBranch: public LControlInstruction<1, 1> {
temps_[0] = temp; temps_[0] = temp;
} }
LOperand* value() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch") DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch")
DECLARE_HYDROGEN_ACCESSOR(IsObjectAndBranch) DECLARE_HYDROGEN_ACCESSOR(IsObjectAndBranch)
...@@ -702,6 +737,9 @@ class LIsStringAndBranch: public LControlInstruction<1, 1> { ...@@ -702,6 +737,9 @@ class LIsStringAndBranch: public LControlInstruction<1, 1> {
temps_[0] = temp; temps_[0] = temp;
} }
LOperand* value() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch") DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch")
DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch) DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch)
...@@ -715,6 +753,8 @@ class LIsSmiAndBranch: public LControlInstruction<1, 0> { ...@@ -715,6 +753,8 @@ class LIsSmiAndBranch: public LControlInstruction<1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch) DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch)
...@@ -729,6 +769,9 @@ class LIsUndetectableAndBranch: public LControlInstruction<1, 1> { ...@@ -729,6 +769,9 @@ class LIsUndetectableAndBranch: public LControlInstruction<1, 1> {
temps_[0] = temp; temps_[0] = temp;
} }
LOperand* value() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch, DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch,
"is-undetectable-and-branch") "is-undetectable-and-branch")
DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch) DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch)
...@@ -744,6 +787,9 @@ class LStringCompareAndBranch: public LControlInstruction<2, 0> { ...@@ -744,6 +787,9 @@ class LStringCompareAndBranch: public LControlInstruction<2, 0> {
inputs_[1] = right; inputs_[1] = right;
} }
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch, DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch,
"string-compare-and-branch") "string-compare-and-branch")
DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch) DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch)
...@@ -760,6 +806,8 @@ class LHasInstanceTypeAndBranch: public LControlInstruction<1, 0> { ...@@ -760,6 +806,8 @@ class LHasInstanceTypeAndBranch: public LControlInstruction<1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
"has-instance-type-and-branch") "has-instance-type-and-branch")
DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch) DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch)
...@@ -774,6 +822,8 @@ class LGetCachedArrayIndex: public LTemplateInstruction<1, 1, 0> { ...@@ -774,6 +822,8 @@ class LGetCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index") DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index")
DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex) DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex)
}; };
...@@ -785,6 +835,8 @@ class LHasCachedArrayIndexAndBranch: public LControlInstruction<1, 0> { ...@@ -785,6 +835,8 @@ class LHasCachedArrayIndexAndBranch: public LControlInstruction<1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch,
"has-cached-array-index-and-branch") "has-cached-array-index-and-branch")
DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch) DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch)
...@@ -800,6 +852,9 @@ class LClassOfTestAndBranch: public LControlInstruction<1, 1> { ...@@ -800,6 +852,9 @@ class LClassOfTestAndBranch: public LControlInstruction<1, 1> {
temps_[0] = temp; temps_[0] = temp;
} }
LOperand* value() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch,
"class-of-test-and-branch") "class-of-test-and-branch")
DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch) DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch)
...@@ -815,6 +870,9 @@ class LCmpT: public LTemplateInstruction<1, 2, 0> { ...@@ -815,6 +870,9 @@ class LCmpT: public LTemplateInstruction<1, 2, 0> {
inputs_[1] = right; inputs_[1] = right;
} }
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t") DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
DECLARE_HYDROGEN_ACCESSOR(CompareGeneric) DECLARE_HYDROGEN_ACCESSOR(CompareGeneric)
...@@ -829,6 +887,9 @@ class LInstanceOf: public LTemplateInstruction<1, 2, 0> { ...@@ -829,6 +887,9 @@ class LInstanceOf: public LTemplateInstruction<1, 2, 0> {
inputs_[1] = right; inputs_[1] = right;
} }
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
}; };
...@@ -840,6 +901,9 @@ class LInstanceOfKnownGlobal: public LTemplateInstruction<1, 1, 1> { ...@@ -840,6 +901,9 @@ class LInstanceOfKnownGlobal: public LTemplateInstruction<1, 1, 1> {
temps_[0] = temp; temps_[0] = temp;
} }
LOperand* value() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
"instance-of-known-global") "instance-of-known-global")
DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal) DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal)
...@@ -879,6 +943,9 @@ class LBitI: public LTemplateInstruction<1, 2, 0> { ...@@ -879,6 +943,9 @@ class LBitI: public LTemplateInstruction<1, 2, 0> {
inputs_[1] = right; inputs_[1] = right;
} }
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
Token::Value op() const { return hydrogen()->op(); } Token::Value op() const { return hydrogen()->op(); }
DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i") DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i")
...@@ -895,7 +962,8 @@ class LShiftI: public LTemplateInstruction<1, 2, 0> { ...@@ -895,7 +962,8 @@ class LShiftI: public LTemplateInstruction<1, 2, 0> {
} }
Token::Value op() const { return op_; } Token::Value op() const { return op_; }
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
bool can_deopt() const { return can_deopt_; } bool can_deopt() const { return can_deopt_; }
DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i") DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i")
...@@ -913,6 +981,9 @@ class LSubI: public LTemplateInstruction<1, 2, 0> { ...@@ -913,6 +981,9 @@ class LSubI: public LTemplateInstruction<1, 2, 0> {
inputs_[1] = right; inputs_[1] = right;
} }
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i") DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i")
DECLARE_HYDROGEN_ACCESSOR(Sub) DECLARE_HYDROGEN_ACCESSOR(Sub)
}; };
...@@ -951,6 +1022,8 @@ class LBranch: public LControlInstruction<1, 0> { ...@@ -951,6 +1022,8 @@ class LBranch: public LControlInstruction<1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
DECLARE_HYDROGEN_ACCESSOR(Branch) DECLARE_HYDROGEN_ACCESSOR(Branch)
...@@ -965,6 +1038,9 @@ class LCmpMapAndBranch: public LTemplateInstruction<0, 1, 1> { ...@@ -965,6 +1038,9 @@ class LCmpMapAndBranch: public LTemplateInstruction<0, 1, 1> {
temps_[0] = temp; temps_[0] = temp;
} }
LOperand* value() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
DECLARE_HYDROGEN_ACCESSOR(CompareMap) DECLARE_HYDROGEN_ACCESSOR(CompareMap)
...@@ -986,6 +1062,8 @@ class LJSArrayLength: public LTemplateInstruction<1, 1, 0> { ...@@ -986,6 +1062,8 @@ class LJSArrayLength: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length") DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length")
DECLARE_HYDROGEN_ACCESSOR(JSArrayLength) DECLARE_HYDROGEN_ACCESSOR(JSArrayLength)
}; };
...@@ -997,6 +1075,8 @@ class LFixedArrayBaseLength: public LTemplateInstruction<1, 1, 0> { ...@@ -997,6 +1075,8 @@ class LFixedArrayBaseLength: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(FixedArrayBaseLength, DECLARE_CONCRETE_INSTRUCTION(FixedArrayBaseLength,
"fixed-array-base-length") "fixed-array-base-length")
DECLARE_HYDROGEN_ACCESSOR(FixedArrayBaseLength) DECLARE_HYDROGEN_ACCESSOR(FixedArrayBaseLength)
...@@ -1009,6 +1089,8 @@ class LMapEnumLength: public LTemplateInstruction<1, 1, 0> { ...@@ -1009,6 +1089,8 @@ class LMapEnumLength: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(MapEnumLength, "map-enum-length") DECLARE_CONCRETE_INSTRUCTION(MapEnumLength, "map-enum-length")
}; };
...@@ -1019,6 +1101,8 @@ class LElementsKind: public LTemplateInstruction<1, 1, 0> { ...@@ -1019,6 +1101,8 @@ class LElementsKind: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(ElementsKind, "elements-kind") DECLARE_CONCRETE_INSTRUCTION(ElementsKind, "elements-kind")
DECLARE_HYDROGEN_ACCESSOR(ElementsKind) DECLARE_HYDROGEN_ACCESSOR(ElementsKind)
}; };
...@@ -1031,6 +1115,9 @@ class LValueOf: public LTemplateInstruction<1, 1, 1> { ...@@ -1031,6 +1115,9 @@ class LValueOf: public LTemplateInstruction<1, 1, 1> {
temps_[0] = temp; temps_[0] = temp;
} }
LOperand* value() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of") DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of")
DECLARE_HYDROGEN_ACCESSOR(ValueOf) DECLARE_HYDROGEN_ACCESSOR(ValueOf)
}; };
...@@ -1043,40 +1130,26 @@ class LDateField: public LTemplateInstruction<1, 1, 1> { ...@@ -1043,40 +1130,26 @@ class LDateField: public LTemplateInstruction<1, 1, 1> {
temps_[0] = temp; temps_[0] = temp;
} }
LOperand* date() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
Smi* index() const { return index_; }
DECLARE_CONCRETE_INSTRUCTION(ValueOf, "date-field") DECLARE_CONCRETE_INSTRUCTION(ValueOf, "date-field")
DECLARE_HYDROGEN_ACCESSOR(ValueOf) DECLARE_HYDROGEN_ACCESSOR(ValueOf)
Smi* index() const { return index_; }
private: private:
Smi* index_; Smi* index_;
}; };
class LSetDateField: public LTemplateInstruction<1, 2, 1> {
public:
LSetDateField(LOperand* date, LOperand* value, LOperand* temp, int index)
: index_(index) {
inputs_[0] = date;
inputs_[1] = value;
temps_[0] = temp;
}
DECLARE_CONCRETE_INSTRUCTION(DateField, "date-set-field")
DECLARE_HYDROGEN_ACCESSOR(DateField)
int index() const { return index_; }
private:
int index_;
};
class LThrow: public LTemplateInstruction<0, 1, 0> { class LThrow: public LTemplateInstruction<0, 1, 0> {
public: public:
explicit LThrow(LOperand* value) { explicit LThrow(LOperand* value) {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(Throw, "throw") DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
}; };
...@@ -1087,6 +1160,8 @@ class LBitNotI: public LTemplateInstruction<1, 1, 0> { ...@@ -1087,6 +1160,8 @@ class LBitNotI: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i") DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i")
}; };
...@@ -1098,6 +1173,9 @@ class LAddI: public LTemplateInstruction<1, 2, 0> { ...@@ -1098,6 +1173,9 @@ class LAddI: public LTemplateInstruction<1, 2, 0> {
inputs_[1] = right; inputs_[1] = right;
} }
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i") DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i")
DECLARE_HYDROGEN_ACCESSOR(Add) DECLARE_HYDROGEN_ACCESSOR(Add)
}; };
...@@ -1110,6 +1188,9 @@ class LMathMinMax: public LTemplateInstruction<1, 2, 0> { ...@@ -1110,6 +1188,9 @@ class LMathMinMax: public LTemplateInstruction<1, 2, 0> {
inputs_[1] = right; inputs_[1] = right;
} }
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "min-max") DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "min-max")
DECLARE_HYDROGEN_ACCESSOR(MathMinMax) DECLARE_HYDROGEN_ACCESSOR(MathMinMax)
}; };
...@@ -1122,6 +1203,9 @@ class LPower: public LTemplateInstruction<1, 2, 0> { ...@@ -1122,6 +1203,9 @@ class LPower: public LTemplateInstruction<1, 2, 0> {
inputs_[1] = right; inputs_[1] = right;
} }
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(Power, "power") DECLARE_CONCRETE_INSTRUCTION(Power, "power")
DECLARE_HYDROGEN_ACCESSOR(Power) DECLARE_HYDROGEN_ACCESSOR(Power)
}; };
...@@ -1133,6 +1217,8 @@ class LRandom: public LTemplateInstruction<1, 1, 0> { ...@@ -1133,6 +1217,8 @@ class LRandom: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = global_object; inputs_[0] = global_object;
} }
LOperand* global_object() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(Random, "random") DECLARE_CONCRETE_INSTRUCTION(Random, "random")
DECLARE_HYDROGEN_ACCESSOR(Random) DECLARE_HYDROGEN_ACCESSOR(Random)
}; };
...@@ -1147,6 +1233,8 @@ class LArithmeticD: public LTemplateInstruction<1, 2, 0> { ...@@ -1147,6 +1233,8 @@ class LArithmeticD: public LTemplateInstruction<1, 2, 0> {
} }
Token::Value op() const { return op_; } Token::Value op() const { return op_; }
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
virtual Opcode opcode() const { return LInstruction::kArithmeticD; } virtual Opcode opcode() const { return LInstruction::kArithmeticD; }
virtual void CompileToNative(LCodeGen* generator); virtual void CompileToNative(LCodeGen* generator);
...@@ -1165,12 +1253,14 @@ class LArithmeticT: public LTemplateInstruction<1, 2, 0> { ...@@ -1165,12 +1253,14 @@ class LArithmeticT: public LTemplateInstruction<1, 2, 0> {
inputs_[1] = right; inputs_[1] = right;
} }
LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; }
Token::Value op() const { return op_; }
virtual Opcode opcode() const { return LInstruction::kArithmeticT; } virtual Opcode opcode() const { return LInstruction::kArithmeticT; }
virtual void CompileToNative(LCodeGen* generator); virtual void CompileToNative(LCodeGen* generator);
virtual const char* Mnemonic() const; virtual const char* Mnemonic() const;
Token::Value op() const { return op_; }
private: private:
Token::Value op_; Token::Value op_;
}; };
...@@ -1182,6 +1272,8 @@ class LReturn: public LTemplateInstruction<0, 1, 0> { ...@@ -1182,6 +1272,8 @@ class LReturn: public LTemplateInstruction<0, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(Return, "return") DECLARE_CONCRETE_INSTRUCTION(Return, "return")
}; };
...@@ -1192,6 +1284,8 @@ class LLoadNamedField: public LTemplateInstruction<1, 1, 0> { ...@@ -1192,6 +1284,8 @@ class LLoadNamedField: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = object; inputs_[0] = object;
} }
LOperand* object() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field")
DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) DECLARE_HYDROGEN_ACCESSOR(LoadNamedField)
}; };
...@@ -1203,10 +1297,10 @@ class LLoadNamedFieldPolymorphic: public LTemplateInstruction<1, 1, 0> { ...@@ -1203,10 +1297,10 @@ class LLoadNamedFieldPolymorphic: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = object; inputs_[0] = object;
} }
LOperand* object() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field-polymorphic") DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field-polymorphic")
DECLARE_HYDROGEN_ACCESSOR(LoadNamedFieldPolymorphic) DECLARE_HYDROGEN_ACCESSOR(LoadNamedFieldPolymorphic)
LOperand* object() { return inputs_[0]; }
}; };
...@@ -1216,10 +1310,11 @@ class LLoadNamedGeneric: public LTemplateInstruction<1, 1, 0> { ...@@ -1216,10 +1310,11 @@ class LLoadNamedGeneric: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = object; inputs_[0] = object;
} }
LOperand* object() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic") DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric) DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
LOperand* object() { return inputs_[0]; }
Handle<Object> name() const { return hydrogen()->name(); } Handle<Object> name() const { return hydrogen()->name(); }
}; };
...@@ -1230,10 +1325,10 @@ class LLoadFunctionPrototype: public LTemplateInstruction<1, 1, 0> { ...@@ -1230,10 +1325,10 @@ class LLoadFunctionPrototype: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = function; inputs_[0] = function;
} }
LOperand* function() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype") DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype")
DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype) DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype)
LOperand* function() { return inputs_[0]; }
}; };
...@@ -1243,6 +1338,8 @@ class LLoadElements: public LTemplateInstruction<1, 1, 0> { ...@@ -1243,6 +1338,8 @@ class LLoadElements: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = object; inputs_[0] = object;
} }
LOperand* object() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements") DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements")
}; };
...@@ -1253,6 +1350,8 @@ class LLoadExternalArrayPointer: public LTemplateInstruction<1, 1, 0> { ...@@ -1253,6 +1350,8 @@ class LLoadExternalArrayPointer: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = object; inputs_[0] = object;
} }
LOperand* object() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer, DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer,
"load-external-array-pointer") "load-external-array-pointer")
}; };
...@@ -1265,11 +1364,12 @@ class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> { ...@@ -1265,11 +1364,12 @@ class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> {
inputs_[1] = key; inputs_[1] = key;
} }
LOperand* elements() { return inputs_[0]; }
LOperand* key() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element") DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element")
DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement) DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement)
LOperand* elements() { return inputs_[0]; }
LOperand* key() { return inputs_[1]; }
uint32_t additional_index() const { return hydrogen()->index_offset(); } uint32_t additional_index() const { return hydrogen()->index_offset(); }
}; };
...@@ -1281,12 +1381,13 @@ class LLoadKeyedFastDoubleElement: public LTemplateInstruction<1, 2, 0> { ...@@ -1281,12 +1381,13 @@ class LLoadKeyedFastDoubleElement: public LTemplateInstruction<1, 2, 0> {
inputs_[1] = key; inputs_[1] = key;
} }
LOperand* elements() { return inputs_[0]; }
LOperand* key() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastDoubleElement, DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastDoubleElement,
"load-keyed-fast-double-element") "load-keyed-fast-double-element")
DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastDoubleElement) DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastDoubleElement)
LOperand* elements() { return inputs_[0]; }
LOperand* key() { return inputs_[1]; }
uint32_t additional_index() const { return hydrogen()->index_offset(); } uint32_t additional_index() const { return hydrogen()->index_offset(); }
}; };
...@@ -1298,12 +1399,13 @@ class LLoadKeyedSpecializedArrayElement: public LTemplateInstruction<1, 2, 0> { ...@@ -1298,12 +1399,13 @@ class LLoadKeyedSpecializedArrayElement: public LTemplateInstruction<1, 2, 0> {
inputs_[1] = key; inputs_[1] = key;
} }
LOperand* external_pointer() { return inputs_[0]; }
LOperand* key() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(LoadKeyedSpecializedArrayElement, DECLARE_CONCRETE_INSTRUCTION(LoadKeyedSpecializedArrayElement,
"load-keyed-specialized-array-element") "load-keyed-specialized-array-element")
DECLARE_HYDROGEN_ACCESSOR(LoadKeyedSpecializedArrayElement) DECLARE_HYDROGEN_ACCESSOR(LoadKeyedSpecializedArrayElement)
LOperand* external_pointer() { return inputs_[0]; }
LOperand* key() { return inputs_[1]; }
ElementsKind elements_kind() const { ElementsKind elements_kind() const {
return hydrogen()->elements_kind(); return hydrogen()->elements_kind();
} }
...@@ -1313,15 +1415,15 @@ class LLoadKeyedSpecializedArrayElement: public LTemplateInstruction<1, 2, 0> { ...@@ -1313,15 +1415,15 @@ class LLoadKeyedSpecializedArrayElement: public LTemplateInstruction<1, 2, 0> {
class LLoadKeyedGeneric: public LTemplateInstruction<1, 2, 0> { class LLoadKeyedGeneric: public LTemplateInstruction<1, 2, 0> {
public: public:
LLoadKeyedGeneric(LOperand* obj, LOperand* key) { LLoadKeyedGeneric(LOperand* object, LOperand* key) {
inputs_[0] = obj; inputs_[0] = object;
inputs_[1] = key; inputs_[1] = key;
} }
DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
LOperand* object() { return inputs_[0]; } LOperand* object() { return inputs_[0]; }
LOperand* key() { return inputs_[1]; } LOperand* key() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
}; };
...@@ -1338,10 +1440,11 @@ class LLoadGlobalGeneric: public LTemplateInstruction<1, 1, 0> { ...@@ -1338,10 +1440,11 @@ class LLoadGlobalGeneric: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = global_object; inputs_[0] = global_object;
} }
LOperand* global_object() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic") DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic")
DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric) DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric)
LOperand* global_object() { return inputs_[0]; }
Handle<Object> name() const { return hydrogen()->name(); } Handle<Object> name() const { return hydrogen()->name(); }
bool for_typeof() const { return hydrogen()->for_typeof(); } bool for_typeof() const { return hydrogen()->for_typeof(); }
}; };
...@@ -1354,10 +1457,11 @@ class LStoreGlobalCell: public LTemplateInstruction<0, 1, 1> { ...@@ -1354,10 +1457,11 @@ class LStoreGlobalCell: public LTemplateInstruction<0, 1, 1> {
temps_[0] = temp; temps_[0] = temp;
} }
LOperand* value() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell") DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell")
DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell) DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell)
LOperand* value() { return inputs_[0]; }
}; };
...@@ -1369,12 +1473,13 @@ class LStoreGlobalGeneric: public LTemplateInstruction<0, 2, 0> { ...@@ -1369,12 +1473,13 @@ class LStoreGlobalGeneric: public LTemplateInstruction<0, 2, 0> {
inputs_[1] = value; inputs_[1] = value;
} }
LOperand* global_object() { return inputs_[0]; }
LOperand* value() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store-global-generic") DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store-global-generic")
DECLARE_HYDROGEN_ACCESSOR(StoreGlobalGeneric) DECLARE_HYDROGEN_ACCESSOR(StoreGlobalGeneric)
LOperand* global_object() { return InputAt(0); }
Handle<Object> name() const { return hydrogen()->name(); } Handle<Object> name() const { return hydrogen()->name(); }
LOperand* value() { return InputAt(1); }
StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); }
}; };
...@@ -1385,10 +1490,11 @@ class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> { ...@@ -1385,10 +1490,11 @@ class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = context; inputs_[0] = context;
} }
LOperand* context() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot")
DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot)
LOperand* context() { return InputAt(0); }
int slot_index() { return hydrogen()->slot_index(); } int slot_index() { return hydrogen()->slot_index(); }
virtual void PrintDataTo(StringStream* stream); virtual void PrintDataTo(StringStream* stream);
...@@ -1402,11 +1508,12 @@ class LStoreContextSlot: public LTemplateInstruction<0, 2, 0> { ...@@ -1402,11 +1508,12 @@ class LStoreContextSlot: public LTemplateInstruction<0, 2, 0> {
inputs_[1] = value; inputs_[1] = value;
} }
LOperand* context() { return inputs_[0]; }
LOperand* value() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot") DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot) DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
LOperand* context() { return InputAt(0); }
LOperand* value() { return InputAt(1); }
int slot_index() { return hydrogen()->slot_index(); } int slot_index() { return hydrogen()->slot_index(); }
virtual void PrintDataTo(StringStream* stream); virtual void PrintDataTo(StringStream* stream);
...@@ -1419,6 +1526,8 @@ class LPushArgument: public LTemplateInstruction<0, 1, 0> { ...@@ -1419,6 +1526,8 @@ class LPushArgument: public LTemplateInstruction<0, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
}; };
...@@ -1455,9 +1564,9 @@ class LOuterContext: public LTemplateInstruction<1, 1, 0> { ...@@ -1455,9 +1564,9 @@ class LOuterContext: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = context; inputs_[0] = context;
} }
DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context") LOperand* context() { return inputs_[0]; }
LOperand* context() { return InputAt(0); } DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context")
}; };
...@@ -1476,7 +1585,7 @@ class LGlobalObject: public LTemplateInstruction<1, 1, 0> { ...@@ -1476,7 +1585,7 @@ class LGlobalObject: public LTemplateInstruction<1, 1, 0> {
DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object") DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object")
LOperand* context() { return InputAt(0); } LOperand* context() { return inputs_[0]; }
}; };
...@@ -1486,9 +1595,9 @@ class LGlobalReceiver: public LTemplateInstruction<1, 1, 0> { ...@@ -1486,9 +1595,9 @@ class LGlobalReceiver: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = global_object; inputs_[0] = global_object;
} }
DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver") LOperand* global_object() { return inputs_[0]; }
LOperand* global() { return InputAt(0); } DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver")
}; };
...@@ -1510,11 +1619,11 @@ class LInvokeFunction: public LTemplateInstruction<1, 1, 0> { ...@@ -1510,11 +1619,11 @@ class LInvokeFunction: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = function; inputs_[0] = function;
} }
LOperand* function() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function") DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
DECLARE_HYDROGEN_ACCESSOR(InvokeFunction) DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
LOperand* function() { return inputs_[0]; }
virtual void PrintDataTo(StringStream* stream); virtual void PrintDataTo(StringStream* stream);
int arity() const { return hydrogen()->argument_count() - 1; } int arity() const { return hydrogen()->argument_count() - 1; }
...@@ -1528,6 +1637,8 @@ class LCallKeyed: public LTemplateInstruction<1, 1, 0> { ...@@ -1528,6 +1637,8 @@ class LCallKeyed: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = key; inputs_[0] = key;
} }
LOperand* key() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed") DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed")
DECLARE_HYDROGEN_ACCESSOR(CallKeyed) DECLARE_HYDROGEN_ACCESSOR(CallKeyed)
...@@ -1556,10 +1667,11 @@ class LCallFunction: public LTemplateInstruction<1, 1, 0> { ...@@ -1556,10 +1667,11 @@ class LCallFunction: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = function; inputs_[0] = function;
} }
LOperand* function() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function") DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
DECLARE_HYDROGEN_ACCESSOR(CallFunction) DECLARE_HYDROGEN_ACCESSOR(CallFunction)
LOperand* function() { return inputs_[0]; }
int arity() const { return hydrogen()->argument_count() - 1; } int arity() const { return hydrogen()->argument_count() - 1; }
}; };
...@@ -1594,6 +1706,8 @@ class LCallNew: public LTemplateInstruction<1, 1, 0> { ...@@ -1594,6 +1706,8 @@ class LCallNew: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = constructor; inputs_[0] = constructor;
} }
LOperand* constructor() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new") DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new")
DECLARE_HYDROGEN_ACCESSOR(CallNew) DECLARE_HYDROGEN_ACCESSOR(CallNew)
...@@ -1619,6 +1733,8 @@ class LInteger32ToDouble: public LTemplateInstruction<1, 1, 0> { ...@@ -1619,6 +1733,8 @@ class LInteger32ToDouble: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double")
}; };
...@@ -1629,6 +1745,8 @@ class LUint32ToDouble: public LTemplateInstruction<1, 1, 0> { ...@@ -1629,6 +1745,8 @@ class LUint32ToDouble: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double") DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double")
}; };
...@@ -1639,6 +1757,8 @@ class LNumberTagI: public LTemplateInstruction<1, 1, 0> { ...@@ -1639,6 +1757,8 @@ class LNumberTagI: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i") DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i")
}; };
...@@ -1649,18 +1769,24 @@ class LNumberTagU: public LTemplateInstruction<1, 1, 0> { ...@@ -1649,18 +1769,24 @@ class LNumberTagU: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u") DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u")
}; };
class LNumberTagD: public LTemplateInstruction<1, 1, 2> { class LNumberTagD: public LTemplateInstruction<1, 1, 2> {
public: public:
LNumberTagD(LOperand* value, LOperand* temp1, LOperand* temp2) { LNumberTagD(LOperand* value, LOperand* temp, LOperand* temp2) {
inputs_[0] = value; inputs_[0] = value;
temps_[0] = temp1; temps_[0] = temp;
temps_[1] = temp2; temps_[1] = temp2;
} }
LOperand* value() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
LOperand* temp2() { return temps_[1]; }
DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d")
}; };
...@@ -1668,12 +1794,16 @@ class LNumberTagD: public LTemplateInstruction<1, 1, 2> { ...@@ -1668,12 +1794,16 @@ class LNumberTagD: public LTemplateInstruction<1, 1, 2> {
// Sometimes truncating conversion from a tagged value to an int32. // Sometimes truncating conversion from a tagged value to an int32.
class LDoubleToI: public LTemplateInstruction<1, 1, 2> { class LDoubleToI: public LTemplateInstruction<1, 1, 2> {
public: public:
LDoubleToI(LOperand* value, LOperand* temp1, LOperand* temp2) { LDoubleToI(LOperand* value, LOperand* temp, LOperand* temp2) {
inputs_[0] = value; inputs_[0] = value;
temps_[0] = temp1; temps_[0] = temp;
temps_[1] = temp2; temps_[1] = temp2;
} }
LOperand* value() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
LOperand* temp2() { return temps_[1]; }
DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
...@@ -1685,15 +1815,20 @@ class LDoubleToI: public LTemplateInstruction<1, 1, 2> { ...@@ -1685,15 +1815,20 @@ class LDoubleToI: public LTemplateInstruction<1, 1, 2> {
class LTaggedToI: public LTemplateInstruction<1, 1, 3> { class LTaggedToI: public LTemplateInstruction<1, 1, 3> {
public: public:
LTaggedToI(LOperand* value, LTaggedToI(LOperand* value,
LOperand* temp1, LOperand* temp,
LOperand* temp2, LOperand* temp2,
LOperand* temp3) { LOperand* temp3) {
inputs_[0] = value; inputs_[0] = value;
temps_[0] = temp1; temps_[0] = temp;
temps_[1] = temp2; temps_[1] = temp2;
temps_[2] = temp3; temps_[2] = temp3;
} }
LOperand* value() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
LOperand* temp2() { return temps_[1]; }
LOperand* temp3() { return temps_[2]; }
DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
...@@ -1707,6 +1842,8 @@ class LSmiTag: public LTemplateInstruction<1, 1, 0> { ...@@ -1707,6 +1842,8 @@ class LSmiTag: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag")
}; };
...@@ -1717,6 +1854,8 @@ class LNumberUntagD: public LTemplateInstruction<1, 1, 0> { ...@@ -1717,6 +1854,8 @@ class LNumberUntagD: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
DECLARE_HYDROGEN_ACCESSOR(Change) DECLARE_HYDROGEN_ACCESSOR(Change)
}; };
...@@ -1729,10 +1868,11 @@ class LSmiUntag: public LTemplateInstruction<1, 1, 0> { ...@@ -1729,10 +1868,11 @@ class LSmiUntag: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") LOperand* value() { return inputs_[0]; }
bool needs_check() const { return needs_check_; } bool needs_check() const { return needs_check_; }
DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag")
private: private:
bool needs_check_; bool needs_check_;
}; };
...@@ -1740,20 +1880,21 @@ class LSmiUntag: public LTemplateInstruction<1, 1, 0> { ...@@ -1740,20 +1880,21 @@ class LSmiUntag: public LTemplateInstruction<1, 1, 0> {
class LStoreNamedField: public LTemplateInstruction<0, 2, 1> { class LStoreNamedField: public LTemplateInstruction<0, 2, 1> {
public: public:
LStoreNamedField(LOperand* obj, LOperand* val, LOperand* temp) { LStoreNamedField(LOperand* object, LOperand* value, LOperand* temp) {
inputs_[0] = obj; inputs_[0] = object;
inputs_[1] = val; inputs_[1] = value;
temps_[0] = temp; 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_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
DECLARE_HYDROGEN_ACCESSOR(StoreNamedField) DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
virtual void PrintDataTo(StringStream* stream); virtual void PrintDataTo(StringStream* stream);
LOperand* object() { return inputs_[0]; }
LOperand* value() { return inputs_[1]; }
Handle<Object> name() const { return hydrogen()->name(); } Handle<Object> name() const { return hydrogen()->name(); }
bool is_in_object() { return hydrogen()->is_in_object(); } bool is_in_object() { return hydrogen()->is_in_object(); }
int offset() { return hydrogen()->offset(); } int offset() { return hydrogen()->offset(); }
...@@ -1763,18 +1904,19 @@ class LStoreNamedField: public LTemplateInstruction<0, 2, 1> { ...@@ -1763,18 +1904,19 @@ class LStoreNamedField: public LTemplateInstruction<0, 2, 1> {
class LStoreNamedGeneric: public LTemplateInstruction<0, 2, 0> { class LStoreNamedGeneric: public LTemplateInstruction<0, 2, 0> {
public: public:
LStoreNamedGeneric(LOperand* obj, LOperand* val) { LStoreNamedGeneric(LOperand* object, LOperand* value) {
inputs_[0] = obj; inputs_[0] = object;
inputs_[1] = val; inputs_[1] = value;
} }
LOperand* object() { return inputs_[0]; }
LOperand* value() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
virtual void PrintDataTo(StringStream* stream); virtual void PrintDataTo(StringStream* stream);
LOperand* object() { return inputs_[0]; }
LOperand* value() { return inputs_[1]; }
Handle<Object> name() const { return hydrogen()->name(); } Handle<Object> name() const { return hydrogen()->name(); }
StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); }
}; };
...@@ -1782,21 +1924,22 @@ class LStoreNamedGeneric: public LTemplateInstruction<0, 2, 0> { ...@@ -1782,21 +1924,22 @@ class LStoreNamedGeneric: public LTemplateInstruction<0, 2, 0> {
class LStoreKeyedFastElement: public LTemplateInstruction<0, 3, 0> { class LStoreKeyedFastElement: public LTemplateInstruction<0, 3, 0> {
public: public:
LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val) { LStoreKeyedFastElement(LOperand* object, LOperand* key, LOperand* value) {
inputs_[0] = obj; inputs_[0] = object;
inputs_[1] = key; inputs_[1] = key;
inputs_[2] = val; inputs_[2] = value;
} }
LOperand* object() { return inputs_[0]; }
LOperand* key() { return inputs_[1]; }
LOperand* value() { return inputs_[2]; }
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement, DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
"store-keyed-fast-element") "store-keyed-fast-element")
DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement) DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement)
virtual void PrintDataTo(StringStream* stream); virtual void PrintDataTo(StringStream* stream);
LOperand* object() { return inputs_[0]; }
LOperand* key() { return inputs_[1]; }
LOperand* value() { return inputs_[2]; }
uint32_t additional_index() const { return hydrogen()->index_offset(); } uint32_t additional_index() const { return hydrogen()->index_offset(); }
}; };
...@@ -1805,21 +1948,22 @@ class LStoreKeyedFastDoubleElement: public LTemplateInstruction<0, 3, 0> { ...@@ -1805,21 +1948,22 @@ class LStoreKeyedFastDoubleElement: public LTemplateInstruction<0, 3, 0> {
public: public:
LStoreKeyedFastDoubleElement(LOperand* elements, LStoreKeyedFastDoubleElement(LOperand* elements,
LOperand* key, LOperand* key,
LOperand* val) { LOperand* value) {
inputs_[0] = elements; inputs_[0] = elements;
inputs_[1] = key; inputs_[1] = key;
inputs_[2] = val; inputs_[2] = value;
} }
LOperand* elements() { return inputs_[0]; }
LOperand* key() { return inputs_[1]; }
LOperand* value() { return inputs_[2]; }
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastDoubleElement, DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastDoubleElement,
"store-keyed-fast-double-element") "store-keyed-fast-double-element")
DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastDoubleElement) DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastDoubleElement)
virtual void PrintDataTo(StringStream* stream); virtual void PrintDataTo(StringStream* stream);
LOperand* elements() { return inputs_[0]; }
LOperand* key() { return inputs_[1]; }
LOperand* value() { return inputs_[2]; }
uint32_t additional_index() const { return hydrogen()->index_offset(); } uint32_t additional_index() const { return hydrogen()->index_offset(); }
bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); } bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); }
...@@ -1828,20 +1972,21 @@ class LStoreKeyedFastDoubleElement: public LTemplateInstruction<0, 3, 0> { ...@@ -1828,20 +1972,21 @@ class LStoreKeyedFastDoubleElement: public LTemplateInstruction<0, 3, 0> {
class LStoreKeyedGeneric: public LTemplateInstruction<0, 3, 0> { class LStoreKeyedGeneric: public LTemplateInstruction<0, 3, 0> {
public: public:
LStoreKeyedGeneric(LOperand* obj, LOperand* key, LOperand* val) { LStoreKeyedGeneric(LOperand* obj, LOperand* key, LOperand* value) {
inputs_[0] = obj; inputs_[0] = obj;
inputs_[1] = key; inputs_[1] = key;
inputs_[2] = val; inputs_[2] = value;
} }
LOperand* object() { return inputs_[0]; }
LOperand* key() { return inputs_[1]; }
LOperand* value() { return inputs_[2]; }
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric)
virtual void PrintDataTo(StringStream* stream); virtual void PrintDataTo(StringStream* stream);
LOperand* object() { return inputs_[0]; }
LOperand* key() { return inputs_[1]; }
LOperand* value() { return inputs_[2]; }
StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); }
}; };
...@@ -1849,22 +1994,21 @@ class LStoreKeyedSpecializedArrayElement: public LTemplateInstruction<0, 3, 0> { ...@@ -1849,22 +1994,21 @@ class LStoreKeyedSpecializedArrayElement: public LTemplateInstruction<0, 3, 0> {
public: public:
LStoreKeyedSpecializedArrayElement(LOperand* external_pointer, LStoreKeyedSpecializedArrayElement(LOperand* external_pointer,
LOperand* key, LOperand* key,
LOperand* val) { LOperand* value) {
inputs_[0] = external_pointer; inputs_[0] = external_pointer;
inputs_[1] = key; inputs_[1] = key;
inputs_[2] = val; inputs_[2] = value;
} }
LOperand* external_pointer() { return inputs_[0]; }
LOperand* key() { return inputs_[1]; }
LOperand* value() { return inputs_[2]; }
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedSpecializedArrayElement, DECLARE_CONCRETE_INSTRUCTION(StoreKeyedSpecializedArrayElement,
"store-keyed-specialized-array-element") "store-keyed-specialized-array-element")
DECLARE_HYDROGEN_ACCESSOR(StoreKeyedSpecializedArrayElement) DECLARE_HYDROGEN_ACCESSOR(StoreKeyedSpecializedArrayElement)
LOperand* external_pointer() { return inputs_[0]; } ElementsKind elements_kind() const { return hydrogen()->elements_kind(); }
LOperand* key() { return inputs_[1]; }
LOperand* value() { return inputs_[2]; }
ElementsKind elements_kind() const {
return hydrogen()->elements_kind();
}
uint32_t additional_index() const { return hydrogen()->index_offset(); } uint32_t additional_index() const { return hydrogen()->index_offset(); }
}; };
...@@ -1873,21 +2017,22 @@ class LTransitionElementsKind: public LTemplateInstruction<1, 1, 2> { ...@@ -1873,21 +2017,22 @@ class LTransitionElementsKind: public LTemplateInstruction<1, 1, 2> {
public: public:
LTransitionElementsKind(LOperand* object, LTransitionElementsKind(LOperand* object,
LOperand* new_map_temp, LOperand* new_map_temp,
LOperand* temp_reg) { LOperand* temp) {
inputs_[0] = object; inputs_[0] = object;
temps_[0] = new_map_temp; temps_[0] = new_map_temp;
temps_[1] = temp_reg; temps_[1] = temp;
} }
LOperand* object() { return inputs_[0]; }
LOperand* new_map_temp() { return temps_[0]; }
LOperand* temp() { return temps_[1]; }
DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind, DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind,
"transition-elements-kind") "transition-elements-kind")
DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind) DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind)
virtual void PrintDataTo(StringStream* stream); virtual void PrintDataTo(StringStream* stream);
LOperand* object() { return inputs_[0]; }
LOperand* new_map_reg() { return temps_[0]; }
LOperand* temp_reg() { return temps_[1]; }
Handle<Map> original_map() { return hydrogen()->original_map(); } Handle<Map> original_map() { return hydrogen()->original_map(); }
Handle<Map> transitioned_map() { return hydrogen()->transitioned_map(); } Handle<Map> transitioned_map() { return hydrogen()->transitioned_map(); }
}; };
...@@ -1900,11 +2045,11 @@ class LStringAdd: public LTemplateInstruction<1, 2, 0> { ...@@ -1900,11 +2045,11 @@ class LStringAdd: public LTemplateInstruction<1, 2, 0> {
inputs_[1] = right; inputs_[1] = right;
} }
DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add")
DECLARE_HYDROGEN_ACCESSOR(StringAdd)
LOperand* left() { return inputs_[0]; } LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; } LOperand* right() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add")
DECLARE_HYDROGEN_ACCESSOR(StringAdd)
}; };
...@@ -1916,11 +2061,11 @@ class LStringCharCodeAt: public LTemplateInstruction<1, 2, 0> { ...@@ -1916,11 +2061,11 @@ class LStringCharCodeAt: public LTemplateInstruction<1, 2, 0> {
inputs_[1] = index; inputs_[1] = index;
} }
DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at")
DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt)
LOperand* string() { return inputs_[0]; } LOperand* string() { return inputs_[0]; }
LOperand* index() { return inputs_[1]; } LOperand* index() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at")
DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt)
}; };
...@@ -1930,10 +2075,10 @@ class LStringCharFromCode: public LTemplateInstruction<1, 1, 0> { ...@@ -1930,10 +2075,10 @@ class LStringCharFromCode: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = char_code; inputs_[0] = char_code;
} }
LOperand* char_code() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code") DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code")
DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode) DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode)
LOperand* char_code() { return inputs_[0]; }
}; };
...@@ -1943,10 +2088,10 @@ class LStringLength: public LTemplateInstruction<1, 1, 0> { ...@@ -1943,10 +2088,10 @@ class LStringLength: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = string; inputs_[0] = string;
} }
LOperand* string() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length") DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length")
DECLARE_HYDROGEN_ACCESSOR(StringLength) DECLARE_HYDROGEN_ACCESSOR(StringLength)
LOperand* string() { return inputs_[0]; }
}; };
...@@ -1956,7 +2101,7 @@ class LCheckFunction: public LTemplateInstruction<0, 1, 0> { ...@@ -1956,7 +2101,7 @@ class LCheckFunction: public LTemplateInstruction<0, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return InputAt(0); } LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function") DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function")
DECLARE_HYDROGEN_ACCESSOR(CheckFunction) DECLARE_HYDROGEN_ACCESSOR(CheckFunction)
...@@ -1969,6 +2114,8 @@ class LCheckInstanceType: public LTemplateInstruction<0, 1, 0> { ...@@ -1969,6 +2114,8 @@ class LCheckInstanceType: public LTemplateInstruction<0, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type") DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType) DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
}; };
...@@ -1980,6 +2127,8 @@ class LCheckMaps: public LTemplateInstruction<0, 1, 0> { ...@@ -1980,6 +2127,8 @@ class LCheckMaps: public LTemplateInstruction<0, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps") DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps")
DECLARE_HYDROGEN_ACCESSOR(CheckMaps) DECLARE_HYDROGEN_ACCESSOR(CheckMaps)
}; };
...@@ -1987,11 +2136,14 @@ class LCheckMaps: public LTemplateInstruction<0, 1, 0> { ...@@ -1987,11 +2136,14 @@ class LCheckMaps: public LTemplateInstruction<0, 1, 0> {
class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 2> { class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 2> {
public: public:
LCheckPrototypeMaps(LOperand* temp1, LOperand* temp2) { LCheckPrototypeMaps(LOperand* temp, LOperand* temp2) {
temps_[0] = temp1; temps_[0] = temp;
temps_[1] = temp2; temps_[1] = temp2;
} }
LOperand* temp() { return temps_[0]; }
LOperand* temp2() { return temps_[1]; }
DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps") DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps")
DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps) DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps)
...@@ -2006,6 +2158,8 @@ class LCheckSmi: public LTemplateInstruction<0, 1, 0> { ...@@ -2006,6 +2158,8 @@ class LCheckSmi: public LTemplateInstruction<0, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi") DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi")
}; };
...@@ -2016,18 +2170,21 @@ class LCheckNonSmi: public LTemplateInstruction<0, 1, 0> { ...@@ -2016,18 +2170,21 @@ class LCheckNonSmi: public LTemplateInstruction<0, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi") DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi")
}; };
class LClampDToUint8: public LTemplateInstruction<1, 1, 1> { class LClampDToUint8: public LTemplateInstruction<1, 1, 1> {
public: public:
LClampDToUint8(LOperand* value, LOperand* temp) { LClampDToUint8(LOperand* unclamped, LOperand* temp) {
inputs_[0] = value; inputs_[0] = unclamped;
temps_[0] = temp; temps_[0] = temp;
} }
LOperand* unclamped() { return inputs_[0]; } LOperand* unclamped() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8") DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8")
}; };
...@@ -2035,8 +2192,8 @@ class LClampDToUint8: public LTemplateInstruction<1, 1, 1> { ...@@ -2035,8 +2192,8 @@ class LClampDToUint8: public LTemplateInstruction<1, 1, 1> {
class LClampIToUint8: public LTemplateInstruction<1, 1, 0> { class LClampIToUint8: public LTemplateInstruction<1, 1, 0> {
public: public:
explicit LClampIToUint8(LOperand* value) { explicit LClampIToUint8(LOperand* unclamped) {
inputs_[0] = value; inputs_[0] = unclamped;
} }
LOperand* unclamped() { return inputs_[0]; } LOperand* unclamped() { return inputs_[0]; }
...@@ -2047,12 +2204,13 @@ class LClampIToUint8: public LTemplateInstruction<1, 1, 0> { ...@@ -2047,12 +2204,13 @@ class LClampIToUint8: public LTemplateInstruction<1, 1, 0> {
class LClampTToUint8: public LTemplateInstruction<1, 1, 1> { class LClampTToUint8: public LTemplateInstruction<1, 1, 1> {
public: public:
LClampTToUint8(LOperand* value, LOperand* temp) { LClampTToUint8(LOperand* unclamped, LOperand* temp) {
inputs_[0] = value; inputs_[0] = unclamped;
temps_[0] = temp; temps_[0] = temp;
} }
LOperand* unclamped() { return inputs_[0]; } LOperand* unclamped() { return inputs_[0]; }
LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8") DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8")
}; };
...@@ -2060,11 +2218,14 @@ class LClampTToUint8: public LTemplateInstruction<1, 1, 1> { ...@@ -2060,11 +2218,14 @@ class LClampTToUint8: public LTemplateInstruction<1, 1, 1> {
class LAllocateObject: public LTemplateInstruction<1, 0, 2> { class LAllocateObject: public LTemplateInstruction<1, 0, 2> {
public: public:
LAllocateObject(LOperand* temp1, LOperand* temp2) { LAllocateObject(LOperand* temp, LOperand* temp2) {
temps_[0] = temp1; temps_[0] = temp;
temps_[1] = temp2; temps_[1] = temp2;
} }
LOperand* temp() { return temps_[0]; }
LOperand* temp2() { return temps_[1]; }
DECLARE_CONCRETE_INSTRUCTION(AllocateObject, "allocate-object") DECLARE_CONCRETE_INSTRUCTION(AllocateObject, "allocate-object")
DECLARE_HYDROGEN_ACCESSOR(AllocateObject) DECLARE_HYDROGEN_ACCESSOR(AllocateObject)
}; };
...@@ -2113,6 +2274,8 @@ class LToFastProperties: public LTemplateInstruction<1, 1, 0> { ...@@ -2113,6 +2274,8 @@ class LToFastProperties: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties") DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties")
DECLARE_HYDROGEN_ACCESSOR(ToFastProperties) DECLARE_HYDROGEN_ACCESSOR(ToFastProperties)
}; };
...@@ -2124,6 +2287,8 @@ class LTypeof: public LTemplateInstruction<1, 1, 0> { ...@@ -2124,6 +2287,8 @@ class LTypeof: public LTemplateInstruction<1, 1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
}; };
...@@ -2134,6 +2299,8 @@ class LTypeofIsAndBranch: public LControlInstruction<1, 0> { ...@@ -2134,6 +2299,8 @@ class LTypeofIsAndBranch: public LControlInstruction<1, 0> {
inputs_[0] = value; inputs_[0] = value;
} }
LOperand* value() { return inputs_[0]; }
DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch")
DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch) DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch)
...@@ -2149,6 +2316,8 @@ class LIsConstructCallAndBranch: public LControlInstruction<0, 1> { ...@@ -2149,6 +2316,8 @@ class LIsConstructCallAndBranch: public LControlInstruction<0, 1> {
temps_[0] = temp; temps_[0] = temp;
} }
LOperand* temp() { return temps_[0]; }
DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch, DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch,
"is-construct-call-and-branch") "is-construct-call-and-branch")
}; };
...@@ -2156,15 +2325,15 @@ class LIsConstructCallAndBranch: public LControlInstruction<0, 1> { ...@@ -2156,15 +2325,15 @@ class LIsConstructCallAndBranch: public LControlInstruction<0, 1> {
class LDeleteProperty: public LTemplateInstruction<1, 2, 0> { class LDeleteProperty: public LTemplateInstruction<1, 2, 0> {
public: public:
LDeleteProperty(LOperand* obj, LOperand* key) { LDeleteProperty(LOperand* object, LOperand* key) {
inputs_[0] = obj; inputs_[0] = object;
inputs_[1] = key; inputs_[1] = key;
} }
DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property")
LOperand* object() { return inputs_[0]; } LOperand* object() { return inputs_[0]; }
LOperand* key() { return inputs_[1]; } LOperand* key() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property")
}; };
......
...@@ -951,7 +951,7 @@ void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { ...@@ -951,7 +951,7 @@ void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) {
void LCodeGen::DoModI(LModI* instr) { void LCodeGen::DoModI(LModI* instr) {
if (instr->hydrogen()->HasPowerOf2Divisor()) { if (instr->hydrogen()->HasPowerOf2Divisor()) {
Register dividend = ToRegister(instr->InputAt(0)); Register dividend = ToRegister(instr->left());
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
int32_t divisor = int32_t divisor =
...@@ -976,14 +976,14 @@ void LCodeGen::DoModI(LModI* instr) { ...@@ -976,14 +976,14 @@ void LCodeGen::DoModI(LModI* instr) {
} }
// These registers hold untagged 32 bit values. // These registers hold untagged 32 bit values.
Register left = ToRegister(instr->InputAt(0)); Register left = ToRegister(instr->left());
Register right = ToRegister(instr->InputAt(1)); Register right = ToRegister(instr->right());
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
Register scratch = scratch0(); Register scratch = scratch0();
Register scratch2 = ToRegister(instr->TempAt(0)); Register scratch2 = ToRegister(instr->temp());
DwVfpRegister dividend = ToDoubleRegister(instr->TempAt(1)); DwVfpRegister dividend = ToDoubleRegister(instr->temp2());
DwVfpRegister divisor = ToDoubleRegister(instr->TempAt(2)); DwVfpRegister divisor = ToDoubleRegister(instr->temp3());
DwVfpRegister quotient = double_scratch0(); DwVfpRegister quotient = double_scratch0();
ASSERT(!dividend.is(divisor)); ASSERT(!dividend.is(divisor));
...@@ -1186,15 +1186,18 @@ void LCodeGen::DoDivI(LDivI* instr) { ...@@ -1186,15 +1186,18 @@ void LCodeGen::DoDivI(LDivI* instr) {
DeferredDivI(LCodeGen* codegen, LDivI* instr) DeferredDivI(LCodeGen* codegen, LDivI* instr)
: LDeferredCode(codegen), instr_(instr) { } : LDeferredCode(codegen), instr_(instr) { }
virtual void Generate() { virtual void Generate() {
codegen()->DoDeferredBinaryOpStub(instr_, Token::DIV); codegen()->DoDeferredBinaryOpStub(instr_->pointer_map(),
instr_->left(),
instr_->right(),
Token::DIV);
} }
virtual LInstruction* instr() { return instr_; } virtual LInstruction* instr() { return instr_; }
private: private:
LDivI* instr_; LDivI* instr_;
}; };
const Register left = ToRegister(instr->InputAt(0)); const Register left = ToRegister(instr->left());
const Register right = ToRegister(instr->InputAt(1)); const Register right = ToRegister(instr->right());
const Register scratch = scratch0(); const Register scratch = scratch0();
const Register result = ToRegister(instr->result()); const Register result = ToRegister(instr->result());
...@@ -1263,15 +1266,15 @@ void LCodeGen::DoDivI(LDivI* instr) { ...@@ -1263,15 +1266,15 @@ void LCodeGen::DoDivI(LDivI* instr) {
void LCodeGen::DoMathFloorOfDiv(LMathFloorOfDiv* instr) { void LCodeGen::DoMathFloorOfDiv(LMathFloorOfDiv* instr) {
const Register result = ToRegister(instr->result()); const Register result = ToRegister(instr->result());
const Register left = ToRegister(instr->InputAt(0)); const Register left = ToRegister(instr->left());
const Register remainder = ToRegister(instr->TempAt(0)); const Register remainder = ToRegister(instr->temp());
const Register scratch = scratch0(); const Register scratch = scratch0();
// We only optimize this for division by constants, because the standard // We only optimize this for division by constants, because the standard
// integer division routine is usually slower than transitionning to VFP. // integer division routine is usually slower than transitionning to VFP.
// This could be optimized on processors with SDIV available. // This could be optimized on processors with SDIV available.
ASSERT(instr->InputAt(1)->IsConstantOperand()); ASSERT(instr->right()->IsConstantOperand());
int32_t divisor = ToInteger32(LConstantOperand::cast(instr->InputAt(1))); int32_t divisor = ToInteger32(LConstantOperand::cast(instr->right()));
if (divisor < 0) { if (divisor < 0) {
__ cmp(left, Operand(0)); __ cmp(left, Operand(0));
DeoptimizeIf(eq, instr->environment()); DeoptimizeIf(eq, instr->environment());
...@@ -1289,11 +1292,12 @@ void LCodeGen::DoMathFloorOfDiv(LMathFloorOfDiv* instr) { ...@@ -1289,11 +1292,12 @@ void LCodeGen::DoMathFloorOfDiv(LMathFloorOfDiv* instr) {
} }
template<int T> void LCodeGen::DoDeferredBinaryOpStub(LPointerMap* pointer_map,
void LCodeGen::DoDeferredBinaryOpStub(LTemplateInstruction<1, 2, T>* instr, LOperand* left_argument,
LOperand* right_argument,
Token::Value op) { Token::Value op) {
Register left = ToRegister(instr->InputAt(0)); Register left = ToRegister(left_argument);
Register right = ToRegister(instr->InputAt(1)); Register right = ToRegister(right_argument);
PushSafepointRegistersScope scope(this, Safepoint::kWithRegistersAndDoubles); PushSafepointRegistersScope scope(this, Safepoint::kWithRegistersAndDoubles);
// Move left to r1 and right to r0 for the stub call. // Move left to r1 and right to r0 for the stub call.
...@@ -1312,7 +1316,7 @@ void LCodeGen::DoDeferredBinaryOpStub(LTemplateInstruction<1, 2, T>* instr, ...@@ -1312,7 +1316,7 @@ void LCodeGen::DoDeferredBinaryOpStub(LTemplateInstruction<1, 2, T>* instr,
} }
BinaryOpStub stub(op, OVERWRITE_LEFT); BinaryOpStub stub(op, OVERWRITE_LEFT);
__ CallStub(&stub); __ CallStub(&stub);
RecordSafepointWithRegistersAndDoubles(instr->pointer_map(), RecordSafepointWithRegistersAndDoubles(pointer_map,
0, 0,
Safepoint::kNoLazyDeopt); Safepoint::kNoLazyDeopt);
// Overwrite the stored value of r0 with the result of the stub. // Overwrite the stored value of r0 with the result of the stub.
...@@ -1324,8 +1328,8 @@ void LCodeGen::DoMulI(LMulI* instr) { ...@@ -1324,8 +1328,8 @@ void LCodeGen::DoMulI(LMulI* instr) {
Register scratch = scratch0(); Register scratch = scratch0();
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
// Note that result may alias left. // Note that result may alias left.
Register left = ToRegister(instr->InputAt(0)); Register left = ToRegister(instr->left());
LOperand* right_op = instr->InputAt(1); LOperand* right_op = instr->right();
bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow);
bool bailout_on_minus_zero = bool bailout_on_minus_zero =
...@@ -1392,7 +1396,7 @@ void LCodeGen::DoMulI(LMulI* instr) { ...@@ -1392,7 +1396,7 @@ void LCodeGen::DoMulI(LMulI* instr) {
} else { } else {
Register right = EmitLoadRegister(right_op, scratch); Register right = EmitLoadRegister(right_op, scratch);
if (bailout_on_minus_zero) { if (bailout_on_minus_zero) {
__ orr(ToRegister(instr->TempAt(0)), left, right); __ orr(ToRegister(instr->temp()), left, right);
} }
if (can_overflow) { if (can_overflow) {
...@@ -1409,7 +1413,7 @@ void LCodeGen::DoMulI(LMulI* instr) { ...@@ -1409,7 +1413,7 @@ void LCodeGen::DoMulI(LMulI* instr) {
Label done; Label done;
__ cmp(result, Operand(0)); __ cmp(result, Operand(0));
__ b(ne, &done); __ b(ne, &done);
__ cmp(ToRegister(instr->TempAt(0)), Operand(0)); __ cmp(ToRegister(instr->temp()), Operand(0));
DeoptimizeIf(mi, instr->environment()); DeoptimizeIf(mi, instr->environment());
__ bind(&done); __ bind(&done);
} }
...@@ -1418,8 +1422,8 @@ void LCodeGen::DoMulI(LMulI* instr) { ...@@ -1418,8 +1422,8 @@ void LCodeGen::DoMulI(LMulI* instr) {
void LCodeGen::DoBitI(LBitI* instr) { void LCodeGen::DoBitI(LBitI* instr) {
LOperand* left_op = instr->InputAt(0); LOperand* left_op = instr->left();
LOperand* right_op = instr->InputAt(1); LOperand* right_op = instr->right();
ASSERT(left_op->IsRegister()); ASSERT(left_op->IsRegister());
Register left = ToRegister(left_op); Register left = ToRegister(left_op);
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
...@@ -1452,8 +1456,8 @@ void LCodeGen::DoBitI(LBitI* instr) { ...@@ -1452,8 +1456,8 @@ void LCodeGen::DoBitI(LBitI* instr) {
void LCodeGen::DoShiftI(LShiftI* instr) { void LCodeGen::DoShiftI(LShiftI* instr) {
// Both 'left' and 'right' are "used at start" (see LCodeGen::DoShift), so // Both 'left' and 'right' are "used at start" (see LCodeGen::DoShift), so
// result may alias either of them. // result may alias either of them.
LOperand* right_op = instr->InputAt(1); LOperand* right_op = instr->right();
Register left = ToRegister(instr->InputAt(0)); Register left = ToRegister(instr->left());
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
Register scratch = scratch0(); Register scratch = scratch0();
if (right_op->IsRegister()) { if (right_op->IsRegister()) {
...@@ -1517,8 +1521,8 @@ void LCodeGen::DoShiftI(LShiftI* instr) { ...@@ -1517,8 +1521,8 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
void LCodeGen::DoSubI(LSubI* instr) { void LCodeGen::DoSubI(LSubI* instr) {
LOperand* left = instr->InputAt(0); LOperand* left = instr->left();
LOperand* right = instr->InputAt(1); LOperand* right = instr->right();
LOperand* result = instr->result(); LOperand* result = instr->result();
bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow);
SBit set_cond = can_overflow ? SetCC : LeaveCC; SBit set_cond = can_overflow ? SetCC : LeaveCC;
...@@ -1564,28 +1568,28 @@ void LCodeGen::DoConstantT(LConstantT* instr) { ...@@ -1564,28 +1568,28 @@ void LCodeGen::DoConstantT(LConstantT* instr) {
void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) {
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
Register array = ToRegister(instr->InputAt(0)); Register array = ToRegister(instr->value());
__ ldr(result, FieldMemOperand(array, JSArray::kLengthOffset)); __ ldr(result, FieldMemOperand(array, JSArray::kLengthOffset));
} }
void LCodeGen::DoFixedArrayBaseLength(LFixedArrayBaseLength* instr) { void LCodeGen::DoFixedArrayBaseLength(LFixedArrayBaseLength* instr) {
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
Register array = ToRegister(instr->InputAt(0)); Register array = ToRegister(instr->value());
__ ldr(result, FieldMemOperand(array, FixedArrayBase::kLengthOffset)); __ ldr(result, FieldMemOperand(array, FixedArrayBase::kLengthOffset));
} }
void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) {
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
Register map = ToRegister(instr->InputAt(0)); Register map = ToRegister(instr->value());
__ EnumLength(result, map); __ EnumLength(result, map);
} }
void LCodeGen::DoElementsKind(LElementsKind* instr) { void LCodeGen::DoElementsKind(LElementsKind* instr) {
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
Register input = ToRegister(instr->InputAt(0)); Register input = ToRegister(instr->value());
// Load map into |result|. // Load map into |result|.
__ ldr(result, FieldMemOperand(input, HeapObject::kMapOffset)); __ ldr(result, FieldMemOperand(input, HeapObject::kMapOffset));
...@@ -1598,9 +1602,9 @@ void LCodeGen::DoElementsKind(LElementsKind* instr) { ...@@ -1598,9 +1602,9 @@ void LCodeGen::DoElementsKind(LElementsKind* instr) {
void LCodeGen::DoValueOf(LValueOf* instr) { void LCodeGen::DoValueOf(LValueOf* instr) {
Register input = ToRegister(instr->InputAt(0)); Register input = ToRegister(instr->value());
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
Register map = ToRegister(instr->TempAt(0)); Register map = ToRegister(instr->temp());
Label done; Label done;
// If the object is a smi return the object. // If the object is a smi return the object.
...@@ -1619,9 +1623,9 @@ void LCodeGen::DoValueOf(LValueOf* instr) { ...@@ -1619,9 +1623,9 @@ void LCodeGen::DoValueOf(LValueOf* instr) {
void LCodeGen::DoDateField(LDateField* instr) { void LCodeGen::DoDateField(LDateField* instr) {
Register object = ToRegister(instr->InputAt(0)); Register object = ToRegister(instr->date());
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
Register scratch = ToRegister(instr->TempAt(0)); Register scratch = ToRegister(instr->temp());
Smi* index = instr->index(); Smi* index = instr->index();
Label runtime, done; Label runtime, done;
ASSERT(object.is(result)); ASSERT(object.is(result));
...@@ -1658,14 +1662,14 @@ void LCodeGen::DoDateField(LDateField* instr) { ...@@ -1658,14 +1662,14 @@ void LCodeGen::DoDateField(LDateField* instr) {
void LCodeGen::DoBitNotI(LBitNotI* instr) { void LCodeGen::DoBitNotI(LBitNotI* instr) {
Register input = ToRegister(instr->InputAt(0)); Register input = ToRegister(instr->value());
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
__ mvn(result, Operand(input)); __ mvn(result, Operand(input));
} }
void LCodeGen::DoThrow(LThrow* instr) { void LCodeGen::DoThrow(LThrow* instr) {
Register input_reg = EmitLoadRegister(instr->InputAt(0), ip); Register input_reg = EmitLoadRegister(instr->value(), ip);
__ push(input_reg); __ push(input_reg);
CallRuntime(Runtime::kThrow, 1, instr); CallRuntime(Runtime::kThrow, 1, instr);
...@@ -1676,8 +1680,8 @@ void LCodeGen::DoThrow(LThrow* instr) { ...@@ -1676,8 +1680,8 @@ void LCodeGen::DoThrow(LThrow* instr) {
void LCodeGen::DoAddI(LAddI* instr) { void LCodeGen::DoAddI(LAddI* instr) {
LOperand* left = instr->InputAt(0); LOperand* left = instr->left();
LOperand* right = instr->InputAt(1); LOperand* right = instr->right();
LOperand* result = instr->result(); LOperand* result = instr->result();
bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow);
SBit set_cond = can_overflow ? SetCC : LeaveCC; SBit set_cond = can_overflow ? SetCC : LeaveCC;
...@@ -1697,8 +1701,8 @@ void LCodeGen::DoAddI(LAddI* instr) { ...@@ -1697,8 +1701,8 @@ void LCodeGen::DoAddI(LAddI* instr) {
void LCodeGen::DoMathMinMax(LMathMinMax* instr) { void LCodeGen::DoMathMinMax(LMathMinMax* instr) {
LOperand* left = instr->InputAt(0); LOperand* left = instr->left();
LOperand* right = instr->InputAt(1); LOperand* right = instr->right();
HMathMinMax::Operation operation = instr->hydrogen()->operation(); HMathMinMax::Operation operation = instr->hydrogen()->operation();
Condition condition = (operation == HMathMinMax::kMathMin) ? le : ge; Condition condition = (operation == HMathMinMax::kMathMin) ? le : ge;
if (instr->hydrogen()->representation().IsInteger32()) { if (instr->hydrogen()->representation().IsInteger32()) {
...@@ -1759,8 +1763,8 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) { ...@@ -1759,8 +1763,8 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) {
void LCodeGen::DoArithmeticD(LArithmeticD* instr) { void LCodeGen::DoArithmeticD(LArithmeticD* instr) {
DoubleRegister left = ToDoubleRegister(instr->InputAt(0)); DoubleRegister left = ToDoubleRegister(instr->left());
DoubleRegister right = ToDoubleRegister(instr->InputAt(1)); DoubleRegister right = ToDoubleRegister(instr->right());
DoubleRegister result = ToDoubleRegister(instr->result()); DoubleRegister result = ToDoubleRegister(instr->result());
switch (instr->op()) { switch (instr->op()) {
case Token::ADD: case Token::ADD:
...@@ -1799,8 +1803,8 @@ void LCodeGen::DoArithmeticD(LArithmeticD* instr) { ...@@ -1799,8 +1803,8 @@ void LCodeGen::DoArithmeticD(LArithmeticD* instr) {
void LCodeGen::DoArithmeticT(LArithmeticT* instr) { void LCodeGen::DoArithmeticT(LArithmeticT* instr) {
ASSERT(ToRegister(instr->InputAt(0)).is(r1)); ASSERT(ToRegister(instr->left()).is(r1));
ASSERT(ToRegister(instr->InputAt(1)).is(r0)); ASSERT(ToRegister(instr->right()).is(r0));
ASSERT(ToRegister(instr->result()).is(r0)); ASSERT(ToRegister(instr->result()).is(r0));
BinaryOpStub stub(instr->op(), NO_OVERWRITE); BinaryOpStub stub(instr->op(), NO_OVERWRITE);
...@@ -1845,11 +1849,11 @@ void LCodeGen::DoBranch(LBranch* instr) { ...@@ -1845,11 +1849,11 @@ void LCodeGen::DoBranch(LBranch* instr) {
Representation r = instr->hydrogen()->value()->representation(); Representation r = instr->hydrogen()->value()->representation();
if (r.IsInteger32()) { if (r.IsInteger32()) {
Register reg = ToRegister(instr->InputAt(0)); Register reg = ToRegister(instr->value());
__ cmp(reg, Operand(0)); __ cmp(reg, Operand(0));
EmitBranch(true_block, false_block, ne); EmitBranch(true_block, false_block, ne);
} else if (r.IsDouble()) { } else if (r.IsDouble()) {
DoubleRegister reg = ToDoubleRegister(instr->InputAt(0)); DoubleRegister reg = ToDoubleRegister(instr->value());
Register scratch = scratch0(); Register scratch = scratch0();
// Test the double value. Zero and NaN are false. // Test the double value. Zero and NaN are false.
...@@ -1858,7 +1862,7 @@ void LCodeGen::DoBranch(LBranch* instr) { ...@@ -1858,7 +1862,7 @@ void LCodeGen::DoBranch(LBranch* instr) {
EmitBranch(true_block, false_block, eq); EmitBranch(true_block, false_block, eq);
} else { } else {
ASSERT(r.IsTagged()); ASSERT(r.IsTagged());
Register reg = ToRegister(instr->InputAt(0)); Register reg = ToRegister(instr->value());
HType type = instr->hydrogen()->value()->type(); HType type = instr->hydrogen()->value()->type();
if (type.IsBoolean()) { if (type.IsBoolean()) {
__ CompareRoot(reg, Heap::kTrueValueRootIndex); __ CompareRoot(reg, Heap::kTrueValueRootIndex);
...@@ -1997,8 +2001,8 @@ Condition LCodeGen::TokenToCondition(Token::Value op, bool is_unsigned) { ...@@ -1997,8 +2001,8 @@ Condition LCodeGen::TokenToCondition(Token::Value op, bool is_unsigned) {
void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) { void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) {
LOperand* left = instr->InputAt(0); LOperand* left = instr->left();
LOperand* right = instr->InputAt(1); LOperand* right = instr->right();
int false_block = chunk_->LookupDestination(instr->false_block_id()); int false_block = chunk_->LookupDestination(instr->false_block_id());
int true_block = chunk_->LookupDestination(instr->true_block_id()); int true_block = chunk_->LookupDestination(instr->true_block_id());
Condition cond = TokenToCondition(instr->op(), false); Condition cond = TokenToCondition(instr->op(), false);
...@@ -2038,8 +2042,8 @@ void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) { ...@@ -2038,8 +2042,8 @@ void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) {
void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) { void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) {
Register left = ToRegister(instr->InputAt(0)); Register left = ToRegister(instr->left());
Register right = ToRegister(instr->InputAt(1)); Register right = ToRegister(instr->right());
int false_block = chunk_->LookupDestination(instr->false_block_id()); int false_block = chunk_->LookupDestination(instr->false_block_id());
int true_block = chunk_->LookupDestination(instr->true_block_id()); int true_block = chunk_->LookupDestination(instr->true_block_id());
...@@ -2049,7 +2053,7 @@ void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) { ...@@ -2049,7 +2053,7 @@ void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) {
void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) { void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) {
Register left = ToRegister(instr->InputAt(0)); Register left = ToRegister(instr->left());
int true_block = chunk_->LookupDestination(instr->true_block_id()); int true_block = chunk_->LookupDestination(instr->true_block_id());
int false_block = chunk_->LookupDestination(instr->false_block_id()); int false_block = chunk_->LookupDestination(instr->false_block_id());
...@@ -2060,7 +2064,7 @@ void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) { ...@@ -2060,7 +2064,7 @@ void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) {
void LCodeGen::DoIsNilAndBranch(LIsNilAndBranch* instr) { void LCodeGen::DoIsNilAndBranch(LIsNilAndBranch* instr) {
Register scratch = scratch0(); Register scratch = scratch0();
Register reg = ToRegister(instr->InputAt(0)); Register reg = ToRegister(instr->value());
int false_block = chunk_->LookupDestination(instr->false_block_id()); int false_block = chunk_->LookupDestination(instr->false_block_id());
// If the expression is known to be untagged or a smi, then it's definitely // If the expression is known to be untagged or a smi, then it's definitely
...@@ -2128,8 +2132,8 @@ Condition LCodeGen::EmitIsObject(Register input, ...@@ -2128,8 +2132,8 @@ Condition LCodeGen::EmitIsObject(Register input,
void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) { void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) {
Register reg = ToRegister(instr->InputAt(0)); Register reg = ToRegister(instr->value());
Register temp1 = ToRegister(instr->TempAt(0)); Register temp1 = ToRegister(instr->temp());
int true_block = chunk_->LookupDestination(instr->true_block_id()); int true_block = chunk_->LookupDestination(instr->true_block_id());
int false_block = chunk_->LookupDestination(instr->false_block_id()); int false_block = chunk_->LookupDestination(instr->false_block_id());
...@@ -2154,8 +2158,8 @@ Condition LCodeGen::EmitIsString(Register input, ...@@ -2154,8 +2158,8 @@ Condition LCodeGen::EmitIsString(Register input,
void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) { void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) {
Register reg = ToRegister(instr->InputAt(0)); Register reg = ToRegister(instr->value());
Register temp1 = ToRegister(instr->TempAt(0)); Register temp1 = ToRegister(instr->temp());
int true_block = chunk_->LookupDestination(instr->true_block_id()); int true_block = chunk_->LookupDestination(instr->true_block_id());
int false_block = chunk_->LookupDestination(instr->false_block_id()); int false_block = chunk_->LookupDestination(instr->false_block_id());
...@@ -2172,15 +2176,15 @@ void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { ...@@ -2172,15 +2176,15 @@ void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) {
int true_block = chunk_->LookupDestination(instr->true_block_id()); int true_block = chunk_->LookupDestination(instr->true_block_id());
int false_block = chunk_->LookupDestination(instr->false_block_id()); int false_block = chunk_->LookupDestination(instr->false_block_id());
Register input_reg = EmitLoadRegister(instr->InputAt(0), ip); Register input_reg = EmitLoadRegister(instr->value(), ip);
__ tst(input_reg, Operand(kSmiTagMask)); __ tst(input_reg, Operand(kSmiTagMask));
EmitBranch(true_block, false_block, eq); EmitBranch(true_block, false_block, eq);
} }
void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) { void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) {
Register input = ToRegister(instr->InputAt(0)); Register input = ToRegister(instr->value());
Register temp = ToRegister(instr->TempAt(0)); Register temp = ToRegister(instr->temp());
int true_block = chunk_->LookupDestination(instr->true_block_id()); int true_block = chunk_->LookupDestination(instr->true_block_id());
int false_block = chunk_->LookupDestination(instr->false_block_id()); int false_block = chunk_->LookupDestination(instr->false_block_id());
...@@ -2250,7 +2254,7 @@ static Condition BranchCondition(HHasInstanceTypeAndBranch* instr) { ...@@ -2250,7 +2254,7 @@ static Condition BranchCondition(HHasInstanceTypeAndBranch* instr) {
void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) {
Register scratch = scratch0(); Register scratch = scratch0();
Register input = ToRegister(instr->InputAt(0)); Register input = ToRegister(instr->value());
int true_block = chunk_->LookupDestination(instr->true_block_id()); int true_block = chunk_->LookupDestination(instr->true_block_id());
int false_block = chunk_->LookupDestination(instr->false_block_id()); int false_block = chunk_->LookupDestination(instr->false_block_id());
...@@ -2265,7 +2269,7 @@ void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { ...@@ -2265,7 +2269,7 @@ void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) {
void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
Register input = ToRegister(instr->InputAt(0)); Register input = ToRegister(instr->value());
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
__ AbortIfNotString(input); __ AbortIfNotString(input);
...@@ -2277,7 +2281,7 @@ void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { ...@@ -2277,7 +2281,7 @@ void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
void LCodeGen::DoHasCachedArrayIndexAndBranch( void LCodeGen::DoHasCachedArrayIndexAndBranch(
LHasCachedArrayIndexAndBranch* instr) { LHasCachedArrayIndexAndBranch* instr) {
Register input = ToRegister(instr->InputAt(0)); Register input = ToRegister(instr->value());
Register scratch = scratch0(); Register scratch = scratch0();
int true_block = chunk_->LookupDestination(instr->true_block_id()); int true_block = chunk_->LookupDestination(instr->true_block_id());
...@@ -2358,9 +2362,9 @@ void LCodeGen::EmitClassOfTest(Label* is_true, ...@@ -2358,9 +2362,9 @@ void LCodeGen::EmitClassOfTest(Label* is_true,
void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) { void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) {
Register input = ToRegister(instr->InputAt(0)); Register input = ToRegister(instr->value());
Register temp = scratch0(); Register temp = scratch0();
Register temp2 = ToRegister(instr->TempAt(0)); Register temp2 = ToRegister(instr->temp());
Handle<String> class_name = instr->hydrogen()->class_name(); Handle<String> class_name = instr->hydrogen()->class_name();
int true_block = chunk_->LookupDestination(instr->true_block_id()); int true_block = chunk_->LookupDestination(instr->true_block_id());
...@@ -2376,8 +2380,8 @@ void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) { ...@@ -2376,8 +2380,8 @@ void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) {
void LCodeGen::DoCmpMapAndBranch(LCmpMapAndBranch* instr) { void LCodeGen::DoCmpMapAndBranch(LCmpMapAndBranch* instr) {
Register reg = ToRegister(instr->InputAt(0)); Register reg = ToRegister(instr->value());
Register temp = ToRegister(instr->TempAt(0)); Register temp = ToRegister(instr->temp());
int true_block = instr->true_block_id(); int true_block = instr->true_block_id();
int false_block = instr->false_block_id(); int false_block = instr->false_block_id();
...@@ -2388,8 +2392,8 @@ void LCodeGen::DoCmpMapAndBranch(LCmpMapAndBranch* instr) { ...@@ -2388,8 +2392,8 @@ void LCodeGen::DoCmpMapAndBranch(LCmpMapAndBranch* instr) {
void LCodeGen::DoInstanceOf(LInstanceOf* instr) { void LCodeGen::DoInstanceOf(LInstanceOf* instr) {
ASSERT(ToRegister(instr->InputAt(0)).is(r0)); // Object is in r0. ASSERT(ToRegister(instr->left()).is(r0)); // Object is in r0.
ASSERT(ToRegister(instr->InputAt(1)).is(r1)); // Function is in r1. ASSERT(ToRegister(instr->right()).is(r1)); // Function is in r1.
InstanceofStub stub(InstanceofStub::kArgsInRegisters); InstanceofStub stub(InstanceofStub::kArgsInRegisters);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
...@@ -2420,8 +2424,8 @@ void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { ...@@ -2420,8 +2424,8 @@ void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) {
deferred = new(zone()) DeferredInstanceOfKnownGlobal(this, instr); deferred = new(zone()) DeferredInstanceOfKnownGlobal(this, instr);
Label done, false_result; Label done, false_result;
Register object = ToRegister(instr->InputAt(0)); Register object = ToRegister(instr->value());
Register temp = ToRegister(instr->TempAt(0)); Register temp = ToRegister(instr->temp());
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
ASSERT(object.is(r0)); ASSERT(object.is(r0));
...@@ -2501,7 +2505,7 @@ void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, ...@@ -2501,7 +2505,7 @@ void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
// Get the temp register reserved by the instruction. This needs to be r4 as // Get the temp register reserved by the instruction. This needs to be r4 as
// its slot of the pushing of safepoint registers is used to communicate the // its slot of the pushing of safepoint registers is used to communicate the
// offset to the location of the map check. // offset to the location of the map check.
Register temp = ToRegister(instr->TempAt(0)); Register temp = ToRegister(instr->temp());
ASSERT(temp.is(r4)); ASSERT(temp.is(r4));
__ LoadHeapObject(InstanceofStub::right(), instr->function()); __ LoadHeapObject(InstanceofStub::right(), instr->function());
static const int kAdditionalDelta = 5; static const int kAdditionalDelta = 5;
...@@ -2598,7 +2602,7 @@ void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { ...@@ -2598,7 +2602,7 @@ void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
// it as no longer deleted. // it as no longer deleted.
if (instr->hydrogen()->RequiresHoleCheck()) { if (instr->hydrogen()->RequiresHoleCheck()) {
// We use a temp to check the payload (CompareRoot might clobber ip). // We use a temp to check the payload (CompareRoot might clobber ip).
Register payload = ToRegister(instr->TempAt(0)); Register payload = ToRegister(instr->temp());
__ ldr(payload, FieldMemOperand(cell, JSGlobalPropertyCell::kValueOffset)); __ ldr(payload, FieldMemOperand(cell, JSGlobalPropertyCell::kValueOffset));
__ CompareRoot(payload, Heap::kTheHoleValueRootIndex); __ CompareRoot(payload, Heap::kTheHoleValueRootIndex);
DeoptimizeIf(eq, instr->environment()); DeoptimizeIf(eq, instr->environment());
...@@ -2677,7 +2681,7 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { ...@@ -2677,7 +2681,7 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
Register object = ToRegister(instr->InputAt(0)); Register object = ToRegister(instr->object());
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
if (instr->hydrogen()->is_in_object()) { if (instr->hydrogen()->is_in_object()) {
__ ldr(result, FieldMemOperand(object, instr->hydrogen()->offset())); __ ldr(result, FieldMemOperand(object, instr->hydrogen()->offset()));
...@@ -2831,7 +2835,7 @@ void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { ...@@ -2831,7 +2835,7 @@ void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
void LCodeGen::DoLoadElements(LLoadElements* instr) { void LCodeGen::DoLoadElements(LLoadElements* instr) {
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
Register input = ToRegister(instr->InputAt(0)); Register input = ToRegister(instr->object());
Register scratch = scratch0(); Register scratch = scratch0();
__ ldr(result, FieldMemOperand(input, JSObject::kElementsOffset)); __ ldr(result, FieldMemOperand(input, JSObject::kElementsOffset));
...@@ -2866,7 +2870,7 @@ void LCodeGen::DoLoadElements(LLoadElements* instr) { ...@@ -2866,7 +2870,7 @@ void LCodeGen::DoLoadElements(LLoadElements* instr) {
void LCodeGen::DoLoadExternalArrayPointer( void LCodeGen::DoLoadExternalArrayPointer(
LLoadExternalArrayPointer* instr) { LLoadExternalArrayPointer* instr) {
Register to_reg = ToRegister(instr->result()); Register to_reg = ToRegister(instr->result());
Register from_reg = ToRegister(instr->InputAt(0)); Register from_reg = ToRegister(instr->object());
__ ldr(to_reg, FieldMemOperand(from_reg, __ ldr(to_reg, FieldMemOperand(from_reg,
ExternalArray::kExternalPointerOffset)); ExternalArray::kExternalPointerOffset));
} }
...@@ -3123,7 +3127,7 @@ void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { ...@@ -3123,7 +3127,7 @@ void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) {
Register elem = ToRegister(instr->InputAt(0)); Register elem = ToRegister(instr->elements());
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
Label done; Label done;
...@@ -3242,7 +3246,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) { ...@@ -3242,7 +3246,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
void LCodeGen::DoPushArgument(LPushArgument* instr) { void LCodeGen::DoPushArgument(LPushArgument* instr) {
LOperand* argument = instr->InputAt(0); LOperand* argument = instr->value();
if (argument->IsDoubleRegister() || argument->IsDoubleStackSlot()) { if (argument->IsDoubleRegister() || argument->IsDoubleStackSlot()) {
Abort("DoPushArgument not implemented for double type."); Abort("DoPushArgument not implemented for double type.");
} else { } else {
...@@ -3294,7 +3298,7 @@ void LCodeGen::DoGlobalObject(LGlobalObject* instr) { ...@@ -3294,7 +3298,7 @@ void LCodeGen::DoGlobalObject(LGlobalObject* instr) {
void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) { void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) {
Register global = ToRegister(instr->global()); Register global = ToRegister(instr->global_object());
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
__ ldr(result, FieldMemOperand(global, GlobalObject::kGlobalReceiverOffset)); __ ldr(result, FieldMemOperand(global, GlobalObject::kGlobalReceiverOffset));
} }
...@@ -3354,7 +3358,7 @@ void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) { ...@@ -3354,7 +3358,7 @@ void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) {
void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) { void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) {
Register input = ToRegister(instr->InputAt(0)); Register input = ToRegister(instr->value());
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
Register scratch = scratch0(); Register scratch = scratch0();
...@@ -3420,7 +3424,7 @@ void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) { ...@@ -3420,7 +3424,7 @@ void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) {
void LCodeGen::EmitIntegerMathAbs(LUnaryMathOperation* instr) { void LCodeGen::EmitIntegerMathAbs(LUnaryMathOperation* instr) {
Register input = ToRegister(instr->InputAt(0)); Register input = ToRegister(instr->value());
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
__ cmp(input, Operand(0)); __ cmp(input, Operand(0));
__ Move(result, input, pl); __ Move(result, input, pl);
...@@ -3450,7 +3454,7 @@ void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) { ...@@ -3450,7 +3454,7 @@ void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) {
Representation r = instr->hydrogen()->value()->representation(); Representation r = instr->hydrogen()->value()->representation();
if (r.IsDouble()) { if (r.IsDouble()) {
DwVfpRegister input = ToDoubleRegister(instr->InputAt(0)); DwVfpRegister input = ToDoubleRegister(instr->value());
DwVfpRegister result = ToDoubleRegister(instr->result()); DwVfpRegister result = ToDoubleRegister(instr->result());
__ vabs(result, input); __ vabs(result, input);
} else if (r.IsInteger32()) { } else if (r.IsInteger32()) {
...@@ -3459,7 +3463,7 @@ void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) { ...@@ -3459,7 +3463,7 @@ void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) {
// Representation is tagged. // Representation is tagged.
DeferredMathAbsTaggedHeapNumber* deferred = DeferredMathAbsTaggedHeapNumber* deferred =
new(zone()) DeferredMathAbsTaggedHeapNumber(this, instr); new(zone()) DeferredMathAbsTaggedHeapNumber(this, instr);
Register input = ToRegister(instr->InputAt(0)); Register input = ToRegister(instr->value());
// Smi check. // Smi check.
__ JumpIfNotSmi(input, deferred->entry()); __ JumpIfNotSmi(input, deferred->entry());
// If smi, handle it directly. // If smi, handle it directly.
...@@ -3470,11 +3474,11 @@ void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) { ...@@ -3470,11 +3474,11 @@ void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) {
void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) { void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) {
DoubleRegister input = ToDoubleRegister(instr->InputAt(0)); DoubleRegister input = ToDoubleRegister(instr->value());
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
SwVfpRegister single_scratch = double_scratch0().low(); SwVfpRegister single_scratch = double_scratch0().low();
Register scratch1 = scratch0(); Register scratch1 = scratch0();
Register scratch2 = ToRegister(instr->TempAt(0)); Register scratch2 = ToRegister(instr->temp());
__ EmitVFPTruncate(kRoundToMinusInf, __ EmitVFPTruncate(kRoundToMinusInf,
single_scratch, single_scratch,
...@@ -3500,7 +3504,7 @@ void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) { ...@@ -3500,7 +3504,7 @@ void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) {
void LCodeGen::DoMathRound(LUnaryMathOperation* instr) { void LCodeGen::DoMathRound(LUnaryMathOperation* instr) {
DoubleRegister input = ToDoubleRegister(instr->InputAt(0)); DoubleRegister input = ToDoubleRegister(instr->value());
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
Register scratch = scratch0(); Register scratch = scratch0();
Label done, check_sign_on_zero; Label done, check_sign_on_zero;
...@@ -3565,16 +3569,16 @@ void LCodeGen::DoMathRound(LUnaryMathOperation* instr) { ...@@ -3565,16 +3569,16 @@ void LCodeGen::DoMathRound(LUnaryMathOperation* instr) {
void LCodeGen::DoMathSqrt(LUnaryMathOperation* instr) { void LCodeGen::DoMathSqrt(LUnaryMathOperation* instr) {
DoubleRegister input = ToDoubleRegister(instr->InputAt(0)); DoubleRegister input = ToDoubleRegister(instr->value());
DoubleRegister result = ToDoubleRegister(instr->result()); DoubleRegister result = ToDoubleRegister(instr->result());
__ vsqrt(result, input); __ vsqrt(result, input);
} }
void LCodeGen::DoMathPowHalf(LUnaryMathOperation* instr) { void LCodeGen::DoMathPowHalf(LUnaryMathOperation* instr) {
DoubleRegister input = ToDoubleRegister(instr->InputAt(0)); DoubleRegister input = ToDoubleRegister(instr->value());
DoubleRegister result = ToDoubleRegister(instr->result()); DoubleRegister result = ToDoubleRegister(instr->result());
DoubleRegister temp = ToDoubleRegister(instr->TempAt(0)); DoubleRegister temp = ToDoubleRegister(instr->temp());
// Note that according to ECMA-262 15.8.2.13: // Note that according to ECMA-262 15.8.2.13:
// Math.pow(-Infinity, 0.5) == Infinity // Math.pow(-Infinity, 0.5) == Infinity
...@@ -3596,11 +3600,11 @@ void LCodeGen::DoPower(LPower* instr) { ...@@ -3596,11 +3600,11 @@ void LCodeGen::DoPower(LPower* instr) {
Representation exponent_type = instr->hydrogen()->right()->representation(); Representation exponent_type = instr->hydrogen()->right()->representation();
// Having marked this as a call, we can use any registers. // Having marked this as a call, we can use any registers.
// Just make sure that the input/output registers are the expected ones. // Just make sure that the input/output registers are the expected ones.
ASSERT(!instr->InputAt(1)->IsDoubleRegister() || ASSERT(!instr->right()->IsDoubleRegister() ||
ToDoubleRegister(instr->InputAt(1)).is(d2)); ToDoubleRegister(instr->right()).is(d2));
ASSERT(!instr->InputAt(1)->IsRegister() || ASSERT(!instr->right()->IsRegister() ||
ToRegister(instr->InputAt(1)).is(r2)); ToRegister(instr->right()).is(r2));
ASSERT(ToDoubleRegister(instr->InputAt(0)).is(d1)); ASSERT(ToDoubleRegister(instr->left()).is(d1));
ASSERT(ToDoubleRegister(instr->result()).is(d3)); ASSERT(ToDoubleRegister(instr->result()).is(d3));
if (exponent_type.IsTagged()) { if (exponent_type.IsTagged()) {
...@@ -3640,7 +3644,7 @@ void LCodeGen::DoRandom(LRandom* instr) { ...@@ -3640,7 +3644,7 @@ void LCodeGen::DoRandom(LRandom* instr) {
// Having marked this instruction as a call we can use any // Having marked this instruction as a call we can use any
// registers. // registers.
ASSERT(ToDoubleRegister(instr->result()).is(d7)); ASSERT(ToDoubleRegister(instr->result()).is(d7));
ASSERT(ToRegister(instr->InputAt(0)).is(r0)); ASSERT(ToRegister(instr->global_object()).is(r0));
static const int kSeedSize = sizeof(uint32_t); static const int kSeedSize = sizeof(uint32_t);
STATIC_ASSERT(kPointerSize == kSeedSize); STATIC_ASSERT(kPointerSize == kSeedSize);
...@@ -3851,7 +3855,7 @@ void LCodeGen::DoCallKnownGlobal(LCallKnownGlobal* instr) { ...@@ -3851,7 +3855,7 @@ void LCodeGen::DoCallKnownGlobal(LCallKnownGlobal* instr) {
void LCodeGen::DoCallNew(LCallNew* instr) { void LCodeGen::DoCallNew(LCallNew* instr) {
ASSERT(ToRegister(instr->InputAt(0)).is(r1)); ASSERT(ToRegister(instr->constructor()).is(r1));
ASSERT(ToRegister(instr->result()).is(r0)); ASSERT(ToRegister(instr->result()).is(r0));
CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); CallConstructStub stub(NO_CALL_FUNCTION_FLAGS);
...@@ -3877,7 +3881,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { ...@@ -3877,7 +3881,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
__ mov(scratch, Operand(instr->transition())); __ mov(scratch, Operand(instr->transition()));
__ str(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); __ str(scratch, FieldMemOperand(object, HeapObject::kMapOffset));
if (instr->hydrogen()->NeedsWriteBarrierForMap()) { if (instr->hydrogen()->NeedsWriteBarrierForMap()) {
Register temp = ToRegister(instr->TempAt(0)); Register temp = ToRegister(instr->temp());
// Update the write barrier for the map field. // Update the write barrier for the map field.
__ RecordWriteField(object, __ RecordWriteField(object,
HeapObject::kMapOffset, HeapObject::kMapOffset,
...@@ -4155,7 +4159,7 @@ void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { ...@@ -4155,7 +4159,7 @@ void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
Register object_reg = ToRegister(instr->object()); Register object_reg = ToRegister(instr->object());
Register new_map_reg = ToRegister(instr->new_map_reg()); Register new_map_reg = ToRegister(instr->new_map_temp());
Register scratch = scratch0(); Register scratch = scratch0();
Handle<Map> from_map = instr->original_map(); Handle<Map> from_map = instr->original_map();
...@@ -4176,7 +4180,7 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { ...@@ -4176,7 +4180,7 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
scratch, kLRHasBeenSaved, kDontSaveFPRegs); scratch, kLRHasBeenSaved, kDontSaveFPRegs);
} else if (IsFastSmiElementsKind(from_kind) && } else if (IsFastSmiElementsKind(from_kind) &&
IsFastDoubleElementsKind(to_kind)) { IsFastDoubleElementsKind(to_kind)) {
Register fixed_object_reg = ToRegister(instr->temp_reg()); Register fixed_object_reg = ToRegister(instr->temp());
ASSERT(fixed_object_reg.is(r2)); ASSERT(fixed_object_reg.is(r2));
ASSERT(new_map_reg.is(r3)); ASSERT(new_map_reg.is(r3));
__ mov(fixed_object_reg, object_reg); __ mov(fixed_object_reg, object_reg);
...@@ -4184,7 +4188,7 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { ...@@ -4184,7 +4188,7 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
RelocInfo::CODE_TARGET, instr); RelocInfo::CODE_TARGET, instr);
} else if (IsFastDoubleElementsKind(from_kind) && } else if (IsFastDoubleElementsKind(from_kind) &&
IsFastObjectElementsKind(to_kind)) { IsFastObjectElementsKind(to_kind)) {
Register fixed_object_reg = ToRegister(instr->temp_reg()); Register fixed_object_reg = ToRegister(instr->temp());
ASSERT(fixed_object_reg.is(r2)); ASSERT(fixed_object_reg.is(r2));
ASSERT(new_map_reg.is(r3)); ASSERT(new_map_reg.is(r3));
__ mov(fixed_object_reg, object_reg); __ mov(fixed_object_reg, object_reg);
...@@ -4309,14 +4313,14 @@ void LCodeGen::DoDeferredStringCharFromCode(LStringCharFromCode* instr) { ...@@ -4309,14 +4313,14 @@ void LCodeGen::DoDeferredStringCharFromCode(LStringCharFromCode* instr) {
void LCodeGen::DoStringLength(LStringLength* instr) { void LCodeGen::DoStringLength(LStringLength* instr) {
Register string = ToRegister(instr->InputAt(0)); Register string = ToRegister(instr->string());
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
__ ldr(result, FieldMemOperand(string, String::kLengthOffset)); __ ldr(result, FieldMemOperand(string, String::kLengthOffset));
} }
void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) {
LOperand* input = instr->InputAt(0); LOperand* input = instr->value();
ASSERT(input->IsRegister() || input->IsStackSlot()); ASSERT(input->IsRegister() || input->IsStackSlot());
LOperand* output = instr->result(); LOperand* output = instr->result();
ASSERT(output->IsDoubleRegister()); ASSERT(output->IsDoubleRegister());
...@@ -4333,7 +4337,7 @@ void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { ...@@ -4333,7 +4337,7 @@ void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) {
void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) {
LOperand* input = instr->InputAt(0); LOperand* input = instr->value();
LOperand* output = instr->result(); LOperand* output = instr->result();
SwVfpRegister flt_scratch = double_scratch0().low(); SwVfpRegister flt_scratch = double_scratch0().low();
...@@ -4349,7 +4353,7 @@ void LCodeGen::DoNumberTagI(LNumberTagI* instr) { ...@@ -4349,7 +4353,7 @@ void LCodeGen::DoNumberTagI(LNumberTagI* instr) {
: LDeferredCode(codegen), instr_(instr) { } : LDeferredCode(codegen), instr_(instr) { }
virtual void Generate() { virtual void Generate() {
codegen()->DoDeferredNumberTagI(instr_, codegen()->DoDeferredNumberTagI(instr_,
instr_->InputAt(0), instr_->value(),
SIGNED_INT32); SIGNED_INT32);
} }
virtual LInstruction* instr() { return instr_; } virtual LInstruction* instr() { return instr_; }
...@@ -4357,7 +4361,7 @@ void LCodeGen::DoNumberTagI(LNumberTagI* instr) { ...@@ -4357,7 +4361,7 @@ void LCodeGen::DoNumberTagI(LNumberTagI* instr) {
LNumberTagI* instr_; LNumberTagI* instr_;
}; };
Register src = ToRegister(instr->InputAt(0)); Register src = ToRegister(instr->value());
Register dst = ToRegister(instr->result()); Register dst = ToRegister(instr->result());
DeferredNumberTagI* deferred = new(zone()) DeferredNumberTagI(this, instr); DeferredNumberTagI* deferred = new(zone()) DeferredNumberTagI(this, instr);
...@@ -4374,7 +4378,7 @@ void LCodeGen::DoNumberTagU(LNumberTagU* instr) { ...@@ -4374,7 +4378,7 @@ void LCodeGen::DoNumberTagU(LNumberTagU* instr) {
: LDeferredCode(codegen), instr_(instr) { } : LDeferredCode(codegen), instr_(instr) { }
virtual void Generate() { virtual void Generate() {
codegen()->DoDeferredNumberTagI(instr_, codegen()->DoDeferredNumberTagI(instr_,
instr_->InputAt(0), instr_->value(),
UNSIGNED_INT32); UNSIGNED_INT32);
} }
virtual LInstruction* instr() { return instr_; } virtual LInstruction* instr() { return instr_; }
...@@ -4382,7 +4386,7 @@ void LCodeGen::DoNumberTagU(LNumberTagU* instr) { ...@@ -4382,7 +4386,7 @@ void LCodeGen::DoNumberTagU(LNumberTagU* instr) {
LNumberTagU* instr_; LNumberTagU* instr_;
}; };
LOperand* input = instr->InputAt(0); LOperand* input = instr->value();
ASSERT(input->IsRegister() && input->Equals(instr->result())); ASSERT(input->IsRegister() && input->Equals(instr->result()));
Register reg = ToRegister(input); Register reg = ToRegister(input);
...@@ -4460,11 +4464,11 @@ void LCodeGen::DoNumberTagD(LNumberTagD* instr) { ...@@ -4460,11 +4464,11 @@ void LCodeGen::DoNumberTagD(LNumberTagD* instr) {
LNumberTagD* instr_; LNumberTagD* instr_;
}; };
DoubleRegister input_reg = ToDoubleRegister(instr->InputAt(0)); DoubleRegister input_reg = ToDoubleRegister(instr->value());
Register scratch = scratch0(); Register scratch = scratch0();
Register reg = ToRegister(instr->result()); Register reg = ToRegister(instr->result());
Register temp1 = ToRegister(instr->TempAt(0)); Register temp1 = ToRegister(instr->temp());
Register temp2 = ToRegister(instr->TempAt(1)); Register temp2 = ToRegister(instr->temp2());
DeferredNumberTagD* deferred = new(zone()) DeferredNumberTagD(this, instr); DeferredNumberTagD* deferred = new(zone()) DeferredNumberTagD(this, instr);
if (FLAG_inline_new) { if (FLAG_inline_new) {
...@@ -4494,12 +4498,12 @@ void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { ...@@ -4494,12 +4498,12 @@ void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) {
void LCodeGen::DoSmiTag(LSmiTag* instr) { void LCodeGen::DoSmiTag(LSmiTag* instr) {
ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow)); ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow));
__ SmiTag(ToRegister(instr->result()), ToRegister(instr->InputAt(0))); __ SmiTag(ToRegister(instr->result()), ToRegister(instr->value()));
} }
void LCodeGen::DoSmiUntag(LSmiUntag* instr) { void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
Register input = ToRegister(instr->InputAt(0)); Register input = ToRegister(instr->value());
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
if (instr->needs_check()) { if (instr->needs_check()) {
STATIC_ASSERT(kHeapObjectTag == 1); STATIC_ASSERT(kHeapObjectTag == 1);
...@@ -4571,9 +4575,9 @@ void LCodeGen::EmitNumberUntagD(Register input_reg, ...@@ -4571,9 +4575,9 @@ void LCodeGen::EmitNumberUntagD(Register input_reg,
void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) { void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
Register input_reg = ToRegister(instr->InputAt(0)); Register input_reg = ToRegister(instr->value());
Register scratch1 = scratch0(); Register scratch1 = scratch0();
Register scratch2 = ToRegister(instr->TempAt(0)); Register scratch2 = ToRegister(instr->temp());
DwVfpRegister double_scratch = double_scratch0(); DwVfpRegister double_scratch = double_scratch0();
SwVfpRegister single_scratch = double_scratch.low(); SwVfpRegister single_scratch = double_scratch.low();
...@@ -4594,8 +4598,8 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) { ...@@ -4594,8 +4598,8 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
__ cmp(scratch1, Operand(ip)); __ cmp(scratch1, Operand(ip));
if (instr->truncating()) { if (instr->truncating()) {
Register scratch3 = ToRegister(instr->TempAt(1)); Register scratch3 = ToRegister(instr->temp2());
DwVfpRegister double_scratch2 = ToDoubleRegister(instr->TempAt(2)); DwVfpRegister double_scratch2 = ToDoubleRegister(instr->temp3());
ASSERT(!scratch3.is(input_reg) && ASSERT(!scratch3.is(input_reg) &&
!scratch3.is(scratch1) && !scratch3.is(scratch1) &&
!scratch3.is(scratch2)); !scratch3.is(scratch2));
...@@ -4662,7 +4666,7 @@ void LCodeGen::DoTaggedToI(LTaggedToI* instr) { ...@@ -4662,7 +4666,7 @@ void LCodeGen::DoTaggedToI(LTaggedToI* instr) {
LTaggedToI* instr_; LTaggedToI* instr_;
}; };
LOperand* input = instr->InputAt(0); LOperand* input = instr->value();
ASSERT(input->IsRegister()); ASSERT(input->IsRegister());
ASSERT(input->Equals(instr->result())); ASSERT(input->Equals(instr->result()));
...@@ -4681,7 +4685,7 @@ void LCodeGen::DoTaggedToI(LTaggedToI* instr) { ...@@ -4681,7 +4685,7 @@ void LCodeGen::DoTaggedToI(LTaggedToI* instr) {
void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) { void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) {
LOperand* input = instr->InputAt(0); LOperand* input = instr->value();
ASSERT(input->IsRegister()); ASSERT(input->IsRegister());
LOperand* result = instr->result(); LOperand* result = instr->result();
ASSERT(result->IsDoubleRegister()); ASSERT(result->IsDoubleRegister());
...@@ -4699,14 +4703,14 @@ void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) { ...@@ -4699,14 +4703,14 @@ void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) {
void LCodeGen::DoDoubleToI(LDoubleToI* instr) { void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
Register result_reg = ToRegister(instr->result()); Register result_reg = ToRegister(instr->result());
Register scratch1 = scratch0(); Register scratch1 = scratch0();
Register scratch2 = ToRegister(instr->TempAt(0)); Register scratch2 = ToRegister(instr->temp());
DwVfpRegister double_input = ToDoubleRegister(instr->InputAt(0)); DwVfpRegister double_input = ToDoubleRegister(instr->value());
SwVfpRegister single_scratch = double_scratch0().low(); SwVfpRegister single_scratch = double_scratch0().low();
Label done; Label done;
if (instr->truncating()) { if (instr->truncating()) {
Register scratch3 = ToRegister(instr->TempAt(1)); Register scratch3 = ToRegister(instr->temp2());
__ EmitECMATruncate(result_reg, __ EmitECMATruncate(result_reg,
double_input, double_input,
single_scratch, single_scratch,
...@@ -4732,21 +4736,21 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) { ...@@ -4732,21 +4736,21 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
void LCodeGen::DoCheckSmi(LCheckSmi* instr) { void LCodeGen::DoCheckSmi(LCheckSmi* instr) {
LOperand* input = instr->InputAt(0); LOperand* input = instr->value();
__ tst(ToRegister(input), Operand(kSmiTagMask)); __ tst(ToRegister(input), Operand(kSmiTagMask));
DeoptimizeIf(ne, instr->environment()); DeoptimizeIf(ne, instr->environment());
} }
void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) {
LOperand* input = instr->InputAt(0); LOperand* input = instr->value();
__ tst(ToRegister(input), Operand(kSmiTagMask)); __ tst(ToRegister(input), Operand(kSmiTagMask));
DeoptimizeIf(eq, instr->environment()); DeoptimizeIf(eq, instr->environment());
} }
void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
Register input = ToRegister(instr->InputAt(0)); Register input = ToRegister(instr->value());
Register scratch = scratch0(); Register scratch = scratch0();
__ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); __ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset));
...@@ -4819,7 +4823,7 @@ void LCodeGen::DoCheckMapCommon(Register reg, ...@@ -4819,7 +4823,7 @@ void LCodeGen::DoCheckMapCommon(Register reg,
void LCodeGen::DoCheckMaps(LCheckMaps* instr) { void LCodeGen::DoCheckMaps(LCheckMaps* instr) {
Register scratch = scratch0(); Register scratch = scratch0();
LOperand* input = instr->InputAt(0); LOperand* input = instr->value();
ASSERT(input->IsRegister()); ASSERT(input->IsRegister());
Register reg = ToRegister(input); Register reg = ToRegister(input);
...@@ -4839,7 +4843,7 @@ void LCodeGen::DoCheckMaps(LCheckMaps* instr) { ...@@ -4839,7 +4843,7 @@ void LCodeGen::DoCheckMaps(LCheckMaps* instr) {
void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) {
DoubleRegister value_reg = ToDoubleRegister(instr->unclamped()); DoubleRegister value_reg = ToDoubleRegister(instr->unclamped());
Register result_reg = ToRegister(instr->result()); Register result_reg = ToRegister(instr->result());
DoubleRegister temp_reg = ToDoubleRegister(instr->TempAt(0)); DoubleRegister temp_reg = ToDoubleRegister(instr->temp());
__ ClampDoubleToUint8(result_reg, value_reg, temp_reg); __ ClampDoubleToUint8(result_reg, value_reg, temp_reg);
} }
...@@ -4855,7 +4859,7 @@ void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) { ...@@ -4855,7 +4859,7 @@ void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) {
Register scratch = scratch0(); Register scratch = scratch0();
Register input_reg = ToRegister(instr->unclamped()); Register input_reg = ToRegister(instr->unclamped());
Register result_reg = ToRegister(instr->result()); Register result_reg = ToRegister(instr->result());
DoubleRegister temp_reg = ToDoubleRegister(instr->TempAt(0)); DoubleRegister temp_reg = ToDoubleRegister(instr->temp());
Label is_smi, done, heap_number; Label is_smi, done, heap_number;
// Both smi and heap number cases are handled. // Both smi and heap number cases are handled.
...@@ -4889,8 +4893,8 @@ void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) { ...@@ -4889,8 +4893,8 @@ void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) {
void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) {
Register temp1 = ToRegister(instr->TempAt(0)); Register temp1 = ToRegister(instr->temp());
Register temp2 = ToRegister(instr->TempAt(1)); Register temp2 = ToRegister(instr->temp2());
Handle<JSObject> holder = instr->holder(); Handle<JSObject> holder = instr->holder();
Handle<JSObject> current_prototype = instr->prototype(); Handle<JSObject> current_prototype = instr->prototype();
...@@ -4932,8 +4936,8 @@ void LCodeGen::DoAllocateObject(LAllocateObject* instr) { ...@@ -4932,8 +4936,8 @@ void LCodeGen::DoAllocateObject(LAllocateObject* instr) {
new(zone()) DeferredAllocateObject(this, instr); new(zone()) DeferredAllocateObject(this, instr);
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
Register scratch = ToRegister(instr->TempAt(0)); Register scratch = ToRegister(instr->temp());
Register scratch2 = ToRegister(instr->TempAt(1)); Register scratch2 = ToRegister(instr->temp2());
Handle<JSFunction> constructor = instr->hydrogen()->constructor(); Handle<JSFunction> constructor = instr->hydrogen()->constructor();
Handle<Map> initial_map(constructor->initial_map()); Handle<Map> initial_map(constructor->initial_map());
int instance_size = initial_map->instance_size(); int instance_size = initial_map->instance_size();
...@@ -5225,7 +5229,7 @@ void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) { ...@@ -5225,7 +5229,7 @@ void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) {
void LCodeGen::DoToFastProperties(LToFastProperties* instr) { void LCodeGen::DoToFastProperties(LToFastProperties* instr) {
ASSERT(ToRegister(instr->InputAt(0)).is(r0)); ASSERT(ToRegister(instr->value()).is(r0));
__ push(r0); __ push(r0);
CallRuntime(Runtime::kToFastProperties, 1, instr); CallRuntime(Runtime::kToFastProperties, 1, instr);
} }
...@@ -5306,14 +5310,14 @@ void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { ...@@ -5306,14 +5310,14 @@ void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
void LCodeGen::DoTypeof(LTypeof* instr) { void LCodeGen::DoTypeof(LTypeof* instr) {
Register input = ToRegister(instr->InputAt(0)); Register input = ToRegister(instr->value());
__ push(input); __ push(input);
CallRuntime(Runtime::kTypeof, 1, instr); CallRuntime(Runtime::kTypeof, 1, instr);
} }
void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) {
Register input = ToRegister(instr->InputAt(0)); Register input = ToRegister(instr->value());
int true_block = chunk_->LookupDestination(instr->true_block_id()); int true_block = chunk_->LookupDestination(instr->true_block_id());
int false_block = chunk_->LookupDestination(instr->false_block_id()); int false_block = chunk_->LookupDestination(instr->false_block_id());
Label* true_label = chunk_->GetAssemblyLabel(true_block); Label* true_label = chunk_->GetAssemblyLabel(true_block);
...@@ -5403,7 +5407,7 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label, ...@@ -5403,7 +5407,7 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label,
void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) {
Register temp1 = ToRegister(instr->TempAt(0)); Register temp1 = ToRegister(instr->temp());
int true_block = chunk_->LookupDestination(instr->true_block_id()); int true_block = chunk_->LookupDestination(instr->true_block_id());
int false_block = chunk_->LookupDestination(instr->false_block_id()); int false_block = chunk_->LookupDestination(instr->false_block_id());
......
...@@ -110,8 +110,9 @@ class LCodeGen BASE_EMBEDDED { ...@@ -110,8 +110,9 @@ class LCodeGen BASE_EMBEDDED {
void FinishCode(Handle<Code> code); void FinishCode(Handle<Code> code);
// Deferred code support. // Deferred code support.
template<int T> void DoDeferredBinaryOpStub(LPointerMap* pointer_map,
void DoDeferredBinaryOpStub(LTemplateInstruction<1, 2, T>* instr, LOperand* left_argument,
LOperand* right_argument,
Token::Value op); Token::Value op);
void DoDeferredNumberTagD(LNumberTagD* instr); void DoDeferredNumberTagD(LNumberTagD* instr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment