| 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 4031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4042 Isolate* isolate = Isolate::Current(); | 4042 Isolate* isolate = Isolate::Current(); |
| 4043 DARTSCOPE(isolate); | 4043 DARTSCOPE(isolate); |
| 4044 const Library& library_vm = Api::UnwrapLibraryHandle(isolate, library); | 4044 const Library& library_vm = Api::UnwrapLibraryHandle(isolate, library); |
| 4045 if (library_vm.IsNull()) { | 4045 if (library_vm.IsNull()) { |
| 4046 RETURN_TYPE_ERROR(isolate, library, Library); | 4046 RETURN_TYPE_ERROR(isolate, library, Library); |
| 4047 } | 4047 } |
| 4048 const Library& import_vm = Api::UnwrapLibraryHandle(isolate, import); | 4048 const Library& import_vm = Api::UnwrapLibraryHandle(isolate, import); |
| 4049 if (import_vm.IsNull()) { | 4049 if (import_vm.IsNull()) { |
| 4050 RETURN_TYPE_ERROR(isolate, import, Library); | 4050 RETURN_TYPE_ERROR(isolate, import, Library); |
| 4051 } | 4051 } |
| 4052 const String& prefix_vm = Dart_IsNull(prefix) | 4052 const Object& prefix_object = |
| 4053 Object::Handle(isolate, Api::UnwrapHandle(prefix)); |
| 4054 const String& prefix_vm = prefix_object.IsNull() |
| 4053 ? String::Handle(isolate, Symbols::New("")) | 4055 ? String::Handle(isolate, Symbols::New("")) |
| 4054 : Api::UnwrapStringHandle(isolate, prefix); | 4056 : String::Cast(prefix_object); |
| 4055 if (prefix_vm.IsNull()) { | 4057 if (prefix_vm.IsNull()) { |
| 4056 RETURN_TYPE_ERROR(isolate, prefix, String); | 4058 RETURN_TYPE_ERROR(isolate, prefix, String); |
| 4057 } | 4059 } |
| 4058 const String& prefix_symbol = | 4060 const String& prefix_symbol = |
| 4059 String::Handle(isolate, Symbols::New(prefix_vm)); | 4061 String::Handle(isolate, Symbols::New(prefix_vm)); |
| 4060 if (prefix_vm.Length() == 0) { | 4062 if (prefix_vm.Length() == 0) { |
| 4061 library_vm.AddImport(import_vm); | 4063 library_vm.AddImport(import_vm); |
| 4062 } else { | 4064 } else { |
| 4063 LibraryPrefix& library_prefix = LibraryPrefix::Handle(); | 4065 LibraryPrefix& library_prefix = LibraryPrefix::Handle(); |
| 4064 library_prefix = library_vm.LookupLocalLibraryPrefix(prefix_symbol); | 4066 library_prefix = library_vm.LookupLocalLibraryPrefix(prefix_symbol); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4151 DART_EXPORT void Dart_InitPerfEventsSupport(Dart_FileWriterFunction function) { | 4153 DART_EXPORT void Dart_InitPerfEventsSupport(Dart_FileWriterFunction function) { |
| 4152 Dart::set_perf_events_writer(function); | 4154 Dart::set_perf_events_writer(function); |
| 4153 } | 4155 } |
| 4154 | 4156 |
| 4155 | 4157 |
| 4156 DART_EXPORT void Dart_InitFlowGraphPrinting(Dart_FileWriterFunction function) { | 4158 DART_EXPORT void Dart_InitFlowGraphPrinting(Dart_FileWriterFunction function) { |
| 4157 Dart::set_flow_graph_writer(function); | 4159 Dart::set_flow_graph_writer(function); |
| 4158 } | 4160 } |
| 4159 | 4161 |
| 4160 } // namespace dart | 4162 } // namespace dart |
| OLD | NEW |