Reviewers: rossberg,
Description:
Maintain the invariant that all HGraphBuilder::VisitFoo methods return void.
Additionally, this enables the use of a CHECK_ALIVE macro instead of
copy-n-paste code at one place.
This CL is part of a series of several yak-shaving CLs to prepare the
inlining
of JavaScript accessors.
Please review this at http://codereview.chromium.org/10783017/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/hydrogen.h
M src/hydrogen.cc
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index
683e805566c024a07585fad5c21fd5778c3b52e5..7d0e228e8eeae3e88bc930be8d518966713afa99
100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -2992,12 +2992,9 @@ void HGraphBuilder::VisitForControl(Expression* expr,
}
-HValue* HGraphBuilder::VisitArgument(Expression* expr) {
- VisitForValue(expr);
- if (HasStackOverflow() || current_block() == NULL) return NULL;
- HValue* value = Pop();
- Push(AddInstruction(new(zone()) HPushArgument(value)));
- return value;
+void HGraphBuilder::VisitArgument(Expression* expr) {
+ CHECK_ALIVE(VisitForValue(expr));
+ Push(AddInstruction(new(zone()) HPushArgument(Pop())));
}
@@ -7450,8 +7447,8 @@ void HGraphBuilder::VisitCallNew(CallNew* expr) {
} else {
// The constructor function is both an operand to the instruction and
an
// argument to the construct call.
- HValue* constructor = NULL;
- CHECK_ALIVE(constructor = VisitArgument(expr->expression()));
+ CHECK_ALIVE(VisitArgument(expr->expression()));
+ HValue* constructor = HPushArgument::cast(Top())->argument();
CHECK_ALIVE(VisitArgumentList(expr->arguments()));
HInstruction* call =
new(zone()) HCallNew(context, constructor, argument_count);
Index: src/hydrogen.h
diff --git a/src/hydrogen.h b/src/hydrogen.h
index
9aac71c93f37ac2671286b2d384b0ed807d857bb..60a4420024d3ad4019de686e7e880ecd2a6fd28e
100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -976,9 +976,8 @@ class HGraphBuilder: public AstVisitor {
HBasicBlock* true_block,
HBasicBlock* false_block);
- // Visit an argument subexpression and emit a push to the outgoing
- // arguments. Returns the hydrogen value that was pushed.
- HValue* VisitArgument(Expression* expr);
+ // Visit an argument subexpression and emit a push to the outgoing
arguments.
+ void VisitArgument(Expression* expr);
void VisitArgumentList(ZoneList<Expression*>* arguments);
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev