Chromium Code Reviews| 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_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 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 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1287 __ movl(EBX, FieldAddress(ECX, ICData::state_bits_offset())); | 1287 __ movl(EBX, FieldAddress(ECX, ICData::state_bits_offset())); |
| 1288 ASSERT(ICData::NumArgsTestedShift() == 0); // No shift needed. | 1288 ASSERT(ICData::NumArgsTestedShift() == 0); // No shift needed. |
| 1289 __ andl(EBX, Immediate(ICData::NumArgsTestedMask())); | 1289 __ andl(EBX, Immediate(ICData::NumArgsTestedMask())); |
| 1290 __ cmpl(EBX, Immediate(num_args)); | 1290 __ cmpl(EBX, Immediate(num_args)); |
| 1291 __ j(EQUAL, &ok, Assembler::kNearJump); | 1291 __ j(EQUAL, &ok, Assembler::kNearJump); |
| 1292 __ Stop("Incorrect stub for IC data"); | 1292 __ Stop("Incorrect stub for IC data"); |
| 1293 __ Bind(&ok); | 1293 __ Bind(&ok); |
| 1294 } | 1294 } |
| 1295 #endif // DEBUG | 1295 #endif // DEBUG |
| 1296 | 1296 |
| 1297 Label stepping, done_stepping; | |
| 1297 if (FLAG_enable_debugger) { | 1298 if (FLAG_enable_debugger) { |
| 1298 // Check single stepping. | 1299 // Check single stepping. |
| 1299 Label not_stepping; | |
| 1300 __ movl(EAX, FieldAddress(CTX, Context::isolate_offset())); | 1300 __ movl(EAX, FieldAddress(CTX, Context::isolate_offset())); |
| 1301 __ movzxb(EAX, Address(EAX, Isolate::single_step_offset())); | 1301 __ movzxb(EAX, Address(EAX, Isolate::single_step_offset())); |
|
Vyacheslav Egorov (Google)
2014/07/11 23:31:34
I wonder if single_step were intptr_t would there
| |
| 1302 __ cmpl(EAX, Immediate(0)); | 1302 __ cmpl(EAX, Immediate(0)); |
| 1303 __ j(EQUAL, ¬_stepping, Assembler::kNearJump); | 1303 __ j(NOT_EQUAL, &stepping); |
| 1304 | 1304 __ Bind(&done_stepping); |
| 1305 __ EnterStubFrame(); | |
| 1306 __ pushl(ECX); | |
| 1307 __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); | |
| 1308 __ popl(ECX); | |
| 1309 __ LeaveFrame(); | |
| 1310 __ Bind(¬_stepping); | |
| 1311 } | 1305 } |
| 1312 | 1306 |
| 1313 // ECX: IC data object (preserved). | 1307 // ECX: IC data object (preserved). |
| 1314 // Load arguments descriptor into EDX. | 1308 // Load arguments descriptor into EDX. |
| 1315 __ movl(EDX, FieldAddress(ECX, ICData::arguments_descriptor_offset())); | 1309 __ movl(EDX, FieldAddress(ECX, ICData::arguments_descriptor_offset())); |
| 1316 // Loop that checks if there is an IC data match. | 1310 // Loop that checks if there is an IC data match. |
| 1317 Label loop, update, test, found; | 1311 Label loop, update, test, found; |
| 1318 // ECX: IC data object (preserved). | 1312 // ECX: IC data object (preserved). |
| 1319 __ movl(EBX, FieldAddress(ECX, ICData::ic_data_offset())); | 1313 __ movl(EBX, FieldAddress(ECX, ICData::ic_data_offset())); |
| 1320 // EBX: ic_data_array with check entries: classes and target functions. | 1314 // EBX: ic_data_array with check entries: classes and target functions. |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1410 __ cmovno(EDI, EAX); | 1404 __ cmovno(EDI, EAX); |
| 1411 __ movl(Address(EBX, count_offset), EDI); | 1405 __ movl(Address(EBX, count_offset), EDI); |
| 1412 | 1406 |
| 1413 __ movl(EAX, Address(EBX, target_offset)); | 1407 __ movl(EAX, Address(EBX, target_offset)); |
| 1414 __ Bind(&call_target_function); | 1408 __ Bind(&call_target_function); |
| 1415 // EAX: Target function. | 1409 // EAX: Target function. |
| 1416 __ movl(EBX, FieldAddress(EAX, Function::instructions_offset())); | 1410 __ movl(EBX, FieldAddress(EAX, Function::instructions_offset())); |
| 1417 __ addl(EBX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); | 1411 __ addl(EBX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); |
| 1418 __ jmp(EBX); | 1412 __ jmp(EBX); |
| 1419 __ int3(); | 1413 __ int3(); |
| 1414 | |
| 1415 if (FLAG_enable_debugger) { | |
| 1416 __ Bind(&stepping); | |
| 1417 __ EnterStubFrame(); | |
| 1418 __ pushl(ECX); | |
| 1419 __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); | |
| 1420 __ popl(ECX); | |
| 1421 __ LeaveFrame(); | |
| 1422 __ jmp(&done_stepping); | |
| 1423 } | |
| 1420 } | 1424 } |
| 1421 | 1425 |
| 1422 | 1426 |
| 1423 // Use inline cache data array to invoke the target or continue in inline | 1427 // Use inline cache data array to invoke the target or continue in inline |
| 1424 // cache miss handler. Stub for 1-argument check (receiver class). | 1428 // cache miss handler. Stub for 1-argument check (receiver class). |
| 1425 // ECX: Inline cache data object. | 1429 // ECX: Inline cache data object. |
| 1426 // TOS(0): Return address. | 1430 // TOS(0): Return address. |
| 1427 // Inline cache data object structure: | 1431 // Inline cache data object structure: |
| 1428 // 0: function-name | 1432 // 0: function-name |
| 1429 // 1: N, number of arguments checked. | 1433 // 1: N, number of arguments checked. |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1897 const Register temp = ECX; | 1901 const Register temp = ECX; |
| 1898 __ movl(left, Address(ESP, 2 * kWordSize)); | 1902 __ movl(left, Address(ESP, 2 * kWordSize)); |
| 1899 __ movl(right, Address(ESP, 1 * kWordSize)); | 1903 __ movl(right, Address(ESP, 1 * kWordSize)); |
| 1900 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 1904 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
| 1901 __ ret(); | 1905 __ ret(); |
| 1902 } | 1906 } |
| 1903 | 1907 |
| 1904 } // namespace dart | 1908 } // namespace dart |
| 1905 | 1909 |
| 1906 #endif // defined TARGET_ARCH_IA32 | 1910 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |