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

Side by Side Diff: runtime/vm/kernel_binary.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 #if !defined(DART_PRECOMPILED_RUNTIME) 4 #if !defined(DART_PRECOMPILED_RUNTIME)
5 5
6 #include "platform/globals.h" 6 #include "platform/globals.h"
7 #include "vm/flags.h" 7 #include "vm/flags.h"
8 #include "vm/growable_array.h" 8 #include "vm/growable_array.h"
9 #include "vm/kernel.h" 9 #include "vm/kernel.h"
10 #include "vm/kernel_to_il.h" 10 #include "vm/kernel_to_il.h"
(...skipping 1861 matching lines...) Expand 10 before | Expand all | Expand 10 after
1872 CanonicalName* canonical_name = parent->AddChild(name); 1872 CanonicalName* canonical_name = parent->AddChild(name);
1873 reader->helper()->SetCanonicalName(i, canonical_name); 1873 reader->helper()->SetCanonicalName(i, canonical_name);
1874 } 1874 }
1875 1875
1876 int libraries = reader->ReadUInt(); 1876 int libraries = reader->ReadUInt();
1877 program->libraries().EnsureInitialized(libraries); 1877 program->libraries().EnsureInitialized(libraries);
1878 for (intptr_t i = 0; i < libraries; i++) { 1878 for (intptr_t i = 0; i < libraries; i++) {
1879 program->libraries().GetOrCreate<Library>(i)->ReadFrom(reader); 1879 program->libraries().GetOrCreate<Library>(i)->ReadFrom(reader);
1880 } 1880 }
1881 1881
1882 program->main_method_reference_ = Reference::ReadMemberFrom(reader); 1882 program->main_method_reference_ =
1883 Reference::ReadMemberFrom(reader, /*allow_null=*/true);
1883 1884
1884 return program; 1885 return program;
1885 } 1886 }
1886 1887
1887 1888
1888 FunctionNode* FunctionNode::ReadFrom(Reader* reader) { 1889 FunctionNode* FunctionNode::ReadFrom(Reader* reader) {
1889 TRACE_READ_OFFSET(); 1890 TRACE_READ_OFFSET();
1890 TypeParameterScope<ReaderHelper> scope(reader->helper()); 1891 TypeParameterScope<ReaderHelper> scope(reader->helper());
1891 1892
1892 FunctionNode* function = new FunctionNode(); 1893 FunctionNode* function = new FunctionNode();
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1925 1926
1926 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, 1927 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer,
1927 intptr_t buffer_length) { 1928 intptr_t buffer_length) {
1928 kernel::Reader reader(buffer, buffer_length); 1929 kernel::Reader reader(buffer, buffer_length);
1929 return kernel::Program::ReadFrom(&reader); 1930 return kernel::Program::ReadFrom(&reader);
1930 } 1931 }
1931 1932
1932 1933
1933 } // namespace dart 1934 } // namespace dart
1934 #endif // !defined(DART_PRECOMPILED_RUNTIME) 1935 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698