| 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 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1561 Dart_Handle state = Api::CheckAndFinalizePendingClasses(isolate); | 1561 Dart_Handle state = Api::CheckAndFinalizePendingClasses(isolate); |
| 1562 if (::Dart_IsError(state)) { | 1562 if (::Dart_IsError(state)) { |
| 1563 return state; | 1563 return state; |
| 1564 } | 1564 } |
| 1565 Library& lib = Library::Handle(isolate); | 1565 Library& lib = Library::Handle(isolate); |
| 1566 if (library == Dart_Null()) { | 1566 if (library == Dart_Null()) { |
| 1567 lib ^= isolate->object_store()->root_library(); | 1567 lib ^= isolate->object_store()->root_library(); |
| 1568 } else { | 1568 } else { |
| 1569 lib ^= Api::UnwrapHandle(library); | 1569 lib ^= Api::UnwrapHandle(library); |
| 1570 } | 1570 } |
| 1571 isolate->heap()->CollectAllGarbage(); |
| 1572 #if defined(DEBUG) |
| 1573 FunctionVisitor check_canonical(isolate); |
| 1574 isolate->heap()->IterateObjects(&check_canonical); |
| 1575 #endif // #if defined(DEBUG). |
| 1571 ScriptSnapshotWriter writer(buffer, ApiReallocate); | 1576 ScriptSnapshotWriter writer(buffer, ApiReallocate); |
| 1572 writer.WriteScriptSnapshot(lib); | 1577 writer.WriteScriptSnapshot(lib); |
| 1573 *size = writer.BytesWritten(); | 1578 *size = writer.BytesWritten(); |
| 1574 return Api::Success(); | 1579 return Api::Success(); |
| 1575 } | 1580 } |
| 1576 | 1581 |
| 1577 | 1582 |
| 1578 DART_EXPORT Dart_Handle Dart_CreateScriptSnapshot(uint8_t** buffer, | 1583 DART_EXPORT Dart_Handle Dart_CreateScriptSnapshot(uint8_t** buffer, |
| 1579 intptr_t* size) { | 1584 intptr_t* size) { |
| 1580 return createLibrarySnapshot(Dart_Null(), buffer, size); | 1585 return createLibrarySnapshot(Dart_Null(), buffer, size); |
| (...skipping 4279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5860 ASSERT(stream != NULL); | 5865 ASSERT(stream != NULL); |
| 5861 TimelineEvent* event = stream->StartEvent(); | 5866 TimelineEvent* event = stream->StartEvent(); |
| 5862 if (event != NULL) { | 5867 if (event != NULL) { |
| 5863 event->AsyncEnd(label, async_id); | 5868 event->AsyncEnd(label, async_id); |
| 5864 event->Complete(); | 5869 event->Complete(); |
| 5865 } | 5870 } |
| 5866 return Api::Success(); | 5871 return Api::Success(); |
| 5867 } | 5872 } |
| 5868 | 5873 |
| 5869 } // namespace dart | 5874 } // namespace dart |
| OLD | NEW |