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

Unified Diff: src/compiler/mips64/instruction-selector-mips64.cc

Issue 1761863002: [turbofan] Re-enables the jump table emission in the mips instruction selector. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update. Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/mips/instruction-selector-mips.cc ('k') | src/mips/macro-assembler-mips.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/mips64/instruction-selector-mips64.cc
diff --git a/src/compiler/mips64/instruction-selector-mips64.cc b/src/compiler/mips64/instruction-selector-mips64.cc
index eae2d3170d4335a6e8feb8007335be5ae5a6aac6..56188f1817ecf5c2771a3e9d49f849de76620c87 100644
--- a/src/compiler/mips64/instruction-selector-mips64.cc
+++ b/src/compiler/mips64/instruction-selector-mips64.cc
@@ -1711,27 +1711,23 @@ void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) {
Mips64OperandGenerator g(this);
InstructionOperand value_operand = g.UseRegister(node->InputAt(0));
- // TODO(mips): TableSwitch is broken, as it messes with ra without saving it
- // properly (which breaks with frame elision, i.e. inside stubs).
- if (false) {
- // Emit either ArchTableSwitch or ArchLookupSwitch.
- size_t table_space_cost = 10 + 2 * sw.value_range;
- size_t table_time_cost = 3;
- size_t lookup_space_cost = 2 + 2 * sw.case_count;
- size_t lookup_time_cost = sw.case_count;
- if (sw.case_count > 0 &&
- table_space_cost + 3 * table_time_cost <=
- lookup_space_cost + 3 * lookup_time_cost &&
- sw.min_value > std::numeric_limits<int32_t>::min()) {
- InstructionOperand index_operand = value_operand;
- if (sw.min_value) {
- index_operand = g.TempRegister();
- Emit(kMips64Sub, index_operand, value_operand,
- g.TempImmediate(sw.min_value));
- }
- // Generate a table lookup.
- return EmitTableSwitch(sw, index_operand);
+ // Emit either ArchTableSwitch or ArchLookupSwitch.
+ size_t table_space_cost = 10 + 2 * sw.value_range;
+ size_t table_time_cost = 3;
+ size_t lookup_space_cost = 2 + 2 * sw.case_count;
+ size_t lookup_time_cost = sw.case_count;
+ if (sw.case_count > 0 &&
+ table_space_cost + 3 * table_time_cost <=
+ lookup_space_cost + 3 * lookup_time_cost &&
+ sw.min_value > std::numeric_limits<int32_t>::min()) {
+ InstructionOperand index_operand = value_operand;
+ if (sw.min_value) {
+ index_operand = g.TempRegister();
+ Emit(kMips64Sub, index_operand, value_operand,
+ g.TempImmediate(sw.min_value));
}
+ // Generate a table lookup.
+ return EmitTableSwitch(sw, index_operand);
}
// Generate a sequence of conditional jumps.
« no previous file with comments | « src/compiler/mips/instruction-selector-mips.cc ('k') | src/mips/macro-assembler-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698