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

Side by Side Diff: runtime/vm/stub_code_arm64.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_arm.cc ('k') | runtime/vm/stub_code_ia32.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 __ StoreToOffset(R3, SP, retval_offset); 207 __ StoreToOffset(R3, SP, retval_offset);
208 __ mov(R0, SP); // Pass the pointer to the NativeArguments. 208 __ mov(R0, SP); // Pass the pointer to the NativeArguments.
209 209
210 // We are entering runtime code, so the C stack pointer must be restored from 210 // We are entering runtime code, so the C stack pointer must be restored from
211 // the stack limit to the top of the stack. We cache the stack limit address 211 // the stack limit to the top of the stack. We cache the stack limit address
212 // in the Dart SP register, which is callee-saved in the C ABI. 212 // in the Dart SP register, which is callee-saved in the C ABI.
213 __ mov(R26, CSP); 213 __ mov(R26, CSP);
214 __ mov(CSP, SP); 214 __ mov(CSP, SP);
215 215
216 __ mov(R1, R5); // Pass the function entrypoint to call. 216 __ mov(R1, R5); // Pass the function entrypoint to call.
217
217 // Call native function invocation wrapper or redirection via simulator. 218 // Call native function invocation wrapper or redirection via simulator.
218 #if defined(USING_SIMULATOR) 219 __ ldr(LR, Address(THR, Thread::native_call_wrapper_entry_point_offset()));
219 uword entry = reinterpret_cast<uword>(NativeEntry::NativeCallWrapper); 220 __ blr(LR);
220 entry = Simulator::RedirectExternalReference(
221 entry, Simulator::kNativeCall, NativeEntry::kNumCallWrapperArguments);
222 __ LoadImmediate(R2, entry);
223 __ blr(R2);
224 #else
225 __ BranchLink(&NativeEntry::NativeCallWrapperLabel());
226 #endif
227 221
228 // Restore SP and CSP. 222 // Restore SP and CSP.
229 __ mov(SP, CSP); 223 __ mov(SP, CSP);
230 __ mov(CSP, R26); 224 __ mov(CSP, R26);
231 225
232 // Mark that the isolate is executing Dart code. 226 // Mark that the isolate is executing Dart code.
233 __ LoadImmediate(R2, VMTag::kDartTagId); 227 __ LoadImmediate(R2, VMTag::kDartTagId);
234 __ StoreToOffset(R2, R28, Isolate::vm_tag_offset()); 228 __ StoreToOffset(R2, R28, Isolate::vm_tag_offset());
235 229
236 // Reset exit frame information in Isolate structure. 230 // Reset exit frame information in Isolate structure.
(...skipping 1928 matching lines...) Expand 10 before | Expand all | Expand 10 after
2165 // Result: 2159 // Result:
2166 // R1: entry point. 2160 // R1: entry point.
2167 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { 2161 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) {
2168 EmitMegamorphicLookup(assembler, R0, R1, R1); 2162 EmitMegamorphicLookup(assembler, R0, R1, R1);
2169 __ ret(); 2163 __ ret();
2170 } 2164 }
2171 2165
2172 } // namespace dart 2166 } // namespace dart
2173 2167
2174 #endif // defined TARGET_ARCH_ARM64 2168 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698