[PATCH] Rework lli-child-target for portability and correctness

Kaylor, Andrew andrew.kaylor at intel.com
Tue Dec 3 09:53:41 PST 2013


Hi Alp,

Thanks a lot for the patch.  Your approach seems very sound.  I'll try to review it later today or tomorrow if no one else has done so before then, but I won't have time to test it for a while.  Hopefully, Renato can verify that it works for him.

-Andy

-----Original Message-----
From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-bounces at cs.uiuc.edu] On Behalf Of Alp Toker
Sent: Tuesday, December 03, 2013 9:34 AM
To: llvm-commits
Subject: [PATCH] Rework lli-child-target for portability and correctness

This is a bumper patch to fix assorted MCJIT remote issues, split into two parts for ease of review.

Minor tweaks outside of lli were necessary to support reuse of LLVM's Support implementation by inclusion without having to link to LLVM.

   9 files changed, 157 insertions(+), 253 deletions(-)

Patch 1:

Provide LLVM_STANDALONE for lightweight Support embedders

This is sufficient to build lli-child-target in a standalone configuration without having to link any LLVM libraries.

Also fixes a problem in AllocateRWX() where process::get_self()->page_size() was being called repeatedly.

Patch 2:

Share a single IPC transport implementation between the child and parent instead of duplicating the code.

Share the existing LLVM memory management and cache invalidation code instead of copy-and-pasting it. This is complicated; we don't want to maintain two versions but at the same time need to keep lli-child-target free of dependencies.

Make memory management and instruction cache flushing portable in the child application using LLVM's Support headers in standalone mode. Eliminate lots of copy-and-pasted code.

Fix a typo that caused the instruction cache invalidation never to run on executable pages, which could be a problem on ARM, PowerPC etc.

Add assertions for piped read/write. This should help cut down on needless assertions at the callsites.

Build lli-child-target in a standalone configuration, reducing binary size to 24KB down from ~500KB.

These fixes pave the way for a Windows implementation.

Alp.

--
http://www.nuanti.com
the browser experts






More information about the llvm-commits mailing list