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)); \ |