xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.S

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5 #include <sys/regdef.h>
michael@0 6 #include <sys/asm.h>
michael@0 7
michael@0 8 LOCALSZ=16
michael@0 9 FRAMESZ=(((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK
michael@0 10
michael@0 11 A1OFF=FRAMESZ-(9*SZREG)
michael@0 12 A2OFF=FRAMESZ-(8*SZREG)
michael@0 13 A3OFF=FRAMESZ-(7*SZREG)
michael@0 14 A4OFF=FRAMESZ-(6*SZREG)
michael@0 15 A5OFF=FRAMESZ-(5*SZREG)
michael@0 16 A6OFF=FRAMESZ-(4*SZREG)
michael@0 17 A7OFF=FRAMESZ-(3*SZREG)
michael@0 18 GPOFF=FRAMESZ-(2*SZREG)
michael@0 19 RAOFF=FRAMESZ-(1*SZREG)
michael@0 20
michael@0 21 F13OFF=FRAMESZ-(16*SZREG)
michael@0 22 F14OFF=FRAMESZ-(15*SZREG)
michael@0 23 F15OFF=FRAMESZ-(14*SZREG)
michael@0 24 F16OFF=FRAMESZ-(13*SZREG)
michael@0 25 F17OFF=FRAMESZ-(12*SZREG)
michael@0 26 F18OFF=FRAMESZ-(11*SZREG)
michael@0 27 F19OFF=FRAMESZ-(10*SZREG)
michael@0 28
michael@0 29 #define SENTINEL_ENTRY(n) /* defined in cpp file, not here */
michael@0 30
michael@0 31 #define STUB_ENTRY(x) \
michael@0 32 .if x < 10; \
michael@0 33 MAKE_STUB(x, _ZN14nsXPTCStubBase5Stub ##x ##Ev); \
michael@0 34 .elseif x < 100; \
michael@0 35 MAKE_STUB(x, _ZN14nsXPTCStubBase6Stub ##x ##Ev); \
michael@0 36 .elseif x < 1000; \
michael@0 37 MAKE_STUB(x, _ZN14nsXPTCStubBase7Stub ##x ##Ev); \
michael@0 38 .else; \
michael@0 39 .err; \
michael@0 40 .endif
michael@0 41
michael@0 42 #define MAKE_STUB(x, name) \
michael@0 43 .globl name; \
michael@0 44 .type name,@function; \
michael@0 45 .aent name,0; \
michael@0 46 name:; \
michael@0 47 PTR_SUBU sp,FRAMESZ; \
michael@0 48 SETUP_GP64(GPOFF, name); \
michael@0 49 li t0,x; \
michael@0 50 b sharedstub; \
michael@0 51
michael@0 52 #
michael@0 53 # open a dummy frame for the function entries
michael@0 54 #
michael@0 55 .text
michael@0 56 .align 2
michael@0 57 .type dummy,@function
michael@0 58 .ent dummy, 0
michael@0 59 dummy:
michael@0 60 .frame sp, FRAMESZ, ra
michael@0 61 .mask 0x90000FF0, RAOFF-FRAMESZ
michael@0 62 .fmask 0x000FF000, F19OFF-FRAMESZ
michael@0 63
michael@0 64 #include "xptcstubsdef.inc"
michael@0 65
michael@0 66 sharedstub:
michael@0 67
michael@0 68 REG_S a1, A1OFF(sp)
michael@0 69 REG_S a2, A2OFF(sp)
michael@0 70 REG_S a3, A3OFF(sp)
michael@0 71 REG_S a4, A4OFF(sp)
michael@0 72 REG_S a5, A5OFF(sp)
michael@0 73 REG_S a6, A6OFF(sp)
michael@0 74 REG_S a7, A7OFF(sp)
michael@0 75 REG_S ra, RAOFF(sp)
michael@0 76
michael@0 77 s.d $f13, F13OFF(sp)
michael@0 78 s.d $f14, F14OFF(sp)
michael@0 79 s.d $f15, F15OFF(sp)
michael@0 80 s.d $f16, F16OFF(sp)
michael@0 81 s.d $f17, F17OFF(sp)
michael@0 82 s.d $f18, F18OFF(sp)
michael@0 83 s.d $f19, F19OFF(sp)
michael@0 84
michael@0 85 # t0 is methodIndex
michael@0 86 move a1, t0
michael@0 87
michael@0 88 # a2 is stack address where extra function params
michael@0 89 # are stored that do not fit in registers
michael@0 90 move a2, sp
michael@0 91 addi a2, FRAMESZ
michael@0 92
michael@0 93 # a3 is stack address of a1..a7
michael@0 94 move a3, sp
michael@0 95 addi a3, A1OFF
michael@0 96
michael@0 97 # a4 is stack address of f13..f19
michael@0 98 move a4, sp
michael@0 99 addi a4, F13OFF
michael@0 100
michael@0 101 # PrepareAndDispatch(that, methodIndex, args, gprArgs, fpArgs)
michael@0 102 # a0 a1 a2 a3 a4
michael@0 103 #
michael@0 104 jal PrepareAndDispatch
michael@0 105
michael@0 106 REG_L ra, RAOFF(sp)
michael@0 107 RESTORE_GP64
michael@0 108
michael@0 109 PTR_ADDU sp, FRAMESZ
michael@0 110 j ra
michael@0 111 END(dummy)

mercurial