Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Side by Side Diff: runtime/vm/intermediate_language_mips.cc

Issue 1343373003: Revert "VM: New calling convention for generated code." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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()));
278 __ jalr(T2); 277 __ jalr(T2);
279 compiler->RecordSafepoint(locs()); 278 compiler->RecordSafepoint(locs());
280 // Marks either the continuation point in unoptimized code or the 279 // Marks either the continuation point in unoptimized code or the
281 // deoptimization point in optimized code, after call. 280 // deoptimization point in optimized code, after call.
282 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id()); 281 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id());
283 if (compiler->is_optimizing()) { 282 if (compiler->is_optimizing()) {
284 compiler->AddDeoptIndexAtCall(deopt_id_after, token_pos()); 283 compiler->AddDeoptIndexAtCall(deopt_id_after, token_pos());
285 } 284 }
286 // Add deoptimization continuation point after the call and before the 285 // Add deoptimization continuation point after the call and before the
287 // arguments are removed. 286 // arguments are removed.
(...skipping 2372 matching lines...) Expand 10 before | Expand all | Expand 10 after
2660 2659
2661 2660
2662 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2661 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2663 __ Bind(compiler->GetJumpLabel(this)); 2662 __ Bind(compiler->GetJumpLabel(this));
2664 compiler->AddExceptionHandler(catch_try_index(), 2663 compiler->AddExceptionHandler(catch_try_index(),
2665 try_index(), 2664 try_index(),
2666 compiler->assembler()->CodeSize(), 2665 compiler->assembler()->CodeSize(),
2667 catch_handler_types_, 2666 catch_handler_types_,
2668 needs_stacktrace()); 2667 needs_stacktrace());
2669 // Restore pool pointer. 2668 // Restore pool pointer.
2670 __ RestoreCodePointer(); 2669 __ GetNextPC(CMPRES1, TMP);
2671 __ LoadPoolPointer(); 2670 const intptr_t object_pool_pc_dist =
2671 Instructions::HeaderSize() - Instructions::object_pool_offset() +
2672 compiler->assembler()->CodeSize() - 1 * Instr::kInstrSize;
2673 __ LoadFromOffset(PP, CMPRES1, -object_pool_pc_dist);
2672 2674
2673 if (HasParallelMove()) { 2675 if (HasParallelMove()) {
2674 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); 2676 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
2675 } 2677 }
2676 2678
2677 // Restore SP from FP as we are coming from a throw and the code for 2679 // Restore SP from FP as we are coming from a throw and the code for
2678 // popping arguments has not been run. 2680 // popping arguments has not been run.
2679 const intptr_t fp_sp_dist = 2681 const intptr_t fp_sp_dist =
2680 (kFirstLocalSlotFromFp + 1 - compiler->StackSize()) * kWordSize; 2682 (kFirstLocalSlotFromFp + 1 - compiler->StackSize()) * kWordSize;
2681 ASSERT(fp_sp_dist <= 0); 2683 ASSERT(fp_sp_dist <= 0);
(...skipping 2736 matching lines...) Expand 10 before | Expand all | Expand 10 after
5418 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); 5420 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
5419 5421
5420 summary->set_in(0, Location::RequiresRegister()); 5422 summary->set_in(0, Location::RequiresRegister());
5421 summary->set_temp(0, Location::RequiresRegister()); 5423 summary->set_temp(0, Location::RequiresRegister());
5422 5424
5423 return summary; 5425 return summary;
5424 } 5426 }
5425 5427
5426 5428
5427 void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5429 void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5428 Register target_reg = locs()->temp_slot(0)->reg(); 5430 Register target_address_reg = locs()->temp_slot(0)->reg();
5429 5431
5430 __ GetNextPC(target_reg, TMP); 5432 // Load from [current frame pointer] + kPcMarkerSlotFromFp.
5431 const intptr_t entry_offset = 5433 __ lw(target_address_reg, Address(FP, kPcMarkerSlotFromFp * kWordSize));
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_reg, target_reg, offset_reg); 5440 __ addu(target_address_reg, target_address_reg, offset_reg);
5441 5441
5442 // Jump to the absolute address. 5442 // Jump to the absolute address.
5443 __ jr(target_reg); 5443 __ jr(target_address_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
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
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698