Index: src/arm/lithium-codegen-arm.cc |
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
index 3c7abc38b56960f693265ee980fabed10f22626a..d5c730889fb750b65ced06fb29037265f68b0c08 100644 |
--- a/src/arm/lithium-codegen-arm.cc |
+++ b/src/arm/lithium-codegen-arm.cc |
@@ -951,7 +951,7 @@ void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { |
void LCodeGen::DoModI(LModI* instr) { |
if (instr->hydrogen()->HasPowerOf2Divisor()) { |
- Register dividend = ToRegister(instr->InputAt(0)); |
+ Register dividend = ToRegister(instr->left()); |
Register result = ToRegister(instr->result()); |
int32_t divisor = |
@@ -976,14 +976,14 @@ void LCodeGen::DoModI(LModI* instr) { |
} |
// These registers hold untagged 32 bit values. |
- Register left = ToRegister(instr->InputAt(0)); |
- Register right = ToRegister(instr->InputAt(1)); |
+ Register left = ToRegister(instr->left()); |
+ Register right = ToRegister(instr->right()); |
Register result = ToRegister(instr->result()); |
Register scratch = scratch0(); |
- Register scratch2 = ToRegister(instr->TempAt(0)); |
- DwVfpRegister dividend = ToDoubleRegister(instr->TempAt(1)); |
- DwVfpRegister divisor = ToDoubleRegister(instr->TempAt(2)); |
+ Register scratch2 = ToRegister(instr->temp()); |
+ DwVfpRegister dividend = ToDoubleRegister(instr->temp2()); |
+ DwVfpRegister divisor = ToDoubleRegister(instr->temp3()); |
DwVfpRegister quotient = double_scratch0(); |
ASSERT(!dividend.is(divisor)); |
@@ -1186,15 +1186,18 @@ void LCodeGen::DoDivI(LDivI* instr) { |
DeferredDivI(LCodeGen* codegen, LDivI* instr) |
: LDeferredCode(codegen), instr_(instr) { } |
virtual void Generate() { |
- codegen()->DoDeferredBinaryOpStub(instr_, Token::DIV); |
+ codegen()->DoDeferredBinaryOpStub(instr_->pointer_map(), |
+ instr_->left(), |
+ instr_->right(), |
+ Token::DIV); |
} |
virtual LInstruction* instr() { return instr_; } |
private: |
LDivI* instr_; |
}; |
- const Register left = ToRegister(instr->InputAt(0)); |
- const Register right = ToRegister(instr->InputAt(1)); |
+ const Register left = ToRegister(instr->left()); |
+ const Register right = ToRegister(instr->right()); |
const Register scratch = scratch0(); |
const Register result = ToRegister(instr->result()); |
@@ -1263,15 +1266,15 @@ void LCodeGen::DoDivI(LDivI* instr) { |
void LCodeGen::DoMathFloorOfDiv(LMathFloorOfDiv* instr) { |
const Register result = ToRegister(instr->result()); |
- const Register left = ToRegister(instr->InputAt(0)); |
- const Register remainder = ToRegister(instr->TempAt(0)); |
+ const Register left = ToRegister(instr->left()); |
+ const Register remainder = ToRegister(instr->temp()); |
const Register scratch = scratch0(); |
// We only optimize this for division by constants, because the standard |
// integer division routine is usually slower than transitionning to VFP. |
// This could be optimized on processors with SDIV available. |
- ASSERT(instr->InputAt(1)->IsConstantOperand()); |
- int32_t divisor = ToInteger32(LConstantOperand::cast(instr->InputAt(1))); |
+ ASSERT(instr->right()->IsConstantOperand()); |
+ int32_t divisor = ToInteger32(LConstantOperand::cast(instr->right())); |
if (divisor < 0) { |
__ cmp(left, Operand(0)); |
DeoptimizeIf(eq, instr->environment()); |
@@ -1289,11 +1292,12 @@ void LCodeGen::DoMathFloorOfDiv(LMathFloorOfDiv* instr) { |
} |
-template<int T> |
-void LCodeGen::DoDeferredBinaryOpStub(LTemplateInstruction<1, 2, T>* instr, |
+void LCodeGen::DoDeferredBinaryOpStub(LPointerMap* pointer_map, |
+ LOperand* left_argument, |
+ LOperand* right_argument, |
Token::Value op) { |
- Register left = ToRegister(instr->InputAt(0)); |
- Register right = ToRegister(instr->InputAt(1)); |
+ Register left = ToRegister(left_argument); |
+ Register right = ToRegister(right_argument); |
PushSafepointRegistersScope scope(this, Safepoint::kWithRegistersAndDoubles); |
// Move left to r1 and right to r0 for the stub call. |
@@ -1312,7 +1316,7 @@ void LCodeGen::DoDeferredBinaryOpStub(LTemplateInstruction<1, 2, T>* instr, |
} |
BinaryOpStub stub(op, OVERWRITE_LEFT); |
__ CallStub(&stub); |
- RecordSafepointWithRegistersAndDoubles(instr->pointer_map(), |
+ RecordSafepointWithRegistersAndDoubles(pointer_map, |
0, |
Safepoint::kNoLazyDeopt); |
// Overwrite the stored value of r0 with the result of the stub. |
@@ -1324,8 +1328,8 @@ void LCodeGen::DoMulI(LMulI* instr) { |
Register scratch = scratch0(); |
Register result = ToRegister(instr->result()); |
// Note that result may alias left. |
- Register left = ToRegister(instr->InputAt(0)); |
- LOperand* right_op = instr->InputAt(1); |
+ Register left = ToRegister(instr->left()); |
+ LOperand* right_op = instr->right(); |
bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); |
bool bailout_on_minus_zero = |
@@ -1392,7 +1396,7 @@ void LCodeGen::DoMulI(LMulI* instr) { |
} else { |
Register right = EmitLoadRegister(right_op, scratch); |
if (bailout_on_minus_zero) { |
- __ orr(ToRegister(instr->TempAt(0)), left, right); |
+ __ orr(ToRegister(instr->temp()), left, right); |
} |
if (can_overflow) { |
@@ -1409,7 +1413,7 @@ void LCodeGen::DoMulI(LMulI* instr) { |
Label done; |
__ cmp(result, Operand(0)); |
__ b(ne, &done); |
- __ cmp(ToRegister(instr->TempAt(0)), Operand(0)); |
+ __ cmp(ToRegister(instr->temp()), Operand(0)); |
DeoptimizeIf(mi, instr->environment()); |
__ bind(&done); |
} |
@@ -1418,8 +1422,8 @@ void LCodeGen::DoMulI(LMulI* instr) { |
void LCodeGen::DoBitI(LBitI* instr) { |
- LOperand* left_op = instr->InputAt(0); |
- LOperand* right_op = instr->InputAt(1); |
+ LOperand* left_op = instr->left(); |
+ LOperand* right_op = instr->right(); |
ASSERT(left_op->IsRegister()); |
Register left = ToRegister(left_op); |
Register result = ToRegister(instr->result()); |
@@ -1452,8 +1456,8 @@ void LCodeGen::DoBitI(LBitI* instr) { |
void LCodeGen::DoShiftI(LShiftI* instr) { |
// Both 'left' and 'right' are "used at start" (see LCodeGen::DoShift), so |
// result may alias either of them. |
- LOperand* right_op = instr->InputAt(1); |
- Register left = ToRegister(instr->InputAt(0)); |
+ LOperand* right_op = instr->right(); |
+ Register left = ToRegister(instr->left()); |
Register result = ToRegister(instr->result()); |
Register scratch = scratch0(); |
if (right_op->IsRegister()) { |
@@ -1517,8 +1521,8 @@ void LCodeGen::DoShiftI(LShiftI* instr) { |
void LCodeGen::DoSubI(LSubI* instr) { |
- LOperand* left = instr->InputAt(0); |
- LOperand* right = instr->InputAt(1); |
+ LOperand* left = instr->left(); |
+ LOperand* right = instr->right(); |
LOperand* result = instr->result(); |
bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); |
SBit set_cond = can_overflow ? SetCC : LeaveCC; |
@@ -1564,28 +1568,28 @@ void LCodeGen::DoConstantT(LConstantT* instr) { |
void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { |
Register result = ToRegister(instr->result()); |
- Register array = ToRegister(instr->InputAt(0)); |
+ Register array = ToRegister(instr->value()); |
__ ldr(result, FieldMemOperand(array, JSArray::kLengthOffset)); |
} |
void LCodeGen::DoFixedArrayBaseLength(LFixedArrayBaseLength* instr) { |
Register result = ToRegister(instr->result()); |
- Register array = ToRegister(instr->InputAt(0)); |
+ Register array = ToRegister(instr->value()); |
__ ldr(result, FieldMemOperand(array, FixedArrayBase::kLengthOffset)); |
} |
void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { |
Register result = ToRegister(instr->result()); |
- Register map = ToRegister(instr->InputAt(0)); |
+ Register map = ToRegister(instr->value()); |
__ EnumLength(result, map); |
} |
void LCodeGen::DoElementsKind(LElementsKind* instr) { |
Register result = ToRegister(instr->result()); |
- Register input = ToRegister(instr->InputAt(0)); |
+ Register input = ToRegister(instr->value()); |
// Load map into |result|. |
__ ldr(result, FieldMemOperand(input, HeapObject::kMapOffset)); |
@@ -1598,9 +1602,9 @@ void LCodeGen::DoElementsKind(LElementsKind* instr) { |
void LCodeGen::DoValueOf(LValueOf* instr) { |
- Register input = ToRegister(instr->InputAt(0)); |
+ Register input = ToRegister(instr->value()); |
Register result = ToRegister(instr->result()); |
- Register map = ToRegister(instr->TempAt(0)); |
+ Register map = ToRegister(instr->temp()); |
Label done; |
// If the object is a smi return the object. |
@@ -1619,9 +1623,9 @@ void LCodeGen::DoValueOf(LValueOf* instr) { |
void LCodeGen::DoDateField(LDateField* instr) { |
- Register object = ToRegister(instr->InputAt(0)); |
+ Register object = ToRegister(instr->date()); |
Register result = ToRegister(instr->result()); |
- Register scratch = ToRegister(instr->TempAt(0)); |
+ Register scratch = ToRegister(instr->temp()); |
Smi* index = instr->index(); |
Label runtime, done; |
ASSERT(object.is(result)); |
@@ -1658,14 +1662,14 @@ void LCodeGen::DoDateField(LDateField* instr) { |
void LCodeGen::DoBitNotI(LBitNotI* instr) { |
- Register input = ToRegister(instr->InputAt(0)); |
+ Register input = ToRegister(instr->value()); |
Register result = ToRegister(instr->result()); |
__ mvn(result, Operand(input)); |
} |
void LCodeGen::DoThrow(LThrow* instr) { |
- Register input_reg = EmitLoadRegister(instr->InputAt(0), ip); |
+ Register input_reg = EmitLoadRegister(instr->value(), ip); |
__ push(input_reg); |
CallRuntime(Runtime::kThrow, 1, instr); |
@@ -1676,8 +1680,8 @@ void LCodeGen::DoThrow(LThrow* instr) { |
void LCodeGen::DoAddI(LAddI* instr) { |
- LOperand* left = instr->InputAt(0); |
- LOperand* right = instr->InputAt(1); |
+ LOperand* left = instr->left(); |
+ LOperand* right = instr->right(); |
LOperand* result = instr->result(); |
bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); |
SBit set_cond = can_overflow ? SetCC : LeaveCC; |
@@ -1697,8 +1701,8 @@ void LCodeGen::DoAddI(LAddI* instr) { |
void LCodeGen::DoMathMinMax(LMathMinMax* instr) { |
- LOperand* left = instr->InputAt(0); |
- LOperand* right = instr->InputAt(1); |
+ LOperand* left = instr->left(); |
+ LOperand* right = instr->right(); |
HMathMinMax::Operation operation = instr->hydrogen()->operation(); |
Condition condition = (operation == HMathMinMax::kMathMin) ? le : ge; |
if (instr->hydrogen()->representation().IsInteger32()) { |
@@ -1759,8 +1763,8 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) { |
void LCodeGen::DoArithmeticD(LArithmeticD* instr) { |
- DoubleRegister left = ToDoubleRegister(instr->InputAt(0)); |
- DoubleRegister right = ToDoubleRegister(instr->InputAt(1)); |
+ DoubleRegister left = ToDoubleRegister(instr->left()); |
+ DoubleRegister right = ToDoubleRegister(instr->right()); |
DoubleRegister result = ToDoubleRegister(instr->result()); |
switch (instr->op()) { |
case Token::ADD: |
@@ -1799,8 +1803,8 @@ void LCodeGen::DoArithmeticD(LArithmeticD* instr) { |
void LCodeGen::DoArithmeticT(LArithmeticT* instr) { |
- ASSERT(ToRegister(instr->InputAt(0)).is(r1)); |
- ASSERT(ToRegister(instr->InputAt(1)).is(r0)); |
+ ASSERT(ToRegister(instr->left()).is(r1)); |
+ ASSERT(ToRegister(instr->right()).is(r0)); |
ASSERT(ToRegister(instr->result()).is(r0)); |
BinaryOpStub stub(instr->op(), NO_OVERWRITE); |
@@ -1845,11 +1849,11 @@ void LCodeGen::DoBranch(LBranch* instr) { |
Representation r = instr->hydrogen()->value()->representation(); |
if (r.IsInteger32()) { |
- Register reg = ToRegister(instr->InputAt(0)); |
+ Register reg = ToRegister(instr->value()); |
__ cmp(reg, Operand(0)); |
EmitBranch(true_block, false_block, ne); |
} else if (r.IsDouble()) { |
- DoubleRegister reg = ToDoubleRegister(instr->InputAt(0)); |
+ DoubleRegister reg = ToDoubleRegister(instr->value()); |
Register scratch = scratch0(); |
// Test the double value. Zero and NaN are false. |
@@ -1858,7 +1862,7 @@ void LCodeGen::DoBranch(LBranch* instr) { |
EmitBranch(true_block, false_block, eq); |
} else { |
ASSERT(r.IsTagged()); |
- Register reg = ToRegister(instr->InputAt(0)); |
+ Register reg = ToRegister(instr->value()); |
HType type = instr->hydrogen()->value()->type(); |
if (type.IsBoolean()) { |
__ CompareRoot(reg, Heap::kTrueValueRootIndex); |
@@ -1997,8 +2001,8 @@ Condition LCodeGen::TokenToCondition(Token::Value op, bool is_unsigned) { |
void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) { |
- LOperand* left = instr->InputAt(0); |
- LOperand* right = instr->InputAt(1); |
+ LOperand* left = instr->left(); |
+ LOperand* right = instr->right(); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
Condition cond = TokenToCondition(instr->op(), false); |
@@ -2038,8 +2042,8 @@ void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) { |
void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) { |
- Register left = ToRegister(instr->InputAt(0)); |
- Register right = ToRegister(instr->InputAt(1)); |
+ Register left = ToRegister(instr->left()); |
+ Register right = ToRegister(instr->right()); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
@@ -2049,7 +2053,7 @@ void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* 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 false_block = chunk_->LookupDestination(instr->false_block_id()); |
@@ -2060,7 +2064,7 @@ void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) { |
void LCodeGen::DoIsNilAndBranch(LIsNilAndBranch* instr) { |
Register scratch = scratch0(); |
- Register reg = ToRegister(instr->InputAt(0)); |
+ Register reg = ToRegister(instr->value()); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
// If the expression is known to be untagged or a smi, then it's definitely |
@@ -2128,8 +2132,8 @@ Condition LCodeGen::EmitIsObject(Register input, |
void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) { |
- Register reg = ToRegister(instr->InputAt(0)); |
- Register temp1 = ToRegister(instr->TempAt(0)); |
+ Register reg = ToRegister(instr->value()); |
+ Register temp1 = ToRegister(instr->temp()); |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
@@ -2154,8 +2158,8 @@ Condition LCodeGen::EmitIsString(Register input, |
void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) { |
- Register reg = ToRegister(instr->InputAt(0)); |
- Register temp1 = ToRegister(instr->TempAt(0)); |
+ Register reg = ToRegister(instr->value()); |
+ Register temp1 = ToRegister(instr->temp()); |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
@@ -2172,15 +2176,15 @@ void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { |
int true_block = chunk_->LookupDestination(instr->true_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)); |
EmitBranch(true_block, false_block, eq); |
} |
void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) { |
- Register input = ToRegister(instr->InputAt(0)); |
- Register temp = ToRegister(instr->TempAt(0)); |
+ Register input = ToRegister(instr->value()); |
+ Register temp = ToRegister(instr->temp()); |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
@@ -2250,7 +2254,7 @@ static Condition BranchCondition(HHasInstanceTypeAndBranch* instr) { |
void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { |
Register scratch = scratch0(); |
- Register input = ToRegister(instr->InputAt(0)); |
+ Register input = ToRegister(instr->value()); |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
@@ -2265,7 +2269,7 @@ void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { |
void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { |
- Register input = ToRegister(instr->InputAt(0)); |
+ Register input = ToRegister(instr->value()); |
Register result = ToRegister(instr->result()); |
__ AbortIfNotString(input); |
@@ -2277,7 +2281,7 @@ void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { |
void LCodeGen::DoHasCachedArrayIndexAndBranch( |
LHasCachedArrayIndexAndBranch* instr) { |
- Register input = ToRegister(instr->InputAt(0)); |
+ Register input = ToRegister(instr->value()); |
Register scratch = scratch0(); |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
@@ -2358,9 +2362,9 @@ void LCodeGen::EmitClassOfTest(Label* is_true, |
void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) { |
- Register input = ToRegister(instr->InputAt(0)); |
+ Register input = ToRegister(instr->value()); |
Register temp = scratch0(); |
- Register temp2 = ToRegister(instr->TempAt(0)); |
+ Register temp2 = ToRegister(instr->temp()); |
Handle<String> class_name = instr->hydrogen()->class_name(); |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
@@ -2376,8 +2380,8 @@ void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) { |
void LCodeGen::DoCmpMapAndBranch(LCmpMapAndBranch* instr) { |
- Register reg = ToRegister(instr->InputAt(0)); |
- Register temp = ToRegister(instr->TempAt(0)); |
+ Register reg = ToRegister(instr->value()); |
+ Register temp = ToRegister(instr->temp()); |
int true_block = instr->true_block_id(); |
int false_block = instr->false_block_id(); |
@@ -2388,8 +2392,8 @@ void LCodeGen::DoCmpMapAndBranch(LCmpMapAndBranch* instr) { |
void LCodeGen::DoInstanceOf(LInstanceOf* instr) { |
- ASSERT(ToRegister(instr->InputAt(0)).is(r0)); // Object is in r0. |
- ASSERT(ToRegister(instr->InputAt(1)).is(r1)); // Function is in r1. |
+ ASSERT(ToRegister(instr->left()).is(r0)); // Object is in r0. |
+ ASSERT(ToRegister(instr->right()).is(r1)); // Function is in r1. |
InstanceofStub stub(InstanceofStub::kArgsInRegisters); |
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
@@ -2420,8 +2424,8 @@ void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { |
deferred = new(zone()) DeferredInstanceOfKnownGlobal(this, instr); |
Label done, false_result; |
- Register object = ToRegister(instr->InputAt(0)); |
- Register temp = ToRegister(instr->TempAt(0)); |
+ Register object = ToRegister(instr->value()); |
+ Register temp = ToRegister(instr->temp()); |
Register result = ToRegister(instr->result()); |
ASSERT(object.is(r0)); |
@@ -2501,7 +2505,7 @@ void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, |
// 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 |
// offset to the location of the map check. |
- Register temp = ToRegister(instr->TempAt(0)); |
+ Register temp = ToRegister(instr->temp()); |
ASSERT(temp.is(r4)); |
__ LoadHeapObject(InstanceofStub::right(), instr->function()); |
static const int kAdditionalDelta = 5; |
@@ -2598,7 +2602,7 @@ void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { |
// it as no longer deleted. |
if (instr->hydrogen()->RequiresHoleCheck()) { |
// 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)); |
__ CompareRoot(payload, Heap::kTheHoleValueRootIndex); |
DeoptimizeIf(eq, instr->environment()); |
@@ -2677,7 +2681,7 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
- Register object = ToRegister(instr->InputAt(0)); |
+ Register object = ToRegister(instr->object()); |
Register result = ToRegister(instr->result()); |
if (instr->hydrogen()->is_in_object()) { |
__ ldr(result, FieldMemOperand(object, instr->hydrogen()->offset())); |
@@ -2831,7 +2835,7 @@ void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
void LCodeGen::DoLoadElements(LLoadElements* instr) { |
Register result = ToRegister(instr->result()); |
- Register input = ToRegister(instr->InputAt(0)); |
+ Register input = ToRegister(instr->object()); |
Register scratch = scratch0(); |
__ ldr(result, FieldMemOperand(input, JSObject::kElementsOffset)); |
@@ -2866,7 +2870,7 @@ void LCodeGen::DoLoadElements(LLoadElements* instr) { |
void LCodeGen::DoLoadExternalArrayPointer( |
LLoadExternalArrayPointer* instr) { |
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, |
ExternalArray::kExternalPointerOffset)); |
} |
@@ -3123,7 +3127,7 @@ void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { |
- Register elem = ToRegister(instr->InputAt(0)); |
+ Register elem = ToRegister(instr->elements()); |
Register result = ToRegister(instr->result()); |
Label done; |
@@ -3242,7 +3246,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) { |
void LCodeGen::DoPushArgument(LPushArgument* instr) { |
- LOperand* argument = instr->InputAt(0); |
+ LOperand* argument = instr->value(); |
if (argument->IsDoubleRegister() || argument->IsDoubleStackSlot()) { |
Abort("DoPushArgument not implemented for double type."); |
} else { |
@@ -3294,7 +3298,7 @@ void LCodeGen::DoGlobalObject(LGlobalObject* instr) { |
void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) { |
- Register global = ToRegister(instr->global()); |
+ Register global = ToRegister(instr->global_object()); |
Register result = ToRegister(instr->result()); |
__ ldr(result, FieldMemOperand(global, GlobalObject::kGlobalReceiverOffset)); |
} |
@@ -3354,7 +3358,7 @@ void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) { |
void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) { |
- Register input = ToRegister(instr->InputAt(0)); |
+ Register input = ToRegister(instr->value()); |
Register result = ToRegister(instr->result()); |
Register scratch = scratch0(); |
@@ -3420,7 +3424,7 @@ void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) { |
void LCodeGen::EmitIntegerMathAbs(LUnaryMathOperation* instr) { |
- Register input = ToRegister(instr->InputAt(0)); |
+ Register input = ToRegister(instr->value()); |
Register result = ToRegister(instr->result()); |
__ cmp(input, Operand(0)); |
__ Move(result, input, pl); |
@@ -3450,7 +3454,7 @@ void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) { |
Representation r = instr->hydrogen()->value()->representation(); |
if (r.IsDouble()) { |
- DwVfpRegister input = ToDoubleRegister(instr->InputAt(0)); |
+ DwVfpRegister input = ToDoubleRegister(instr->value()); |
DwVfpRegister result = ToDoubleRegister(instr->result()); |
__ vabs(result, input); |
} else if (r.IsInteger32()) { |
@@ -3459,7 +3463,7 @@ void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) { |
// Representation is tagged. |
DeferredMathAbsTaggedHeapNumber* deferred = |
new(zone()) DeferredMathAbsTaggedHeapNumber(this, instr); |
- Register input = ToRegister(instr->InputAt(0)); |
+ Register input = ToRegister(instr->value()); |
// Smi check. |
__ JumpIfNotSmi(input, deferred->entry()); |
// If smi, handle it directly. |
@@ -3470,11 +3474,11 @@ void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) { |
void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) { |
- DoubleRegister input = ToDoubleRegister(instr->InputAt(0)); |
+ DoubleRegister input = ToDoubleRegister(instr->value()); |
Register result = ToRegister(instr->result()); |
SwVfpRegister single_scratch = double_scratch0().low(); |
Register scratch1 = scratch0(); |
- Register scratch2 = ToRegister(instr->TempAt(0)); |
+ Register scratch2 = ToRegister(instr->temp()); |
__ EmitVFPTruncate(kRoundToMinusInf, |
single_scratch, |
@@ -3500,7 +3504,7 @@ void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) { |
void LCodeGen::DoMathRound(LUnaryMathOperation* instr) { |
- DoubleRegister input = ToDoubleRegister(instr->InputAt(0)); |
+ DoubleRegister input = ToDoubleRegister(instr->value()); |
Register result = ToRegister(instr->result()); |
Register scratch = scratch0(); |
Label done, check_sign_on_zero; |
@@ -3565,16 +3569,16 @@ void LCodeGen::DoMathRound(LUnaryMathOperation* instr) { |
void LCodeGen::DoMathSqrt(LUnaryMathOperation* instr) { |
- DoubleRegister input = ToDoubleRegister(instr->InputAt(0)); |
+ DoubleRegister input = ToDoubleRegister(instr->value()); |
DoubleRegister result = ToDoubleRegister(instr->result()); |
__ vsqrt(result, input); |
} |
void LCodeGen::DoMathPowHalf(LUnaryMathOperation* instr) { |
- DoubleRegister input = ToDoubleRegister(instr->InputAt(0)); |
+ DoubleRegister input = ToDoubleRegister(instr->value()); |
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: |
// Math.pow(-Infinity, 0.5) == Infinity |
@@ -3596,11 +3600,11 @@ void LCodeGen::DoPower(LPower* instr) { |
Representation exponent_type = instr->hydrogen()->right()->representation(); |
// Having marked this as a call, we can use any registers. |
// Just make sure that the input/output registers are the expected ones. |
- ASSERT(!instr->InputAt(1)->IsDoubleRegister() || |
- ToDoubleRegister(instr->InputAt(1)).is(d2)); |
- ASSERT(!instr->InputAt(1)->IsRegister() || |
- ToRegister(instr->InputAt(1)).is(r2)); |
- ASSERT(ToDoubleRegister(instr->InputAt(0)).is(d1)); |
+ ASSERT(!instr->right()->IsDoubleRegister() || |
+ ToDoubleRegister(instr->right()).is(d2)); |
+ ASSERT(!instr->right()->IsRegister() || |
+ ToRegister(instr->right()).is(r2)); |
+ ASSERT(ToDoubleRegister(instr->left()).is(d1)); |
ASSERT(ToDoubleRegister(instr->result()).is(d3)); |
if (exponent_type.IsTagged()) { |
@@ -3640,7 +3644,7 @@ void LCodeGen::DoRandom(LRandom* instr) { |
// Having marked this instruction as a call we can use any |
// registers. |
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_ASSERT(kPointerSize == kSeedSize); |
@@ -3851,7 +3855,7 @@ void LCodeGen::DoCallKnownGlobal(LCallKnownGlobal* 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)); |
CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); |
@@ -3877,7 +3881,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
__ mov(scratch, Operand(instr->transition())); |
__ str(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); |
if (instr->hydrogen()->NeedsWriteBarrierForMap()) { |
- Register temp = ToRegister(instr->TempAt(0)); |
+ Register temp = ToRegister(instr->temp()); |
// Update the write barrier for the map field. |
__ RecordWriteField(object, |
HeapObject::kMapOffset, |
@@ -4155,7 +4159,7 @@ void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { |
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(); |
Handle<Map> from_map = instr->original_map(); |
@@ -4176,7 +4180,7 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { |
scratch, kLRHasBeenSaved, kDontSaveFPRegs); |
} else if (IsFastSmiElementsKind(from_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(new_map_reg.is(r3)); |
__ mov(fixed_object_reg, object_reg); |
@@ -4184,7 +4188,7 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { |
RelocInfo::CODE_TARGET, instr); |
} else if (IsFastDoubleElementsKind(from_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(new_map_reg.is(r3)); |
__ mov(fixed_object_reg, object_reg); |
@@ -4309,14 +4313,14 @@ void LCodeGen::DoDeferredStringCharFromCode(LStringCharFromCode* instr) { |
void LCodeGen::DoStringLength(LStringLength* instr) { |
- Register string = ToRegister(instr->InputAt(0)); |
+ Register string = ToRegister(instr->string()); |
Register result = ToRegister(instr->result()); |
__ ldr(result, FieldMemOperand(string, String::kLengthOffset)); |
} |
void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { |
- LOperand* input = instr->InputAt(0); |
+ LOperand* input = instr->value(); |
ASSERT(input->IsRegister() || input->IsStackSlot()); |
LOperand* output = instr->result(); |
ASSERT(output->IsDoubleRegister()); |
@@ -4333,7 +4337,7 @@ void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { |
void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { |
- LOperand* input = instr->InputAt(0); |
+ LOperand* input = instr->value(); |
LOperand* output = instr->result(); |
SwVfpRegister flt_scratch = double_scratch0().low(); |
@@ -4349,7 +4353,7 @@ void LCodeGen::DoNumberTagI(LNumberTagI* instr) { |
: LDeferredCode(codegen), instr_(instr) { } |
virtual void Generate() { |
codegen()->DoDeferredNumberTagI(instr_, |
- instr_->InputAt(0), |
+ instr_->value(), |
SIGNED_INT32); |
} |
virtual LInstruction* instr() { return instr_; } |
@@ -4357,7 +4361,7 @@ void LCodeGen::DoNumberTagI(LNumberTagI* instr) { |
LNumberTagI* instr_; |
}; |
- Register src = ToRegister(instr->InputAt(0)); |
+ Register src = ToRegister(instr->value()); |
Register dst = ToRegister(instr->result()); |
DeferredNumberTagI* deferred = new(zone()) DeferredNumberTagI(this, instr); |
@@ -4374,7 +4378,7 @@ void LCodeGen::DoNumberTagU(LNumberTagU* instr) { |
: LDeferredCode(codegen), instr_(instr) { } |
virtual void Generate() { |
codegen()->DoDeferredNumberTagI(instr_, |
- instr_->InputAt(0), |
+ instr_->value(), |
UNSIGNED_INT32); |
} |
virtual LInstruction* instr() { return instr_; } |
@@ -4382,7 +4386,7 @@ void LCodeGen::DoNumberTagU(LNumberTagU* instr) { |
LNumberTagU* instr_; |
}; |
- LOperand* input = instr->InputAt(0); |
+ LOperand* input = instr->value(); |
ASSERT(input->IsRegister() && input->Equals(instr->result())); |
Register reg = ToRegister(input); |
@@ -4460,11 +4464,11 @@ void LCodeGen::DoNumberTagD(LNumberTagD* instr) { |
LNumberTagD* instr_; |
}; |
- DoubleRegister input_reg = ToDoubleRegister(instr->InputAt(0)); |
+ DoubleRegister input_reg = ToDoubleRegister(instr->value()); |
Register scratch = scratch0(); |
Register reg = ToRegister(instr->result()); |
- Register temp1 = ToRegister(instr->TempAt(0)); |
- Register temp2 = ToRegister(instr->TempAt(1)); |
+ Register temp1 = ToRegister(instr->temp()); |
+ Register temp2 = ToRegister(instr->temp2()); |
DeferredNumberTagD* deferred = new(zone()) DeferredNumberTagD(this, instr); |
if (FLAG_inline_new) { |
@@ -4494,12 +4498,12 @@ void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { |
void LCodeGen::DoSmiTag(LSmiTag* instr) { |
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) { |
- Register input = ToRegister(instr->InputAt(0)); |
+ Register input = ToRegister(instr->value()); |
Register result = ToRegister(instr->result()); |
if (instr->needs_check()) { |
STATIC_ASSERT(kHeapObjectTag == 1); |
@@ -4571,9 +4575,9 @@ void LCodeGen::EmitNumberUntagD(Register input_reg, |
void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) { |
- Register input_reg = ToRegister(instr->InputAt(0)); |
+ Register input_reg = ToRegister(instr->value()); |
Register scratch1 = scratch0(); |
- Register scratch2 = ToRegister(instr->TempAt(0)); |
+ Register scratch2 = ToRegister(instr->temp()); |
DwVfpRegister double_scratch = double_scratch0(); |
SwVfpRegister single_scratch = double_scratch.low(); |
@@ -4594,8 +4598,8 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) { |
__ cmp(scratch1, Operand(ip)); |
if (instr->truncating()) { |
- Register scratch3 = ToRegister(instr->TempAt(1)); |
- DwVfpRegister double_scratch2 = ToDoubleRegister(instr->TempAt(2)); |
+ Register scratch3 = ToRegister(instr->temp2()); |
+ DwVfpRegister double_scratch2 = ToDoubleRegister(instr->temp3()); |
ASSERT(!scratch3.is(input_reg) && |
!scratch3.is(scratch1) && |
!scratch3.is(scratch2)); |
@@ -4662,7 +4666,7 @@ void LCodeGen::DoTaggedToI(LTaggedToI* instr) { |
LTaggedToI* instr_; |
}; |
- LOperand* input = instr->InputAt(0); |
+ LOperand* input = instr->value(); |
ASSERT(input->IsRegister()); |
ASSERT(input->Equals(instr->result())); |
@@ -4681,7 +4685,7 @@ void LCodeGen::DoTaggedToI(LTaggedToI* instr) { |
void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) { |
- LOperand* input = instr->InputAt(0); |
+ LOperand* input = instr->value(); |
ASSERT(input->IsRegister()); |
LOperand* result = instr->result(); |
ASSERT(result->IsDoubleRegister()); |
@@ -4699,14 +4703,14 @@ void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) { |
void LCodeGen::DoDoubleToI(LDoubleToI* instr) { |
Register result_reg = ToRegister(instr->result()); |
Register scratch1 = scratch0(); |
- Register scratch2 = ToRegister(instr->TempAt(0)); |
- DwVfpRegister double_input = ToDoubleRegister(instr->InputAt(0)); |
+ Register scratch2 = ToRegister(instr->temp()); |
+ DwVfpRegister double_input = ToDoubleRegister(instr->value()); |
SwVfpRegister single_scratch = double_scratch0().low(); |
Label done; |
if (instr->truncating()) { |
- Register scratch3 = ToRegister(instr->TempAt(1)); |
+ Register scratch3 = ToRegister(instr->temp2()); |
__ EmitECMATruncate(result_reg, |
double_input, |
single_scratch, |
@@ -4732,21 +4736,21 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) { |
void LCodeGen::DoCheckSmi(LCheckSmi* instr) { |
- LOperand* input = instr->InputAt(0); |
+ LOperand* input = instr->value(); |
__ tst(ToRegister(input), Operand(kSmiTagMask)); |
DeoptimizeIf(ne, instr->environment()); |
} |
void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { |
- LOperand* input = instr->InputAt(0); |
+ LOperand* input = instr->value(); |
__ tst(ToRegister(input), Operand(kSmiTagMask)); |
DeoptimizeIf(eq, instr->environment()); |
} |
void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { |
- Register input = ToRegister(instr->InputAt(0)); |
+ Register input = ToRegister(instr->value()); |
Register scratch = scratch0(); |
__ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); |
@@ -4819,7 +4823,7 @@ void LCodeGen::DoCheckMapCommon(Register reg, |
void LCodeGen::DoCheckMaps(LCheckMaps* instr) { |
Register scratch = scratch0(); |
- LOperand* input = instr->InputAt(0); |
+ LOperand* input = instr->value(); |
ASSERT(input->IsRegister()); |
Register reg = ToRegister(input); |
@@ -4839,7 +4843,7 @@ void LCodeGen::DoCheckMaps(LCheckMaps* instr) { |
void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { |
DoubleRegister value_reg = ToDoubleRegister(instr->unclamped()); |
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); |
} |
@@ -4855,7 +4859,7 @@ void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) { |
Register scratch = scratch0(); |
Register input_reg = ToRegister(instr->unclamped()); |
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; |
// Both smi and heap number cases are handled. |
@@ -4889,8 +4893,8 @@ void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) { |
void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
- Register temp1 = ToRegister(instr->TempAt(0)); |
- Register temp2 = ToRegister(instr->TempAt(1)); |
+ Register temp1 = ToRegister(instr->temp()); |
+ Register temp2 = ToRegister(instr->temp2()); |
Handle<JSObject> holder = instr->holder(); |
Handle<JSObject> current_prototype = instr->prototype(); |
@@ -4932,8 +4936,8 @@ void LCodeGen::DoAllocateObject(LAllocateObject* instr) { |
new(zone()) DeferredAllocateObject(this, instr); |
Register result = ToRegister(instr->result()); |
- Register scratch = ToRegister(instr->TempAt(0)); |
- Register scratch2 = ToRegister(instr->TempAt(1)); |
+ Register scratch = ToRegister(instr->temp()); |
+ Register scratch2 = ToRegister(instr->temp2()); |
Handle<JSFunction> constructor = instr->hydrogen()->constructor(); |
Handle<Map> initial_map(constructor->initial_map()); |
int instance_size = initial_map->instance_size(); |
@@ -5225,7 +5229,7 @@ void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) { |
void LCodeGen::DoToFastProperties(LToFastProperties* instr) { |
- ASSERT(ToRegister(instr->InputAt(0)).is(r0)); |
+ ASSERT(ToRegister(instr->value()).is(r0)); |
__ push(r0); |
CallRuntime(Runtime::kToFastProperties, 1, instr); |
} |
@@ -5306,14 +5310,14 @@ void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { |
void LCodeGen::DoTypeof(LTypeof* instr) { |
- Register input = ToRegister(instr->InputAt(0)); |
+ Register input = ToRegister(instr->value()); |
__ push(input); |
CallRuntime(Runtime::kTypeof, 1, 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 false_block = chunk_->LookupDestination(instr->false_block_id()); |
Label* true_label = chunk_->GetAssemblyLabel(true_block); |
@@ -5403,7 +5407,7 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label, |
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 false_block = chunk_->LookupDestination(instr->false_block_id()); |