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

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

Issue 335443002: Setup R10/EDX to be valid Oops before stub 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
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 19 matching lines...) Expand all
30 DEFINE_FLAG(bool, verify_incoming_contexts, false, ""); 30 DEFINE_FLAG(bool, verify_incoming_contexts, false, "");
31 31
32 DECLARE_FLAG(bool, enable_debugger); 32 DECLARE_FLAG(bool, enable_debugger);
33 33
34 // Input parameters: 34 // Input parameters:
35 // ESP : points to return address. 35 // ESP : points to return address.
36 // ESP + 4 : address of last argument in argument array. 36 // ESP + 4 : address of last argument in argument array.
37 // ESP + 4*EDX : address of first argument in argument array. 37 // ESP + 4*EDX : address of first argument in argument array.
38 // ESP + 4*EDX + 4 : address of return value. 38 // ESP + 4*EDX + 4 : address of return value.
39 // ECX : address of the runtime function to call. 39 // ECX : address of the runtime function to call.
40 // EDX : number of arguments to the call. 40 // EDX : number of arguments to the call as Smi.
41 // Must preserve callee saved registers EDI and EBX. 41 // Must preserve callee saved registers EDI and EBX.
42 void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) { 42 void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
43 const intptr_t isolate_offset = NativeArguments::isolate_offset(); 43 const intptr_t isolate_offset = NativeArguments::isolate_offset();
44 const intptr_t argc_tag_offset = NativeArguments::argc_tag_offset(); 44 const intptr_t argc_tag_offset = NativeArguments::argc_tag_offset();
45 const intptr_t argv_offset = NativeArguments::argv_offset(); 45 const intptr_t argv_offset = NativeArguments::argv_offset();
46 const intptr_t retval_offset = NativeArguments::retval_offset(); 46 const intptr_t retval_offset = NativeArguments::retval_offset();
47 47
48 __ EnterFrame(0); 48 __ EnterFrame(0);
49 __ SmiUntag(EDX);
49 50
50 // Load current Isolate pointer from Context structure into EAX. 51 // Load current Isolate pointer from Context structure into EAX.
51 __ movl(EAX, FieldAddress(CTX, Context::isolate_offset())); 52 __ movl(EAX, FieldAddress(CTX, Context::isolate_offset()));
52 53
53 // Save exit frame information to enable stack walking as we are about 54 // Save exit frame information to enable stack walking as we are about
54 // to transition to Dart VM C++ code. 55 // to transition to Dart VM C++ code.
55 __ movl(Address(EAX, Isolate::top_exit_frame_info_offset()), ESP); 56 __ movl(Address(EAX, Isolate::top_exit_frame_info_offset()), ESP);
56 57
57 #if defined(DEBUG) 58 #if defined(DEBUG)
58 if (FLAG_verify_incoming_contexts) { 59 if (FLAG_verify_incoming_contexts) {
(...skipping 1833 matching lines...) Expand 10 before | Expand all | Expand 10 after
1892 const Register temp = ECX; 1893 const Register temp = ECX;
1893 __ movl(left, Address(ESP, 2 * kWordSize)); 1894 __ movl(left, Address(ESP, 2 * kWordSize));
1894 __ movl(right, Address(ESP, 1 * kWordSize)); 1895 __ movl(right, Address(ESP, 1 * kWordSize));
1895 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 1896 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
1896 __ ret(); 1897 __ ret();
1897 } 1898 }
1898 1899
1899 } // namespace dart 1900 } // namespace dart
1900 1901
1901 #endif // defined TARGET_ARCH_IA32 1902 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698