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

Side by Side Diff: runtime/vm/stub_code_ia32.cc

Issue 17846009: Better single stepping in VM debugger (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_mips.cc » ('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_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 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after
1425 // Check that the IC data array has NumberOfArgumentsChecked() == num_args. 1425 // Check that the IC data array has NumberOfArgumentsChecked() == num_args.
1426 // 'num_args_tested' is stored as an untagged int. 1426 // 'num_args_tested' is stored as an untagged int.
1427 __ movl(EBX, FieldAddress(ECX, ICData::num_args_tested_offset())); 1427 __ movl(EBX, FieldAddress(ECX, ICData::num_args_tested_offset()));
1428 __ cmpl(EBX, Immediate(num_args)); 1428 __ cmpl(EBX, Immediate(num_args));
1429 __ j(EQUAL, &ok, Assembler::kNearJump); 1429 __ j(EQUAL, &ok, Assembler::kNearJump);
1430 __ Stop("Incorrect stub for IC data"); 1430 __ Stop("Incorrect stub for IC data");
1431 __ Bind(&ok); 1431 __ Bind(&ok);
1432 } 1432 }
1433 #endif // DEBUG 1433 #endif // DEBUG
1434 1434
1435 // Check single stepping.
1436 Label not_stepping;
1437 __ movl(EAX, FieldAddress(CTX, Context::isolate_offset()));
1438 __ movzxb(EAX, Address(EAX, Isolate::single_step_offset()));
1439 __ cmpl(EAX, Immediate(0));
1440 __ j(EQUAL, &not_stepping, Assembler::kNearJump);
1441
1442 __ EnterStubFrame();
1443 __ pushl(ECX);
1444 __ CallRuntime(kSingleStepHandlerRuntimeEntry);
1445 __ popl(ECX);
1446 __ LeaveFrame();
1447 __ Bind(&not_stepping);
1448
1435 // Load arguments descriptor into EDX. 1449 // Load arguments descriptor into EDX.
1436 __ movl(EDX, FieldAddress(ECX, ICData::arguments_descriptor_offset())); 1450 __ movl(EDX, FieldAddress(ECX, ICData::arguments_descriptor_offset()));
1437 // Loop that checks if there is an IC data match. 1451 // Loop that checks if there is an IC data match.
1438 Label loop, update, test, found, get_class_id_as_smi; 1452 Label loop, update, test, found, get_class_id_as_smi;
1439 // ECX: IC data object (preserved). 1453 // ECX: IC data object (preserved).
1440 __ movl(EBX, FieldAddress(ECX, ICData::ic_data_offset())); 1454 __ movl(EBX, FieldAddress(ECX, ICData::ic_data_offset()));
1441 // EBX: ic_data_array with check entries: classes and target functions. 1455 // EBX: ic_data_array with check entries: classes and target functions.
1442 __ leal(EBX, FieldAddress(EBX, Array::data_offset())); 1456 __ leal(EBX, FieldAddress(EBX, Array::data_offset()));
1443 // EBX: points directly to the first ic data array element. 1457 // EBX: points directly to the first ic data array element.
1444 1458
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1648 // Check that the IC data array has NumberOfArgumentsChecked() == 0. 1662 // Check that the IC data array has NumberOfArgumentsChecked() == 0.
1649 // 'num_args_tested' is stored as an untagged int. 1663 // 'num_args_tested' is stored as an untagged int.
1650 __ movl(EBX, FieldAddress(ECX, ICData::num_args_tested_offset())); 1664 __ movl(EBX, FieldAddress(ECX, ICData::num_args_tested_offset()));
1651 __ cmpl(EBX, Immediate(0)); 1665 __ cmpl(EBX, Immediate(0));
1652 __ j(EQUAL, &ok, Assembler::kNearJump); 1666 __ j(EQUAL, &ok, Assembler::kNearJump);
1653 __ Stop("Incorrect IC data for unoptimized static call"); 1667 __ Stop("Incorrect IC data for unoptimized static call");
1654 __ Bind(&ok); 1668 __ Bind(&ok);
1655 } 1669 }
1656 #endif // DEBUG 1670 #endif // DEBUG
1657 1671
1672 // Check single stepping.
1673 Label not_stepping;
1674 __ movl(EAX, FieldAddress(CTX, Context::isolate_offset()));
1675 __ movzxb(EAX, Address(EAX, Isolate::single_step_offset()));
1676 __ cmpl(EAX, Immediate(0));
1677 __ j(EQUAL, &not_stepping, Assembler::kNearJump);
1678
1679 __ EnterStubFrame();
1680 __ pushl(ECX);
1681 __ CallRuntime(kSingleStepHandlerRuntimeEntry);
1682 __ popl(ECX);
1683 __ LeaveFrame();
1684 __ Bind(&not_stepping);
1685
1658 // ECX: IC data object (preserved). 1686 // ECX: IC data object (preserved).
1659 __ movl(EBX, FieldAddress(ECX, ICData::ic_data_offset())); 1687 __ movl(EBX, FieldAddress(ECX, ICData::ic_data_offset()));
1660 // EBX: ic_data_array with entries: target functions and count. 1688 // EBX: ic_data_array with entries: target functions and count.
1661 __ leal(EBX, FieldAddress(EBX, Array::data_offset())); 1689 __ leal(EBX, FieldAddress(EBX, Array::data_offset()));
1662 // EBX: points directly to the first ic data array element. 1690 // EBX: points directly to the first ic data array element.
1663 const intptr_t target_offset = ICData::TargetIndexFor(0) * kWordSize; 1691 const intptr_t target_offset = ICData::TargetIndexFor(0) * kWordSize;
1664 const intptr_t count_offset = ICData::CountIndexFor(0) * kWordSize; 1692 const intptr_t count_offset = ICData::CountIndexFor(0) * kWordSize;
1665 1693
1666 // Increment count for this call. 1694 // Increment count for this call.
1667 Label increment_done; 1695 Label increment_done;
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
2126 } 2154 }
2127 2155
2128 2156
2129 // Called only from unoptimized code. All relevant registers have been saved. 2157 // Called only from unoptimized code. All relevant registers have been saved.
2130 // TOS + 0: return address 2158 // TOS + 0: return address
2131 // TOS + 1: right argument. 2159 // TOS + 1: right argument.
2132 // TOS + 2: left argument. 2160 // TOS + 2: left argument.
2133 // Returns ZF set. 2161 // Returns ZF set.
2134 void StubCode::GenerateUnoptimizedIdenticalWithNumberCheckStub( 2162 void StubCode::GenerateUnoptimizedIdenticalWithNumberCheckStub(
2135 Assembler* assembler) { 2163 Assembler* assembler) {
2164 // Check single stepping.
2165 Label not_stepping;
2166 __ movl(EAX, FieldAddress(CTX, Context::isolate_offset()));
2167 __ movzxb(EAX, Address(EAX, Isolate::single_step_offset()));
2168 __ cmpl(EAX, Immediate(0));
2169 __ j(EQUAL, &not_stepping, Assembler::kNearJump);
2170
2171 __ EnterStubFrame();
2172 __ CallRuntime(kSingleStepHandlerRuntimeEntry);
2173 __ LeaveFrame();
2174 __ Bind(&not_stepping);
2175
2136 const Register left = EAX; 2176 const Register left = EAX;
2137 const Register right = EDX; 2177 const Register right = EDX;
2138 const Register temp = ECX; 2178 const Register temp = ECX;
2139 __ movl(left, Address(ESP, 2 * kWordSize)); 2179 __ movl(left, Address(ESP, 2 * kWordSize));
2140 __ movl(right, Address(ESP, 1 * kWordSize)); 2180 __ movl(right, Address(ESP, 1 * kWordSize));
2141 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 2181 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
2142 __ ret(); 2182 __ ret();
2143 } 2183 }
2144 2184
2145 2185
(...skipping 17 matching lines...) Expand all
2163 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 2203 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
2164 __ popl(temp); 2204 __ popl(temp);
2165 __ popl(right); 2205 __ popl(right);
2166 __ popl(left); 2206 __ popl(left);
2167 __ ret(); 2207 __ ret();
2168 } 2208 }
2169 2209
2170 } // namespace dart 2210 } // namespace dart
2171 2211
2172 #endif // defined TARGET_ARCH_IA32 2212 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698