OLD | NEW |
---|---|
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "include/dart_api.h" | 5 #include "include/dart_api.h" |
6 #include "include/dart_mirrors_api.h" | 6 #include "include/dart_mirrors_api.h" |
7 #include "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
8 | 8 |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "vm/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
(...skipping 5088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5099 NoHeapGrowthControlScope no_growth_control; | 5099 NoHeapGrowthControlScope no_growth_control; |
5100 | 5100 |
5101 const Script& script = Script::Handle( | 5101 const Script& script = Script::Handle( |
5102 isolate, Script::New(url_str, source_str, RawScript::kPatchTag)); | 5102 isolate, Script::New(url_str, source_str, RawScript::kPatchTag)); |
5103 Dart_Handle result; | 5103 Dart_Handle result; |
5104 CompileSource(isolate, lib, script, &result); | 5104 CompileSource(isolate, lib, script, &result); |
5105 return result; | 5105 return result; |
5106 } | 5106 } |
5107 | 5107 |
5108 | 5108 |
5109 // Finalizes classes and invokes Dart core library function that completes | |
5110 // futures of loadLibrary calls (deferred library loading). | |
5111 DART_EXPORT Dart_Handle Dart_FinalizeLoading() { | |
5112 Isolate* isolate = Isolate::Current(); | |
5113 CHECK_ISOLATE_SCOPE(isolate); | |
siva
2014/06/17 20:43:19
DARTSCOPE(isolate); so we get a new scope instead
hausner
2014/06/17 20:55:54
Done.
| |
5114 CHECK_CALLBACK_STATE(isolate); | |
5115 | |
5116 // Finalize all classes if needed. | |
5117 Dart_Handle state = Api::CheckIsolateState(isolate); | |
5118 if (::Dart_IsError(state)) { | |
5119 return state; | |
5120 } | |
5121 | |
5122 const Library& corelib = Library::Handle(isolate, Library::CoreLibrary()); | |
5123 const String& function_name = | |
5124 String::Handle(isolate, String::New("_completeDeferredLoads")); | |
5125 const Function& function = | |
5126 Function::Handle(isolate, | |
5127 corelib.LookupFunctionAllowPrivate(function_name)); | |
5128 ASSERT(!function.IsNull()); | |
5129 const Array& args = Array::empty_array(); | |
5130 Dart_Handle res = | |
5131 Api::NewHandle(isolate, DartEntry::InvokeFunction(function, args)); | |
siva
2014/06/17 20:43:19
_completeDeferredLoads does not seem to return any
hausner
2014/06/17 20:55:54
Done.
| |
5132 return res; | |
5133 } | |
5134 | |
5135 | |
5109 DART_EXPORT Dart_Handle Dart_SetNativeResolver( | 5136 DART_EXPORT Dart_Handle Dart_SetNativeResolver( |
5110 Dart_Handle library, | 5137 Dart_Handle library, |
5111 Dart_NativeEntryResolver resolver, | 5138 Dart_NativeEntryResolver resolver, |
5112 Dart_NativeEntrySymbol symbol) { | 5139 Dart_NativeEntrySymbol symbol) { |
5113 Isolate* isolate = Isolate::Current(); | 5140 Isolate* isolate = Isolate::Current(); |
5114 DARTSCOPE(isolate); | 5141 DARTSCOPE(isolate); |
5115 const Library& lib = Api::UnwrapLibraryHandle(isolate, library); | 5142 const Library& lib = Api::UnwrapLibraryHandle(isolate, library); |
5116 if (lib.IsNull()) { | 5143 if (lib.IsNull()) { |
5117 RETURN_TYPE_ERROR(isolate, library, Library); | 5144 RETURN_TYPE_ERROR(isolate, library, Library); |
5118 } | 5145 } |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5188 | 5215 |
5189 | 5216 |
5190 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( | 5217 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( |
5191 const char* name, | 5218 const char* name, |
5192 Dart_ServiceRequestCallback callback, | 5219 Dart_ServiceRequestCallback callback, |
5193 void* user_data) { | 5220 void* user_data) { |
5194 Service::RegisterRootEmbedderCallback(name, callback, user_data); | 5221 Service::RegisterRootEmbedderCallback(name, callback, user_data); |
5195 } | 5222 } |
5196 | 5223 |
5197 } // namespace dart | 5224 } // namespace dart |
OLD | NEW |