[webkit-dev] want to port JIT to MIPS - cti_op_mod(STUB_ARGS) seg fault
x yz
lastguy at yahoo.com
Tue Apr 21 17:31:15 PDT 2009
I use MIPS32EL, VA_LIST call, MIPS pushes function argument from left to right. I wrote a simple VA_LIST test it works on my box.
BEGIN_STUB_FUNCTION() cause seg fault due to MIPS uses gp reg to read sth.
I treied to rewrite the code like that:
JSObject* JITStubs::cti_op_new_func_exp(STUB_ARGS)
{
va_list vl_args;
va_start(vl_args, args);
StackHack stackHack(&STUB_RETURN_ADDRESS_SLOT);
JSValuePtr dividendValue = va_arg(vl_args, JSC::JSCell* );
JSValuePtr divisorValue = va_arg(vl_args, JSC::JSCell* );
...
}
Still fail in stackHack(), if I comment out stackHack() then fails at va_arg.
gp is a global register for common/public variables, the same usage before I call cti_op_mod() works fine.
I also tried not use VA_LIST but REGISTER calling convention, still fail:
(gdb) x/2i $at
0x6ab500 <_ZN3JSC8JITStubs10cti_op_modEPPv>: lui gp,0xf96
0x6ab504 <_ZN3JSC8JITStubs10cti_op_modEPPv+4>: addiu gp,gp,9008
(gdb) x/20i $at
0x6ab500 <_ZN3JSC8JITStubs10cti_op_modEPPv>: lui gp,0xf96
0x6ab504 <_ZN3JSC8JITStubs10cti_op_modEPPv+4>: addiu gp,gp,9008
0x6ab508 <_ZN3JSC8JITStubs10cti_op_modEPPv+8>: addu gp,gp,t9
0x6ab50c <_ZN3JSC8JITStubs10cti_op_modEPPv+12>: addiu sp,sp,-80
0x6ab510 <_ZN3JSC8JITStubs10cti_op_modEPPv+16>: sw ra,72(sp)
0x6ab514 <_ZN3JSC8JITStubs10cti_op_modEPPv+20>: sw s8,68(sp)
0x6ab518 <_ZN3JSC8JITStubs10cti_op_modEPPv+24>: sw s0,64(sp)
0x6ab51c <_ZN3JSC8JITStubs10cti_op_modEPPv+28>: move s8,sp
0x6ab520 <_ZN3JSC8JITStubs10cti_op_modEPPv+32>: sw gp,16(sp)
0x6ab524 <_ZN3JSC8JITStubs10cti_op_modEPPv+36>: sw a0,80(s8)
0x6ab528 <_ZN3JSC8JITStubs10cti_op_modEPPv+40>: lw v0,80(s8)
0x6ab52c <_ZN3JSC8JITStubs10cti_op_modEPPv+44>: addiu v0,v0,-4
0x6ab530 <_ZN3JSC8JITStubs10cti_op_modEPPv+48>: addiu a0,s8,24
0x6ab534 <_ZN3JSC8JITStubs10cti_op_modEPPv+52>: move a1,v0
0x6ab538 <_ZN3JSC8JITStubs10cti_op_modEPPv+56>: lw t9,-19012(gp)
0x6ab53c <_ZN3JSC8JITStubs10cti_op_modEPPv+60>: jalr t9
0x6ab540 <_ZN3JSC8JITStubs10cti_op_modEPPv+64>: nop
0x6ab544 <_ZN3JSC8JITStubs10cti_op_modEPPv+68>: lw gp,16(s8)
0x6ab548 <_ZN3JSC8JITStubs10cti_op_modEPPv+72>: addiu v0,s8,32
0x6ab54c <_ZN3JSC8JITStubs10cti_op_modEPPv+76>: lw v1,80(s8)
(gdb) stepi 14
Program received signal SIGSEGV, Segmentation fault.
0x006ab538 in JSC::JITStubs::cti_op_mod (args=0x2aac9500) at /home/jdai/depot/mp/mediabase/head/libs/webkit-1.1.1/JavaScriptCore/jit/JITStubs.cpp:1685
1685 BEGIN_STUB_FUNCTION();
another question is that there is no matched va_end() and it is a bug.
thanks a lot for help,
joe
More information about the webkit-dev
mailing list