Index: runtime/vm/intermediate_language.cc |
=================================================================== |
--- runtime/vm/intermediate_language.cc (revision 15200) |
+++ runtime/vm/intermediate_language.cc (working copy) |
@@ -227,6 +227,19 @@ |
} |
+static bool CheckFingerprint(const Function& function, intptr_t fp) { |
+ if (function.SourceFingerprint() != fp) { |
+ OS::Print("FP mismatch while recogbnizing method %s:" |
+ " expecting %"Pd" found %d\n", |
+ function.ToFullyQualifiedCString(), |
+ fp, |
+ function.SourceFingerprint()); |
+ return false; |
+ } |
+ return true; |
+} |
siva
2012/11/21 22:02:50
We could make this a static function in class Func
srdjan
2012/11/21 22:10:36
Done.
|
+ |
+ |
MethodRecognizer::Kind MethodRecognizer::RecognizeKind( |
const Function& function) { |
// Only core and math library methods can be recognized. |
@@ -241,9 +254,10 @@ |
const String& function_name = String::Handle(function.name()); |
const String& class_name = String::Handle(function_class.Name()); |
-#define RECOGNIZE_FUNCTION(test_class_name, test_function_name, enum_name) \ |
+#define RECOGNIZE_FUNCTION(test_class_name, test_function_name, enum_name, fp) \ |
if (CompareNames(lib, #test_function_name, function_name) && \ |
CompareNames(lib, #test_class_name, class_name)) { \ |
+ ASSERT(CheckFingerprint(function, fp)); \ |
return k##enum_name; \ |
} |
RECOGNIZED_LIST(RECOGNIZE_FUNCTION) |
@@ -253,7 +267,7 @@ |
const char* MethodRecognizer::KindToCString(Kind kind) { |
-#define KIND_TO_STRING(class_name, function_name, enum_name) \ |
+#define KIND_TO_STRING(class_name, function_name, enum_name, fp) \ |
if (kind == k##enum_name) return #enum_name; |
RECOGNIZED_LIST(KIND_TO_STRING) |
#undef KIND_TO_STRING |