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

Unified Diff: src/IceGlobalContext.cpp

Issue 2099293002: Subzero: Make -translate-only work with nonzero -threads=<N>. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceGlobalContext.cpp
diff --git a/src/IceGlobalContext.cpp b/src/IceGlobalContext.cpp
index a1e817bfad7c905f714e1eeae4b75f6b9537f7c1..349db7cc4ff4bb7db75c5233ce3d3ec1f318a91b 100644
--- a/src/IceGlobalContext.cpp
+++ b/src/IceGlobalContext.cpp
@@ -362,6 +362,7 @@ GlobalContext::GlobalContext(Ostream *OsDump, Ostream *OsEmit, Ostream *OsError,
void GlobalContext::translateFunctions() {
TimerMarker Timer(TimerStack::TT_translateFunctions, this);
while (std::unique_ptr<OptWorkItem> OptItem = optQueueBlockingPop()) {
+ std::unique_ptr<EmitterWorkItem> Item;
auto Func = OptItem->getParsedCfg();
// Install Func in TLS for Cfg-specific container allocators.
CfgLocalAllocatorScope _(Func.get());
@@ -379,11 +380,14 @@ void GlobalContext::translateFunctions() {
!getFlags().matchTranslateOnly(Func->getFunctionName(),
Func->getSequenceNumber())) {
Func->dump();
+ // Add a dummy work item as a placeholder. This maintains sequence
+ // numbers so that the emitter thread will emit subsequent functions.
+ Item = makeUnique<EmitterWorkItem>(Func->getSequenceNumber());
+ emitQueueBlockingPush(std::move(Item));
continue; // Func goes out of scope and gets deleted
}
Func->translate();
- std::unique_ptr<EmitterWorkItem> Item;
if (Func->hasError()) {
getErrorStatus()->assign(EC_Translation);
OstreamLocker L(this);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698