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