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

Unified Diff: src/IceCfg.cpp

Issue 848193003: Subzero: Add locking to prepare for multithreaded translation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 5 years, 11 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 | src/IceConverter.cpp » ('j') | src/IceGlobalContext.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfg.cpp
diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp
index e8c74bacc3a08c3e44c460092ed950edfea76395..8eac918b69d671de8fb9e15b511b27b157456b71 100644
--- a/src/IceCfg.cpp
+++ b/src/IceCfg.cpp
@@ -56,6 +56,7 @@ Cfg::~Cfg() {
void Cfg::setError(const IceString &Message) {
HasError = true;
ErrorMessage = Message;
+ OstreamLocker L(Ctx);
Ctx->getStrDump() << "ICE translation error: " << ErrorMessage << "\n";
}
@@ -335,6 +336,7 @@ void Cfg::liveness(LivenessMode Mode) {
bool Cfg::validateLiveness() const {
TimerMarker T(TimerStack::TT_validateLiveness, this);
bool Valid = true;
+ OstreamLocker L(Ctx);
Ostream &Str = Ctx->getStrDump();
for (CfgNode *Node : Nodes) {
Inst *FirstInst = nullptr;
@@ -442,6 +444,7 @@ void Cfg::emit() {
liveness(Liveness_Basic);
dump("After recomputing liveness for -decorate-asm");
}
+ OstreamLocker L(Ctx);
Ostream &Str = Ctx->getStrEmit();
IceString MangledName = getContext()->mangleName(getFunctionName());
emitTextHeader(MangledName);
@@ -454,6 +457,7 @@ void Cfg::emitIAS() {
TimerMarker T(TimerStack::TT_emit, this);
assert(!Ctx->getFlags().DecorateAsm);
IceString MangledName = getContext()->mangleName(getFunctionName());
+ OstreamLocker L(Ctx);
if (!Ctx->getFlags().UseELFWriter)
jvoung (off chromium) 2015/01/15 18:20:40 Technically, the lock doesn't need to be held this
Jim Stichnoth 2015/01/17 18:44:16 Done.
emitTextHeader(MangledName);
for (CfgNode *Node : Nodes)
@@ -474,6 +478,7 @@ void Cfg::dump(const IceString &Message) {
return;
if (!Ctx->isVerbose())
return;
+ OstreamLocker L(Ctx);
Ostream &Str = Ctx->getStrDump();
if (!Message.empty())
Str << "================ " << Message << " ================\n";
« no previous file with comments | « no previous file | src/IceConverter.cpp » ('j') | src/IceGlobalContext.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698