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

Unified Diff: runtime/vm/intrinsifier.cc

Issue 10919267: Introduce a VM-only dart:scalarlist library for byte arrays. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move init call for scalarlist lib Created 8 years, 3 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
« no previous file with comments | « runtime/vm/bootstrap_nocorelib.cc ('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
diff --git a/runtime/vm/intrinsifier.cc b/runtime/vm/intrinsifier.cc
index abeef01f0e255700ac257c79a1f6ac29a0c541da..27e83f7415bede22723ca6cbc421de3fe75a8207 100644
--- a/runtime/vm/intrinsifier.cc
+++ b/runtime/vm/intrinsifier.cc
@@ -17,10 +17,12 @@ static bool CompareNames(const char* test_name, const char* name) {
return true;
}
if ((name[0] == '_') && (test_name[0] == '_')) {
- // Check if the private class is member of corelib and matches the
- // test_class_name.
+ // Check if the private class is member of core, coreimpl or
+ // scalarlist and matches the test_class_name.
const Library& core_lib = Library::Handle(Library::CoreLibrary());
const Library& core_impl_lib = Library::Handle(Library::CoreImplLibrary());
+ const Library& scalarlist_lib =
+ Library::Handle(Library::ScalarlistLibrary());
String& test_str = String::Handle(String::New(test_name));
String& test_str_with_key = String::Handle();
test_str_with_key =
@@ -33,6 +35,11 @@ static bool CompareNames(const char* test_name, const char* name) {
if (strcmp(test_str_with_key.ToCString(), name) == 0) {
return true;
}
+ test_str_with_key =
+ String::Concat(test_str, String::Handle(scalarlist_lib.private_key()));
+ if (strcmp(test_str_with_key.ToCString(), name) == 0) {
+ return true;
+ }
}
return false;
}
@@ -57,13 +64,15 @@ bool Intrinsifier::CanIntrinsify(const Function& function) {
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 and math library methods can be intrinsified.
+ // 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() != math_lib.raw()) &&
+ (function_class.library() != scalarlist_lib.raw())) {
return false;
}
#define FIND_INTRINSICS(test_class_name, test_function_name, destination) \
« no previous file with comments | « runtime/vm/bootstrap_nocorelib.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698