| 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 // |
| 11 // This file is distributed under the University of Illinois Open Source | 11 // This file is distributed under the University of Illinois Open Source |
| 12 // License. See LICENSE.TXT for details. | 12 // License. See LICENSE.TXT for details. |
| 13 // | 13 // |
| 14 //===----------------------------------------------------------------------===// | 14 //===----------------------------------------------------------------------===// |
| 15 // | 15 // |
| 16 // This file implements the Assembler class for x86-32. | 16 // This file implements the Assembler class for x86-32. |
| 17 // | 17 // |
| 18 //===----------------------------------------------------------------------===// | 18 //===----------------------------------------------------------------------===// |
| 19 | 19 |
| 20 #include "assembler_ia32.h" | 20 #include "assembler_ia32.h" |
| 21 #include "IceCfg.h" | 21 #include "IceCfg.h" |
| 22 #include "IceMemoryRegion.h" | 22 #include "IceMemoryRegion.h" |
| 23 #include "IceOperand.h" | 23 #include "IceOperand.h" |
| 24 | 24 |
| 25 namespace Ice { | 25 namespace Ice { |
| 26 namespace x86 { | 26 namespace x86 { |
| 27 | 27 |
| 28 class DirectCallRelocation : public AssemblerFixup { | 28 class DirectCallRelocation : public AssemblerFixup { |
| 29 DirectCallRelocation(const DirectCallRelocation &) = delete; |
| 30 DirectCallRelocation &operator=(const DirectCallRelocation &) = delete; |
| 31 |
| 29 public: | 32 public: |
| 30 static DirectCallRelocation *create(Assembler *Asm, FixupKind Kind, | 33 static DirectCallRelocation *create(Assembler *Asm, FixupKind Kind, |
| 31 const ConstantRelocatable *Sym) { | 34 const ConstantRelocatable *Sym) { |
| 32 return new (Asm->Allocate<DirectCallRelocation>()) | 35 return new (Asm->Allocate<DirectCallRelocation>()) |
| 33 DirectCallRelocation(Kind, Sym); | 36 DirectCallRelocation(Kind, Sym); |
| 34 } | 37 } |
| 35 | 38 |
| 36 void Process(const MemoryRegion ®ion, intptr_t position) override { | 39 void Process(const MemoryRegion ®ion, intptr_t position) override { |
| 37 // Direct calls are relative to the following instruction on x86. | 40 // Direct calls are relative to the following instruction on x86. |
| 38 int32_t pointer = region.Load<int32_t>(position); | 41 int32_t pointer = region.Load<int32_t>(position); |
| (...skipping 2426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2465 assert(shifter == RegX8632::Encoded_Reg_ecx); | 2468 assert(shifter == RegX8632::Encoded_Reg_ecx); |
| 2466 (void)shifter; | 2469 (void)shifter; |
| 2467 if (Ty == IceType_i16) | 2470 if (Ty == IceType_i16) |
| 2468 EmitOperandSizeOverride(); | 2471 EmitOperandSizeOverride(); |
| 2469 EmitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); | 2472 EmitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); |
| 2470 EmitOperand(rm, operand); | 2473 EmitOperand(rm, operand); |
| 2471 } | 2474 } |
| 2472 | 2475 |
| 2473 } // end of namespace x86 | 2476 } // end of namespace x86 |
| 2474 } // end of namespace Ice | 2477 } // end of namespace Ice |
| OLD | NEW |