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

Side by Side Diff: runtime/vm/code_patcher_x64.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, 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) 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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 } 207 }
208 return call.target(); 208 return call.target();
209 } 209 }
210 210
211 211
212 intptr_t CodePatcher::InstanceCallSizeInBytes() { 212 intptr_t CodePatcher::InstanceCallSizeInBytes() {
213 return InstanceCall::kCallPatternSize; 213 return InstanceCall::kCallPatternSize;
214 } 214 }
215 215
216 216
217 RawFunction* CodePatcher::GetUnoptimizedStaticCallTargetAt(
218 uword return_address, const Code& code) {
219 ASSERT(code.ContainsInstructionAt(return_address));
220 UnoptimizedStaticCall static_call(return_address);
221 ICData& ic_data = ICData::Handle();
222 ic_data ^= static_call.ic_data();
223 return ic_data.GetTargetAt(0);
224 }
225
226
227 void CodePatcher::InsertCallAt(uword start, uword target) { 217 void CodePatcher::InsertCallAt(uword start, uword target) {
228 // The inserted call should not overlap the lazy deopt jump code. 218 // The inserted call should not overlap the lazy deopt jump code.
229 ASSERT(start + ShortCallPattern::InstructionLength() <= target); 219 ASSERT(start + ShortCallPattern::InstructionLength() <= target);
230 *reinterpret_cast<uint8_t*>(start) = 0xE8; 220 *reinterpret_cast<uint8_t*>(start) = 0xE8;
231 ShortCallPattern call(start); 221 ShortCallPattern call(start);
232 call.SetTargetAddress(target); 222 call.SetTargetAddress(target);
233 CPU::FlushICache(start, ShortCallPattern::InstructionLength()); 223 CPU::FlushICache(start, ShortCallPattern::InstructionLength());
234 } 224 }
235 225
236 226
227 RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(
228 uword return_address, const Code& code, ICData* ic_data_result) {
229 ASSERT(code.ContainsInstructionAt(return_address));
230 UnoptimizedStaticCall static_call(return_address);
231 ICData& ic_data = ICData::Handle();
232 ic_data ^= static_call.ic_data();
233 if (ic_data_result != NULL) {
234 *ic_data_result = ic_data.raw();
235 }
236 return ic_data.GetTargetAt(0);
237 }
siva 2013/06/25 21:21:05 This code seems pretty similar in all the target v
srdjan 2013/06/25 21:26:08 Next CL.
238
237 } // namespace dart 239 } // namespace dart
238 240
239 #endif // defined TARGET_ARCH_X64 241 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698