Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index da17e297637f01656e5f7708be1aebf376ff2bfb..33efdd89e1dce0c9fcea673f3b5ff3ed8feb61ac 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -404,9 +404,7 @@ Operand LCodeGen::HighOperand(LOperand* op) { |
void LCodeGen::WriteTranslation(LEnvironment* environment, |
- Translation* translation, |
- int* arguments_index, |
- int* arguments_count) { |
+ Translation* translation) { |
if (environment == NULL) return; |
// The translation includes one command per value in the environment. |
@@ -414,17 +412,7 @@ void LCodeGen::WriteTranslation(LEnvironment* environment, |
// The output frame height does not include the parameters. |
int height = translation_size - environment->parameter_count(); |
- // Function parameters are arguments to the outermost environment. The |
- // arguments index points to the first element of a sequence of tagged |
- // values on the stack that represent the arguments. This needs to be |
- // kept in sync with the LArgumentsElements implementation. |
- *arguments_index = -environment->parameter_count(); |
- *arguments_count = environment->parameter_count(); |
- |
- WriteTranslation(environment->outer(), |
- translation, |
- arguments_index, |
- arguments_count); |
+ WriteTranslation(environment->outer(), translation); |
int closure_id = *info()->closure() != *environment->closure() |
? DefineDeoptimizationLiteral(environment->closure()) |
: Translation::kSelfLiteralId; |
@@ -449,17 +437,6 @@ void LCodeGen::WriteTranslation(LEnvironment* environment, |
translation->BeginArgumentsAdaptorFrame(closure_id, translation_size); |
break; |
} |
- |
- // Inlined frames which push their arguments cause the index to be |
- // bumped and another stack area to be used for materialization. |
- if (environment->entry() != NULL && |
- environment->entry()->arguments_pushed()) { |
- *arguments_index = *arguments_index < 0 |
- ? GetStackSlotCount() |
- : *arguments_index + *arguments_count; |
- *arguments_count = environment->entry()->arguments_count() + 1; |
- } |
- |
for (int i = 0; i < translation_size; ++i) { |
LOperand* value = environment->values()->at(i); |
// spilled_registers_ and spilled_double_registers_ are either |
@@ -471,9 +448,7 @@ void LCodeGen::WriteTranslation(LEnvironment* environment, |
AddToTranslation(translation, |
environment->spilled_registers()[value->index()], |
environment->HasTaggedValueAt(i), |
- environment->HasUint32ValueAt(i), |
- *arguments_index, |
- *arguments_count); |
+ environment->HasUint32ValueAt(i)); |
} else if ( |
value->IsDoubleRegister() && |
environment->spilled_double_registers()[value->index()] != NULL) { |
@@ -482,18 +457,14 @@ void LCodeGen::WriteTranslation(LEnvironment* environment, |
translation, |
environment->spilled_double_registers()[value->index()], |
false, |
- false, |
- *arguments_index, |
- *arguments_count); |
+ false); |
} |
} |
AddToTranslation(translation, |
value, |
environment->HasTaggedValueAt(i), |
- environment->HasUint32ValueAt(i), |
- *arguments_index, |
- *arguments_count); |
+ environment->HasUint32ValueAt(i)); |
} |
} |
@@ -501,14 +472,12 @@ void LCodeGen::WriteTranslation(LEnvironment* environment, |
void LCodeGen::AddToTranslation(Translation* translation, |
LOperand* op, |
bool is_tagged, |
- bool is_uint32, |
- int arguments_index, |
- int arguments_count) { |
+ bool is_uint32) { |
if (op == NULL) { |
// TODO(twuerthinger): Introduce marker operands to indicate that this value |
// is not present and must be reconstructed from the deoptimizer. Currently |
// this is only used for the arguments object. |
- translation->StoreArgumentsObject(arguments_index, arguments_count); |
+ translation->StoreArgumentsObject(); |
} else if (op->IsStackSlot()) { |
if (is_tagged) { |
translation->StoreStackSlot(op->index()); |
@@ -627,16 +596,15 @@ void LCodeGen::RegisterEnvironmentForDeoptimization( |
int frame_count = 0; |
int jsframe_count = 0; |
- int args_index = 0; |
- int args_count = 0; |
for (LEnvironment* e = environment; e != NULL; e = e->outer()) { |
++frame_count; |
if (e->frame_type() == JS_FUNCTION) { |
++jsframe_count; |
} |
} |
- Translation translation(&translations_, frame_count, jsframe_count, zone()); |
- WriteTranslation(environment, &translation, &args_index, &args_count); |
+ Translation translation(&translations_, frame_count, jsframe_count, |
+ zone()); |
+ WriteTranslation(environment, &translation); |
int deoptimization_index = deoptimizations_.length(); |
int pc_offset = masm()->pc_offset(); |
environment->Register(deoptimization_index, |
@@ -909,7 +877,7 @@ void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { |
void LCodeGen::DoModI(LModI* instr) { |
if (instr->hydrogen()->HasPowerOf2Divisor()) { |
- Register dividend = ToRegister(instr->left()); |
+ Register dividend = ToRegister(instr->InputAt(0)); |
int32_t divisor = |
HConstant::cast(instr->hydrogen()->right())->Integer32Value(); |
@@ -933,8 +901,8 @@ void LCodeGen::DoModI(LModI* instr) { |
__ bind(&done); |
} else { |
Label done, remainder_eq_dividend, slow, do_subtraction, both_positive; |
- Register left_reg = ToRegister(instr->left()); |
- Register right_reg = ToRegister(instr->right()); |
+ Register left_reg = ToRegister(instr->InputAt(0)); |
+ Register right_reg = ToRegister(instr->InputAt(1)); |
Register result_reg = ToRegister(instr->result()); |
ASSERT(left_reg.is(eax)); |
@@ -964,7 +932,7 @@ void LCodeGen::DoModI(LModI* instr) { |
__ j(less, &remainder_eq_dividend, Label::kNear); |
// Check if the divisor is a PowerOfTwo integer. |
- Register scratch = ToRegister(instr->temp()); |
+ Register scratch = ToRegister(instr->TempAt(0)); |
__ mov(scratch, right_reg); |
__ sub(Operand(scratch), Immediate(1)); |
__ test(scratch, Operand(right_reg)); |
@@ -1020,11 +988,11 @@ void LCodeGen::DoModI(LModI* instr) { |
void LCodeGen::DoDivI(LDivI* instr) { |
- LOperand* right = instr->right(); |
+ LOperand* right = instr->InputAt(1); |
ASSERT(ToRegister(instr->result()).is(eax)); |
- ASSERT(ToRegister(instr->left()).is(eax)); |
- ASSERT(!ToRegister(instr->right()).is(eax)); |
- ASSERT(!ToRegister(instr->right()).is(edx)); |
+ ASSERT(ToRegister(instr->InputAt(0)).is(eax)); |
+ ASSERT(!ToRegister(instr->InputAt(1)).is(eax)); |
+ ASSERT(!ToRegister(instr->InputAt(1)).is(edx)); |
Register left_reg = eax; |
@@ -1066,10 +1034,10 @@ void LCodeGen::DoDivI(LDivI* instr) { |
void LCodeGen::DoMathFloorOfDiv(LMathFloorOfDiv* instr) { |
- ASSERT(instr->right()->IsConstantOperand()); |
+ ASSERT(instr->InputAt(1)->IsConstantOperand()); |
- Register dividend = ToRegister(instr->left()); |
- int32_t divisor = ToInteger32(LConstantOperand::cast(instr->right())); |
+ Register dividend = ToRegister(instr->InputAt(0)); |
+ int32_t divisor = ToInteger32(LConstantOperand::cast(instr->InputAt(1))); |
Register result = ToRegister(instr->result()); |
switch (divisor) { |
@@ -1115,9 +1083,9 @@ void LCodeGen::DoMathFloorOfDiv(LMathFloorOfDiv* instr) { |
__ sar(result, power); |
} |
} else { |
- ASSERT(ToRegister(instr->left()).is(eax)); |
+ ASSERT(ToRegister(instr->InputAt(0)).is(eax)); |
ASSERT(ToRegister(instr->result()).is(edx)); |
- Register scratch = ToRegister(instr->temp()); |
+ Register scratch = ToRegister(instr->TempAt(0)); |
// Find b which: 2^b < divisor_abs < 2^(b+1). |
unsigned b = 31 - CompilerIntrinsics::CountLeadingZeros(divisor_abs); |
@@ -1169,11 +1137,11 @@ void LCodeGen::DoMathFloorOfDiv(LMathFloorOfDiv* instr) { |
void LCodeGen::DoMulI(LMulI* instr) { |
- Register left = ToRegister(instr->left()); |
- LOperand* right = instr->right(); |
+ Register left = ToRegister(instr->InputAt(0)); |
+ LOperand* right = instr->InputAt(1); |
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
- __ mov(ToRegister(instr->temp()), left); |
+ __ mov(ToRegister(instr->TempAt(0)), left); |
} |
if (right->IsConstantOperand()) { |
@@ -1234,15 +1202,12 @@ void LCodeGen::DoMulI(LMulI* instr) { |
__ test(left, Operand(left)); |
__ j(not_zero, &done, Label::kNear); |
if (right->IsConstantOperand()) { |
- if (ToInteger32(LConstantOperand::cast(right)) < 0) { |
+ if (ToInteger32(LConstantOperand::cast(right)) <= 0) { |
DeoptimizeIf(no_condition, instr->environment()); |
- } else if (ToInteger32(LConstantOperand::cast(right)) == 0) { |
- __ cmp(ToRegister(instr->temp()), Immediate(0)); |
- DeoptimizeIf(less, instr->environment()); |
} |
} else { |
// Test the non-zero operand for negative sign. |
- __ or_(ToRegister(instr->temp()), ToOperand(right)); |
+ __ or_(ToRegister(instr->TempAt(0)), ToOperand(right)); |
DeoptimizeIf(sign, instr->environment()); |
} |
__ bind(&done); |
@@ -1251,8 +1216,8 @@ void LCodeGen::DoMulI(LMulI* instr) { |
void LCodeGen::DoBitI(LBitI* instr) { |
- LOperand* left = instr->left(); |
- LOperand* right = instr->right(); |
+ LOperand* left = instr->InputAt(0); |
+ LOperand* right = instr->InputAt(1); |
ASSERT(left->Equals(instr->result())); |
ASSERT(left->IsRegister()); |
@@ -1292,8 +1257,8 @@ void LCodeGen::DoBitI(LBitI* instr) { |
void LCodeGen::DoShiftI(LShiftI* instr) { |
- LOperand* left = instr->left(); |
- LOperand* right = instr->right(); |
+ LOperand* left = instr->InputAt(0); |
+ LOperand* right = instr->InputAt(1); |
ASSERT(left->Equals(instr->result())); |
ASSERT(left->IsRegister()); |
if (right->IsRegister()) { |
@@ -1348,8 +1313,8 @@ void LCodeGen::DoShiftI(LShiftI* instr) { |
void LCodeGen::DoSubI(LSubI* instr) { |
- LOperand* left = instr->left(); |
- LOperand* right = instr->right(); |
+ LOperand* left = instr->InputAt(0); |
+ LOperand* right = instr->InputAt(1); |
ASSERT(left->Equals(instr->result())); |
if (right->IsConstantOperand()) { |
@@ -1378,7 +1343,7 @@ void LCodeGen::DoConstantD(LConstantD* instr) { |
if (BitCast<uint64_t, double>(v) == 0) { |
__ xorps(res, res); |
} else { |
- Register temp = ToRegister(instr->temp()); |
+ Register temp = ToRegister(instr->TempAt(0)); |
uint64_t int_val = BitCast<uint64_t, double>(v); |
int32_t lower = static_cast<int32_t>(int_val); |
int32_t upper = static_cast<int32_t>(int_val >> (kBitsPerInt)); |
@@ -1421,7 +1386,7 @@ void LCodeGen::DoConstantT(LConstantT* instr) { |
void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { |
Register result = ToRegister(instr->result()); |
- Register array = ToRegister(instr->value()); |
+ Register array = ToRegister(instr->InputAt(0)); |
__ mov(result, FieldOperand(array, JSArray::kLengthOffset)); |
} |
@@ -1429,21 +1394,21 @@ void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { |
void LCodeGen::DoFixedArrayBaseLength( |
LFixedArrayBaseLength* instr) { |
Register result = ToRegister(instr->result()); |
- Register array = ToRegister(instr->value()); |
+ Register array = ToRegister(instr->InputAt(0)); |
__ mov(result, FieldOperand(array, FixedArrayBase::kLengthOffset)); |
} |
void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { |
Register result = ToRegister(instr->result()); |
- Register map = ToRegister(instr->value()); |
+ Register map = ToRegister(instr->InputAt(0)); |
__ EnumLength(result, map); |
} |
void LCodeGen::DoElementsKind(LElementsKind* instr) { |
Register result = ToRegister(instr->result()); |
- Register input = ToRegister(instr->value()); |
+ Register input = ToRegister(instr->InputAt(0)); |
// Load map into |result|. |
__ mov(result, FieldOperand(input, HeapObject::kMapOffset)); |
@@ -1457,9 +1422,9 @@ void LCodeGen::DoElementsKind(LElementsKind* instr) { |
void LCodeGen::DoValueOf(LValueOf* instr) { |
- Register input = ToRegister(instr->value()); |
+ Register input = ToRegister(instr->InputAt(0)); |
Register result = ToRegister(instr->result()); |
- Register map = ToRegister(instr->temp()); |
+ Register map = ToRegister(instr->TempAt(0)); |
ASSERT(input.is(result)); |
Label done; |
@@ -1476,9 +1441,9 @@ void LCodeGen::DoValueOf(LValueOf* instr) { |
void LCodeGen::DoDateField(LDateField* instr) { |
- Register object = ToRegister(instr->date()); |
+ Register object = ToRegister(instr->InputAt(0)); |
Register result = ToRegister(instr->result()); |
- Register scratch = ToRegister(instr->temp()); |
+ Register scratch = ToRegister(instr->TempAt(0)); |
Smi* index = instr->index(); |
Label runtime, done; |
ASSERT(object.is(result)); |
@@ -1512,7 +1477,7 @@ void LCodeGen::DoDateField(LDateField* instr) { |
void LCodeGen::DoBitNotI(LBitNotI* instr) { |
- LOperand* input = instr->value(); |
+ LOperand* input = instr->InputAt(0); |
ASSERT(input->Equals(instr->result())); |
__ not_(ToRegister(input)); |
} |
@@ -1531,8 +1496,8 @@ void LCodeGen::DoThrow(LThrow* instr) { |
void LCodeGen::DoAddI(LAddI* instr) { |
- LOperand* left = instr->left(); |
- LOperand* right = instr->right(); |
+ LOperand* left = instr->InputAt(0); |
+ LOperand* right = instr->InputAt(1); |
ASSERT(left->Equals(instr->result())); |
if (right->IsConstantOperand()) { |
@@ -1548,8 +1513,8 @@ void LCodeGen::DoAddI(LAddI* instr) { |
void LCodeGen::DoMathMinMax(LMathMinMax* instr) { |
- LOperand* left = instr->left(); |
- LOperand* right = instr->right(); |
+ LOperand* left = instr->InputAt(0); |
+ LOperand* right = instr->InputAt(1); |
ASSERT(left->Equals(instr->result())); |
HMathMinMax::Operation operation = instr->hydrogen()->operation(); |
if (instr->hydrogen()->representation().IsInteger32()) { |
@@ -1609,8 +1574,8 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) { |
void LCodeGen::DoArithmeticD(LArithmeticD* instr) { |
- XMMRegister left = ToDoubleRegister(instr->left()); |
- XMMRegister right = ToDoubleRegister(instr->right()); |
+ XMMRegister left = ToDoubleRegister(instr->InputAt(0)); |
+ XMMRegister right = ToDoubleRegister(instr->InputAt(1)); |
XMMRegister result = ToDoubleRegister(instr->result()); |
// Modulo uses a fixed result register. |
ASSERT(instr->op() == Token::MOD || left.is(result)); |
@@ -1696,17 +1661,17 @@ void LCodeGen::DoBranch(LBranch* instr) { |
Representation r = instr->hydrogen()->value()->representation(); |
if (r.IsInteger32()) { |
- Register reg = ToRegister(instr->value()); |
+ Register reg = ToRegister(instr->InputAt(0)); |
__ test(reg, Operand(reg)); |
EmitBranch(true_block, false_block, not_zero); |
} else if (r.IsDouble()) { |
- XMMRegister reg = ToDoubleRegister(instr->value()); |
+ XMMRegister reg = ToDoubleRegister(instr->InputAt(0)); |
__ xorps(xmm0, xmm0); |
__ ucomisd(reg, xmm0); |
EmitBranch(true_block, false_block, not_equal); |
} else { |
ASSERT(r.IsTagged()); |
- Register reg = ToRegister(instr->value()); |
+ Register reg = ToRegister(instr->InputAt(0)); |
HType type = instr->hydrogen()->value()->type(); |
if (type.IsBoolean()) { |
__ cmp(reg, factory()->true_value()); |
@@ -1754,7 +1719,7 @@ void LCodeGen::DoBranch(LBranch* instr) { |
Register map = no_reg; // Keep the compiler happy. |
if (expected.NeedsMap()) { |
- map = ToRegister(instr->temp()); |
+ map = ToRegister(instr->TempAt(0)); |
ASSERT(!map.is(reg)); |
__ mov(map, FieldOperand(reg, HeapObject::kMapOffset)); |
@@ -1847,8 +1812,8 @@ Condition LCodeGen::TokenToCondition(Token::Value op, bool is_unsigned) { |
void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) { |
- LOperand* left = instr->left(); |
- LOperand* right = instr->right(); |
+ LOperand* left = instr->InputAt(0); |
+ LOperand* right = instr->InputAt(1); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
Condition cc = TokenToCondition(instr->op(), instr->is_double()); |
@@ -1884,8 +1849,8 @@ void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) { |
void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) { |
- Register left = ToRegister(instr->left()); |
- Operand right = ToOperand(instr->right()); |
+ Register left = ToRegister(instr->InputAt(0)); |
+ Operand right = ToOperand(instr->InputAt(1)); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
@@ -1895,7 +1860,7 @@ void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) { |
void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) { |
- Register left = ToRegister(instr->left()); |
+ Register left = ToRegister(instr->InputAt(0)); |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
@@ -1905,7 +1870,7 @@ void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) { |
void LCodeGen::DoIsNilAndBranch(LIsNilAndBranch* instr) { |
- Register reg = ToRegister(instr->value()); |
+ Register reg = ToRegister(instr->InputAt(0)); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
// If the expression is known to be untagged or a smi, then it's definitely |
@@ -1935,7 +1900,7 @@ void LCodeGen::DoIsNilAndBranch(LIsNilAndBranch* instr) { |
__ JumpIfSmi(reg, false_label); |
// Check for undetectable objects by looking in the bit field in |
// the map. The object has already been smi checked. |
- Register scratch = ToRegister(instr->temp()); |
+ Register scratch = ToRegister(instr->TempAt(0)); |
__ mov(scratch, FieldOperand(reg, HeapObject::kMapOffset)); |
__ movzx_b(scratch, FieldOperand(scratch, Map::kBitFieldOffset)); |
__ test(scratch, Immediate(1 << Map::kIsUndetectable)); |
@@ -1968,8 +1933,8 @@ Condition LCodeGen::EmitIsObject(Register input, |
void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) { |
- Register reg = ToRegister(instr->value()); |
- Register temp = ToRegister(instr->temp()); |
+ Register reg = ToRegister(instr->InputAt(0)); |
+ Register temp = ToRegister(instr->TempAt(0)); |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
@@ -1994,8 +1959,8 @@ Condition LCodeGen::EmitIsString(Register input, |
void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) { |
- Register reg = ToRegister(instr->value()); |
- Register temp = ToRegister(instr->temp()); |
+ Register reg = ToRegister(instr->InputAt(0)); |
+ Register temp = ToRegister(instr->TempAt(0)); |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
@@ -2008,7 +1973,7 @@ void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) { |
void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { |
- Operand input = ToOperand(instr->value()); |
+ Operand input = ToOperand(instr->InputAt(0)); |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
@@ -2019,8 +1984,8 @@ void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { |
void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) { |
- Register input = ToRegister(instr->value()); |
- Register temp = ToRegister(instr->temp()); |
+ Register input = ToRegister(instr->InputAt(0)); |
+ Register temp = ToRegister(instr->TempAt(0)); |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
@@ -2090,8 +2055,8 @@ static Condition BranchCondition(HHasInstanceTypeAndBranch* instr) { |
void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { |
- Register input = ToRegister(instr->value()); |
- Register temp = ToRegister(instr->temp()); |
+ Register input = ToRegister(instr->InputAt(0)); |
+ Register temp = ToRegister(instr->TempAt(0)); |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
@@ -2106,7 +2071,7 @@ void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { |
void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { |
- Register input = ToRegister(instr->value()); |
+ Register input = ToRegister(instr->InputAt(0)); |
Register result = ToRegister(instr->result()); |
__ AbortIfNotString(input); |
@@ -2118,7 +2083,7 @@ void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { |
void LCodeGen::DoHasCachedArrayIndexAndBranch( |
LHasCachedArrayIndexAndBranch* instr) { |
- Register input = ToRegister(instr->value()); |
+ Register input = ToRegister(instr->InputAt(0)); |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
@@ -2195,9 +2160,9 @@ void LCodeGen::EmitClassOfTest(Label* is_true, |
void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) { |
- Register input = ToRegister(instr->value()); |
- Register temp = ToRegister(instr->temp()); |
- Register temp2 = ToRegister(instr->temp2()); |
+ Register input = ToRegister(instr->InputAt(0)); |
+ Register temp = ToRegister(instr->TempAt(0)); |
+ Register temp2 = ToRegister(instr->TempAt(1)); |
Handle<String> class_name = instr->hydrogen()->class_name(); |
@@ -2214,7 +2179,7 @@ void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) { |
void LCodeGen::DoCmpMapAndBranch(LCmpMapAndBranch* instr) { |
- Register reg = ToRegister(instr->value()); |
+ Register reg = ToRegister(instr->InputAt(0)); |
int true_block = instr->true_block_id(); |
int false_block = instr->false_block_id(); |
@@ -2260,8 +2225,8 @@ void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { |
deferred = new(zone()) DeferredInstanceOfKnownGlobal(this, instr); |
Label done, false_result; |
- Register object = ToRegister(instr->value()); |
- Register temp = ToRegister(instr->temp()); |
+ Register object = ToRegister(instr->InputAt(1)); |
+ Register temp = ToRegister(instr->TempAt(0)); |
// A Smi is not an instance of anything. |
__ JumpIfSmi(object, &false_result); |
@@ -2270,7 +2235,7 @@ void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { |
// hole value will be patched to the last map/result pair generated by the |
// instanceof stub. |
Label cache_miss; |
- Register map = ToRegister(instr->temp()); |
+ Register map = ToRegister(instr->TempAt(0)); |
__ mov(map, FieldOperand(object, HeapObject::kMapOffset)); |
__ bind(deferred->map_check()); // Label for calculating code patching. |
Handle<JSGlobalPropertyCell> cache_cell = |
@@ -2321,7 +2286,7 @@ void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, |
// register which is pushed last by PushSafepointRegisters as top of the |
// stack is used to pass the offset to the location of the map check to |
// the stub. |
- Register temp = ToRegister(instr->temp()); |
+ Register temp = ToRegister(instr->TempAt(0)); |
ASSERT(MacroAssembler::SafepointRegisterStackIndex(temp) == 0); |
__ LoadHeapObject(InstanceofStub::right(), instr->function()); |
static const int kAdditionalDelta = 13; |
@@ -2488,7 +2453,7 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
HType type = instr->hydrogen()->value()->type(); |
SmiCheck check_needed = |
type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
- Register temp = ToRegister(instr->temp()); |
+ Register temp = ToRegister(instr->TempAt(0)); |
int offset = Context::SlotOffset(instr->slot_index()); |
__ RecordWriteContextSlot(context, |
offset, |
@@ -2653,7 +2618,7 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
Register function = ToRegister(instr->function()); |
- Register temp = ToRegister(instr->temp()); |
+ Register temp = ToRegister(instr->TempAt(0)); |
Register result = ToRegister(instr->result()); |
// Check that the function really is a function. |
@@ -2695,7 +2660,7 @@ void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
void LCodeGen::DoLoadElements(LLoadElements* instr) { |
Register result = ToRegister(instr->result()); |
- Register input = ToRegister(instr->object()); |
+ Register input = ToRegister(instr->InputAt(0)); |
__ mov(result, FieldOperand(input, JSObject::kElementsOffset)); |
if (FLAG_debug_code) { |
Label done, ok, fail; |
@@ -2731,7 +2696,7 @@ void LCodeGen::DoLoadElements(LLoadElements* instr) { |
void LCodeGen::DoLoadExternalArrayPointer( |
LLoadExternalArrayPointer* instr) { |
Register result = ToRegister(instr->result()); |
- Register input = ToRegister(instr->object()); |
+ Register input = ToRegister(instr->InputAt(0)); |
__ mov(result, FieldOperand(input, |
ExternalArray::kExternalPointerOffset)); |
} |
@@ -2944,7 +2909,7 @@ void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { |
- Operand elem = ToOperand(instr->elements()); |
+ Operand elem = ToOperand(instr->InputAt(0)); |
Register result = ToRegister(instr->result()); |
Label done; |
@@ -2968,7 +2933,7 @@ void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { |
void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) { |
Register receiver = ToRegister(instr->receiver()); |
Register function = ToRegister(instr->function()); |
- Register scratch = ToRegister(instr->temp()); |
+ Register scratch = ToRegister(instr->TempAt(0)); |
// If the receiver is null or undefined, we have to pass the global |
// object as a receiver to normal functions. Values have to be |
@@ -2981,12 +2946,12 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) { |
FieldOperand(function, JSFunction::kSharedFunctionInfoOffset)); |
__ test_b(FieldOperand(scratch, SharedFunctionInfo::kStrictModeByteOffset), |
1 << SharedFunctionInfo::kStrictModeBitWithinByte); |
- __ j(not_equal, &receiver_ok); // A near jump is not sufficient here! |
+ __ j(not_equal, &receiver_ok, Label::kNear); |
// Do not transform the receiver to object for builtins. |
__ test_b(FieldOperand(scratch, SharedFunctionInfo::kNativeByteOffset), |
1 << SharedFunctionInfo::kNativeBitWithinByte); |
- __ j(not_equal, &receiver_ok); |
+ __ j(not_equal, &receiver_ok, Label::kNear); |
// Normal function. Replace undefined or null with global receiver. |
__ cmp(receiver, factory()->null_value()); |
@@ -3056,7 +3021,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) { |
void LCodeGen::DoPushArgument(LPushArgument* instr) { |
- LOperand* argument = instr->value(); |
+ LOperand* argument = instr->InputAt(0); |
EmitPushTaggedOperand(argument); |
} |
@@ -3087,7 +3052,7 @@ void LCodeGen::DoOuterContext(LOuterContext* instr) { |
void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { |
- ASSERT(ToRegister(instr->context()).is(esi)); |
+ ASSERT(ToRegister(instr->InputAt(0)).is(esi)); |
__ push(esi); // The context is the first argument. |
__ push(Immediate(instr->hydrogen()->pairs())); |
__ push(Immediate(Smi::FromInt(instr->hydrogen()->flags()))); |
@@ -3420,11 +3385,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->right()->IsDoubleRegister() || |
- ToDoubleRegister(instr->right()).is(xmm1)); |
- ASSERT(!instr->right()->IsRegister() || |
- ToRegister(instr->right()).is(eax)); |
- ASSERT(ToDoubleRegister(instr->left()).is(xmm2)); |
+ ASSERT(!instr->InputAt(1)->IsDoubleRegister() || |
+ ToDoubleRegister(instr->InputAt(1)).is(xmm1)); |
+ ASSERT(!instr->InputAt(1)->IsRegister() || |
+ ToRegister(instr->InputAt(1)).is(eax)); |
+ ASSERT(ToDoubleRegister(instr->InputAt(0)).is(xmm2)); |
ASSERT(ToDoubleRegister(instr->result()).is(xmm3)); |
if (exponent_type.IsTagged()) { |
@@ -3462,7 +3427,7 @@ void LCodeGen::DoRandom(LRandom* instr) { |
// Having marked this instruction as a call we can use any |
// registers. |
ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); |
- ASSERT(ToRegister(instr->global_object()).is(eax)); |
+ ASSERT(ToRegister(instr->InputAt(0)).is(eax)); |
// Assert that the register size is indeed the size of each seed. |
static const int kSeedSize = sizeof(uint32_t); |
STATIC_ASSERT(kPointerSize == kSeedSize); |
@@ -3719,8 +3684,8 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
if (!instr->hydrogen()->NeedsWriteBarrierForMap()) { |
__ mov(FieldOperand(object, HeapObject::kMapOffset), instr->transition()); |
} else { |
- Register temp = ToRegister(instr->temp()); |
- Register temp_map = ToRegister(instr->temp_map()); |
+ Register temp = ToRegister(instr->TempAt(0)); |
+ Register temp_map = ToRegister(instr->TempAt(1)); |
__ mov(temp_map, instr->transition()); |
__ mov(FieldOperand(object, HeapObject::kMapOffset), temp_map); |
// Update the write barrier for the map field. |
@@ -3741,7 +3706,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
if (instr->is_in_object()) { |
__ mov(FieldOperand(object, offset), value); |
if (instr->hydrogen()->NeedsWriteBarrier()) { |
- Register temp = ToRegister(instr->temp()); |
+ Register temp = ToRegister(instr->TempAt(0)); |
// Update the write barrier for the object for in-object properties. |
__ RecordWriteField(object, |
offset, |
@@ -3752,7 +3717,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
check_needed); |
} |
} else { |
- Register temp = ToRegister(instr->temp()); |
+ Register temp = ToRegister(instr->TempAt(0)); |
__ mov(temp, FieldOperand(object, JSObject::kPropertiesOffset)); |
__ mov(FieldOperand(temp, offset), value); |
if (instr->hydrogen()->NeedsWriteBarrier()) { |
@@ -3948,7 +3913,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_temp()); |
+ Register new_map_reg = ToRegister(instr->new_map_reg()); |
Handle<Map> from_map = instr->original_map(); |
Handle<Map> to_map = instr->transitioned_map(); |
@@ -3968,14 +3933,14 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { |
__ mov(FieldOperand(object_reg, HeapObject::kMapOffset), |
Immediate(map)); |
// Write barrier. |
- ASSERT_NE(instr->temp(), NULL); |
+ ASSERT_NE(instr->temp_reg(), NULL); |
__ RecordWriteForMap(object_reg, to_map, new_map_reg, |
- ToRegister(instr->temp()), |
+ ToRegister(instr->temp_reg()), |
kDontSaveFPRegs); |
} else if (IsFastSmiElementsKind(from_kind) && |
IsFastDoubleElementsKind(to_kind)) { |
__ mov(new_map_reg, to_map); |
- Register fixed_object_reg = ToRegister(instr->temp()); |
+ Register fixed_object_reg = ToRegister(instr->temp_reg()); |
ASSERT(fixed_object_reg.is(edx)); |
ASSERT(new_map_reg.is(ebx)); |
__ mov(fixed_object_reg, object_reg); |
@@ -3984,7 +3949,7 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { |
} else if (IsFastDoubleElementsKind(from_kind) && |
IsFastObjectElementsKind(to_kind)) { |
__ mov(new_map_reg, to_map); |
- Register fixed_object_reg = ToRegister(instr->temp()); |
+ Register fixed_object_reg = ToRegister(instr->temp_reg()); |
ASSERT(fixed_object_reg.is(edx)); |
ASSERT(new_map_reg.is(ebx)); |
__ mov(fixed_object_reg, object_reg); |
@@ -4117,7 +4082,7 @@ void LCodeGen::DoStringAdd(LStringAdd* instr) { |
void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { |
- LOperand* input = instr->value(); |
+ LOperand* input = instr->InputAt(0); |
ASSERT(input->IsRegister() || input->IsStackSlot()); |
LOperand* output = instr->result(); |
ASSERT(output->IsDoubleRegister()); |
@@ -4126,9 +4091,9 @@ void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) { |
void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { |
- LOperand* input = instr->value(); |
+ LOperand* input = instr->InputAt(0); |
LOperand* output = instr->result(); |
- LOperand* temp = instr->temp(); |
+ LOperand* temp = instr->TempAt(0); |
__ LoadUint32(ToDoubleRegister(output), |
ToRegister(input), |
@@ -4142,14 +4107,16 @@ void LCodeGen::DoNumberTagI(LNumberTagI* instr) { |
DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) |
: LDeferredCode(codegen), instr_(instr) { } |
virtual void Generate() { |
- codegen()->DoDeferredNumberTagI(instr_, instr_->value(), SIGNED_INT32); |
+ codegen()->DoDeferredNumberTagI(instr_, |
+ instr_->InputAt(0), |
+ SIGNED_INT32); |
} |
virtual LInstruction* instr() { return instr_; } |
private: |
LNumberTagI* instr_; |
}; |
- LOperand* input = instr->value(); |
+ LOperand* input = instr->InputAt(0); |
ASSERT(input->IsRegister() && input->Equals(instr->result())); |
Register reg = ToRegister(input); |
@@ -4166,14 +4133,16 @@ void LCodeGen::DoNumberTagU(LNumberTagU* instr) { |
DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr) |
: LDeferredCode(codegen), instr_(instr) { } |
virtual void Generate() { |
- codegen()->DoDeferredNumberTagI(instr_, instr_->value(), UNSIGNED_INT32); |
+ codegen()->DoDeferredNumberTagI(instr_, |
+ instr_->InputAt(0), |
+ UNSIGNED_INT32); |
} |
virtual LInstruction* instr() { return instr_; } |
private: |
LNumberTagU* instr_; |
}; |
- LOperand* input = instr->value(); |
+ LOperand* input = instr->InputAt(0); |
ASSERT(input->IsRegister() && input->Equals(instr->result())); |
Register reg = ToRegister(input); |
@@ -4250,9 +4219,9 @@ void LCodeGen::DoNumberTagD(LNumberTagD* instr) { |
LNumberTagD* instr_; |
}; |
- XMMRegister input_reg = ToDoubleRegister(instr->value()); |
+ XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0)); |
Register reg = ToRegister(instr->result()); |
- Register tmp = ToRegister(instr->temp()); |
+ Register tmp = ToRegister(instr->TempAt(0)); |
DeferredNumberTagD* deferred = new(zone()) DeferredNumberTagD(this, instr); |
if (FLAG_inline_new) { |
@@ -4287,7 +4256,7 @@ void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { |
void LCodeGen::DoSmiTag(LSmiTag* instr) { |
- LOperand* input = instr->value(); |
+ LOperand* input = instr->InputAt(0); |
ASSERT(input->IsRegister() && input->Equals(instr->result())); |
ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow)); |
__ SmiTag(ToRegister(input)); |
@@ -4295,7 +4264,7 @@ void LCodeGen::DoSmiTag(LSmiTag* instr) { |
void LCodeGen::DoSmiUntag(LSmiUntag* instr) { |
- LOperand* input = instr->value(); |
+ LOperand* input = instr->InputAt(0); |
ASSERT(input->IsRegister() && input->Equals(instr->result())); |
if (instr->needs_check()) { |
__ test(ToRegister(input), Immediate(kSmiTagMask)); |
@@ -4364,7 +4333,7 @@ void LCodeGen::EmitNumberUntagD(Register input_reg, |
void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) { |
Label done, heap_number; |
- Register input_reg = ToRegister(instr->value()); |
+ Register input_reg = ToRegister(instr->InputAt(0)); |
// Heap number map check. |
__ cmp(FieldOperand(input_reg, HeapObject::kMapOffset), |
@@ -4405,7 +4374,7 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) { |
__ mov(input_reg, Operand(esp, 0)); // Low word of answer is the result. |
__ add(Operand(esp), Immediate(kDoubleSize)); |
} else { |
- XMMRegister xmm_temp = ToDoubleRegister(instr->temp()); |
+ XMMRegister xmm_temp = ToDoubleRegister(instr->TempAt(0)); |
__ movdbl(xmm0, FieldOperand(input_reg, HeapNumber::kValueOffset)); |
__ cvttsd2si(input_reg, Operand(xmm0)); |
__ cmp(input_reg, 0x80000000u); |
@@ -4422,7 +4391,7 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) { |
// Deoptimize if we don't have a heap number. |
DeoptimizeIf(not_equal, instr->environment()); |
- XMMRegister xmm_temp = ToDoubleRegister(instr->temp()); |
+ XMMRegister xmm_temp = ToDoubleRegister(instr->TempAt(0)); |
__ movdbl(xmm0, FieldOperand(input_reg, HeapNumber::kValueOffset)); |
__ cvttsd2si(input_reg, Operand(xmm0)); |
__ cvtsi2sd(xmm_temp, Operand(input_reg)); |
@@ -4452,7 +4421,7 @@ void LCodeGen::DoTaggedToI(LTaggedToI* instr) { |
LTaggedToI* instr_; |
}; |
- LOperand* input = instr->value(); |
+ LOperand* input = instr->InputAt(0); |
ASSERT(input->IsRegister()); |
ASSERT(input->Equals(instr->result())); |
@@ -4471,9 +4440,9 @@ void LCodeGen::DoTaggedToI(LTaggedToI* instr) { |
void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) { |
- LOperand* input = instr->value(); |
+ LOperand* input = instr->InputAt(0); |
ASSERT(input->IsRegister()); |
- LOperand* temp = instr->temp(); |
+ LOperand* temp = instr->TempAt(0); |
ASSERT(temp == NULL || temp->IsRegister()); |
LOperand* result = instr->result(); |
ASSERT(result->IsDoubleRegister()); |
@@ -4495,7 +4464,7 @@ void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) { |
void LCodeGen::DoDoubleToI(LDoubleToI* instr) { |
- LOperand* input = instr->value(); |
+ LOperand* input = instr->InputAt(0); |
ASSERT(input->IsDoubleRegister()); |
LOperand* result = instr->result(); |
ASSERT(result->IsRegister()); |
@@ -4533,7 +4502,7 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) { |
__ bind(&done); |
} else { |
Label done; |
- Register temp_reg = ToRegister(instr->temp()); |
+ Register temp_reg = ToRegister(instr->TempAt(0)); |
XMMRegister xmm_scratch = xmm0; |
// If cvttsd2si succeeded, we're done. Otherwise, we attempt |
@@ -4612,22 +4581,22 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) { |
void LCodeGen::DoCheckSmi(LCheckSmi* instr) { |
- LOperand* input = instr->value(); |
+ LOperand* input = instr->InputAt(0); |
__ test(ToOperand(input), Immediate(kSmiTagMask)); |
DeoptimizeIf(not_zero, instr->environment()); |
} |
void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { |
- LOperand* input = instr->value(); |
+ LOperand* input = instr->InputAt(0); |
__ test(ToOperand(input), Immediate(kSmiTagMask)); |
DeoptimizeIf(zero, instr->environment()); |
} |
void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { |
- Register input = ToRegister(instr->value()); |
- Register temp = ToRegister(instr->temp()); |
+ Register input = ToRegister(instr->InputAt(0)); |
+ Register temp = ToRegister(instr->TempAt(0)); |
__ mov(temp, FieldOperand(input, HeapObject::kMapOffset)); |
@@ -4697,7 +4666,7 @@ void LCodeGen::DoCheckMapCommon(Register reg, |
void LCodeGen::DoCheckMaps(LCheckMaps* instr) { |
- LOperand* input = instr->value(); |
+ LOperand* input = instr->InputAt(0); |
ASSERT(input->IsRegister()); |
Register reg = ToRegister(input); |
@@ -4763,7 +4732,7 @@ void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) { |
void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
- Register reg = ToRegister(instr->temp()); |
+ Register reg = ToRegister(instr->TempAt(0)); |
Handle<JSObject> holder = instr->holder(); |
Handle<JSObject> current_prototype = instr->prototype(); |
@@ -4803,7 +4772,7 @@ void LCodeGen::DoAllocateObject(LAllocateObject* instr) { |
new(zone()) DeferredAllocateObject(this, instr); |
Register result = ToRegister(instr->result()); |
- Register scratch = ToRegister(instr->temp()); |
+ Register scratch = ToRegister(instr->TempAt(0)); |
Handle<JSFunction> constructor = instr->hydrogen()->constructor(); |
Handle<Map> initial_map(constructor->initial_map()); |
int instance_size = initial_map->instance_size(); |
@@ -5122,7 +5091,7 @@ void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) { |
void LCodeGen::DoToFastProperties(LToFastProperties* instr) { |
- ASSERT(ToRegister(instr->value()).is(eax)); |
+ ASSERT(ToRegister(instr->InputAt(0)).is(eax)); |
__ push(eax); |
CallRuntime(Runtime::kToFastProperties, 1, instr); |
} |
@@ -5202,14 +5171,14 @@ void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { |
void LCodeGen::DoTypeof(LTypeof* instr) { |
- LOperand* input = instr->value(); |
+ LOperand* input = instr->InputAt(1); |
EmitPushTaggedOperand(input); |
CallRuntime(Runtime::kTypeof, 1, instr); |
} |
void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { |
- Register input = ToRegister(instr->value()); |
+ Register input = ToRegister(instr->InputAt(0)); |
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); |
@@ -5293,7 +5262,7 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label, |
void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { |
- Register temp = ToRegister(instr->temp()); |
+ Register temp = ToRegister(instr->TempAt(0)); |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |