gecko-dev/xpcom/ds/moz.build
Nika Layzell 5b24f801f7 Bug 1500927 - Add copy-free jsstring support to perfecthash.py, r=bzbarsky
This is needed for bug 1500926. It takes the approach of taking a JSFlatString
and using AutoAssertCannotGC to read the memory directly from the JS heap.
This lets us avoid re-encoding strings when performing lookups, which can be
advantageous.

Only ASCII strings are supported by this handler, and wide strings are hashed
as though they contain only values under 0x7f. This is OK as invalid keys to
perfecthash may return any hashtable entry.

Differential Revision: https://phabricator.services.mozilla.com/D9405
2018-10-24 20:11:01 -04:00

152 lines
3.7 KiB
Python

# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
XPIDL_SOURCES += [
'nsIArray.idl',
'nsIArrayExtensions.idl',
'nsIHashable.idl',
'nsIINIParser.idl',
'nsIMutableArray.idl',
'nsIObserver.idl',
'nsIObserverService.idl',
'nsIPersistentProperties2.idl',
'nsIProperties.idl',
'nsIProperty.idl',
'nsIPropertyBag.idl',
'nsIPropertyBag2.idl',
'nsISerializable.idl',
'nsISimpleEnumerator.idl',
'nsIStringEnumerator.idl',
'nsISupportsIterators.idl',
'nsISupportsPrimitives.idl',
'nsIVariant.idl',
'nsIWritablePropertyBag.idl',
'nsIWritablePropertyBag2.idl',
]
if CONFIG['OS_ARCH'] == 'WINNT':
XPIDL_SOURCES += [
'nsIWindowsRegKey.idl',
]
EXPORTS += ['nsWindowsRegKey.h']
SOURCES += [
'nsWindowsRegKey.cpp'
]
XPIDL_MODULE = 'xpcom_ds'
EXPORTS += [
'!nsGkAtomConsts.h',
'!nsGkAtomList.h',
'nsArray.h',
'nsArrayEnumerator.h',
'nsArrayUtils.h',
'nsAtom.h',
'nsBaseHashtable.h',
'nsCharSeparatedTokenizer.h',
'nsCheapSets.h',
'nsClassHashtable.h',
'nsCOMArray.h',
'nsCRT.h',
'nsDataHashtable.h',
'nsDeque.h',
'nsEnumeratorUtils.h',
'nsExpirationTracker.h',
'nsGkAtoms.h',
'nsHashKeys.h',
'nsHashPropertyBag.h',
'nsInterfaceHashtable.h',
'nsJSThingHashtable.h',
'nsMathUtils.h',
'nsPersistentProperties.h',
'nsPointerHashKeys.h',
'nsProperties.h',
'nsQuickSort.h',
'nsRefPtrHashtable.h',
'nsSimpleEnumerator.h',
'nsStaticAtomUtils.h',
'nsStaticNameTable.h',
'nsStringEnumerator.h',
'nsSupportsPrimitives.h',
'nsTArray-inl.h',
'nsTArray.h',
'nsTArrayForwardDeclare.h',
'nsTHashtable.h',
'nsTObserverArray.h',
'nsTPriorityQueue.h',
'nsVariant.h',
'nsWhitespaceTokenizer.h',
'PLDHashTable.h',
]
EXPORTS.mozilla += [
'ArenaAllocator.h',
'ArenaAllocatorExtensions.h',
'ArrayIterator.h',
'AtomArray.h',
'Dafsa.h',
'IncrementalTokenizer.h',
'MruCache.h',
'Observer.h',
'PerfectHash.h',
'SimpleEnumerator.h',
'StickyTimeDuration.h',
'Tokenizer.h',
]
UNIFIED_SOURCES += [
'Dafsa.cpp',
'IncrementalTokenizer.cpp',
'nsArray.cpp',
'nsArrayEnumerator.cpp',
'nsArrayUtils.cpp',
'nsAtomTable.cpp',
'nsCOMArray.cpp',
'nsCRT.cpp',
'nsDeque.cpp',
'nsEnumeratorUtils.cpp',
'nsHashPropertyBag.cpp',
'nsINIParserImpl.cpp',
'nsObserverList.cpp',
'nsObserverService.cpp',
'nsPersistentProperties.cpp',
'nsProperties.cpp',
'nsQuickSort.cpp',
'nsSimpleEnumerator.cpp',
'nsStaticNameTable.cpp',
'nsStringEnumerator.cpp',
'nsSupportsPrimitives.cpp',
'nsTArray.cpp',
'nsTObserverArray.cpp',
'nsVariant.cpp',
'PLDHashTable.cpp',
'Tokenizer.cpp',
]
SOURCES += [
'nsGkAtoms.cpp',
]
if CONFIG['CC_TYPE'] == 'msvc':
# Needed for gGkAtoms.
SOURCES['nsGkAtoms.cpp'].flags += [
'-constexpr:steps300000',
'-Zc:externConstexpr',
]
LOCAL_INCLUDES += [
'../io',
]
GENERATED_FILES += ['nsGkAtomList.h']
GENERATED_FILES['nsGkAtomList.h'].script = 'StaticAtoms.py:generate_nsgkatomlist_h'
GENERATED_FILES['nsGkAtomList.h'].inputs = ['Atom.py', 'HTMLAtoms.py']
GENERATED_FILES += ['nsGkAtomConsts.h']
GENERATED_FILES['nsGkAtomConsts.h'].script = 'StaticAtoms.py:generate_nsgkatomconsts_h'
GENERATED_FILES['nsGkAtomConsts.h'].inputs = ['Atom.py', 'HTMLAtoms.py']
FINAL_LIBRARY = 'xul'