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

Unified Diff: runtime/vm/native_entry.h

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_arguments.h ('k') | runtime/vm/native_entry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/native_entry.h
===================================================================
--- runtime/vm/native_entry.h (revision 25822)
+++ runtime/vm/native_entry.h (working copy)
@@ -16,9 +16,6 @@
namespace dart {
-DECLARE_FLAG(bool, deoptimize_alot);
-DECLARE_FLAG(bool, trace_natives);
-
// Forward declarations.
class Class;
class String;
@@ -46,13 +43,12 @@
VERIFY_ON_TRANSITION; \
NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); \
ASSERT(arguments->NativeArgCount() == argument_count); \
- if (FLAG_trace_natives) OS::Print("Calling native: %s\n", ""#name); \
+ TRACE_NATIVES(""#name); \
{ \
StackZone zone(arguments->isolate()); \
- HANDLESCOPE(arguments->isolate()); \
SET_NATIVE_RETVAL(arguments, \
DN_Helper##name(arguments->isolate(), arguments)); \
- if (FLAG_deoptimize_alot) DeoptimizeAll(); \
+ DEOPTIMIZE_ALOT; \
} \
VERIFY_ON_TRANSITION; \
} \
@@ -92,10 +88,15 @@
// Helper class for resolving and handling native functions.
class NativeEntry : public AllStatic {
public:
+ static const intptr_t kNumCallWrapperArguments = 2;
+
// Resolve specified dart native function to the actual native entrypoint.
- static NativeFunction ResolveNative(const Class& cls,
+ static NativeFunction ResolveNative(const Library& library,
const String& function_name,
int number_of_arguments);
+ static void NativeCallWrapper(Dart_NativeArguments args,
+ Dart_NativeFunction func);
+ static const ExternalLabel& NativeCallWrapperLabel();
};
} // namespace dart
« no previous file with comments | « runtime/vm/native_arguments.h ('k') | runtime/vm/native_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698