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

Unified Diff: src/IceOperand.h

Issue 1773503003: Subzero: Control memory growth from local label fixups. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Attempt to fix -nonsfi -filetype=iasm -target=arm32 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 | « src/IceFixups.cpp ('k') | src/IceTargetLoweringX8664.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceOperand.h
diff --git a/src/IceOperand.h b/src/IceOperand.h
index 888e4df2f52b124eb0dbed809487580dd10501f1..bc48b74da0639623550479d341a400dc5ec01dde 100644
--- a/src/IceOperand.h
+++ b/src/IceOperand.h
@@ -270,8 +270,8 @@ class RelocOffset final {
RelocOffset &operator=(const RelocOffset &) = delete;
public:
- static RelocOffset *create(GlobalContext *Ctx) {
- return new (Ctx->allocate<RelocOffset>()) RelocOffset();
+ template <typename T> static RelocOffset *create(T *AllocOwner) {
+ return new (AllocOwner->template allocate<RelocOffset>()) RelocOffset();
}
static RelocOffset *create(GlobalContext *Ctx, RelocOffsetT Value) {
@@ -342,10 +342,12 @@ class ConstantRelocatable : public Constant {
ConstantRelocatable &operator=(const ConstantRelocatable &) = delete;
public:
- static ConstantRelocatable *create(GlobalContext *Ctx, Type Ty,
+ template <typename T>
+ static ConstantRelocatable *create(T *AllocOwner, Type Ty,
const RelocatableTuple &Tuple) {
- return new (Ctx->allocate<ConstantRelocatable>()) ConstantRelocatable(
- Ty, Tuple.Offset, Tuple.OffsetExpr, Tuple.Name, Tuple.EmitString);
+ return new (AllocOwner->template allocate<ConstantRelocatable>())
+ ConstantRelocatable(Ty, Tuple.Offset, Tuple.OffsetExpr, Tuple.Name,
+ Tuple.EmitString);
}
RelocOffsetT getOffset() const {
« no previous file with comments | « src/IceFixups.cpp ('k') | src/IceTargetLoweringX8664.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698