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

13 Коммитов

Автор SHA1 Сообщение Дата
Henri Sivonen 8e541f1e0a Bug 1473337 - Omit ASCII-case length calculation for short strings when performing an encoding conversion that expands non-ASCII. r=Nika
MozReview-Commit-ID: 88k27XnFym9

--HG--
extra : rebase_source : d633eee2a8f64df22663607125ca99a42c59ec6d
2018-07-05 09:27:29 +03:00
Henri Sivonen 3edc601325 Bug 1402247 - Use encoding_rs for XPCOM string encoding conversions. r=Nika,erahm,froydnj.
Correctness improvements:

 * UTF errors are handled safely per spec instead of dangerously truncating
   strings.

 * There are fewer converter implementations.

Performance improvements:

 * The old code did exact buffer length math, which meant doing UTF math twice
   on each input string (once for length calculation and another time for
   conversion). Exact length math is more complicated when handling errors
   properly, which the old code didn't do. The new code does UTF math on the
   string content only once (when converting) but risks allocating more than
   once. There are heuristics in place to lower the probability of
   reallocation in cases where the double math avoidance isn't enough of a
   saving to absorb an allocation and memcpy.

 * Previously, in UTF-16 <-> UTF-8 conversions, an ASCII prefix was optimized
   but a single non-ASCII code point pessimized the rest of the string. The
   new code tries to get back on the fast ASCII path.

 * UTF-16 to Latin1 conversion guarantees less about handling of out-of-range
   input to eliminate an operation from the inner loop on x86/x86_64.

 * When assigning to a pre-existing string, the new code tries to reuse the
   old buffer instead of first releasing the old buffer and then allocating a
   new one.

 * When reallocating from the new code, the memcpy covers only the data that
   is part of the logical length of the old string instead of memcpying the
   whole capacity. (For old callers old excess memcpy behavior is preserved
   due to bogus callers. See bug 1472113.)

 * UTF-8 strings in XPConnect that are in the Latin1 range are passed to
   SpiderMonkey as Latin1.

New features:

 * Conversion between UTF-8 and Latin1 is added in order to enable faster
   future interop between Rust code (or otherwise UTF-8-using code) and text
   node and SpiderMonkey code that uses Latin1.

MozReview-Commit-ID: JaJuExfILM9
2018-08-14 14:43:42 +03:00
Bobby Holley 5ec8b701fa Bug 1454021 - Make ns{,C}String Sync/Send. r=mystor
MozReview-Commit-ID: DeBOgxxTvBR
2018-04-13 10:11:39 -07:00
Bobby Holley 915ff8eb0e servo: Merge #20577 - Avoid Gecko Namespace registration from Servo (from bholley:no_namespace_registration); r=upsuper
https://bugzilla.mozilla.org/show_bug.cgi?id=1451421

Source-Repo: https://github.com/servo/servo
Source-Revision: db9ab0440a75b8663efb816edc2b66faca59a1fd

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : b25e1a7becc43a31c2144b2389e7c01c79d83f6d
2018-04-06 17:33:07 -04:00
L. David Baron d43e36ae5b servo: Merge #20407 - Rename Gecko string DataFlags::SHARED to REFCOUNTED (from dbaron:bug1448138); r=erahm
This is the servo piece of:

[Bug 1448138](https://bugzilla.mozilla.org/show_bug.cgi?id=1448138) - Rename string DataFlags::SHARED to REFCOUNTED to make it clearer to those reading the code.  r=erahm

This is a renaming in the internals of Gecko's string library that should also have a corresponding rename in the rust bindings.  This is already reviewed as part of the Gecko change, and the two pieces should be able to land separately.

<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 1fda5d6a5a7dabbd80bc9efdedaadfeb9bf9e93a

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : d22475acddf3d597b788b53f27eaefeffe9f58b8
2018-03-23 20:56:08 -04:00
janczer 4e2c0a5eb3 servo: Merge #19970 - Change debug assertions to specific ones (from janczer:change_debug_assertions); r=emilio
<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #19962 (github issue number if applicable).

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 5d209a70ab11cd0ce6c7e086091112570c6e259d

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : c837bee3dbbf93357f6553a2a356685a094d8e3e
2018-02-07 06:20:36 -05:00
Simon Sapin 235145b016 servo: Merge #19914 - Remove #![deny(warnings)] (from servo:dont-deny); r=nox
We already have https://github.com/servo/servo/pull/19612 to deny warnings at the time of landing into master. But it’s not useful to break the build when later compiler with a more recent Rust version that has introduced new warnings:

https://bugzilla.mozilla.org/show_bug.cgi?id=1434619

Source-Repo: https://github.com/servo/servo
Source-Revision: 7546c37f1e921a112fef5828c59c6738a98c3f30

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : ed5c34f72e321ce0051347bd5156389d1ef26bef
2018-01-31 11:01:26 -06:00
Bastien Orivel b5ec6408a9 servo: Merge #18967 - Bump bitflags to 1.0 (from Eijebong:bitflags2.0); r=mbrubeck
See #18809

Still haven't had time to test it but it should fix the tests failures that appeared in m-c

Source-Repo: https://github.com/servo/servo
Source-Revision: fe4139b779b3af749ec1426ddf4e1393c7b85442

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 9a0549d7dd8a99315ba3f8eec5d0f9fdf9eb4c0f
2017-10-30 18:25:45 -05:00
Nika Layzell d89819000a servo: Merge #18993 - Move nsstring from gecko into servo/support/gecko/nsstring (from mystor:nsstring2); r=mystor
This is the servo side of bug 1403213.

Take 2 of #18941 which got backed out because we botched the landing of the gecko side and I wasn't able to fix it in time.

Source-Repo: https://github.com/servo/servo
Source-Revision: 0e6946fd9c279425e66721e6eb2b1e323e4c640f

--HG--
rename : servo/components/style/gecko_bindings/nsstring_vendor/src/lib.rs => servo/support/gecko/nsstring/src/lib.rs
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 6d2fb196b2ed25c0201097d20e07b2e757096d00
2017-10-23 17:26:28 -05:00
Gregory Szorc 0a6049fe26 Bug 1410775 - Remove dummy file to fix Servo sync state; r=me 2017-10-24 10:24:21 -07:00
Gregory Szorc e312fb03fc Bug 1410775 - Dummy file to help restore Servo VCS syncing; r=me 2017-10-24 10:22:45 -07:00
Sebastian Hengst e045239d71 Backed out changeset 196206f129ef (bug 1403213) for referencing non-existing xpcom/rust/gtest/moz.build in xpcom/moz.build. r=backout on a CLOSED TREE
--HG--
rename : servo/support/gecko/nsstring/src/lib.rs => servo/components/style/gecko_bindings/nsstring_vendor/src/lib.rs
extra : amend_source : 38517df328727184682c048c4c741b384fcddd58
2017-10-20 21:31:59 +02:00
Nika Layzell d7c878d8ac servo: Merge #18941 - Move nsstring from gecko into servo/support/gecko/nsstring (from mystor:nsstring); r=mystor
This is the servo side of bug 1403213.

This cannot merge until https://bugzilla.mozilla.org/show_bug.cgi?id=1377351 merges. It is currently on inbound. This will break autoland when it merges until the gecko-side part has also landed.

Source-Repo: https://github.com/servo/servo
Source-Revision: 7e0f5afa83d9f0eba07988735e56f47a2c18b451

--HG--
rename : servo/components/style/gecko_bindings/nsstring_vendor/src/lib.rs => servo/support/gecko/nsstring/src/lib.rs
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : ee57178ea85a844d5fb5c15e9aab3d430c0ac9a1
2017-10-20 12:32:05 -05:00