| 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_native_api.h" | 5 #include "include/dart_native_api.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/dart_api_impl.h" | 8 #include "vm/dart_api_impl.h" |
| 9 #include "vm/dart_api_message.h" | 9 #include "vm/dart_api_message.h" |
| 10 #include "vm/dart_api_state.h" | 10 #include "vm/dart_api_state.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 IsolateSaver saver(Isolate::Current()); | 62 IsolateSaver saver(Isolate::Current()); |
| 63 Thread::ExitIsolate(); | 63 Thread::ExitIsolate(); |
| 64 | 64 |
| 65 // TODO(turnidge): Check that the port is native before trying to close. | 65 // TODO(turnidge): Check that the port is native before trying to close. |
| 66 return PortMap::ClosePort(native_port_id); | 66 return PortMap::ClosePort(native_port_id); |
| 67 } | 67 } |
| 68 | 68 |
| 69 | 69 |
| 70 // --- Verification tools --- | 70 // --- Verification tools --- |
| 71 | 71 |
| 72 static void CompileAll(Isolate* isolate, Dart_Handle* result) { | 72 static void CompileAll(Thread* thread, Dart_Handle* result) { |
| 73 ASSERT(isolate != NULL); | 73 ASSERT(thread != NULL); |
| 74 const Error& error = | 74 const Error& error = Error::Handle(thread->zone(), Library::CompileAll()); |
| 75 Error::Handle(isolate->current_zone(), Library::CompileAll()); | |
| 76 if (error.IsNull()) { | 75 if (error.IsNull()) { |
| 77 *result = Api::Success(); | 76 *result = Api::Success(); |
| 78 } else { | 77 } else { |
| 79 *result = Api::NewHandle(isolate, error.raw()); | 78 *result = Api::NewHandle(thread->isolate(), error.raw()); |
| 80 } | 79 } |
| 81 } | 80 } |
| 82 | 81 |
| 83 | 82 |
| 84 DART_EXPORT Dart_Handle Dart_CompileAll() { | 83 DART_EXPORT Dart_Handle Dart_CompileAll() { |
| 85 DARTSCOPE(Thread::Current()); | 84 DARTSCOPE(Thread::Current()); |
| 86 Dart_Handle result = Api::CheckAndFinalizePendingClasses(I); | 85 Dart_Handle result = Api::CheckAndFinalizePendingClasses(I); |
| 87 if (::Dart_IsError(result)) { | 86 if (::Dart_IsError(result)) { |
| 88 return result; | 87 return result; |
| 89 } | 88 } |
| 90 CHECK_CALLBACK_STATE(T); | 89 CHECK_CALLBACK_STATE(T); |
| 91 CompileAll(I, &result); | 90 CompileAll(T, &result); |
| 92 return result; | 91 return result; |
| 93 } | 92 } |
| 94 | 93 |
| 95 } // namespace dart | 94 } // namespace dart |
| OLD | NEW |