want to port JIT to MIPS - JIT reg usage clean up?

71 篇文章 0 订阅
42 篇文章 0 订阅
转自:https://lists.webkit.org/pipermail/webkit-dev/2009-February/006852.html
 
> The regTx seems to be working registers here, yet their definition  
> are regparm(3) registers for function arugments. Such usage would  
> cause conflict on other platforms. May I suggest that we use  
> individual defined set of regs for func i/o argument and working?

First up, I think you're getting slightly confused about regparm(3).   
This is not used anywhere in the JS language JIT, only in WREC.  In  
some configurations of the JIT we use fastcall semantics on x86... but  
none of this is really relevant to MIPS.  Just ignore all this.  Stick  
to the default MIPS ABI for stub functions.

Reading between the lines, I'm guessing your concern here is that in  
setting up arguments for a JIT stub call you may trample the JIT's  
temporary registers?  If so, I think you need to look at the argument  
passing more closely.  The mechanisms to pass arguments to stub  
functions:pass all arguments in memory – typically passing a single  
pointer to the stub functions, which can be used to retrieve the  
arguments.  This pointer argument can be set up immediately prior to  
the call, so it does not interfere with the regT? temporaries.  
We follow this pattern on x86-64, where the ABI is typically to pass  arguments in registers.  


You cannot trivially change the way this  
works, since the argument pointer is used for other purposes too (e.g.  
retrieving the arguments passed into the JIT code from within the  
stubs).

We strongly prefer small, simple, incremental changes.  A patch that  
tried to both port the JIT to a new platform and to introduce a new  
argument passing interface to the JIT stub functions sounds unlikely  
to get anywhere (a patch porting the JIT to a new platform is on its  
own very likely to be too much more than we'd want to land in one  
chunk).  I'd suggest that a port would be wise to engineer it's  
initial solution to fit one of the existing argument passing  
mechanisms (these are selected by JIT_STUB_ARGUMENT_* switches, to  
help find the relevant code).  (Alternatively, you're welcome to  
attempt to port x86-64 to make use of an in-register argument passing  
solution, which could be hugely useful.  With this landed first and  
separately, a port could then build on top of this.)

As a more direct answer to your question, you could endeavour to make  
the set of hardware registers used as JIT temporaries non-overlapping  
with ABI function argument registers on MIPS, but this is unlikely to  
be a general solution to anything for all platforms, due to limited  
register availability on some architectures.

> we would put all these definition in a file named regMap.h, then we  
> can remove all "X86::" from other JIT files.

I don't think we'll be keen on taking preemptive changes so far ahead  
in preparation of a port.  The first logical step in porting to a new  
platform is still to start with WREC, and this requires no changes in  
the JIT directory.  Any refactoring of the existing JIT would make  
more sense more directly prior to work in that area.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值