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

Unified Diff: runtime/vm/parser.cc

Issue 22303002: Auto create ApiLocalScope before calling native functions, this ensures that (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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/native_entry_test.cc ('k') | runtime/vm/simulator_arm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 25822)
+++ runtime/vm/parser.cc (working copy)
@@ -6,6 +6,7 @@
#include "lib/invocation_mirror.h"
#include "vm/bigint_operations.h"
+#include "vm/bootstrap.h"
#include "vm/class_finalizer.h"
#include "vm/compiler.h"
#include "vm/compiler_stats.h"
@@ -5009,6 +5010,7 @@
func.set_is_native(true);
TRACE_PARSER("ParseNativeFunctionBlock");
const Class& cls = Class::Handle(func.Owner());
+ const Library& library = Library::Handle(cls.library());
ASSERT(func.NumParameters() == params->parameters->length());
// Parse the function name out.
@@ -5018,19 +5020,22 @@
// Now resolve the native function to the corresponding native entrypoint.
const int num_params = NativeArguments::ParameterCountForResolution(func);
NativeFunction native_function = NativeEntry::ResolveNative(
- cls, native_name, num_params);
+ library, native_name, num_params);
if (native_function == NULL) {
ErrorMsg(native_pos, "native function '%s' cannot be found",
native_name.ToCString());
}
// Now add the NativeBodyNode and return statement.
+ Dart_NativeEntryResolver resolver = library.native_entry_resolver();
+ bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver);
current_block_->statements->Add(
new ReturnNode(TokenPos(),
new NativeBodyNode(TokenPos(),
Function::ZoneHandle(func.raw()),
native_name,
- native_function)));
+ native_function,
+ is_bootstrap_native)));
}
« no previous file with comments | « runtime/vm/native_entry_test.cc ('k') | runtime/vm/simulator_arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698