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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 Array::ZoneHandle(ArgumentsDescriptor::New(argument_count, | 267 Array::ZoneHandle(ArgumentsDescriptor::New(argument_count, |
268 argument_names())); | 268 argument_names())); |
269 __ LoadObject(S4, arguments_descriptor); | 269 __ LoadObject(S4, arguments_descriptor); |
270 | 270 |
271 // Load closure function code in T2. | 271 // Load closure function code in T2. |
272 // S4: arguments descriptor array. | 272 // S4: arguments descriptor array. |
273 // S5: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). | 273 // S5: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). |
274 ASSERT(locs()->in(0).reg() == T0); | 274 ASSERT(locs()->in(0).reg() == T0); |
275 __ LoadImmediate(S5, 0); | 275 __ LoadImmediate(S5, 0); |
276 __ lw(T2, FieldAddress(T0, Function::entry_point_offset())); | 276 __ lw(T2, FieldAddress(T0, Function::entry_point_offset())); |
| 277 __ lw(CODE_REG, FieldAddress(T0, Function::code_offset())); |
277 __ jalr(T2); | 278 __ jalr(T2); |
278 compiler->RecordSafepoint(locs()); | 279 compiler->RecordSafepoint(locs()); |
279 // Marks either the continuation point in unoptimized code or the | 280 // Marks either the continuation point in unoptimized code or the |
280 // deoptimization point in optimized code, after call. | 281 // deoptimization point in optimized code, after call. |
281 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id()); | 282 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id()); |
282 if (compiler->is_optimizing()) { | 283 if (compiler->is_optimizing()) { |
283 compiler->AddDeoptIndexAtCall(deopt_id_after, token_pos()); | 284 compiler->AddDeoptIndexAtCall(deopt_id_after, token_pos()); |
284 } | 285 } |
285 // Add deoptimization continuation point after the call and before the | 286 // Add deoptimization continuation point after the call and before the |
286 // arguments are removed. | 287 // arguments are removed. |
(...skipping 2372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2659 | 2660 |
2660 | 2661 |
2661 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2662 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2662 __ Bind(compiler->GetJumpLabel(this)); | 2663 __ Bind(compiler->GetJumpLabel(this)); |
2663 compiler->AddExceptionHandler(catch_try_index(), | 2664 compiler->AddExceptionHandler(catch_try_index(), |
2664 try_index(), | 2665 try_index(), |
2665 compiler->assembler()->CodeSize(), | 2666 compiler->assembler()->CodeSize(), |
2666 catch_handler_types_, | 2667 catch_handler_types_, |
2667 needs_stacktrace()); | 2668 needs_stacktrace()); |
2668 // Restore pool pointer. | 2669 // Restore pool pointer. |
2669 __ GetNextPC(CMPRES1, TMP); | 2670 __ RestoreCodePointer(); |
2670 const intptr_t object_pool_pc_dist = | 2671 __ LoadPoolPointer(); |
2671 Instructions::HeaderSize() - Instructions::object_pool_offset() + | |
2672 compiler->assembler()->CodeSize() - 1 * Instr::kInstrSize; | |
2673 __ LoadFromOffset(PP, CMPRES1, -object_pool_pc_dist); | |
2674 | 2672 |
2675 if (HasParallelMove()) { | 2673 if (HasParallelMove()) { |
2676 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 2674 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
2677 } | 2675 } |
2678 | 2676 |
2679 // Restore SP from FP as we are coming from a throw and the code for | 2677 // Restore SP from FP as we are coming from a throw and the code for |
2680 // popping arguments has not been run. | 2678 // popping arguments has not been run. |
2681 const intptr_t fp_sp_dist = | 2679 const intptr_t fp_sp_dist = |
2682 (kFirstLocalSlotFromFp + 1 - compiler->StackSize()) * kWordSize; | 2680 (kFirstLocalSlotFromFp + 1 - compiler->StackSize()) * kWordSize; |
2683 ASSERT(fp_sp_dist <= 0); | 2681 ASSERT(fp_sp_dist <= 0); |
(...skipping 2736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5420 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5418 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5421 | 5419 |
5422 summary->set_in(0, Location::RequiresRegister()); | 5420 summary->set_in(0, Location::RequiresRegister()); |
5423 summary->set_temp(0, Location::RequiresRegister()); | 5421 summary->set_temp(0, Location::RequiresRegister()); |
5424 | 5422 |
5425 return summary; | 5423 return summary; |
5426 } | 5424 } |
5427 | 5425 |
5428 | 5426 |
5429 void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5427 void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5430 Register target_address_reg = locs()->temp_slot(0)->reg(); | 5428 Register target_reg = locs()->temp_slot(0)->reg(); |
5431 | 5429 |
5432 // Load from [current frame pointer] + kPcMarkerSlotFromFp. | 5430 __ GetNextPC(target_reg, TMP); |
5433 __ lw(target_address_reg, Address(FP, kPcMarkerSlotFromFp * kWordSize)); | 5431 const intptr_t entry_offset = |
| 5432 __ CodeSize() - 1 * Instr::kInstrSize; |
| 5433 __ AddImmediate(target_reg, target_reg, -entry_offset); |
5434 | 5434 |
5435 // Add the offset. | 5435 // Add the offset. |
5436 Register offset_reg = locs()->in(0).reg(); | 5436 Register offset_reg = locs()->in(0).reg(); |
5437 if (offset()->definition()->representation() == kTagged) { | 5437 if (offset()->definition()->representation() == kTagged) { |
5438 __ SmiUntag(offset_reg); | 5438 __ SmiUntag(offset_reg); |
5439 } | 5439 } |
5440 __ addu(target_address_reg, target_address_reg, offset_reg); | 5440 __ addu(target_reg, target_reg, offset_reg); |
5441 | 5441 |
5442 // Jump to the absolute address. | 5442 // Jump to the absolute address. |
5443 __ jr(target_address_reg); | 5443 __ jr(target_reg); |
5444 } | 5444 } |
5445 | 5445 |
5446 | 5446 |
5447 LocationSummary* StrictCompareInstr::MakeLocationSummary(Zone* zone, | 5447 LocationSummary* StrictCompareInstr::MakeLocationSummary(Zone* zone, |
5448 bool opt) const { | 5448 bool opt) const { |
5449 const intptr_t kNumInputs = 2; | 5449 const intptr_t kNumInputs = 2; |
5450 const intptr_t kNumTemps = 0; | 5450 const intptr_t kNumTemps = 0; |
5451 if (needs_number_check()) { | 5451 if (needs_number_check()) { |
5452 LocationSummary* locs = new(zone) LocationSummary( | 5452 LocationSummary* locs = new(zone) LocationSummary( |
5453 zone, kNumInputs, kNumTemps, LocationSummary::kCall); | 5453 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5603 1, | 5603 1, |
5604 locs()); | 5604 locs()); |
5605 __ lw(result, Address(SP, 1 * kWordSize)); | 5605 __ lw(result, Address(SP, 1 * kWordSize)); |
5606 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 5606 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
5607 } | 5607 } |
5608 | 5608 |
5609 | 5609 |
5610 } // namespace dart | 5610 } // namespace dart |
5611 | 5611 |
5612 #endif // defined TARGET_ARCH_MIPS | 5612 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |