Consistently use named getters for Lithium operands on ia32.
With this CL we clearly distinguish two different views on Lithium instructions: For register allocation, the actual instruction/operand is irrelevant, so it has only an iterator/indexed view on the instruction operands. All other places, most importantly code generation, use named getters for the operands now, making it easy to see where each one is used. Review URL: https://codereview.chromium.org/10919261 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12510 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
8924052787
commit
58c8d208f5
@ -909,7 +909,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());
|
||||||
|
|
||||||
int32_t divisor =
|
int32_t divisor =
|
||||||
HConstant::cast(instr->hydrogen()->right())->Integer32Value();
|
HConstant::cast(instr->hydrogen()->right())->Integer32Value();
|
||||||
@ -933,8 +933,8 @@ void LCodeGen::DoModI(LModI* instr) {
|
|||||||
__ bind(&done);
|
__ bind(&done);
|
||||||
} else {
|
} else {
|
||||||
Label done, remainder_eq_dividend, slow, do_subtraction, both_positive;
|
Label done, remainder_eq_dividend, slow, do_subtraction, both_positive;
|
||||||
Register left_reg = ToRegister(instr->InputAt(0));
|
Register left_reg = ToRegister(instr->left());
|
||||||
Register right_reg = ToRegister(instr->InputAt(1));
|
Register right_reg = ToRegister(instr->right());
|
||||||
Register result_reg = ToRegister(instr->result());
|
Register result_reg = ToRegister(instr->result());
|
||||||
|
|
||||||
ASSERT(left_reg.is(eax));
|
ASSERT(left_reg.is(eax));
|
||||||
@ -964,7 +964,7 @@ void LCodeGen::DoModI(LModI* instr) {
|
|||||||
__ j(less, &remainder_eq_dividend, Label::kNear);
|
__ j(less, &remainder_eq_dividend, Label::kNear);
|
||||||
|
|
||||||
// Check if the divisor is a PowerOfTwo integer.
|
// Check if the divisor is a PowerOfTwo integer.
|
||||||
Register scratch = ToRegister(instr->TempAt(0));
|
Register scratch = ToRegister(instr->temp());
|
||||||
__ mov(scratch, right_reg);
|
__ mov(scratch, right_reg);
|
||||||
__ sub(Operand(scratch), Immediate(1));
|
__ sub(Operand(scratch), Immediate(1));
|
||||||
__ test(scratch, Operand(right_reg));
|
__ test(scratch, Operand(right_reg));
|
||||||
@ -1020,11 +1020,11 @@ void LCodeGen::DoModI(LModI* instr) {
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoDivI(LDivI* instr) {
|
void LCodeGen::DoDivI(LDivI* instr) {
|
||||||
LOperand* right = instr->InputAt(1);
|
LOperand* right = instr->right();
|
||||||
ASSERT(ToRegister(instr->result()).is(eax));
|
ASSERT(ToRegister(instr->result()).is(eax));
|
||||||
ASSERT(ToRegister(instr->InputAt(0)).is(eax));
|
ASSERT(ToRegister(instr->left()).is(eax));
|
||||||
ASSERT(!ToRegister(instr->InputAt(1)).is(eax));
|
ASSERT(!ToRegister(instr->right()).is(eax));
|
||||||
ASSERT(!ToRegister(instr->InputAt(1)).is(edx));
|
ASSERT(!ToRegister(instr->right()).is(edx));
|
||||||
|
|
||||||
Register left_reg = eax;
|
Register left_reg = eax;
|
||||||
|
|
||||||
@ -1066,10 +1066,10 @@ void LCodeGen::DoDivI(LDivI* instr) {
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoMathFloorOfDiv(LMathFloorOfDiv* instr) {
|
void LCodeGen::DoMathFloorOfDiv(LMathFloorOfDiv* instr) {
|
||||||
ASSERT(instr->InputAt(1)->IsConstantOperand());
|
ASSERT(instr->right()->IsConstantOperand());
|
||||||
|
|
||||||
Register dividend = ToRegister(instr->InputAt(0));
|
Register dividend = ToRegister(instr->left());
|
||||||
int32_t divisor = ToInteger32(LConstantOperand::cast(instr->InputAt(1)));
|
int32_t divisor = ToInteger32(LConstantOperand::cast(instr->right()));
|
||||||
Register result = ToRegister(instr->result());
|
Register result = ToRegister(instr->result());
|
||||||
|
|
||||||
switch (divisor) {
|
switch (divisor) {
|
||||||
@ -1115,9 +1115,9 @@ void LCodeGen::DoMathFloorOfDiv(LMathFloorOfDiv* instr) {
|
|||||||
__ sar(result, power);
|
__ sar(result, power);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ASSERT(ToRegister(instr->InputAt(0)).is(eax));
|
ASSERT(ToRegister(instr->left()).is(eax));
|
||||||
ASSERT(ToRegister(instr->result()).is(edx));
|
ASSERT(ToRegister(instr->result()).is(edx));
|
||||||
Register scratch = ToRegister(instr->TempAt(0));
|
Register scratch = ToRegister(instr->temp());
|
||||||
|
|
||||||
// Find b which: 2^b < divisor_abs < 2^(b+1).
|
// Find b which: 2^b < divisor_abs < 2^(b+1).
|
||||||
unsigned b = 31 - CompilerIntrinsics::CountLeadingZeros(divisor_abs);
|
unsigned b = 31 - CompilerIntrinsics::CountLeadingZeros(divisor_abs);
|
||||||
@ -1169,11 +1169,11 @@ void LCodeGen::DoMathFloorOfDiv(LMathFloorOfDiv* instr) {
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoMulI(LMulI* instr) {
|
void LCodeGen::DoMulI(LMulI* instr) {
|
||||||
Register left = ToRegister(instr->InputAt(0));
|
Register left = ToRegister(instr->left());
|
||||||
LOperand* right = instr->InputAt(1);
|
LOperand* right = instr->right();
|
||||||
|
|
||||||
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
|
if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
|
||||||
__ mov(ToRegister(instr->TempAt(0)), left);
|
__ mov(ToRegister(instr->temp()), left);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (right->IsConstantOperand()) {
|
if (right->IsConstantOperand()) {
|
||||||
@ -1239,7 +1239,7 @@ void LCodeGen::DoMulI(LMulI* instr) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Test the non-zero operand for negative sign.
|
// Test the non-zero operand for negative sign.
|
||||||
__ or_(ToRegister(instr->TempAt(0)), ToOperand(right));
|
__ or_(ToRegister(instr->temp()), ToOperand(right));
|
||||||
DeoptimizeIf(sign, instr->environment());
|
DeoptimizeIf(sign, instr->environment());
|
||||||
}
|
}
|
||||||
__ bind(&done);
|
__ bind(&done);
|
||||||
@ -1248,8 +1248,8 @@ void LCodeGen::DoMulI(LMulI* instr) {
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoBitI(LBitI* instr) {
|
void LCodeGen::DoBitI(LBitI* instr) {
|
||||||
LOperand* left = instr->InputAt(0);
|
LOperand* left = instr->left();
|
||||||
LOperand* right = instr->InputAt(1);
|
LOperand* right = instr->right();
|
||||||
ASSERT(left->Equals(instr->result()));
|
ASSERT(left->Equals(instr->result()));
|
||||||
ASSERT(left->IsRegister());
|
ASSERT(left->IsRegister());
|
||||||
|
|
||||||
@ -1289,8 +1289,8 @@ void LCodeGen::DoBitI(LBitI* instr) {
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoShiftI(LShiftI* instr) {
|
void LCodeGen::DoShiftI(LShiftI* instr) {
|
||||||
LOperand* left = instr->InputAt(0);
|
LOperand* left = instr->left();
|
||||||
LOperand* right = instr->InputAt(1);
|
LOperand* right = instr->right();
|
||||||
ASSERT(left->Equals(instr->result()));
|
ASSERT(left->Equals(instr->result()));
|
||||||
ASSERT(left->IsRegister());
|
ASSERT(left->IsRegister());
|
||||||
if (right->IsRegister()) {
|
if (right->IsRegister()) {
|
||||||
@ -1345,8 +1345,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();
|
||||||
ASSERT(left->Equals(instr->result()));
|
ASSERT(left->Equals(instr->result()));
|
||||||
|
|
||||||
if (right->IsConstantOperand()) {
|
if (right->IsConstantOperand()) {
|
||||||
@ -1375,7 +1375,7 @@ void LCodeGen::DoConstantD(LConstantD* instr) {
|
|||||||
if (BitCast<uint64_t, double>(v) == 0) {
|
if (BitCast<uint64_t, double>(v) == 0) {
|
||||||
__ xorps(res, res);
|
__ xorps(res, res);
|
||||||
} else {
|
} else {
|
||||||
Register temp = ToRegister(instr->TempAt(0));
|
Register temp = ToRegister(instr->temp());
|
||||||
uint64_t int_val = BitCast<uint64_t, double>(v);
|
uint64_t int_val = BitCast<uint64_t, double>(v);
|
||||||
int32_t lower = static_cast<int32_t>(int_val);
|
int32_t lower = static_cast<int32_t>(int_val);
|
||||||
int32_t upper = static_cast<int32_t>(int_val >> (kBitsPerInt));
|
int32_t upper = static_cast<int32_t>(int_val >> (kBitsPerInt));
|
||||||
@ -1418,7 +1418,7 @@ 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());
|
||||||
__ mov(result, FieldOperand(array, JSArray::kLengthOffset));
|
__ mov(result, FieldOperand(array, JSArray::kLengthOffset));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1426,21 +1426,21 @@ void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) {
|
|||||||
void LCodeGen::DoFixedArrayBaseLength(
|
void LCodeGen::DoFixedArrayBaseLength(
|
||||||
LFixedArrayBaseLength* instr) {
|
LFixedArrayBaseLength* instr) {
|
||||||
Register result = ToRegister(instr->result());
|
Register result = ToRegister(instr->result());
|
||||||
Register array = ToRegister(instr->InputAt(0));
|
Register array = ToRegister(instr->value());
|
||||||
__ mov(result, FieldOperand(array, FixedArrayBase::kLengthOffset));
|
__ mov(result, FieldOperand(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|.
|
||||||
__ mov(result, FieldOperand(input, HeapObject::kMapOffset));
|
__ mov(result, FieldOperand(input, HeapObject::kMapOffset));
|
||||||
@ -1454,9 +1454,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());
|
||||||
ASSERT(input.is(result));
|
ASSERT(input.is(result));
|
||||||
|
|
||||||
Label done;
|
Label done;
|
||||||
@ -1473,9 +1473,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));
|
||||||
@ -1509,7 +1509,7 @@ void LCodeGen::DoDateField(LDateField* instr) {
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoBitNotI(LBitNotI* instr) {
|
void LCodeGen::DoBitNotI(LBitNotI* instr) {
|
||||||
LOperand* input = instr->InputAt(0);
|
LOperand* input = instr->value();
|
||||||
ASSERT(input->Equals(instr->result()));
|
ASSERT(input->Equals(instr->result()));
|
||||||
__ not_(ToRegister(input));
|
__ not_(ToRegister(input));
|
||||||
}
|
}
|
||||||
@ -1528,8 +1528,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();
|
||||||
ASSERT(left->Equals(instr->result()));
|
ASSERT(left->Equals(instr->result()));
|
||||||
|
|
||||||
if (right->IsConstantOperand()) {
|
if (right->IsConstantOperand()) {
|
||||||
@ -1545,8 +1545,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();
|
||||||
ASSERT(left->Equals(instr->result()));
|
ASSERT(left->Equals(instr->result()));
|
||||||
HMathMinMax::Operation operation = instr->hydrogen()->operation();
|
HMathMinMax::Operation operation = instr->hydrogen()->operation();
|
||||||
if (instr->hydrogen()->representation().IsInteger32()) {
|
if (instr->hydrogen()->representation().IsInteger32()) {
|
||||||
@ -1606,8 +1606,8 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) {
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoArithmeticD(LArithmeticD* instr) {
|
void LCodeGen::DoArithmeticD(LArithmeticD* instr) {
|
||||||
XMMRegister left = ToDoubleRegister(instr->InputAt(0));
|
XMMRegister left = ToDoubleRegister(instr->left());
|
||||||
XMMRegister right = ToDoubleRegister(instr->InputAt(1));
|
XMMRegister right = ToDoubleRegister(instr->right());
|
||||||
XMMRegister result = ToDoubleRegister(instr->result());
|
XMMRegister result = ToDoubleRegister(instr->result());
|
||||||
// Modulo uses a fixed result register.
|
// Modulo uses a fixed result register.
|
||||||
ASSERT(instr->op() == Token::MOD || left.is(result));
|
ASSERT(instr->op() == Token::MOD || left.is(result));
|
||||||
@ -1693,17 +1693,17 @@ 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());
|
||||||
__ test(reg, Operand(reg));
|
__ test(reg, Operand(reg));
|
||||||
EmitBranch(true_block, false_block, not_zero);
|
EmitBranch(true_block, false_block, not_zero);
|
||||||
} else if (r.IsDouble()) {
|
} else if (r.IsDouble()) {
|
||||||
XMMRegister reg = ToDoubleRegister(instr->InputAt(0));
|
XMMRegister reg = ToDoubleRegister(instr->value());
|
||||||
__ xorps(xmm0, xmm0);
|
__ xorps(xmm0, xmm0);
|
||||||
__ ucomisd(reg, xmm0);
|
__ ucomisd(reg, xmm0);
|
||||||
EmitBranch(true_block, false_block, not_equal);
|
EmitBranch(true_block, false_block, not_equal);
|
||||||
} 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()) {
|
||||||
__ cmp(reg, factory()->true_value());
|
__ cmp(reg, factory()->true_value());
|
||||||
@ -1751,7 +1751,7 @@ void LCodeGen::DoBranch(LBranch* instr) {
|
|||||||
|
|
||||||
Register map = no_reg; // Keep the compiler happy.
|
Register map = no_reg; // Keep the compiler happy.
|
||||||
if (expected.NeedsMap()) {
|
if (expected.NeedsMap()) {
|
||||||
map = ToRegister(instr->TempAt(0));
|
map = ToRegister(instr->temp());
|
||||||
ASSERT(!map.is(reg));
|
ASSERT(!map.is(reg));
|
||||||
__ mov(map, FieldOperand(reg, HeapObject::kMapOffset));
|
__ mov(map, FieldOperand(reg, HeapObject::kMapOffset));
|
||||||
|
|
||||||
@ -1844,8 +1844,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 cc = TokenToCondition(instr->op(), instr->is_double());
|
Condition cc = TokenToCondition(instr->op(), instr->is_double());
|
||||||
@ -1881,8 +1881,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());
|
||||||
Operand right = ToOperand(instr->InputAt(1));
|
Operand right = ToOperand(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());
|
||||||
|
|
||||||
@ -1892,7 +1892,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());
|
||||||
|
|
||||||
@ -1902,7 +1902,7 @@ void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) {
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoIsNilAndBranch(LIsNilAndBranch* instr) {
|
void LCodeGen::DoIsNilAndBranch(LIsNilAndBranch* instr) {
|
||||||
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
|
||||||
@ -1932,7 +1932,7 @@ void LCodeGen::DoIsNilAndBranch(LIsNilAndBranch* instr) {
|
|||||||
__ JumpIfSmi(reg, false_label);
|
__ JumpIfSmi(reg, false_label);
|
||||||
// Check for undetectable objects by looking in the bit field in
|
// Check for undetectable objects by looking in the bit field in
|
||||||
// the map. The object has already been smi checked.
|
// the map. The object has already been smi checked.
|
||||||
Register scratch = ToRegister(instr->TempAt(0));
|
Register scratch = ToRegister(instr->temp());
|
||||||
__ mov(scratch, FieldOperand(reg, HeapObject::kMapOffset));
|
__ mov(scratch, FieldOperand(reg, HeapObject::kMapOffset));
|
||||||
__ movzx_b(scratch, FieldOperand(scratch, Map::kBitFieldOffset));
|
__ movzx_b(scratch, FieldOperand(scratch, Map::kBitFieldOffset));
|
||||||
__ test(scratch, Immediate(1 << Map::kIsUndetectable));
|
__ test(scratch, Immediate(1 << Map::kIsUndetectable));
|
||||||
@ -1965,8 +1965,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 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());
|
||||||
@ -1991,8 +1991,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 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());
|
||||||
@ -2005,7 +2005,7 @@ void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) {
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) {
|
void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) {
|
||||||
Operand input = ToOperand(instr->InputAt(0));
|
Operand input = ToOperand(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());
|
||||||
@ -2016,8 +2016,8 @@ void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) {
|
|||||||
|
|
||||||
|
|
||||||
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());
|
||||||
@ -2087,8 +2087,8 @@ static Condition BranchCondition(HHasInstanceTypeAndBranch* instr) {
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) {
|
void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* 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());
|
||||||
@ -2103,7 +2103,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);
|
||||||
@ -2115,7 +2115,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());
|
||||||
|
|
||||||
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());
|
||||||
@ -2192,9 +2192,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 = ToRegister(instr->TempAt(0));
|
Register temp = ToRegister(instr->temp());
|
||||||
Register temp2 = ToRegister(instr->TempAt(1));
|
Register temp2 = ToRegister(instr->temp2());
|
||||||
|
|
||||||
Handle<String> class_name = instr->hydrogen()->class_name();
|
Handle<String> class_name = instr->hydrogen()->class_name();
|
||||||
|
|
||||||
@ -2211,7 +2211,7 @@ 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());
|
||||||
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();
|
||||||
|
|
||||||
@ -2257,8 +2257,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(1));
|
Register object = ToRegister(instr->value());
|
||||||
Register temp = ToRegister(instr->TempAt(0));
|
Register temp = ToRegister(instr->temp());
|
||||||
|
|
||||||
// A Smi is not an instance of anything.
|
// A Smi is not an instance of anything.
|
||||||
__ JumpIfSmi(object, &false_result);
|
__ JumpIfSmi(object, &false_result);
|
||||||
@ -2267,7 +2267,7 @@ void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) {
|
|||||||
// hole value will be patched to the last map/result pair generated by the
|
// hole value will be patched to the last map/result pair generated by the
|
||||||
// instanceof stub.
|
// instanceof stub.
|
||||||
Label cache_miss;
|
Label cache_miss;
|
||||||
Register map = ToRegister(instr->TempAt(0));
|
Register map = ToRegister(instr->temp());
|
||||||
__ mov(map, FieldOperand(object, HeapObject::kMapOffset));
|
__ mov(map, FieldOperand(object, HeapObject::kMapOffset));
|
||||||
__ bind(deferred->map_check()); // Label for calculating code patching.
|
__ bind(deferred->map_check()); // Label for calculating code patching.
|
||||||
Handle<JSGlobalPropertyCell> cache_cell =
|
Handle<JSGlobalPropertyCell> cache_cell =
|
||||||
@ -2318,7 +2318,7 @@ void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
|
|||||||
// register which is pushed last by PushSafepointRegisters as top of the
|
// 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
|
// stack is used to pass the offset to the location of the map check to
|
||||||
// the stub.
|
// the stub.
|
||||||
Register temp = ToRegister(instr->TempAt(0));
|
Register temp = ToRegister(instr->temp());
|
||||||
ASSERT(MacroAssembler::SafepointRegisterStackIndex(temp) == 0);
|
ASSERT(MacroAssembler::SafepointRegisterStackIndex(temp) == 0);
|
||||||
__ LoadHeapObject(InstanceofStub::right(), instr->function());
|
__ LoadHeapObject(InstanceofStub::right(), instr->function());
|
||||||
static const int kAdditionalDelta = 13;
|
static const int kAdditionalDelta = 13;
|
||||||
@ -2485,7 +2485,7 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
|
|||||||
HType type = instr->hydrogen()->value()->type();
|
HType type = instr->hydrogen()->value()->type();
|
||||||
SmiCheck check_needed =
|
SmiCheck check_needed =
|
||||||
type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
|
type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
|
||||||
Register temp = ToRegister(instr->TempAt(0));
|
Register temp = ToRegister(instr->temp());
|
||||||
int offset = Context::SlotOffset(instr->slot_index());
|
int offset = Context::SlotOffset(instr->slot_index());
|
||||||
__ RecordWriteContextSlot(context,
|
__ RecordWriteContextSlot(context,
|
||||||
offset,
|
offset,
|
||||||
@ -2650,7 +2650,7 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
|
|||||||
|
|
||||||
void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
|
void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
|
||||||
Register function = ToRegister(instr->function());
|
Register function = ToRegister(instr->function());
|
||||||
Register temp = ToRegister(instr->TempAt(0));
|
Register temp = ToRegister(instr->temp());
|
||||||
Register result = ToRegister(instr->result());
|
Register result = ToRegister(instr->result());
|
||||||
|
|
||||||
// Check that the function really is a function.
|
// Check that the function really is a function.
|
||||||
@ -2692,7 +2692,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());
|
||||||
__ mov(result, FieldOperand(input, JSObject::kElementsOffset));
|
__ mov(result, FieldOperand(input, JSObject::kElementsOffset));
|
||||||
if (FLAG_debug_code) {
|
if (FLAG_debug_code) {
|
||||||
Label done, ok, fail;
|
Label done, ok, fail;
|
||||||
@ -2728,7 +2728,7 @@ void LCodeGen::DoLoadElements(LLoadElements* instr) {
|
|||||||
void LCodeGen::DoLoadExternalArrayPointer(
|
void LCodeGen::DoLoadExternalArrayPointer(
|
||||||
LLoadExternalArrayPointer* instr) {
|
LLoadExternalArrayPointer* instr) {
|
||||||
Register result = ToRegister(instr->result());
|
Register result = ToRegister(instr->result());
|
||||||
Register input = ToRegister(instr->InputAt(0));
|
Register input = ToRegister(instr->object());
|
||||||
__ mov(result, FieldOperand(input,
|
__ mov(result, FieldOperand(input,
|
||||||
ExternalArray::kExternalPointerOffset));
|
ExternalArray::kExternalPointerOffset));
|
||||||
}
|
}
|
||||||
@ -2941,7 +2941,7 @@ void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) {
|
void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) {
|
||||||
Operand elem = ToOperand(instr->InputAt(0));
|
Operand elem = ToOperand(instr->elements());
|
||||||
Register result = ToRegister(instr->result());
|
Register result = ToRegister(instr->result());
|
||||||
|
|
||||||
Label done;
|
Label done;
|
||||||
@ -2965,7 +2965,7 @@ void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) {
|
|||||||
void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
|
void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
|
||||||
Register receiver = ToRegister(instr->receiver());
|
Register receiver = ToRegister(instr->receiver());
|
||||||
Register function = ToRegister(instr->function());
|
Register function = ToRegister(instr->function());
|
||||||
Register scratch = ToRegister(instr->TempAt(0));
|
Register scratch = ToRegister(instr->temp());
|
||||||
|
|
||||||
// If the receiver is null or undefined, we have to pass the global
|
// If the receiver is null or undefined, we have to pass the global
|
||||||
// object as a receiver to normal functions. Values have to be
|
// object as a receiver to normal functions. Values have to be
|
||||||
@ -3053,7 +3053,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();
|
||||||
EmitPushTaggedOperand(argument);
|
EmitPushTaggedOperand(argument);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3084,7 +3084,7 @@ void LCodeGen::DoOuterContext(LOuterContext* instr) {
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) {
|
void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) {
|
||||||
ASSERT(ToRegister(instr->InputAt(0)).is(esi));
|
ASSERT(ToRegister(instr->context()).is(esi));
|
||||||
__ push(esi); // The context is the first argument.
|
__ push(esi); // The context is the first argument.
|
||||||
__ push(Immediate(instr->hydrogen()->pairs()));
|
__ push(Immediate(instr->hydrogen()->pairs()));
|
||||||
__ push(Immediate(Smi::FromInt(instr->hydrogen()->flags())));
|
__ push(Immediate(Smi::FromInt(instr->hydrogen()->flags())));
|
||||||
@ -3417,11 +3417,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(xmm1));
|
ToDoubleRegister(instr->right()).is(xmm1));
|
||||||
ASSERT(!instr->InputAt(1)->IsRegister() ||
|
ASSERT(!instr->right()->IsRegister() ||
|
||||||
ToRegister(instr->InputAt(1)).is(eax));
|
ToRegister(instr->right()).is(eax));
|
||||||
ASSERT(ToDoubleRegister(instr->InputAt(0)).is(xmm2));
|
ASSERT(ToDoubleRegister(instr->left()).is(xmm2));
|
||||||
ASSERT(ToDoubleRegister(instr->result()).is(xmm3));
|
ASSERT(ToDoubleRegister(instr->result()).is(xmm3));
|
||||||
|
|
||||||
if (exponent_type.IsTagged()) {
|
if (exponent_type.IsTagged()) {
|
||||||
@ -3459,7 +3459,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(xmm1));
|
ASSERT(ToDoubleRegister(instr->result()).is(xmm1));
|
||||||
ASSERT(ToRegister(instr->InputAt(0)).is(eax));
|
ASSERT(ToRegister(instr->global_object()).is(eax));
|
||||||
// Assert that the register size is indeed the size of each seed.
|
// Assert that the register size is indeed the size of each seed.
|
||||||
static const int kSeedSize = sizeof(uint32_t);
|
static const int kSeedSize = sizeof(uint32_t);
|
||||||
STATIC_ASSERT(kPointerSize == kSeedSize);
|
STATIC_ASSERT(kPointerSize == kSeedSize);
|
||||||
@ -3716,8 +3716,8 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
|
|||||||
if (!instr->hydrogen()->NeedsWriteBarrierForMap()) {
|
if (!instr->hydrogen()->NeedsWriteBarrierForMap()) {
|
||||||
__ mov(FieldOperand(object, HeapObject::kMapOffset), instr->transition());
|
__ mov(FieldOperand(object, HeapObject::kMapOffset), instr->transition());
|
||||||
} else {
|
} else {
|
||||||
Register temp = ToRegister(instr->TempAt(0));
|
Register temp = ToRegister(instr->temp());
|
||||||
Register temp_map = ToRegister(instr->TempAt(1));
|
Register temp_map = ToRegister(instr->temp_map());
|
||||||
__ mov(temp_map, instr->transition());
|
__ mov(temp_map, instr->transition());
|
||||||
__ mov(FieldOperand(object, HeapObject::kMapOffset), temp_map);
|
__ mov(FieldOperand(object, HeapObject::kMapOffset), temp_map);
|
||||||
// Update the write barrier for the map field.
|
// Update the write barrier for the map field.
|
||||||
@ -3738,7 +3738,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
|
|||||||
if (instr->is_in_object()) {
|
if (instr->is_in_object()) {
|
||||||
__ mov(FieldOperand(object, offset), value);
|
__ mov(FieldOperand(object, offset), value);
|
||||||
if (instr->hydrogen()->NeedsWriteBarrier()) {
|
if (instr->hydrogen()->NeedsWriteBarrier()) {
|
||||||
Register temp = ToRegister(instr->TempAt(0));
|
Register temp = ToRegister(instr->temp());
|
||||||
// Update the write barrier for the object for in-object properties.
|
// Update the write barrier for the object for in-object properties.
|
||||||
__ RecordWriteField(object,
|
__ RecordWriteField(object,
|
||||||
offset,
|
offset,
|
||||||
@ -3749,7 +3749,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
|
|||||||
check_needed);
|
check_needed);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Register temp = ToRegister(instr->TempAt(0));
|
Register temp = ToRegister(instr->temp());
|
||||||
__ mov(temp, FieldOperand(object, JSObject::kPropertiesOffset));
|
__ mov(temp, FieldOperand(object, JSObject::kPropertiesOffset));
|
||||||
__ mov(FieldOperand(temp, offset), value);
|
__ mov(FieldOperand(temp, offset), value);
|
||||||
if (instr->hydrogen()->NeedsWriteBarrier()) {
|
if (instr->hydrogen()->NeedsWriteBarrier()) {
|
||||||
@ -3945,7 +3945,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());
|
||||||
|
|
||||||
Handle<Map> from_map = instr->original_map();
|
Handle<Map> from_map = instr->original_map();
|
||||||
Handle<Map> to_map = instr->transitioned_map();
|
Handle<Map> to_map = instr->transitioned_map();
|
||||||
@ -3965,14 +3965,14 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
|
|||||||
__ mov(FieldOperand(object_reg, HeapObject::kMapOffset),
|
__ mov(FieldOperand(object_reg, HeapObject::kMapOffset),
|
||||||
Immediate(map));
|
Immediate(map));
|
||||||
// Write barrier.
|
// Write barrier.
|
||||||
ASSERT_NE(instr->temp_reg(), NULL);
|
ASSERT_NE(instr->temp(), NULL);
|
||||||
__ RecordWriteForMap(object_reg, to_map, new_map_reg,
|
__ RecordWriteForMap(object_reg, to_map, new_map_reg,
|
||||||
ToRegister(instr->temp_reg()),
|
ToRegister(instr->temp()),
|
||||||
kDontSaveFPRegs);
|
kDontSaveFPRegs);
|
||||||
} else if (IsFastSmiElementsKind(from_kind) &&
|
} else if (IsFastSmiElementsKind(from_kind) &&
|
||||||
IsFastDoubleElementsKind(to_kind)) {
|
IsFastDoubleElementsKind(to_kind)) {
|
||||||
__ mov(new_map_reg, to_map);
|
__ mov(new_map_reg, to_map);
|
||||||
Register fixed_object_reg = ToRegister(instr->temp_reg());
|
Register fixed_object_reg = ToRegister(instr->temp());
|
||||||
ASSERT(fixed_object_reg.is(edx));
|
ASSERT(fixed_object_reg.is(edx));
|
||||||
ASSERT(new_map_reg.is(ebx));
|
ASSERT(new_map_reg.is(ebx));
|
||||||
__ mov(fixed_object_reg, object_reg);
|
__ mov(fixed_object_reg, object_reg);
|
||||||
@ -3981,7 +3981,7 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
|
|||||||
} else if (IsFastDoubleElementsKind(from_kind) &&
|
} else if (IsFastDoubleElementsKind(from_kind) &&
|
||||||
IsFastObjectElementsKind(to_kind)) {
|
IsFastObjectElementsKind(to_kind)) {
|
||||||
__ mov(new_map_reg, to_map);
|
__ mov(new_map_reg, to_map);
|
||||||
Register fixed_object_reg = ToRegister(instr->temp_reg());
|
Register fixed_object_reg = ToRegister(instr->temp());
|
||||||
ASSERT(fixed_object_reg.is(edx));
|
ASSERT(fixed_object_reg.is(edx));
|
||||||
ASSERT(new_map_reg.is(ebx));
|
ASSERT(new_map_reg.is(ebx));
|
||||||
__ mov(fixed_object_reg, object_reg);
|
__ mov(fixed_object_reg, object_reg);
|
||||||
@ -4114,7 +4114,7 @@ void LCodeGen::DoStringAdd(LStringAdd* instr) {
|
|||||||
|
|
||||||
|
|
||||||
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());
|
||||||
@ -4123,9 +4123,9 @@ 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();
|
||||||
LOperand* temp = instr->TempAt(0);
|
LOperand* temp = instr->temp();
|
||||||
|
|
||||||
__ LoadUint32(ToDoubleRegister(output),
|
__ LoadUint32(ToDoubleRegister(output),
|
||||||
ToRegister(input),
|
ToRegister(input),
|
||||||
@ -4139,16 +4139,14 @@ void LCodeGen::DoNumberTagI(LNumberTagI* instr) {
|
|||||||
DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr)
|
DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr)
|
||||||
: LDeferredCode(codegen), instr_(instr) { }
|
: LDeferredCode(codegen), instr_(instr) { }
|
||||||
virtual void Generate() {
|
virtual void Generate() {
|
||||||
codegen()->DoDeferredNumberTagI(instr_,
|
codegen()->DoDeferredNumberTagI(instr_, instr_->value(), SIGNED_INT32);
|
||||||
instr_->InputAt(0),
|
|
||||||
SIGNED_INT32);
|
|
||||||
}
|
}
|
||||||
virtual LInstruction* instr() { return instr_; }
|
virtual LInstruction* instr() { return instr_; }
|
||||||
private:
|
private:
|
||||||
LNumberTagI* instr_;
|
LNumberTagI* 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);
|
||||||
|
|
||||||
@ -4165,16 +4163,14 @@ void LCodeGen::DoNumberTagU(LNumberTagU* instr) {
|
|||||||
DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr)
|
DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr)
|
||||||
: LDeferredCode(codegen), instr_(instr) { }
|
: LDeferredCode(codegen), instr_(instr) { }
|
||||||
virtual void Generate() {
|
virtual void Generate() {
|
||||||
codegen()->DoDeferredNumberTagI(instr_,
|
codegen()->DoDeferredNumberTagI(instr_, instr_->value(), UNSIGNED_INT32);
|
||||||
instr_->InputAt(0),
|
|
||||||
UNSIGNED_INT32);
|
|
||||||
}
|
}
|
||||||
virtual LInstruction* instr() { return instr_; }
|
virtual LInstruction* instr() { return instr_; }
|
||||||
private:
|
private:
|
||||||
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);
|
||||||
|
|
||||||
@ -4251,9 +4247,9 @@ void LCodeGen::DoNumberTagD(LNumberTagD* instr) {
|
|||||||
LNumberTagD* instr_;
|
LNumberTagD* instr_;
|
||||||
};
|
};
|
||||||
|
|
||||||
XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0));
|
XMMRegister input_reg = ToDoubleRegister(instr->value());
|
||||||
Register reg = ToRegister(instr->result());
|
Register reg = ToRegister(instr->result());
|
||||||
Register tmp = ToRegister(instr->TempAt(0));
|
Register tmp = ToRegister(instr->temp());
|
||||||
|
|
||||||
DeferredNumberTagD* deferred = new(zone()) DeferredNumberTagD(this, instr);
|
DeferredNumberTagD* deferred = new(zone()) DeferredNumberTagD(this, instr);
|
||||||
if (FLAG_inline_new) {
|
if (FLAG_inline_new) {
|
||||||
@ -4288,7 +4284,7 @@ void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) {
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoSmiTag(LSmiTag* instr) {
|
void LCodeGen::DoSmiTag(LSmiTag* instr) {
|
||||||
LOperand* input = instr->InputAt(0);
|
LOperand* input = instr->value();
|
||||||
ASSERT(input->IsRegister() && input->Equals(instr->result()));
|
ASSERT(input->IsRegister() && input->Equals(instr->result()));
|
||||||
ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow));
|
ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow));
|
||||||
__ SmiTag(ToRegister(input));
|
__ SmiTag(ToRegister(input));
|
||||||
@ -4296,7 +4292,7 @@ void LCodeGen::DoSmiTag(LSmiTag* instr) {
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
|
void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
|
||||||
LOperand* input = instr->InputAt(0);
|
LOperand* input = instr->value();
|
||||||
ASSERT(input->IsRegister() && input->Equals(instr->result()));
|
ASSERT(input->IsRegister() && input->Equals(instr->result()));
|
||||||
if (instr->needs_check()) {
|
if (instr->needs_check()) {
|
||||||
__ test(ToRegister(input), Immediate(kSmiTagMask));
|
__ test(ToRegister(input), Immediate(kSmiTagMask));
|
||||||
@ -4365,7 +4361,7 @@ void LCodeGen::EmitNumberUntagD(Register input_reg,
|
|||||||
|
|
||||||
void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
|
void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
|
||||||
Label done, heap_number;
|
Label done, heap_number;
|
||||||
Register input_reg = ToRegister(instr->InputAt(0));
|
Register input_reg = ToRegister(instr->value());
|
||||||
|
|
||||||
// Heap number map check.
|
// Heap number map check.
|
||||||
__ cmp(FieldOperand(input_reg, HeapObject::kMapOffset),
|
__ cmp(FieldOperand(input_reg, HeapObject::kMapOffset),
|
||||||
@ -4406,7 +4402,7 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
|
|||||||
__ mov(input_reg, Operand(esp, 0)); // Low word of answer is the result.
|
__ mov(input_reg, Operand(esp, 0)); // Low word of answer is the result.
|
||||||
__ add(Operand(esp), Immediate(kDoubleSize));
|
__ add(Operand(esp), Immediate(kDoubleSize));
|
||||||
} else {
|
} else {
|
||||||
XMMRegister xmm_temp = ToDoubleRegister(instr->TempAt(0));
|
XMMRegister xmm_temp = ToDoubleRegister(instr->temp());
|
||||||
__ movdbl(xmm0, FieldOperand(input_reg, HeapNumber::kValueOffset));
|
__ movdbl(xmm0, FieldOperand(input_reg, HeapNumber::kValueOffset));
|
||||||
__ cvttsd2si(input_reg, Operand(xmm0));
|
__ cvttsd2si(input_reg, Operand(xmm0));
|
||||||
__ cmp(input_reg, 0x80000000u);
|
__ cmp(input_reg, 0x80000000u);
|
||||||
@ -4423,7 +4419,7 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
|
|||||||
// Deoptimize if we don't have a heap number.
|
// Deoptimize if we don't have a heap number.
|
||||||
DeoptimizeIf(not_equal, instr->environment());
|
DeoptimizeIf(not_equal, instr->environment());
|
||||||
|
|
||||||
XMMRegister xmm_temp = ToDoubleRegister(instr->TempAt(0));
|
XMMRegister xmm_temp = ToDoubleRegister(instr->temp());
|
||||||
__ movdbl(xmm0, FieldOperand(input_reg, HeapNumber::kValueOffset));
|
__ movdbl(xmm0, FieldOperand(input_reg, HeapNumber::kValueOffset));
|
||||||
__ cvttsd2si(input_reg, Operand(xmm0));
|
__ cvttsd2si(input_reg, Operand(xmm0));
|
||||||
__ cvtsi2sd(xmm_temp, Operand(input_reg));
|
__ cvtsi2sd(xmm_temp, Operand(input_reg));
|
||||||
@ -4453,7 +4449,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()));
|
||||||
|
|
||||||
@ -4472,9 +4468,9 @@ 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* temp = instr->TempAt(0);
|
LOperand* temp = instr->temp();
|
||||||
ASSERT(temp == NULL || temp->IsRegister());
|
ASSERT(temp == NULL || temp->IsRegister());
|
||||||
LOperand* result = instr->result();
|
LOperand* result = instr->result();
|
||||||
ASSERT(result->IsDoubleRegister());
|
ASSERT(result->IsDoubleRegister());
|
||||||
@ -4496,7 +4492,7 @@ void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) {
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
|
void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
|
||||||
LOperand* input = instr->InputAt(0);
|
LOperand* input = instr->value();
|
||||||
ASSERT(input->IsDoubleRegister());
|
ASSERT(input->IsDoubleRegister());
|
||||||
LOperand* result = instr->result();
|
LOperand* result = instr->result();
|
||||||
ASSERT(result->IsRegister());
|
ASSERT(result->IsRegister());
|
||||||
@ -4534,7 +4530,7 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
|
|||||||
__ bind(&done);
|
__ bind(&done);
|
||||||
} else {
|
} else {
|
||||||
Label done;
|
Label done;
|
||||||
Register temp_reg = ToRegister(instr->TempAt(0));
|
Register temp_reg = ToRegister(instr->temp());
|
||||||
XMMRegister xmm_scratch = xmm0;
|
XMMRegister xmm_scratch = xmm0;
|
||||||
|
|
||||||
// If cvttsd2si succeeded, we're done. Otherwise, we attempt
|
// If cvttsd2si succeeded, we're done. Otherwise, we attempt
|
||||||
@ -4613,22 +4609,22 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoCheckSmi(LCheckSmi* instr) {
|
void LCodeGen::DoCheckSmi(LCheckSmi* instr) {
|
||||||
LOperand* input = instr->InputAt(0);
|
LOperand* input = instr->value();
|
||||||
__ test(ToOperand(input), Immediate(kSmiTagMask));
|
__ test(ToOperand(input), Immediate(kSmiTagMask));
|
||||||
DeoptimizeIf(not_zero, instr->environment());
|
DeoptimizeIf(not_zero, instr->environment());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) {
|
void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) {
|
||||||
LOperand* input = instr->InputAt(0);
|
LOperand* input = instr->value();
|
||||||
__ test(ToOperand(input), Immediate(kSmiTagMask));
|
__ test(ToOperand(input), Immediate(kSmiTagMask));
|
||||||
DeoptimizeIf(zero, instr->environment());
|
DeoptimizeIf(zero, instr->environment());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
|
void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
|
||||||
Register input = ToRegister(instr->InputAt(0));
|
Register input = ToRegister(instr->value());
|
||||||
Register temp = ToRegister(instr->TempAt(0));
|
Register temp = ToRegister(instr->temp());
|
||||||
|
|
||||||
__ mov(temp, FieldOperand(input, HeapObject::kMapOffset));
|
__ mov(temp, FieldOperand(input, HeapObject::kMapOffset));
|
||||||
|
|
||||||
@ -4698,7 +4694,7 @@ void LCodeGen::DoCheckMapCommon(Register reg,
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoCheckMaps(LCheckMaps* instr) {
|
void LCodeGen::DoCheckMaps(LCheckMaps* instr) {
|
||||||
LOperand* input = instr->InputAt(0);
|
LOperand* input = instr->value();
|
||||||
ASSERT(input->IsRegister());
|
ASSERT(input->IsRegister());
|
||||||
Register reg = ToRegister(input);
|
Register reg = ToRegister(input);
|
||||||
|
|
||||||
@ -4764,7 +4760,7 @@ void LCodeGen::DoClampTToUint8(LClampTToUint8* instr) {
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) {
|
void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) {
|
||||||
Register reg = ToRegister(instr->TempAt(0));
|
Register reg = ToRegister(instr->temp());
|
||||||
|
|
||||||
Handle<JSObject> holder = instr->holder();
|
Handle<JSObject> holder = instr->holder();
|
||||||
Handle<JSObject> current_prototype = instr->prototype();
|
Handle<JSObject> current_prototype = instr->prototype();
|
||||||
@ -4804,7 +4800,7 @@ 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());
|
||||||
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();
|
||||||
@ -5123,7 +5119,7 @@ void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) {
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoToFastProperties(LToFastProperties* instr) {
|
void LCodeGen::DoToFastProperties(LToFastProperties* instr) {
|
||||||
ASSERT(ToRegister(instr->InputAt(0)).is(eax));
|
ASSERT(ToRegister(instr->value()).is(eax));
|
||||||
__ push(eax);
|
__ push(eax);
|
||||||
CallRuntime(Runtime::kToFastProperties, 1, instr);
|
CallRuntime(Runtime::kToFastProperties, 1, instr);
|
||||||
}
|
}
|
||||||
@ -5203,14 +5199,14 @@ void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoTypeof(LTypeof* instr) {
|
void LCodeGen::DoTypeof(LTypeof* instr) {
|
||||||
LOperand* input = instr->InputAt(1);
|
LOperand* input = instr->value();
|
||||||
EmitPushTaggedOperand(input);
|
EmitPushTaggedOperand(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);
|
||||||
@ -5294,7 +5290,7 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label,
|
|||||||
|
|
||||||
|
|
||||||
void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) {
|
void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) {
|
||||||
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());
|
||||||
|
|
||||||
|
@ -196,22 +196,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());
|
||||||
@ -220,57 +220,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(1)->PrintTo(stream);
|
left()->PrintTo(stream);
|
||||||
InputAt(2)->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(),
|
||||||
@ -280,7 +280,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());
|
||||||
@ -294,34 +294,34 @@ 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 LMathPowHalf::PrintDataTo(StringStream* stream) {
|
void LMathPowHalf::PrintDataTo(StringStream* stream) {
|
||||||
stream->Add("/pow_half ");
|
stream->Add("/pow_half ");
|
||||||
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);
|
context()->PrintTo(stream);
|
||||||
stream->Add(" ");
|
stream->Add(" ");
|
||||||
InputAt(1)->PrintTo(stream);
|
function()->PrintTo(stream);
|
||||||
stream->Add(" #%d / ", arity());
|
stream->Add(" #%d / ", arity());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,7 +350,9 @@ void LCallKnownGlobal::PrintDataTo(StringStream* stream) {
|
|||||||
|
|
||||||
void LCallNew::PrintDataTo(StringStream* stream) {
|
void LCallNew::PrintDataTo(StringStream* stream) {
|
||||||
stream->Add("= ");
|
stream->Add("= ");
|
||||||
InputAt(0)->PrintTo(stream);
|
context()->PrintTo(stream);
|
||||||
|
stream->Add(" ");
|
||||||
|
constructor()->PrintTo(stream);
|
||||||
stream->Add(" #%d / ", arity());
|
stream->Add(" #%d / ", arity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user