| 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 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 __ movl(EAX, Address(CTX, Isolate::vm_tag_offset())); | 64 __ movl(EAX, Address(CTX, Isolate::vm_tag_offset())); |
| 65 __ cmpl(EAX, Immediate(VMTag::kScriptTagId)); | 65 __ cmpl(EAX, Immediate(VMTag::kScriptTagId)); |
| 66 __ j(EQUAL, &ok, Assembler::kNearJump); | 66 __ j(EQUAL, &ok, Assembler::kNearJump); |
| 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 __ movl(Address(CTX, Isolate::vm_tag_offset()), Immediate(VMTag::kVMTagId)); | 73 __ movl(Address(CTX, Isolate::vm_tag_offset()), ECX); |
| 74 | 74 |
| 75 // Reserve space for arguments and align frame before entering C++ world. | 75 // Reserve space for arguments and align frame before entering C++ world. |
| 76 __ AddImmediate(ESP, Immediate(-sizeof(NativeArguments))); | 76 __ AddImmediate(ESP, Immediate(-sizeof(NativeArguments))); |
| 77 if (OS::ActivationFrameAlignment() > 1) { | 77 if (OS::ActivationFrameAlignment() > 1) { |
| 78 __ andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1))); | 78 __ andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1))); |
| 79 } | 79 } |
| 80 | 80 |
| 81 // Pass NativeArguments structure by value and call runtime. | 81 // Pass NativeArguments structure by value and call runtime. |
| 82 __ movl(Address(ESP, isolate_offset), CTX); // Set isolate in NativeArgs. | 82 __ movl(Address(ESP, isolate_offset), CTX); // Set isolate in NativeArgs. |
| 83 // There are no runtime calls to closures, so we do not need to set the tag | 83 // There are no runtime calls to closures, so we do not need to set the tag |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 // Check that we are always entering from Dart code. | 171 // Check that we are always entering from Dart code. |
| 172 __ movl(EDI, Address(CTX, Isolate::vm_tag_offset())); | 172 __ movl(EDI, Address(CTX, Isolate::vm_tag_offset())); |
| 173 __ cmpl(EDI, Immediate(VMTag::kScriptTagId)); | 173 __ cmpl(EDI, Immediate(VMTag::kScriptTagId)); |
| 174 __ j(EQUAL, &ok, Assembler::kNearJump); | 174 __ j(EQUAL, &ok, Assembler::kNearJump); |
| 175 __ Stop("Not coming from Dart code."); | 175 __ Stop("Not coming from Dart code."); |
| 176 __ Bind(&ok); | 176 __ Bind(&ok); |
| 177 } | 177 } |
| 178 #endif | 178 #endif |
| 179 | 179 |
| 180 // Mark that the isolate is executing Native code. | 180 // Mark that the isolate is executing Native code. |
| 181 __ movl(Address(CTX, Isolate::vm_tag_offset()), | 181 __ movl(Address(CTX, Isolate::vm_tag_offset()), ECX); |
| 182 Immediate(VMTag::kRuntimeNativeTagId)); | |
| 183 | 182 |
| 184 // Reserve space for the native arguments structure, the outgoing parameters | 183 // Reserve space for the native arguments structure, the outgoing parameters |
| 185 // (pointer to the native arguments structure, the C function entry point) | 184 // (pointer to the native arguments structure, the C function entry point) |
| 186 // and align frame before entering the C++ world. | 185 // and align frame before entering the C++ world. |
| 187 __ AddImmediate(ESP, Immediate(-sizeof(NativeArguments) - (2 * kWordSize))); | 186 __ AddImmediate(ESP, Immediate(-sizeof(NativeArguments) - (2 * kWordSize))); |
| 188 if (OS::ActivationFrameAlignment() > 1) { | 187 if (OS::ActivationFrameAlignment() > 1) { |
| 189 __ andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1))); | 188 __ andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1))); |
| 190 } | 189 } |
| 191 | 190 |
| 192 // Pass NativeArguments structure by value and call native function. | 191 // Pass NativeArguments structure by value and call native function. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 // Check that we are always entering from Dart code. | 270 // Check that we are always entering from Dart code. |
| 272 __ movl(EDI, Address(CTX, Isolate::vm_tag_offset())); | 271 __ movl(EDI, Address(CTX, Isolate::vm_tag_offset())); |
| 273 __ cmpl(EDI, Immediate(VMTag::kScriptTagId)); | 272 __ cmpl(EDI, Immediate(VMTag::kScriptTagId)); |
| 274 __ j(EQUAL, &ok, Assembler::kNearJump); | 273 __ j(EQUAL, &ok, Assembler::kNearJump); |
| 275 __ Stop("Not coming from Dart code."); | 274 __ Stop("Not coming from Dart code."); |
| 276 __ Bind(&ok); | 275 __ Bind(&ok); |
| 277 } | 276 } |
| 278 #endif | 277 #endif |
| 279 | 278 |
| 280 // Mark that the isolate is executing Native code. | 279 // Mark that the isolate is executing Native code. |
| 281 __ movl(Address(CTX, Isolate::vm_tag_offset()), | 280 __ movl(Address(CTX, Isolate::vm_tag_offset()), ECX); |
| 282 Immediate(VMTag::kRuntimeNativeTagId)); | |
| 283 | 281 |
| 284 // Reserve space for the native arguments structure, the outgoing parameter | 282 // Reserve space for the native arguments structure, the outgoing parameter |
| 285 // (pointer to the native arguments structure) and align frame before | 283 // (pointer to the native arguments structure) and align frame before |
| 286 // entering the C++ world. | 284 // entering the C++ world. |
| 287 __ AddImmediate(ESP, Immediate(-sizeof(NativeArguments) - kWordSize)); | 285 __ AddImmediate(ESP, Immediate(-sizeof(NativeArguments) - kWordSize)); |
| 288 if (OS::ActivationFrameAlignment() > 1) { | 286 if (OS::ActivationFrameAlignment() > 1) { |
| 289 __ andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1))); | 287 __ andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1))); |
| 290 } | 288 } |
| 291 | 289 |
| 292 // Pass NativeArguments structure by value and call native function. | 290 // Pass NativeArguments structure by value and call native function. |
| (...skipping 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1864 const Register temp = ECX; | 1862 const Register temp = ECX; |
| 1865 __ movl(left, Address(ESP, 2 * kWordSize)); | 1863 __ movl(left, Address(ESP, 2 * kWordSize)); |
| 1866 __ movl(right, Address(ESP, 1 * kWordSize)); | 1864 __ movl(right, Address(ESP, 1 * kWordSize)); |
| 1867 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 1865 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
| 1868 __ ret(); | 1866 __ ret(); |
| 1869 } | 1867 } |
| 1870 | 1868 |
| 1871 } // namespace dart | 1869 } // namespace dart |
| 1872 | 1870 |
| 1873 #endif // defined TARGET_ARCH_IA32 | 1871 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |