Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: runtime/vm/stub_code_ia32.cc

Issue 315223003: Use CallBootstrapC stub for leaf native calls. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/stub_code_arm64.cc ('k') | runtime/vm/stub_code_mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 // Pass NativeArguments structure by value and call native function. 220 // Pass NativeArguments structure by value and call native function.
221 __ movl(Address(ESP, isolate_offset), CTX); // Set isolate in NativeArgs. 221 __ movl(Address(ESP, isolate_offset), CTX); // Set isolate in NativeArgs.
222 __ movl(Address(ESP, argc_tag_offset), EDX); // Set argc in NativeArguments. 222 __ movl(Address(ESP, argc_tag_offset), EDX); // Set argc in NativeArguments.
223 __ movl(Address(ESP, argv_offset), EAX); // Set argv in NativeArguments. 223 __ movl(Address(ESP, argv_offset), EAX); // Set argv in NativeArguments.
224 __ leal(EAX, Address(EBP, 2 * kWordSize)); // Compute return value addr. 224 __ leal(EAX, Address(EBP, 2 * kWordSize)); // Compute return value addr.
225 __ movl(Address(ESP, retval_offset), EAX); // Set retval in NativeArguments. 225 __ movl(Address(ESP, retval_offset), EAX); // Set retval in NativeArguments.
226 __ leal(EAX, Address(ESP, 2 * kWordSize)); // Pointer to the NativeArguments. 226 __ leal(EAX, Address(ESP, 2 * kWordSize)); // Pointer to the NativeArguments.
227 __ movl(Address(ESP, 0), EAX); // Pass the pointer to the NativeArguments. 227 __ movl(Address(ESP, 0), EAX); // Pass the pointer to the NativeArguments.
228 228
229 // Call native function (setsup scope if not leaf function).
230 Label leaf_call;
231 Label done;
232 __ testl(EDX, Immediate(NativeArguments::AutoSetupScopeMask()));
233 __ j(ZERO, &leaf_call, Assembler::kNearJump);
234 __ movl(Address(ESP, kWordSize), ECX); // Function to call. 229 __ movl(Address(ESP, kWordSize), ECX); // Function to call.
235 __ call(&NativeEntry::NativeCallWrapperLabel()); 230 __ call(&NativeEntry::NativeCallWrapperLabel());
236 __ jmp(&done);
237 __ Bind(&leaf_call);
238 __ call(ECX);
239 __ Bind(&done);
240 231
241 // Mark that the isolate is executing Dart code. 232 // Mark that the isolate is executing Dart code.
242 __ movl(Address(CTX, Isolate::vm_tag_offset()), 233 __ movl(Address(CTX, Isolate::vm_tag_offset()),
243 Immediate(VMTag::kScriptTagId)); 234 Immediate(VMTag::kScriptTagId));
244 235
245 // Reset exit frame information in Isolate structure. 236 // Reset exit frame information in Isolate structure.
246 __ movl(Address(CTX, Isolate::top_exit_frame_info_offset()), Immediate(0)); 237 __ movl(Address(CTX, Isolate::top_exit_frame_info_offset()), Immediate(0));
247 238
248 // Load Context pointer from Isolate structure into EDI. 239 // Load Context pointer from Isolate structure into EDI.
249 __ movl(EDI, Address(CTX, Isolate::top_context_offset())); 240 __ movl(EDI, Address(CTX, Isolate::top_context_offset()));
(...skipping 1651 matching lines...) Expand 10 before | Expand all | Expand 10 after
1901 const Register temp = ECX; 1892 const Register temp = ECX;
1902 __ movl(left, Address(ESP, 2 * kWordSize)); 1893 __ movl(left, Address(ESP, 2 * kWordSize));
1903 __ movl(right, Address(ESP, 1 * kWordSize)); 1894 __ movl(right, Address(ESP, 1 * kWordSize));
1904 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 1895 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
1905 __ ret(); 1896 __ ret();
1906 } 1897 }
1907 1898
1908 } // namespace dart 1899 } // namespace dart
1909 1900
1910 #endif // defined TARGET_ARCH_IA32 1901 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_arm64.cc ('k') | runtime/vm/stub_code_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698