Граф коммитов

9 Коммитов

Автор SHA1 Сообщение Дата
Ricky Stewart 38f4d8fa39 Bug 1621361 - Convert webidl to py3_action r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D71803
2020-04-24 16:17:26 +00:00
Mike Shal 449e9c0820 Bug 1618620 - Convert gen_static_components.py to py3; r=firefox-build-system-reviewers,rstewart
Note that perfecthash.py is also used by other scripts, so it needs to
remain py2 compatible for now.

Differential Revision: https://phabricator.services.mozilla.com/D64620

--HG--
extra : moz-landing-system : lando
2020-02-28 21:27:17 +00:00
Jan de Mooij 6febd292ea Bug 1586683 - Remove flat strings from JSAPI. r=jwalden,bzbarsky
We want to remove flat strings (JSFlatString). With this patch we only expose
linear strings (JSLinearString) to API consumers.

This is very mechanical for the most part, because code typically only cares
about linear strings and not the null-termination aspect.

CTypes's Library.cpp has some Windows-specific code where we relied on null-terminated
strings. This patch adds JS_CopyStringCharsZ for that use case.

Differential Revision: https://phabricator.services.mozilla.com/D48314

--HG--
extra : moz-landing-system : lando
2019-10-14 09:32:07 +00:00
Daniel Varga 989da387ea Bug 1083971 - Added a new line in xpcom/ds/tools/make_dafsa.py to fix lint failure 2019-07-02 16:04:46 +03:00
Arpit Bharti 3ac5afd32b Bug 1083971 - Add an option to output a binary file for the PSL data r=leplatrem,erahm
Differential Revision: https://phabricator.services.mozilla.com/D34364

--HG--
extra : moz-landing-system : lando
2019-07-02 12:28:48 +00:00
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
Nika Layzell 3869445efd Bug 1474739 - Part 3: Linting fixes on a CLOSED TREE, a=bustage 2018-08-01 18:23:21 -04:00
Nika Layzell d36f0538d8 Bug 1479484 - Part 3: Add perfecthash.py with codegen to xpcom/ds/tools, r=froydnj
Summary:
This is a streamlined version of perfecthash.py from xpcom/reflect/xptinfo.
There are a few major changes here:

Instead of providing '(key, value)' pairs to the constructor, callers provide a
list of 'entries'. An optional 'key' parameter allows overriding the function
used to get an entry's key. The default behaviour is as before, destructuring a
(key, value) tuple.

Keys can now be anything which supports the 'memoryview' protocol with 1-byte
elements, rather than being forced to be a 'bytearray'. This allows passing in
types such as bytestrings.

A new 'cxx_codegen' method is now exposed which generates a series of
fully-contained C++ declarations to perform entry lookups. It is possible to
override many parts of this codegen to make it the best fit for your component.

PerfectHash remembers the 'key' function, meaning lookup methods automatically
verify a valid key was passed in, and return 'None' otherwise.

Depends On D2615

Reviewers: froydnj!

Tags: #secure-revision

Bug #: 1479484

Differential Revision: https://phabricator.services.mozilla.com/D2616
2018-08-01 17:54:42 -04:00
Nika Layzell 7a9f60fafb Bug 1479484 - Part 1: Add make_dafsa.py to the virtualenv's python path, r=froydnj
Summary:
The plan is to also expose perfecthash.py from this module on the python path.
This also allows us to stop using explicit module loading to load make_dafsa.py.

make_dafsa.py was moved into tools/ to avoid any extra python files from
accidentally ending up on the python path.

Reviewers: froydnj!

Tags: #secure-revision

Bug #: 1479484

Differential Revision: https://phabricator.services.mozilla.com/D2614


--HG--
rename : xpcom/ds/make_dafsa.py => xpcom/ds/tools/make_dafsa.py
2018-08-01 17:54:41 -04:00