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 18 matching lines...) Expand all Loading... |
29 #include "IceOperand.h" | 29 #include "IceOperand.h" |
30 | 30 |
31 namespace Ice { | 31 namespace Ice { |
32 | 32 |
33 static uintptr_t NewContents(Assembler &Assemblr, intptr_t Capacity) { | 33 static uintptr_t NewContents(Assembler &Assemblr, intptr_t Capacity) { |
34 uintptr_t Result = Assemblr.allocateBytes(Capacity); | 34 uintptr_t Result = Assemblr.allocateBytes(Capacity); |
35 return Result; | 35 return Result; |
36 } | 36 } |
37 | 37 |
38 void AssemblerBuffer::installFixup(AssemblerFixup *F) { | 38 void AssemblerBuffer::installFixup(AssemblerFixup *F) { |
39 F->set_position(0); | |
40 if (!Assemblr.getPreliminary()) | 39 if (!Assemblr.getPreliminary()) |
41 Fixups.push_back(F); | 40 Fixups.push_back(F); |
42 } | 41 } |
43 | 42 |
44 AssemblerFixup *AssemblerBuffer::createFixup(FixupKind Kind, | 43 AssemblerFixup *AssemblerBuffer::createFixup(FixupKind Kind, |
45 const Constant *Value) { | 44 const Constant *Value) { |
46 AssemblerFixup *F = | 45 AssemblerFixup *F = |
47 new (Assemblr.allocate<AssemblerFixup>()) AssemblerFixup(); | 46 new (Assemblr.allocate<AssemblerFixup>()) AssemblerFixup(); |
48 F->set_kind(Kind); | 47 F->set_kind(Kind); |
49 F->set_value(Value); | 48 F->set_value(Value); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 } | 154 } |
156 // Handle any bytes that are not prefixed by a fixup. | 155 // Handle any bytes that are not prefixed by a fixup. |
157 for (intptr_t i = CurPosition; i < EndPosition; ++i) { | 156 for (intptr_t i = CurPosition; i < EndPosition; ++i) { |
158 Str << "\t.byte 0x"; | 157 Str << "\t.byte 0x"; |
159 Str.write_hex(Buffer.load<uint8_t>(i)); | 158 Str.write_hex(Buffer.load<uint8_t>(i)); |
160 Str << "\n"; | 159 Str << "\n"; |
161 } | 160 } |
162 } | 161 } |
163 | 162 |
164 } // end of namespace Ice | 163 } // end of namespace Ice |
OLD | NEW |