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

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

Issue 1270803003: VM: More abstract interface for generating stub calls. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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/stub_code_arm.cc ('k') | runtime/vm/stub_code_ia32.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 392
393 393
394 // Input parameters: 394 // Input parameters:
395 // R2: smi-tagged argument count, may be zero. 395 // R2: smi-tagged argument count, may be zero.
396 // FP[kParamEndSlotFromFp + 1]: last argument. 396 // FP[kParamEndSlotFromFp + 1]: last argument.
397 static void PushArgumentsArray(Assembler* assembler) { 397 static void PushArgumentsArray(Assembler* assembler) {
398 // Allocate array to store arguments of caller. 398 // Allocate array to store arguments of caller.
399 __ LoadObject(R1, Object::null_object()); 399 __ LoadObject(R1, Object::null_object());
400 // R1: null element type for raw Array. 400 // R1: null element type for raw Array.
401 // R2: smi-tagged argument count, may be zero. 401 // R2: smi-tagged argument count, may be zero.
402 const ExternalLabel array_label(StubCode::AllocateArrayEntryPoint()); 402 __ BranchLink(*StubCode::AllocateArray_entry());
403 __ BranchLink(&array_label);
404 // R0: newly allocated array. 403 // R0: newly allocated array.
405 // R2: smi-tagged argument count, may be zero (was preserved by the stub). 404 // R2: smi-tagged argument count, may be zero (was preserved by the stub).
406 __ Push(R0); // Array is in R0 and on top of stack. 405 __ Push(R0); // Array is in R0 and on top of stack.
407 __ add(R1, FP, Operand(R2, LSL, 2)); 406 __ add(R1, FP, Operand(R2, LSL, 2));
408 __ AddImmediate(R1, R1, kParamEndSlotFromFp * kWordSize); 407 __ AddImmediate(R1, R1, kParamEndSlotFromFp * kWordSize);
409 __ AddImmediate(R3, R0, Array::data_offset() - kHeapObjectTag); 408 __ AddImmediate(R3, R0, Array::data_offset() - kHeapObjectTag);
410 // R1: address of first argument on stack. 409 // R1: address of first argument on stack.
411 // R3: address of first argument in array. 410 // R3: address of first argument in array.
412 411
413 Label loop, loop_exit; 412 Label loop, loop_exit;
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 __ PushObject(Object::null_object()); 1198 __ PushObject(Object::null_object());
1200 } 1199 }
1201 __ CallRuntime(kAllocateObjectRuntimeEntry, 2); // Allocate object. 1200 __ CallRuntime(kAllocateObjectRuntimeEntry, 2); // Allocate object.
1202 __ Drop(2); // Pop arguments. 1201 __ Drop(2); // Pop arguments.
1203 __ Pop(R0); // Pop result (newly allocated object). 1202 __ Pop(R0); // Pop result (newly allocated object).
1204 // R0: new object 1203 // R0: new object
1205 // Restore the frame pointer. 1204 // Restore the frame pointer.
1206 __ LeaveStubFrame(); 1205 __ LeaveStubFrame();
1207 __ ret(); 1206 __ ret();
1208 *patch_code_pc_offset = assembler->CodeSize(); 1207 *patch_code_pc_offset = assembler->CodeSize();
1209 __ BranchPatchable(&StubCode::FixAllocationStubTargetLabel()); 1208 __ BranchPatchable(*StubCode::FixAllocationStubTarget_entry());
1210 } 1209 }
1211 1210
1212 1211
1213 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function 1212 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function
1214 // from the entry code of a dart function after an error in passed argument 1213 // from the entry code of a dart function after an error in passed argument
1215 // name or number is detected. 1214 // name or number is detected.
1216 // Input parameters: 1215 // Input parameters:
1217 // LR : return address. 1216 // LR : return address.
1218 // SP : address of last argument. 1217 // SP : address of last argument.
1219 // R4: arguments descriptor array. 1218 // R4: arguments descriptor array.
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
2154 // Result: 2153 // Result:
2155 // R1: entry point. 2154 // R1: entry point.
2156 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { 2155 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) {
2157 EmitMegamorphicLookup(assembler, R0, R1, R1); 2156 EmitMegamorphicLookup(assembler, R0, R1, R1);
2158 __ ret(); 2157 __ ret();
2159 } 2158 }
2160 2159
2161 } // namespace dart 2160 } // namespace dart
2162 2161
2163 #endif // defined TARGET_ARCH_ARM64 2162 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698