Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: runtime/vm/kernel_binary_flowgraph.h

Issue 2991993002: Reapply 47ecf72 after it was reverted in e431e93e872d9a1c97a5177ebb09d5416f1d659a. (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/kernel/lib/binary/ast_to_binary.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 #ifndef RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_ 5 #ifndef RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_
6 #define RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_ 6 #define RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_
7 7
8 #if !defined(DART_PRECOMPILED_RUNTIME) 8 #if !defined(DART_PRECOMPILED_RUNTIME)
9 9
10 #include <map> 10 #include <map>
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 public: 853 public:
854 enum Fields { 854 enum Fields {
855 kStart, // tag. 855 kStart, // tag.
856 kCanonicalName, 856 kCanonicalName,
857 kPosition, 857 kPosition,
858 kEndPosition, 858 kEndPosition,
859 kFlags, 859 kFlags,
860 kParentClassBinaryOffset, 860 kParentClassBinaryOffset,
861 kName, 861 kName,
862 kSourceUriIndex, 862 kSourceUriIndex,
863 kDocumentationCommentIndex,
863 kAnnotations, 864 kAnnotations,
864 kType, 865 kType,
865 kInitializer, 866 kInitializer,
866 kEnd 867 kEnd
867 }; 868 };
868 869
869 explicit FieldHelper(StreamingFlowGraphBuilder* builder) 870 explicit FieldHelper(StreamingFlowGraphBuilder* builder)
870 : builder_(builder), 871 : builder_(builder),
871 next_read_(kStart), 872 next_read_(kStart),
872 has_function_literal_initializer_(false) {} 873 has_function_literal_initializer_(false) {}
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 if (++next_read_ == field) return; 913 if (++next_read_ == field) return;
913 case kName: 914 case kName:
914 builder_->SkipName(); // read name. 915 builder_->SkipName(); // read name.
915 if (++next_read_ == field) return; 916 if (++next_read_ == field) return;
916 case kSourceUriIndex: 917 case kSourceUriIndex:
917 source_uri_index_ = builder_->ReadUInt(); // read source_uri_index. 918 source_uri_index_ = builder_->ReadUInt(); // read source_uri_index.
918 builder_->current_script_id_ = source_uri_index_; 919 builder_->current_script_id_ = source_uri_index_;
919 builder_->record_token_position(position_); 920 builder_->record_token_position(position_);
920 builder_->record_token_position(end_position_); 921 builder_->record_token_position(end_position_);
921 if (++next_read_ == field) return; 922 if (++next_read_ == field) return;
923 case kDocumentationCommentIndex:
924 builder_->ReadStringReference();
925 if (++next_read_ == field) return;
922 case kAnnotations: { 926 case kAnnotations: {
923 annotation_count_ = builder_->ReadListLength(); // read list length. 927 annotation_count_ = builder_->ReadListLength(); // read list length.
924 for (intptr_t i = 0; i < annotation_count_; ++i) { 928 for (intptr_t i = 0; i < annotation_count_; ++i) {
925 builder_->SkipExpression(); // read ith expression. 929 builder_->SkipExpression(); // read ith expression.
926 } 930 }
927 if (++next_read_ == field) return; 931 if (++next_read_ == field) return;
928 } 932 }
929 case kType: 933 case kType:
930 builder_->SkipDartType(); // read type. 934 builder_->SkipDartType(); // read type.
931 if (++next_read_ == field) return; 935 if (++next_read_ == field) return;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 enum Fields { 1006 enum Fields {
1003 kStart, // tag. 1007 kStart, // tag.
1004 kCanonicalName, 1008 kCanonicalName,
1005 kPosition, 1009 kPosition,
1006 kEndPosition, 1010 kEndPosition,
1007 kKind, 1011 kKind,
1008 kFlags, 1012 kFlags,
1009 kParentClassBinaryOffset, 1013 kParentClassBinaryOffset,
1010 kName, 1014 kName,
1011 kSourceUriIndex, 1015 kSourceUriIndex,
1016 kDocumentationCommentIndex,
1012 kAnnotations, 1017 kAnnotations,
1013 kFunction, 1018 kFunction,
1014 kEnd 1019 kEnd
1015 }; 1020 };
1016 1021
1017 explicit ProcedureHelper(StreamingFlowGraphBuilder* builder) { 1022 explicit ProcedureHelper(StreamingFlowGraphBuilder* builder) {
1018 builder_ = builder; 1023 builder_ = builder;
1019 next_read_ = kStart; 1024 next_read_ = kStart;
1020 } 1025 }
1021 1026
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 if (++next_read_ == field) return; 1061 if (++next_read_ == field) return;
1057 case kName: 1062 case kName:
1058 builder_->SkipName(); // read name. 1063 builder_->SkipName(); // read name.
1059 if (++next_read_ == field) return; 1064 if (++next_read_ == field) return;
1060 case kSourceUriIndex: 1065 case kSourceUriIndex:
1061 source_uri_index_ = builder_->ReadUInt(); // read source_uri_index. 1066 source_uri_index_ = builder_->ReadUInt(); // read source_uri_index.
1062 builder_->current_script_id_ = source_uri_index_; 1067 builder_->current_script_id_ = source_uri_index_;
1063 builder_->record_token_position(position_); 1068 builder_->record_token_position(position_);
1064 builder_->record_token_position(end_position_); 1069 builder_->record_token_position(end_position_);
1065 if (++next_read_ == field) return; 1070 if (++next_read_ == field) return;
1071 case kDocumentationCommentIndex:
1072 builder_->ReadStringReference();
1073 if (++next_read_ == field) return;
1066 case kAnnotations: { 1074 case kAnnotations: {
1067 annotation_count_ = builder_->ReadListLength(); // read list length. 1075 annotation_count_ = builder_->ReadListLength(); // read list length.
1068 for (intptr_t i = 0; i < annotation_count_; ++i) { 1076 for (intptr_t i = 0; i < annotation_count_; ++i) {
1069 builder_->SkipExpression(); // read ith expression. 1077 builder_->SkipExpression(); // read ith expression.
1070 } 1078 }
1071 if (++next_read_ == field) return; 1079 if (++next_read_ == field) return;
1072 } 1080 }
1073 case kFunction: 1081 case kFunction:
1074 if (builder_->ReadTag() == kSomething) 1082 if (builder_->ReadTag() == kSomething)
1075 builder_->SkipFunctionNode(); // read function node. 1083 builder_->SkipFunctionNode(); // read function node.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 class ConstructorHelper { 1130 class ConstructorHelper {
1123 public: 1131 public:
1124 enum Fields { 1132 enum Fields {
1125 kStart, // tag. 1133 kStart, // tag.
1126 kCanonicalName, 1134 kCanonicalName,
1127 kPosition, 1135 kPosition,
1128 kEndPosition, 1136 kEndPosition,
1129 kFlags, 1137 kFlags,
1130 kParentClassBinaryOffset, 1138 kParentClassBinaryOffset,
1131 kName, 1139 kName,
1140 kDocumentationCommentIndex,
1132 kAnnotations, 1141 kAnnotations,
1133 kFunction, 1142 kFunction,
1134 kInitializers, 1143 kInitializers,
1135 kEnd 1144 kEnd
1136 }; 1145 };
1137 1146
1138 explicit ConstructorHelper(StreamingFlowGraphBuilder* builder) { 1147 explicit ConstructorHelper(StreamingFlowGraphBuilder* builder) {
1139 builder_ = builder; 1148 builder_ = builder;
1140 next_read_ = kStart; 1149 next_read_ = kStart;
1141 } 1150 }
(...skipping 25 matching lines...) Expand all
1167 case kFlags: 1176 case kFlags:
1168 flags_ = builder_->ReadFlags(); // read flags. 1177 flags_ = builder_->ReadFlags(); // read flags.
1169 if (++next_read_ == field) return; 1178 if (++next_read_ == field) return;
1170 case kParentClassBinaryOffset: 1179 case kParentClassBinaryOffset:
1171 parent_class_binary_offset_ = 1180 parent_class_binary_offset_ =
1172 builder_->ReadUInt(); // read parent class binary offset. 1181 builder_->ReadUInt(); // read parent class binary offset.
1173 if (++next_read_ == field) return; 1182 if (++next_read_ == field) return;
1174 case kName: 1183 case kName:
1175 builder_->SkipName(); // read name. 1184 builder_->SkipName(); // read name.
1176 if (++next_read_ == field) return; 1185 if (++next_read_ == field) return;
1186 case kDocumentationCommentIndex:
1187 builder_->ReadStringReference();
1188 if (++next_read_ == field) return;
1177 case kAnnotations: { 1189 case kAnnotations: {
1178 annotation_count_ = builder_->ReadListLength(); // read list length. 1190 annotation_count_ = builder_->ReadListLength(); // read list length.
1179 for (intptr_t i = 0; i < annotation_count_; ++i) { 1191 for (intptr_t i = 0; i < annotation_count_; ++i) {
1180 builder_->SkipExpression(); // read ith expression. 1192 builder_->SkipExpression(); // read ith expression.
1181 } 1193 }
1182 if (++next_read_ == field) return; 1194 if (++next_read_ == field) return;
1183 } 1195 }
1184 case kFunction: 1196 case kFunction:
1185 builder_->SkipFunctionNode(); // read function. 1197 builder_->SkipFunctionNode(); // read function.
1186 if (++next_read_ == field) return; 1198 if (++next_read_ == field) return;
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 private: 1543 private:
1532 Reader* reader_; 1544 Reader* reader_;
1533 intptr_t saved_offset_; 1545 intptr_t saved_offset_;
1534 }; 1546 };
1535 1547
1536 } // namespace kernel 1548 } // namespace kernel
1537 } // namespace dart 1549 } // namespace dart
1538 1550
1539 #endif // !defined(DART_PRECOMPILED_RUNTIME) 1551 #endif // !defined(DART_PRECOMPILED_RUNTIME)
1540 #endif // RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_ 1552 #endif // RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_
OLDNEW
« no previous file with comments | « pkg/kernel/lib/binary/ast_to_binary.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698