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

Unified Diff: src/IceTargetLoweringX86Base.h

Issue 1783893002: Subzero. X8664. No moar ::new for AutoBundle. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: 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 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/IceTargetLoweringX86Base.h
diff --git a/src/IceTargetLoweringX86Base.h b/src/IceTargetLoweringX86Base.h
index 48f04abbd6c65b7aacbb0f4511683e5301866a38..0c2523f9cb97940cbdd4e459b784455a53c6878d 100644
--- a/src/IceTargetLoweringX86Base.h
+++ b/src/IceTargetLoweringX86Base.h
@@ -461,7 +461,7 @@ protected:
X86OperandMem **findMemoryReference() { return nullptr; }
public:
- std::unique_ptr<AutoBundle> Bundler;
+ AutoBundle *Bundler = nullptr;
X86OperandMem **const MemOperand;
template <typename... T>
@@ -471,13 +471,18 @@ protected:
: findMemoryReference(Args...)) {
if (MemOperand != nullptr) {
if (Traits::Is64Bit) {
- Bundler = makeUnique<AutoBundle>(Target, BundleLockOpt);
+ Bundler = new (Target->Func->template allocate<AutoBundle>())
+ AutoBundle(Target, BundleLockOpt);
}
*MemOperand = Target->_sandbox_mem_reference(*MemOperand);
}
}
- ~AutoMemorySandboxer() {}
+ ~AutoMemorySandboxer() {
+ if (Bundler != nullptr) {
+ Bundler->~AutoBundle();
+ }
+ }
};
/// The following are helpers that insert lowered x86 instructions with
« 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