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 1920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1931 __ jmp(&StubCode::TwoArgsCheckInlineCacheLabel()); | 1931 __ jmp(&StubCode::TwoArgsCheckInlineCacheLabel()); |
1932 __ Bind(&test_three); | 1932 __ Bind(&test_three); |
1933 __ cmpl(EBX, Immediate(3)); | 1933 __ cmpl(EBX, Immediate(3)); |
1934 __ j(NOT_EQUAL, &test_four, Assembler::kNearJump); | 1934 __ j(NOT_EQUAL, &test_four, Assembler::kNearJump); |
1935 __ jmp(&StubCode::ThreeArgsCheckInlineCacheLabel()); | 1935 __ jmp(&StubCode::ThreeArgsCheckInlineCacheLabel()); |
1936 __ Bind(&test_four); | 1936 __ Bind(&test_four); |
1937 __ Stop("Unsupported number of arguments tested."); | 1937 __ Stop("Unsupported number of arguments tested."); |
1938 } | 1938 } |
1939 | 1939 |
1940 | 1940 |
| 1941 // Called only from unoptimized code. |
| 1942 void StubCode::GenerateDebugStepCheckStub(Assembler* assembler) { |
| 1943 // Check single stepping. |
| 1944 Label not_stepping; |
| 1945 __ movl(EAX, FieldAddress(CTX, Context::isolate_offset())); |
| 1946 __ movzxb(EAX, Address(EAX, Isolate::single_step_offset())); |
| 1947 __ cmpl(EAX, Immediate(0)); |
| 1948 __ j(EQUAL, ¬_stepping, Assembler::kNearJump); |
| 1949 |
| 1950 __ EnterStubFrame(); |
| 1951 __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
| 1952 __ LeaveFrame(); |
| 1953 __ Bind(¬_stepping); |
| 1954 __ ret(); |
| 1955 } |
| 1956 |
| 1957 |
1941 // Used to check class and type arguments. Arguments passed on stack: | 1958 // Used to check class and type arguments. Arguments passed on stack: |
1942 // TOS + 0: return address. | 1959 // TOS + 0: return address. |
1943 // TOS + 1: instantiator type arguments (can be NULL). | 1960 // TOS + 1: instantiator type arguments (can be NULL). |
1944 // TOS + 2: instance. | 1961 // TOS + 2: instance. |
1945 // TOS + 3: SubtypeTestCache. | 1962 // TOS + 3: SubtypeTestCache. |
1946 // Result in ECX: null -> not found, otherwise result (true or false). | 1963 // Result in ECX: null -> not found, otherwise result (true or false). |
1947 static void GenerateSubtypeNTestCacheStub(Assembler* assembler, int n) { | 1964 static void GenerateSubtypeNTestCacheStub(Assembler* assembler, int n) { |
1948 ASSERT((1 <= n) && (n <= 3)); | 1965 ASSERT((1 <= n) && (n <= 3)); |
1949 const intptr_t kInstantiatorTypeArgumentsInBytes = 1 * kWordSize; | 1966 const intptr_t kInstantiatorTypeArgumentsInBytes = 1 * kWordSize; |
1950 const intptr_t kInstanceOffsetInBytes = 2 * kWordSize; | 1967 const intptr_t kInstanceOffsetInBytes = 2 * kWordSize; |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2210 const Register temp = ECX; | 2227 const Register temp = ECX; |
2211 __ movl(left, Address(ESP, 2 * kWordSize)); | 2228 __ movl(left, Address(ESP, 2 * kWordSize)); |
2212 __ movl(right, Address(ESP, 1 * kWordSize)); | 2229 __ movl(right, Address(ESP, 1 * kWordSize)); |
2213 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 2230 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
2214 __ ret(); | 2231 __ ret(); |
2215 } | 2232 } |
2216 | 2233 |
2217 } // namespace dart | 2234 } // namespace dart |
2218 | 2235 |
2219 #endif // defined TARGET_ARCH_IA32 | 2236 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |