Deleted Added
full compact
142,152c142,146
< MachineCodeEmitter::BufferState BS;
< JCE.startGVStub(BS, GV, 4, 4);
< intptr_t Addr = (intptr_t)JCE.getCurrentPCValue();
< if (!sys::Memory::setRangeWritable((void*)Addr, 4)) {
< llvm_unreachable("ERROR: Unable to mark indirect symbol writable");
< }
< JCE.emitWordLE((intptr_t)Ptr);
< if (!sys::Memory::setRangeExecutable((void*)Addr, 4)) {
< llvm_unreachable("ERROR: Unable to mark indirect symbol executable");
< }
< void *PtrAddr = JCE.finishGVStub(BS);
---
> uint8_t Buffer[4];
> uint8_t *Cur = Buffer;
> MachineCodeEmitter::emitWordLEInto(Cur, (intptr_t)Ptr);
> void *PtrAddr = JCE.allocIndirectGV(
> GV, Buffer, sizeof(Buffer), /*Alignment=*/4);