| Index: src/assembler_ia32.cpp
|
| diff --git a/src/assembler_ia32.cpp b/src/assembler_ia32.cpp
|
| index 8857a57cdce6b9040dc57d6b98d7a8452dbae398..1c58527cd1fbe745b3ea9944ea5aa5ff53637e6e 100644
|
| --- a/src/assembler_ia32.cpp
|
| +++ b/src/assembler_ia32.cpp
|
| @@ -20,7 +20,6 @@
|
|
|
| #include "assembler_ia32.h"
|
| #include "IceCfg.h"
|
| -#include "IceMemoryRegion.h"
|
| #include "IceOperand.h"
|
|
|
| namespace Ice {
|
| @@ -37,13 +36,6 @@ public:
|
| DirectCallRelocation(Kind, Sym);
|
| }
|
|
|
| - void Process(const MemoryRegion ®ion, intptr_t position) override {
|
| - // Direct calls are relative to the following instruction on x86.
|
| - int32_t pointer = region.Load<int32_t>(position);
|
| - int32_t delta = region.start() + position + sizeof(int32_t);
|
| - region.Store<int32_t>(position, pointer - delta);
|
| - }
|
| -
|
| private:
|
| DirectCallRelocation(FixupKind Kind, const ConstantRelocatable *Sym)
|
| : AssemblerFixup(Kind, Sym) {}
|
| @@ -78,6 +70,22 @@ AssemblerX86::~AssemblerX86() {
|
| #endif
|
| }
|
|
|
| +void AssemblerX86::alignFunction() {
|
| + intptr_t Pos = buffer_.GetPosition();
|
| + SizeT Align = 1 << getBundleAlignLog2Bytes();
|
| + intptr_t Mod = Pos & (Align - 1);
|
| + if (Mod == 0) {
|
| + return;
|
| + }
|
| + SizeT BytesNeeded = Align - Mod;
|
| + const SizeT HltSize = 1;
|
| + while (BytesNeeded > 0) {
|
| + hlt();
|
| + BytesNeeded -= HltSize;
|
| + }
|
| + assert((buffer_.GetPosition() & (Align - 1)) == 0);
|
| +}
|
| +
|
| Label *AssemblerX86::GetOrCreateLabel(SizeT Number, LabelVector &Labels) {
|
| Label *L = nullptr;
|
| if (Number == Labels.size()) {
|
|
|