OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 // | 4 // |
5 // Modified by the Subzero authors. | 5 // Modified by the Subzero authors. |
6 // | 6 // |
7 //===- subzero/src/assembler_ia32.cpp - Assembler for x86-32 -------------===// | 7 //===- subzero/src/assembler_ia32.cpp - Assembler for x86-32 -------------===// |
8 // | 8 // |
9 // The Subzero Code Generator | 9 // The Subzero Code Generator |
10 // | 10 // |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 EmitUint8(0xFF); | 68 EmitUint8(0xFF); |
69 EmitRegisterOperand(2, reg); | 69 EmitRegisterOperand(2, reg); |
70 } | 70 } |
71 | 71 |
72 void AssemblerX86::call(const Address &address) { | 72 void AssemblerX86::call(const Address &address) { |
73 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 73 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
74 EmitUint8(0xFF); | 74 EmitUint8(0xFF); |
75 EmitOperand(2, address); | 75 EmitOperand(2, address); |
76 } | 76 } |
77 | 77 |
78 void AssemblerX86::call(Label *label) { | |
79 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | |
80 EmitUint8(0xE8); | |
81 static const int kSize = 5; | |
82 EmitLabel(label, kSize); | |
83 } | |
84 | |
85 void AssemblerX86::call(const ConstantRelocatable *label) { | 78 void AssemblerX86::call(const ConstantRelocatable *label) { |
86 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 79 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
87 intptr_t call_start = buffer_.GetPosition(); | 80 intptr_t call_start = buffer_.GetPosition(); |
88 EmitUint8(0xE8); | 81 EmitUint8(0xE8); |
89 EmitFixup(DirectCallRelocation::create(this, FK_PcRel_4, label)); | 82 EmitFixup(DirectCallRelocation::create(this, FK_PcRel_4, label)); |
90 EmitInt32(-4); | 83 EmitInt32(-4); |
91 assert((buffer_.GetPosition() - call_start) == kCallExternalLabelSize); | 84 assert((buffer_.GetPosition() - call_start) == kCallExternalLabelSize); |
92 (void)call_start; | 85 (void)call_start; |
93 } | 86 } |
94 | 87 |
(...skipping 2377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2472 assert(shifter == RegX8632::Encoded_Reg_ecx); | 2465 assert(shifter == RegX8632::Encoded_Reg_ecx); |
2473 (void)shifter; | 2466 (void)shifter; |
2474 if (Ty == IceType_i16) | 2467 if (Ty == IceType_i16) |
2475 EmitOperandSizeOverride(); | 2468 EmitOperandSizeOverride(); |
2476 EmitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); | 2469 EmitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); |
2477 EmitOperand(rm, operand); | 2470 EmitOperand(rm, operand); |
2478 } | 2471 } |
2479 | 2472 |
2480 } // end of namespace x86 | 2473 } // end of namespace x86 |
2481 } // end of namespace Ice | 2474 } // end of namespace Ice |
OLD | NEW |