| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 const intptr_t kNumTemps = 0; | 411 const intptr_t kNumTemps = 0; |
| 412 LocationSummary* locs = new(zone) LocationSummary( | 412 LocationSummary* locs = new(zone) LocationSummary( |
| 413 zone, kNumInputs, kNumTemps, LocationSummary::kCall); | 413 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 414 locs->set_in(0, Location::RegisterLocation(A0)); | 414 locs->set_in(0, Location::RegisterLocation(A0)); |
| 415 locs->set_out(0, Location::RegisterLocation(A0)); | 415 locs->set_out(0, Location::RegisterLocation(A0)); |
| 416 return locs; | 416 return locs; |
| 417 } | 417 } |
| 418 | 418 |
| 419 | 419 |
| 420 static void EmitAssertBoolean(Register reg, | 420 static void EmitAssertBoolean(Register reg, |
| 421 intptr_t token_pos, | 421 TokenPosition token_pos, |
| 422 intptr_t deopt_id, | 422 intptr_t deopt_id, |
| 423 LocationSummary* locs, | 423 LocationSummary* locs, |
| 424 FlowGraphCompiler* compiler) { | 424 FlowGraphCompiler* compiler) { |
| 425 // Check that the type of the value is allowed in conditional context. | 425 // Check that the type of the value is allowed in conditional context. |
| 426 // Call the runtime if the object is not bool::true or bool::false. | 426 // Call the runtime if the object is not bool::true or bool::false. |
| 427 ASSERT(locs->always_calls()); | 427 ASSERT(locs->always_calls()); |
| 428 Label done; | 428 Label done; |
| 429 | 429 |
| 430 if (Isolate::Current()->flags().type_checks()) { | 430 if (Isolate::Current()->flags().type_checks()) { |
| 431 __ BranchEqual(reg, Bool::True(), &done); | 431 __ BranchEqual(reg, Bool::True(), &done); |
| (...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1844 } | 1844 } |
| 1845 __ Bind(entry_label()); | 1845 __ Bind(entry_label()); |
| 1846 const Code& stub = Code::ZoneHandle( | 1846 const Code& stub = Code::ZoneHandle( |
| 1847 compiler->zone(), StubCode::GetAllocationStubForClass(cls_)); | 1847 compiler->zone(), StubCode::GetAllocationStubForClass(cls_)); |
| 1848 const StubEntry stub_entry(stub); | 1848 const StubEntry stub_entry(stub); |
| 1849 | 1849 |
| 1850 LocationSummary* locs = instruction_->locs(); | 1850 LocationSummary* locs = instruction_->locs(); |
| 1851 locs->live_registers()->Remove(Location::RegisterLocation(result_)); | 1851 locs->live_registers()->Remove(Location::RegisterLocation(result_)); |
| 1852 | 1852 |
| 1853 compiler->SaveLiveRegisters(locs); | 1853 compiler->SaveLiveRegisters(locs); |
| 1854 compiler->GenerateCall(Token::kNoSourcePos, // No token position. | 1854 compiler->GenerateCall(TokenPosition::kNoSource, // No token position. |
| 1855 stub_entry, | 1855 stub_entry, |
| 1856 RawPcDescriptors::kOther, | 1856 RawPcDescriptors::kOther, |
| 1857 locs); | 1857 locs); |
| 1858 compiler->AddStubCallTarget(stub); | 1858 compiler->AddStubCallTarget(stub); |
| 1859 if (result_ != V0) { | 1859 if (result_ != V0) { |
| 1860 __ mov(result_, V0); | 1860 __ mov(result_, V0); |
| 1861 } | 1861 } |
| 1862 compiler->RestoreLiveRegisters(locs); | 1862 compiler->RestoreLiveRegisters(locs); |
| 1863 __ b(exit_label()); | 1863 __ b(exit_label()); |
| 1864 } | 1864 } |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2718 compiler->GenerateRuntimeCall(instruction_->token_pos(), | 2718 compiler->GenerateRuntimeCall(instruction_->token_pos(), |
| 2719 instruction_->deopt_id(), | 2719 instruction_->deopt_id(), |
| 2720 kStackOverflowRuntimeEntry, | 2720 kStackOverflowRuntimeEntry, |
| 2721 0, | 2721 0, |
| 2722 instruction_->locs()); | 2722 instruction_->locs()); |
| 2723 | 2723 |
| 2724 if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) { | 2724 if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) { |
| 2725 // In unoptimized code, record loop stack checks as possible OSR entries. | 2725 // In unoptimized code, record loop stack checks as possible OSR entries. |
| 2726 compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry, | 2726 compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry, |
| 2727 instruction_->deopt_id(), | 2727 instruction_->deopt_id(), |
| 2728 0); // No token position. | 2728 TokenPosition::kNoSource); |
| 2729 } | 2729 } |
| 2730 compiler->pending_deoptimization_env_ = NULL; | 2730 compiler->pending_deoptimization_env_ = NULL; |
| 2731 compiler->RestoreLiveRegisters(instruction_->locs()); | 2731 compiler->RestoreLiveRegisters(instruction_->locs()); |
| 2732 __ b(exit_label()); | 2732 __ b(exit_label()); |
| 2733 } | 2733 } |
| 2734 | 2734 |
| 2735 Label* osr_entry_label() { | 2735 Label* osr_entry_label() { |
| 2736 ASSERT(FLAG_use_osr); | 2736 ASSERT(FLAG_use_osr); |
| 2737 return &osr_entry_label_; | 2737 return &osr_entry_label_; |
| 2738 } | 2738 } |
| (...skipping 2635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5374 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5374 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5375 __ Comment("GotoInstr"); | 5375 __ Comment("GotoInstr"); |
| 5376 if (!compiler->is_optimizing()) { | 5376 if (!compiler->is_optimizing()) { |
| 5377 if (FLAG_emit_edge_counters) { | 5377 if (FLAG_emit_edge_counters) { |
| 5378 compiler->EmitEdgeCounter(block()->preorder_number()); | 5378 compiler->EmitEdgeCounter(block()->preorder_number()); |
| 5379 } | 5379 } |
| 5380 // Add a deoptimization descriptor for deoptimizing instructions that | 5380 // Add a deoptimization descriptor for deoptimizing instructions that |
| 5381 // may be inserted before this instruction. | 5381 // may be inserted before this instruction. |
| 5382 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, | 5382 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
| 5383 GetDeoptId(), | 5383 GetDeoptId(), |
| 5384 Token::kNoSourcePos); | 5384 TokenPosition::kNoSource); |
| 5385 } | 5385 } |
| 5386 if (HasParallelMove()) { | 5386 if (HasParallelMove()) { |
| 5387 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 5387 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
| 5388 } | 5388 } |
| 5389 | 5389 |
| 5390 // We can fall through if the successor is the next block in the list. | 5390 // We can fall through if the successor is the next block in the list. |
| 5391 // Otherwise, we need a jump. | 5391 // Otherwise, we need a jump. |
| 5392 if (!compiler->CanFallThroughTo(successor())) { | 5392 if (!compiler->CanFallThroughTo(successor())) { |
| 5393 __ b(compiler->GetJumpLabel(successor())); | 5393 __ b(compiler->GetJumpLabel(successor())); |
| 5394 } | 5394 } |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5576 | 5576 |
| 5577 | 5577 |
| 5578 void GrowRegExpStackInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5578 void GrowRegExpStackInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5579 const Register typed_data = locs()->in(0).reg(); | 5579 const Register typed_data = locs()->in(0).reg(); |
| 5580 const Register result = locs()->out(0).reg(); | 5580 const Register result = locs()->out(0).reg(); |
| 5581 __ Comment("GrowRegExpStackInstr"); | 5581 __ Comment("GrowRegExpStackInstr"); |
| 5582 __ addiu(SP, SP, Immediate(-2 * kWordSize)); | 5582 __ addiu(SP, SP, Immediate(-2 * kWordSize)); |
| 5583 __ LoadObject(TMP, Object::null_object()); | 5583 __ LoadObject(TMP, Object::null_object()); |
| 5584 __ sw(TMP, Address(SP, 1 * kWordSize)); | 5584 __ sw(TMP, Address(SP, 1 * kWordSize)); |
| 5585 __ sw(typed_data, Address(SP, 0 * kWordSize)); | 5585 __ sw(typed_data, Address(SP, 0 * kWordSize)); |
| 5586 compiler->GenerateRuntimeCall(Token::kNoSourcePos, // No token position. | 5586 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, |
| 5587 deopt_id(), | 5587 deopt_id(), |
| 5588 kGrowRegExpStackRuntimeEntry, | 5588 kGrowRegExpStackRuntimeEntry, |
| 5589 1, | 5589 1, |
| 5590 locs()); | 5590 locs()); |
| 5591 __ lw(result, Address(SP, 1 * kWordSize)); | 5591 __ lw(result, Address(SP, 1 * kWordSize)); |
| 5592 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 5592 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
| 5593 } | 5593 } |
| 5594 | 5594 |
| 5595 | 5595 |
| 5596 } // namespace dart | 5596 } // namespace dart |
| 5597 | 5597 |
| 5598 #endif // defined TARGET_ARCH_MIPS | 5598 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |