Chromium Code Reviews| Index: runtime/vm/code_patcher_ia32.cc |
| =================================================================== |
| --- runtime/vm/code_patcher_ia32.cc (revision 1596) |
| +++ runtime/vm/code_patcher_ia32.cc (working copy) |
| @@ -30,6 +30,15 @@ |
| ASSERT(kInstructionSize == Assembler::kCallExternalLabelSize); |
| } |
| + static bool IsValidCallPattern(uword return_address) { |
|
srdjan
2011/11/17 01:32:55
Could be called DartCallPattern::IsValid instead o
hausner
2011/11/17 16:33:02
Done.
|
| + uint8_t* code_bytes = |
| + reinterpret_cast<uint8_t*>( |
| + return_address - (kNumInstructions * kInstructionSize)); |
| + return (code_bytes[0] == 0xB9) && |
| + (code_bytes[kInstructionSize] == 0xBA) && |
| + (code_bytes[2 * kInstructionSize] == 0xE8); |
| + } |
| + |
| uword target() const { |
| const uword offset = *reinterpret_cast<uword*>(call_address() + 1); |
| return return_address() + offset; |
| @@ -217,6 +226,11 @@ |
| } |
| +bool CodePatcher::IsDartCall(uword return_address) { |
| + return DartCallPattern::IsValidCallPattern(return_address); |
| +} |
| + |
| + |
| void CodePatcher::GetInstanceCallAt(uword return_address, |
| String* function_name, |
| int* num_arguments, |