Commit 68f56646 authored by ager@chromium.org's avatar ager@chromium.org

Address review comments.

Only jump over 'else' part of a conditional if it is actually
generated.  Update a comment to more correctly reflect what is going
on.

Review URL: http://codereview.chromium.org/155272

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2402 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 05b7b265
......@@ -2421,25 +2421,21 @@ void CodeGenerator::VisitConditional(Conditional* node) {
Comment cmnt(masm_, "[ Conditional");
JumpTarget then;
JumpTarget else_;
JumpTarget exit;
LoadConditionAndSpill(node->condition(), NOT_INSIDE_TYPEOF,
&then, &else_, true);
if (frame_ != NULL) {
if (has_valid_frame()) {
Branch(false, &else_);
}
if (frame_ != NULL || then.is_linked()) {
if (has_valid_frame() || then.is_linked()) {
then.Bind();
LoadAndSpill(node->then_expression(), typeof_state());
}
if (frame_ != NULL) {
exit.Jump();
}
if (else_.is_linked()) {
JumpTarget exit;
if (has_valid_frame()) exit.Jump();
else_.Bind();
LoadAndSpill(node->else_expression(), typeof_state());
}
if (exit.is_linked()) {
exit.Bind();
if (exit.is_linked()) exit.Bind();
}
ASSERT(frame_->height() == original_height + 1);
}
......@@ -3615,9 +3611,8 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
false_target(),
true_target(),
true);
// LoadConditionAndSpill might emit only unconditional jumps to
// the targets in which case cc_reg_ is not set. When that
// happens, don't attempt to negate the condition.
// LoadCondition may (and usually does) leave a test and branch to
// be emitted by the caller. In that case, negate the condition.
if (has_cc()) cc_reg_ = NegateCondition(cc_reg_);
} else if (op == Token::DELETE) {
......
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