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

Side by Side Diff: src/IceTargetLoweringARM32.cpp

Issue 1776473007: Subzero. Allocate global initializers from a dedicated arena. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Removes global variable (and initializer) allocation methods from GlobalContext. Created 4 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/IceTargetLowering.cpp ('k') | src/PNaClTranslator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTargetLoweringARM32.cpp - ARM32 lowering ------------===// 1 //===- subzero/src/IceTargetLoweringARM32.cpp - ARM32 lowering ------------===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 Context.insert<InstFakeDef>(T); 901 Context.insert<InstFakeDef>(T);
902 Context.insert<InstFakeDef>(GotPtr, T); 902 Context.insert<InstFakeDef>(GotPtr, T);
903 } 903 }
904 904
905 IceString TargetARM32::createGotoffRelocation(const ConstantRelocatable *CR) { 905 IceString TargetARM32::createGotoffRelocation(const ConstantRelocatable *CR) {
906 const IceString &CRName = CR->getName(); 906 const IceString &CRName = CR->getName();
907 const IceString CRGotoffName = 907 const IceString CRGotoffName =
908 "GOTOFF$" + Func->getFunctionName() + "$" + CRName; 908 "GOTOFF$" + Func->getFunctionName() + "$" + CRName;
909 if (KnownGotoffs.count(CRGotoffName) == 0) { 909 if (KnownGotoffs.count(CRGotoffName) == 0) {
910 constexpr bool SuppressMangling = true; 910 constexpr bool SuppressMangling = true;
911 auto *Global = VariableDeclaration::create(Ctx, SuppressMangling); 911 auto *Global =
912 VariableDeclaration::create(Func->getGlobalPool(), SuppressMangling);
912 Global->setIsConstant(true); 913 Global->setIsConstant(true);
913 Global->setName(CRName); 914 Global->setName(CRName);
915 Func->getGlobalPool()->willNotBeEmitted(Global);
914 916
915 auto *Gotoff = VariableDeclaration::create(Ctx, SuppressMangling); 917 auto *Gotoff =
918 VariableDeclaration::create(Func->getGlobalPool(), SuppressMangling);
916 constexpr auto GotFixup = R_ARM_GOTOFF32; 919 constexpr auto GotFixup = R_ARM_GOTOFF32;
917 Gotoff->setIsConstant(true); 920 Gotoff->setIsConstant(true);
918 Gotoff->addInitializer(VariableDeclaration::RelocInitializer::create( 921 Gotoff->addInitializer(VariableDeclaration::RelocInitializer::create(
919 Global, {RelocOffset::create(Ctx, 0)}, GotFixup)); 922 Func->getGlobalPool(), Global, {RelocOffset::create(Ctx, 0)},
923 GotFixup));
920 Gotoff->setName(CRGotoffName); 924 Gotoff->setName(CRGotoffName);
921 Func->addGlobal(Gotoff); 925 Func->addGlobal(Gotoff);
922 KnownGotoffs.emplace(CRGotoffName); 926 KnownGotoffs.emplace(CRGotoffName);
923 } 927 }
924 return CRGotoffName; 928 return CRGotoffName;
925 } 929 }
926 930
927 void TargetARM32::materializeGotAddr(CfgNode *Node) { 931 void TargetARM32::materializeGotAddr(CfgNode *Node) {
928 if (SandboxingType != ST_Nonsfi) { 932 if (SandboxingType != ST_Nonsfi) {
929 return; 933 return;
(...skipping 5963 matching lines...) Expand 10 before | Expand all | Expand 10 after
6893 // However, for compatibility with current NaCl LLVM, don't claim that. 6897 // However, for compatibility with current NaCl LLVM, don't claim that.
6894 Str << ".eabi_attribute 14, 3 @ Tag_ABI_PCS_R9_use: Not used\n"; 6898 Str << ".eabi_attribute 14, 3 @ Tag_ABI_PCS_R9_use: Not used\n";
6895 } 6899 }
6896 6900
6897 SmallBitVector TargetARM32::TypeToRegisterSet[RegARM32::RCARM32_NUM]; 6901 SmallBitVector TargetARM32::TypeToRegisterSet[RegARM32::RCARM32_NUM];
6898 SmallBitVector TargetARM32::TypeToRegisterSetUnfiltered[RegARM32::RCARM32_NUM]; 6902 SmallBitVector TargetARM32::TypeToRegisterSetUnfiltered[RegARM32::RCARM32_NUM];
6899 SmallBitVector TargetARM32::RegisterAliases[RegARM32::Reg_NUM]; 6903 SmallBitVector TargetARM32::RegisterAliases[RegARM32::Reg_NUM];
6900 6904
6901 } // end of namespace ARM32 6905 } // end of namespace ARM32
6902 } // end of namespace Ice 6906 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLowering.cpp ('k') | src/PNaClTranslator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698