Commit graph

926 commits

Author SHA1 Message Date
Ms2ger
d6aa0915c3 Use the heap module through its facade in libstd. 2015-06-26 20:52:28 +02:00
bors-servo
f812390d3a Auto merge of #6463 - Ms2ger:layout-reduce-unsafe, r=SimonSapin
Reduce the scope of the unsafe block in ParallelPostorderDomTraversal.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6463)
<!-- Reviewable:end -->
2015-06-26 06:45:48 -06:00
bors-servo
26982cb547 Auto merge of #6449 - mbrubeck:byte_range, r=pcwalton
Slice TextRuns by byte range instead of char range

Currently only the end of the byte range is used, but I plan to use the full range in some follow-up work.

Fixes #6431. r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6449)
<!-- Reviewable:end -->
2015-06-25 22:25:36 -06:00
Ms2ger
b6e5f8e7b6 Reduce the scope of the unsafe block in ParallelPostorderDomTraversal. 2015-06-25 22:34:00 +02:00
Ms2ger
b98a7f27a9 Remove a no-op transmute in ParallelPostorderDomTraversal. 2015-06-25 22:31:33 +02:00
Ms2ger
d0a29c3951 Use a dedicated type for the opaque type parameter to WorkQueue in layout.
Currently, we use UnsafeFlow and UnsafeLayoutNode, both of which are aliases
for (usize, usize) and thus interconvertible. This change should make it
clearer that the WorkQueue is not limited to one particular type.
2015-06-25 21:20:41 +02:00
Ms2ger
73a7e92bfd Update to rustc 2d0cbf3e3e25e092bd9e4c94d08e446b680869f0. 2015-06-25 20:02:36 +02:00
Ms2ger
8375e0914a Simplify ThreadSafeLayoutNodeChildrenIterator::next a bit. 2015-06-25 08:28:03 +02:00
Ms2ger
51d0f51dd9 Use a while let loop in ThreadSafeLayoutNode::traverse_postorder_mut. 2015-06-25 08:27:56 +02:00
Ms2ger
c87c7f1d84 Simplify ThreadSafeLayoutNode::text_content. 2015-06-25 08:27:53 +02:00
Ms2ger
e1cee995b7 Make {ThreadSafe,}LayoutNode::get_jsmanaged private.
There are no longer any callers outside wrapper.rs, and this makes it harder
to introduce buggy callers.
2015-06-24 15:14:19 +02:00
Ms2ger
2ea32829af Replace OpaqueNodeMethods::from_{threadsafe_,}layout_node by opaque methods. 2015-06-24 14:55:43 +02:00
bors-servo
469b9550f6 Auto merge of #6443 - Ms2ger:cleanup-layout, r=pcwalton
Various layout cleanup.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6443)
<!-- Reviewable:end -->
2015-06-24 03:00:32 -06:00
Matt Brubeck
83c73a5d91 Slice TextRuns by byte range instead of char range
Fixes #6431
2015-06-23 10:06:50 -07:00
Glenn Watson
39ddbbb0e1 Implement enough of 3d transforms spec to run the CSS FPS demo. 2015-06-23 14:10:44 +10:00
bors-servo
d86c587925 Auto merge of #6445 - mbrubeck:next_fragment, r=pcwalton
Simplify next_fragment and fix obsolete docs

r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6445)
<!-- Reviewable:end -->
2015-06-22 16:23:27 -06:00
Matt Brubeck
a3b339c358 Simplify next_fragment and fix obsolete docs 2015-06-22 15:23:00 -07:00
Ms2ger
a42e11a95f Replace the LayoutDataAccess trait by inherent methods. 2015-06-22 11:34:31 +02:00
Ms2ger
167a396293 Replace TLayoutNode by inherent methods.
There is no reason for this trait to exist.
2015-06-22 11:04:43 +02:00
Ms2ger
50d4084e9a Remove TLayoutNode::first_child.
It is replaced by the TNode implementation for LayoutNode and an inherent
implementation for ThreadSafeLayoutNode.
2015-06-22 11:04:41 +02:00
Ms2ger
dc167ca343 Implement type_id as inherent methods.
This implies LayoutNode no longer needs to return an Option, as it never
represents a pseudo-element.

Also, fixes lies in the documentation.
2015-06-22 10:47:52 +02:00
Ms2ger
f0034b4ac9 Remove some dead code from ThreadSafeLayoutNode::first_child.
self.pseudo is always PseudoElementType::Normal at this point.
2015-06-22 10:47:44 +02:00
Ms2ger
13a07a4ed2 Move some TLayoutNode methods to ThreadSafeLayoutNode.
They are unused on LayoutNode.
2015-06-22 10:47:38 +02:00
Ms2ger
8f58dafbd6 Inline node_is_element and node_is_document into their only callers. 2015-06-22 10:47:35 +02:00
Ms2ger
54b9dc6563 Inline LayoutNode::text_content into its only caller, ThreadSafeLayoutNode::text_content. 2015-06-22 10:47:31 +02:00
Ms2ger
1398616ec1 Remove incorrect claim from a comment. 2015-06-22 10:47:27 +02:00
Ms2ger
ae5191275a Remove TLayoutNode::get.
It is highly unsafe and unused.
2015-06-22 10:47:23 +02:00
Ms2ger
eb2c508df0 Implement the LayoutData getters on LayoutJS<Node> rather than Node itself. 2015-06-22 10:47:21 +02:00
Ms2ger
ebd0a62eec Remove an unused import from layout_task. 2015-06-22 10:47:18 +02:00
Simon Sapin
fc25397c91 Update rust-selectors
https://github.com/servo/rust-selectors/pull/30
2015-06-20 07:05:43 +02:00
Michael Wu
675267b782 Upgrade to SM 39 2015-06-19 18:42:48 -04:00
ecoal95
8cbfb3482c Use euclid from crates.io 2015-06-19 00:04:24 +02:00
Simon Sapin
0229de822b Use string-cache from crates.io 2015-06-16 00:27:50 +02:00
Manish Goregaokar
94fa868d2b Add unsafe blocks to make_unique
See #6376
2015-06-14 20:52:27 +05:30
bors-servo
db2eb36e19 Auto merge of #6325 - Ms2ger:from_str, r=nox
The former appears to be preferred.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6325)
<!-- Reviewable:end -->
2015-06-14 03:55:56 -06:00
Corey Farwell
5c408d2be9 rust-geom API changes
https://github.com/servo/rust-geom/pull/81
2015-06-13 12:28:21 -07:00
Ms2ger
b49bd79625 Use str::parse() rather than FromStr::from_str.
The former appears to be preferred.
2015-06-13 17:58:16 +02:00
Patrick Walton
eef9c5d9bf layout: Disable parallel display list building by default.
I've never see it result in a speedup. Actually, I don't think I've seen
it result in anything better than a 50% slowdown. The arithmetic
intensity is just too low, at least with the current algorithm.

Parallel DL building can still be enabled with a debug flag if the
algorithm is improved.
2015-06-12 18:03:58 -07:00
bors-servo
f03f584895 Auto merge of #6334 - nnethercote:report-local-contexts, r=pcwalton
Passing a function that measures TLS to WorkQueue is a bit weird, but I can't see how else to measure that data.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6334)
<!-- Reviewable:end -->
2015-06-12 18:42:32 -06:00
Patrick Walton
732fd9e050 layout: Divide DOM nodes and flows into chunks, and perform work stealing over
those instead of working on nodes one-by-one.

This reduces the overhead of the work-stealing traversal function
significantly. It's especially important on ARM, where memory barriers are
expensive.
2015-06-12 16:07:39 -07:00
bors-servo
74ef31cfc4 Auto merge of #6335 - nnethercote:fix-layout-task-shutdown-panic, r=metajack
Prior to this change, a panic would occur if a CollectReport message was
received while the LayoutTask was shutting down. Now it just gets
ignored.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6335)
<!-- Reviewable:end -->
2015-06-11 00:58:41 -06:00
Nicholas Nethercote
67e7436cb8 Ignore CollectReport messages when shutting down the LayoutTask.
Prior to this change, a panic would occur if a CollectReport message was
received while the LayoutTask was shutting down. Now it just gets
ignored.
2015-06-10 21:18:39 -07:00
Nicholas Nethercote
48a0725c01 Measure LocalLayoutContexts in LayoutTask and LayoutWorkers.
The FreeType instances in layout workers are reasonably large and worth
measuring. The one in LayoutTask is smaller but it's easy to measure at the
same time. Sample output:
```
|    8.33 MiB -- pages
|       8.33 MiB -- url(file:///home/njn/moz/servo/../servo-static-suite/wikipedia/Guardians%20of%20the%20Galaxy%20(film)%20-%20Wikipedia,%20the%20free%20encyclopedia.html)
|          1.32 MiB -- layout-worker-0-local-context
|          1.31 MiB -- layout-worker-1-local-context
|          1.24 MiB -- layout-worker-3-local-context
|          1.17 MiB -- layout-worker-4-local-context
|          1.08 MiB -- layout-worker-2-local-context
|          1.06 MiB -- layout-worker-5-local-context
|          0.78 MiB -- paint-task
|             0.78 MiB -- buffer-map
|          0.38 MiB -- layout-task
|             0.30 MiB -- display-list
|             0.07 MiB -- local-context
```
This required adding a mechanism to WorkQueue to measure worker TLSes.
2015-06-10 21:06:59 -07:00
bors-servo
a8b6632a5a Auto merge of #6328 - mbrubeck:line-comment, r=pcwalton
r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6328)
<!-- Reviewable:end -->
2015-06-10 17:44:55 -06:00
Glenn Watson
899ab226de Updates for changes in rust-geom and rust-layers 2015-06-11 07:19:58 +10:00
Patrick Walton
e42011cd53 Revert "Updates for changes in rust-geom and rust-layers" 2015-06-10 14:14:51 -07:00
Patrick Walton
053296e131 Merge pull request #6329 from glennw/remove-generic
Updates for changes in rust-geom and rust-layers
2015-06-10 14:14:24 -07:00
Glenn Watson
8fb29c91e6 Updates for changes in rust-geom and rust-layers 2015-06-11 07:05:56 +10:00
Matt Brubeck
775953b11e Fix indices in Line::range doc comment 2015-06-10 14:04:15 -07:00
Corey Farwell
4f47b41fa7 Remove fnv & smallvec crate reexports from util
The util component specified fnv and smallvec as dependencies and publicly
reexported both of them. Several other components utilized these reexports,
presumably because fnv and smallvec used to live in the tree so reexporting
made the transition easier.

These indirect dependencies through the util component are unnecessary.

This commit removes the fnv & smallvec crate reexports in the util component.
It exchange, it adds fnv & smallvec as dependencies to non-util components
wherever needed. Finally, it removes the fnv dependency from util as it is not
utilized anywhere in the util component.
2015-06-10 07:14:55 -07:00