| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 bool CodePatcher::IsDartCall(uword return_address) { | 215 bool CodePatcher::IsDartCall(uword return_address) { |
| 216 return DartCallPattern::IsValid(return_address); | 216 return DartCallPattern::IsValid(return_address); |
| 217 } | 217 } |
| 218 | 218 |
| 219 | 219 |
| 220 void CodePatcher::GetInstanceCallAt(uword return_address, | 220 void CodePatcher::GetInstanceCallAt(uword return_address, |
| 221 String* function_name, | 221 String* function_name, |
| 222 int* num_arguments, | 222 int* num_arguments, |
| 223 int* num_named_arguments, | 223 int* num_named_arguments, |
| 224 uword* target) { | 224 uword* target) { |
| 225 ASSERT(function_name != NULL); | |
| 226 ASSERT(num_arguments != NULL); | 225 ASSERT(num_arguments != NULL); |
| 227 ASSERT(num_named_arguments != NULL); | 226 ASSERT(num_named_arguments != NULL); |
| 228 ASSERT(target != NULL); | 227 ASSERT(target != NULL); |
| 229 InstanceCall call(return_address); | 228 InstanceCall call(return_address); |
| 230 *num_arguments = call.argument_count(); | 229 *num_arguments = call.argument_count(); |
| 231 *num_named_arguments = call.named_argument_count(); | 230 *num_named_arguments = call.named_argument_count(); |
| 232 *target = call.target(); | 231 *target = call.target(); |
| 233 ICData ic_data(Array::ZoneHandle(call.ic_data())); | 232 ICData ic_data(Array::ZoneHandle(call.ic_data())); |
| 234 *function_name = ic_data.FunctionName(); | 233 if (function_name != NULL) { |
| 234 *function_name = ic_data.FunctionName(); |
| 235 } |
| 235 } | 236 } |
| 236 | 237 |
| 237 | 238 |
| 238 RawArray* CodePatcher::GetInstanceCallIcDataAt(uword return_address) { | 239 RawArray* CodePatcher::GetInstanceCallIcDataAt(uword return_address) { |
| 239 InstanceCall call(return_address); | 240 InstanceCall call(return_address); |
| 240 return call.ic_data(); | 241 return call.ic_data(); |
| 241 } | 242 } |
| 242 | 243 |
| 243 | 244 |
| 244 void CodePatcher::SetInstanceCallIcDataAt(uword return_address, | 245 void CodePatcher::SetInstanceCallIcDataAt(uword return_address, |
| 245 const Array& ic_data) { | 246 const Array& ic_data) { |
| 246 InstanceCall call(return_address); | 247 InstanceCall call(return_address); |
| 247 call.SetIcData(ic_data); | 248 call.SetIcData(ic_data); |
| 248 } | 249 } |
| 249 | 250 |
| 250 | 251 |
| 251 intptr_t CodePatcher::InstanceCallSizeInBytes() { | 252 intptr_t CodePatcher::InstanceCallSizeInBytes() { |
| 252 return DartCallPattern::kCallPatternSize; | 253 return DartCallPattern::kCallPatternSize; |
| 253 } | 254 } |
| 254 | 255 |
| 255 } // namespace dart | 256 } // namespace dart |
| 256 | 257 |
| 257 #endif // defined TARGET_ARCH_X64 | 258 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |