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/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
(...skipping 5932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5943 TimelineEvent* event = stream->StartEvent(); | 5943 TimelineEvent* event = stream->StartEvent(); |
5944 if (event != NULL) { | 5944 if (event != NULL) { |
5945 event->AsyncEnd(label, async_id); | 5945 event->AsyncEnd(label, async_id); |
5946 event->Complete(); | 5946 event->Complete(); |
5947 } | 5947 } |
5948 return Api::Success(); | 5948 return Api::Success(); |
5949 } | 5949 } |
5950 | 5950 |
5951 | 5951 |
5952 DART_EXPORT Dart_Handle Dart_Precompile( | 5952 DART_EXPORT Dart_Handle Dart_Precompile( |
5953 Dart_QualifiedFunctionName entry_points[]) { | 5953 Dart_QualifiedFunctionName entry_points[], |
| 5954 bool reset_fields) { |
5954 DARTSCOPE(Thread::Current()); | 5955 DARTSCOPE(Thread::Current()); |
5955 Dart_Handle result = Api::CheckAndFinalizePendingClasses(I); | 5956 Dart_Handle result = Api::CheckAndFinalizePendingClasses(I); |
5956 if (::Dart_IsError(result)) { | 5957 if (::Dart_IsError(result)) { |
5957 return result; | 5958 return result; |
5958 } | 5959 } |
5959 CHECK_CALLBACK_STATE(I); | 5960 CHECK_CALLBACK_STATE(I); |
5960 const Error& error = Error::Handle(Precompiler::CompileAll(entry_points)); | 5961 const Error& error = Error::Handle(Precompiler::CompileAll(entry_points, |
| 5962 reset_fields)); |
5961 if (!error.IsNull()) { | 5963 if (!error.IsNull()) { |
5962 return Api::NewHandle(I, error.raw()); | 5964 return Api::NewHandle(I, error.raw()); |
5963 } | 5965 } |
5964 return Api::Success(); | 5966 return Api::Success(); |
5965 } | 5967 } |
5966 | 5968 |
5967 | 5969 |
5968 DART_EXPORT Dart_Handle Dart_CreatePrecompiledSnapshot( | 5970 DART_EXPORT Dart_Handle Dart_CreatePrecompiledSnapshot( |
5969 uint8_t** vm_isolate_snapshot_buffer, | 5971 uint8_t** vm_isolate_snapshot_buffer, |
5970 intptr_t* vm_isolate_snapshot_size, | 5972 intptr_t* vm_isolate_snapshot_size, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6004 ApiReallocate); | 6006 ApiReallocate); |
6005 writer.WriteFullSnapshot(); | 6007 writer.WriteFullSnapshot(); |
6006 *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize(); | 6008 *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize(); |
6007 *isolate_snapshot_size = writer.IsolateSnapshotSize(); | 6009 *isolate_snapshot_size = writer.IsolateSnapshotSize(); |
6008 *instructions_snapshot_size = writer.InstructionsSnapshotSize(); | 6010 *instructions_snapshot_size = writer.InstructionsSnapshotSize(); |
6009 | 6011 |
6010 return Api::Success(); | 6012 return Api::Success(); |
6011 } | 6013 } |
6012 | 6014 |
6013 } // namespace dart | 6015 } // namespace dart |
OLD | NEW |