| Index: src/ia32/lithium-codegen-ia32.cc
|
| diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc
|
| index afdf48059cd5088f0a425a000b3eca7b978d2205..fd70b7717bb493d50b1d19b8befe23a6ca156f82 100644
|
| --- a/src/ia32/lithium-codegen-ia32.cc
|
| +++ b/src/ia32/lithium-codegen-ia32.cc
|
| @@ -781,17 +781,36 @@ bool LCodeGen::IsSmi(LConstantOperand* op) const {
|
| }
|
|
|
|
|
| +static int ArgumentsOffsetWithoutFrame(int index) {
|
| + ASSERT(index < 0);
|
| + return -(index + 1) * kPointerSize + kPCOnStackSize;
|
| +}
|
| +
|
| +
|
| Operand LCodeGen::ToOperand(LOperand* op) const {
|
| if (op->IsRegister()) return Operand(ToRegister(op));
|
| if (op->IsDoubleRegister()) return Operand(ToDoubleRegister(op));
|
| ASSERT(op->IsStackSlot() || op->IsDoubleStackSlot());
|
| - return Operand(ebp, StackSlotOffset(op->index()));
|
| + if (NeedsEagerFrame()) {
|
| + return Operand(ebp, StackSlotOffset(op->index()));
|
| + } else {
|
| + // Retrieve parameter without eager stack-frame relative to the
|
| + // stack-pointer.
|
| + return Operand(esp, ArgumentsOffsetWithoutFrame(op->index()));
|
| + }
|
| }
|
|
|
|
|
| Operand LCodeGen::HighOperand(LOperand* op) {
|
| ASSERT(op->IsDoubleStackSlot());
|
| - return Operand(ebp, StackSlotOffset(op->index()) + kPointerSize);
|
| + if (NeedsEagerFrame()) {
|
| + return Operand(ebp, StackSlotOffset(op->index()) + kPointerSize);
|
| + } else {
|
| + // Retrieve parameter without eager stack-frame relative to the
|
| + // stack-pointer.
|
| + return Operand(
|
| + esp, ArgumentsOffsetWithoutFrame(op->index()) + kPointerSize);
|
| + }
|
| }
|
|
|
|
|
| @@ -2670,6 +2689,35 @@ void LCodeGen::DoCmpHoleAndBranch(LCmpHoleAndBranch* instr) {
|
| }
|
|
|
|
|
| +void LCodeGen::DoCompareMinusZeroAndBranch(LCompareMinusZeroAndBranch* instr) {
|
| + Representation rep = instr->hydrogen()->value()->representation();
|
| + ASSERT(!rep.IsInteger32());
|
| + Register scratch = ToRegister(instr->temp());
|
| +
|
| + if (rep.IsDouble()) {
|
| + CpuFeatureScope use_sse2(masm(), SSE2);
|
| + XMMRegister value = ToDoubleRegister(instr->value());
|
| + XMMRegister xmm_scratch = double_scratch0();
|
| + __ xorps(xmm_scratch, xmm_scratch);
|
| + __ ucomisd(xmm_scratch, value);
|
| + EmitFalseBranch(instr, not_equal);
|
| + __ movmskpd(scratch, value);
|
| + __ test(scratch, Immediate(1));
|
| + EmitBranch(instr, not_zero);
|
| + } else {
|
| + Register value = ToRegister(instr->value());
|
| + Handle<Map> map = masm()->isolate()->factory()->heap_number_map();
|
| + __ CheckMap(value, map, instr->FalseLabel(chunk()), DO_SMI_CHECK);
|
| + __ cmp(FieldOperand(value, HeapNumber::kExponentOffset),
|
| + Immediate(0x80000000));
|
| + EmitFalseBranch(instr, not_equal);
|
| + __ cmp(FieldOperand(value, HeapNumber::kMantissaOffset),
|
| + Immediate(0x00000000));
|
| + EmitBranch(instr, equal);
|
| + }
|
| +}
|
| +
|
| +
|
| Condition LCodeGen::EmitIsObject(Register input,
|
| Register temp1,
|
| Label* is_not_object,
|
| @@ -4347,7 +4395,12 @@ void LCodeGen::DoCallFunction(LCallFunction* instr) {
|
|
|
| int arity = instr->arity();
|
| CallFunctionStub stub(arity, NO_CALL_FUNCTION_FLAGS);
|
| - CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| + if (instr->hydrogen()->IsTailCall()) {
|
| + if (NeedsEagerFrame()) __ leave();
|
| + __ jmp(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
|
| + } else {
|
| + CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| + }
|
| }
|
|
|
|
|
| @@ -6016,19 +6069,22 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
|
| __ push(Immediate(Smi::FromInt(size)));
|
| }
|
|
|
| + int flags = AllocateDoubleAlignFlag::encode(
|
| + instr->hydrogen()->MustAllocateDoubleAligned());
|
| if (instr->hydrogen()->IsOldPointerSpaceAllocation()) {
|
| ASSERT(!instr->hydrogen()->IsOldDataSpaceAllocation());
|
| ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
|
| - CallRuntimeFromDeferred(
|
| - Runtime::kAllocateInOldPointerSpace, 1, instr, instr->context());
|
| + flags = AllocateTargetSpace::update(flags, OLD_POINTER_SPACE);
|
| } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) {
|
| ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
|
| - CallRuntimeFromDeferred(
|
| - Runtime::kAllocateInOldDataSpace, 1, instr, instr->context());
|
| + flags = AllocateTargetSpace::update(flags, OLD_DATA_SPACE);
|
| } else {
|
| - CallRuntimeFromDeferred(
|
| - Runtime::kAllocateInNewSpace, 1, instr, instr->context());
|
| + flags = AllocateTargetSpace::update(flags, NEW_SPACE);
|
| }
|
| + __ push(Immediate(Smi::FromInt(flags)));
|
| +
|
| + CallRuntimeFromDeferred(
|
| + Runtime::kAllocateInTargetSpace, 2, instr, instr->context());
|
| __ StoreToSafepointRegisterSlot(result, eax);
|
| }
|
|
|
|
|