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

Unified Diff: runtime/vm/kernel_binary_flowgraph.h

Issue 2979653002: [kernel] Only add metadata if there's at least one annotation (Closed)
Patch Set: Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/kernel_reader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel_binary_flowgraph.h
diff --git a/runtime/vm/kernel_binary_flowgraph.h b/runtime/vm/kernel_binary_flowgraph.h
index c645744049f19ba6b9746fdb7a34a5edf784a083..e6b47578c350a6a71fc1f6dcf22bb2770d31563e 100644
--- a/runtime/vm/kernel_binary_flowgraph.h
+++ b/runtime/vm/kernel_binary_flowgraph.h
@@ -902,9 +902,13 @@ class FieldHelper {
builder_->record_token_position(position_);
builder_->record_token_position(end_position_);
if (++next_read_ == field) return;
- case kAnnotations:
- builder_->SkipListOfExpressions(); // read annotations.
+ case kAnnotations: {
+ annotation_count_ = builder_->ReadListLength(); // read list length.
+ for (intptr_t i = 0; i < annotation_count_; ++i) {
+ builder_->SkipExpression(); // read ith expression.
+ }
if (++next_read_ == field) return;
+ }
case kType:
builder_->SkipDartType(); // read type.
if (++next_read_ == field) return;
@@ -935,6 +939,7 @@ class FieldHelper {
word flags_;
intptr_t parent_class_binary_offset_;
intptr_t source_uri_index_;
+ intptr_t annotation_count_;
private:
StreamingFlowGraphBuilder* builder_;
@@ -1015,9 +1020,13 @@ class ProcedureHelper {
builder_->record_token_position(position_);
builder_->record_token_position(end_position_);
if (++next_read_ == field) return;
- case kAnnotations:
- builder_->SkipListOfExpressions(); // read annotations.
+ case kAnnotations: {
+ annotation_count_ = builder_->ReadListLength(); // read list length.
+ for (intptr_t i = 0; i < annotation_count_; ++i) {
+ builder_->SkipExpression(); // read ith expression.
+ }
if (++next_read_ == field) return;
+ }
case kFunction:
if (builder_->ReadTag() == kSomething)
builder_->SkipFunctionNode(); // read function node.
@@ -1053,6 +1062,7 @@ class ProcedureHelper {
word flags_;
intptr_t parent_class_binary_offset_;
intptr_t source_uri_index_;
+ intptr_t annotation_count_;
private:
StreamingFlowGraphBuilder* builder_;
@@ -1121,9 +1131,13 @@ class ConstructorHelper {
case kName:
builder_->SkipName(); // read name.
if (++next_read_ == field) return;
- case kAnnotations:
- builder_->SkipListOfExpressions(); // read annotations.
+ case kAnnotations: {
+ annotation_count_ = builder_->ReadListLength(); // read list length.
+ for (intptr_t i = 0; i < annotation_count_; ++i) {
+ builder_->SkipExpression(); // read ith expression.
+ }
if (++next_read_ == field) return;
+ }
case kFunction:
builder_->SkipFunctionNode(); // read function.
if (++next_read_ == field) return;
@@ -1179,6 +1193,7 @@ class ConstructorHelper {
TokenPosition end_position_;
word flags_;
intptr_t parent_class_binary_offset_;
+ intptr_t annotation_count_;
private:
StreamingFlowGraphBuilder* builder_;
@@ -1249,9 +1264,13 @@ class ClassHelper {
builder_->current_script_id_ = source_uri_index_;
builder_->record_token_position(position_);
if (++next_read_ == field) return;
- case kAnnotations:
- builder_->SkipListOfExpressions(); // read annotations.
+ case kAnnotations: {
+ annotation_count_ = builder_->ReadListLength(); // read list length.
+ for (intptr_t i = 0; i < annotation_count_; ++i) {
+ builder_->SkipExpression(); // read ith expression.
+ }
if (++next_read_ == field) return;
+ }
case kTypeParameters:
builder_->SkipTypeParametersList(); // read type parameters.
if (++next_read_ == field) return;
@@ -1317,6 +1336,7 @@ class ClassHelper {
bool is_abstract_;
StringIndex name_index_;
intptr_t source_uri_index_;
+ intptr_t annotation_count_;
private:
StreamingFlowGraphBuilder* builder_;
« no previous file with comments | « no previous file | runtime/vm/kernel_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698