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

Side by Side Diff: src/compiler/instruction-selector-impl.h

Issue 1019803005: [turbofan] Factor out common switch-related code in instruction selectors. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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/compiler/instruction-selector.cc ('k') | src/compiler/mips/instruction-selector-mips.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 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 #ifndef V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ 5 #ifndef V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_
6 #define V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ 6 #define V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_
7 7
8 #include "src/compiler/instruction.h" 8 #include "src/compiler/instruction.h"
9 #include "src/compiler/instruction-selector.h" 9 #include "src/compiler/instruction-selector.h"
10 #include "src/compiler/linkage.h" 10 #include "src/compiler/linkage.h"
11 #include "src/compiler/schedule.h" 11 #include "src/compiler/schedule.h"
12 #include "src/macro-assembler.h" 12 #include "src/macro-assembler.h"
13 13
14 namespace v8 { 14 namespace v8 {
15 namespace internal { 15 namespace internal {
16 namespace compiler { 16 namespace compiler {
17 17
18 // Helper struct containing data about a table or lookup switch.
19 struct SwitchInfo {
20 int32_t min_value; // minimum value of {case_values}
21 int32_t max_value; // maximum value of {case_values}
22 size_t value_range; // |max_value - min_value| + 1
23 size_t case_count; // number of cases
24 int32_t* case_values; // actual case values, unsorted
25 BasicBlock** case_branches; // basic blocks corresponding to case values
26 BasicBlock* default_branch; // default branch target
27 };
28
18 // A helper class for the instruction selector that simplifies construction of 29 // A helper class for the instruction selector that simplifies construction of
19 // Operands. This class implements a base for architecture-specific helpers. 30 // Operands. This class implements a base for architecture-specific helpers.
20 class OperandGenerator { 31 class OperandGenerator {
21 public: 32 public:
22 explicit OperandGenerator(InstructionSelector* selector) 33 explicit OperandGenerator(InstructionSelector* selector)
23 : selector_(selector) {} 34 : selector_(selector) {}
24 35
25 InstructionOperand NoOutput() { 36 InstructionOperand NoOutput() {
26 return InstructionOperand(); // Generates an invalid operand. 37 return InstructionOperand(); // Generates an invalid operand.
27 } 38 }
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 : (frame_state_descriptor->GetTotalSize() + 380 : (frame_state_descriptor->GetTotalSize() +
370 1); // Include deopt id. 381 1); // Include deopt id.
371 } 382 }
372 }; 383 };
373 384
374 } // namespace compiler 385 } // namespace compiler
375 } // namespace internal 386 } // namespace internal
376 } // namespace v8 387 } // namespace v8
377 388
378 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ 389 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_
OLDNEW
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/mips/instruction-selector-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698