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

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

Issue 140743010: Get rid of dynamic call debug stub (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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
« runtime/vm/debugger_ia32.cc ('K') | « runtime/vm/stub_code_mips.cc ('k') | no next file » | 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_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 1831 matching lines...) Expand 10 before | Expand all | Expand 10 after
1842 __ pushq(R12); // Room for result. 1842 __ pushq(R12); // Room for result.
1843 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); 1843 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
1844 __ popq(RAX); // Address of original. 1844 __ popq(RAX); // Address of original.
1845 __ popq(R10); // Restore arguments. 1845 __ popq(R10); // Restore arguments.
1846 __ popq(RBX); 1846 __ popq(RBX);
1847 __ LeaveStubFrame(); 1847 __ LeaveStubFrame();
1848 __ jmp(RAX); // Jump to original stub. 1848 __ jmp(RAX); // Jump to original stub.
1849 } 1849 }
1850 1850
1851 1851
1852 // RBX: Inline cache data array.
1853 // TOS(0): return address (Dart code).
1854 void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) {
1855 __ EnterStubFrame();
1856 __ pushq(RBX);
1857 __ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry, 0);
1858 __ popq(RBX);
1859 __ LeaveStubFrame();
1860
1861 // Find out which dispatch stub to call.
1862 Label test_two, test_three, test_four;
1863 __ movq(RCX, FieldAddress(RBX, ICData::num_args_tested_offset()));
1864 __ cmpq(RCX, Immediate(1));
1865 __ j(NOT_EQUAL, &test_two, Assembler::kNearJump);
1866 __ jmp(&StubCode::OneArgCheckInlineCacheLabel());
1867 __ Bind(&test_two);
1868 __ cmpl(RCX, Immediate(2));
1869 __ j(NOT_EQUAL, &test_three, Assembler::kNearJump);
1870 __ jmp(&StubCode::TwoArgsCheckInlineCacheLabel());
1871 __ Bind(&test_three);
1872 __ cmpl(RCX, Immediate(3));
1873 __ j(NOT_EQUAL, &test_four, Assembler::kNearJump);
1874 __ jmp(&StubCode::ThreeArgsCheckInlineCacheLabel());
1875 __ Bind(&test_four);
1876 __ Stop("Unsupported number of arguments tested.");
1877 }
1878
1879
1880 // Called only from unoptimized code. 1852 // Called only from unoptimized code.
1881 void StubCode::GenerateDebugStepCheckStub(Assembler* assembler) { 1853 void StubCode::GenerateDebugStepCheckStub(Assembler* assembler) {
1882 // Check single stepping. 1854 // Check single stepping.
1883 Label not_stepping; 1855 Label not_stepping;
1884 __ movq(RAX, FieldAddress(CTX, Context::isolate_offset())); 1856 __ movq(RAX, FieldAddress(CTX, Context::isolate_offset()));
1885 __ movzxb(RAX, Address(RAX, Isolate::single_step_offset())); 1857 __ movzxb(RAX, Address(RAX, Isolate::single_step_offset()));
1886 __ cmpq(RAX, Immediate(0)); 1858 __ cmpq(RAX, Immediate(0));
1887 __ j(EQUAL, &not_stepping, Assembler::kNearJump); 1859 __ j(EQUAL, &not_stepping, Assembler::kNearJump);
1888 1860
1889 __ EnterStubFrame(); 1861 __ EnterStubFrame();
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
2157 2129
2158 __ movq(left, Address(RSP, 2 * kWordSize)); 2130 __ movq(left, Address(RSP, 2 * kWordSize));
2159 __ movq(right, Address(RSP, 1 * kWordSize)); 2131 __ movq(right, Address(RSP, 1 * kWordSize));
2160 GenerateIdenticalWithNumberCheckStub(assembler, left, right); 2132 GenerateIdenticalWithNumberCheckStub(assembler, left, right);
2161 __ ret(); 2133 __ ret();
2162 } 2134 }
2163 2135
2164 } // namespace dart 2136 } // namespace dart
2165 2137
2166 #endif // defined TARGET_ARCH_X64 2138 #endif // defined TARGET_ARCH_X64
OLDNEW
« runtime/vm/debugger_ia32.cc ('K') | « runtime/vm/stub_code_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698