Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Unified Diff: runtime/vm/code_patcher_ia32.cc

Issue 8588014: Addition to CodePatcher (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,

Powered by Google App Engine
This is Rietveld 408576698