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

Side by Side Diff: src/compiler/arm/code-generator-arm.cc

Issue 1069633002: [arm] Use position independent table switches. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/arm/assembler-arm.cc ('k') | test/cctest/test-assembler-arm.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 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/arm/macro-assembler-arm.h" 7 #include "src/arm/macro-assembler-arm.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/gap-resolver.h" 9 #include "src/compiler/gap-resolver.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 __ b(eq, GetLabel(i.InputRpo(index + 1))); 847 __ b(eq, GetLabel(i.InputRpo(index + 1)));
848 } 848 }
849 AssembleArchJump(i.InputRpo(1)); 849 AssembleArchJump(i.InputRpo(1));
850 } 850 }
851 851
852 852
853 void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) { 853 void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
854 ArmOperandConverter i(this, instr); 854 ArmOperandConverter i(this, instr);
855 Register input = i.InputRegister(0); 855 Register input = i.InputRegister(0);
856 size_t const case_count = instr->InputCount() - 2; 856 size_t const case_count = instr->InputCount() - 2;
857 // Ensure to emit the constant pool first if necessary.
857 __ CheckConstPool(true, true); 858 __ CheckConstPool(true, true);
858 __ cmp(input, Operand(case_count)); 859 __ cmp(input, Operand(case_count));
859 __ BlockConstPoolFor(case_count + 2); 860 __ BlockConstPoolFor(case_count + 2);
860 __ ldr(pc, MemOperand(pc, input, LSL, 2), lo); 861 __ add(pc, pc, Operand(input, LSL, 2), LeaveCC, lo);
861 __ b(GetLabel(i.InputRpo(1))); 862 __ b(GetLabel(i.InputRpo(1)));
862 for (size_t index = 0; index < case_count; ++index) { 863 for (size_t index = 0; index < case_count; ++index) {
863 __ dd(GetLabel(i.InputRpo(index + 2))); 864 __ b(GetLabel(i.InputRpo(index + 2)));
864 } 865 }
865 } 866 }
866 867
867 868
868 void CodeGenerator::AssembleDeoptimizerCall( 869 void CodeGenerator::AssembleDeoptimizerCall(
869 int deoptimization_id, Deoptimizer::BailoutType bailout_type) { 870 int deoptimization_id, Deoptimizer::BailoutType bailout_type) {
870 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( 871 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry(
871 isolate(), deoptimization_id, bailout_type); 872 isolate(), deoptimization_id, bailout_type);
872 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); 873 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY);
873 } 874 }
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 } 1157 }
1157 } 1158 }
1158 MarkLazyDeoptSite(); 1159 MarkLazyDeoptSite();
1159 } 1160 }
1160 1161
1161 #undef __ 1162 #undef __
1162 1163
1163 } // namespace compiler 1164 } // namespace compiler
1164 } // namespace internal 1165 } // namespace internal
1165 } // namespace v8 1166 } // namespace v8
OLDNEW
« no previous file with comments | « src/arm/assembler-arm.cc ('k') | test/cctest/test-assembler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698