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

Side by Side Diff: runtime/vm/stub_code_ia32.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_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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 const intptr_t argc_tag_offset = NativeArguments::argc_tag_offset(); 45 const intptr_t argc_tag_offset = NativeArguments::argc_tag_offset();
46 const intptr_t argv_offset = NativeArguments::argv_offset(); 46 const intptr_t argv_offset = NativeArguments::argv_offset();
47 const intptr_t retval_offset = NativeArguments::retval_offset(); 47 const intptr_t retval_offset = NativeArguments::retval_offset();
48 48
49 __ EnterFrame(0); 49 __ EnterFrame(0);
50 50
51 __ LoadIsolate(ESI); 51 __ LoadIsolate(ESI);
52 52
53 // Save exit frame information to enable stack walking as we are about 53 // Save exit frame information to enable stack walking as we are about
54 // to transition to Dart VM C++ code. 54 // to transition to Dart VM C++ code.
55 __ movl(Address(ESI, Isolate::top_exit_frame_info_offset()), ESP); 55 __ movl(Address(ESI, Isolate::top_exit_frame_info_offset()), EBP);
56 56
57 #if defined(DEBUG) 57 #if defined(DEBUG)
58 { Label ok; 58 { Label ok;
59 // Check that we are always entering from Dart code. 59 // Check that we are always entering from Dart code.
60 __ cmpl(Address(ESI, Isolate::vm_tag_offset()), 60 __ cmpl(Address(ESI, Isolate::vm_tag_offset()),
61 Immediate(VMTag::kDartTagId)); 61 Immediate(VMTag::kDartTagId));
62 __ j(EQUAL, &ok, Assembler::kNearJump); 62 __ j(EQUAL, &ok, Assembler::kNearJump);
63 __ Stop("Not coming from Dart code."); 63 __ Stop("Not coming from Dart code.");
64 __ Bind(&ok); 64 __ Bind(&ok);
65 } 65 }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 NativeArguments::argv_offset() + native_args_struct_offset; 135 NativeArguments::argv_offset() + native_args_struct_offset;
136 const intptr_t retval_offset = 136 const intptr_t retval_offset =
137 NativeArguments::retval_offset() + native_args_struct_offset; 137 NativeArguments::retval_offset() + native_args_struct_offset;
138 138
139 __ EnterFrame(0); 139 __ EnterFrame(0);
140 140
141 __ LoadIsolate(ESI); 141 __ LoadIsolate(ESI);
142 142
143 // Save exit frame information to enable stack walking as we are about 143 // Save exit frame information to enable stack walking as we are about
144 // to transition to dart VM code. 144 // to transition to dart VM code.
145 __ movl(Address(ESI, Isolate::top_exit_frame_info_offset()), ESP); 145 __ movl(Address(ESI, Isolate::top_exit_frame_info_offset()), EBP);
146 146
147 #if defined(DEBUG) 147 #if defined(DEBUG)
148 { Label ok; 148 { Label ok;
149 // Check that we are always entering from Dart code. 149 // Check that we are always entering from Dart code.
150 __ cmpl(Address(ESI, Isolate::vm_tag_offset()), 150 __ cmpl(Address(ESI, Isolate::vm_tag_offset()),
151 Immediate(VMTag::kDartTagId)); 151 Immediate(VMTag::kDartTagId));
152 __ j(EQUAL, &ok, Assembler::kNearJump); 152 __ j(EQUAL, &ok, Assembler::kNearJump);
153 __ Stop("Not coming from Dart code."); 153 __ Stop("Not coming from Dart code.");
154 __ Bind(&ok); 154 __ Bind(&ok);
155 } 155 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 NativeArguments::argv_offset() + native_args_struct_offset; 208 NativeArguments::argv_offset() + native_args_struct_offset;
209 const intptr_t retval_offset = 209 const intptr_t retval_offset =
210 NativeArguments::retval_offset() + native_args_struct_offset; 210 NativeArguments::retval_offset() + native_args_struct_offset;
211 211
212 __ EnterFrame(0); 212 __ EnterFrame(0);
213 213
214 __ LoadIsolate(ESI); 214 __ LoadIsolate(ESI);
215 215
216 // Save exit frame information to enable stack walking as we are about 216 // Save exit frame information to enable stack walking as we are about
217 // to transition to dart VM code. 217 // to transition to dart VM code.
218 __ movl(Address(ESI, Isolate::top_exit_frame_info_offset()), ESP); 218 __ movl(Address(ESI, Isolate::top_exit_frame_info_offset()), EBP);
219 219
220 #if defined(DEBUG) 220 #if defined(DEBUG)
221 { Label ok; 221 { Label ok;
222 // Check that we are always entering from Dart code. 222 // Check that we are always entering from Dart code.
223 __ cmpl(Address(ESI, Isolate::vm_tag_offset()), 223 __ cmpl(Address(ESI, Isolate::vm_tag_offset()),
224 Immediate(VMTag::kDartTagId)); 224 Immediate(VMTag::kDartTagId));
225 __ j(EQUAL, &ok, Assembler::kNearJump); 225 __ j(EQUAL, &ok, Assembler::kNearJump);
226 __ Stop("Not coming from Dart code."); 226 __ Stop("Not coming from Dart code.");
227 __ Bind(&ok); 227 __ Bind(&ok);
228 } 228 }
(...skipping 1893 matching lines...) Expand 10 before | Expand all | Expand 10 after
2122 // EBX: entry point. 2122 // EBX: entry point.
2123 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { 2123 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) {
2124 EmitMegamorphicLookup(assembler, EDI, EBX, EBX); 2124 EmitMegamorphicLookup(assembler, EDI, EBX, EBX);
2125 __ ret(); 2125 __ ret();
2126 } 2126 }
2127 2127
2128 2128
2129 } // namespace dart 2129 } // namespace dart
2130 2130
2131 #endif // defined TARGET_ARCH_IA32 2131 #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