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

Unified Diff: vm/native_entry.h

Issue 10874072: Use the return value of vm native methods to set the return value, (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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
Index: vm/native_entry.h
===================================================================
--- vm/native_entry.h (revision 11528)
+++ vm/native_entry.h (working copy)
@@ -24,17 +24,13 @@
typedef void (*NativeFunction)(NativeArguments* arguments);
-#define NATIVE_ENTRY_FUNCTION(name) DN_##name
+#define NATIVE_ENTRY_FUNCTION(name) BootstrapNatives::DN_##name
-// Helper macros for declaring and defining native entries.
-#define REGISTER_NATIVE_ENTRY(name, count) \
- { ""#name, NATIVE_ENTRY_FUNCTION(name), count },
-
-
#define DEFINE_NATIVE_ENTRY(name, argument_count) \
- static void DN_Helper##name(Isolate* isolate, NativeArguments* arguments); \
- void NATIVE_ENTRY_FUNCTION(name)(Dart_NativeArguments args) { \
+ static RawObject* DN_Helper##name(Isolate* isolate, \
+ NativeArguments* arguments); \
+ void NATIVE_ENTRY_FUNCTION(name)(Dart_NativeArguments args) { \
CHECK_STACK_ALIGNMENT; \
VERIFY_ON_TRANSITION; \
NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); \
@@ -43,16 +39,15 @@
{ \
Zone zone(arguments->isolate()); \
HANDLESCOPE(arguments->isolate()); \
- DN_Helper##name(arguments->isolate(), arguments); \
+ arguments->SetReturnUnsafe( \
+ DN_Helper##name(arguments->isolate(), arguments)); \
} \
VERIFY_ON_TRANSITION; \
} \
- static void DN_Helper##name(Isolate* isolate, NativeArguments* arguments)
+ static RawObject* DN_Helper##name(Isolate* isolate, \
+ NativeArguments* arguments)
-#define DECLARE_NATIVE_ENTRY(name, argument_count) \
- extern void NATIVE_ENTRY_FUNCTION(name)(Dart_NativeArguments arguments);
-
// Natives should throw an exception if an illegal argument is passed.
// type name = value.
#define GET_NATIVE_ARGUMENT(type, name, value) \
« vm/bootstrap_natives.h ('K') | « vm/native_arguments.cc ('k') | vm/native_entry_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698