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

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

Issue 1358773002: Load the native call wrapper via Thread. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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
« 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // Pass NativeArguments structure by value and call native function. 172 // Pass NativeArguments structure by value and call native function.
173 __ movl(Address(ESP, thread_offset), THR); // Set thread in NativeArgs. 173 __ movl(Address(ESP, thread_offset), THR); // Set thread in NativeArgs.
174 __ movl(Address(ESP, argc_tag_offset), EDX); // Set argc in NativeArguments. 174 __ movl(Address(ESP, argc_tag_offset), EDX); // Set argc in NativeArguments.
175 __ movl(Address(ESP, argv_offset), EAX); // Set argv in NativeArguments. 175 __ movl(Address(ESP, argv_offset), EAX); // Set argv in NativeArguments.
176 __ leal(EAX, Address(EBP, 2 * kWordSize)); // Compute return value addr. 176 __ leal(EAX, Address(EBP, 2 * kWordSize)); // Compute return value addr.
177 __ movl(Address(ESP, retval_offset), EAX); // Set retval in NativeArguments. 177 __ movl(Address(ESP, retval_offset), EAX); // Set retval in NativeArguments.
178 __ leal(EAX, Address(ESP, 2 * kWordSize)); // Pointer to the NativeArguments. 178 __ leal(EAX, Address(ESP, 2 * kWordSize)); // Pointer to the NativeArguments.
179 __ movl(Address(ESP, 0), EAX); // Pass the pointer to the NativeArguments. 179 __ movl(Address(ESP, 0), EAX); // Pass the pointer to the NativeArguments.
180 180
181 __ movl(Address(ESP, kWordSize), ECX); // Function to call. 181 __ movl(Address(ESP, kWordSize), ECX); // Function to call.
182 __ call(&NativeEntry::NativeCallWrapperLabel()); 182 ExternalLabel label(NativeEntry::NativeCallWrapperEntry());
183 __ call(&label);
183 184
184 // Mark that the isolate is executing Dart code. EDI is callee saved. 185 // Mark that the isolate is executing Dart code. EDI is callee saved.
185 __ movl(Address(EDI, Isolate::vm_tag_offset()), 186 __ movl(Address(EDI, Isolate::vm_tag_offset()),
186 Immediate(VMTag::kDartTagId)); 187 Immediate(VMTag::kDartTagId));
187 188
188 // Reset exit frame information in Isolate structure. 189 // Reset exit frame information in Isolate structure.
189 __ movl(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0)); 190 __ movl(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
190 191
191 __ LeaveFrame(); 192 __ LeaveFrame();
192 __ ret(); 193 __ ret();
(...skipping 1896 matching lines...) Expand 10 before | Expand all | Expand 10 after
2089 // EBX: entry point. 2090 // EBX: entry point.
2090 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { 2091 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) {
2091 EmitMegamorphicLookup(assembler, ECX, EBX, EBX); 2092 EmitMegamorphicLookup(assembler, ECX, EBX, EBX);
2092 __ ret(); 2093 __ ret();
2093 } 2094 }
2094 2095
2095 2096
2096 } // namespace dart 2097 } // namespace dart
2097 2098
2098 #endif // defined TARGET_ARCH_IA32 2099 #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