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 "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 1543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1554 } | 1554 } |
1555 | 1555 |
1556 | 1556 |
1557 ForInStatement* ForInStatement::ReadFrom(Reader* reader, bool is_async) { | 1557 ForInStatement* ForInStatement::ReadFrom(Reader* reader, bool is_async) { |
1558 TRACE_READ_OFFSET(); | 1558 TRACE_READ_OFFSET(); |
1559 VariableScope<ReaderHelper> vars(reader->helper()); | 1559 VariableScope<ReaderHelper> vars(reader->helper()); |
1560 PositionScope scope(reader); | 1560 PositionScope scope(reader); |
1561 | 1561 |
1562 ForInStatement* forinstmt = new ForInStatement(); | 1562 ForInStatement* forinstmt = new ForInStatement(); |
1563 forinstmt->is_async_ = is_async; | 1563 forinstmt->is_async_ = is_async; |
| 1564 forinstmt->position_ = reader->ReadPosition(); |
1564 forinstmt->variable_ = VariableDeclaration::ReadFromImpl(reader); | 1565 forinstmt->variable_ = VariableDeclaration::ReadFromImpl(reader); |
1565 forinstmt->iterable_ = Expression::ReadFrom(reader); | 1566 forinstmt->iterable_ = Expression::ReadFrom(reader); |
1566 forinstmt->body_ = Statement::ReadFrom(reader); | 1567 forinstmt->body_ = Statement::ReadFrom(reader); |
1567 forinstmt->end_position_ = reader->max_position(); | 1568 forinstmt->end_position_ = reader->max_position(); |
1568 forinstmt->position_ = reader->min_position(); | 1569 if (!forinstmt->position_.IsReal()) { |
| 1570 forinstmt->position_ = reader->min_position(); |
| 1571 } |
| 1572 forinstmt->variable_->set_end_position(forinstmt->position_); |
1569 | 1573 |
1570 return forinstmt; | 1574 return forinstmt; |
1571 } | 1575 } |
1572 | 1576 |
1573 | 1577 |
1574 SwitchStatement* SwitchStatement::ReadFrom(Reader* reader) { | 1578 SwitchStatement* SwitchStatement::ReadFrom(Reader* reader) { |
1575 TRACE_READ_OFFSET(); | 1579 TRACE_READ_OFFSET(); |
1576 SwitchCaseScope<ReaderHelper> scope(reader->helper()); | 1580 SwitchCaseScope<ReaderHelper> scope(reader->helper()); |
1577 SwitchStatement* stmt = new SwitchStatement(); | 1581 SwitchStatement* stmt = new SwitchStatement(); |
1578 stmt->condition_ = Expression::ReadFrom(reader); | 1582 stmt->condition_ = Expression::ReadFrom(reader); |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1932 | 1936 |
1933 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, | 1937 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, |
1934 intptr_t buffer_length) { | 1938 intptr_t buffer_length) { |
1935 kernel::Reader reader(buffer, buffer_length); | 1939 kernel::Reader reader(buffer, buffer_length); |
1936 return kernel::Program::ReadFrom(&reader); | 1940 return kernel::Program::ReadFrom(&reader); |
1937 } | 1941 } |
1938 | 1942 |
1939 | 1943 |
1940 } // namespace dart | 1944 } // namespace dart |
1941 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 1945 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
OLD | NEW |