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

Unified Diff: src/IceTargetLoweringX86BaseImpl.h

Issue 1860473002: Subzero. Refactors Switch Lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: git pull Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceSwitchLowering.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringX86BaseImpl.h
diff --git a/src/IceTargetLoweringX86BaseImpl.h b/src/IceTargetLoweringX86BaseImpl.h
index a344d57c960b294731cd27b7395562c1c0bc4447..afc8dcfc5463d59b66992a7a2cfb99256a5d0aa1 100644
--- a/src/IceTargetLoweringX86BaseImpl.h
+++ b/src/IceTargetLoweringX86BaseImpl.h
@@ -5881,10 +5881,8 @@ void TargetX86Base<TraitsType>::lowerCaseCluster(const CaseCluster &Case,
}
constexpr RelocOffsetT RelocOffset = 0;
- GlobalString FunctionName = Func->getFunctionName();
constexpr Variable *NoBase = nullptr;
- auto JTName = GlobalString::createWithString(
- Ctx, InstJumpTable::makeName(FunctionName, JumpTable->getId()));
+ auto JTName = GlobalString::createWithString(Ctx, JumpTable->getName());
Constant *Offset = Ctx->getConstantSym(RelocOffset, JTName);
uint16_t Shift = typeWidthInBytesLog2(PointerType);
constexpr auto Segment = X86OperandMem::SegmentRegisters::DefaultSegment;
@@ -7277,17 +7275,16 @@ TargetX86Base<TraitsType>::randomizeOrPoolImmediate(X86OperandMem *MemOperand,
template <typename TraitsType>
void TargetX86Base<TraitsType>::emitJumpTable(
- const Cfg *Func, const InstJumpTable *JumpTable) const {
+ const Cfg *, const InstJumpTable *JumpTable) const {
if (!BuildDefs::dump())
return;
Ostream &Str = Ctx->getStrEmit();
- const bool UseNonsfi = getFlags().getUseNonsfi();
- GlobalString FunctionName = Func->getFunctionName();
+ const bool UseNonsfi = Ctx->getFlags().getUseNonsfi();
const char *Prefix = UseNonsfi ? ".data.rel.ro." : ".rodata.";
- Str << "\t.section\t" << Prefix << FunctionName
- << "$jumptable,\"a\",@progbits\n";
- Str << "\t.align\t" << typeWidthInBytes(getPointerType()) << "\n";
- Str << InstJumpTable::makeName(FunctionName, JumpTable->getId()) << ":";
+ Str << "\t.section\t" << Prefix << JumpTable->getSectionName()
+ << ",\"a\",@progbits\n"
+ "\t.align\t" << typeWidthInBytes(getPointerType()) << "\n"
+ << JumpTable->getName() << ":";
// On X86 ILP32 pointers are 32-bit hence the use of .long
for (SizeT I = 0; I < JumpTable->getNumTargets(); ++I)
@@ -7389,10 +7386,10 @@ void TargetDataX86<TraitsType>::lowerJumpTables() {
Ostream &Str = Ctx->getStrEmit();
const char *Prefix = IsPIC ? ".data.rel.ro." : ".rodata.";
for (const JumpTableData &JT : Ctx->getJumpTables()) {
- Str << "\t.section\t" << Prefix << JT.getFunctionName()
- << "$jumptable,\"a\",@progbits\n";
- Str << "\t.align\t" << typeWidthInBytes(getPointerType()) << "\n";
- Str << InstJumpTable::makeName(JT.getFunctionName(), JT.getId()) << ":";
+ Str << "\t.section\t" << Prefix << JT.getSectionName()
+ << ",\"a\",@progbits\n"
+ "\t.align\t" << typeWidthInBytes(getPointerType()) << "\n"
+ << JT.getName().toString() << ":";
// On X8664 ILP32 pointers are 32-bit hence the use of .long
for (intptr_t TargetOffset : JT.getTargetOffsets())
« no previous file with comments | « src/IceSwitchLowering.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698