| 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 1819 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1830 class BoxAllocationSlowPath : public SlowPathCode { | 1830 class BoxAllocationSlowPath : public SlowPathCode { | 
| 1831  public: | 1831  public: | 
| 1832   BoxAllocationSlowPath(Instruction* instruction, | 1832   BoxAllocationSlowPath(Instruction* instruction, | 
| 1833                         const Class& cls, | 1833                         const Class& cls, | 
| 1834                         Register result) | 1834                         Register result) | 
| 1835       : instruction_(instruction), | 1835       : instruction_(instruction), | 
| 1836         cls_(cls), | 1836         cls_(cls), | 
| 1837         result_(result) { } | 1837         result_(result) { } | 
| 1838 | 1838 | 
| 1839   virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 1839   virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 
| 1840     Isolate* isolate = compiler->isolate(); |  | 
| 1841 |  | 
| 1842     if (Assembler::EmittingComments()) { | 1840     if (Assembler::EmittingComments()) { | 
| 1843       __ Comment("%s slow path allocation of %s", | 1841       __ Comment("%s slow path allocation of %s", | 
| 1844                  instruction_->DebugName(), | 1842                  instruction_->DebugName(), | 
| 1845                  String::Handle(cls_.PrettyName()).ToCString()); | 1843                  String::Handle(cls_.PrettyName()).ToCString()); | 
| 1846     } | 1844     } | 
| 1847     __ Bind(entry_label()); | 1845     __ Bind(entry_label()); | 
| 1848     const Code& stub = | 1846     const Code& stub = Code::ZoneHandle( | 
| 1849         Code::Handle(isolate, StubCode::GetAllocationStubForClass(cls_)); | 1847         compiler->zone(), StubCode::GetAllocationStubForClass(cls_)); | 
| 1850     const StubEntry stub_entry(stub); | 1848     const StubEntry stub_entry(stub); | 
| 1851 | 1849 | 
| 1852     LocationSummary* locs = instruction_->locs(); | 1850     LocationSummary* locs = instruction_->locs(); | 
| 1853     locs->live_registers()->Remove(Location::RegisterLocation(result_)); | 1851     locs->live_registers()->Remove(Location::RegisterLocation(result_)); | 
| 1854 | 1852 | 
| 1855     compiler->SaveLiveRegisters(locs); | 1853     compiler->SaveLiveRegisters(locs); | 
| 1856     compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position. | 1854     compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position. | 
| 1857                            stub_entry, | 1855                            stub_entry, | 
| 1858                            RawPcDescriptors::kOther, | 1856                            RawPcDescriptors::kOther, | 
| 1859                            locs); | 1857                            locs); | 
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2239                                     2, | 2237                                     2, | 
| 2240                                     locs()); | 2238                                     locs()); | 
| 2241       __ Drop(2); | 2239       __ Drop(2); | 
| 2242       __ Pop(kResultReg); | 2240       __ Pop(kResultReg); | 
| 2243       __ Bind(&done); | 2241       __ Bind(&done); | 
| 2244       return; | 2242       return; | 
| 2245     } | 2243     } | 
| 2246   } | 2244   } | 
| 2247 | 2245 | 
| 2248   __ Bind(&slow_path); | 2246   __ Bind(&slow_path); | 
| 2249   const Code& stub = Code::Handle(compiler->isolate(), | 2247   const Code& stub = Code::ZoneHandle(compiler->zone(), | 
| 2250                                   StubCode::AllocateArray_entry()->code()); | 2248                                       StubCode::AllocateArray_entry()->code()); | 
| 2251   compiler->AddStubCallTarget(stub); | 2249   compiler->AddStubCallTarget(stub); | 
| 2252   compiler->GenerateCall(token_pos(), | 2250   compiler->GenerateCall(token_pos(), | 
| 2253                          *StubCode::AllocateArray_entry(), | 2251                          *StubCode::AllocateArray_entry(), | 
| 2254                          RawPcDescriptors::kOther, | 2252                          RawPcDescriptors::kOther, | 
| 2255                          locs()); | 2253                          locs()); | 
| 2256   __ Bind(&done); | 2254   __ Bind(&done); | 
| 2257   ASSERT(locs()->out(0).reg() == kResultReg); | 2255   ASSERT(locs()->out(0).reg() == kResultReg); | 
| 2258 } | 2256 } | 
| 2259 | 2257 | 
| 2260 | 2258 | 
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2491   virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 2489   virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 
| 2492     __ Comment("AllocateContextSlowPath"); | 2490     __ Comment("AllocateContextSlowPath"); | 
| 2493     __ Bind(entry_label()); | 2491     __ Bind(entry_label()); | 
| 2494 | 2492 | 
| 2495     LocationSummary* locs = instruction_->locs(); | 2493     LocationSummary* locs = instruction_->locs(); | 
| 2496     locs->live_registers()->Remove(locs->out(0)); | 2494     locs->live_registers()->Remove(locs->out(0)); | 
| 2497 | 2495 | 
| 2498     compiler->SaveLiveRegisters(locs); | 2496     compiler->SaveLiveRegisters(locs); | 
| 2499 | 2497 | 
| 2500     __ LoadImmediate(T1, instruction_->num_context_variables()); | 2498     __ LoadImmediate(T1, instruction_->num_context_variables()); | 
| 2501     const Code& stub = Code::Handle(compiler->isolate(), | 2499     const Code& stub = Code::ZoneHandle( | 
| 2502                                     StubCode::AllocateContext_entry()->code()); | 2500         compiler->zone(), StubCode::AllocateContext_entry()->code()); | 
| 2503     compiler->AddStubCallTarget(stub); | 2501     compiler->AddStubCallTarget(stub); | 
| 2504     compiler->GenerateCall(instruction_->token_pos(), | 2502     compiler->GenerateCall(instruction_->token_pos(), | 
| 2505                            *StubCode::AllocateContext_entry(), | 2503                            *StubCode::AllocateContext_entry(), | 
| 2506                            RawPcDescriptors::kOther, | 2504                            RawPcDescriptors::kOther, | 
| 2507                            locs); | 2505                            locs); | 
| 2508     ASSERT(instruction_->locs()->out(0).reg() == V0); | 2506     ASSERT(instruction_->locs()->out(0).reg() == V0); | 
| 2509     compiler->RestoreLiveRegisters(instruction_->locs()); | 2507     compiler->RestoreLiveRegisters(instruction_->locs()); | 
| 2510     __ b(exit_label()); | 2508     __ b(exit_label()); | 
| 2511   } | 2509   } | 
| 2512 | 2510 | 
| (...skipping 3025 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5538 | 5536 | 
| 5539 | 5537 | 
| 5540 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Zone* zone, | 5538 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Zone* zone, | 
| 5541                                                           bool opt) const { | 5539                                                           bool opt) const { | 
| 5542   return MakeCallSummary(zone); | 5540   return MakeCallSummary(zone); | 
| 5543 } | 5541 } | 
| 5544 | 5542 | 
| 5545 | 5543 | 
| 5546 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5544 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 
| 5547   __ Comment("AllocateObjectInstr"); | 5545   __ Comment("AllocateObjectInstr"); | 
| 5548   Isolate* isolate = compiler->isolate(); | 5546   const Code& stub = Code::ZoneHandle( | 
| 5549   const Code& stub = Code::Handle(isolate, | 5547       compiler->zone(), StubCode::GetAllocationStubForClass(cls())); | 
| 5550                                   StubCode::GetAllocationStubForClass(cls())); |  | 
| 5551   const StubEntry stub_entry(stub); | 5548   const StubEntry stub_entry(stub); | 
| 5552   compiler->GenerateCall(token_pos(), | 5549   compiler->GenerateCall(token_pos(), | 
| 5553                          stub_entry, | 5550                          stub_entry, | 
| 5554                          RawPcDescriptors::kOther, | 5551                          RawPcDescriptors::kOther, | 
| 5555                          locs()); | 5552                          locs()); | 
| 5556   compiler->AddStubCallTarget(stub); | 5553   compiler->AddStubCallTarget(stub); | 
| 5557   __ Drop(ArgumentCount());  // Discard arguments. | 5554   __ Drop(ArgumentCount());  // Discard arguments. | 
| 5558 } | 5555 } | 
| 5559 | 5556 | 
| 5560 | 5557 | 
| (...skipping 30 matching lines...) Expand all  Loading... | 
| 5591                                 1, | 5588                                 1, | 
| 5592                                 locs()); | 5589                                 locs()); | 
| 5593   __ lw(result, Address(SP, 1 * kWordSize)); | 5590   __ lw(result, Address(SP, 1 * kWordSize)); | 
| 5594   __ addiu(SP, SP, Immediate(2 * kWordSize)); | 5591   __ addiu(SP, SP, Immediate(2 * kWordSize)); | 
| 5595 } | 5592 } | 
| 5596 | 5593 | 
| 5597 | 5594 | 
| 5598 }  // namespace dart | 5595 }  // namespace dart | 
| 5599 | 5596 | 
| 5600 #endif  // defined TARGET_ARCH_MIPS | 5597 #endif  // defined TARGET_ARCH_MIPS | 
| OLD | NEW | 
|---|