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.

Review URL: https://chromiumcodereview.appspot.com/10783017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12093 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent fac81414
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment