OLD | NEW |
1 //===- subzero/src/assembler.cpp - Assembler base class -------------------===// | 1 //===- subzero/src/assembler.cpp - Assembler base class -------------------===// |
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 56 matching lines...) Loading... |
67 fixups_processed_ = false; | 67 fixups_processed_ = false; |
68 #endif // !NDEBUG | 68 #endif // !NDEBUG |
69 | 69 |
70 // Verify internal state. | 70 // Verify internal state. |
71 assert(Capacity() == kInitialBufferCapacity); | 71 assert(Capacity() == kInitialBufferCapacity); |
72 assert(Size() == 0); | 72 assert(Size() == 0); |
73 } | 73 } |
74 | 74 |
75 AssemblerBuffer::~AssemblerBuffer() {} | 75 AssemblerBuffer::~AssemblerBuffer() {} |
76 | 76 |
77 // Returns the latest fixup at or after the given position, or NULL if | 77 // Returns the latest fixup at or after the given position, or nullptr if |
78 // there is none. Assumes fixups were added in increasing order. | 78 // there is none. Assumes fixups were added in increasing order. |
79 AssemblerFixup *AssemblerBuffer::GetLatestFixup(intptr_t position) const { | 79 AssemblerFixup *AssemblerBuffer::GetLatestFixup(intptr_t position) const { |
80 AssemblerFixup *latest_fixup = NULL; | 80 AssemblerFixup *latest_fixup = nullptr; |
81 for (auto I = fixups_.rbegin(), E = fixups_.rend(); I != E; ++I) { | 81 for (auto I = fixups_.rbegin(), E = fixups_.rend(); I != E; ++I) { |
82 if ((*I)->position() < position) | 82 if ((*I)->position() < position) |
83 return latest_fixup; | 83 return latest_fixup; |
84 latest_fixup = *I; | 84 latest_fixup = *I; |
85 } | 85 } |
86 return latest_fixup; | 86 return latest_fixup; |
87 } | 87 } |
88 | 88 |
89 void AssemblerBuffer::ProcessFixups(const MemoryRegion ®ion) { | 89 void AssemblerBuffer::ProcessFixups(const MemoryRegion ®ion) { |
90 for (SizeT I = 0; I < fixups_.size(); ++I) { | 90 for (SizeT I = 0; I < fixups_.size(); ++I) { |
(...skipping 36 matching lines...) Loading... |
127 // Update the cursor and recompute the limit. | 127 // Update the cursor and recompute the limit. |
128 cursor_ += delta; | 128 cursor_ += delta; |
129 limit_ = ComputeLimit(new_contents, new_capacity); | 129 limit_ = ComputeLimit(new_contents, new_capacity); |
130 | 130 |
131 // Verify internal state. | 131 // Verify internal state. |
132 assert(Capacity() == new_capacity); | 132 assert(Capacity() == new_capacity); |
133 assert(Size() == old_size); | 133 assert(Size() == old_size); |
134 } | 134 } |
135 | 135 |
136 } // end of namespace Ice | 136 } // end of namespace Ice |
OLD | NEW |