2016-07-14 19:16:42 +03:00
|
|
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
2013-02-26 01:20:02 +04:00
|
|
|
# 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/.
|
|
|
|
|
2013-03-12 21:17:46 +04:00
|
|
|
XPIDL_SOURCES += [
|
|
|
|
'nsIArray.idl',
|
2016-10-24 23:24:26 +03:00
|
|
|
'nsIArrayExtensions.idl',
|
2013-03-12 21:17:46 +04:00
|
|
|
'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',
|
|
|
|
]
|
|
|
|
|
2013-03-12 21:20:41 +04:00
|
|
|
if CONFIG['OS_ARCH'] == 'WINNT':
|
|
|
|
XPIDL_SOURCES += [
|
|
|
|
'nsIWindowsRegKey.idl',
|
|
|
|
]
|
2013-04-16 23:24:43 +04:00
|
|
|
EXPORTS += ['nsWindowsRegKey.h']
|
2013-10-25 03:23:05 +04:00
|
|
|
SOURCES += [
|
2013-04-24 01:54:15 +04:00
|
|
|
'nsWindowsRegKey.cpp'
|
|
|
|
]
|
2013-03-12 21:20:41 +04:00
|
|
|
|
2013-03-12 09:00:00 +04:00
|
|
|
XPIDL_MODULE = 'xpcom_ds'
|
|
|
|
|
2013-04-16 23:24:43 +04:00
|
|
|
EXPORTS += [
|
|
|
|
'nsArray.h',
|
2017-01-20 21:59:21 +03:00
|
|
|
'nsArrayEnumerator.h',
|
|
|
|
'nsArrayUtils.h',
|
2017-10-03 01:05:19 +03:00
|
|
|
'nsAtom.h',
|
2017-01-20 21:59:21 +03:00
|
|
|
'nsBaseHashtable.h',
|
2013-04-16 23:24:43 +04:00
|
|
|
'nsCharSeparatedTokenizer.h',
|
|
|
|
'nsCheapSets.h',
|
2017-01-20 21:59:21 +03:00
|
|
|
'nsClassHashtable.h',
|
|
|
|
'nsCOMArray.h',
|
2013-10-24 03:05:43 +04:00
|
|
|
'nsCRT.h',
|
2017-01-20 21:59:21 +03:00
|
|
|
'nsDataHashtable.h',
|
|
|
|
'nsDeque.h',
|
|
|
|
'nsEnumeratorUtils.h',
|
2013-04-16 23:24:43 +04:00
|
|
|
'nsExpirationTracker.h',
|
2018-03-14 03:10:55 +03:00
|
|
|
'nsGkAtomList.h',
|
|
|
|
'nsGkAtoms.h',
|
2017-01-20 21:59:21 +03:00
|
|
|
'nsHashKeys.h',
|
2013-04-16 23:24:43 +04:00
|
|
|
'nsHashPropertyBag.h',
|
2017-01-20 21:59:21 +03:00
|
|
|
'nsInterfaceHashtable.h',
|
|
|
|
'nsJSThingHashtable.h',
|
2013-04-16 23:24:43 +04:00
|
|
|
'nsMathUtils.h',
|
2017-01-20 21:59:21 +03:00
|
|
|
'nsPointerHashKeys.h',
|
|
|
|
'nsQuickSort.h',
|
|
|
|
'nsRefPtrHashtable.h',
|
2013-04-16 23:24:43 +04:00
|
|
|
'nsStaticAtom.h',
|
|
|
|
'nsStaticNameTable.h',
|
|
|
|
'nsStringEnumerator.h',
|
|
|
|
'nsSupportsPrimitives.h',
|
2017-01-20 21:59:21 +03:00
|
|
|
'nsTArray-inl.h',
|
|
|
|
'nsTArray.h',
|
|
|
|
'nsTArrayForwardDeclare.h',
|
|
|
|
'nsTHashtable.h',
|
|
|
|
'nsTObserverArray.h',
|
|
|
|
'nsTPriorityQueue.h',
|
2013-04-16 23:24:43 +04:00
|
|
|
'nsVariant.h',
|
|
|
|
'nsWhitespaceTokenizer.h',
|
2017-01-20 21:59:21 +03:00
|
|
|
'PLDHashTable.h',
|
2013-04-16 23:24:43 +04:00
|
|
|
]
|
|
|
|
|
|
|
|
EXPORTS.mozilla += [
|
2017-03-31 02:46:55 +03:00
|
|
|
'ArenaAllocator.h',
|
2017-03-31 02:46:56 +03:00
|
|
|
'ArenaAllocatorExtensions.h',
|
2017-02-24 08:14:06 +03:00
|
|
|
'ArrayIterator.h',
|
2017-10-13 03:59:23 +03:00
|
|
|
'AtomArray.h',
|
2017-07-18 02:09:42 +03:00
|
|
|
'Dafsa.h',
|
2017-02-06 18:49:00 +03:00
|
|
|
'IncrementalTokenizer.h',
|
2017-01-20 21:59:21 +03:00
|
|
|
'Observer.h',
|
2014-09-25 09:25:50 +04:00
|
|
|
'StickyTimeDuration.h',
|
2015-07-27 12:07:00 +03:00
|
|
|
'Tokenizer.h',
|
2013-04-16 23:24:43 +04:00
|
|
|
]
|
|
|
|
|
2013-11-19 06:34:00 +04:00
|
|
|
UNIFIED_SOURCES += [
|
2017-07-18 02:09:42 +03:00
|
|
|
'Dafsa.cpp',
|
2017-02-06 18:49:00 +03:00
|
|
|
'IncrementalTokenizer.cpp',
|
2013-04-24 01:54:15 +04:00
|
|
|
'nsArray.cpp',
|
2017-01-20 21:59:21 +03:00
|
|
|
'nsArrayEnumerator.cpp',
|
|
|
|
'nsArrayUtils.cpp',
|
2013-04-24 01:54:15 +04:00
|
|
|
'nsAtomTable.cpp',
|
2017-01-20 21:59:21 +03:00
|
|
|
'nsCOMArray.cpp',
|
2013-04-24 01:54:15 +04:00
|
|
|
'nsCRT.cpp',
|
2017-01-20 21:59:21 +03:00
|
|
|
'nsDeque.cpp',
|
|
|
|
'nsEnumeratorUtils.cpp',
|
2013-04-24 01:54:15 +04:00
|
|
|
'nsHashPropertyBag.cpp',
|
|
|
|
'nsINIParserImpl.cpp',
|
|
|
|
'nsObserverList.cpp',
|
|
|
|
'nsObserverService.cpp',
|
2017-03-31 02:46:58 +03:00
|
|
|
'nsPersistentProperties.cpp',
|
2013-04-24 01:54:15 +04:00
|
|
|
'nsProperties.cpp',
|
2017-01-20 21:59:21 +03:00
|
|
|
'nsQuickSort.cpp',
|
2017-03-27 19:15:38 +03:00
|
|
|
'nsStaticNameTable.cpp',
|
2013-04-24 01:54:15 +04:00
|
|
|
'nsStringEnumerator.cpp',
|
|
|
|
'nsSupportsPrimitives.cpp',
|
2017-01-20 21:59:21 +03:00
|
|
|
'nsTArray.cpp',
|
|
|
|
'nsTObserverArray.cpp',
|
2013-04-24 01:54:15 +04:00
|
|
|
'nsVariant.cpp',
|
2017-01-20 21:59:21 +03:00
|
|
|
'PLDHashTable.cpp',
|
2015-07-27 12:07:00 +03:00
|
|
|
'Tokenizer.cpp',
|
2013-04-24 01:54:15 +04:00
|
|
|
]
|
|
|
|
|
2018-03-14 03:10:55 +03:00
|
|
|
SOURCES += [
|
|
|
|
'nsGkAtoms.cpp',
|
|
|
|
]
|
Bug 1411469 - Statically allocate static atoms. r=froydnj
Currently static atoms are stored on the heap, but their char buffers are
stored in read-only static memory.
This patch changes the representation of nsStaticAtom (thus making it a
non-trivial subclass of nsAtom). Instead of a pointer to the string, it now has
an mStringOffset field which is a 32-bit offset to the string. (This requires
placement of the string and the atom within the same object so that the offset
is known to be small. The docs and macros in nsStaticAtom.h handle that.)
Static and dynamic atoms now store their chars in different ways: nsStaticAtom
stores them inline, nsDynamicAtom has a pointer to separate storage. So
`mString` and GetStringBuffer() move from nsAtom to nsDynamicAtom.
The change to static atoms means they can be made constexpr and stored in
read-only memory instead of on the heap. On 64-bit this reduces the per-process
overhead by 16 bytes; on 32-bit the saving is 12 bytes. (Further reductions
will be possible in follow-up patches.)
The increased use of constexpr required multiple workarounds for MSVC.
- Multiple uses of MOZ_{PUSH,POP}_DISABLE_INTEGRAL_CONSTANT_OVERFLOW_WARNING to
disable warnings about (well-defined!) overflow of unsigned integer
arithmetic.
- The use of -Zc:externConstexpr on all files defining static atoms, to make
MSVC follow the C++ standard(!) and let constexpr variables have external
linkage.
- The use of -constexpr:steps300000 to increase the number of operations
allowed in a constexpr value, in order to handle gGkAtoms, which requires
hashing ~2,500 atom strings.
The patch also changes how HTML5 atoms are handled. They are now treated as
dynamic atoms, i.e. we have "dynamic normal" atoms and "dynamic HTML5 atoms",
and "dynamic atoms" covers both cases, and both are represented via
nsDynamicAtom. The main difference between the two kinds is that dynamic HTML5
atoms still aren't allowed to be used in various operations, most notably
AddRef()/Release(). All this also required moving nsDynamicAtom into the header
file.
There is a slight performance cost to all these changes: now that nsStaticAtom
and nsDynamicAtom store their chars in different ways, a conditional branch is
required in the following functions: Equals(), GetUTF16String(),
WeakAtom::as_slice().
Finally, in about:memory the "explicit/atoms/static/atom-objects" value is no
longer needed, because that memory is static instead of heap-allocated.
MozReview-Commit-ID: 4AxPv05ngZy
2018-03-08 04:59:11 +03:00
|
|
|
if CONFIG['CC_TYPE'] == 'msvc':
|
|
|
|
# Needed for gGkAtoms.
|
|
|
|
SOURCES['nsGkAtoms.cpp'].flags += [
|
|
|
|
'-constexpr:steps300000',
|
|
|
|
'-Zc:externConstexpr',
|
|
|
|
]
|
2018-03-14 03:10:55 +03:00
|
|
|
|
2013-06-12 00:38:22 +04:00
|
|
|
EXTRA_COMPONENTS += [
|
|
|
|
'nsINIProcessor.js',
|
|
|
|
'nsINIProcessor.manifest',
|
|
|
|
]
|
|
|
|
|
2013-09-12 16:15:51 +04:00
|
|
|
LOCAL_INCLUDES += [
|
|
|
|
'../io',
|
|
|
|
]
|
2013-11-19 06:47:14 +04:00
|
|
|
|
2014-07-23 03:37:51 +04:00
|
|
|
FINAL_LIBRARY = 'xul'
|