Index: runtime/vm/intrinsifier.cc |
diff --git a/runtime/vm/intrinsifier.cc b/runtime/vm/intrinsifier.cc |
index efcb13690c51d032b0796aae35ce7a0ebf899107..abeef01f0e255700ac257c79a1f6ac29a0c541da 100644 |
--- a/runtime/vm/intrinsifier.cc |
+++ b/runtime/vm/intrinsifier.cc |
@@ -50,7 +50,7 @@ static bool TestFunction(const Function& function, |
} |
-bool Intrinsifier::Intrinsify(const Function& function, Assembler* assembler) { |
+bool Intrinsifier::CanIntrinsify(const Function& function) { |
if (!FLAG_intrinsify) return false; |
// Closure functions may have different arguments. |
if (function.IsClosureFunction()) return false; |
@@ -70,6 +70,23 @@ bool Intrinsifier::Intrinsify(const Function& function, Assembler* assembler) { |
if (TestFunction(function, \ |
class_name, function_name, \ |
#test_class_name, #test_function_name)) { \ |
+ return true; \ |
+ } \ |
+ |
+INTRINSIC_LIST(FIND_INTRINSICS); |
+#undef FIND_INTRINSICS |
+ return false; |
+} |
+ |
+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) \ |
+ if (TestFunction(function, \ |
+ class_name, function_name, \ |
+ #test_class_name, #test_function_name)) { \ |
return destination(assembler); \ |
} \ |