| 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 // 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 intptr_t CurPosition = 0; | 129 intptr_t CurPosition = 0; |
| 130 const intptr_t FixupSize = 4; | 130 const intptr_t FixupSize = 4; |
| 131 for (const AssemblerFixup *NextFixup : fixups()) { | 131 for (const AssemblerFixup *NextFixup : fixups()) { |
| 132 intptr_t NextFixupLoc = NextFixup->position(); | 132 intptr_t NextFixupLoc = NextFixup->position(); |
| 133 for (intptr_t i = CurPosition; i < NextFixupLoc; ++i) { | 133 for (intptr_t i = CurPosition; i < NextFixupLoc; ++i) { |
| 134 Str << "\t.byte 0x"; | 134 Str << "\t.byte 0x"; |
| 135 Str.write_hex(buffer_.Load<uint8_t>(i)); | 135 Str.write_hex(buffer_.Load<uint8_t>(i)); |
| 136 Str << "\n"; | 136 Str << "\n"; |
| 137 } | 137 } |
| 138 Str << "\t.long "; | 138 Str << "\t.long "; |
| 139 NextFixup->emit(Ctx); | 139 NextFixup->emit(Ctx, buffer_.Load<RelocOffsetT>(NextFixupLoc)); |
| 140 if (fixupIsPCRel(NextFixup->kind())) | 140 if (fixupIsPCRel(NextFixup->kind())) |
| 141 Str << " - (. + " << FixupSize << ")"; | 141 Str << " - ."; |
| 142 Str << "\n"; | 142 Str << "\n"; |
| 143 CurPosition = NextFixupLoc + FixupSize; | 143 CurPosition = NextFixupLoc + FixupSize; |
| 144 assert(CurPosition <= EndPosition); | 144 assert(CurPosition <= EndPosition); |
| 145 } | 145 } |
| 146 // Handle any bytes that are not prefixed by a fixup. | 146 // Handle any bytes that are not prefixed by a fixup. |
| 147 for (intptr_t i = CurPosition; i < EndPosition; ++i) { | 147 for (intptr_t i = CurPosition; i < EndPosition; ++i) { |
| 148 Str << "\t.byte 0x"; | 148 Str << "\t.byte 0x"; |
| 149 Str.write_hex(buffer_.Load<uint8_t>(i)); | 149 Str.write_hex(buffer_.Load<uint8_t>(i)); |
| 150 Str << "\n"; | 150 Str << "\n"; |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 | 153 |
| 154 } // end of namespace Ice | 154 } // end of namespace Ice |
| OLD | NEW |