xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ipf64.cpp

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
michael@0 2 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
michael@0 3 *
michael@0 4 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 5 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 7
michael@0 8 #include "xptcprivate.h"
michael@0 9
michael@0 10 #include <stdint.h>
michael@0 11
michael@0 12 // "This code is for IA64 only"
michael@0 13
michael@0 14
michael@0 15 /* invoke_copy_to_stack() will copy from variant array 's' to
michael@0 16 * the stack argument area 'mloc', the integer register area 'iloc', and
michael@0 17 * the float register area 'floc'.
michael@0 18 *
michael@0 19 */
michael@0 20 extern "C" void
michael@0 21 invoke_copy_to_stack(uint64_t* mloc, uint64_t* iloc, uint64_t* floc,
michael@0 22 const uint32_t paramCount, nsXPTCVariant* s)
michael@0 23 {
michael@0 24 uint64_t* dest = mloc;
michael@0 25 uint32_t len = paramCount;
michael@0 26 nsXPTCVariant* source = s;
michael@0 27
michael@0 28 uint32_t indx;
michael@0 29 uint32_t endlen;
michael@0 30 endlen = (len > 7) ? 7 : len;
michael@0 31 /* handle the memory arguments */
michael@0 32 for (indx = 7; indx < len; ++indx)
michael@0 33 {
michael@0 34 if (source[indx].IsPtrData())
michael@0 35 {
michael@0 36 /* 64 bit pointer mode */
michael@0 37 *((void**) dest) = source[indx].ptr;
michael@0 38 }
michael@0 39 else
michael@0 40 switch (source[indx].type)
michael@0 41 {
michael@0 42 case nsXPTType::T_I8 : *(dest) = source[indx].val.i8; break;
michael@0 43 case nsXPTType::T_I16 : *(dest) = source[indx].val.i16; break;
michael@0 44 case nsXPTType::T_I32 : *(dest) = source[indx].val.i32; break;
michael@0 45 case nsXPTType::T_I64 : *(dest) = source[indx].val.i64; break;
michael@0 46 case nsXPTType::T_U8 : *(dest) = source[indx].val.u8; break;
michael@0 47 case nsXPTType::T_U16 : *(dest) = source[indx].val.u16; break;
michael@0 48 case nsXPTType::T_U32 : *(dest) = source[indx].val.u32; break;
michael@0 49 case nsXPTType::T_U64 : *(dest) = source[indx].val.u64; break;
michael@0 50 case nsXPTType::T_FLOAT : *(dest) = source[indx].val.u32; break;
michael@0 51 case nsXPTType::T_DOUBLE: *(dest) = source[indx].val.u64; break;
michael@0 52 case nsXPTType::T_BOOL : *(dest) = source[indx].val.b; break;
michael@0 53 case nsXPTType::T_CHAR : *(dest) = source[indx].val.c; break;
michael@0 54 case nsXPTType::T_WCHAR : *(dest) = source[indx].val.wc; break;
michael@0 55 default:
michael@0 56 // all the others are plain pointer types
michael@0 57 /* 64 bit pointer mode */
michael@0 58 *((void**) dest) = source[indx].val.p;
michael@0 59 }
michael@0 60 ++dest;
michael@0 61 }
michael@0 62 /* process register arguments */
michael@0 63 dest = iloc;
michael@0 64 for (indx = 0; indx < endlen; ++indx)
michael@0 65 {
michael@0 66 if (source[indx].IsPtrData())
michael@0 67 {
michael@0 68 /* 64 bit pointer mode */
michael@0 69 *((void**) dest) = source[indx].ptr;
michael@0 70 }
michael@0 71 else
michael@0 72 switch (source[indx].type)
michael@0 73 {
michael@0 74 case nsXPTType::T_I8 : *(dest) = source[indx].val.i8; break;
michael@0 75 case nsXPTType::T_I16 : *(dest) = source[indx].val.i16; break;
michael@0 76 case nsXPTType::T_I32 : *(dest) = source[indx].val.i32; break;
michael@0 77 case nsXPTType::T_I64 : *(dest) = source[indx].val.i64; break;
michael@0 78 case nsXPTType::T_U8 : *(dest) = source[indx].val.u8; break;
michael@0 79 case nsXPTType::T_U16 : *(dest) = source[indx].val.u16; break;
michael@0 80 case nsXPTType::T_U32 : *(dest) = source[indx].val.u32; break;
michael@0 81 case nsXPTType::T_U64 : *(dest) = source[indx].val.u64; break;
michael@0 82 case nsXPTType::T_FLOAT :
michael@0 83 *((double*) (floc++)) = (double) source[indx].val.f;
michael@0 84 break;
michael@0 85 case nsXPTType::T_DOUBLE:
michael@0 86 *((double*) (floc++)) = source[indx].val.d;
michael@0 87 break;
michael@0 88 case nsXPTType::T_BOOL : *(dest) = source[indx].val.b; break;
michael@0 89 case nsXPTType::T_CHAR : *(dest) = source[indx].val.c; break;
michael@0 90 case nsXPTType::T_WCHAR : *(dest) = source[indx].val.wc; break;
michael@0 91 default:
michael@0 92 // all the others are plain pointer types
michael@0 93 /* 64 bit pointer mode */
michael@0 94 *((void**) dest) = source[indx].val.p;
michael@0 95 }
michael@0 96 ++dest;
michael@0 97 }
michael@0 98
michael@0 99 }
michael@0 100

mercurial