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 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1313 stmt->kernel_offset_ = reader->offset() - 1; // -1 to include tag byte. | 1313 stmt->kernel_offset_ = reader->offset() - 1; // -1 to include tag byte. |
1314 return stmt; | 1314 return stmt; |
1315 } | 1315 } |
1316 | 1316 |
1317 | 1317 |
1318 AssertStatement* AssertStatement::ReadFrom(Reader* reader) { | 1318 AssertStatement* AssertStatement::ReadFrom(Reader* reader) { |
1319 TRACE_READ_OFFSET(); | 1319 TRACE_READ_OFFSET(); |
1320 AssertStatement* stmt = new AssertStatement(); | 1320 AssertStatement* stmt = new AssertStatement(); |
1321 stmt->kernel_offset_ = reader->offset() - 1; // -1 to include tag byte. | 1321 stmt->kernel_offset_ = reader->offset() - 1; // -1 to include tag byte. |
1322 stmt->condition_ = Expression::ReadFrom(reader); | 1322 stmt->condition_ = Expression::ReadFrom(reader); |
| 1323 reader->ReadPosition(); // condition start offset. |
| 1324 reader->ReadPosition(); // condition end offset. |
1323 stmt->message_ = reader->ReadOptional<Expression>(); | 1325 stmt->message_ = reader->ReadOptional<Expression>(); |
1324 | 1326 |
1325 stmt->can_stream_ = stmt->condition_->can_stream() && | 1327 stmt->can_stream_ = stmt->condition_->can_stream() && |
1326 (stmt->message_ == NULL || stmt->message_->can_stream()); | 1328 (stmt->message_ == NULL || stmt->message_->can_stream()); |
1327 | 1329 |
1328 return stmt; | 1330 return stmt; |
1329 } | 1331 } |
1330 | 1332 |
1331 | 1333 |
1332 LabeledStatement* LabeledStatement::ReadFrom(Reader* reader) { | 1334 LabeledStatement* LabeledStatement::ReadFrom(Reader* reader) { |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1879 | 1881 |
1880 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, | 1882 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, |
1881 intptr_t buffer_length) { | 1883 intptr_t buffer_length) { |
1882 kernel::Reader reader(buffer, buffer_length); | 1884 kernel::Reader reader(buffer, buffer_length); |
1883 return kernel::Program::ReadFrom(&reader); | 1885 return kernel::Program::ReadFrom(&reader); |
1884 } | 1886 } |
1885 | 1887 |
1886 | 1888 |
1887 } // namespace dart | 1889 } // namespace dart |
1888 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 1890 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
OLD | NEW |