[webkit-reviews] review granted: [Bug 26125] Allow the JIT to operate without relying on use of RWX memory, on platforms where this is supported : [Attachment 30844] The patch!

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 1 17:34:24 PDT 2009


Sam Weinig <sam at webkit.org> has granted Gavin Barraclough
<barraclough at apple.com>'s request for review:
Bug 26125: Allow the JIT to operate without relying on use of RWX memory, on
platforms where this is supported
https://bugs.webkit.org/show_bug.cgi?id=26125

Attachment 30844: The patch!
https://bugs.webkit.org/attachment.cgi?id=30844&action=review

------- Additional Comments from Sam Weinig <sam at webkit.org>

>  #if ENABLE(ASSEMBLER)
>  
> +// Fixme: keep transitioning this out into MacroAssemblerX86_64.

CAPITAL FIXME PLEASE!

> -    static void linkCall(void* code, JmpSrc from, void* to)
> +    static void relinkCall(void* from, void* to)
>      {
> -	   ASSERT(from.m_offset != -1);
> -	   ptrdiff_t linkOffset = reinterpret_cast<ptrdiff_t>(to) -
(reinterpret_cast<ptrdiff_t>(code) + from.m_offset);
> -	   ASSERT(linkOffset == static_cast<int>(linkOffset));
> -	   reinterpret_cast<int*>(reinterpret_cast<ptrdiff_t>(code) +
from.m_offset)[-1] = linkOffset;
> +	   ExecutableAllocator::makeWritable(reinterpret_cast<char*>(from) -
sizeof(int32_t), sizeof(int32_t));
> +	   patchRel32(from, to);
> +	   ExecutableAllocator::makeExecutable(reinterpret_cast<char*>(from) -
sizeof(int32_t), sizeof(int32_t));

These might benefit from a stackbased object to protect/unprotect, though this
might not be necessary if we switch to using a repatch buffer.


More information about the webkit-reviews mailing list