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

Unified Diff: runtime/vm/parser.cc

Issue 2949803002: New growth strategy for growable arrays (Closed)
Patch Set: Branch-free grow size computation. Renamed function names to be clearer. Created 3 years, 6 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 | « runtime/vm/pages.cc ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 6f639387c126ac232945dfea4ccc80cac1915855..e6a4275cc42765627143138dbfd757b884830d70 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -1336,7 +1336,7 @@ RawArray* Parser::EvaluateMetadata() {
const Instance& val = EvaluateConstExpr(expr_pos, expr);
meta_values.Add(val, Heap::kOld);
}
- return Array::MakeArray(meta_values);
+ return Array::MakeFixedLength(meta_values);
}
@@ -4974,7 +4974,7 @@ void Parser::ParseClassDefinition(const Class& cls) {
}
CheckConstructors(&members);
- // Need to compute this here since MakeArray() will clear the
+ // Need to compute this here since MakeFixedLength() will clear the
// functions array in members.
const bool need_implicit_constructor =
!members.has_constructor() && !cls.is_patch();
@@ -5730,7 +5730,7 @@ void Parser::ParseInterfaceList(const Class& cls) {
}
all_interfaces.Add(interface, Heap::kOld);
} while (CurrentToken() == Token::kCOMMA);
- cls_interfaces = Array::MakeArray(all_interfaces);
+ cls_interfaces = Array::MakeFixedLength(all_interfaces);
cls.set_interfaces(cls_interfaces);
}
@@ -5756,8 +5756,8 @@ RawAbstractType* Parser::ParseMixins(const AbstractType& super_type) {
}
mixin_types.Add(mixin_type, Heap::kOld);
} while (CurrentToken() == Token::kCOMMA);
- return MixinAppType::New(super_type,
- Array::Handle(Z, Array::MakeArray(mixin_types)));
+ return MixinAppType::New(
+ super_type, Array::Handle(Z, Array::MakeFixedLength(mixin_types)));
}
@@ -6286,7 +6286,7 @@ void Parser::ParseLibraryImportExport(const Object& tl_owner,
}
// Check if this conditional line overrides the default import.
const String& key = String::Handle(String::ConcatAll(
- Array::Handle(Array::MakeArray(pieces)), allocation_space_));
+ Array::Handle(Array::MakeFixedLength(pieces)), allocation_space_));
const String& value =
(valueNode == NULL)
? Symbols::True()
@@ -6345,10 +6345,10 @@ void Parser::ParseLibraryImportExport(const Object& tl_owner,
}
}
if (show_list.Length() > 0) {
- show_names = Array::MakeArray(show_list);
+ show_names = Array::MakeFixedLength(show_list);
}
if (hide_list.Length() > 0) {
- hide_names = Array::MakeArray(hide_list);
+ hide_names = Array::MakeFixedLength(hide_list);
}
}
ExpectSemicolon();
@@ -10381,7 +10381,7 @@ AstNode* Parser::ParseTryStatement(String* label_name) {
CatchClauseNode* catch_clause = new (Z) CatchClauseNode(
handler_pos, catch_handler_list,
- Array::ZoneHandle(Z, Array::MakeArray(handler_types)), context_var,
+ Array::ZoneHandle(Z, Array::MakeFixedLength(handler_types)), context_var,
exception_var, stack_trace_var,
is_async ? saved_exception_var : exception_var,
is_async ? saved_stack_trace_var : stack_trace_var,
@@ -11742,7 +11742,7 @@ ArgumentListNode* Parser::ParseActualParameters(
ExpectToken(Token::kRPAREN);
SetAllowFunctionLiterals(saved_mode);
if (named_argument_seen) {
- arguments->set_names(Array::Handle(Z, Array::MakeArray(names)));
+ arguments->set_names(Array::Handle(Z, Array::MakeFixedLength(names)));
}
return arguments;
}
« no previous file with comments | « runtime/vm/pages.cc ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698