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

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

Issue 2987213002: [vm] Add Dart_CreateVMAOTSnapshotAsAssembly. (Closed)
Patch Set: . Created 3 years, 4 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 | « runtime/vm/clustered_snapshot.cc ('k') | 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 "lib/stacktrace.h" 9 #include "lib/stacktrace.h"
10 #include "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 6547 matching lines...) Expand 10 before | Expand all | Expand 10 after
6558 6558
6559 writer.WriteFullSnapshot(); 6559 writer.WriteFullSnapshot();
6560 image_writer.Finalize(); 6560 image_writer.Finalize();
6561 *assembly_size = image_writer.AssemblySize(); 6561 *assembly_size = image_writer.AssemblySize();
6562 6562
6563 return Api::Success(); 6563 return Api::Success();
6564 #endif 6564 #endif
6565 } 6565 }
6566 6566
6567 DART_EXPORT Dart_Handle 6567 DART_EXPORT Dart_Handle
6568 Dart_CreateVMAOTSnapshotAsAssembly(uint8_t** assembly_buffer,
6569 intptr_t* assembly_size) {
6570 #if defined(TARGET_ARCH_IA32)
6571 return Api::NewError("AOT compilation is not supported on IA32.");
6572 #elif defined(TARGET_ARCH_DBC)
6573 return Api::NewError("AOT compilation is not supported on DBC.");
6574 #elif !defined(DART_PRECOMPILER)
6575 return Api::NewError(
6576 "This VM was built without support for AOT compilation.");
6577 #else
6578 API_TIMELINE_DURATION;
6579 DARTSCOPE(Thread::Current());
6580 CHECK_NULL(assembly_buffer);
6581 CHECK_NULL(assembly_size);
6582
6583 NOT_IN_PRODUCT(TimelineDurationScope tds2(T, Timeline::GetIsolateStream(),
6584 "WriteVMAOTSnapshot"));
6585 AssemblyImageWriter image_writer(assembly_buffer, ApiReallocate,
6586 2 * MB /* initial_size */);
6587 uint8_t* vm_snapshot_data_buffer = NULL;
6588 FullSnapshotWriter writer(Snapshot::kFullAOT, &vm_snapshot_data_buffer, NULL,
6589 ApiReallocate, &image_writer, NULL);
6590
6591 writer.WriteFullSnapshot();
6592 *assembly_size = image_writer.AssemblySize();
6593
6594 return Api::Success();
6595 #endif
6596 }
6597
6598 DART_EXPORT Dart_Handle
6568 Dart_CreateAppAOTSnapshotAsBlobs(uint8_t** vm_snapshot_data_buffer, 6599 Dart_CreateAppAOTSnapshotAsBlobs(uint8_t** vm_snapshot_data_buffer,
6569 intptr_t* vm_snapshot_data_size, 6600 intptr_t* vm_snapshot_data_size,
6570 uint8_t** vm_snapshot_instructions_buffer, 6601 uint8_t** vm_snapshot_instructions_buffer,
6571 intptr_t* vm_snapshot_instructions_size, 6602 intptr_t* vm_snapshot_instructions_size,
6572 uint8_t** isolate_snapshot_data_buffer, 6603 uint8_t** isolate_snapshot_data_buffer,
6573 intptr_t* isolate_snapshot_data_size, 6604 intptr_t* isolate_snapshot_data_size,
6574 uint8_t** isolate_snapshot_instructions_buffer, 6605 uint8_t** isolate_snapshot_instructions_buffer,
6575 intptr_t* isolate_snapshot_instructions_size) { 6606 intptr_t* isolate_snapshot_instructions_size) {
6576 #if defined(TARGET_ARCH_IA32) 6607 #if defined(TARGET_ARCH_IA32)
6577 return Api::NewError("AOT compilation is not supported on IA32."); 6608 return Api::NewError("AOT compilation is not supported on IA32.");
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
6746 #endif 6777 #endif
6747 } 6778 }
6748 6779
6749 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { 6780 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) {
6750 #ifndef PRODUCT 6781 #ifndef PRODUCT
6751 Profiler::DumpStackTrace(context); 6782 Profiler::DumpStackTrace(context);
6752 #endif 6783 #endif
6753 } 6784 }
6754 6785
6755 } // namespace dart 6786 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/clustered_snapshot.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698