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

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: unbreak x64 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
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() ||
408 instr->IsDeoptCounter() || instr->IsDeoptCounterAdd()) {
Sven Panne 2013/06/03 07:30:44 This is a no-go: We're doing something wrong if we
indutny 2013/06/03 07:50:53 Well, its just DeoptCounterAdd that behaves like S
408 block_side_effects_[id].RemoveAll(); 409 block_side_effects_[id].RemoveAll();
409 side_effects.RemoveAll(); 410 side_effects.RemoveAll();
410 break; 411 break;
411 } 412 }
412 instr = instr->next(); 413 instr = instr->next();
413 } 414 }
414 block_side_effects_[id].Add(side_effects); 415 block_side_effects_[id].Add(side_effects);
415 416
416 // Loop headers are part of their loop. 417 // Loop headers are part of their loop.
417 if (block->IsLoopHeader()) { 418 if (block->IsLoopHeader()) {
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 dominated); 850 dominated);
850 successor_map->Kill(side_effects_on_all_paths); 851 successor_map->Kill(side_effects_on_all_paths);
851 successor_dominators->Kill(side_effects_on_all_paths); 852 successor_dominators->Kill(side_effects_on_all_paths);
852 } 853 }
853 } 854 }
854 current = next; 855 current = next;
855 } 856 }
856 } 857 }
857 858
858 } } // namespace v8::internal 859 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698