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

Unified Diff: runtime/vm/intrinsifier.cc

Issue 11358047: Add is_intrinsic and is_not_intrinsic bits to prevent repeated tests on the same function (inlining… (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 | « no previous file | 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 14433)
+++ runtime/vm/intrinsifier.cc (working copy)
@@ -69,31 +69,32 @@
bool Intrinsifier::CanIntrinsify(const Function& function) {
if (!FLAG_intrinsify) return false;
+ if (function.IsClosureFunction()) return false;
+ // Intrinsic kind is set lazily below.
+ if (function.intrinsic_kind() == Function::kIsIntrinsic) return true;
+ if (function.intrinsic_kind() == Function::kIsNotIntrinsic) return false;
// Closure functions may have different arguments.
- if (function.IsClosureFunction()) 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();
// Only core, math and scalarlist library methods can be intrinsified.
- const Library& core_lib = Library::Handle(Library::CoreLibrary());
- const Library& core_impl_lib = Library::Handle(Library::CoreImplLibrary());
- const Library& math_lib = Library::Handle(Library::MathLibrary());
- const Library& scalarlist_lib = Library::Handle(Library::ScalarlistLibrary());
- if ((function_class.library() != core_lib.raw()) &&
- (function_class.library() != core_impl_lib.raw()) &&
- (function_class.library() != math_lib.raw()) &&
- (function_class.library() != scalarlist_lib.raw())) {
+ if ((function_class.library() != Library::CoreLibrary()) &&
+ (function_class.library() != Library::CoreImplLibrary()) &&
+ (function_class.library() != Library::MathLibrary()) &&
+ (function_class.library() != Library::ScalarlistLibrary())) {
return false;
}
+ 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)) { \
+ function.set_intrinsic_kind(Function::kIsIntrinsic); \
return true; \
} \
INTRINSIC_LIST(FIND_INTRINSICS);
#undef FIND_INTRINSICS
+ function.set_intrinsic_kind(Function::kIsNotIntrinsic);
return false;
}
« no previous file with comments | « no previous file | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698