| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 const intptr_t kNumTemps = 0; | 350 const intptr_t kNumTemps = 0; |
| 351 LocationSummary* locs = new(zone) LocationSummary( | 351 LocationSummary* locs = new(zone) LocationSummary( |
| 352 zone, kNumInputs, kNumTemps, LocationSummary::kCall); | 352 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 353 locs->set_in(0, Location::RegisterLocation(R0)); | 353 locs->set_in(0, Location::RegisterLocation(R0)); |
| 354 locs->set_out(0, Location::RegisterLocation(R0)); | 354 locs->set_out(0, Location::RegisterLocation(R0)); |
| 355 return locs; | 355 return locs; |
| 356 } | 356 } |
| 357 | 357 |
| 358 | 358 |
| 359 static void EmitAssertBoolean(Register reg, | 359 static void EmitAssertBoolean(Register reg, |
| 360 intptr_t token_pos, | 360 TokenDescriptor token_pos, |
| 361 intptr_t deopt_id, | 361 intptr_t deopt_id, |
| 362 LocationSummary* locs, | 362 LocationSummary* locs, |
| 363 FlowGraphCompiler* compiler) { | 363 FlowGraphCompiler* compiler) { |
| 364 // Check that the type of the value is allowed in conditional context. | 364 // Check that the type of the value is allowed in conditional context. |
| 365 // Call the runtime if the object is not bool::true or bool::false. | 365 // Call the runtime if the object is not bool::true or bool::false. |
| 366 ASSERT(locs->always_calls()); | 366 ASSERT(locs->always_calls()); |
| 367 Label done; | 367 Label done; |
| 368 | 368 |
| 369 if (Isolate::Current()->flags().type_checks()) { | 369 if (Isolate::Current()->flags().type_checks()) { |
| 370 __ CompareObject(reg, Bool::True()); | 370 __ CompareObject(reg, Bool::True()); |
| (...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1679 __ Bind(entry_label()); | 1679 __ Bind(entry_label()); |
| 1680 const Code& stub = Code::ZoneHandle(compiler->zone(), | 1680 const Code& stub = Code::ZoneHandle(compiler->zone(), |
| 1681 StubCode::GetAllocationStubForClass(cls_)); | 1681 StubCode::GetAllocationStubForClass(cls_)); |
| 1682 const StubEntry stub_entry(stub); | 1682 const StubEntry stub_entry(stub); |
| 1683 | 1683 |
| 1684 LocationSummary* locs = instruction_->locs(); | 1684 LocationSummary* locs = instruction_->locs(); |
| 1685 | 1685 |
| 1686 locs->live_registers()->Remove(Location::RegisterLocation(result_)); | 1686 locs->live_registers()->Remove(Location::RegisterLocation(result_)); |
| 1687 | 1687 |
| 1688 compiler->SaveLiveRegisters(locs); | 1688 compiler->SaveLiveRegisters(locs); |
| 1689 compiler->GenerateCall(Token::kNoSourcePos, // No token position. | 1689 compiler->GenerateCall(TokenDescriptor::kNoSource, // No token position. |
| 1690 stub_entry, | 1690 stub_entry, |
| 1691 RawPcDescriptors::kOther, | 1691 RawPcDescriptors::kOther, |
| 1692 locs); | 1692 locs); |
| 1693 compiler->AddStubCallTarget(stub); | 1693 compiler->AddStubCallTarget(stub); |
| 1694 __ mov(result_, R0); | 1694 __ mov(result_, R0); |
| 1695 compiler->RestoreLiveRegisters(locs); | 1695 compiler->RestoreLiveRegisters(locs); |
| 1696 __ b(exit_label()); | 1696 __ b(exit_label()); |
| 1697 } | 1697 } |
| 1698 | 1698 |
| 1699 static void Allocate(FlowGraphCompiler* compiler, | 1699 static void Allocate(FlowGraphCompiler* compiler, |
| (...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2608 compiler->GenerateRuntimeCall(instruction_->token_pos(), | 2608 compiler->GenerateRuntimeCall(instruction_->token_pos(), |
| 2609 instruction_->deopt_id(), | 2609 instruction_->deopt_id(), |
| 2610 kStackOverflowRuntimeEntry, | 2610 kStackOverflowRuntimeEntry, |
| 2611 0, | 2611 0, |
| 2612 instruction_->locs()); | 2612 instruction_->locs()); |
| 2613 | 2613 |
| 2614 if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) { | 2614 if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) { |
| 2615 // In unoptimized code, record loop stack checks as possible OSR entries. | 2615 // In unoptimized code, record loop stack checks as possible OSR entries. |
| 2616 compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry, | 2616 compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry, |
| 2617 instruction_->deopt_id(), | 2617 instruction_->deopt_id(), |
| 2618 0); // No token position. | 2618 TokenDescriptor::kNoSource); |
| 2619 } | 2619 } |
| 2620 compiler->pending_deoptimization_env_ = NULL; | 2620 compiler->pending_deoptimization_env_ = NULL; |
| 2621 compiler->RestoreLiveRegisters(instruction_->locs()); | 2621 compiler->RestoreLiveRegisters(instruction_->locs()); |
| 2622 __ b(exit_label()); | 2622 __ b(exit_label()); |
| 2623 } | 2623 } |
| 2624 | 2624 |
| 2625 Label* osr_entry_label() { | 2625 Label* osr_entry_label() { |
| 2626 ASSERT(FLAG_use_osr); | 2626 ASSERT(FLAG_use_osr); |
| 2627 return &osr_entry_label_; | 2627 return &osr_entry_label_; |
| 2628 } | 2628 } |
| (...skipping 2778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5407 | 5407 |
| 5408 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5408 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5409 if (!compiler->is_optimizing()) { | 5409 if (!compiler->is_optimizing()) { |
| 5410 if (FLAG_emit_edge_counters) { | 5410 if (FLAG_emit_edge_counters) { |
| 5411 compiler->EmitEdgeCounter(block()->preorder_number()); | 5411 compiler->EmitEdgeCounter(block()->preorder_number()); |
| 5412 } | 5412 } |
| 5413 // Add a deoptimization descriptor for deoptimizing instructions that | 5413 // Add a deoptimization descriptor for deoptimizing instructions that |
| 5414 // may be inserted before this instruction. | 5414 // may be inserted before this instruction. |
| 5415 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, | 5415 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
| 5416 GetDeoptId(), | 5416 GetDeoptId(), |
| 5417 Token::kNoSourcePos); | 5417 TokenDescriptor::kNoSource); |
| 5418 } | 5418 } |
| 5419 if (HasParallelMove()) { | 5419 if (HasParallelMove()) { |
| 5420 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 5420 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
| 5421 } | 5421 } |
| 5422 | 5422 |
| 5423 // We can fall through if the successor is the next block in the list. | 5423 // We can fall through if the successor is the next block in the list. |
| 5424 // Otherwise, we need a jump. | 5424 // Otherwise, we need a jump. |
| 5425 if (!compiler->CanFallThroughTo(successor())) { | 5425 if (!compiler->CanFallThroughTo(successor())) { |
| 5426 __ b(compiler->GetJumpLabel(successor())); | 5426 __ b(compiler->GetJumpLabel(successor())); |
| 5427 } | 5427 } |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5609 locs->set_out(0, Location::RegisterLocation(R0)); | 5609 locs->set_out(0, Location::RegisterLocation(R0)); |
| 5610 return locs; | 5610 return locs; |
| 5611 } | 5611 } |
| 5612 | 5612 |
| 5613 | 5613 |
| 5614 void GrowRegExpStackInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5614 void GrowRegExpStackInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5615 const Register typed_data = locs()->in(0).reg(); | 5615 const Register typed_data = locs()->in(0).reg(); |
| 5616 const Register result = locs()->out(0).reg(); | 5616 const Register result = locs()->out(0).reg(); |
| 5617 __ PushObject(Object::null_object()); | 5617 __ PushObject(Object::null_object()); |
| 5618 __ Push(typed_data); | 5618 __ Push(typed_data); |
| 5619 compiler->GenerateRuntimeCall(Token::kNoSourcePos, // No token position. | 5619 compiler->GenerateRuntimeCall(TokenDescriptor::kNoSource, |
| 5620 deopt_id(), | 5620 deopt_id(), |
| 5621 kGrowRegExpStackRuntimeEntry, | 5621 kGrowRegExpStackRuntimeEntry, |
| 5622 1, | 5622 1, |
| 5623 locs()); | 5623 locs()); |
| 5624 __ Drop(1); | 5624 __ Drop(1); |
| 5625 __ Pop(result); | 5625 __ Pop(result); |
| 5626 } | 5626 } |
| 5627 | 5627 |
| 5628 | 5628 |
| 5629 } // namespace dart | 5629 } // namespace dart |
| 5630 | 5630 |
| 5631 #endif // defined TARGET_ARCH_ARM64 | 5631 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |