Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: src/IceAssembler.cpp

Issue 1397933002: Start incorporating the ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nit and add URL. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceAssembler.h ('k') | src/IceAssemblerARM32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 // Verify internal state. 112 // Verify internal state.
113 assert(capacity() == new_capacity); 113 assert(capacity() == new_capacity);
114 assert(size() == old_size); 114 assert(size() == old_size);
115 } 115 }
116 116
117 llvm::StringRef Assembler::getBufferView() const { 117 llvm::StringRef Assembler::getBufferView() const {
118 return llvm::StringRef(reinterpret_cast<const char *>(Buffer.contents()), 118 return llvm::StringRef(reinterpret_cast<const char *>(Buffer.contents()),
119 Buffer.size()); 119 Buffer.size());
120 } 120 }
121 121
122 void Assembler::emitIASBytes(GlobalContext *Ctx) const { 122 void Assembler::emitIASBytes() const {
123 Ostream &Str = Ctx->getStrEmit(); 123 Ostream &Str = Ctx->getStrEmit();
124 intptr_t EndPosition = Buffer.size(); 124 intptr_t EndPosition = Buffer.size();
125 intptr_t CurPosition = 0; 125 intptr_t CurPosition = 0;
126 const intptr_t FixupSize = 4; 126 const intptr_t FixupSize = 4;
127 for (const AssemblerFixup *NextFixup : fixups()) { 127 for (const AssemblerFixup *NextFixup : fixups()) {
128 intptr_t NextFixupLoc = NextFixup->position(); 128 intptr_t NextFixupLoc = NextFixup->position();
129 for (intptr_t i = CurPosition; i < NextFixupLoc; ++i) { 129 for (intptr_t i = CurPosition; i < NextFixupLoc; ++i) {
130 Str << "\t.byte 0x"; 130 Str << "\t.byte 0x";
131 Str.write_hex(Buffer.load<uint8_t>(i)); 131 Str.write_hex(Buffer.load<uint8_t>(i));
132 Str << "\n"; 132 Str << "\n";
(...skipping 12 matching lines...) Expand all
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
OLDNEW
« no previous file with comments | « src/IceAssembler.h ('k') | src/IceAssemblerARM32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698