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 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1592 SwitchCase* sc = stmt->cases_[i]; | 1592 SwitchCase* sc = stmt->cases_[i]; |
1593 sc->ReadFrom(reader); | 1593 sc->ReadFrom(reader); |
1594 } | 1594 } |
1595 return stmt; | 1595 return stmt; |
1596 } | 1596 } |
1597 | 1597 |
1598 | 1598 |
1599 SwitchCase* SwitchCase::ReadFrom(Reader* reader) { | 1599 SwitchCase* SwitchCase::ReadFrom(Reader* reader) { |
1600 TRACE_READ_OFFSET(); | 1600 TRACE_READ_OFFSET(); |
1601 expressions_.ReadFromStatic<Expression>(reader); | 1601 expressions_.ReadFromStatic<Expression>(reader); |
| 1602 for (intptr_t i = 0; i < expressions_.length(); ++i) { |
| 1603 expressions_[i]->set_position(reader->ReadPosition()); |
| 1604 } |
1602 is_default_ = reader->ReadBool(); | 1605 is_default_ = reader->ReadBool(); |
1603 body_ = Statement::ReadFrom(reader); | 1606 body_ = Statement::ReadFrom(reader); |
1604 return this; | 1607 return this; |
1605 } | 1608 } |
1606 | 1609 |
1607 | 1610 |
1608 ContinueSwitchStatement* ContinueSwitchStatement::ReadFrom(Reader* reader) { | 1611 ContinueSwitchStatement* ContinueSwitchStatement::ReadFrom(Reader* reader) { |
1609 TRACE_READ_OFFSET(); | 1612 TRACE_READ_OFFSET(); |
1610 ContinueSwitchStatement* stmt = new ContinueSwitchStatement(); | 1613 ContinueSwitchStatement* stmt = new ContinueSwitchStatement(); |
1611 stmt->target_ = reader->helper()->switch_cases().Lookup(reader->ReadUInt()); | 1614 stmt->target_ = reader->helper()->switch_cases().Lookup(reader->ReadUInt()); |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1936 | 1939 |
1937 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, | 1940 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, |
1938 intptr_t buffer_length) { | 1941 intptr_t buffer_length) { |
1939 kernel::Reader reader(buffer, buffer_length); | 1942 kernel::Reader reader(buffer, buffer_length); |
1940 return kernel::Program::ReadFrom(&reader); | 1943 return kernel::Program::ReadFrom(&reader); |
1941 } | 1944 } |
1942 | 1945 |
1943 | 1946 |
1944 } // namespace dart | 1947 } // namespace dart |
1945 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 1948 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
OLD | NEW |