OLD | NEW |
1 //===- subzero/src/IceAssembler.cpp - Assembler base class ----------------===// | 1 //===- subzero/src/IceAssembler.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 // This is forked from Dart revision 39313. | 8 // This is forked from Dart revision 39313. |
9 // Please update the revision if we merge back changes from Dart. | 9 // Please update the revision if we merge back changes from Dart. |
10 // https://code.google.com/p/dart/wiki/GettingTheSource | 10 // https://code.google.com/p/dart/wiki/GettingTheSource |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 F->set_value(Value); | 59 F->set_value(Value); |
60 installFixup(F); | 60 installFixup(F); |
61 return F; | 61 return F; |
62 } | 62 } |
63 | 63 |
64 AssemblerTextFixup *AssemblerBuffer::createTextFixup(const std::string &Text, | 64 AssemblerTextFixup *AssemblerBuffer::createTextFixup(const std::string &Text, |
65 size_t BytesUsed) { | 65 size_t BytesUsed) { |
66 AssemblerTextFixup *F = new (Assemblr.allocate<AssemblerTextFixup>()) | 66 AssemblerTextFixup *F = new (Assemblr.allocate<AssemblerTextFixup>()) |
67 AssemblerTextFixup(Text, BytesUsed); | 67 AssemblerTextFixup(Text, BytesUsed); |
68 installFixup(F); | 68 installFixup(F); |
69 TextFixupNeeded = false; | 69 resetNeedsTextFixup(); |
70 return F; | 70 return F; |
71 } | 71 } |
72 | 72 |
73 void AssemblerBuffer::EnsureCapacity::validate(AssemblerBuffer *buffer) { | 73 void AssemblerBuffer::EnsureCapacity::validate(AssemblerBuffer *buffer) { |
74 // In debug mode, we save the assembler buffer along with the gap size before | 74 // In debug mode, we save the assembler buffer along with the gap size before |
75 // we start emitting to the buffer. This allows us to check that any single | 75 // we start emitting to the buffer. This allows us to check that any single |
76 // generated instruction doesn't overflow the limit implied by the minimum | 76 // generated instruction doesn't overflow the limit implied by the minimum |
77 // gap size. | 77 // gap size. |
78 Gap = computeGap(); | 78 Gap = computeGap(); |
79 // Make sure that extending the capacity leaves a big enough gap for any kind | 79 // Make sure that extending the capacity leaves a big enough gap for any kind |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 159 } |
160 // Handle any bytes that are not prefixed by a fixup. | 160 // Handle any bytes that are not prefixed by a fixup. |
161 for (intptr_t i = CurPosition; i < EndPosition; ++i) { | 161 for (intptr_t i = CurPosition; i < EndPosition; ++i) { |
162 Str << "\t.byte 0x"; | 162 Str << "\t.byte 0x"; |
163 Str.write_hex(Buffer.load<uint8_t>(i)); | 163 Str.write_hex(Buffer.load<uint8_t>(i)); |
164 Str << "\n"; | 164 Str << "\n"; |
165 } | 165 } |
166 } | 166 } |
167 | 167 |
168 } // end of namespace Ice | 168 } // end of namespace Ice |
OLD | NEW |