Sat, 03 Jan 2015 20:18:00 +0100
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: asm -*- */ |
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 | |
michael@0 | 6 | .text |
michael@0 | 7 | .globl _SharedStub |
michael@0 | 8 | dnl |
michael@0 | 9 | define(STUB_MANGLED_ENTRY, |
michael@0 | 10 | ` .globl '$2` |
michael@0 | 11 | .align 2 |
michael@0 | 12 | '$2`: |
michael@0 | 13 | addi r12, 0,'$1` |
michael@0 | 14 | b _SharedStub') |
michael@0 | 15 | dnl |
michael@0 | 16 | define(STUB_ENTRY, |
michael@0 | 17 | ` .if '$1` < 10 |
michael@0 | 18 | STUB_MANGLED_ENTRY('$1`, `__ZN14nsXPTCStubBase5Stub'$1`Ev') |
michael@0 | 19 | .elseif '$1` < 100 |
michael@0 | 20 | STUB_MANGLED_ENTRY('$1`, `__ZN14nsXPTCStubBase6Stub'$1`Ev') |
michael@0 | 21 | .elseif '$1` < 1000 |
michael@0 | 22 | STUB_MANGLED_ENTRY('$1`, `__ZN14nsXPTCStubBase7Stub'$1`Ev') |
michael@0 | 23 | .else |
michael@0 | 24 | .err "Stub'$1` >= 1000 not yet supported." |
michael@0 | 25 | .endif |
michael@0 | 26 | ') |
michael@0 | 27 | dnl |
michael@0 | 28 | define(SENTINEL_ENTRY, `') |
michael@0 | 29 | dnl |
michael@0 | 30 | include(xptcstubsdef.inc) |
michael@0 | 31 | dnl |
michael@0 | 32 | // See also xptcstubs_ppc_rhapsody.cpp:PrepareAndDispatch. |
michael@0 | 33 | _SharedStub: |
michael@0 | 34 | // Prolog(ue) |
michael@0 | 35 | mflr r0 // Save the link register in the caller's |
michael@0 | 36 | stw r0, 8(r1) // stack frame |
michael@0 | 37 | stwu r1,-176(r1) // Allocate stack space for our own frame and |
michael@0 | 38 | // adjust stack pointer |
michael@0 | 39 | |
michael@0 | 40 | // Linkage area, 0(r1) to 24(r1) |
michael@0 | 41 | // Original sp saved at 0(r1) |
michael@0 | 42 | |
michael@0 | 43 | // Parameter area, 20 bytes from 24(r1) to |
michael@0 | 44 | // 44(r1) to accomodate 5 arguments passed |
michael@0 | 45 | // to PrepareAndDispatch |
michael@0 | 46 | |
michael@0 | 47 | // Local variables, 132 bytes from 44(r1) |
michael@0 | 48 | // to 176(r1), to accomodate 5 words and |
michael@0 | 49 | // 13 doubles |
michael@0 | 50 | |
michael@0 | 51 | stw r4, 44(r1) // Save parameters passed in GPRs r4-r10; |
michael@0 | 52 | stw r5, 48(r1) // a pointer to here will be passed to |
michael@0 | 53 | stw r6, 52(r1) // PrepareAndDispatch for access to |
michael@0 | 54 | stw r7, 56(r1) // arguments passed in registers. r3, |
michael@0 | 55 | stw r8, 60(r1) // the self pointer, is used for the |
michael@0 | 56 | stw r9, 64(r1) // call but isn't otherwise needed in |
michael@0 | 57 | stw r10, 68(r1) // PrepareAndDispatch, so it is not saved. |
michael@0 | 58 | |
michael@0 | 59 | stfd f1, 72(r1) // Do the same for floating-point parameters |
michael@0 | 60 | stfd f2, 80(r1) // passed in FPRs f1-f13 |
michael@0 | 61 | stfd f3, 88(r1) |
michael@0 | 62 | stfd f4, 96(r1) |
michael@0 | 63 | stfd f5, 104(r1) |
michael@0 | 64 | stfd f6, 112(r1) |
michael@0 | 65 | stfd f7, 120(r1) |
michael@0 | 66 | stfd f8, 128(r1) |
michael@0 | 67 | stfd f9, 136(r1) |
michael@0 | 68 | stfd f10, 144(r1) |
michael@0 | 69 | stfd f11, 152(r1) |
michael@0 | 70 | stfd f12, 160(r1) |
michael@0 | 71 | stfd f13, 168(r1) |
michael@0 | 72 | |
michael@0 | 73 | // Set up parameters for call to |
michael@0 | 74 | // PrepareAndDispatch. argument= |
michael@0 | 75 | // 0, pointer to self, already in r3 |
michael@0 | 76 | mr r4,r12 // 1, stub number |
michael@0 | 77 | addi r5, r1, 204 // 2, pointer to the parameter area in our |
michael@0 | 78 | // caller's stack, for access to |
michael@0 | 79 | // parameters beyond those passed in |
michael@0 | 80 | // registers. Skip past the first parameter |
michael@0 | 81 | // (corresponding to r3) for the same reason |
michael@0 | 82 | // as above. 176 (size of our frame) + 24 |
michael@0 | 83 | // (size of caller's linkage) + 4 (skipped |
michael@0 | 84 | // parameter) |
michael@0 | 85 | addi r6, r1, 44 // 3, pointer to saved GPRs |
michael@0 | 86 | addi r7, r1, 72 // 4, pointer to saved FPRs |
michael@0 | 87 | |
michael@0 | 88 | bl L_PrepareAndDispatch$stub |
michael@0 | 89 | // Do it |
michael@0 | 90 | nop // Leave room for linker magic |
michael@0 | 91 | |
michael@0 | 92 | // Epilog(ue) |
michael@0 | 93 | lwz r0, 184(r1) // Retrieve old link register value |
michael@0 | 94 | addi r1, r1, 176 // Restore stack pointer |
michael@0 | 95 | mtlr r0 // Restore link register |
michael@0 | 96 | blr // Return |
michael@0 | 97 | |
michael@0 | 98 | .picsymbol_stub |
michael@0 | 99 | L_PrepareAndDispatch$stub: // Standard PIC symbol stub |
michael@0 | 100 | .indirect_symbol _PrepareAndDispatch |
michael@0 | 101 | mflr r0 |
michael@0 | 102 | bcl 20,31,L1$pb |
michael@0 | 103 | L1$pb: |
michael@0 | 104 | mflr r11 |
michael@0 | 105 | addis r11,r11,ha16(L1$lz-L1$pb) |
michael@0 | 106 | mtlr r0 |
michael@0 | 107 | lwz r12,lo16(L1$lz-L1$pb)(r11) |
michael@0 | 108 | mtctr r12 |
michael@0 | 109 | addi r11,r11,lo16(L1$lz-L1$pb) |
michael@0 | 110 | bctr |
michael@0 | 111 | .lazy_symbol_pointer |
michael@0 | 112 | L1$lz: |
michael@0 | 113 | .indirect_symbol _PrepareAndDispatch |
michael@0 | 114 | .long dyld_stub_binding_helper |