Offlineasm adds a .cpload when we create a label in MIPS (useful for functions so that the GOT can be used to calculate the address of position-independent code). But the code created by the assembler when encountering a .cpload assumes that we jumped to that address. So we need to add a jump to pcBase in initPCRelative(), or otherwise the GOT-related calculations are wrong.
Created attachment 263644 [details] Patch
Comment on attachment 263644 [details] Patch Can't hurt anything for non-MIPS, so sure....
Could anyone land this patch? It is needed to get MIPS finally working.
Looks like jmp is not needed here, we just need to update $t9. I will upload different patch.
Created attachment 269193 [details] Patch
New patch fixes the bug without adding unneeded jr instruction after move $t9, $v1
Comment on attachment 269193 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=269193&action=review LGTM, please just fix ChangeLog file > Source/JavaScriptCore/ChangeLog:3 > + llint: fix calculation of Global Offset Table This line seems redundant with line 5, please remove it > Source/JavaScriptCore/ChangeLog:14 > + instruction setcallreg which does exactlly that. exactlly -> exactly
Created attachment 269212 [details] Patch
Comment on attachment 269193 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=269193&action=review >> Source/JavaScriptCore/ChangeLog:3 >> + llint: fix calculation of Global Offset Table > > This line seems redundant with line 5, please remove it Done >> Source/JavaScriptCore/ChangeLog:14 >> + instruction setcallreg which does exactlly that. > > exactlly -> exactly Done
Thanks, LGTM
Comment on attachment 269212 [details] Patch r=me
Comment on attachment 269212 [details] Patch Clearing flags on attachment: 269212 Committed r195236: <http://trac.webkit.org/changeset/195236>
(In reply to comment #6) > New patch fixes the bug without adding unneeded jr instruction after move > $t9, $v1 Indeed, I was a bit lazy with my patch. Thanks!