Index: runtime/vm/native_entry.cc |
diff --git a/runtime/vm/native_entry.cc b/runtime/vm/native_entry.cc |
index 63c9a61a185036241fb5689ec9cf3bfcc2f6b938..adedfb78914f4555036492b085899939b56926ab 100644 |
--- a/runtime/vm/native_entry.cc |
+++ b/runtime/vm/native_entry.cc |
@@ -129,33 +129,17 @@ void NativeEntry::NativeCallWrapper(Dart_NativeArguments args, |
} |
-static bool IsNativeKeyword(const TokenStream::Iterator& it) { |
- return Token::IsIdentifier(it.CurrentTokenKind()) && |
- (it.CurrentLiteral() == Symbols::Native().raw()); |
-} |
- |
- |
static NativeFunction ResolveNativeFunction(Zone* zone, |
const Function& func, |
bool* is_bootstrap_native) { |
- const Script& script = Script::Handle(zone, func.script()); |
const Class& cls = Class::Handle(zone, func.Owner()); |
const Library& library = Library::Handle(zone, cls.library()); |
*is_bootstrap_native = |
Bootstrap::IsBootstapResolver(library.native_entry_resolver()); |
- TokenStream::Iterator it(TokenStream::Handle(zone, script.tokens()), |
- func.token_pos()); |
- |
- const intptr_t end_pos = func.end_token_pos(); |
- while (!IsNativeKeyword(it) && it.CurrentPosition() <= end_pos) { |
- it.Advance(); |
- } |
- ASSERT(IsNativeKeyword(it)); |
- it.Advance(); |
- ASSERT(it.CurrentTokenKind() == Token::kSTRING); |
- const String& native_name = String::Handle(it.CurrentLiteral()); |
+ const String& native_name = String::Handle(zone, func.native_name()); |
+ ASSERT(!native_name.IsNull()); |
const int num_params = NativeArguments::ParameterCountForResolution(func); |
bool auto_setup_scope = true; |