OLD | NEW |
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 "vm/kernel_binary.h" | 6 #include "vm/kernel_binary.h" |
7 #include "platform/globals.h" | 7 #include "platform/globals.h" |
8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
10 #include "vm/kernel.h" | 10 #include "vm/kernel.h" |
(...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1526 CanonicalName* canonical_name = parent->AddChild(name); | 1526 CanonicalName* canonical_name = parent->AddChild(name); |
1527 reader->helper()->SetCanonicalName(i, canonical_name); | 1527 reader->helper()->SetCanonicalName(i, canonical_name); |
1528 } | 1528 } |
1529 | 1529 |
1530 int libraries = reader->ReadUInt(); | 1530 int libraries = reader->ReadUInt(); |
1531 program->libraries().EnsureInitialized(libraries); | 1531 program->libraries().EnsureInitialized(libraries); |
1532 for (intptr_t i = 0; i < libraries; i++) { | 1532 for (intptr_t i = 0; i < libraries; i++) { |
1533 program->libraries().GetOrCreate<Library>(i)->ReadFrom(reader); | 1533 program->libraries().GetOrCreate<Library>(i)->ReadFrom(reader); |
1534 } | 1534 } |
1535 | 1535 |
1536 program->main_method_reference_ = Reference::ReadMemberFrom(reader); | 1536 program->main_method_reference_ = |
| 1537 Reference::ReadMemberFrom(reader, /*allow_null=*/true); |
1537 | 1538 |
1538 return program; | 1539 return program; |
1539 } | 1540 } |
1540 | 1541 |
1541 | 1542 |
1542 FunctionNode* FunctionNode::ReadFrom(Reader* reader) { | 1543 FunctionNode* FunctionNode::ReadFrom(Reader* reader) { |
1543 TRACE_READ_OFFSET(); | 1544 TRACE_READ_OFFSET(); |
1544 TypeParameterScope<ReaderHelper> scope(reader->helper()); | 1545 TypeParameterScope<ReaderHelper> scope(reader->helper()); |
1545 | 1546 |
1546 FunctionNode* function = new FunctionNode(); | 1547 FunctionNode* function = new FunctionNode(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1579 | 1580 |
1580 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, | 1581 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, |
1581 intptr_t buffer_length) { | 1582 intptr_t buffer_length) { |
1582 kernel::Reader reader(buffer, buffer_length); | 1583 kernel::Reader reader(buffer, buffer_length); |
1583 return kernel::Program::ReadFrom(&reader); | 1584 return kernel::Program::ReadFrom(&reader); |
1584 } | 1585 } |
1585 | 1586 |
1586 | 1587 |
1587 } // namespace dart | 1588 } // namespace dart |
1588 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 1589 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
OLD | NEW |