SquirrelFish Extreme for non x-86 platforms

71 篇文章 0 订阅
42 篇文章 0 订阅

SquirrelFish Extreme for non x-86 platforms

 I want to know whether WebKit JavaScript Engine SquirrelFish Extreme (SFX)
has been reported to work on any embedded, non-x86 platform? I have built a
recent nightly build on Windows and it works fine. However, there is use of
Windows specific VirtualAlloc() API functions for allocating memory from
virtaul address space. What will be the alternative for this routine on
non-Windows platforms, especially the embedded ones? Thanks.

To be more specific:

1) The JS engine should work on any CPU and on most reasonable  
operating systems in bytecode mode. It's still pretty fast as bytecode  
- nearly an order of magnitude faster than the old WebKit JS engine.

2) Currently the JIT only fully works on x86 and will soon also work  
on x86_64 (currently some basic tests pass but neither performance nor  
correctness are where we want them to be).

3) We are considering ports of the JIT to other CPU architectures. For  
mobile platforms, it's not entirely clear whether the JIT will turn  
out to be better than the bytecode interpreter - the memory cost might  
outweigh the speed benefit.

That means the current JS Engine (SquirrelFish Extreme) can be run on
embedded/mobile platforms in bytecode mode without JIT. Correct me if I am
wrong? If I am correct, then how to enable the engine's bytecode mode? There
are number of ENABLE switches related to current JS engine...

It should compile with JIT disabled on platforms that do not support  
the JIT.

This way the engine will run without JIT support. However, what to do with
memory allocation functions like VirtualAlloc() that are only available on
Windows? I mean to say, to run on embedded platforms, what alternate has to
exist that may provide the facility of VirtualAlloc(). As far I have seen,
the virtualAlloc() calls can be disabled even on Windows by setting
HAVE_VIRTUAL_ALLOC to 0 in JSC/wtf/Platform.h. However, the garbage
collection implementation uses this particular call inside
JSC/runtime/Collector.cpp irrespective of HAVE_VIRTUAL_ALLOC being 0 or 1.
Any suggestions on this front?
 
 
That call to VirtualAlloc is inside a PLATFORM(WIN_OS) guard -- you  
should not be hitting it on a non-windows platform
This is basically expected -- as the code for other platforms should  
have also indicated the collector has important alignment requirements  
that fastMalloc does not guarantee.

Alignment -- VirtualAlloc, mmap, vm_map all produce page aligned  
memory (which is at least 4k aligned), and the posix_memalign version  
appears to actually over align memory (my following of the code makes  
me thinks it's requesting 64k alignment.
I'm still not sure what your problem is -- posix systems should  
provide mmap or posix_memalign either of which will achieve correct  
behaviour

All of the #if branches allocateBlock will guarantee 64k alignment,  
which is what is required. That's with the exception of the  
PLATFORM(SYMBIAN) branch, which appears to be incorrect. I would  
expect it to lead to crashes as a result of incorrect garbage  
collection.




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值