OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 10481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10492 } else if (ast_context()->IsValue()) { | 10492 } else if (ast_context()->IsValue()) { |
10493 CHECK_ALIVE(VisitForValue(expr->left())); | 10493 CHECK_ALIVE(VisitForValue(expr->left())); |
10494 ASSERT(current_block() != NULL); | 10494 ASSERT(current_block() != NULL); |
10495 HValue* left_value = Top(); | 10495 HValue* left_value = Top(); |
10496 | 10496 |
10497 if (left_value->IsConstant()) { | 10497 if (left_value->IsConstant()) { |
10498 HConstant* left_constant = HConstant::cast(left_value); | 10498 HConstant* left_constant = HConstant::cast(left_value); |
10499 if ((is_logical_and && left_constant->BooleanValue()) || | 10499 if ((is_logical_and && left_constant->BooleanValue()) || |
10500 (!is_logical_and && !left_constant->BooleanValue())) { | 10500 (!is_logical_and && !left_constant->BooleanValue())) { |
10501 Drop(1); // left_value. | 10501 Drop(1); // left_value. |
10502 CHECK_BAILOUT(VisitForValue(expr->right())); | 10502 CHECK_ALIVE(VisitForValue(expr->right())); |
10503 } | 10503 } |
10504 return ast_context()->ReturnValue(Pop()); | 10504 return ast_context()->ReturnValue(Pop()); |
10505 } | 10505 } |
10506 | 10506 |
10507 // We need an extra block to maintain edge-split form. | 10507 // We need an extra block to maintain edge-split form. |
10508 HBasicBlock* empty_block = graph()->CreateBasicBlock(); | 10508 HBasicBlock* empty_block = graph()->CreateBasicBlock(); |
10509 HBasicBlock* eval_right = graph()->CreateBasicBlock(); | 10509 HBasicBlock* eval_right = graph()->CreateBasicBlock(); |
10510 TypeFeedbackId test_id = expr->left()->test_id(); | 10510 TypeFeedbackId test_id = expr->left()->test_id(); |
10511 ToBooleanStub::Types expected(oracle()->ToBooleanTypes(test_id)); | 10511 ToBooleanStub::Types expected(oracle()->ToBooleanTypes(test_id)); |
10512 HBranch* test = is_logical_and | 10512 HBranch* test = is_logical_and |
(...skipping 1958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12471 } | 12471 } |
12472 } | 12472 } |
12473 | 12473 |
12474 #ifdef DEBUG | 12474 #ifdef DEBUG |
12475 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 12475 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
12476 if (allocator_ != NULL) allocator_->Verify(); | 12476 if (allocator_ != NULL) allocator_->Verify(); |
12477 #endif | 12477 #endif |
12478 } | 12478 } |
12479 | 12479 |
12480 } } // namespace v8::internal | 12480 } } // namespace v8::internal |
OLD | NEW |