Ok after discovering for several days i find out the real working code is 
not here, but in 
base/allocator/partition_allocator/src/partition_alloc/page_allocator_internals_posix.h,
 
but why there are so much complete logics and code in src/v8 but some 
logical branch is never reached?

在2024年2月2日星期五 UTC+8 16:15:11<chen chang> 写道:

> What I know or, understand the mechanic:
>
> I know that ARM based Apple Silicon(I call it M1 in following) doesn't 
> allow applications apply RWX memorys, so that v8 flag the codespace with 
> kNoAccessWillJitLater, in which way when calling mmap(), the MAP_JIT bit is 
> set, so that compiler can switch the memory between RW and RX. I try to 
> borrow the method in my own project, so I change the code in 
> v8/src/base/page-allocator.cc:47, where restrict the flag only work in M1 
> environment.
>
> There are only two places where JitLater is used as param:
> v8/src/utils/allocation.cc:221
> v8/src/heap/code-range.cc:365
> and both of them call page_allocator->AllocatePages()
>
> but PageAllocator is a class with 5 different subclass, since in 
> v8/src/base/page-allocator.cc v8 block the JitLater in not-M1 system(I 
> remove the block, it is not its fault, I also  change the logic where 
> judging access in platform-posix.cc GetFlagsForMemoryPermisson()), I 
> thought it is where the call really goes.
> And I write my code in v8/scr/base/platform/platform-posix.cc(I develop in 
> linux), and listen in linux kernel, expecting browser make mmap() request 
> with flag which has MAP_JIT bit, but no answer is got.
>
> Potential answer: the caller is caling with other classes but not 
> subclass  in src/base/page-allocator, but i figure this deeper need lots of 
> time.
>
> Hope someone can help me with this problem, after removing two bypassing 
> about kNoAccessWillJitLater, why cant see my change in kernel log?
> P.S. not sys/mman.h and MAP_JIT fault, i test it with fixed bit.
>

-- 
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-dev/2c7ddee5-9a61-474c-a194-3a489543d9e1n%40googlegroups.com.

Reply via email to