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

Unified Diff: runtime/vm/object.cc

Issue 594183003: Mark _Bigint._mulAdd and conversion methods in typed_data as invisible. Strengthen the mirror invoc… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « no previous file | tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 5825d87cf6cbf8e05343b6e04ad745a60ab4018d..201ab7d8349f6210cbcd2974afd9f12dbb6684fe 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -161,13 +161,24 @@ const double MegamorphicCache::kLoadFactor = 0.75;
// (Library, class name, method name)
// Additionally, private functions in dart:* that are native or constructors are
// marked as invisible by the parser.
-#define INVISIBLE_LIST(V) \
+#define INVISIBLE_CLASS_FUNCTIONS(V) \
V(CoreLibrary, int, _throwFormatException) \
V(CoreLibrary, int, _parse) \
-
-static void MarkFunctionAsInvisible(const Library& lib,
- const char* class_name,
- const char* function_name) {
+ V(CoreLibrary, _Bigint, _mulAdd) \
+
+#define INVISIBLE_LIBRARY_FUNCTIONS(V) \
+ V(TypedDataLibrary, _toInt8) \
+ V(TypedDataLibrary, _toInt16) \
+ V(TypedDataLibrary, _toInt32) \
+ V(TypedDataLibrary, _toInt64) \
+ V(TypedDataLibrary, _toUint8) \
+ V(TypedDataLibrary, _toUint16) \
+ V(TypedDataLibrary, _toUint32) \
+ V(TypedDataLibrary, _toUint64) \
+
+static void MarkClassFunctionAsInvisible(const Library& lib,
+ const char* class_name,
+ const char* function_name) {
ASSERT(!lib.IsNull());
const Class& cls = Class::Handle(
lib.LookupClassAllowPrivate(String::Handle(String::New(class_name))));
@@ -180,13 +191,31 @@ static void MarkFunctionAsInvisible(const Library& lib,
function.set_is_visible(false);
}
+static void MarkLibraryFunctionAsInvisible(const Library& lib,
+ const char* function_name) {
+ ASSERT(!lib.IsNull());
+ const Function& function =
+ Function::Handle(
+ lib.LookupFunctionAllowPrivate(
+ String::Handle(String::New(function_name))));
+ ASSERT(!function.IsNull());
+ function.set_is_visible(false);
+}
+
static void MarkInvisibleFunctions() {
#define MARK_FUNCTION(lib, class_name, function_name) \
- MarkFunctionAsInvisible(Library::Handle(Library::lib()), \
+ MarkClassFunctionAsInvisible(Library::Handle(Library::lib()), \
#class_name, #function_name); \
-INVISIBLE_LIST(MARK_FUNCTION)
+INVISIBLE_CLASS_FUNCTIONS(MARK_FUNCTION)
+#undef MARK_FUNCTION
+
+#define MARK_FUNCTION(lib, function_name) \
+ MarkLibraryFunctionAsInvisible(Library::Handle(Library::lib()), \
+ #function_name); \
+
+INVISIBLE_LIBRARY_FUNCTIONS(MARK_FUNCTION)
#undef MARK_FUNCTION
}
« no previous file with comments | « no previous file | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698