| 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_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 // Check that we are always entering from Dart code. | 63 // Check that we are always entering from Dart code. |
| 64 __ LoadFromOffset(kWord, R6, CTX, Isolate::vm_tag_offset()); | 64 __ LoadFromOffset(kWord, R6, CTX, Isolate::vm_tag_offset()); |
| 65 __ CompareImmediate(R6, VMTag::kScriptTagId); | 65 __ CompareImmediate(R6, VMTag::kScriptTagId); |
| 66 __ b(&ok, EQ); | 66 __ b(&ok, EQ); |
| 67 __ Stop("Not coming from Dart code."); | 67 __ Stop("Not coming from Dart code."); |
| 68 __ Bind(&ok); | 68 __ Bind(&ok); |
| 69 } | 69 } |
| 70 #endif | 70 #endif |
| 71 | 71 |
| 72 // Mark that the isolate is executing VM code. | 72 // Mark that the isolate is executing VM code. |
| 73 __ LoadImmediate(R6, VMTag::kVMTagId); | 73 __ StoreToOffset(kWord, R5, CTX, Isolate::vm_tag_offset()); |
| 74 __ StoreToOffset(kWord, R6, CTX, Isolate::vm_tag_offset()); | |
| 75 | 74 |
| 76 // Reserve space for arguments and align frame before entering C++ world. | 75 // Reserve space for arguments and align frame before entering C++ world. |
| 77 // NativeArguments are passed in registers. | 76 // NativeArguments are passed in registers. |
| 78 ASSERT(sizeof(NativeArguments) == 4 * kWordSize); | 77 ASSERT(sizeof(NativeArguments) == 4 * kWordSize); |
| 79 __ ReserveAlignedFrameSpace(0); | 78 __ ReserveAlignedFrameSpace(0); |
| 80 | 79 |
| 81 // Pass NativeArguments structure by value and call runtime. | 80 // Pass NativeArguments structure by value and call runtime. |
| 82 // Registers R0, R1, R2, and R3 are used. | 81 // Registers R0, R1, R2, and R3 are used. |
| 83 | 82 |
| 84 ASSERT(isolate_offset == 0 * kWordSize); | 83 ASSERT(isolate_offset == 0 * kWordSize); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 // Check that we are always entering from Dart code. | 177 // Check that we are always entering from Dart code. |
| 179 __ LoadFromOffset(kWord, R6, CTX, Isolate::vm_tag_offset()); | 178 __ LoadFromOffset(kWord, R6, CTX, Isolate::vm_tag_offset()); |
| 180 __ CompareImmediate(R6, VMTag::kScriptTagId); | 179 __ CompareImmediate(R6, VMTag::kScriptTagId); |
| 181 __ b(&ok, EQ); | 180 __ b(&ok, EQ); |
| 182 __ Stop("Not coming from Dart code."); | 181 __ Stop("Not coming from Dart code."); |
| 183 __ Bind(&ok); | 182 __ Bind(&ok); |
| 184 } | 183 } |
| 185 #endif | 184 #endif |
| 186 | 185 |
| 187 // Mark that the isolate is executing Native code. | 186 // Mark that the isolate is executing Native code. |
| 188 __ LoadImmediate(R6, VMTag::kRuntimeNativeTagId); | 187 __ StoreToOffset(kWord, R5, CTX, Isolate::vm_tag_offset()); |
| 189 __ StoreToOffset(kWord, R6, CTX, Isolate::vm_tag_offset()); | |
| 190 | 188 |
| 191 // Reserve space for the native arguments structure passed on the stack (the | 189 // Reserve space for the native arguments structure passed on the stack (the |
| 192 // outgoing pointer parameter to the native arguments structure is passed in | 190 // outgoing pointer parameter to the native arguments structure is passed in |
| 193 // R0) and align frame before entering the C++ world. | 191 // R0) and align frame before entering the C++ world. |
| 194 __ ReserveAlignedFrameSpace(sizeof(NativeArguments)); | 192 __ ReserveAlignedFrameSpace(sizeof(NativeArguments)); |
| 195 | 193 |
| 196 // Initialize NativeArguments structure and call native function. | 194 // Initialize NativeArguments structure and call native function. |
| 197 // Registers R0, R1, R2, and R3 are used. | 195 // Registers R0, R1, R2, and R3 are used. |
| 198 | 196 |
| 199 ASSERT(isolate_offset == 0 * kWordSize); | 197 ASSERT(isolate_offset == 0 * kWordSize); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 // Check that we are always entering from Dart code. | 298 // Check that we are always entering from Dart code. |
| 301 __ LoadFromOffset(kWord, R6, CTX, Isolate::vm_tag_offset()); | 299 __ LoadFromOffset(kWord, R6, CTX, Isolate::vm_tag_offset()); |
| 302 __ CompareImmediate(R6, VMTag::kScriptTagId); | 300 __ CompareImmediate(R6, VMTag::kScriptTagId); |
| 303 __ b(&ok, EQ); | 301 __ b(&ok, EQ); |
| 304 __ Stop("Not coming from Dart code."); | 302 __ Stop("Not coming from Dart code."); |
| 305 __ Bind(&ok); | 303 __ Bind(&ok); |
| 306 } | 304 } |
| 307 #endif | 305 #endif |
| 308 | 306 |
| 309 // Mark that the isolate is executing Native code. | 307 // Mark that the isolate is executing Native code. |
| 310 __ LoadImmediate(R6, VMTag::kRuntimeNativeTagId); | 308 __ StoreToOffset(kWord, R5, CTX, Isolate::vm_tag_offset()); |
| 311 __ StoreToOffset(kWord, R6, CTX, Isolate::vm_tag_offset()); | |
| 312 | 309 |
| 313 // Reserve space for the native arguments structure passed on the stack (the | 310 // Reserve space for the native arguments structure passed on the stack (the |
| 314 // outgoing pointer parameter to the native arguments structure is passed in | 311 // outgoing pointer parameter to the native arguments structure is passed in |
| 315 // R0) and align frame before entering the C++ world. | 312 // R0) and align frame before entering the C++ world. |
| 316 __ ReserveAlignedFrameSpace(sizeof(NativeArguments)); | 313 __ ReserveAlignedFrameSpace(sizeof(NativeArguments)); |
| 317 | 314 |
| 318 // Initialize NativeArguments structure and call native function. | 315 // Initialize NativeArguments structure and call native function. |
| 319 // Registers R0, R1, R2, and R3 are used. | 316 // Registers R0, R1, R2, and R3 are used. |
| 320 | 317 |
| 321 ASSERT(isolate_offset == 0 * kWordSize); | 318 ASSERT(isolate_offset == 0 * kWordSize); |
| (...skipping 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1852 const Register right = R0; | 1849 const Register right = R0; |
| 1853 __ ldr(left, Address(SP, 1 * kWordSize)); | 1850 __ ldr(left, Address(SP, 1 * kWordSize)); |
| 1854 __ ldr(right, Address(SP, 0 * kWordSize)); | 1851 __ ldr(right, Address(SP, 0 * kWordSize)); |
| 1855 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 1852 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
| 1856 __ Ret(); | 1853 __ Ret(); |
| 1857 } | 1854 } |
| 1858 | 1855 |
| 1859 } // namespace dart | 1856 } // namespace dart |
| 1860 | 1857 |
| 1861 #endif // defined TARGET_ARCH_ARM | 1858 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |