| 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 | 4 |
| 5 #include "vm/kernel_binary_flowgraph.h" | 5 #include "vm/kernel_binary_flowgraph.h" |
| 6 | 6 |
| 7 #include "vm/compiler.h" | 7 #include "vm/compiler.h" |
| 8 #include "vm/longjump.h" | 8 #include "vm/longjump.h" |
| 9 #include "vm/object_store.h" | 9 #include "vm/object_store.h" |
| 10 | 10 |
| (...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 intptr_t list_length = builder_->ReadListLength(); // read list length. | 611 intptr_t list_length = builder_->ReadListLength(); // read list length. |
| 612 for (intptr_t i = 0; i < list_length; ++i) { | 612 for (intptr_t i = 0; i < list_length; ++i) { |
| 613 VisitExpression(); // read ith key. | 613 VisitExpression(); // read ith key. |
| 614 VisitExpression(); // read ith value. | 614 VisitExpression(); // read ith value. |
| 615 } | 615 } |
| 616 return; | 616 return; |
| 617 } | 617 } |
| 618 case kFunctionExpression: { | 618 case kFunctionExpression: { |
| 619 intptr_t offset = | 619 intptr_t offset = |
| 620 builder_->ReaderOffset() - 1; // -1 to include tag byte. | 620 builder_->ReaderOffset() - 1; // -1 to include tag byte. |
| 621 builder_->ReadPosition(); // read position. |
| 621 HandleLocalFunction(offset); // read function node. | 622 HandleLocalFunction(offset); // read function node. |
| 622 return; | 623 return; |
| 623 } | 624 } |
| 624 case kLet: { | 625 case kLet: { |
| 625 PositionScope scope(builder_->reader_); | 626 PositionScope scope(builder_->reader_); |
| 626 intptr_t offset = | 627 intptr_t offset = |
| 627 builder_->ReaderOffset() - 1; // -1 to include tag byte. | 628 builder_->ReaderOffset() - 1; // -1 to include tag byte. |
| 628 | 629 |
| 629 EnterScope(relative_kernel_offset_ + offset); | 630 EnterScope(relative_kernel_offset_ + offset); |
| 630 | 631 |
| (...skipping 3318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3949 SkipDartType(); // read key type. | 3950 SkipDartType(); // read key type. |
| 3950 SkipDartType(); // read value type. | 3951 SkipDartType(); // read value type. |
| 3951 intptr_t list_length = ReadListLength(); // read list length. | 3952 intptr_t list_length = ReadListLength(); // read list length. |
| 3952 for (intptr_t i = 0; i < list_length; ++i) { | 3953 for (intptr_t i = 0; i < list_length; ++i) { |
| 3953 SkipExpression(); // read ith key. | 3954 SkipExpression(); // read ith key. |
| 3954 SkipExpression(); // read ith value. | 3955 SkipExpression(); // read ith value. |
| 3955 } | 3956 } |
| 3956 return; | 3957 return; |
| 3957 } | 3958 } |
| 3958 case kFunctionExpression: | 3959 case kFunctionExpression: |
| 3960 ReadPosition(); // read position. |
| 3959 SkipFunctionNode(); // read function node. | 3961 SkipFunctionNode(); // read function node. |
| 3960 return; | 3962 return; |
| 3961 case kLet: | 3963 case kLet: |
| 3962 SkipVariableDeclaration(); // read variable declaration. | 3964 SkipVariableDeclaration(); // read variable declaration. |
| 3963 SkipExpression(); // read expression. | 3965 SkipExpression(); // read expression. |
| 3964 return; | 3966 return; |
| 3965 case kVectorCreation: | 3967 case kVectorCreation: |
| 3966 ReadUInt(); // read value. | 3968 ReadUInt(); // read value. |
| 3967 return; | 3969 return; |
| 3968 case kVectorGet: | 3970 case kVectorGet: |
| (...skipping 1762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5731 const dart::Class& map_class = | 5733 const dart::Class& map_class = |
| 5732 dart::Class::Handle(Z, dart::Library::LookupCoreClass(Symbols::Map())); | 5734 dart::Class::Handle(Z, dart::Library::LookupCoreClass(Symbols::Map())); |
| 5733 const Function& factory_method = Function::ZoneHandle( | 5735 const Function& factory_method = Function::ZoneHandle( |
| 5734 Z, map_class.LookupFactory( | 5736 Z, map_class.LookupFactory( |
| 5735 dart::Library::PrivateCoreLibName(Symbols::MapLiteralFactory()))); | 5737 dart::Library::PrivateCoreLibName(Symbols::MapLiteralFactory()))); |
| 5736 | 5738 |
| 5737 return instructions + StaticCall(position, factory_method, 2); | 5739 return instructions + StaticCall(position, factory_method, 2); |
| 5738 } | 5740 } |
| 5739 | 5741 |
| 5740 Fragment StreamingFlowGraphBuilder::BuildFunctionExpression() { | 5742 Fragment StreamingFlowGraphBuilder::BuildFunctionExpression() { |
| 5743 ReadPosition(); // read position. |
| 5741 return BuildFunctionNode(TokenPosition::kNoSource, StringIndex()); | 5744 return BuildFunctionNode(TokenPosition::kNoSource, StringIndex()); |
| 5742 } | 5745 } |
| 5743 | 5746 |
| 5744 Fragment StreamingFlowGraphBuilder::BuildLet(TokenPosition* position) { | 5747 Fragment StreamingFlowGraphBuilder::BuildLet(TokenPosition* position) { |
| 5745 if (position != NULL) *position = TokenPosition::kNoSource; | 5748 if (position != NULL) *position = TokenPosition::kNoSource; |
| 5746 | 5749 |
| 5747 Fragment instructions = BuildVariableDeclaration(); // read variable. | 5750 Fragment instructions = BuildVariableDeclaration(); // read variable. |
| 5748 instructions += BuildExpression(); // read body. | 5751 instructions += BuildExpression(); // read body. |
| 5749 return instructions; | 5752 return instructions; |
| 5750 } | 5753 } |
| (...skipping 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7280 } | 7283 } |
| 7281 } | 7284 } |
| 7282 | 7285 |
| 7283 return Array::Handle(Array::null()); | 7286 return Array::Handle(Array::null()); |
| 7284 } | 7287 } |
| 7285 | 7288 |
| 7286 } // namespace kernel | 7289 } // namespace kernel |
| 7287 } // namespace dart | 7290 } // namespace dart |
| 7288 | 7291 |
| 7289 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 7292 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
| OLD | NEW |