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

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

Issue 2786083002: Read platform.dill in the VM. (Closed)
Patch Set: Allow main to be a field or getter. Created 3 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
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 5389 matching lines...) Expand 10 before | Expand all | Expand 10 after
5400 5400
5401 // NOTE: Now the VM owns the [kernel_program] memory! Currently we do not 5401 // NOTE: Now the VM owns the [kernel_program] memory! Currently we do not
5402 // free it because (similar to the token stream) it will be used to repeatedly 5402 // free it because (similar to the token stream) it will be used to repeatedly
5403 // run the `kernel::FlowGraphBuilder()`. 5403 // run the `kernel::FlowGraphBuilder()`.
5404 kernel::KernelReader reader( 5404 kernel::KernelReader reader(
5405 reinterpret_cast<kernel::Program*>(kernel_program)); 5405 reinterpret_cast<kernel::Program*>(kernel_program));
5406 const Object& tmp = reader.ReadProgram(); 5406 const Object& tmp = reader.ReadProgram();
5407 if (tmp.IsError()) { 5407 if (tmp.IsError()) {
5408 return Api::NewHandle(T, tmp.raw()); 5408 return Api::NewHandle(T, tmp.raw());
5409 } 5409 }
5410 if (tmp.IsNull()) {
5411 return Api::NewError("%s: The binary program does not contain 'main'.",
5412 CURRENT_FUNC);
5413 }
5410 library ^= tmp.raw(); 5414 library ^= tmp.raw();
5411 I->object_store()->set_root_library(library); 5415 I->object_store()->set_root_library(library);
5412 return Api::NewHandle(T, library.raw()); 5416 return Api::NewHandle(T, library.raw());
5413 #endif 5417 #endif
5414 } 5418 }
5415 5419
5416 5420
5417 DART_EXPORT Dart_Handle Dart_RootLibrary() { 5421 DART_EXPORT Dart_Handle Dart_RootLibrary() {
5418 Thread* thread = Thread::Current(); 5422 Thread* thread = Thread::Current();
5419 Isolate* isolate = thread->isolate(); 5423 Isolate* isolate = thread->isolate();
(...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after
6832 } 6836 }
6833 6837
6834 6838
6835 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { 6839 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) {
6836 #ifndef PRODUCT 6840 #ifndef PRODUCT
6837 Profiler::DumpStackTrace(context); 6841 Profiler::DumpStackTrace(context);
6838 #endif 6842 #endif
6839 } 6843 }
6840 6844
6841 } // namespace dart 6845 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698