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

Unified Diff: runtime/vm/intrinsifier.cc

Issue 11421024: Use fingerprint to detect changes in methods that are intrinsified. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« no previous file with comments | « runtime/vm/intrinsifier.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier.cc
===================================================================
--- runtime/vm/intrinsifier.cc (revision 15200)
+++ runtime/vm/intrinsifier.cc (working copy)
@@ -64,6 +64,8 @@
bool Intrinsifier::CanIntrinsify(const Function& function) {
if (!FLAG_intrinsify) return false;
if (function.IsClosureFunction()) return false;
+ // Can occur because of compile-all flag.
+ if (function.is_external()) return false;
// Intrinsic kind is set lazily below.
if (function.intrinsic_kind() == Function::kIsIntrinsic) return true;
if (function.intrinsic_kind() == Function::kIsNotIntrinsic) return false;
@@ -77,7 +79,7 @@
return false;
}
const char* class_name = String::Handle(function_class.Name()).ToCString();
-#define FIND_INTRINSICS(test_class_name, test_function_name, destination) \
+#define FIND_INTRINSICS(test_class_name, test_function_name, destination, fp) \
if (TestFunction(function, \
class_name, function_name, \
#test_class_name, #test_function_name)) { \
@@ -91,15 +93,30 @@
return false;
}
+
+static bool CheckFingerprint(const Function& function, intptr_t fp) {
+ if (function.SourceFingerprint() != fp) {
+ OS::Print("FP mismatch while intrinsifying %s:"
+ " expecting %"Pd" found %d\n",
+ function.ToFullyQualifiedCString(),
+ fp,
+ function.SourceFingerprint());
+ return false;
+ }
+ return true;
+}
+
+
bool Intrinsifier::Intrinsify(const Function& function, Assembler* assembler) {
if (!CanIntrinsify(function)) return false;
const char* function_name = String::Handle(function.name()).ToCString();
const Class& function_class = Class::Handle(function.Owner());
const char* class_name = String::Handle(function_class.Name()).ToCString();
-#define FIND_INTRINSICS(test_class_name, test_function_name, destination) \
+#define FIND_INTRINSICS(test_class_name, test_function_name, destination, fp) \
if (TestFunction(function, \
class_name, function_name, \
#test_class_name, #test_function_name)) { \
+ ASSERT(CheckFingerprint(function, fp)); \
return destination(assembler); \
} \
« no previous file with comments | « runtime/vm/intrinsifier.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698