diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h index f1d0a36fc11..d5fa7f7eca1 100644 --- a/runtime/include/dart_api.h +++ b/runtime/include/dart_api.h @@ -2458,15 +2458,6 @@ DART_EXPORT Dart_Handle Dart_ReThrowException(Dart_Handle exception, * =========================== */ -/** - * Creates a native wrapper class. - * - * TODO(turnidge): Document. - */ -DART_EXPORT Dart_Handle Dart_CreateNativeWrapperClass(Dart_Handle library, - Dart_Handle class_name, - int field_count); - /** * Gets the number of native instance fields in an object. */ diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status index b17e237b0e7..dda2b1d3973 100644 --- a/runtime/tests/vm/vm.status +++ b/runtime/tests/vm/vm.status @@ -182,7 +182,6 @@ cc/SourceReport_Coverage_UnusedClass_ForceCompileError: Crash cc/SourceReport_Coverage_UnusedClass_NoForceCompile: Fail cc/SourceReport_MultipleReports: Fail cc/SourceReport_PossibleBreakpoints_Simple: Fail -cc/UseDartApi: Fail dart/data_uri_import_test/utf16: MissingRuntimeError dart/spawn_shutdown_test: SkipSlow diff --git a/runtime/vm/benchmark_test.cc b/runtime/vm/benchmark_test.cc index 60078c674a7..c3e1db30746 100644 --- a/runtime/vm/benchmark_test.cc +++ b/runtime/vm/benchmark_test.cc @@ -240,7 +240,6 @@ BENCHMARK(CorelibIsolateStartup) { // Measure invocation of Dart API functions. // static void InitNativeFields(Dart_NativeArguments args) { - Dart_EnterScope(); int count = Dart_GetNativeArgumentCount(args); EXPECT_EQ(1, count); @@ -248,8 +247,6 @@ static void InitNativeFields(Dart_NativeArguments args) { EXPECT_VALID(recv); Dart_Handle result = Dart_SetNativeInstanceField(recv, 0, 7); EXPECT_VALID(result); - - Dart_ExitScope(); } // The specific api functions called here are a bit arbitrary. We are @@ -300,7 +297,8 @@ static Dart_NativeFunction bm_uda_lookup(Dart_Handle name, BENCHMARK(UseDartApi) { const int kNumIterations = 1000000; const char* kScriptChars = - "class Class extends NativeFieldsWrapper{\n" + "import 'dart:nativewrappers';\n" + "class Class extends NativeFieldWrapperClass1 {\n" " int init() native 'init';\n" " int method(int param1, int param2) native 'method';\n" "}\n" @@ -316,12 +314,7 @@ BENCHMARK(UseDartApi) { Dart_Handle lib = TestCase::LoadTestScript( kScriptChars, reinterpret_cast(bm_uda_lookup), USER_TEST_URI, false); - - // Create a native wrapper class with native fields. - Dart_Handle result = - Dart_CreateNativeWrapperClass(lib, NewString("NativeFieldsWrapper"), 1); - EXPECT_VALID(result); - result = Dart_FinalizeLoading(false); + Dart_Handle result = Dart_FinalizeLoading(false); EXPECT_VALID(result); Dart_Handle args[1]; diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc index d8800558cb6..7d5eafc7324 100644 --- a/runtime/vm/dart_api_impl.cc +++ b/runtime/vm/dart_api_impl.cc @@ -4401,38 +4401,6 @@ DART_EXPORT Dart_Handle Dart_ReThrowException(Dart_Handle exception, // --- Native fields and functions --- -DART_EXPORT Dart_Handle Dart_CreateNativeWrapperClass(Dart_Handle library, - Dart_Handle name, - int field_count) { -#if defined(DART_PRECOMPILED_RUNTIME) - return Api::NewError("%s: Cannot compile on an AOT runtime.", CURRENT_FUNC); -#else - DARTSCOPE(Thread::Current()); - const String& cls_name = Api::UnwrapStringHandle(Z, name); - if (cls_name.IsNull()) { - RETURN_TYPE_ERROR(Z, name, String); - } - const Library& lib = Api::UnwrapLibraryHandle(Z, library); - if (lib.IsNull()) { - RETURN_TYPE_ERROR(Z, library, Library); - } - if (!Utils::IsUint(16, field_count)) { - return Api::NewError( - "Invalid field_count passed to Dart_CreateNativeWrapperClass"); - } - CHECK_CALLBACK_STATE(T); - - String& cls_symbol = String::Handle(Z, Symbols::New(T, cls_name)); - const Class& cls = - Class::Handle(Z, Class::NewNativeWrapper(lib, cls_symbol, field_count)); - if (cls.IsNull()) { - return Api::NewError( - "Unable to create native wrapper class : already exists"); - } - return Api::NewHandle(T, cls.RareType()); -#endif // defined(DART_PRECOMPILED_RUNTIME) -} - DART_EXPORT Dart_Handle Dart_GetNativeInstanceFieldCount(Dart_Handle obj, int* count) { Thread* thread = Thread::Current(); @@ -4659,6 +4627,7 @@ Dart_GetNativeFieldsOfArgument(Dart_NativeArguments args, DART_EXPORT Dart_Handle Dart_GetNativeReceiver(Dart_NativeArguments args, intptr_t* value) { NativeArguments* arguments = reinterpret_cast(args); + TransitionNativeToVM transition(arguments->thread()); ASSERT(arguments->thread()->isolate() == Isolate::Current()); if (value == NULL) { RETURN_NULL_ERROR(value);