OLD | NEW |
1 //===- subzero/src/IceAssembler.h - Integrated assembler --------*- C++ -*-===// | 1 //===- subzero/src/IceAssembler.h - Integrated assembler --------*- C++ -*-===// |
2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
5 // | 5 // |
6 // Modified by the Subzero authors. | 6 // Modified by the Subzero authors. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // The Subzero Code Generator | 10 // The Subzero Code Generator |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 /// Create and track a fixup in the current function. | 177 /// Create and track a fixup in the current function. |
178 AssemblerFixup *createFixup(FixupKind Kind, const Constant *Value); | 178 AssemblerFixup *createFixup(FixupKind Kind, const Constant *Value); |
179 | 179 |
180 /// Create and track a textual fixup in the current function. | 180 /// Create and track a textual fixup in the current function. |
181 AssemblerTextFixup *createTextFixup(const std::string &Text, | 181 AssemblerTextFixup *createTextFixup(const std::string &Text, |
182 size_t BytesUsed); | 182 size_t BytesUsed); |
183 | 183 |
184 /// Mark that an attempt was made to emit, but failed. Hence, in order to | 184 /// Mark that an attempt was made to emit, but failed. Hence, in order to |
185 /// continue, one must emit a text fixup. | 185 /// continue, one must emit a text fixup. |
186 void setNeedsTextFixup() { TextFixupNeeded = true; } | 186 void setNeedsTextFixup() { TextFixupNeeded = true; } |
| 187 void resetNeedsTextFixup() { TextFixupNeeded = false; } |
187 | 188 |
188 /// Returns true if last emit failed and needs a text fixup. | 189 /// Returns true if last emit failed and needs a text fixup. |
189 bool needsTextFixup() const { return TextFixupNeeded; } | 190 bool needsTextFixup() const { return TextFixupNeeded; } |
190 | 191 |
191 /// Installs a created fixup, after it has been allocated. | 192 /// Installs a created fixup, after it has been allocated. |
192 void installFixup(AssemblerFixup *F); | 193 void installFixup(AssemblerFixup *F); |
193 | 194 |
194 const FixupRefList &fixups() const { return Fixups; } | 195 const FixupRefList &fixups() const { return Fixups; } |
195 | 196 |
196 void setSize(intptr_t NewSize) { | 197 void setSize(intptr_t NewSize) { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 AssemblerFixup *createFixup(FixupKind Kind, const Constant *Value) { | 304 AssemblerFixup *createFixup(FixupKind Kind, const Constant *Value) { |
304 return Buffer.createFixup(Kind, Value); | 305 return Buffer.createFixup(Kind, Value); |
305 } | 306 } |
306 | 307 |
307 AssemblerTextFixup *createTextFixup(const std::string &Text, | 308 AssemblerTextFixup *createTextFixup(const std::string &Text, |
308 size_t BytesUsed) { | 309 size_t BytesUsed) { |
309 return Buffer.createTextFixup(Text, BytesUsed); | 310 return Buffer.createTextFixup(Text, BytesUsed); |
310 } | 311 } |
311 | 312 |
312 void setNeedsTextFixup() { Buffer.setNeedsTextFixup(); } | 313 void setNeedsTextFixup() { Buffer.setNeedsTextFixup(); } |
| 314 void resetNeedsTextFixup() { Buffer.resetNeedsTextFixup(); } |
313 | 315 |
314 bool needsTextFixup() const { return Buffer.needsTextFixup(); } | 316 bool needsTextFixup() const { return Buffer.needsTextFixup(); } |
315 | 317 |
316 void emitIASBytes(GlobalContext *Ctx) const; | 318 void emitIASBytes(GlobalContext *Ctx) const; |
317 bool getInternal() const { return IsInternal; } | 319 bool getInternal() const { return IsInternal; } |
318 void setInternal(bool Internal) { IsInternal = Internal; } | 320 void setInternal(bool Internal) { IsInternal = Internal; } |
319 const IceString &getFunctionName() { return FunctionName; } | 321 const IceString &getFunctionName() { return FunctionName; } |
320 void setFunctionName(const IceString &NewName) { FunctionName = NewName; } | 322 void setFunctionName(const IceString &NewName) { FunctionName = NewName; } |
321 intptr_t getBufferSize() const { return Buffer.size(); } | 323 intptr_t getBufferSize() const { return Buffer.size(); } |
322 /// Roll back to a (smaller) size. | 324 /// Roll back to a (smaller) size. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 protected: | 364 protected: |
363 // Buffer's constructor uses the Allocator, so it needs to appear after it. | 365 // Buffer's constructor uses the Allocator, so it needs to appear after it. |
364 // TODO(jpp): dependencies on construction order are a nice way of shooting | 366 // TODO(jpp): dependencies on construction order are a nice way of shooting |
365 // yourself in the foot. Fix this. | 367 // yourself in the foot. Fix this. |
366 AssemblerBuffer Buffer; | 368 AssemblerBuffer Buffer; |
367 }; | 369 }; |
368 | 370 |
369 } // end of namespace Ice | 371 } // end of namespace Ice |
370 | 372 |
371 #endif // SUBZERO_SRC_ICEASSEMBLER_H_ | 373 #endif // SUBZERO_SRC_ICEASSEMBLER_H_ |
OLD | NEW |