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

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

Issue 17723002: Remove skip_static_calls_ as it uses an obsolete way to check for uncalled static calls. Will be re… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | Annotate | Revision Log
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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 void CodePatcher::InsertCallAt(uword start, uword target) { 224 void CodePatcher::InsertCallAt(uword start, uword target) {
225 // The inserted call should not overlap the lazy deopt jump code. 225 // The inserted call should not overlap the lazy deopt jump code.
226 ASSERT(start + CallPattern::InstructionLength() <= target); 226 ASSERT(start + CallPattern::InstructionLength() <= target);
227 *reinterpret_cast<uint8_t*>(start) = 0xE8; 227 *reinterpret_cast<uint8_t*>(start) = 0xE8;
228 CallPattern call(start); 228 CallPattern call(start);
229 call.SetTargetAddress(target); 229 call.SetTargetAddress(target);
230 CPU::FlushICache(start, CallPattern::InstructionLength()); 230 CPU::FlushICache(start, CallPattern::InstructionLength());
231 } 231 }
232 232
233 233
234 uword CodePatcher::GetInstanceCallAt(uword return_address, 234 uword CodePatcher::GetInstanceCallAt(
235 const Code& code, 235 uword return_address, const Code& code, ICData* ic_data) {
236 ICData* ic_data) {
237 ASSERT(code.ContainsInstructionAt(return_address)); 236 ASSERT(code.ContainsInstructionAt(return_address));
238 InstanceCall call(return_address); 237 InstanceCall call(return_address);
239 if (ic_data != NULL) { 238 if (ic_data != NULL) {
240 *ic_data ^= call.ic_data(); 239 *ic_data ^= call.ic_data();
241 } 240 }
242 return call.target(); 241 return call.target();
243 } 242 }
244 243
245 244
246 RawFunction* CodePatcher::GetUnoptimizedStaticCallTargetAt( 245 RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(
247 uword return_address, const Code& code) { 246 uword return_address, const Code& code, ICData* ic_data_result) {
siva 2013/06/25 21:21:05 why not keep the param name consistent with GetIns
srdjan 2013/06/25 21:26:08 Discussed offline. Leaving as it is, since we need
248 ASSERT(code.ContainsInstructionAt(return_address)); 247 ASSERT(code.ContainsInstructionAt(return_address));
249 UnoptimizedStaticCall static_call(return_address); 248 UnoptimizedStaticCall static_call(return_address);
250 ICData& ic_data = ICData::Handle(); 249 ICData& ic_data = ICData::Handle();
251 ic_data ^= static_call.ic_data(); 250 ic_data ^= static_call.ic_data();
251 if (ic_data_result != NULL) {
252 *ic_data_result = ic_data.raw();
253 }
252 return ic_data.GetTargetAt(0); 254 return ic_data.GetTargetAt(0);
253 } 255 }
254 256
255 257
256 intptr_t CodePatcher::InstanceCallSizeInBytes() { 258 intptr_t CodePatcher::InstanceCallSizeInBytes() {
257 return InstanceCall::kNumInstructions * InstanceCall::kInstructionSize; 259 return InstanceCall::kNumInstructions * InstanceCall::kInstructionSize;
258 } 260 }
259 261
260 } // namespace dart 262 } // namespace dart
261 263
262 #endif // defined TARGET_ARCH_IA32 264 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698