/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* Platform specific code to invoke XPCOM methods on native objects */
#include"xptcprivate.h"
static uint32_t
invoke_count_words(uint32_t paramCount, nsXPTCVariant* s)
{
uint32_t overflow = 0, gpr = 1 /*this*/, fpr = 0; for(uint32_t i = 0; i < paramCount; i++, s++)
{ if(s->IsPtrData())
{ if (gpr < 5) gpr++; else overflow++; continue;
} switch(s->type)
{ case nsXPTType::T_I8 : case nsXPTType::T_I16 : case nsXPTType::T_I32 : if (gpr < 5) gpr++; else overflow++; break; case nsXPTType::T_I64 : if (gpr < 4) gpr+=2; else gpr=5, overflow+=2; break; case nsXPTType::T_U8 : case nsXPTType::T_U16 : case nsXPTType::T_U32 : if (gpr < 5) gpr++; else overflow++; break; case nsXPTType::T_U64 : if (gpr < 4) gpr+=2; else gpr=5, overflow+=2; break; case nsXPTType::T_FLOAT : if (fpr < 2) fpr++; else overflow++; break; case nsXPTType::T_DOUBLE : if (fpr < 2) fpr++; else overflow+=2; break; case nsXPTType::T_BOOL : case nsXPTType::T_CHAR : case nsXPTType::T_WCHAR : if (gpr < 5) gpr++; else overflow++; break; default: // all the others are plain pointer types if (gpr < 5) gpr++; else overflow++; break;
}
} /* Round up number of overflow words to ensure stack
stays aligned to 8 bytes. */ return (overflow + 1) & ~1;
}
// Avoid AddressSanitizer instrumentation for the next function because it // depends on __builtin_alloca behavior and alignment that cannot be relied on // once the function is compiled with a version of ASan that has dynamic-alloca // instrumentation enabled.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.