OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/allocation-site-scopes.h" | 9 #include "src/allocation-site-scopes.h" |
10 #include "src/ast/ast-numbering.h" | 10 #include "src/ast/ast-numbering.h" |
(...skipping 5026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5037 BailoutId default_id = BailoutId::None(); | 5037 BailoutId default_id = BailoutId::None(); |
5038 for (int i = 0; i < clause_count; ++i) { | 5038 for (int i = 0; i < clause_count; ++i) { |
5039 CaseClause* clause = clauses->at(i); | 5039 CaseClause* clause = clauses->at(i); |
5040 if (clause->is_default()) { | 5040 if (clause->is_default()) { |
5041 body_blocks.Add(NULL, zone()); | 5041 body_blocks.Add(NULL, zone()); |
5042 if (default_id.IsNone()) default_id = clause->EntryId(); | 5042 if (default_id.IsNone()) default_id = clause->EntryId(); |
5043 continue; | 5043 continue; |
5044 } | 5044 } |
5045 | 5045 |
5046 // Generate a compare and branch. | 5046 // Generate a compare and branch. |
5047 CHECK_ALIVE(VisitForValue(clause->label())); | 5047 CHECK_BAILOUT(VisitForValue(clause->label())); |
| 5048 if (current_block() == NULL) return Bailout(kUnsupportedSwitchStatement); |
5048 HValue* label_value = Pop(); | 5049 HValue* label_value = Pop(); |
5049 | 5050 |
5050 Type* label_type = clause->label()->bounds().lower; | 5051 Type* label_type = clause->label()->bounds().lower; |
5051 Type* combined_type = clause->compare_type(); | 5052 Type* combined_type = clause->compare_type(); |
5052 HControlInstruction* compare = BuildCompareInstruction( | 5053 HControlInstruction* compare = BuildCompareInstruction( |
5053 Token::EQ_STRICT, tag_value, label_value, tag_type, label_type, | 5054 Token::EQ_STRICT, tag_value, label_value, tag_type, label_type, |
5054 combined_type, | 5055 combined_type, |
5055 ScriptPositionToSourcePosition(stmt->tag()->position()), | 5056 ScriptPositionToSourcePosition(stmt->tag()->position()), |
5056 ScriptPositionToSourcePosition(clause->label()->position()), | 5057 ScriptPositionToSourcePosition(clause->label()->position()), |
5057 PUSH_BEFORE_SIMULATE, clause->id()); | 5058 PUSH_BEFORE_SIMULATE, clause->id()); |
(...skipping 8561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13619 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13620 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13620 } | 13621 } |
13621 | 13622 |
13622 #ifdef DEBUG | 13623 #ifdef DEBUG |
13623 graph_->Verify(false); // No full verify. | 13624 graph_->Verify(false); // No full verify. |
13624 #endif | 13625 #endif |
13625 } | 13626 } |
13626 | 13627 |
13627 } // namespace internal | 13628 } // namespace internal |
13628 } // namespace v8 | 13629 } // namespace v8 |
OLD | NEW |