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

Unified Diff: src/IceTargetLoweringX8632.cpp

Issue 916653004: Subzero: Emit functions and global initializers in a separate thread. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Const change Created 5 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/IceTargetLoweringX8632.h ('k') | src/IceThreading.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringX8632.cpp
diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp
index 9fd0106a39cbbbb1530d85bd0d5153ab0d764ee7..51f1f3b81bfd14a680d953be8630589cd28a25ce 100644
--- a/src/IceTargetLoweringX8632.cpp
+++ b/src/IceTargetLoweringX8632.cpp
@@ -4639,10 +4639,20 @@ void TargetDataX8632::lowerGlobal(const VariableDeclaration &Var) const {
Str << "\t.size\t" << MangledName << ", " << Size << "\n";
}
-void
-TargetDataX8632::lowerGlobalsELF(const VariableDeclarationList &Vars) const {
- ELFObjectWriter *Writer = Ctx->getObjectWriter();
- Writer->writeDataSection(Vars, llvm::ELF::R_386_32);
+void TargetDataX8632::lowerGlobals(
+ std::unique_ptr<VariableDeclarationList> Vars) const {
+ if (Ctx->getFlags().getUseELFWriter()) {
+ ELFObjectWriter *Writer = Ctx->getObjectWriter();
+ Writer->writeDataSection(*Vars, llvm::ELF::R_386_32);
+ } else {
+ const IceString &TranslateOnly = Ctx->getFlags().getTranslateOnly();
+ OstreamLocker L(Ctx);
+ for (const VariableDeclaration *Var : *Vars) {
+ if (GlobalContext::matchSymbolName(Var->getName(), TranslateOnly)) {
+ lowerGlobal(*Var);
+ }
+ }
+ }
}
template <typename T> struct PoolTypeConverter {};
@@ -4701,7 +4711,7 @@ void TargetDataX8632::emitConstantPool(GlobalContext *Ctx) {
}
}
-void TargetDataX8632::lowerConstants(GlobalContext *Ctx) const {
+void TargetDataX8632::lowerConstants() const {
if (Ctx->getFlags().getDisableTranslation())
return;
// No need to emit constants from the int pool since (for x86) they
« no previous file with comments | « src/IceTargetLoweringX8632.h ('k') | src/IceThreading.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698