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

Side by Side Diff: src/IceOperand.cpp

Issue 802183004: Subzero: Use CFG-local arena allocation for relevant containers. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Typo fix Created 6 years 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/IceOperand.h ('k') | src/IceTargetLoweringX8632.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.cpp - High-level operand implementation -----===// 1 //===- subzero/src/IceOperand.cpp - High-level operand implementation -----===//
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 // This file implements the Operand class and its target-independent 10 // This file implements the Operand class and its target-independent
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 while (TrimmedBegin != Range.end() && TrimmedBegin->second <= Lower) 119 while (TrimmedBegin != Range.end() && TrimmedBegin->second <= Lower)
120 ++TrimmedBegin; 120 ++TrimmedBegin;
121 } 121 }
122 122
123 IceString Variable::getName(const Cfg *Func) const { 123 IceString Variable::getName(const Cfg *Func) const {
124 if (Func && NameIndex >= 0) 124 if (Func && NameIndex >= 0)
125 return Func->getIdentifierName(NameIndex); 125 return Func->getIdentifierName(NameIndex);
126 return "__" + std::to_string(getIndex()); 126 return "__" + std::to_string(getIndex());
127 } 127 }
128 128
129 Variable Variable::asType(Type Ty) { 129 Variable *Variable::asType(Type Ty) {
130 // Note: This returns a Variable, even if the "this" object is a 130 // Note: This returns a Variable, even if the "this" object is a
131 // subclass of Variable. 131 // subclass of Variable.
132 Variable V(kVariable, Ty, Number); 132 if (!ALLOW_DUMP || getType() == Ty)
133 V.NameIndex = NameIndex; 133 return this;
134 V.RegNum = RegNum; 134 Variable *V = new (getCurrentCfgAllocator()->Allocate<Variable>())
135 V.StackOffset = StackOffset; 135 Variable(kVariable, Ty, Number);
136 V->NameIndex = NameIndex;
137 V->RegNum = RegNum;
138 V->StackOffset = StackOffset;
136 return V; 139 return V;
137 } 140 }
138 141
139 void VariableTracking::markUse(MetadataKind TrackingKind, const Inst *Instr, 142 void VariableTracking::markUse(MetadataKind TrackingKind, const Inst *Instr,
140 const CfgNode *Node, bool IsFromDef, 143 const CfgNode *Node, bool IsFromDef,
141 bool IsImplicit) { 144 bool IsImplicit) {
142 (void)TrackingKind; 145 (void)TrackingKind;
143 if (MultiBlock == MBS_MultiBlock) 146 if (MultiBlock == MBS_MultiBlock)
144 return; 147 return;
145 // TODO(stichnot): If the use occurs as a source operand in the 148 // TODO(stichnot): If the use occurs as a source operand in the
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 if (!ALLOW_DUMP) 483 if (!ALLOW_DUMP)
481 return Str; 484 return Str;
482 if (W.getWeight() == RegWeight::Inf) 485 if (W.getWeight() == RegWeight::Inf)
483 Str << "Inf"; 486 Str << "Inf";
484 else 487 else
485 Str << W.getWeight(); 488 Str << W.getWeight();
486 return Str; 489 return Str;
487 } 490 }
488 491
489 } // end of namespace Ice 492 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceOperand.h ('k') | src/IceTargetLoweringX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698