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

Side by Side Diff: src/hydrogen-gvn.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/hydrogen.cc ('k') | src/hydrogen-instructions.h » ('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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 loop_side_effects_[i].RemoveAll(); 397 loop_side_effects_[i].RemoveAll();
398 } 398 }
399 for (int i = graph_->blocks()->length() - 1; i >= 0; --i) { 399 for (int i = graph_->blocks()->length() - 1; i >= 0; --i) {
400 // Compute side effects for the block. 400 // Compute side effects for the block.
401 HBasicBlock* block = graph_->blocks()->at(i); 401 HBasicBlock* block = graph_->blocks()->at(i);
402 HInstruction* instr = block->first(); 402 HInstruction* instr = block->first();
403 int id = block->block_id(); 403 int id = block->block_id();
404 GVNFlagSet side_effects; 404 GVNFlagSet side_effects;
405 while (instr != NULL) { 405 while (instr != NULL) {
406 side_effects.Add(instr->ChangesFlags()); 406 side_effects.Add(instr->ChangesFlags());
407 if (instr->IsSoftDeoptimize()) { 407 if (instr->IsSoftDeoptimize() || instr->IsDeoptCounterAdd()) {
408 block_side_effects_[id].RemoveAll(); 408 block_side_effects_[id].RemoveAll();
409 side_effects.RemoveAll(); 409 side_effects.RemoveAll();
410 break; 410 break;
411 } 411 }
412 instr = instr->next(); 412 instr = instr->next();
413 } 413 }
414 block_side_effects_[id].Add(side_effects); 414 block_side_effects_[id].Add(side_effects);
415 415
416 // Loop headers are part of their loop. 416 // Loop headers are part of their loop.
417 if (block->IsLoopHeader()) { 417 if (block->IsLoopHeader()) {
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 dominated); 849 dominated);
850 successor_map->Kill(side_effects_on_all_paths); 850 successor_map->Kill(side_effects_on_all_paths);
851 successor_dominators->Kill(side_effects_on_all_paths); 851 successor_dominators->Kill(side_effects_on_all_paths);
852 } 852 }
853 } 853 }
854 current = next; 854 current = next;
855 } 855 }
856 } 856 }
857 857
858 } } // namespace v8::internal 858 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698