| 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_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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // to transition to Dart VM C++ code. | 53 // to transition to Dart VM C++ code. |
| 54 __ movq(Address(RAX, Isolate::top_exit_frame_info_offset()), RSP); | 54 __ movq(Address(RAX, Isolate::top_exit_frame_info_offset()), RSP); |
| 55 | 55 |
| 56 // Save current Context pointer into Isolate structure. | 56 // Save current Context pointer into Isolate structure. |
| 57 __ movq(Address(RAX, Isolate::top_context_offset()), CTX); | 57 __ movq(Address(RAX, Isolate::top_context_offset()), CTX); |
| 58 | 58 |
| 59 // Cache Isolate pointer into CTX while executing runtime code. | 59 // Cache Isolate pointer into CTX while executing runtime code. |
| 60 __ movq(CTX, RAX); | 60 __ movq(CTX, RAX); |
| 61 | 61 |
| 62 // Reserve space for arguments and align frame before entering C++ world. | 62 // Reserve space for arguments and align frame before entering C++ world. |
| 63 __ AddImmediate(RSP, Immediate(-sizeof(NativeArguments))); | 63 __ subq(RSP, Immediate(sizeof(NativeArguments))); |
| 64 if (OS::ActivationFrameAlignment() > 1) { | 64 if (OS::ActivationFrameAlignment() > 1) { |
| 65 __ andq(RSP, Immediate(~(OS::ActivationFrameAlignment() - 1))); | 65 __ andq(RSP, Immediate(~(OS::ActivationFrameAlignment() - 1))); |
| 66 } | 66 } |
| 67 | 67 |
| 68 // Pass NativeArguments structure by value and call runtime. | 68 // Pass NativeArguments structure by value and call runtime. |
| 69 __ movq(Address(RSP, isolate_offset), CTX); // Set isolate in NativeArgs. | 69 __ movq(Address(RSP, isolate_offset), CTX); // Set isolate in NativeArgs. |
| 70 // There are no runtime calls to closures, so we do not need to set the tag | 70 // There are no runtime calls to closures, so we do not need to set the tag |
| 71 // bits kClosureFunctionBit and kInstanceFunctionBit in argc_tag_. | 71 // bits kClosureFunctionBit and kInstanceFunctionBit in argc_tag_. |
| 72 __ movq(Address(RSP, argc_tag_offset), R10); // Set argc in NativeArguments. | 72 __ movq(Address(RSP, argc_tag_offset), R10); // Set argc in NativeArguments. |
| 73 __ leaq(RAX, Address(RBP, R10, TIMES_8, 1 * kWordSize)); // Compute argv. | 73 __ leaq(RAX, Address(RBP, R10, TIMES_8, 1 * kWordSize)); // Compute argv. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 // Save current Context pointer into Isolate structure. | 143 // Save current Context pointer into Isolate structure. |
| 144 __ movq(Address(R8, Isolate::top_context_offset()), CTX); | 144 __ movq(Address(R8, Isolate::top_context_offset()), CTX); |
| 145 | 145 |
| 146 // Cache Isolate pointer into CTX while executing native code. | 146 // Cache Isolate pointer into CTX while executing native code. |
| 147 __ movq(CTX, R8); | 147 __ movq(CTX, R8); |
| 148 | 148 |
| 149 // Reserve space for the native arguments structure passed on the stack (the | 149 // Reserve space for the native arguments structure passed on the stack (the |
| 150 // outgoing pointer parameter to the native arguments structure is passed in | 150 // outgoing pointer parameter to the native arguments structure is passed in |
| 151 // RDI) and align frame before entering the C++ world. | 151 // RDI) and align frame before entering the C++ world. |
| 152 __ AddImmediate(RSP, Immediate(-sizeof(NativeArguments))); | 152 __ subq(RSP, Immediate(sizeof(NativeArguments))); |
| 153 if (OS::ActivationFrameAlignment() > 1) { | 153 if (OS::ActivationFrameAlignment() > 1) { |
| 154 __ andq(RSP, Immediate(~(OS::ActivationFrameAlignment() - 1))); | 154 __ andq(RSP, Immediate(~(OS::ActivationFrameAlignment() - 1))); |
| 155 } | 155 } |
| 156 | 156 |
| 157 // Pass NativeArguments structure by value and call native function. | 157 // Pass NativeArguments structure by value and call native function. |
| 158 __ movq(Address(RSP, isolate_offset), CTX); // Set isolate in NativeArgs. | 158 __ movq(Address(RSP, isolate_offset), CTX); // Set isolate in NativeArgs. |
| 159 __ movq(Address(RSP, argc_tag_offset), R10); // Set argc in NativeArguments. | 159 __ movq(Address(RSP, argc_tag_offset), R10); // Set argc in NativeArguments. |
| 160 __ movq(Address(RSP, argv_offset), RAX); // Set argv in NativeArguments. | 160 __ movq(Address(RSP, argv_offset), RAX); // Set argv in NativeArguments. |
| 161 __ leaq(RAX, Address(RBP, 2 * kWordSize)); // Compute return value addr. | 161 __ leaq(RAX, Address(RBP, 2 * kWordSize)); // Compute return value addr. |
| 162 __ movq(Address(RSP, retval_offset), RAX); // Set retval in NativeArguments. | 162 __ movq(Address(RSP, retval_offset), RAX); // Set retval in NativeArguments. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 210 |
| 211 // Save current Context pointer into Isolate structure. | 211 // Save current Context pointer into Isolate structure. |
| 212 __ movq(Address(R8, Isolate::top_context_offset()), CTX); | 212 __ movq(Address(R8, Isolate::top_context_offset()), CTX); |
| 213 | 213 |
| 214 // Cache Isolate pointer into CTX while executing native code. | 214 // Cache Isolate pointer into CTX while executing native code. |
| 215 __ movq(CTX, R8); | 215 __ movq(CTX, R8); |
| 216 | 216 |
| 217 // Reserve space for the native arguments structure passed on the stack (the | 217 // Reserve space for the native arguments structure passed on the stack (the |
| 218 // outgoing pointer parameter to the native arguments structure is passed in | 218 // outgoing pointer parameter to the native arguments structure is passed in |
| 219 // RDI) and align frame before entering the C++ world. | 219 // RDI) and align frame before entering the C++ world. |
| 220 __ AddImmediate(RSP, Immediate(-sizeof(NativeArguments))); | 220 __ subq(RSP, Immediate(sizeof(NativeArguments))); |
| 221 if (OS::ActivationFrameAlignment() > 1) { | 221 if (OS::ActivationFrameAlignment() > 1) { |
| 222 __ andq(RSP, Immediate(~(OS::ActivationFrameAlignment() - 1))); | 222 __ andq(RSP, Immediate(~(OS::ActivationFrameAlignment() - 1))); |
| 223 } | 223 } |
| 224 | 224 |
| 225 // Pass NativeArguments structure by value and call native function. | 225 // Pass NativeArguments structure by value and call native function. |
| 226 __ movq(Address(RSP, isolate_offset), CTX); // Set isolate in NativeArgs. | 226 __ movq(Address(RSP, isolate_offset), CTX); // Set isolate in NativeArgs. |
| 227 __ movq(Address(RSP, argc_tag_offset), R10); // Set argc in NativeArguments. | 227 __ movq(Address(RSP, argc_tag_offset), R10); // Set argc in NativeArguments. |
| 228 __ movq(Address(RSP, argv_offset), RAX); // Set argv in NativeArguments. | 228 __ movq(Address(RSP, argv_offset), RAX); // Set argv in NativeArguments. |
| 229 __ leaq(RAX, Address(RBP, 2 * kWordSize)); // Compute return value addr. | 229 __ leaq(RAX, Address(RBP, 2 * kWordSize)); // Compute return value addr. |
| 230 __ movq(Address(RSP, retval_offset), RAX); // Set retval in NativeArguments. | 230 __ movq(Address(RSP, retval_offset), RAX); // Set retval in NativeArguments. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 248 __ ret(); | 248 __ ret(); |
| 249 } | 249 } |
| 250 | 250 |
| 251 | 251 |
| 252 // Input parameters: | 252 // Input parameters: |
| 253 // R10: arguments descriptor array. | 253 // R10: arguments descriptor array. |
| 254 void StubCode::GenerateCallStaticFunctionStub(Assembler* assembler) { | 254 void StubCode::GenerateCallStaticFunctionStub(Assembler* assembler) { |
| 255 __ EnterStubFrame(); | 255 __ EnterStubFrame(); |
| 256 __ pushq(R10); // Preserve arguments descriptor array. | 256 __ pushq(R10); // Preserve arguments descriptor array. |
| 257 // Setup space on stack for return value. | 257 // Setup space on stack for return value. |
| 258 __ PushObject(Object::null_object()); | 258 __ PushObject(Object::null_object(), PP); |
| 259 __ CallRuntime(kPatchStaticCallRuntimeEntry, 0); | 259 __ CallRuntime(kPatchStaticCallRuntimeEntry, 0); |
| 260 __ popq(RAX); // Get Code object result. | 260 __ popq(RAX); // Get Code object result. |
| 261 __ popq(R10); // Restore arguments descriptor array. | 261 __ popq(R10); // Restore arguments descriptor array. |
| 262 // Remove the stub frame as we are about to jump to the dart function. | 262 // Remove the stub frame as we are about to jump to the dart function. |
| 263 __ LeaveFrame(); | 263 __ LeaveFrame(); |
| 264 | 264 |
| 265 __ movq(RBX, FieldAddress(RAX, Code::instructions_offset())); | 265 __ movq(RBX, FieldAddress(RAX, Code::instructions_offset())); |
| 266 __ addq(RBX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); | 266 __ addq(RBX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); |
| 267 __ jmp(RBX); | 267 __ jmp(RBX); |
| 268 } | 268 } |
| 269 | 269 |
| 270 | 270 |
| 271 // Called from a static call only when an invalid code has been entered | 271 // Called from a static call only when an invalid code has been entered |
| 272 // (invalid because its function was optimized or deoptimized). | 272 // (invalid because its function was optimized or deoptimized). |
| 273 // R10: arguments descriptor array. | 273 // R10: arguments descriptor array. |
| 274 void StubCode::GenerateFixCallersTargetStub(Assembler* assembler) { | 274 void StubCode::GenerateFixCallersTargetStub(Assembler* assembler) { |
| 275 __ EnterStubFrame(); | 275 __ EnterStubFrame(); |
| 276 __ pushq(R10); // Preserve arguments descriptor array. | 276 __ pushq(R10); // Preserve arguments descriptor array. |
| 277 // Setup space on stack for return value. | 277 // Setup space on stack for return value. |
| 278 __ PushObject(Object::null_object()); | 278 __ PushObject(Object::null_object(), PP); |
| 279 __ CallRuntime(kFixCallersTargetRuntimeEntry, 0); | 279 __ CallRuntime(kFixCallersTargetRuntimeEntry, 0); |
| 280 __ popq(RAX); // Get Code object. | 280 __ popq(RAX); // Get Code object. |
| 281 __ popq(R10); // Restore arguments descriptor array. | 281 __ popq(R10); // Restore arguments descriptor array. |
| 282 __ movq(RAX, FieldAddress(RAX, Code::instructions_offset())); | 282 __ movq(RAX, FieldAddress(RAX, Code::instructions_offset())); |
| 283 __ addq(RAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); | 283 __ addq(RAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); |
| 284 __ LeaveFrame(); | 284 __ LeaveFrame(); |
| 285 __ jmp(RAX); | 285 __ jmp(RAX); |
| 286 __ int3(); | 286 __ int3(); |
| 287 } | 287 } |
| 288 | 288 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 301 __ pushq(RAX); // Array is in RAX and on top of stack. | 301 __ pushq(RAX); // Array is in RAX and on top of stack. |
| 302 __ leaq(R12, Address(RBP, R10, TIMES_8, kParamEndSlotFromFp * kWordSize)); | 302 __ leaq(R12, Address(RBP, R10, TIMES_8, kParamEndSlotFromFp * kWordSize)); |
| 303 __ leaq(RBX, FieldAddress(RAX, Array::data_offset())); | 303 __ leaq(RBX, FieldAddress(RAX, Array::data_offset())); |
| 304 // R12: address of first argument on stack. | 304 // R12: address of first argument on stack. |
| 305 // RBX: address of first argument in array. | 305 // RBX: address of first argument in array. |
| 306 Label loop, loop_condition; | 306 Label loop, loop_condition; |
| 307 __ jmp(&loop_condition, Assembler::kNearJump); | 307 __ jmp(&loop_condition, Assembler::kNearJump); |
| 308 __ Bind(&loop); | 308 __ Bind(&loop); |
| 309 __ movq(RAX, Address(R12, 0)); | 309 __ movq(RAX, Address(R12, 0)); |
| 310 __ movq(Address(RBX, 0), RAX); | 310 __ movq(Address(RBX, 0), RAX); |
| 311 __ AddImmediate(RBX, Immediate(kWordSize)); | 311 __ addq(RBX, Immediate(kWordSize)); |
| 312 __ AddImmediate(R12, Immediate(-kWordSize)); | 312 __ subq(R12, Immediate(kWordSize)); |
| 313 __ Bind(&loop_condition); | 313 __ Bind(&loop_condition); |
| 314 __ decq(R10); | 314 __ decq(R10); |
| 315 __ j(POSITIVE, &loop, Assembler::kNearJump); | 315 __ j(POSITIVE, &loop, Assembler::kNearJump); |
| 316 } | 316 } |
| 317 | 317 |
| 318 | 318 |
| 319 // Input parameters: | 319 // Input parameters: |
| 320 // RBX: ic-data. | 320 // RBX: ic-data. |
| 321 // R10: arguments descriptor array. | 321 // R10: arguments descriptor array. |
| 322 // Note: The receiver object is the first argument to the function being | 322 // Note: The receiver object is the first argument to the function being |
| 323 // called, the stub accesses the receiver from this location directly | 323 // called, the stub accesses the receiver from this location directly |
| 324 // when trying to resolve the call. | 324 // when trying to resolve the call. |
| 325 void StubCode::GenerateInstanceFunctionLookupStub(Assembler* assembler) { | 325 void StubCode::GenerateInstanceFunctionLookupStub(Assembler* assembler) { |
| 326 __ EnterStubFrameWithPP(); | 326 __ EnterStubFrameWithPP(); |
| 327 __ PushObject(Object::null_object()); // Space for the return value. | 327 __ PushObject(Object::null_object(), PP); // Space for the return value. |
| 328 | 328 |
| 329 // Push the receiver as an argument. Load the smi-tagged argument | 329 // Push the receiver as an argument. Load the smi-tagged argument |
| 330 // count into R13 to index the receiver in the stack. There are | 330 // count into R13 to index the receiver in the stack. There are |
| 331 // four words (null, stub's pc marker, saved pp, saved fp) above the return | 331 // four words (null, stub's pc marker, saved pp, saved fp) above the return |
| 332 // address. | 332 // address. |
| 333 __ movq(R13, FieldAddress(R10, ArgumentsDescriptor::count_offset())); | 333 __ movq(R13, FieldAddress(R10, ArgumentsDescriptor::count_offset())); |
| 334 __ pushq(Address(RSP, R13, TIMES_4, (4 * kWordSize))); | 334 __ pushq(Address(RSP, R13, TIMES_4, (4 * kWordSize))); |
| 335 | 335 |
| 336 __ pushq(RBX); // Pass IC data object. | 336 __ pushq(RBX); // Pass IC data object. |
| 337 __ pushq(R10); // Pass arguments descriptor array. | 337 __ pushq(R10); // Pass arguments descriptor array. |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 __ movq(RAX, FieldAddress(R10, ArgumentsDescriptor::count_offset())); | 497 __ movq(RAX, FieldAddress(R10, ArgumentsDescriptor::count_offset())); |
| 498 // Three words (saved pp, saved fp, stub's pc marker) | 498 // Three words (saved pp, saved fp, stub's pc marker) |
| 499 // in the stack above the return address. | 499 // in the stack above the return address. |
| 500 __ movq(RAX, Address(RSP, RAX, TIMES_4, | 500 __ movq(RAX, Address(RSP, RAX, TIMES_4, |
| 501 kSavedAboveReturnAddress * kWordSize)); | 501 kSavedAboveReturnAddress * kWordSize)); |
| 502 // Preserve IC data and arguments descriptor. | 502 // Preserve IC data and arguments descriptor. |
| 503 __ pushq(RBX); | 503 __ pushq(RBX); |
| 504 __ pushq(R10); | 504 __ pushq(R10); |
| 505 | 505 |
| 506 // Space for the result of the runtime call. | 506 // Space for the result of the runtime call. |
| 507 __ PushObject(Object::null_object()); | 507 __ PushObject(Object::null_object(), PP); |
| 508 __ pushq(RAX); // Receiver. | 508 __ pushq(RAX); // Receiver. |
| 509 __ pushq(RBX); // IC data. | 509 __ pushq(RBX); // IC data. |
| 510 __ pushq(R10); // Arguments descriptor. | 510 __ pushq(R10); // Arguments descriptor. |
| 511 __ CallRuntime(kMegamorphicCacheMissHandlerRuntimeEntry, 3); | 511 __ CallRuntime(kMegamorphicCacheMissHandlerRuntimeEntry, 3); |
| 512 // Discard arguments. | 512 // Discard arguments. |
| 513 __ popq(RAX); | 513 __ popq(RAX); |
| 514 __ popq(RAX); | 514 __ popq(RAX); |
| 515 __ popq(RAX); | 515 __ popq(RAX); |
| 516 __ popq(RAX); // Return value from the runtime call (instructions). | 516 __ popq(RAX); // Return value from the runtime call (instructions). |
| 517 __ popq(R10); // Restore arguments descriptor. | 517 __ popq(R10); // Restore arguments descriptor. |
| 518 __ popq(RBX); // Restore IC data. | 518 __ popq(RBX); // Restore IC data. |
| 519 __ LeaveFrameWithPP(); | 519 __ LeaveFrameWithPP(); |
| 520 | 520 |
| 521 Label lookup; | 521 Label lookup; |
| 522 __ CompareObject(RAX, Object::null_object()); | 522 __ CompareObject(RAX, Object::null_object(), PP); |
| 523 __ j(EQUAL, &lookup, Assembler::kNearJump); | 523 __ j(EQUAL, &lookup, Assembler::kNearJump); |
| 524 __ addq(RAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); | 524 __ addq(RAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); |
| 525 __ jmp(RAX); | 525 __ jmp(RAX); |
| 526 | 526 |
| 527 __ Bind(&lookup); | 527 __ Bind(&lookup); |
| 528 __ jmp(&StubCode::InstanceFunctionLookupLabel()); | 528 __ jmp(&StubCode::InstanceFunctionLookupLabel()); |
| 529 } | 529 } |
| 530 | 530 |
| 531 | 531 |
| 532 // Called for inline allocation of arrays. | 532 // Called for inline allocation of arrays. |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 __ ret(); | 643 __ ret(); |
| 644 } | 644 } |
| 645 | 645 |
| 646 // Unable to allocate the array using the fast inline code, just call | 646 // Unable to allocate the array using the fast inline code, just call |
| 647 // into the runtime. | 647 // into the runtime. |
| 648 __ Bind(&slow_case); | 648 __ Bind(&slow_case); |
| 649 // Create a stub frame as we are pushing some objects on the stack before | 649 // Create a stub frame as we are pushing some objects on the stack before |
| 650 // calling into the runtime. | 650 // calling into the runtime. |
| 651 __ EnterStubFrame(); | 651 __ EnterStubFrame(); |
| 652 // Setup space on stack for return value. | 652 // Setup space on stack for return value. |
| 653 __ PushObject(Object::null_object()); | 653 __ PushObject(Object::null_object(), PP); |
| 654 __ pushq(R10); // Array length as Smi. | 654 __ pushq(R10); // Array length as Smi. |
| 655 __ pushq(RBX); // Element type. | 655 __ pushq(RBX); // Element type. |
| 656 __ CallRuntime(kAllocateArrayRuntimeEntry, 2); | 656 __ CallRuntime(kAllocateArrayRuntimeEntry, 2); |
| 657 __ popq(RAX); // Pop element type argument. | 657 __ popq(RAX); // Pop element type argument. |
| 658 __ popq(R10); // Pop array length argument. | 658 __ popq(R10); // Pop array length argument. |
| 659 __ popq(RAX); // Pop return value from return slot. | 659 __ popq(RAX); // Pop return value from return slot. |
| 660 __ LeaveFrame(); | 660 __ LeaveFrame(); |
| 661 __ ret(); | 661 __ ret(); |
| 662 } | 662 } |
| 663 | 663 |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1221 | 1221 |
| 1222 __ Bind(&slow_case); | 1222 __ Bind(&slow_case); |
| 1223 } | 1223 } |
| 1224 if (is_cls_parameterized) { | 1224 if (is_cls_parameterized) { |
| 1225 __ movq(RAX, Address(RSP, kObjectTypeArgumentsOffset)); | 1225 __ movq(RAX, Address(RSP, kObjectTypeArgumentsOffset)); |
| 1226 __ movq(RDX, Address(RSP, kInstantiatorTypeArgumentsOffset)); | 1226 __ movq(RDX, Address(RSP, kInstantiatorTypeArgumentsOffset)); |
| 1227 } | 1227 } |
| 1228 // Create a stub frame. | 1228 // Create a stub frame. |
| 1229 __ EnterStubFrameWithPP(); | 1229 __ EnterStubFrameWithPP(); |
| 1230 __ pushq(R12); // Setup space on stack for return value. | 1230 __ pushq(R12); // Setup space on stack for return value. |
| 1231 __ PushObject(cls); // Push class of object to be allocated. | 1231 __ PushObject(cls, PP); // Push class of object to be allocated. |
| 1232 if (is_cls_parameterized) { | 1232 if (is_cls_parameterized) { |
| 1233 __ pushq(RAX); // Push type arguments of object to be allocated. | 1233 __ pushq(RAX); // Push type arguments of object to be allocated. |
| 1234 __ pushq(RDX); // Push type arguments of instantiator. | 1234 __ pushq(RDX); // Push type arguments of instantiator. |
| 1235 } else { | 1235 } else { |
| 1236 __ pushq(R12); // Push null type arguments. | 1236 __ pushq(R12); // Push null type arguments. |
| 1237 __ pushq(Immediate(Smi::RawValue(StubCode::kNoInstantiator))); | 1237 __ pushq(Immediate(Smi::RawValue(StubCode::kNoInstantiator))); |
| 1238 } | 1238 } |
| 1239 __ CallRuntime(kAllocateObjectRuntimeEntry, 3); // Allocate object. | 1239 __ CallRuntime(kAllocateObjectRuntimeEntry, 3); // Allocate object. |
| 1240 __ popq(RAX); // Pop argument (instantiator). | 1240 __ popq(RAX); // Pop argument (instantiator). |
| 1241 __ popq(RAX); // Pop argument (type arguments of object). | 1241 __ popq(RAX); // Pop argument (type arguments of object). |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1357 __ Bind(&slow_case); | 1357 __ Bind(&slow_case); |
| 1358 } | 1358 } |
| 1359 if (has_type_arguments) { | 1359 if (has_type_arguments) { |
| 1360 __ movq(RCX, Address(RSP, kTypeArgumentsOffset)); | 1360 __ movq(RCX, Address(RSP, kTypeArgumentsOffset)); |
| 1361 } | 1361 } |
| 1362 if (is_implicit_instance_closure) { | 1362 if (is_implicit_instance_closure) { |
| 1363 __ movq(RAX, Address(RSP, kReceiverOffset)); | 1363 __ movq(RAX, Address(RSP, kReceiverOffset)); |
| 1364 } | 1364 } |
| 1365 | 1365 |
| 1366 __ pushq(R12); // Setup space on stack for the return value. | 1366 __ pushq(R12); // Setup space on stack for the return value. |
| 1367 __ PushObject(func); | 1367 __ PushObject(func, PP); |
| 1368 if (is_implicit_instance_closure) { | 1368 if (is_implicit_instance_closure) { |
| 1369 __ pushq(RAX); // Receiver. | 1369 __ pushq(RAX); // Receiver. |
| 1370 } | 1370 } |
| 1371 if (has_type_arguments) { | 1371 if (has_type_arguments) { |
| 1372 __ pushq(RCX); // Push type arguments of closure to be allocated. | 1372 __ pushq(RCX); // Push type arguments of closure to be allocated. |
| 1373 } else { | 1373 } else { |
| 1374 __ pushq(R12); // Push null type arguments. | 1374 __ pushq(R12); // Push null type arguments. |
| 1375 } | 1375 } |
| 1376 if (is_implicit_instance_closure) { | 1376 if (is_implicit_instance_closure) { |
| 1377 __ CallRuntime(kAllocateImplicitInstanceClosureRuntimeEntry, 3); | 1377 __ CallRuntime(kAllocateImplicitInstanceClosureRuntimeEntry, 3); |
| (...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2082 __ Bind(¬_smi); | 2082 __ Bind(¬_smi); |
| 2083 __ LoadClassId(RAX, RAX); | 2083 __ LoadClassId(RAX, RAX); |
| 2084 __ SmiTag(RAX); | 2084 __ SmiTag(RAX); |
| 2085 __ ret(); | 2085 __ ret(); |
| 2086 | 2086 |
| 2087 __ Bind(&update_ic_data); | 2087 __ Bind(&update_ic_data); |
| 2088 | 2088 |
| 2089 // RBX: ICData | 2089 // RBX: ICData |
| 2090 __ movq(RAX, Address(RSP, 1 * kWordSize)); | 2090 __ movq(RAX, Address(RSP, 1 * kWordSize)); |
| 2091 __ movq(R13, Address(RSP, 2 * kWordSize)); | 2091 __ movq(R13, Address(RSP, 2 * kWordSize)); |
| 2092 __ EnterStubFrame(); | 2092 __ EnterStubFrameWithPP(); |
| 2093 __ pushq(R13); // arg 0 | 2093 __ pushq(R13); // arg 0 |
| 2094 __ pushq(RAX); // arg 1 | 2094 __ pushq(RAX); // arg 1 |
| 2095 __ PushObject(Symbols::EqualOperator()); // Target's name. | 2095 __ PushObject(Symbols::EqualOperator(), PP); // Target's name. |
| 2096 __ pushq(RBX); // ICData | 2096 __ pushq(RBX); // ICData |
| 2097 __ CallRuntime(kUpdateICDataTwoArgsRuntimeEntry, 4); | 2097 __ CallRuntime(kUpdateICDataTwoArgsRuntimeEntry, 4); |
| 2098 __ Drop(4); | 2098 __ Drop(4); |
| 2099 __ LeaveFrame(); | 2099 __ LeaveFrameWithPP(); |
| 2100 | 2100 |
| 2101 __ jmp(&compute_result, Assembler::kNearJump); | 2101 __ jmp(&compute_result, Assembler::kNearJump); |
| 2102 } | 2102 } |
| 2103 | 2103 |
| 2104 // Calls to the runtime to optimize the given function. | 2104 // Calls to the runtime to optimize the given function. |
| 2105 // RDI: function to be reoptimized. | 2105 // RDI: function to be reoptimized. |
| 2106 // R10: argument descriptor (preserved). | 2106 // R10: argument descriptor (preserved). |
| 2107 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { | 2107 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { |
| 2108 __ EnterStubFrameWithPP(); | 2108 __ EnterStubFrameWithPP(); |
| 2109 __ LoadObject(R12, Object::null_object(), PP); | 2109 __ LoadObject(R12, Object::null_object(), PP); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2232 __ movq(right, Address(RSP, 3 * kWordSize)); | 2232 __ movq(right, Address(RSP, 3 * kWordSize)); |
| 2233 GenerateIdenticalWithNumberCheckStub(assembler, left, right); | 2233 GenerateIdenticalWithNumberCheckStub(assembler, left, right); |
| 2234 __ popq(right); | 2234 __ popq(right); |
| 2235 __ popq(left); | 2235 __ popq(left); |
| 2236 __ ret(); | 2236 __ ret(); |
| 2237 } | 2237 } |
| 2238 | 2238 |
| 2239 } // namespace dart | 2239 } // namespace dart |
| 2240 | 2240 |
| 2241 #endif // defined TARGET_ARCH_X64 | 2241 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |