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

Unified Diff: runtime/vm/intrinsifier.cc

Issue 484693003: Improve polymorphic inlining of int/int double/double operations. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 months 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/intrinsifier.cc
===================================================================
--- runtime/vm/intrinsifier.cc (revision 39328)
+++ runtime/vm/intrinsifier.cc (working copy)
@@ -46,10 +46,21 @@
// Check if the private class is member of the library and matches
// the test_class_name.
- const String& test_str = String::Handle(String::New(test_name));
- const String& test_str_with_key = String::Handle(
- String::Concat(test_str, String::Handle(lib.private_key())));
- if (strcmp(test_str_with_key.ToCString(), name) == 0) {
+ // Check if this is a constructor (e.g., List,), in which case the mangler
+ // needs some help (see comment in Library::PrivateName).
+ String& test_str = String::Handle();
+ if (test_name[strlen(test_name) - 1] == '.') {
+ test_str = String::FromUTF8(reinterpret_cast<const uint8_t*>(test_name),
+ strlen(test_name) - 1);
+ test_str = lib.PrivateName(test_str);
+ test_str = String::Concat(test_str, Symbols::Dot());
+
+ } else {
+ test_str = String::New(test_name);
+ test_str = String::Concat(test_str, String::Handle(lib.private_key()));
+ }
+
+ if (strcmp(test_str.ToCString(), name) == 0) {
return true;
}
@@ -59,12 +70,11 @@
// Returns true if the function matches function_name and class_name, with
// special recognition of corelib private classes.
-static bool TestFunction(const Library& lib,
- const Function& function,
- const char* function_class_name,
- const char* function_name,
- const char* test_class_name,
- const char* test_function_name) {
+bool Intrinsifier::TestFunction(const Library& lib,
+ const char* class_name,
+ const char* function_name,
+ const char* test_class_name,
+ const char* test_function_name) {
// If test_function_name starts with a '.' we use that to indicate
// that it is a named constructor in the class. Therefore, if
// the class matches and the rest of the method name starting with
@@ -78,7 +88,7 @@
return false;
}
}
- return CompareNames(lib, test_class_name, function_class_name) &&
+ return CompareNames(lib, test_class_name, class_name) &&
CompareNames(lib, test_function_name, function_name);
}
@@ -162,7 +172,7 @@
const Library& lib = Library::Handle(function_class.library());
#define FIND_INTRINSICS(test_class_name, test_function_name, destination, fp) \
- if (TestFunction(lib, function, \
+ if (TestFunction(lib, \
class_name, function_name, \
#test_class_name, #test_function_name)) { \
ASSERT(function.CheckSourceFingerprint(fp)); \

Powered by Google App Engine
This is Rietveld 408576698