| Index: src/arm/lithium-codegen-arm.cc
|
| diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
|
| index 348b8ce20df764279b84963c12d6bc99b3aea259..56717a29e129e19071133d6fecb60db19bfbad56 100644
|
| --- a/src/arm/lithium-codegen-arm.cc
|
| +++ b/src/arm/lithium-codegen-arm.cc
|
| @@ -509,17 +509,36 @@ Operand LCodeGen::ToOperand(LOperand* op) {
|
| }
|
|
|
|
|
| +static int ArgumentsOffsetWithoutFrame(int index) {
|
| + ASSERT(index < 0);
|
| + return -(index + 1) * kPointerSize;
|
| +}
|
| +
|
| +
|
| MemOperand LCodeGen::ToMemOperand(LOperand* op) const {
|
| ASSERT(!op->IsRegister());
|
| ASSERT(!op->IsDoubleRegister());
|
| ASSERT(op->IsStackSlot() || op->IsDoubleStackSlot());
|
| - return MemOperand(fp, StackSlotOffset(op->index()));
|
| + if (NeedsEagerFrame()) {
|
| + return MemOperand(fp, StackSlotOffset(op->index()));
|
| + } else {
|
| + // Retrieve parameter without eager stack-frame relative to the
|
| + // stack-pointer.
|
| + return MemOperand(sp, ArgumentsOffsetWithoutFrame(op->index()));
|
| + }
|
| }
|
|
|
|
|
| MemOperand LCodeGen::ToHighMemOperand(LOperand* op) const {
|
| ASSERT(op->IsDoubleStackSlot());
|
| - return MemOperand(fp, StackSlotOffset(op->index()) + kPointerSize);
|
| + if (NeedsEagerFrame()) {
|
| + return MemOperand(fp, StackSlotOffset(op->index()) + kPointerSize);
|
| + } else {
|
| + // Retrieve parameter without eager stack-frame relative to the
|
| + // stack-pointer.
|
| + return MemOperand(
|
| + sp, ArgumentsOffsetWithoutFrame(op->index()) + kPointerSize);
|
| + }
|
| }
|
|
|
|
|
| @@ -2472,6 +2491,33 @@ 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()) {
|
| + DwVfpRegister value = ToDoubleRegister(instr->value());
|
| + __ VFPCompareAndSetFlags(value, 0.0);
|
| + EmitFalseBranch(instr, ne);
|
| + __ VmovHigh(scratch, value);
|
| + __ cmp(scratch, Operand(0x80000000));
|
| + } else {
|
| + Register value = ToRegister(instr->value());
|
| + __ CheckMap(value,
|
| + scratch,
|
| + Heap::kHeapNumberMapRootIndex,
|
| + instr->FalseLabel(chunk()),
|
| + DO_SMI_CHECK);
|
| + __ ldr(scratch, FieldMemOperand(value, HeapNumber::kExponentOffset));
|
| + __ ldr(ip, FieldMemOperand(value, HeapNumber::kMantissaOffset));
|
| + __ cmp(scratch, Operand(0x80000000));
|
| + __ cmp(ip, Operand(0x00000000), eq);
|
| + }
|
| + EmitBranch(instr, eq);
|
| +}
|
| +
|
| +
|
| Condition LCodeGen::EmitIsObject(Register input,
|
| Register temp1,
|
| Label* is_not_object,
|
| @@ -4080,7 +4126,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()) __ mov(sp, fp);
|
| + __ Jump(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
|
| + } else {
|
| + CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| + }
|
| }
|
|
|
|
|
| @@ -5446,19 +5497,22 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
|
| __ Push(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(Smi::FromInt(flags));
|
| +
|
| + CallRuntimeFromDeferred(
|
| + Runtime::kAllocateInTargetSpace, 2, instr, instr->context());
|
| __ StoreToSafepointRegisterSlot(r0, result);
|
| }
|
|
|
|
|