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

Unified Diff: src/IceTargetLowering.cpp

Issue 1585843007: Subzero. RAII NaCl Bundling. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 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 | « src/IceTargetLowering.h ('k') | src/IceTargetLoweringARM32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLowering.cpp
diff --git a/src/IceTargetLowering.cpp b/src/IceTargetLowering.cpp
index 04f77e61b2caf26ea4fe4bedffc1efae35434fcd..2873272a63cdaf206884e8120698caef4187d5ec 100644
--- a/src/IceTargetLowering.cpp
+++ b/src/IceTargetLowering.cpp
@@ -152,6 +152,25 @@ void TargetLowering::staticInit(const ClFlags &Flags) {
TargetLowering::TargetLowering(Cfg *Func)
: Func(Func), Ctx(Func->getContext()), Context() {}
+TargetLowering::AutoBundle::AutoBundle(TargetLowering *Target,
+ InstBundleLock::Option Option)
+ : Target(Target),
+ NeedSandboxing(Target->Ctx->getFlags().getUseSandboxing()) {
+ assert(!Target->AutoBundling);
+ Target->AutoBundling = true;
+ if (NeedSandboxing) {
+ Target->_bundle_lock(Option);
+ }
+}
+
+TargetLowering::AutoBundle::~AutoBundle() {
+ assert(Target->AutoBundling);
+ Target->AutoBundling = false;
+ if (NeedSandboxing) {
+ Target->_bundle_unlock();
+ }
+}
+
void TargetLowering::genTargetHelperCalls() {
for (CfgNode *Node : Func->getNodes()) {
Context.init(Node);
« no previous file with comments | « src/IceTargetLowering.h ('k') | src/IceTargetLoweringARM32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698