| Index: runtime/vm/flow_graph_compiler_arm64.cc
|
| ===================================================================
|
| --- runtime/vm/flow_graph_compiler_arm64.cc (revision 39726)
|
| +++ runtime/vm/flow_graph_compiler_arm64.cc (working copy)
|
| @@ -55,6 +55,20 @@
|
| }
|
|
|
|
|
| +void FlowGraphCompiler::EnterIntrinsicMode() {
|
| + ASSERT(!intrinsic_mode());
|
| + intrinsic_mode_ = true;
|
| + assembler()->set_allow_constant_pool(false);
|
| +}
|
| +
|
| +
|
| +void FlowGraphCompiler::ExitIntrinsicMode() {
|
| + ASSERT(intrinsic_mode());
|
| + intrinsic_mode_ = false;
|
| + assembler()->set_allow_constant_pool(true);
|
| +}
|
| +
|
| +
|
| RawDeoptInfo* CompilerDeoptInfo::CreateDeoptInfo(FlowGraphCompiler* compiler,
|
| DeoptInfoBuilder* builder,
|
| const Array& deopt_table) {
|
| @@ -1521,18 +1535,20 @@
|
| } else {
|
| ASSERT(destination.IsStackSlot());
|
| const intptr_t dest_offset = destination.ToStackSlotOffset();
|
| - __ StoreToOffset(source.reg(), FP, dest_offset, PP);
|
| + __ StoreToOffset(source.reg(), destination.base_reg(), dest_offset, PP);
|
| }
|
| } else if (source.IsStackSlot()) {
|
| if (destination.IsRegister()) {
|
| const intptr_t source_offset = source.ToStackSlotOffset();
|
| - __ LoadFromOffset(destination.reg(), FP, source_offset, PP);
|
| + __ LoadFromOffset(
|
| + destination.reg(), source.base_reg(), source_offset, PP);
|
| } else {
|
| ASSERT(destination.IsStackSlot());
|
| const intptr_t source_offset = source.ToStackSlotOffset();
|
| const intptr_t dest_offset = destination.ToStackSlotOffset();
|
| - __ LoadFromOffset(TMP, FP, source_offset, PP);
|
| - __ StoreToOffset(TMP, FP, dest_offset, PP);
|
| + ScratchRegisterScope tmp(this, kNoRegister);
|
| + __ LoadFromOffset(tmp.reg(), source.base_reg(), source_offset, PP);
|
| + __ StoreToOffset(tmp.reg(), destination.base_reg(), dest_offset, PP);
|
| }
|
| } else if (source.IsFpuRegister()) {
|
| if (destination.IsFpuRegister()) {
|
| @@ -1541,35 +1557,37 @@
|
| if (destination.IsDoubleStackSlot()) {
|
| const intptr_t dest_offset = destination.ToStackSlotOffset();
|
| VRegister src = source.fpu_reg();
|
| - __ StoreDToOffset(src, FP, dest_offset, PP);
|
| + __ StoreDToOffset(src, destination.base_reg(), dest_offset, PP);
|
| } else {
|
| ASSERT(destination.IsQuadStackSlot());
|
| const intptr_t dest_offset = destination.ToStackSlotOffset();
|
| - __ StoreQToOffset(source.fpu_reg(), FP, dest_offset, PP);
|
| + __ StoreQToOffset(
|
| + source.fpu_reg(), destination.base_reg(), dest_offset, PP);
|
| }
|
| }
|
| } else if (source.IsDoubleStackSlot()) {
|
| if (destination.IsFpuRegister()) {
|
| - const intptr_t dest_offset = source.ToStackSlotOffset();
|
| + const intptr_t source_offset = source.ToStackSlotOffset();
|
| const VRegister dst = destination.fpu_reg();
|
| - __ LoadDFromOffset(dst, FP, dest_offset, PP);
|
| + __ LoadDFromOffset(dst, source.base_reg(), source_offset, PP);
|
| } else {
|
| ASSERT(destination.IsDoubleStackSlot());
|
| const intptr_t source_offset = source.ToStackSlotOffset();
|
| const intptr_t dest_offset = destination.ToStackSlotOffset();
|
| - __ LoadDFromOffset(VTMP, FP, source_offset, PP);
|
| - __ StoreDToOffset(VTMP, FP, dest_offset, PP);
|
| + __ LoadDFromOffset(VTMP, source.base_reg(), source_offset, PP);
|
| + __ StoreDToOffset(VTMP, destination.base_reg(), dest_offset, PP);
|
| }
|
| } else if (source.IsQuadStackSlot()) {
|
| if (destination.IsFpuRegister()) {
|
| - const intptr_t dest_offset = source.ToStackSlotOffset();
|
| - __ LoadQFromOffset(destination.fpu_reg(), FP, dest_offset, PP);
|
| + const intptr_t source_offset = source.ToStackSlotOffset();
|
| + __ LoadQFromOffset(
|
| + destination.fpu_reg(), source.base_reg(), source_offset, PP);
|
| } else {
|
| ASSERT(destination.IsQuadStackSlot());
|
| const intptr_t source_offset = source.ToStackSlotOffset();
|
| const intptr_t dest_offset = destination.ToStackSlotOffset();
|
| - __ LoadQFromOffset(VTMP, FP, source_offset, PP);
|
| - __ StoreQToOffset(VTMP, FP, dest_offset, PP);
|
| + __ LoadQFromOffset(VTMP, source.base_reg(), source_offset, PP);
|
| + __ StoreQToOffset(VTMP, destination.base_reg(), dest_offset, PP);
|
| }
|
| } else {
|
| ASSERT(source.IsConstant());
|
| @@ -1581,23 +1599,26 @@
|
| if (Utils::DoublesBitEqual(Double::Cast(constant).value(), 0.0)) {
|
| __ veor(dst, dst, dst);
|
| } else {
|
| - __ LoadObject(TMP, constant, PP);
|
| - __ LoadDFieldFromOffset(dst, TMP, Double::value_offset(), PP);
|
| + ScratchRegisterScope tmp(this, kNoRegister);
|
| + __ LoadObject(tmp.reg(), constant, PP);
|
| + __ LoadDFieldFromOffset(dst, tmp.reg(), Double::value_offset(), PP);
|
| }
|
| } else if (destination.IsDoubleStackSlot()) {
|
| if (Utils::DoublesBitEqual(Double::Cast(constant).value(), 0.0)) {
|
| __ veor(VTMP, VTMP, VTMP);
|
| } else {
|
| - __ LoadObject(TMP, constant, PP);
|
| - __ LoadDFieldFromOffset(VTMP, TMP, Double::value_offset(), PP);
|
| + ScratchRegisterScope tmp(this, kNoRegister);
|
| + __ LoadObject(tmp.reg(), constant, PP);
|
| + __ LoadDFieldFromOffset(VTMP, tmp.reg(), Double::value_offset(), PP);
|
| }
|
| const intptr_t dest_offset = destination.ToStackSlotOffset();
|
| - __ StoreDToOffset(VTMP, FP, dest_offset, PP);
|
| + __ StoreDToOffset(VTMP, destination.base_reg(), dest_offset, PP);
|
| } else {
|
| ASSERT(destination.IsStackSlot());
|
| const intptr_t dest_offset = destination.ToStackSlotOffset();
|
| - __ LoadObject(TMP, constant, PP);
|
| - __ StoreToOffset(TMP, FP, dest_offset, PP);
|
| + ScratchRegisterScope tmp(this, kNoRegister);
|
| + __ LoadObject(tmp.reg(), constant, PP);
|
| + __ StoreToOffset(tmp.reg(), destination.base_reg(), dest_offset, PP);
|
| }
|
| }
|
|
|
| @@ -1617,11 +1638,14 @@
|
| __ mov(source.reg(), destination.reg());
|
| __ mov(destination.reg(), TMP);
|
| } else if (source.IsRegister() && destination.IsStackSlot()) {
|
| - Exchange(source.reg(), destination.ToStackSlotOffset());
|
| + Exchange(source.reg(),
|
| + destination.base_reg(), destination.ToStackSlotOffset());
|
| } else if (source.IsStackSlot() && destination.IsRegister()) {
|
| - Exchange(destination.reg(), source.ToStackSlotOffset());
|
| + Exchange(destination.reg(),
|
| + source.base_reg(), source.ToStackSlotOffset());
|
| } else if (source.IsStackSlot() && destination.IsStackSlot()) {
|
| - Exchange(source.ToStackSlotOffset(), destination.ToStackSlotOffset());
|
| + Exchange(source.base_reg(), source.ToStackSlotOffset(),
|
| + destination.base_reg(), destination.ToStackSlotOffset());
|
| } else if (source.IsFpuRegister() && destination.IsFpuRegister()) {
|
| const VRegister dst = destination.fpu_reg();
|
| const VRegister src = source.fpu_reg();
|
| @@ -1684,12 +1708,12 @@
|
|
|
| void ParallelMoveResolver::MoveMemoryToMemory(const Address& dst,
|
| const Address& src) {
|
| - UNIMPLEMENTED();
|
| + UNREACHABLE();
|
| }
|
|
|
|
|
| void ParallelMoveResolver::StoreObject(const Address& dst, const Object& obj) {
|
| - UNIMPLEMENTED();
|
| + UNREACHABLE();
|
| }
|
|
|
|
|
| @@ -1707,34 +1731,46 @@
|
| }
|
|
|
|
|
| -void ParallelMoveResolver::Exchange(Register reg, intptr_t stack_offset) {
|
| - UNIMPLEMENTED();
|
| +void ParallelMoveResolver::Exchange(Register reg,
|
| + Register base_reg,
|
| + intptr_t stack_offset) {
|
| + ScratchRegisterScope tmp(this, kNoRegister);
|
| + __ mov(tmp.reg(), reg);
|
| + __ LoadFromOffset(reg, base_reg, stack_offset, PP);
|
| + __ StoreToOffset(tmp.reg(), base_reg, stack_offset, PP);
|
| }
|
|
|
|
|
| -void ParallelMoveResolver::Exchange(intptr_t stack_offset1,
|
| +void ParallelMoveResolver::Exchange(Register base_reg1,
|
| + intptr_t stack_offset1,
|
| + Register base_reg2,
|
| intptr_t stack_offset2) {
|
| - UNIMPLEMENTED();
|
| + ScratchRegisterScope tmp1(this, kNoRegister);
|
| + ScratchRegisterScope tmp2(this, tmp1.reg());
|
| + __ LoadFromOffset(tmp1.reg(), base_reg1, stack_offset1, PP);
|
| + __ LoadFromOffset(tmp2.reg(), base_reg2, stack_offset2, PP);
|
| + __ StoreToOffset(tmp1.reg(), base_reg2, stack_offset2, PP);
|
| + __ StoreToOffset(tmp2.reg(), base_reg1, stack_offset1, PP);
|
| }
|
|
|
|
|
| void ParallelMoveResolver::SpillScratch(Register reg) {
|
| - UNIMPLEMENTED();
|
| + __ Push(reg);
|
| }
|
|
|
|
|
| void ParallelMoveResolver::RestoreScratch(Register reg) {
|
| - UNIMPLEMENTED();
|
| + __ Pop(reg);
|
| }
|
|
|
|
|
| void ParallelMoveResolver::SpillFpuScratch(FpuRegister reg) {
|
| - UNIMPLEMENTED();
|
| + __ PushDouble(reg);
|
| }
|
|
|
|
|
| void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) {
|
| - UNIMPLEMENTED();
|
| + __ PopDouble(reg);
|
| }
|
|
|
|
|
|
|