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

Side by Side Diff: src/assembler_ia32.cpp

Issue 1017373002: Subzero: Assemble calls to constant addresses. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: move test back Created 5 years, 9 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/assembler_ia32.h ('k') | src/main.cpp » ('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/assembler_ia32.cpp - Assembler for x86-32 -------------===// 1 //===- subzero/src/assembler_ia32.cpp - Assembler for x86-32 -------------===//
2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 2 // Copyright (c) 2013, 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 void AssemblerX86::call(const ConstantRelocatable *label) { 105 void AssemblerX86::call(const ConstantRelocatable *label) {
106 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 106 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
107 intptr_t call_start = buffer_.GetPosition(); 107 intptr_t call_start = buffer_.GetPosition();
108 EmitUint8(0xE8); 108 EmitUint8(0xE8);
109 EmitFixup(this->createFixup(llvm::ELF::R_386_PC32, label)); 109 EmitFixup(this->createFixup(llvm::ELF::R_386_PC32, label));
110 EmitInt32(-4); 110 EmitInt32(-4);
111 assert((buffer_.GetPosition() - call_start) == kCallExternalLabelSize); 111 assert((buffer_.GetPosition() - call_start) == kCallExternalLabelSize);
112 (void)call_start; 112 (void)call_start;
113 } 113 }
114 114
115 void AssemblerX86::call(const Immediate &abs_address) {
116 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
117 intptr_t call_start = buffer_.GetPosition();
118 EmitUint8(0xE8);
119 EmitFixup(
120 this->createFixup(llvm::ELF::R_386_PC32, AssemblerFixup::NullSymbol));
121 EmitInt32(abs_address.value() - 4);
122 assert((buffer_.GetPosition() - call_start) == kCallExternalLabelSize);
123 (void)call_start;
124 }
125
115 void AssemblerX86::pushl(GPRRegister reg) { 126 void AssemblerX86::pushl(GPRRegister reg) {
116 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 127 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
117 EmitUint8(0x50 + reg); 128 EmitUint8(0x50 + reg);
118 } 129 }
119 130
120 void AssemblerX86::popl(GPRRegister reg) { 131 void AssemblerX86::popl(GPRRegister reg) {
121 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 132 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
122 EmitUint8(0x58 + reg); 133 EmitUint8(0x58 + reg);
123 } 134 }
124 135
(...skipping 2389 matching lines...) Expand 10 before | Expand all | Expand 10 after
2514 assert(shifter == RegX8632::Encoded_Reg_ecx); 2525 assert(shifter == RegX8632::Encoded_Reg_ecx);
2515 (void)shifter; 2526 (void)shifter;
2516 if (Ty == IceType_i16) 2527 if (Ty == IceType_i16)
2517 EmitOperandSizeOverride(); 2528 EmitOperandSizeOverride();
2518 EmitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); 2529 EmitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3);
2519 EmitOperand(rm, operand); 2530 EmitOperand(rm, operand);
2520 } 2531 }
2521 2532
2522 } // end of namespace x86 2533 } // end of namespace x86
2523 } // end of namespace Ice 2534 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/assembler_ia32.h ('k') | src/main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698