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

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

Issue 11411072: Simplify CodePatcher::GetStaticCallAt. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 ICData& ic_data = ICData::Handle(); 114 ICData& ic_data = ICData::Handle();
115 ic_data ^= reinterpret_cast<RawObject*>(immediate_one()); 115 ic_data ^= reinterpret_cast<RawObject*>(immediate_one());
116 return ic_data.raw(); 116 return ic_data.raw();
117 } 117 }
118 118
119 private: 119 private:
120 DISALLOW_IMPLICIT_CONSTRUCTORS(InstanceCall); 120 DISALLOW_IMPLICIT_CONSTRUCTORS(InstanceCall);
121 }; 121 };
122 122
123 123
124 void CodePatcher::GetStaticCallAt(uword return_address, 124 void CodePatcher::GetStaticCallTargetAt(uword return_address) {
125 Function* function,
126 uword* target) {
127 ASSERT(function != NULL);
128 ASSERT(target != NULL);
129 StaticCall call(return_address); 125 StaticCall call(return_address);
130 *target = call.target(); 126 return call.target();
131 *function = call.function();
132 } 127 }
133 128
134 129
135 void CodePatcher::PatchStaticCallAt(uword return_address, uword new_target) { 130 void CodePatcher::PatchStaticCallAt(uword return_address, uword new_target) {
136 StaticCall call(return_address); 131 StaticCall call(return_address);
137 call.set_target(new_target); 132 call.set_target(new_target);
138 } 133 }
139 134
140 135
141 void CodePatcher::PatchInstanceCallAt(uword return_address, uword new_target) { 136 void CodePatcher::PatchInstanceCallAt(uword return_address, uword new_target) {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 *reinterpret_cast<uint8_t*>(start) = 0xE8; 241 *reinterpret_cast<uint8_t*>(start) = 0xE8;
247 ShortCallPattern call(start); 242 ShortCallPattern call(start);
248 call.SetTargetAddress(target); 243 call.SetTargetAddress(target);
249 CPU::FlushICache(start, ShortCallPattern::InstructionLength()); 244 CPU::FlushICache(start, ShortCallPattern::InstructionLength());
250 } 245 }
251 246
252 247
253 } // namespace dart 248 } // namespace dart
254 249
255 #endif // defined TARGET_ARCH_X64 250 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698