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

Side by Side Diff: src/compiler/instruction-selector.cc

Issue 2008493002: [x64/ia32] Deal with the non-transitivity of InstructionSelector::CanCover() when folding loads int… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update. Created 4 years, 7 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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/compiler/instruction-selector.h" 5 #include "src/compiler/instruction-selector.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/base/adapters.h" 9 #include "src/base/adapters.h"
10 #include "src/compiler/instruction-selector-impl.h" 10 #include "src/compiler/instruction-selector-impl.h"
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 int effect_level = 0; 706 int effect_level = 0;
707 for (Node* const node : *block) { 707 for (Node* const node : *block) {
708 if (node->opcode() == IrOpcode::kStore || 708 if (node->opcode() == IrOpcode::kStore ||
709 node->opcode() == IrOpcode::kCheckedStore || 709 node->opcode() == IrOpcode::kCheckedStore ||
710 node->opcode() == IrOpcode::kCall) { 710 node->opcode() == IrOpcode::kCall) {
711 ++effect_level; 711 ++effect_level;
712 } 712 }
713 SetEffectLevel(node, effect_level); 713 SetEffectLevel(node, effect_level);
714 } 714 }
715 715
716 // We visit the control first, then the nodes in the block, so the block's
717 // control input should be on the same effect level as the last node.
718 if (block->control_input() != nullptr) {
719 SetEffectLevel(block->control_input(), effect_level);
720 }
721
716 // Generate code for the block control "top down", but schedule the code 722 // Generate code for the block control "top down", but schedule the code
717 // "bottom up". 723 // "bottom up".
718 VisitControl(block); 724 VisitControl(block);
719 std::reverse(instructions_.begin() + current_block_end, instructions_.end()); 725 std::reverse(instructions_.begin() + current_block_end, instructions_.end());
720 726
721 // Visit code in reverse control flow order, because architecture-specific 727 // Visit code in reverse control flow order, because architecture-specific
722 // matching may cover more than one node at a time. 728 // matching may cover more than one node at a time.
723 for (auto node : base::Reversed(*block)) { 729 for (auto node : base::Reversed(*block)) {
724 // Skip nodes that are unused or already defined. 730 // Skip nodes that are unused or already defined.
725 if (!IsUsed(node) || IsDefined(node)) continue; 731 if (!IsUsed(node) || IsDefined(node)) continue;
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1818 return new (instruction_zone()) FrameStateDescriptor( 1824 return new (instruction_zone()) FrameStateDescriptor(
1819 instruction_zone(), state_info.type(), state_info.bailout_id(), 1825 instruction_zone(), state_info.type(), state_info.bailout_id(),
1820 state_info.state_combine(), parameters, locals, stack, 1826 state_info.state_combine(), parameters, locals, stack,
1821 state_info.shared_info(), outer_state); 1827 state_info.shared_info(), outer_state);
1822 } 1828 }
1823 1829
1824 1830
1825 } // namespace compiler 1831 } // namespace compiler
1826 } // namespace internal 1832 } // namespace internal
1827 } // namespace v8 1833 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ia32/instruction-selector-ia32.cc ('k') | src/compiler/x64/instruction-selector-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698