| OLD | NEW |
| 1 //===- subzero/src/assembler.h - Integrated assembler -----------*- C++ -*-===// | 1 //===- subzero/src/assembler.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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // When building the C++ tests, assertion code is enabled. To allow | 156 // When building the C++ tests, assertion code is enabled. To allow |
| 157 // asserting that the user of the assembler buffer has ensured the | 157 // asserting that the user of the assembler buffer has ensured the |
| 158 // capacity needed for emitting, we add a dummy method in non-debug mode. | 158 // capacity needed for emitting, we add a dummy method in non-debug mode. |
| 159 bool HasEnsuredCapacity() const { return true; } | 159 bool HasEnsuredCapacity() const { return true; } |
| 160 #endif // NDEBUG | 160 #endif // NDEBUG |
| 161 | 161 |
| 162 // Returns the position in the instruction stream. | 162 // Returns the position in the instruction stream. |
| 163 intptr_t GetPosition() const { return cursor_ - contents_; } | 163 intptr_t GetPosition() const { return cursor_ - contents_; } |
| 164 | 164 |
| 165 // For bringup only. | 165 // For bringup only. |
| 166 AssemblerFixup *GetLatestFixup() const; | 166 AssemblerFixup *GetLatestFixup(intptr_t position) const; |
| 167 | 167 |
| 168 private: | 168 private: |
| 169 // The limit is set to kMinimumGap bytes before the end of the data area. | 169 // The limit is set to kMinimumGap bytes before the end of the data area. |
| 170 // This leaves enough space for the longest possible instruction and allows | 170 // This leaves enough space for the longest possible instruction and allows |
| 171 // for a single, fast space check per instruction. | 171 // for a single, fast space check per instruction. |
| 172 static const intptr_t kMinimumGap = 32; | 172 static const intptr_t kMinimumGap = 32; |
| 173 | 173 |
| 174 uintptr_t contents_; | 174 uintptr_t contents_; |
| 175 uintptr_t cursor_; | 175 uintptr_t cursor_; |
| 176 uintptr_t limit_; | 176 uintptr_t limit_; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 226 |
| 227 virtual void BindCfgNodeLabel(SizeT NodeNumber) = 0; | 227 virtual void BindCfgNodeLabel(SizeT NodeNumber) = 0; |
| 228 | 228 |
| 229 private: | 229 private: |
| 230 llvm::BumpPtrAllocator Allocator; | 230 llvm::BumpPtrAllocator Allocator; |
| 231 }; | 231 }; |
| 232 | 232 |
| 233 } // end of namespace Ice | 233 } // end of namespace Ice |
| 234 | 234 |
| 235 #endif // SUBZERO_SRC_ASSEMBLER_H_ | 235 #endif // SUBZERO_SRC_ASSEMBLER_H_ |
| OLD | NEW |