Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/typing.cc

Issue 16128004: Reorder switch clauses using newly-introduced execution counters in (Closed) Base URL: gh:v8/v8.git@master
Patch Set: tweak heuristic Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/type-info.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/type-info.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698