| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 | 6 |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
| (...skipping 3719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3730 | 3730 |
| 3731 DART_EXPORT Dart_Handle Dart_SetLibraryTagHandler( | 3731 DART_EXPORT Dart_Handle Dart_SetLibraryTagHandler( |
| 3732 Dart_LibraryTagHandler handler) { | 3732 Dart_LibraryTagHandler handler) { |
| 3733 Isolate* isolate = Isolate::Current(); | 3733 Isolate* isolate = Isolate::Current(); |
| 3734 CHECK_ISOLATE(isolate); | 3734 CHECK_ISOLATE(isolate); |
| 3735 isolate->set_library_tag_handler(handler); | 3735 isolate->set_library_tag_handler(handler); |
| 3736 return Api::Success(isolate); | 3736 return Api::Success(isolate); |
| 3737 } | 3737 } |
| 3738 | 3738 |
| 3739 | 3739 |
| 3740 DART_EXPORT Dart_Handle Dart_SetImportMap(Dart_Handle import_map) { | |
| 3741 Isolate* isolate = Isolate::Current(); | |
| 3742 DARTSCOPE(isolate); | |
| 3743 const Array& mapping_array = Api::UnwrapArrayHandle(isolate, import_map); | |
| 3744 if (mapping_array.IsNull()) { | |
| 3745 RETURN_TYPE_ERROR(isolate, import_map, Array); | |
| 3746 } | |
| 3747 isolate->object_store()->set_import_map(mapping_array); | |
| 3748 return Api::Success(isolate); | |
| 3749 } | |
| 3750 | |
| 3751 | |
| 3752 // NOTE: Need to pass 'result' as a parameter here in order to avoid | 3740 // NOTE: Need to pass 'result' as a parameter here in order to avoid |
| 3753 // warning: variable 'result' might be clobbered by 'longjmp' or 'vfork' | 3741 // warning: variable 'result' might be clobbered by 'longjmp' or 'vfork' |
| 3754 // which shows up because of the use of setjmp. | 3742 // which shows up because of the use of setjmp. |
| 3755 static void CompileSource(Isolate* isolate, | 3743 static void CompileSource(Isolate* isolate, |
| 3756 const Library& lib, | 3744 const Library& lib, |
| 3757 const String& url, | 3745 const String& url, |
| 3758 const String& source, | 3746 const String& source, |
| 3759 RawScript::Kind kind, | 3747 RawScript::Kind kind, |
| 3760 Dart_Handle* result) { | 3748 Dart_Handle* result) { |
| 3761 bool update_lib_status = (kind == RawScript::kScriptTag || | 3749 bool update_lib_status = (kind == RawScript::kScriptTag || |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4186 DART_EXPORT void Dart_InitPerfEventsSupport(Dart_FileWriterFunction function) { | 4174 DART_EXPORT void Dart_InitPerfEventsSupport(Dart_FileWriterFunction function) { |
| 4187 Dart::set_perf_events_writer(function); | 4175 Dart::set_perf_events_writer(function); |
| 4188 } | 4176 } |
| 4189 | 4177 |
| 4190 | 4178 |
| 4191 DART_EXPORT void Dart_InitFlowGraphPrinting(Dart_FileWriterFunction function) { | 4179 DART_EXPORT void Dart_InitFlowGraphPrinting(Dart_FileWriterFunction function) { |
| 4192 Dart::set_flow_graph_writer(function); | 4180 Dart::set_flow_graph_writer(function); |
| 4193 } | 4181 } |
| 4194 | 4182 |
| 4195 } // namespace dart | 4183 } // namespace dart |
| OLD | NEW |