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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/IceFixups.cpp ('k') | src/IceTargetLoweringX8664.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceOperand.h - High-level operands -----------*- C++ -*-===// 1 //===- subzero/src/IceOperand.h - High-level operands -----------*- C++ -*-===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 } 263 }
264 264
265 /// RelocOffset allows symbolic references in ConstantRelocatables' offsets, 265 /// RelocOffset allows symbolic references in ConstantRelocatables' offsets,
266 /// e.g., 8 + LabelOffset, where label offset is the location (code or data) 266 /// e.g., 8 + LabelOffset, where label offset is the location (code or data)
267 /// of a Label that is only determinable during ELF emission. 267 /// of a Label that is only determinable during ELF emission.
268 class RelocOffset final { 268 class RelocOffset final {
269 RelocOffset(const RelocOffset &) = delete; 269 RelocOffset(const RelocOffset &) = delete;
270 RelocOffset &operator=(const RelocOffset &) = delete; 270 RelocOffset &operator=(const RelocOffset &) = delete;
271 271
272 public: 272 public:
273 static RelocOffset *create(GlobalContext *Ctx) { 273 template <typename T> static RelocOffset *create(T *AllocOwner) {
274 return new (Ctx->allocate<RelocOffset>()) RelocOffset(); 274 return new (AllocOwner->template allocate<RelocOffset>()) RelocOffset();
275 } 275 }
276 276
277 static RelocOffset *create(GlobalContext *Ctx, RelocOffsetT Value) { 277 static RelocOffset *create(GlobalContext *Ctx, RelocOffsetT Value) {
278 return new (Ctx->allocate<RelocOffset>()) RelocOffset(Value); 278 return new (Ctx->allocate<RelocOffset>()) RelocOffset(Value);
279 } 279 }
280 280
281 void setSubtract(bool Value) { Subtract = Value; } 281 void setSubtract(bool Value) { Subtract = Value; }
282 bool hasOffset() const { return HasOffset; } 282 bool hasOffset() const { return HasOffset; }
283 283
284 RelocOffsetT getOffset() const { 284 RelocOffsetT getOffset() const {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 bool operator==(const RelocatableTuple &A, const RelocatableTuple &B); 335 bool operator==(const RelocatableTuple &A, const RelocatableTuple &B);
336 336
337 /// ConstantRelocatable represents a symbolic constant combined with a fixed 337 /// ConstantRelocatable represents a symbolic constant combined with a fixed
338 /// offset. 338 /// offset.
339 class ConstantRelocatable : public Constant { 339 class ConstantRelocatable : public Constant {
340 ConstantRelocatable() = delete; 340 ConstantRelocatable() = delete;
341 ConstantRelocatable(const ConstantRelocatable &) = delete; 341 ConstantRelocatable(const ConstantRelocatable &) = delete;
342 ConstantRelocatable &operator=(const ConstantRelocatable &) = delete; 342 ConstantRelocatable &operator=(const ConstantRelocatable &) = delete;
343 343
344 public: 344 public:
345 static ConstantRelocatable *create(GlobalContext *Ctx, Type Ty, 345 template <typename T>
346 static ConstantRelocatable *create(T *AllocOwner, Type Ty,
346 const RelocatableTuple &Tuple) { 347 const RelocatableTuple &Tuple) {
347 return new (Ctx->allocate<ConstantRelocatable>()) ConstantRelocatable( 348 return new (AllocOwner->template allocate<ConstantRelocatable>())
348 Ty, Tuple.Offset, Tuple.OffsetExpr, Tuple.Name, Tuple.EmitString); 349 ConstantRelocatable(Ty, Tuple.Offset, Tuple.OffsetExpr, Tuple.Name,
350 Tuple.EmitString);
349 } 351 }
350 352
351 RelocOffsetT getOffset() const { 353 RelocOffsetT getOffset() const {
352 RelocOffsetT Ret = Offset; 354 RelocOffsetT Ret = Offset;
353 for (const auto *const OffsetReloc : OffsetExpr) { 355 for (const auto *const OffsetReloc : OffsetExpr) {
354 Ret += OffsetReloc->getOffset(); 356 Ret += OffsetReloc->getOffset();
355 } 357 }
356 return Ret; 358 return Ret;
357 } 359 }
358 360
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 private: 943 private:
942 const Cfg *Func; 944 const Cfg *Func;
943 MetadataKind Kind; 945 MetadataKind Kind;
944 CfgVector<VariableTracking> Metadata; 946 CfgVector<VariableTracking> Metadata;
945 const static InstDefList NoDefinitions; 947 const static InstDefList NoDefinitions;
946 }; 948 };
947 949
948 } // end of namespace Ice 950 } // end of namespace Ice
949 951
950 #endif // SUBZERO_SRC_ICEOPERAND_H 952 #endif // SUBZERO_SRC_ICEOPERAND_H
OLDNEW
« 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