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

Unified Diff: vm/code_descriptors_test.cc

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/code_descriptors_test.cc
===================================================================
--- vm/code_descriptors_test.cc (revision 11528)
+++ vm/code_descriptors_test.cc (working copy)
@@ -182,18 +182,22 @@
CODEGEN_TEST_RUN(StackmapCodegen, Smi::New(1))
-DEFINE_NATIVE_ENTRY(NativeFunc, 2) {
- GET_NATIVE_ARGUMENT(Smi, i, arguments->At(0));
- GET_NATIVE_ARGUMENT(Smi, k, arguments->At(1));
- EXPECT_EQ(10, i.Value());
- EXPECT_EQ(20, k.Value());
+static void NativeFunc(Dart_NativeArguments args) {
+ Dart_EnterScope();
+ Dart_Handle i = Dart_GetNativeArgument(args, 0);
+ Dart_Handle k = Dart_GetNativeArgument(args, 1);
+ int64_t value = -1;
+ EXPECT_VALID(Dart_IntegerToInt64(i, &value));
+ EXPECT_EQ(10, value);
+ EXPECT_VALID(Dart_IntegerToInt64(k, &value));
+ EXPECT_EQ(20, value);
Isolate::Current()->heap()->CollectAllGarbage();
}
static Dart_NativeFunction native_resolver(Dart_Handle name,
int argument_count) {
- return reinterpret_cast<Dart_NativeFunction>(&DN_NativeFunc);
+ return reinterpret_cast<Dart_NativeFunction>(&NativeFunc);
}
« vm/bootstrap_natives.h ('K') | « vm/bootstrap_natives.cc ('k') | vm/code_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698