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 1894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1905 __ jmp(&StubCode::TwoArgsCheckInlineCacheLabel()); | 1905 __ jmp(&StubCode::TwoArgsCheckInlineCacheLabel()); |
1906 __ Bind(&test_three); | 1906 __ Bind(&test_three); |
1907 __ cmpl(RCX, Immediate(3)); | 1907 __ cmpl(RCX, Immediate(3)); |
1908 __ j(NOT_EQUAL, &test_four, Assembler::kNearJump); | 1908 __ j(NOT_EQUAL, &test_four, Assembler::kNearJump); |
1909 __ jmp(&StubCode::ThreeArgsCheckInlineCacheLabel()); | 1909 __ jmp(&StubCode::ThreeArgsCheckInlineCacheLabel()); |
1910 __ Bind(&test_four); | 1910 __ Bind(&test_four); |
1911 __ Stop("Unsupported number of arguments tested."); | 1911 __ Stop("Unsupported number of arguments tested."); |
1912 } | 1912 } |
1913 | 1913 |
1914 | 1914 |
| 1915 // Called only from unoptimized code. |
| 1916 void StubCode::GenerateDebugStepCheckStub(Assembler* assembler) { |
| 1917 // Check single stepping. |
| 1918 Label not_stepping; |
| 1919 __ movq(RAX, FieldAddress(CTX, Context::isolate_offset())); |
| 1920 __ movzxb(RAX, Address(RAX, Isolate::single_step_offset())); |
| 1921 __ cmpq(RAX, Immediate(0)); |
| 1922 __ j(EQUAL, ¬_stepping, Assembler::kNearJump); |
| 1923 |
| 1924 __ EnterStubFrame(); |
| 1925 __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
| 1926 __ LeaveStubFrame(); |
| 1927 __ Bind(¬_stepping); |
| 1928 __ ret(); |
| 1929 } |
| 1930 |
| 1931 |
1915 // Used to check class and type arguments. Arguments passed on stack: | 1932 // Used to check class and type arguments. Arguments passed on stack: |
1916 // TOS + 0: return address. | 1933 // TOS + 0: return address. |
1917 // TOS + 1: instantiator type arguments (can be NULL). | 1934 // TOS + 1: instantiator type arguments (can be NULL). |
1918 // TOS + 2: instance. | 1935 // TOS + 2: instance. |
1919 // TOS + 3: SubtypeTestCache. | 1936 // TOS + 3: SubtypeTestCache. |
1920 // Result in RCX: null -> not found, otherwise result (true or false). | 1937 // Result in RCX: null -> not found, otherwise result (true or false). |
1921 static void GenerateSubtypeNTestCacheStub(Assembler* assembler, int n) { | 1938 static void GenerateSubtypeNTestCacheStub(Assembler* assembler, int n) { |
1922 ASSERT((1 <= n) && (n <= 3)); | 1939 ASSERT((1 <= n) && (n <= 3)); |
1923 const intptr_t kInstantiatorTypeArgumentsInBytes = 1 * kWordSize; | 1940 const intptr_t kInstantiatorTypeArgumentsInBytes = 1 * kWordSize; |
1924 const intptr_t kInstanceOffsetInBytes = 2 * kWordSize; | 1941 const intptr_t kInstanceOffsetInBytes = 2 * kWordSize; |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2175 | 2192 |
2176 __ movq(left, Address(RSP, 2 * kWordSize)); | 2193 __ movq(left, Address(RSP, 2 * kWordSize)); |
2177 __ movq(right, Address(RSP, 1 * kWordSize)); | 2194 __ movq(right, Address(RSP, 1 * kWordSize)); |
2178 GenerateIdenticalWithNumberCheckStub(assembler, left, right); | 2195 GenerateIdenticalWithNumberCheckStub(assembler, left, right); |
2179 __ ret(); | 2196 __ ret(); |
2180 } | 2197 } |
2181 | 2198 |
2182 } // namespace dart | 2199 } // namespace dart |
2183 | 2200 |
2184 #endif // defined TARGET_ARCH_X64 | 2201 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |