| Index: runtime/vm/code_patcher_ia32.cc
|
| ===================================================================
|
| --- runtime/vm/code_patcher_ia32.cc (revision 1620)
|
| +++ runtime/vm/code_patcher_ia32.cc (working copy)
|
| @@ -24,12 +24,19 @@
|
| public:
|
| explicit DartCallPattern(uword return_address)
|
| : start_(return_address - (kNumInstructions * kInstructionSize)) {
|
| - ASSERT(*reinterpret_cast<uint8_t*>(start_) == 0xB9);
|
| - ASSERT(*reinterpret_cast<uint8_t*>(start_ + 1 * kInstructionSize) == 0xBA);
|
| - ASSERT(*reinterpret_cast<uint8_t*>(start_ + 2 * kInstructionSize) == 0xE8);
|
| + ASSERT(IsValid(return_address));
|
| ASSERT(kInstructionSize == Assembler::kCallExternalLabelSize);
|
| }
|
|
|
| + static bool IsValid(uword return_address) {
|
| + 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 +224,11 @@
|
| }
|
|
|
|
|
| +bool CodePatcher::IsDartCall(uword return_address) {
|
| + return DartCallPattern::IsValid(return_address);
|
| +}
|
| +
|
| +
|
| void CodePatcher::GetInstanceCallAt(uword return_address,
|
| String* function_name,
|
| int* num_arguments,
|
|
|