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 2517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2528 HBasicBlock* curr_test_block = first_test_block; | 2528 HBasicBlock* curr_test_block = first_test_block; |
2529 HBasicBlock* fall_through_block = NULL; | 2529 HBasicBlock* fall_through_block = NULL; |
2530 BreakAndContinueInfo break_info(stmt); | 2530 BreakAndContinueInfo break_info(stmt); |
2531 { BreakAndContinueScope push(&break_info, this); | 2531 { BreakAndContinueScope push(&break_info, this); |
2532 for (int i = 0; i < clause_count; ++i) { | 2532 for (int i = 0; i < clause_count; ++i) { |
2533 CaseClause* clause = clauses->at(i); | 2533 CaseClause* clause = clauses->at(i); |
2534 | 2534 |
2535 // Identify the block where normal (non-fall-through) control flow | 2535 // Identify the block where normal (non-fall-through) control flow |
2536 // goes to. | 2536 // goes to. |
2537 HBasicBlock* normal_block = NULL; | 2537 HBasicBlock* normal_block = NULL; |
2538 if (clause->is_default() && last_block != NULL) { | 2538 if (clause->is_default()) { |
2539 normal_block = last_block; | 2539 if (last_block != NULL) { |
2540 last_block = NULL; // Cleared to indicate we've handled it. | 2540 normal_block = last_block; |
| 2541 last_block = NULL; // Cleared to indicate we've handled it. |
| 2542 } |
2541 } else if (!curr_test_block->end()->IsDeoptimize()) { | 2543 } else if (!curr_test_block->end()->IsDeoptimize()) { |
2542 normal_block = curr_test_block->end()->FirstSuccessor(); | 2544 normal_block = curr_test_block->end()->FirstSuccessor(); |
2543 curr_test_block = curr_test_block->end()->SecondSuccessor(); | 2545 curr_test_block = curr_test_block->end()->SecondSuccessor(); |
2544 } | 2546 } |
2545 | 2547 |
2546 // Identify a block to emit the body into. | 2548 // Identify a block to emit the body into. |
2547 if (normal_block == NULL) { | 2549 if (normal_block == NULL) { |
2548 if (fall_through_block == NULL) { | 2550 if (fall_through_block == NULL) { |
2549 // (a) Unreachable. | 2551 // (a) Unreachable. |
2550 if (clause->is_default()) { | 2552 if (clause->is_default()) { |
(...skipping 3591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6142 } | 6144 } |
6143 } | 6145 } |
6144 | 6146 |
6145 #ifdef DEBUG | 6147 #ifdef DEBUG |
6146 if (graph_ != NULL) graph_->Verify(); | 6148 if (graph_ != NULL) graph_->Verify(); |
6147 if (allocator_ != NULL) allocator_->Verify(); | 6149 if (allocator_ != NULL) allocator_->Verify(); |
6148 #endif | 6150 #endif |
6149 } | 6151 } |
6150 | 6152 |
6151 } } // namespace v8::internal | 6153 } } // namespace v8::internal |
OLD | NEW |