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

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

Issue 2226893002: Optimize AOT's switchable calls for the monomorphic case. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 4 years, 4 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/code_patcher_dbc.cc ('k') | runtime/vm/code_patcher_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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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" // Needed here to get TARGET_ARCH_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
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/code_patcher.h" 9 #include "vm/code_patcher.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 ASSERT(code.ContainsInstructionAt(return_address)); 163 ASSERT(code.ContainsInstructionAt(return_address));
164 StaticCall call(return_address); 164 StaticCall call(return_address);
165 return call.target(); 165 return call.target();
166 } 166 }
167 167
168 168
169 void CodePatcher::PatchStaticCallAt(uword return_address, 169 void CodePatcher::PatchStaticCallAt(uword return_address,
170 const Code& code, 170 const Code& code,
171 const Code& new_target) { 171 const Code& new_target) {
172 const Instructions& instrs = Instructions::Handle(code.instructions()); 172 const Instructions& instrs = Instructions::Handle(code.instructions());
173 WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size()); 173 WritableInstructionsScope writable(instrs.PayloadStart(), instrs.size());
174 ASSERT(code.ContainsInstructionAt(return_address)); 174 ASSERT(code.ContainsInstructionAt(return_address));
175 StaticCall call(return_address); 175 StaticCall call(return_address);
176 call.set_target(new_target); 176 call.set_target(new_target);
177 } 177 }
178 178
179 179
180 void CodePatcher::InsertDeoptimizationCallAt(uword start, uword target) { 180 void CodePatcher::InsertDeoptimizationCallAt(uword start, uword target) {
181 // The inserted call should not overlap the lazy deopt jump code. 181 // The inserted call should not overlap the lazy deopt jump code.
182 ASSERT(start + CallPattern::pattern_length_in_bytes() <= target); 182 ASSERT(start + CallPattern::pattern_length_in_bytes() <= target);
183 *reinterpret_cast<uint8_t*>(start) = 0xE8; 183 *reinterpret_cast<uint8_t*>(start) = 0xE8;
(...skipping 21 matching lines...) Expand all
205 ICData& ic_data = ICData::Handle(); 205 ICData& ic_data = ICData::Handle();
206 ic_data ^= static_call.ic_data(); 206 ic_data ^= static_call.ic_data();
207 if (ic_data_result != NULL) { 207 if (ic_data_result != NULL) {
208 *ic_data_result = ic_data.raw(); 208 *ic_data_result = ic_data.raw();
209 } 209 }
210 return ic_data.GetTargetAt(0); 210 return ic_data.GetTargetAt(0);
211 } 211 }
212 212
213 213
214 void CodePatcher::PatchSwitchableCallAt(uword return_address, 214 void CodePatcher::PatchSwitchableCallAt(uword return_address,
215 const Code& code, 215 const Code& caller_code,
216 const ICData& ic_data, 216 const Object& data,
217 const MegamorphicCache& cache, 217 const Code& target) {
218 const Code& lookup_stub) {
219 // Switchable instance calls only generated for precompilation. 218 // Switchable instance calls only generated for precompilation.
220 UNREACHABLE(); 219 UNREACHABLE();
221 } 220 }
222 221
223 222
223 RawCode* CodePatcher::GetSwitchableCallTargetAt(uword return_address,
224 const Code& caller_code) {
225 // Switchable instance calls only generated for precompilation.
226 UNREACHABLE();
227 return Code::null();
228 }
229
230
231 RawObject* CodePatcher::GetSwitchableCallDataAt(uword return_address,
232 const Code& caller_code) {
233 // Switchable instance calls only generated for precompilation.
234 UNREACHABLE();
235 return Object::null();
236 }
237
238
224 void CodePatcher::PatchNativeCallAt(uword return_address, 239 void CodePatcher::PatchNativeCallAt(uword return_address,
225 const Code& code, 240 const Code& code,
226 NativeFunction target, 241 NativeFunction target,
227 const Code& trampoline) { 242 const Code& trampoline) {
228 UNREACHABLE(); 243 UNREACHABLE();
229 } 244 }
230 245
231 246
232 RawCode* CodePatcher::GetNativeCallAt(uword return_address, 247 RawCode* CodePatcher::GetNativeCallAt(uword return_address,
233 const Code& code, 248 const Code& code,
234 NativeFunction* target) { 249 NativeFunction* target) {
235 UNREACHABLE(); 250 UNREACHABLE();
236 return NULL; 251 return NULL;
237 } 252 }
238 253
239 254
240 255
241 intptr_t CodePatcher::InstanceCallSizeInBytes() { 256 intptr_t CodePatcher::InstanceCallSizeInBytes() {
242 return InstanceCall::kPatternSize; 257 return InstanceCall::kPatternSize;
243 } 258 }
244 259
245 } // namespace dart 260 } // namespace dart
246 261
247 #endif // defined TARGET_ARCH_IA32 262 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/code_patcher_dbc.cc ('k') | runtime/vm/code_patcher_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698