Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(475)

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 1844553003: Add API timeline durations for snapshot creation (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "lib/stacktrace.h" 10 #include "lib/stacktrace.h"
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1459 } 1459 }
1460 1460
1461 1461
1462 DART_EXPORT Dart_Handle Dart_CreateSnapshot( 1462 DART_EXPORT Dart_Handle Dart_CreateSnapshot(
1463 uint8_t** vm_isolate_snapshot_buffer, 1463 uint8_t** vm_isolate_snapshot_buffer,
1464 intptr_t* vm_isolate_snapshot_size, 1464 intptr_t* vm_isolate_snapshot_size,
1465 uint8_t** isolate_snapshot_buffer, 1465 uint8_t** isolate_snapshot_buffer,
1466 intptr_t* isolate_snapshot_size) { 1466 intptr_t* isolate_snapshot_size) {
1467 ASSERT(FLAG_load_deferred_eagerly); 1467 ASSERT(FLAG_load_deferred_eagerly);
1468 DARTSCOPE(Thread::Current()); 1468 DARTSCOPE(Thread::Current());
1469 API_TIMELINE_DURATION;
1469 Isolate* I = T->isolate(); 1470 Isolate* I = T->isolate();
1470 if (vm_isolate_snapshot_buffer != NULL && 1471 if (vm_isolate_snapshot_buffer != NULL &&
1471 vm_isolate_snapshot_size == NULL) { 1472 vm_isolate_snapshot_size == NULL) {
1472 RETURN_NULL_ERROR(vm_isolate_snapshot_size); 1473 RETURN_NULL_ERROR(vm_isolate_snapshot_size);
1473 } 1474 }
1474 if (isolate_snapshot_buffer == NULL) { 1475 if (isolate_snapshot_buffer == NULL) {
1475 RETURN_NULL_ERROR(isolate_snapshot_buffer); 1476 RETURN_NULL_ERROR(isolate_snapshot_buffer);
1476 } 1477 }
1477 if (isolate_snapshot_size == NULL) { 1478 if (isolate_snapshot_size == NULL) {
1478 RETURN_NULL_ERROR(isolate_snapshot_size); 1479 RETURN_NULL_ERROR(isolate_snapshot_size);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1530 #endif // #if defined(DEBUG). 1531 #endif // #if defined(DEBUG).
1531 ScriptSnapshotWriter writer(buffer, ApiReallocate); 1532 ScriptSnapshotWriter writer(buffer, ApiReallocate);
1532 writer.WriteScriptSnapshot(lib); 1533 writer.WriteScriptSnapshot(lib);
1533 *size = writer.BytesWritten(); 1534 *size = writer.BytesWritten();
1534 return Api::Success(); 1535 return Api::Success();
1535 } 1536 }
1536 1537
1537 1538
1538 DART_EXPORT Dart_Handle Dart_CreateScriptSnapshot(uint8_t** buffer, 1539 DART_EXPORT Dart_Handle Dart_CreateScriptSnapshot(uint8_t** buffer,
1539 intptr_t* size) { 1540 intptr_t* size) {
1541 API_TIMELINE_DURATION;
1540 return createLibrarySnapshot(Dart_Null(), buffer, size); 1542 return createLibrarySnapshot(Dart_Null(), buffer, size);
1541 } 1543 }
1542 1544
1543 1545
1544 DART_EXPORT Dart_Handle Dart_CreateLibrarySnapshot(Dart_Handle library, 1546 DART_EXPORT Dart_Handle Dart_CreateLibrarySnapshot(Dart_Handle library,
1545 uint8_t** buffer, 1547 uint8_t** buffer,
1546 intptr_t* size) { 1548 intptr_t* size) {
1549 API_TIMELINE_DURATION;
1547 return createLibrarySnapshot(library, buffer, size); 1550 return createLibrarySnapshot(library, buffer, size);
1548 } 1551 }
1549 1552
1550 1553
1551 DART_EXPORT void Dart_InterruptIsolate(Dart_Isolate isolate) { 1554 DART_EXPORT void Dart_InterruptIsolate(Dart_Isolate isolate) {
1552 if (isolate == NULL) { 1555 if (isolate == NULL) {
1553 FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC); 1556 FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC);
1554 } 1557 }
1555 // TODO(16615): Validate isolate parameter. 1558 // TODO(16615): Validate isolate parameter.
1556 Isolate* iso = reinterpret_cast<Isolate*>(isolate); 1559 Isolate* iso = reinterpret_cast<Isolate*>(isolate);
(...skipping 4639 matching lines...) Expand 10 before | Expand all | Expand 10 after
6196 return Api::Success(); 6199 return Api::Success();
6197 } 6200 }
6198 #endif // DART_PRECOMPILER 6201 #endif // DART_PRECOMPILER
6199 6202
6200 6203
6201 DART_EXPORT bool Dart_IsRunningPrecompiledCode() { 6204 DART_EXPORT bool Dart_IsRunningPrecompiledCode() {
6202 return Dart::IsRunningPrecompiledCode(); 6205 return Dart::IsRunningPrecompiledCode();
6203 } 6206 }
6204 6207
6205 } // namespace dart 6208 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698