Chromium Code Reviews| Index: runtime/vm/object.cc |
| =================================================================== |
| --- runtime/vm/object.cc (revision 17416) |
| +++ runtime/vm/object.cc (working copy) |
| @@ -117,6 +117,45 @@ |
| const double MegamorphicCache::kLoadFactor = 0.75; |
| +// The following functions are marked as invisible, meaning they will be hidden |
| +// in the stack trace. |
| +// (Library, class name, method name) |
| +#define INVISIBLE_LIST(V) \ |
| + V(CoreLibrary, Object, _noSuchMethod) \ |
| + V(CoreLibrary, List, _throwArgumentError) \ |
| + V(CoreLibrary, AssertionErrorImplementation, _throwNew) \ |
| + V(CoreLibrary, TypeErrorImplementation, _throwNew) \ |
| + V(CoreLibrary, FallThroughErrorImplementation, _throwNew) \ |
| + V(CoreLibrary, AbstractClassInstantiationErrorImplementation, _throwNew) \ |
| + V(CoreLibrary, NoSuchMethodError, _throwNew) \ |
| + V(CoreLibrary, int, _throwFormatException) \ |
| + V(CoreLibrary, int, _parse) \ |
| + |
| + |
| +static void CallIt(const Library& lib, |
|
Ivan Posva
2013/01/23 01:17:26
Please CallIt something more descriptive.
srdjan
2013/01/23 19:22:29
MarkFunctionAsInvisible
|
| + const char* class_name, |
| + const char* function_name) { |
| + ASSERT(!lib.IsNull()); |
| + const Class& cls = Class::Handle( |
| + lib.LookupClass(String::Handle(String::New(class_name)))); |
| + ASSERT(!cls.IsNull()); |
| + const Function& function = |
| + Function::Handle( |
| + cls.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) \ |
| + CallIt(Library::Handle(Library::lib()), #class_name, #function_name); |
| + |
| +INVISIBLE_LIST(MARK_FUNCTION) |
| +#undef MARK_FUNCTION |
| +} |
| + |
| // Takes a vm internal name and makes it suitable for external user. |
| // |
| // Examples: |
| @@ -1024,6 +1063,7 @@ |
| cls.set_super_type(Type::Handle()); |
| ClassFinalizer::VerifyBootstrapClasses(); |
| + MarkInvisibleFunctions(); |
| return Error::null(); |
| } |
| @@ -3628,6 +3668,11 @@ |
| } |
| +void Function::set_is_visible(bool value) const { |
| + set_kind_tag(VisibleBit::update(value, raw_ptr()->kind_tag_)); |
| +} |
| + |
| + |
| intptr_t Function::NumParameters() const { |
| return num_fixed_parameters() + NumOptionalParameters(); |
| } |
| @@ -4038,6 +4083,7 @@ |
| result.set_is_const(is_const); |
| result.set_is_abstract(is_abstract); |
| result.set_is_external(is_external); |
| + result.set_is_visible(true); // Will be computed later. |
| result.set_intrinsic_kind(kUnknownIntrinsic); |
| result.set_owner(owner); |
| result.set_token_pos(token_pos); |