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

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 742433002: Use ZoneVector instead of ZoneList in the graph builder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-operator-counts
Patch Set: Remove pesky space. Created 6 years, 1 month 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 | « src/compiler/ast-graph-builder.h ('k') | src/compiler/control-builders.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index 4eb72a6d66598d63c00200ca2f5d9db9c2897720..e2d8aabc2b95c6f4d5205a110e37c6c5535ef06c 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -395,8 +395,8 @@ void AstGraphBuilder::VisitVariableDeclaration(VariableDeclaration* decl) {
Handle<Oddball> value = variable->binding_needs_init()
? isolate()->factory()->the_hole_value()
: isolate()->factory()->undefined_value();
- globals()->Add(variable->name(), zone());
- globals()->Add(value, zone());
+ globals()->push_back(variable->name());
+ globals()->push_back(value);
break;
}
case Variable::PARAMETER:
@@ -427,8 +427,8 @@ void AstGraphBuilder::VisitFunctionDeclaration(FunctionDeclaration* decl) {
Compiler::BuildFunctionInfo(decl->fun(), info()->script(), info());
// Check for stack-overflow exception.
if (function.is_null()) return SetStackOverflow();
- globals()->Add(variable->name(), zone());
- globals()->Add(function, zone());
+ globals()->push_back(variable->name());
+ globals()->push_back(function);
break;
}
case Variable::PARAMETER:
@@ -1639,12 +1639,13 @@ void AstGraphBuilder::VisitCaseClause(CaseClause* expr) { UNREACHABLE(); }
void AstGraphBuilder::VisitDeclarations(ZoneList<Declaration*>* declarations) {
- DCHECK(globals()->is_empty());
+ DCHECK(globals()->empty());
AstVisitor::VisitDeclarations(declarations);
- if (globals()->is_empty()) return;
- Handle<FixedArray> data =
- isolate()->factory()->NewFixedArray(globals()->length(), TENURED);
- for (int i = 0; i < globals()->length(); ++i) data->set(i, *globals()->at(i));
+ if (globals()->empty()) return;
+ int array_index = 0;
+ Handle<FixedArray> data = isolate()->factory()->NewFixedArray(
+ static_cast<int>(globals()->size()), TENURED);
+ for (Handle<Object> obj : *globals()) data->set(array_index++, *obj);
int encoded_flags = DeclareGlobalsEvalFlag::encode(info()->is_eval()) |
DeclareGlobalsNativeFlag::encode(info()->is_native()) |
DeclareGlobalsStrictMode::encode(strict_mode());
@@ -1652,7 +1653,7 @@ void AstGraphBuilder::VisitDeclarations(ZoneList<Declaration*>* declarations) {
Node* pairs = jsgraph()->Constant(data);
const Operator* op = javascript()->CallRuntime(Runtime::kDeclareGlobals, 3);
NewNode(op, current_context(), pairs, flags);
- globals()->Rewind(0);
+ globals()->clear();
}
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/compiler/control-builders.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698