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

Unified Diff: runtime/vm/native_entry.h

Issue 2793163002: Do not embed is_auto_setup_scope into the compilation of native calls. (Closed)
Patch Set: . Created 3 years, 9 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
Index: runtime/vm/native_entry.h
diff --git a/runtime/vm/native_entry.h b/runtime/vm/native_entry.h
index 9b8f6e341e68eceba17ff5802570c6b79a3b6335..187472f4a6372f4d1e2e448cb3cc60a582f3c3ce 100644
--- a/runtime/vm/native_entry.h
+++ b/runtime/vm/native_entry.h
@@ -22,6 +22,18 @@ namespace dart {
class Class;
class String;
+// We have three variants of native functions:
+// - bootstrap natives, which are called directly from stub code. The callee is
+// responsible for safepoint transitions and setting up handle scopes as
+// needed. Only VM-defined natives are bootstrap natives; they cannot be
+// defined by embedders or native extensions.
+// - no scope natives, which are called through a wrapper function. The wrapper
+// function handles the safepoint transition. The callee is responsible for
+// setting up API scopes as needed.
+// - auto scope natives, which are called through a wrapper function. The
+// wrapper function handles the safepoint transition and sets up an API
+// scope.
+
typedef void (*NativeFunction)(NativeArguments* arguments);
@@ -107,9 +119,13 @@ class NativeEntry : public AllStatic {
uword pc);
static const uint8_t* ResolveSymbol(uword pc);
- static uword NativeCallWrapperEntry();
- static void NativeCallWrapper(Dart_NativeArguments args,
- Dart_NativeFunction func);
+ static uword NoScopeNativeCallWrapperEntry();
+ static void NoScopeNativeCallWrapper(Dart_NativeArguments args,
+ Dart_NativeFunction func);
+
+ static uword AutoScopeNativeCallWrapperEntry();
+ static void AutoScopeNativeCallWrapper(Dart_NativeArguments args,
+ Dart_NativeFunction func);
// DBC does not support lazy native call linking.
#if !defined(TARGET_ARCH_DBC)
@@ -118,8 +134,10 @@ class NativeEntry : public AllStatic {
#endif
private:
- static void NativeCallWrapperNoStackCheck(Dart_NativeArguments args,
- Dart_NativeFunction func);
+ static void NoScopeNativeCallWrapperNoStackCheck(Dart_NativeArguments args,
+ Dart_NativeFunction func);
+ static void AutoScopeNativeCallWrapperNoStackCheck(Dart_NativeArguments args,
+ Dart_NativeFunction func);
static bool ReturnValueIsError(NativeArguments* arguments);
static void PropagateErrors(NativeArguments* arguments);

Powered by Google App Engine
This is Rietveld 408576698