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

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

Issue 1139163004: Store FP instead of SP in the exit info when transitioning from Dart to C++. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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_ia32.cc ('k') | runtime/vm/stub_code_x64.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_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 __ sw(ZR, Address(SP, 2 * kWordSize)); // Push 0 for the PC marker 48 __ sw(ZR, Address(SP, 2 * kWordSize)); // Push 0 for the PC marker
49 __ sw(RA, Address(SP, 1 * kWordSize)); 49 __ sw(RA, Address(SP, 1 * kWordSize));
50 __ sw(FP, Address(SP, 0 * kWordSize)); 50 __ sw(FP, Address(SP, 0 * kWordSize));
51 __ mov(FP, SP); 51 __ mov(FP, SP);
52 52
53 COMPILE_ASSERT((kAbiPreservedCpuRegs & (1 << S6)) != 0); 53 COMPILE_ASSERT((kAbiPreservedCpuRegs & (1 << S6)) != 0);
54 __ LoadIsolate(S6); 54 __ LoadIsolate(S6);
55 55
56 // Save exit frame information to enable stack walking as we are about 56 // Save exit frame information to enable stack walking as we are about
57 // to transition to Dart VM C++ code. 57 // to transition to Dart VM C++ code.
58 __ sw(SP, Address(S6, Isolate::top_exit_frame_info_offset())); 58 __ sw(FP, Address(S6, Isolate::top_exit_frame_info_offset()));
59 59
60 #if defined(DEBUG) 60 #if defined(DEBUG)
61 { Label ok; 61 { Label ok;
62 // Check that we are always entering from Dart code. 62 // Check that we are always entering from Dart code.
63 __ lw(T0, Address(S6, Isolate::vm_tag_offset())); 63 __ lw(T0, Address(S6, Isolate::vm_tag_offset()));
64 __ BranchEqual(T0, Immediate(VMTag::kDartTagId), &ok); 64 __ BranchEqual(T0, Immediate(VMTag::kDartTagId), &ok);
65 __ Stop("Not coming from Dart code."); 65 __ Stop("Not coming from Dart code.");
66 __ Bind(&ok); 66 __ Bind(&ok);
67 } 67 }
68 #endif 68 #endif
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 __ sw(ZR, Address(SP, 2 * kWordSize)); // Push 0 for the PC marker 157 __ sw(ZR, Address(SP, 2 * kWordSize)); // Push 0 for the PC marker
158 __ sw(RA, Address(SP, 1 * kWordSize)); 158 __ sw(RA, Address(SP, 1 * kWordSize));
159 __ sw(FP, Address(SP, 0 * kWordSize)); 159 __ sw(FP, Address(SP, 0 * kWordSize));
160 __ mov(FP, SP); 160 __ mov(FP, SP);
161 161
162 COMPILE_ASSERT((kAbiPreservedCpuRegs & (1 << S6)) != 0); 162 COMPILE_ASSERT((kAbiPreservedCpuRegs & (1 << S6)) != 0);
163 __ LoadIsolate(S6); 163 __ LoadIsolate(S6);
164 164
165 // Save exit frame information to enable stack walking as we are about 165 // Save exit frame information to enable stack walking as we are about
166 // to transition to native code. 166 // to transition to native code.
167 __ sw(SP, Address(S6, Isolate::top_exit_frame_info_offset())); 167 __ sw(FP, Address(S6, Isolate::top_exit_frame_info_offset()));
168 168
169 #if defined(DEBUG) 169 #if defined(DEBUG)
170 { Label ok; 170 { Label ok;
171 // Check that we are always entering from Dart code. 171 // Check that we are always entering from Dart code.
172 __ lw(T0, Address(S6, Isolate::vm_tag_offset())); 172 __ lw(T0, Address(S6, Isolate::vm_tag_offset()));
173 __ BranchEqual(T0, Immediate(VMTag::kDartTagId), &ok); 173 __ BranchEqual(T0, Immediate(VMTag::kDartTagId), &ok);
174 __ Stop("Not coming from Dart code."); 174 __ Stop("Not coming from Dart code.");
175 __ Bind(&ok); 175 __ Bind(&ok);
176 } 176 }
177 #endif 177 #endif
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 __ sw(ZR, Address(SP, 2 * kWordSize)); // Push 0 for the PC marker 255 __ sw(ZR, Address(SP, 2 * kWordSize)); // Push 0 for the PC marker
256 __ sw(RA, Address(SP, 1 * kWordSize)); 256 __ sw(RA, Address(SP, 1 * kWordSize));
257 __ sw(FP, Address(SP, 0 * kWordSize)); 257 __ sw(FP, Address(SP, 0 * kWordSize));
258 __ mov(FP, SP); 258 __ mov(FP, SP);
259 259
260 COMPILE_ASSERT((kAbiPreservedCpuRegs & (1 << S6)) != 0); 260 COMPILE_ASSERT((kAbiPreservedCpuRegs & (1 << S6)) != 0);
261 __ LoadIsolate(S6); 261 __ LoadIsolate(S6);
262 262
263 // Save exit frame information to enable stack walking as we are about 263 // Save exit frame information to enable stack walking as we are about
264 // to transition to native code. 264 // to transition to native code.
265 __ sw(SP, Address(S6, Isolate::top_exit_frame_info_offset())); 265 __ sw(FP, Address(S6, Isolate::top_exit_frame_info_offset()));
266 266
267 #if defined(DEBUG) 267 #if defined(DEBUG)
268 { Label ok; 268 { Label ok;
269 // Check that we are always entering from Dart code. 269 // Check that we are always entering from Dart code.
270 __ lw(T0, Address(S6, Isolate::vm_tag_offset())); 270 __ lw(T0, Address(S6, Isolate::vm_tag_offset()));
271 __ BranchEqual(T0, Immediate(VMTag::kDartTagId), &ok); 271 __ BranchEqual(T0, Immediate(VMTag::kDartTagId), &ok);
272 __ Stop("Not coming from Dart code."); 272 __ Stop("Not coming from Dart code.");
273 __ Bind(&ok); 273 __ Bind(&ok);
274 } 274 }
275 #endif 275 #endif
(...skipping 2052 matching lines...) Expand 10 before | Expand all | Expand 10 after
2328 // Result: 2328 // Result:
2329 // T1: entry point. 2329 // T1: entry point.
2330 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { 2330 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) {
2331 EmitMegamorphicLookup(assembler, T0, T1, T1); 2331 EmitMegamorphicLookup(assembler, T0, T1, T1);
2332 __ Ret(); 2332 __ Ret();
2333 } 2333 }
2334 2334
2335 } // namespace dart 2335 } // namespace dart
2336 2336
2337 #endif // defined TARGET_ARCH_MIPS 2337 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698