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

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

Issue 1248113003: VM: Fix more places with isolate embedded into unoptimized code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: minor cleanup in stub_code* Created 5 years, 5 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
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 // The intrinsic code below is executed before a method has built its frame. 5 // The intrinsic code below is executed before a method has built its frame.
6 // The return address is on the stack and the arguments below it. 6 // The return address is on the stack and the arguments below it.
7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved. 7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved.
8 // Each intrinsification method returns true if the corresponding 8 // Each intrinsification method returns true if the corresponding
9 // Dart method was intrinsified. 9 // Dart method was intrinsified.
10 10
(...skipping 2098 matching lines...) Expand 10 before | Expand all | Expand 10 after
2109 2109
2110 // Tail-call the function. 2110 // Tail-call the function.
2111 __ movl(EDI, FieldAddress(EAX, Function::instructions_offset())); 2111 __ movl(EDI, FieldAddress(EAX, Function::instructions_offset()));
2112 __ addl(EDI, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); 2112 __ addl(EDI, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
2113 __ jmp(EDI); 2113 __ jmp(EDI);
2114 } 2114 }
2115 2115
2116 2116
2117 // On stack: user tag (+1), return-address (+0). 2117 // On stack: user tag (+1), return-address (+0).
2118 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { 2118 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) {
2119 Isolate* isolate = Isolate::Current(); 2119 // RDI: Isolate.
2120 const Address current_tag_addr = 2120 __ LoadIsolate(EDI);
2121 Address::Absolute(reinterpret_cast<uword>(isolate) +
2122 Isolate::current_tag_offset());
2123 const Address user_tag_addr =
2124 Address::Absolute(reinterpret_cast<uword>(isolate) +
2125 Isolate::user_tag_offset());
2126 // EAX: Current user tag. 2121 // EAX: Current user tag.
2127 __ movl(EAX, current_tag_addr); 2122 __ movl(EAX, Address(EDI, Isolate::current_tag_offset()));
2128 // EAX: UserTag. 2123 // EAX: UserTag.
2129 __ movl(EBX, Address(ESP, + 1 * kWordSize)); 2124 __ movl(EBX, Address(ESP, + 1 * kWordSize));
2130 // Set Isolate::current_tag_. 2125 // Set Isolate::current_tag_.
2131 __ movl(current_tag_addr, EBX); 2126 __ movl(Address(EDI, Isolate::current_tag_offset()), EBX);
2132 // EAX: UserTag's tag. 2127 // EAX: UserTag's tag.
2133 __ movl(EBX, FieldAddress(EBX, UserTag::tag_offset())); 2128 __ movl(EBX, FieldAddress(EBX, UserTag::tag_offset()));
2134 // Set Isolate::user_tag_. 2129 // Set Isolate::user_tag_.
2135 __ movl(user_tag_addr, EBX); 2130 __ movl(Address(EDI, Isolate::user_tag_offset()), EBX);
2136 __ ret(); 2131 __ ret();
2137 } 2132 }
2138 2133
2139 2134
2140 void Intrinsifier::UserTag_defaultTag(Assembler* assembler) { 2135 void Intrinsifier::UserTag_defaultTag(Assembler* assembler) {
2141 Isolate* isolate = Isolate::Current(); 2136 __ LoadIsolate(EAX);
2142 const Address default_tag_addr = 2137 __ movl(EAX, Address(EAX, Isolate::default_tag_offset()));
2143 Address::Absolute(
2144 reinterpret_cast<uword>(isolate) + Isolate::default_tag_offset());
2145 // Set return value.
2146 __ movl(EAX, default_tag_addr);
2147 __ ret(); 2138 __ ret();
2148 } 2139 }
2149 2140
2150 2141
2151 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { 2142 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) {
2152 Isolate* isolate = Isolate::Current(); 2143 __ LoadIsolate(EAX);
2153 const Address current_tag_addr = 2144 __ movl(EAX, Address(EAX, Isolate::current_tag_offset()));
2154 Address::Absolute(reinterpret_cast<uword>(isolate) +
2155 Isolate::current_tag_offset());
2156 // Set return value to Isolate::current_tag_.
2157 __ movl(EAX, current_tag_addr);
2158 __ ret(); 2145 __ ret();
2159 } 2146 }
2160 2147
2161 #undef __ 2148 #undef __
2162 } // namespace dart 2149 } // namespace dart
2163 2150
2164 #endif // defined TARGET_ARCH_IA32 2151 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698