| 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_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 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/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 359 |
| 360 | 360 |
| 361 // Input parameters: | 361 // Input parameters: |
| 362 // R2: smi-tagged argument count, may be zero. | 362 // R2: smi-tagged argument count, may be zero. |
| 363 // FP[kParamEndSlotFromFp + 1]: last argument. | 363 // FP[kParamEndSlotFromFp + 1]: last argument. |
| 364 static void PushArgumentsArray(Assembler* assembler) { | 364 static void PushArgumentsArray(Assembler* assembler) { |
| 365 // Allocate array to store arguments of caller. | 365 // Allocate array to store arguments of caller. |
| 366 __ LoadImmediate(R1, reinterpret_cast<intptr_t>(Object::null())); | 366 __ LoadImmediate(R1, reinterpret_cast<intptr_t>(Object::null())); |
| 367 // R1: null element type for raw Array. | 367 // R1: null element type for raw Array. |
| 368 // R2: smi-tagged argument count, may be zero. | 368 // R2: smi-tagged argument count, may be zero. |
| 369 const ExternalLabel array_label(StubCode::AllocateArrayEntryPoint()); | 369 __ BranchLink(*StubCode::AllocateArray_entry()); |
| 370 __ BranchLink(&array_label); | |
| 371 // R0: newly allocated array. | 370 // R0: newly allocated array. |
| 372 // R2: smi-tagged argument count, may be zero (was preserved by the stub). | 371 // R2: smi-tagged argument count, may be zero (was preserved by the stub). |
| 373 __ Push(R0); // Array is in R0 and on top of stack. | 372 __ Push(R0); // Array is in R0 and on top of stack. |
| 374 __ AddImmediate(R1, FP, kParamEndSlotFromFp * kWordSize); | 373 __ AddImmediate(R1, FP, kParamEndSlotFromFp * kWordSize); |
| 375 __ AddImmediate(R3, R0, Array::data_offset() - kHeapObjectTag); | 374 __ AddImmediate(R3, R0, Array::data_offset() - kHeapObjectTag); |
| 376 // Copy arguments from stack to array (starting at the end). | 375 // Copy arguments from stack to array (starting at the end). |
| 377 // R1: address just beyond last argument on stack. | 376 // R1: address just beyond last argument on stack. |
| 378 // R3: address of first argument in array. | 377 // R3: address of first argument in array. |
| 379 Label enter; | 378 Label enter; |
| 380 __ b(&enter); | 379 __ b(&enter); |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1166 __ Push(R2); | 1165 __ Push(R2); |
| 1167 } | 1166 } |
| 1168 __ CallRuntime(kAllocateObjectRuntimeEntry, 2); // Allocate object. | 1167 __ CallRuntime(kAllocateObjectRuntimeEntry, 2); // Allocate object. |
| 1169 __ Drop(2); // Pop arguments. | 1168 __ Drop(2); // Pop arguments. |
| 1170 __ Pop(R0); // Pop result (newly allocated object). | 1169 __ Pop(R0); // Pop result (newly allocated object). |
| 1171 // R0: new object | 1170 // R0: new object |
| 1172 // Restore the frame pointer. | 1171 // Restore the frame pointer. |
| 1173 __ LeaveStubFrame(); | 1172 __ LeaveStubFrame(); |
| 1174 __ Ret(); | 1173 __ Ret(); |
| 1175 *patch_code_pc_offset = assembler->CodeSize(); | 1174 *patch_code_pc_offset = assembler->CodeSize(); |
| 1176 __ BranchPatchable(&StubCode::FixAllocationStubTargetLabel()); | 1175 __ BranchPatchable(*StubCode::FixAllocationStubTarget_entry()); |
| 1177 } | 1176 } |
| 1178 | 1177 |
| 1179 | 1178 |
| 1180 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function | 1179 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function |
| 1181 // from the entry code of a dart function after an error in passed argument | 1180 // from the entry code of a dart function after an error in passed argument |
| 1182 // name or number is detected. | 1181 // name or number is detected. |
| 1183 // Input parameters: | 1182 // Input parameters: |
| 1184 // LR : return address. | 1183 // LR : return address. |
| 1185 // SP : address of last argument. | 1184 // SP : address of last argument. |
| 1186 // R4: arguments descriptor array. | 1185 // R4: arguments descriptor array. |
| (...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2095 // Result: | 2094 // Result: |
| 2096 // R1: entry point. | 2095 // R1: entry point. |
| 2097 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2096 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
| 2098 EmitMegamorphicLookup(assembler, R0, R1, R1); | 2097 EmitMegamorphicLookup(assembler, R0, R1, R1); |
| 2099 __ Ret(); | 2098 __ Ret(); |
| 2100 } | 2099 } |
| 2101 | 2100 |
| 2102 } // namespace dart | 2101 } // namespace dart |
| 2103 | 2102 |
| 2104 #endif // defined TARGET_ARCH_ARM | 2103 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |