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" |
| 11 #include "vm/flow_graph_compiler.h" | 11 #include "vm/flow_graph_compiler.h" |
| 12 #include "vm/instructions.h" | 12 #include "vm/instructions.h" |
| 13 #include "vm/heap.h" | 13 #include "vm/heap.h" |
| 14 #include "vm/object_store.h" | 14 #include "vm/object_store.h" |
| 15 #include "vm/resolver.h" | 15 #include "vm/resolver.h" |
| 16 #include "vm/scavenger.h" | 16 #include "vm/scavenger.h" |
| 17 #include "vm/stack_frame.h" | 17 #include "vm/stack_frame.h" |
| 18 #include "vm/stub_code.h" | 18 #include "vm/stub_code.h" |
| 19 #include "vm/tags.h" | 19 #include "vm/tags.h" |
| 20 | 20 |
| 21 | 21 |
| 22 #define __ assembler-> | 22 #define __ assembler-> |
| 23 | 23 |
| 24 namespace dart { | 24 namespace dart { |
| 25 | 25 |
| 26 DEFINE_FLAG(bool, enable_debugger, true, "Enables debugger step checks"); | |
| 26 DEFINE_FLAG(bool, inline_alloc, true, "Inline allocation of objects."); | 27 DEFINE_FLAG(bool, inline_alloc, true, "Inline allocation of objects."); |
| 27 DEFINE_FLAG(bool, use_slow_path, false, | 28 DEFINE_FLAG(bool, use_slow_path, false, |
| 28 "Set to true for debugging & verifying the slow paths."); | 29 "Set to true for debugging & verifying the slow paths."); |
| 29 DECLARE_FLAG(bool, trace_optimized_ic_calls); | 30 DECLARE_FLAG(bool, trace_optimized_ic_calls); |
| 30 DEFINE_FLAG(bool, verify_incoming_contexts, false, ""); | 31 DEFINE_FLAG(bool, verify_incoming_contexts, false, ""); |
| 31 | 32 |
| 32 | 33 |
| 33 // Input parameters: | 34 // Input parameters: |
| 34 // ESP : points to return address. | 35 // ESP : points to return address. |
| 35 // ESP + 4 : address of last argument in argument array. | 36 // ESP + 4 : address of last argument in argument array. |
| (...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1294 __ movl(EBX, FieldAddress(ECX, ICData::state_bits_offset())); | 1295 __ movl(EBX, FieldAddress(ECX, ICData::state_bits_offset())); |
| 1295 ASSERT(ICData::NumArgsTestedShift() == 0); // No shift needed. | 1296 ASSERT(ICData::NumArgsTestedShift() == 0); // No shift needed. |
| 1296 __ andl(EBX, Immediate(ICData::NumArgsTestedMask())); | 1297 __ andl(EBX, Immediate(ICData::NumArgsTestedMask())); |
| 1297 __ cmpl(EBX, Immediate(num_args)); | 1298 __ cmpl(EBX, Immediate(num_args)); |
| 1298 __ j(EQUAL, &ok, Assembler::kNearJump); | 1299 __ j(EQUAL, &ok, Assembler::kNearJump); |
| 1299 __ Stop("Incorrect stub for IC data"); | 1300 __ Stop("Incorrect stub for IC data"); |
| 1300 __ Bind(&ok); | 1301 __ Bind(&ok); |
| 1301 } | 1302 } |
| 1302 #endif // DEBUG | 1303 #endif // DEBUG |
| 1303 | 1304 |
| 1304 // Check single stepping. | 1305 if (FLAG_enable_debugger) { |
|
Ivan Posva
2014/05/22 21:53:43
Other architectures?
| |
| 1305 Label not_stepping; | 1306 // Check single stepping. |
| 1306 __ movl(EAX, FieldAddress(CTX, Context::isolate_offset())); | 1307 Label not_stepping; |
| 1307 __ movzxb(EAX, Address(EAX, Isolate::single_step_offset())); | 1308 __ movl(EAX, FieldAddress(CTX, Context::isolate_offset())); |
| 1308 __ cmpl(EAX, Immediate(0)); | 1309 __ movzxb(EAX, Address(EAX, Isolate::single_step_offset())); |
| 1309 __ j(EQUAL, ¬_stepping, Assembler::kNearJump); | 1310 __ cmpl(EAX, Immediate(0)); |
| 1311 __ j(EQUAL, ¬_stepping, Assembler::kNearJump); | |
| 1310 | 1312 |
| 1311 __ EnterStubFrame(); | 1313 __ EnterStubFrame(); |
| 1312 __ pushl(ECX); | 1314 __ pushl(ECX); |
| 1313 __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); | 1315 __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
| 1314 __ popl(ECX); | 1316 __ popl(ECX); |
| 1315 __ LeaveFrame(); | 1317 __ LeaveFrame(); |
| 1316 __ Bind(¬_stepping); | 1318 __ Bind(¬_stepping); |
| 1319 } | |
| 1317 | 1320 |
| 1318 // ECX: IC data object (preserved). | 1321 // ECX: IC data object (preserved). |
| 1319 // Load arguments descriptor into EDX. | 1322 // Load arguments descriptor into EDX. |
| 1320 __ movl(EDX, FieldAddress(ECX, ICData::arguments_descriptor_offset())); | 1323 __ movl(EDX, FieldAddress(ECX, ICData::arguments_descriptor_offset())); |
| 1321 // Loop that checks if there is an IC data match. | 1324 // Loop that checks if there is an IC data match. |
| 1322 Label loop, update, test, found, get_class_id_as_smi; | 1325 Label loop, update, test, found, get_class_id_as_smi; |
| 1323 // ECX: IC data object (preserved). | 1326 // ECX: IC data object (preserved). |
| 1324 __ movl(EBX, FieldAddress(ECX, ICData::ic_data_offset())); | 1327 __ movl(EBX, FieldAddress(ECX, ICData::ic_data_offset())); |
| 1325 // EBX: ic_data_array with check entries: classes and target functions. | 1328 // EBX: ic_data_array with check entries: classes and target functions. |
| 1326 __ leal(EBX, FieldAddress(EBX, Array::data_offset())); | 1329 __ leal(EBX, FieldAddress(EBX, Array::data_offset())); |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1907 const Register temp = ECX; | 1910 const Register temp = ECX; |
| 1908 __ movl(left, Address(ESP, 2 * kWordSize)); | 1911 __ movl(left, Address(ESP, 2 * kWordSize)); |
| 1909 __ movl(right, Address(ESP, 1 * kWordSize)); | 1912 __ movl(right, Address(ESP, 1 * kWordSize)); |
| 1910 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 1913 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
| 1911 __ ret(); | 1914 __ ret(); |
| 1912 } | 1915 } |
| 1913 | 1916 |
| 1914 } // namespace dart | 1917 } // namespace dart |
| 1915 | 1918 |
| 1916 #endif // defined TARGET_ARCH_IA32 | 1919 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |