| 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" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 | 388 |
| 389 // Input parameters: | 389 // Input parameters: |
| 390 // A1: Smi-tagged argument count, may be zero. | 390 // A1: Smi-tagged argument count, may be zero. |
| 391 // FP[kParamEndSlotFromFp + 1]: Last argument. | 391 // FP[kParamEndSlotFromFp + 1]: Last argument. |
| 392 static void PushArgumentsArray(Assembler* assembler) { | 392 static void PushArgumentsArray(Assembler* assembler) { |
| 393 __ Comment("PushArgumentsArray"); | 393 __ Comment("PushArgumentsArray"); |
| 394 // Allocate array to store arguments of caller. | 394 // Allocate array to store arguments of caller. |
| 395 __ LoadImmediate(A0, reinterpret_cast<intptr_t>(Object::null())); | 395 __ LoadImmediate(A0, reinterpret_cast<intptr_t>(Object::null())); |
| 396 // A0: Null element type for raw Array. | 396 // A0: Null element type for raw Array. |
| 397 // A1: Smi-tagged argument count, may be zero. | 397 // A1: Smi-tagged argument count, may be zero. |
| 398 const ExternalLabel array_label(StubCode::AllocateArrayEntryPoint()); | 398 __ BranchLink(*StubCode::AllocateArray_entry()); |
| 399 __ BranchLink(&array_label); | |
| 400 __ Comment("PushArgumentsArray return"); | 399 __ Comment("PushArgumentsArray return"); |
| 401 // V0: newly allocated array. | 400 // V0: newly allocated array. |
| 402 // A1: Smi-tagged argument count, may be zero (was preserved by the stub). | 401 // A1: Smi-tagged argument count, may be zero (was preserved by the stub). |
| 403 __ Push(V0); // Array is in V0 and on top of stack. | 402 __ Push(V0); // Array is in V0 and on top of stack. |
| 404 __ sll(T1, A1, 1); | 403 __ sll(T1, A1, 1); |
| 405 __ addu(T1, FP, T1); | 404 __ addu(T1, FP, T1); |
| 406 __ AddImmediate(T1, kParamEndSlotFromFp * kWordSize); | 405 __ AddImmediate(T1, kParamEndSlotFromFp * kWordSize); |
| 407 // T1: address of first argument on stack. | 406 // T1: address of first argument on stack. |
| 408 // T2: address of first argument in array. | 407 // T2: address of first argument in array. |
| 409 | 408 |
| (...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1253 } | 1252 } |
| 1254 __ CallRuntime(kAllocateObjectRuntimeEntry, 2); // Allocate object. | 1253 __ CallRuntime(kAllocateObjectRuntimeEntry, 2); // Allocate object. |
| 1255 __ Comment("AllocationStubForClass return"); | 1254 __ Comment("AllocationStubForClass return"); |
| 1256 // Pop result (newly allocated object). | 1255 // Pop result (newly allocated object). |
| 1257 __ lw(V0, Address(SP, 2 * kWordSize)); | 1256 __ lw(V0, Address(SP, 2 * kWordSize)); |
| 1258 __ addiu(SP, SP, Immediate(3 * kWordSize)); // Pop arguments. | 1257 __ addiu(SP, SP, Immediate(3 * kWordSize)); // Pop arguments. |
| 1259 // V0: new object | 1258 // V0: new object |
| 1260 // Restore the frame pointer and return. | 1259 // Restore the frame pointer and return. |
| 1261 __ LeaveStubFrameAndReturn(RA); | 1260 __ LeaveStubFrameAndReturn(RA); |
| 1262 *patch_code_pc_offset = assembler->CodeSize(); | 1261 *patch_code_pc_offset = assembler->CodeSize(); |
| 1263 __ BranchPatchable(&StubCode::FixAllocationStubTargetLabel()); | 1262 __ BranchPatchable(*StubCode::FixAllocationStubTarget_entry()); |
| 1264 } | 1263 } |
| 1265 | 1264 |
| 1266 | 1265 |
| 1267 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function | 1266 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function |
| 1268 // from the entry code of a dart function after an error in passed argument | 1267 // from the entry code of a dart function after an error in passed argument |
| 1269 // name or number is detected. | 1268 // name or number is detected. |
| 1270 // Input parameters: | 1269 // Input parameters: |
| 1271 // RA : return address. | 1270 // RA : return address. |
| 1272 // SP : address of last argument. | 1271 // SP : address of last argument. |
| 1273 // S4: arguments descriptor array. | 1272 // S4: arguments descriptor array. |
| (...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2285 // Result: | 2284 // Result: |
| 2286 // T1: entry point. | 2285 // T1: entry point. |
| 2287 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2286 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
| 2288 EmitMegamorphicLookup(assembler, T0, T1, T1); | 2287 EmitMegamorphicLookup(assembler, T0, T1, T1); |
| 2289 __ Ret(); | 2288 __ Ret(); |
| 2290 } | 2289 } |
| 2291 | 2290 |
| 2292 } // namespace dart | 2291 } // namespace dart |
| 2293 | 2292 |
| 2294 #endif // defined TARGET_ARCH_MIPS | 2293 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |