OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 else if (switch_type != label_switch_type) | 160 else if (switch_type != label_switch_type) |
161 switch_type = SwitchStatement::GENERIC_SWITCH; | 161 switch_type = SwitchStatement::GENERIC_SWITCH; |
162 } | 162 } |
163 CHECK_ALIVE(VisitStatements(clause->statements())); | 163 CHECK_ALIVE(VisitStatements(clause->statements())); |
164 } | 164 } |
165 if (switch_type == SwitchStatement::UNKNOWN_SWITCH) | 165 if (switch_type == SwitchStatement::UNKNOWN_SWITCH) |
166 switch_type = SwitchStatement::GENERIC_SWITCH; | 166 switch_type = SwitchStatement::GENERIC_SWITCH; |
167 stmt->set_switch_type(switch_type); | 167 stmt->set_switch_type(switch_type); |
168 | 168 |
169 // TODO(rossberg): can we eliminate this special case and extra loop? | 169 // TODO(rossberg): can we eliminate this special case and extra loop? |
170 if (switch_type == SwitchStatement::SMI_SWITCH) { | 170 if (switch_type == SwitchStatement::SMI_SWITCH || |
| 171 switch_type == SwitchStatement::STRING_SWITCH) { |
171 for (int i = 0; i < clauses->length(); ++i) { | 172 for (int i = 0; i < clauses->length(); ++i) { |
172 CaseClause* clause = clauses->at(i); | 173 CaseClause* clause = clauses->at(i); |
173 if (!clause->is_default()) | 174 if (!clause->is_default()) |
174 clause->RecordTypeFeedback(oracle()); | 175 clause->RecordTypeFeedback(oracle()); |
175 } | 176 } |
176 } | 177 } |
177 } | 178 } |
178 | 179 |
179 | 180 |
180 void AstTyper::VisitDoWhileStatement(DoWhileStatement* stmt) { | 181 void AstTyper::VisitDoWhileStatement(DoWhileStatement* stmt) { |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 } | 504 } |
504 | 505 |
505 | 506 |
506 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) { | 507 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) { |
507 ASSERT(!HasStackOverflow()); | 508 ASSERT(!HasStackOverflow()); |
508 CHECK_ALIVE(Visit(stmt->body())); | 509 CHECK_ALIVE(Visit(stmt->body())); |
509 } | 510 } |
510 | 511 |
511 | 512 |
512 } } // namespace v8::internal | 513 } } // namespace v8::internal |
OLD | NEW |