Commit graph

39 commits

Author SHA1 Message Date
Simon Sapin
a15d33a10e cargo fix --edition 2018-11-10 17:47:28 +01:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Emilio Cobos Álvarez
4c97f68f3e
Fix tidy issues. 2018-09-18 11:46:01 +02:00
Manish Goregaokar
84ca681a78
servo_arc cleanups for publishing.
Differential Revision: https://phabricator.services.mozilla.com/D6034
2018-09-18 11:39:54 +02:00
Bobby Holley
89880727ec
style: Use an acquire load for is_unique in servo_arc.
Fixes #21186

Bug: 1476445
Reviewed-by: Manishearth
Differential Revision: https://phabricator.services.mozilla.com/D2205
2018-07-24 03:27:08 +02:00
Emilio Cobos Álvarez
292f899631
style: Fix tidy issues and Servo build. 2018-04-29 05:09:43 +02:00
Bobby Holley
cbbefebdba
servo_arc: ArcUnion.
Bug: 1455784
Reviewed-by: Manishearth
MozReview-Commit-ID: Jxp2A7cj6CV
2018-04-29 03:28:31 +02:00
Bobby Holley
c99bcdd4b8 Run rustfmt on selectors, servo_arc, and style.
This was generated with:

./mach cargo fmt --package selectors &&
./mach cargo fmt --package servo_arc &&
./mach cargo fmt --package style

Using rustfmt 0.4.1-nightly (a4462d1 2018-03-26)
2018-04-10 17:35:15 -07:00
janczer
661d234c3c Change debug assertions to specific ones 2018-02-07 09:21:24 +01:00
CYBAI
6e4e318b24 Use specific negative assertion for ServoArc 2018-01-26 02:24:06 +08:00
CYBAI
f81ba5e9dd Use specific assertion for ServoArc 2018-01-26 01:18:59 +08:00
Simon Sapin
4be3096040 Add some FIXME comments about using ptr::NonNull 2018-01-22 17:41:26 +01:00
Simon Sapin
b0003f77e4 Prepare servo_arc for publication on crates.io 2018-01-12 15:10:44 +01:00
Emilio Cobos Álvarez
a1521d9d4d
servo_arc: Add some #[inline] and repr(C) annotations.
inline is probably unnecessary, but anyway... We rely on those being repr(C), so
they rather have some.
2017-12-01 14:34:38 +01:00
Nicholas Nethercote
4506f0d30c Replace all uses of the heapsize crate with malloc_size_of.
Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`.
`malloc_size_of` is better -- it handles various cases that `heapsize` does not
-- so this patch changes Servo to use `malloc_size_of`.

This patch makes the following changes to the `malloc_size_of` crate.

- Adds `MallocSizeOf` trait implementations for numerous types, some built-in
  (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`).

- Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't
  support that operation.

- For `HashSet`/`HashMap`, falls back to a computed estimate when
  `enclosing_size_of_op` isn't available.

- Adds an extern "C" `malloc_size_of` function that does the actual heap
  measurement; this is based on the same functions from the `heapsize` crate.

This patch makes the following changes elsewhere.

- Converts all the uses of `heapsize` to instead use `malloc_size_of`.

- Disables the "heapsize"/"heap_size" feature for the external crates that
  provide it.

- Removes the `HeapSizeOf` implementation from `hashglobe`.

- Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of`
  doesn't derive those types, unlike `heapsize`.
2017-10-18 22:20:37 +11:00
Matt Brubeck
efc3683cc7 Fix commonmark Markdown warnings in docs, part 1
Fixes warnings from rust-lang/rust#44229 when `--enable-commonmark` is
passed to rustdoc.

This is mostly a global find-and-replace for bare URIs on lines by
themselves in doc comments.
2017-10-17 11:24:57 -07:00
Cameron McCormack
9c738711bc servo_arc: Make Arc do a pointer equality check in eq and ne first. 2017-10-11 09:24:03 +08:00
Emilio Cobos Álvarez
cb31e782aa
style: Share user agent cascade data across documents.
MozReview-Commit-ID: KcyuTHD0bt9
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-15 09:26:23 +02:00
Emilio Cobos Álvarez
c34c92e904 style: Add a TLS-based style struct caching mechanism. 2017-09-14 17:13:39 +08:00
Nicholas Nethercote
61877b7316 Measure selectors.
This patch adds measurement of Selectors within StyleRule. This requires
exposing the pointer within ThinArc.

The patch also adds measurement of the several CssRule variants, in order to
measure nested CssRules (and PropertyDeclarationBlocks) within them:
DocumentRule, MediaRule, PageRule, SupportsRule.
2017-09-07 15:01:11 +10:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Nicholas Nethercote
526e9691f8 stylo: Measure Elements and ComputedValues.
The patch provides FFI access to Gecko's SeenPtrs type from Rust, in
order to record what has already been measured when measuring Arcs. (The
SeenPtrs must be initialized on the Gecko side because the same table is
reused for measuring all Elements within a window, because Elements can
share ComputedValues.) I have confirmed with DMD that this is working
correctly.

The patch also introduces MallocSizeOfRepeats, which is like
MallocSizeOf but takes a SizeOfState, which holds a SeenPtrs table.
2017-08-03 09:15:38 +10:00
Manish Goregaokar
3c3e4399da stylo: Remove usage of ServoComputedValues from binding functions 2017-07-21 08:33:11 -07:00
Manish Goregaokar
74519cc1a7 stylo: Make Servo Arc types use ptr to T instead of ptr to ArcInner<T> 2017-07-17 18:03:09 -07:00
Manish Goregaokar
5d78743037 stylo: Replace real ComputedValues with bindgenned ComputedValues2 2017-07-17 18:01:20 -07:00
Manish Goregaokar
d1c235d7b7 stylo: Add RawOffsetArc<T> 2017-07-17 18:00:47 -07:00
bors-servo
6597178b91
Auto merge of #17701 - bholley:reuse_allocations, r=emilio
reuse the bloom filter and style sharing cache across traversals

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

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17701)
<!-- Reviewable:end -->
2017-07-14 11:01:07 +02:00
Emilio Cobos Álvarez
a34f288b98
Revert "Auto merge of #17701 - bholley:reuse_allocations, r=emilio"
This reverts commit ebfc8f5858, reversing
changes made to 5585ff2c44.

Animation code can reenter and create a new TLS context from the traversal
SequentialTask, so this won't work as written.
2017-07-13 09:58:08 +02:00
Bobby Holley
0614010552 Store the bloom filter in TLS and reuse it across traversals.
MozReview-Commit-ID: EbzDehr2Y2L
2017-07-12 16:38:06 -07:00
Bobby Holley
d1c31f7eaf Add owning_ref back as a style dep, and update parking_lot. 2017-07-12 16:37:50 -07:00
Nathan Froyd
096cee8ebc remove various things now that Rust 1.17 is required
std::ptr::eq and Arc::ptr_eq are now usuable, and we can replace a
panic!() with abort().
2017-06-23 10:39:41 -04:00
Imanol Fernandez
58e887658d Fix over-alignment assert crash on Android. 2017-06-17 01:43:24 +02:00
Bastien Orivel
76d8573393 Bump serde to 1.0 2017-06-16 13:31:18 +02:00
Bobby Holley
eee07be227 Introduce NonZeroPtrMut and use it in servo_arc.
MozReview-Commit-ID: AAmeyjfyXeU
2017-06-06 21:38:51 -07:00
Bobby Holley
586a21e1dd Make a bunch of types 'static.
The reasoning for this is explained in a comment in the next patch.

MozReview-Commit-ID: FQgDY77mg3B
2017-06-06 19:09:16 -07:00
Bobby Holley
817a2c6cca Address followup review comments.
MozReview-Commit-ID: AghLMEcbUVC
2017-06-06 19:09:04 -07:00
Bobby Holley
ce8d2a9208 Implement ThinArc.
MozReview-Commit-ID: LB3bs9ed2WC
2017-06-05 19:44:09 -07:00
Bobby Holley
21448cf266 Add support for dynamically-sized types in servo_arc.
MozReview-Commit-ID: H15cG5RBtZH
2017-06-05 19:44:05 -07:00
Bobby Holley
fa9d2cb036 Move stylearc into a separate crate.
MozReview-Commit-ID: C3btN8Jw9sJ
2017-06-05 19:44:04 -07:00
Renamed from components/style/stylearc.rs (Browse further)