| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 5054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5065 | 5065 |
| 5066 // Translate right subexpression by visiting it in the same AST | 5066 // Translate right subexpression by visiting it in the same AST |
| 5067 // context as the entire expression. | 5067 // context as the entire expression. |
| 5068 if (eval_right->HasPredecessor()) { | 5068 if (eval_right->HasPredecessor()) { |
| 5069 eval_right->SetJoinId(expr->RightId()); | 5069 eval_right->SetJoinId(expr->RightId()); |
| 5070 set_current_block(eval_right); | 5070 set_current_block(eval_right); |
| 5071 Visit(expr->right()); | 5071 Visit(expr->right()); |
| 5072 } | 5072 } |
| 5073 | 5073 |
| 5074 } else if (ast_context()->IsValue()) { | 5074 } else if (ast_context()->IsValue()) { |
| 5075 CHECK_ALIVE(VisitForValue(expr->left())); | 5075 CHECK_ALIVE(Visit(expr->left())); |
| 5076 ASSERT(current_block() != NULL); | 5076 ASSERT(current_block() != NULL); |
| 5077 | 5077 |
| 5078 // We need an extra block to maintain edge-split form. | 5078 // We need an extra block to maintain edge-split form. |
| 5079 HBasicBlock* empty_block = graph()->CreateBasicBlock(); | 5079 HBasicBlock* empty_block = graph()->CreateBasicBlock(); |
| 5080 HBasicBlock* eval_right = graph()->CreateBasicBlock(); | 5080 HBasicBlock* eval_right = graph()->CreateBasicBlock(); |
| 5081 HTest* test = is_logical_and | 5081 HTest* test = is_logical_and |
| 5082 ? new(zone()) HTest(Top(), eval_right, empty_block) | 5082 ? new(zone()) HTest(Top(), eval_right, empty_block) |
| 5083 : new(zone()) HTest(Top(), empty_block, eval_right); | 5083 : new(zone()) HTest(Top(), empty_block, eval_right); |
| 5084 current_block()->Finish(test); | 5084 current_block()->Finish(test); |
| 5085 | 5085 |
| 5086 set_current_block(eval_right); | 5086 set_current_block(eval_right); |
| 5087 Drop(1); // Value of the left subexpression. | 5087 Drop(1); // Value of the left subexpression. |
| 5088 CHECK_BAILOUT(VisitForValue(expr->right())); | 5088 CHECK_BAILOUT(Visit(expr->right())); |
| 5089 | 5089 |
| 5090 HBasicBlock* join_block = | 5090 HBasicBlock* join_block = |
| 5091 CreateJoin(empty_block, current_block(), expr->id()); | 5091 CreateJoin(empty_block, current_block(), expr->id()); |
| 5092 set_current_block(join_block); | 5092 set_current_block(join_block); |
| 5093 ast_context()->ReturnValue(Pop()); | 5093 ast_context()->ReturnValue(Pop()); |
| 5094 | 5094 |
| 5095 } else { | 5095 } else { |
| 5096 ASSERT(ast_context()->IsEffect()); | 5096 ASSERT(ast_context()->IsEffect()); |
| 5097 // In an effect context, we don't need the value of the left subexpression, | 5097 // In an effect context, we don't need the value of the left subexpression, |
| 5098 // only its control flow and side effects. We need an extra block to | 5098 // only its control flow and side effects. We need an extra block to |
| (...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6230 } | 6230 } |
| 6231 } | 6231 } |
| 6232 | 6232 |
| 6233 #ifdef DEBUG | 6233 #ifdef DEBUG |
| 6234 if (graph_ != NULL) graph_->Verify(); | 6234 if (graph_ != NULL) graph_->Verify(); |
| 6235 if (allocator_ != NULL) allocator_->Verify(); | 6235 if (allocator_ != NULL) allocator_->Verify(); |
| 6236 #endif | 6236 #endif |
| 6237 } | 6237 } |
| 6238 | 6238 |
| 6239 } } // namespace v8::internal | 6239 } } // namespace v8::internal |
| OLD | NEW |