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

Side by Side Diff: runtime/vm/stub_code_x64.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_mips.cc ('k') | runtime/vm/thread.h » ('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" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 } 324 }
325 325
326 326
327 // Input parameters: 327 // Input parameters:
328 // R10: smi-tagged argument count, may be zero. 328 // R10: smi-tagged argument count, may be zero.
329 // RBP[kParamEndSlotFromFp + 1]: last argument. 329 // RBP[kParamEndSlotFromFp + 1]: last argument.
330 static void PushArgumentsArray(Assembler* assembler) { 330 static void PushArgumentsArray(Assembler* assembler) {
331 __ LoadObject(R12, Object::null_object()); 331 __ LoadObject(R12, Object::null_object());
332 // Allocate array to store arguments of caller. 332 // Allocate array to store arguments of caller.
333 __ movq(RBX, R12); // Null element type for raw Array. 333 __ movq(RBX, R12); // Null element type for raw Array.
334 const ExternalLabel array_label(StubCode::AllocateArrayEntryPoint()); 334 __ Call(*StubCode::AllocateArray_entry());
335 __ call(&array_label);
336 __ SmiUntag(R10); 335 __ SmiUntag(R10);
337 // RAX: newly allocated array. 336 // RAX: newly allocated array.
338 // R10: length of the array (was preserved by the stub). 337 // R10: length of the array (was preserved by the stub).
339 __ pushq(RAX); // Array is in RAX and on top of stack. 338 __ pushq(RAX); // Array is in RAX and on top of stack.
340 __ leaq(R12, Address(RBP, R10, TIMES_8, kParamEndSlotFromFp * kWordSize)); 339 __ leaq(R12, Address(RBP, R10, TIMES_8, kParamEndSlotFromFp * kWordSize));
341 __ leaq(RBX, FieldAddress(RAX, Array::data_offset())); 340 __ leaq(RBX, FieldAddress(RAX, Array::data_offset()));
342 // R12: address of first argument on stack. 341 // R12: address of first argument on stack.
343 // RBX: address of first argument in array. 342 // RBX: address of first argument in array.
344 Label loop, loop_condition; 343 Label loop, loop_condition;
345 #if defined(DEBUG) 344 #if defined(DEBUG)
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
1163 } 1162 }
1164 __ CallRuntime(kAllocateObjectRuntimeEntry, 2); // Allocate object. 1163 __ CallRuntime(kAllocateObjectRuntimeEntry, 2); // Allocate object.
1165 __ popq(RAX); // Pop argument (type arguments of object). 1164 __ popq(RAX); // Pop argument (type arguments of object).
1166 __ popq(RAX); // Pop argument (class of object). 1165 __ popq(RAX); // Pop argument (class of object).
1167 __ popq(RAX); // Pop result (newly allocated object). 1166 __ popq(RAX); // Pop result (newly allocated object).
1168 // RAX: new object 1167 // RAX: new object
1169 // Restore the frame pointer. 1168 // Restore the frame pointer.
1170 __ LeaveStubFrame(); 1169 __ LeaveStubFrame();
1171 __ ret(); 1170 __ ret();
1172 *patch_code_pc_offset = assembler->CodeSize(); 1171 *patch_code_pc_offset = assembler->CodeSize();
1173 __ JmpPatchable(&StubCode::FixAllocationStubTargetLabel(), new_pp); 1172 __ JmpPatchable(*StubCode::FixAllocationStubTarget_entry(), new_pp);
1174 } 1173 }
1175 1174
1176 1175
1177 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function 1176 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function
1178 // from the entry code of a dart function after an error in passed argument 1177 // from the entry code of a dart function after an error in passed argument
1179 // name or number is detected. 1178 // name or number is detected.
1180 // Input parameters: 1179 // Input parameters:
1181 // RSP : points to return address. 1180 // RSP : points to return address.
1182 // RSP + 8 : address of last argument. 1181 // RSP + 8 : address of last argument.
1183 // R10 : arguments descriptor array. 1182 // R10 : arguments descriptor array.
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
2149 // Result: 2148 // Result:
2150 // RCX: entry point. 2149 // RCX: entry point.
2151 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { 2150 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) {
2152 EmitMegamorphicLookup(assembler, RDI, RBX, RCX); 2151 EmitMegamorphicLookup(assembler, RDI, RBX, RCX);
2153 __ ret(); 2152 __ ret();
2154 } 2153 }
2155 2154
2156 } // namespace dart 2155 } // namespace dart
2157 2156
2158 #endif // defined TARGET_ARCH_X64 2157 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | runtime/vm/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698