| OLD | NEW |
| 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 bool CodePatcher::IsDartCall(uword return_address) { | 232 bool CodePatcher::IsDartCall(uword return_address) { |
| 233 return DartCallPattern::IsValid(return_address); | 233 return DartCallPattern::IsValid(return_address); |
| 234 } | 234 } |
| 235 | 235 |
| 236 | 236 |
| 237 void CodePatcher::GetInstanceCallAt(uword return_address, | 237 void CodePatcher::GetInstanceCallAt(uword return_address, |
| 238 String* function_name, | 238 String* function_name, |
| 239 int* num_arguments, | 239 int* num_arguments, |
| 240 int* num_named_arguments, | 240 int* num_named_arguments, |
| 241 uword* target) { | 241 uword* target) { |
| 242 ASSERT(function_name != NULL); | |
| 243 ASSERT(num_arguments != NULL); | 242 ASSERT(num_arguments != NULL); |
| 244 ASSERT(num_named_arguments != NULL); | 243 ASSERT(num_named_arguments != NULL); |
| 245 ASSERT(target != NULL); | 244 ASSERT(target != NULL); |
| 246 InstanceCall call(return_address); | 245 InstanceCall call(return_address); |
| 247 *num_arguments = call.argument_count(); | 246 *num_arguments = call.argument_count(); |
| 248 *num_named_arguments = call.named_argument_count(); | 247 *num_named_arguments = call.named_argument_count(); |
| 249 *target = call.target(); | 248 *target = call.target(); |
| 250 const ICData& ic_data = ICData::Handle(call.ic_data()); | 249 const ICData& ic_data = ICData::Handle(call.ic_data()); |
| 251 *function_name = ic_data.target_name(); | 250 *function_name = ic_data.target_name(); |
| 252 } | 251 } |
| 253 | 252 |
| 254 | 253 |
| 255 RawICData* CodePatcher::GetInstanceCallIcDataAt(uword return_address) { | 254 RawICData* CodePatcher::GetInstanceCallIcDataAt(uword return_address) { |
| 256 InstanceCall call(return_address); | 255 InstanceCall call(return_address); |
| 257 return call.ic_data(); | 256 return call.ic_data(); |
| 258 } | 257 } |
| 259 | 258 |
| 260 | 259 |
| 261 intptr_t CodePatcher::InstanceCallSizeInBytes() { | 260 intptr_t CodePatcher::InstanceCallSizeInBytes() { |
| 262 return DartCallPattern::kNumInstructions * DartCallPattern::kInstructionSize; | 261 return DartCallPattern::kNumInstructions * DartCallPattern::kInstructionSize; |
| 263 } | 262 } |
| 264 | 263 |
| 265 } // namespace dart | 264 } // namespace dart |
| 266 | 265 |
| 267 #endif // defined TARGET_ARCH_IA32 | 266 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |