| 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 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1261 __ movl(RCX, FieldAddress(RBX, ICData::state_bits_offset())); | 1261 __ movl(RCX, FieldAddress(RBX, ICData::state_bits_offset())); |
| 1262 ASSERT(ICData::NumArgsTestedShift() == 0); // No shift needed. | 1262 ASSERT(ICData::NumArgsTestedShift() == 0); // No shift needed. |
| 1263 __ andq(RCX, Immediate(ICData::NumArgsTestedMask())); | 1263 __ andq(RCX, Immediate(ICData::NumArgsTestedMask())); |
| 1264 __ cmpq(RCX, Immediate(num_args)); | 1264 __ cmpq(RCX, Immediate(num_args)); |
| 1265 __ j(EQUAL, &ok, Assembler::kNearJump); | 1265 __ j(EQUAL, &ok, Assembler::kNearJump); |
| 1266 __ Stop("Incorrect stub for IC data"); | 1266 __ Stop("Incorrect stub for IC data"); |
| 1267 __ Bind(&ok); | 1267 __ Bind(&ok); |
| 1268 } | 1268 } |
| 1269 #endif // DEBUG | 1269 #endif // DEBUG |
| 1270 | 1270 |
| 1271 Label stepping, done_stepping; |
| 1271 if (FLAG_enable_debugger) { | 1272 if (FLAG_enable_debugger) { |
| 1272 // Check single stepping. | 1273 // Check single stepping. |
| 1273 Label not_stepping; | |
| 1274 __ movq(RAX, FieldAddress(CTX, Context::isolate_offset())); | 1274 __ movq(RAX, FieldAddress(CTX, Context::isolate_offset())); |
| 1275 __ movzxb(RAX, Address(RAX, Isolate::single_step_offset())); | 1275 __ movzxb(RAX, Address(RAX, Isolate::single_step_offset())); |
| 1276 __ cmpq(RAX, Immediate(0)); | 1276 __ cmpq(RAX, Immediate(0)); |
| 1277 __ j(EQUAL, ¬_stepping, Assembler::kNearJump); | 1277 __ j(NOT_EQUAL, &stepping); |
| 1278 __ EnterStubFrame(); | 1278 __ Bind(&done_stepping); |
| 1279 __ pushq(RBX); | |
| 1280 __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); | |
| 1281 __ popq(RBX); | |
| 1282 __ LeaveStubFrame(); | |
| 1283 __ Bind(¬_stepping); | |
| 1284 } | 1279 } |
| 1285 | 1280 |
| 1286 // Load arguments descriptor into R10. | 1281 // Load arguments descriptor into R10. |
| 1287 __ movq(R10, FieldAddress(RBX, ICData::arguments_descriptor_offset())); | 1282 __ movq(R10, FieldAddress(RBX, ICData::arguments_descriptor_offset())); |
| 1288 // Loop that checks if there is an IC data match. | 1283 // Loop that checks if there is an IC data match. |
| 1289 Label loop, update, test, found; | 1284 Label loop, update, test, found; |
| 1290 // RBX: IC data object (preserved). | 1285 // RBX: IC data object (preserved). |
| 1291 __ movq(R12, FieldAddress(RBX, ICData::ic_data_offset())); | 1286 __ movq(R12, FieldAddress(RBX, ICData::ic_data_offset())); |
| 1292 // R12: ic_data_array with check entries: classes and target functions. | 1287 // R12: ic_data_array with check entries: classes and target functions. |
| 1293 __ leaq(R12, FieldAddress(R12, Array::data_offset())); | 1288 __ leaq(R12, FieldAddress(R12, Array::data_offset())); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1377 __ movq(R9, Immediate(Smi::RawValue(Smi::kMaxValue))); | 1372 __ movq(R9, Immediate(Smi::RawValue(Smi::kMaxValue))); |
| 1378 __ cmovnoq(R9, R8); | 1373 __ cmovnoq(R9, R8); |
| 1379 __ movq(Address(R12, count_offset), R9); | 1374 __ movq(Address(R12, count_offset), R9); |
| 1380 | 1375 |
| 1381 __ Bind(&call_target_function); | 1376 __ Bind(&call_target_function); |
| 1382 // RAX: Target function. | 1377 // RAX: Target function. |
| 1383 Label is_compiled; | 1378 Label is_compiled; |
| 1384 __ movq(RCX, FieldAddress(RAX, Function::instructions_offset())); | 1379 __ movq(RCX, FieldAddress(RAX, Function::instructions_offset())); |
| 1385 __ addq(RCX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); | 1380 __ addq(RCX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); |
| 1386 __ jmp(RCX); | 1381 __ jmp(RCX); |
| 1382 |
| 1383 if (FLAG_enable_debugger) { |
| 1384 __ Bind(&stepping); |
| 1385 __ EnterStubFrame(); |
| 1386 __ pushq(RBX); |
| 1387 __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
| 1388 __ popq(RBX); |
| 1389 __ LeaveStubFrame(); |
| 1390 __ jmp(&done_stepping); |
| 1391 } |
| 1387 } | 1392 } |
| 1388 | 1393 |
| 1389 | 1394 |
| 1390 // Use inline cache data array to invoke the target or continue in inline | 1395 // Use inline cache data array to invoke the target or continue in inline |
| 1391 // cache miss handler. Stub for 1-argument check (receiver class). | 1396 // cache miss handler. Stub for 1-argument check (receiver class). |
| 1392 // RBX: Inline cache data object. | 1397 // RBX: Inline cache data object. |
| 1393 // TOS(0): Return address. | 1398 // TOS(0): Return address. |
| 1394 // Inline cache data object structure: | 1399 // Inline cache data object structure: |
| 1395 // 0: function-name | 1400 // 0: function-name |
| 1396 // 1: N, number of arguments checked. | 1401 // 1: N, number of arguments checked. |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1863 | 1868 |
| 1864 __ movq(left, Address(RSP, 2 * kWordSize)); | 1869 __ movq(left, Address(RSP, 2 * kWordSize)); |
| 1865 __ movq(right, Address(RSP, 1 * kWordSize)); | 1870 __ movq(right, Address(RSP, 1 * kWordSize)); |
| 1866 GenerateIdenticalWithNumberCheckStub(assembler, left, right); | 1871 GenerateIdenticalWithNumberCheckStub(assembler, left, right); |
| 1867 __ ret(); | 1872 __ ret(); |
| 1868 } | 1873 } |
| 1869 | 1874 |
| 1870 } // namespace dart | 1875 } // namespace dart |
| 1871 | 1876 |
| 1872 #endif // defined TARGET_ARCH_X64 | 1877 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |