| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 __ movl(Address(EAX, Isolate::top_exit_frame_info_offset()), ESP); | 52 __ movl(Address(EAX, Isolate::top_exit_frame_info_offset()), ESP); |
| 53 | 53 |
| 54 // Save current Context pointer into Isolate structure. | 54 // Save current Context pointer into Isolate structure. |
| 55 __ movl(Address(EAX, Isolate::top_context_offset()), CTX); | 55 __ movl(Address(EAX, Isolate::top_context_offset()), CTX); |
| 56 | 56 |
| 57 // Cache Isolate pointer into CTX while executing runtime code. | 57 // Cache Isolate pointer into CTX while executing runtime code. |
| 58 __ movl(CTX, EAX); | 58 __ movl(CTX, EAX); |
| 59 | 59 |
| 60 // Reserve space for arguments and align frame before entering C++ world. | 60 // Reserve space for arguments and align frame before entering C++ world. |
| 61 __ AddImmediate(ESP, Immediate(-sizeof(NativeArguments))); | 61 __ AddImmediate(ESP, Immediate(-sizeof(NativeArguments))); |
| 62 if (OS::ActivationFrameAlignment() > 0) { | 62 if (OS::ActivationFrameAlignment() > 1) { |
| 63 __ andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1))); | 63 __ andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1))); |
| 64 } | 64 } |
| 65 | 65 |
| 66 // Pass NativeArguments structure by value and call runtime. | 66 // Pass NativeArguments structure by value and call runtime. |
| 67 __ movl(Address(ESP, isolate_offset), CTX); // Set isolate in NativeArgs. | 67 __ movl(Address(ESP, isolate_offset), CTX); // Set isolate in NativeArgs. |
| 68 // There are no runtime calls to closures, so we do not need to set the tag | 68 // There are no runtime calls to closures, so we do not need to set the tag |
| 69 // bits kClosureFunctionBit and kInstanceFunctionBit in argc_tag_. | 69 // bits kClosureFunctionBit and kInstanceFunctionBit in argc_tag_. |
| 70 __ movl(Address(ESP, argc_tag_offset), EDX); // Set argc in NativeArguments. | 70 __ movl(Address(ESP, argc_tag_offset), EDX); // Set argc in NativeArguments. |
| 71 __ leal(EAX, Address(EBP, EDX, TIMES_4, 1 * kWordSize)); // Compute argv. | 71 __ leal(EAX, Address(EBP, EDX, TIMES_4, 1 * kWordSize)); // Compute argv. |
| 72 __ movl(Address(ESP, argv_offset), EAX); // Set argv in NativeArguments. | 72 __ movl(Address(ESP, argv_offset), EAX); // Set argv in NativeArguments. |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // Save current Context pointer into Isolate structure. | 144 // Save current Context pointer into Isolate structure. |
| 145 __ movl(Address(EDI, Isolate::top_context_offset()), CTX); | 145 __ movl(Address(EDI, Isolate::top_context_offset()), CTX); |
| 146 | 146 |
| 147 // Cache Isolate pointer into CTX while executing native code. | 147 // Cache Isolate pointer into CTX while executing native code. |
| 148 __ movl(CTX, EDI); | 148 __ movl(CTX, EDI); |
| 149 | 149 |
| 150 // Reserve space for the native arguments structure, the outgoing parameters | 150 // Reserve space for the native arguments structure, the outgoing parameters |
| 151 // (pointer to the native arguments structure, the C function entry point) | 151 // (pointer to the native arguments structure, the C function entry point) |
| 152 // and align frame before entering the C++ world. | 152 // and align frame before entering the C++ world. |
| 153 __ AddImmediate(ESP, Immediate(-sizeof(NativeArguments) - (2 * kWordSize))); | 153 __ AddImmediate(ESP, Immediate(-sizeof(NativeArguments) - (2 * kWordSize))); |
| 154 if (OS::ActivationFrameAlignment() > 0) { | 154 if (OS::ActivationFrameAlignment() > 1) { |
| 155 __ andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1))); | 155 __ andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1))); |
| 156 } | 156 } |
| 157 | 157 |
| 158 // Pass NativeArguments structure by value and call native function. | 158 // Pass NativeArguments structure by value and call native function. |
| 159 __ movl(Address(ESP, isolate_offset), CTX); // Set isolate in NativeArgs. | 159 __ movl(Address(ESP, isolate_offset), CTX); // Set isolate in NativeArgs. |
| 160 __ movl(Address(ESP, argc_tag_offset), EDX); // Set argc in NativeArguments. | 160 __ movl(Address(ESP, argc_tag_offset), EDX); // Set argc in NativeArguments. |
| 161 __ movl(Address(ESP, argv_offset), EAX); // Set argv in NativeArguments. | 161 __ movl(Address(ESP, argv_offset), EAX); // Set argv in NativeArguments. |
| 162 __ leal(EAX, Address(EBP, 2 * kWordSize)); // Compute return value addr. | 162 __ leal(EAX, Address(EBP, 2 * kWordSize)); // Compute return value addr. |
| 163 __ movl(Address(ESP, retval_offset), EAX); // Set retval in NativeArguments. | 163 __ movl(Address(ESP, retval_offset), EAX); // Set retval in NativeArguments. |
| 164 __ leal(EAX, Address(ESP, 2 * kWordSize)); // Pointer to the NativeArguments. | 164 __ leal(EAX, Address(ESP, 2 * kWordSize)); // Pointer to the NativeArguments. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 // Save current Context pointer into Isolate structure. | 215 // Save current Context pointer into Isolate structure. |
| 216 __ movl(Address(EDI, Isolate::top_context_offset()), CTX); | 216 __ movl(Address(EDI, Isolate::top_context_offset()), CTX); |
| 217 | 217 |
| 218 // Cache Isolate pointer into CTX while executing native code. | 218 // Cache Isolate pointer into CTX while executing native code. |
| 219 __ movl(CTX, EDI); | 219 __ movl(CTX, EDI); |
| 220 | 220 |
| 221 // Reserve space for the native arguments structure, the outgoing parameter | 221 // Reserve space for the native arguments structure, the outgoing parameter |
| 222 // (pointer to the native arguments structure) and align frame before | 222 // (pointer to the native arguments structure) and align frame before |
| 223 // entering the C++ world. | 223 // entering the C++ world. |
| 224 __ AddImmediate(ESP, Immediate(-sizeof(NativeArguments) - kWordSize)); | 224 __ AddImmediate(ESP, Immediate(-sizeof(NativeArguments) - kWordSize)); |
| 225 if (OS::ActivationFrameAlignment() > 0) { | 225 if (OS::ActivationFrameAlignment() > 1) { |
| 226 __ andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1))); | 226 __ andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1))); |
| 227 } | 227 } |
| 228 | 228 |
| 229 // Pass NativeArguments structure by value and call native function. | 229 // Pass NativeArguments structure by value and call native function. |
| 230 __ movl(Address(ESP, isolate_offset), CTX); // Set isolate in NativeArgs. | 230 __ movl(Address(ESP, isolate_offset), CTX); // Set isolate in NativeArgs. |
| 231 __ movl(Address(ESP, argc_tag_offset), EDX); // Set argc in NativeArguments. | 231 __ movl(Address(ESP, argc_tag_offset), EDX); // Set argc in NativeArguments. |
| 232 __ movl(Address(ESP, argv_offset), EAX); // Set argv in NativeArguments. | 232 __ movl(Address(ESP, argv_offset), EAX); // Set argv in NativeArguments. |
| 233 __ leal(EAX, Address(EBP, 2 * kWordSize)); // Compute return value addr. | 233 __ leal(EAX, Address(EBP, 2 * kWordSize)); // Compute return value addr. |
| 234 __ movl(Address(ESP, retval_offset), EAX); // Set retval in NativeArguments. | 234 __ movl(Address(ESP, retval_offset), EAX); // Set retval in NativeArguments. |
| 235 __ leal(EAX, Address(ESP, kWordSize)); // Pointer to the NativeArguments. | 235 __ leal(EAX, Address(ESP, kWordSize)); // Pointer to the NativeArguments. |
| (...skipping 2036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2272 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 2272 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
| 2273 __ popl(temp); | 2273 __ popl(temp); |
| 2274 __ popl(right); | 2274 __ popl(right); |
| 2275 __ popl(left); | 2275 __ popl(left); |
| 2276 __ ret(); | 2276 __ ret(); |
| 2277 } | 2277 } |
| 2278 | 2278 |
| 2279 } // namespace dart | 2279 } // namespace dart |
| 2280 | 2280 |
| 2281 #endif // defined TARGET_ARCH_IA32 | 2281 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |