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

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

Issue 687103004: Minor cleanup using BooleanConstant in graph builder. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | « src/compiler/ast-graph-builder.h ('k') | no next file » | 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 92eec8611eddf6143bf7d287b708722e9d58a287..d7bae5a4197b612cdec3abb69fc4396a8970eeb4 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -588,13 +588,6 @@ void AstGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) {
}
-BitVector* AstGraphBuilder::GetVariablesAssignedInLoop(
- IterationStatement* stmt) {
- if (loop_assignment_analysis_ == NULL) return NULL;
- return loop_assignment_analysis_->GetVariablesAssignedInLoop(stmt);
-}
-
-
void AstGraphBuilder::VisitDoWhileStatement(DoWhileStatement* stmt) {
LoopBuilder while_loop(this);
while_loop.BeginLoop(GetVariablesAssignedInLoop(stmt));
@@ -826,8 +819,7 @@ void AstGraphBuilder::VisitFunctionLiteral(FunctionLiteral* expr) {
// Create node to instantiate a new closure.
Node* info = jsgraph()->Constant(shared_info);
- Node* pretenure = expr->pretenure() ? jsgraph()->TrueConstant()
- : jsgraph()->FalseConstant();
+ Node* pretenure = jsgraph()->BooleanConstant(expr->pretenure());
const Operator* op = javascript()->CallRuntime(Runtime::kNewClosure, 3);
Node* value = NewNode(op, context, info, pretenure);
ast_context()->ProduceValue(value);
@@ -1933,8 +1925,7 @@ Node* AstGraphBuilder::BuildVariableDelete(
case Variable::LOCAL:
case Variable::CONTEXT:
// Local var, const, or let variable or context variable.
- return variable->is_this() ? jsgraph()->TrueConstant()
- : jsgraph()->FalseConstant();
+ return jsgraph()->BooleanConstant(variable->is_this());
case Variable::LOOKUP: {
// Dynamic lookup of context variable (anywhere in the chain).
Node* name = jsgraph()->Constant(variable->name());
@@ -2172,6 +2163,13 @@ void AstGraphBuilder::PrepareFrameState(Node* node, BailoutId ast_id,
}
}
+
+BitVector* AstGraphBuilder::GetVariablesAssignedInLoop(
+ IterationStatement* stmt) {
+ if (loop_assignment_analysis_ == NULL) return NULL;
+ return loop_assignment_analysis_->GetVariablesAssignedInLoop(stmt);
}
-}
-} // namespace v8::internal::compiler
+
+} // namespace compiler
+} // namespace internal
+} // namespace v8
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698