Commit graph

7387 commits

Author SHA1 Message Date
Manish Goregaokar
dedebc5cb5 Add spec links for column properties 2017-01-03 14:03:11 -08:00
Manish Goregaokar
6a88723409 Support logical values for float/clear 2017-01-03 14:03:10 -08:00
bors-servo
57b2c2609e Auto merge of #14828 - bholley:faster_atomic_refcell, r=Manishearth
Reimplement AtomicRefCell with pure atomics

While reviewing @bzbarsky's patches in [1], I started typing out some lore about how mutable AtomicRefCell borrows are actually cheaper than immutable ones, so we should prefer them where possible. But then I decided that this was a really dumb state of affairs and that we should just fix AtomicRefCell instead, and implement a proper AtomicRef{,Mut}::map while we were at it. So here we are.

This PR adds a from-scratch implementation of AtomicRefCell that aims to be 100% sound, even in unrealistic overflow scenarios. We should probably get this on crates.io eventually, but I want to land it landed in-tree first.

With this implementation, each operation (borrow or release) is one atomic instruction, and all borrow/release pairs (mutable or immutable) take 12 ns on my machine, which is what I'd expect. This is a 50% improvement over the previous implementation in the immutable case.

There may be some places where we could get away with Ordering::Release instead of Ordering::AcqRel, but it didn't seem worth it to try to reason it out.

r? @Manishearth

CC @emilio @SimonSapin @heycam @upsuper

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1298588

<!-- 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/14828)
<!-- Reviewable:end -->
2017-01-03 12:24:45 -08:00
Bobby Holley
c26b4bed60 Reimplement AtomicRefCell as a fork of RefCell. 2017-01-03 12:23:06 -08:00
Manish Goregaokar
0b515c2bc9 Add spec links for box properties 2017-01-03 10:27:49 -08:00
Manish Goregaokar
a9c0162000 Add spec links for border properties 2017-01-03 10:24:00 -08:00
Manish Goregaokar
cd2f9734e9 Add spec links for background properties 2017-01-03 10:23:56 -08:00
Manish Goregaokar
d63af611f2 Add spec links for position properties 2017-01-03 10:23:04 -08:00
Manish Goregaokar
29c2db4457 Add spec argument to property helpers 2017-01-03 10:23:02 -08:00
Cameron McCormack
8d6c3e0bdf stylo: Regenerate bindings. 2017-01-03 19:09:18 +08:00
Cameron McCormack
1041ce6b98 stylo: Update glue for background-color. 2017-01-03 19:09:17 +08:00
Emilio Cobos Álvarez
a8fdf5b6b9
style: Require documentation also for a Gecko build. 2017-01-02 12:58:08 +01:00
Emilio Cobos Álvarez
2cebd3bc96
style: Document gecko_string_cache. 2017-01-02 12:58:07 +01:00
Emilio Cobos Álvarez
e9d3ac03a9
style: Document Gecko's wrapper module. 2017-01-02 12:58:06 +01:00
Emilio Cobos Álvarez
94f8c0fc63
style: Document the remaining public parts of Gecko's values module. 2017-01-02 12:58:06 +01:00
Emilio Cobos Álvarez
632c99676b
style: Document Gecko's traversal code.
Actually, I think most of the functions in DOMTraversalContext deserve a nice
comment, but that's probably fine as a followup, I want to land the require-docs
thing now.
2017-01-02 12:58:05 +01:00
Emilio Cobos Álvarez
58173367be
style: Document Gecko's snapshot code. 2017-01-02 12:58:05 +01:00
Emilio Cobos Álvarez
40e5ec9018
style: Document Gecko's restyle-damage code. 2017-01-02 12:58:05 +01:00
Emilio Cobos Álvarez
99b0f53064
style: Describe the gecko module. 2017-01-02 12:58:04 +01:00
Emilio Cobos Álvarez
dba73dc618
style: Document Gecko's data module. 2017-01-02 12:58:04 +01:00
Emilio Cobos Álvarez
ee48599d1b
style: Document Gecko conversions module. 2017-01-02 12:58:03 +01:00
Emilio Cobos Álvarez
7b4d3deae7
style: Ditch GeckoStyleCoordHelpers, and implement directly on nsStyleCoord. 2017-01-02 12:58:03 +01:00
Emilio Cobos Álvarez
9b6cf8dc1b
style: Document the nsCOMPtr sugar. 2017-01-02 12:58:03 +01:00
Emilio Cobos Álvarez
bcac8265c9
style: Document Gecko's selector parser. 2017-01-02 12:58:02 +01:00
Emilio Cobos Álvarez
2778354455
style: Document nsCSSShadowArray sugar. 2017-01-02 12:58:01 +01:00
Emilio Cobos Álvarez
96fb1378d7
style: Document the sugar for nsStyleCoord. 2017-01-02 12:58:01 +01:00
Emilio Cobos Álvarez
1bd246905c
style: Document sugar for nsStyleAutoArray. 2017-01-02 12:58:01 +01:00
Emilio Cobos Álvarez
89f3e34f48
style: Describe the sugar module. 2017-01-02 12:58:00 +01:00
Emilio Cobos Álvarez
3a75545629
style: Document the bindings module, allow missing docs in autogenerated files. 2017-01-02 12:58:00 +01:00
Emilio Cobos Álvarez
1fc48dc730
style: Document nsTArray sugar module. 2017-01-02 12:57:59 +01:00
Emilio Cobos Álvarez
1d19e81c8b
style: Document and make clearer the ownership helpers. 2017-01-02 12:57:59 +01:00
Emilio Cobos Álvarez
f97e5ff9aa
style: Document the RefPtr sugar module. 2017-01-02 12:57:59 +01:00
Emilio Cobos Álvarez
d10cc314fe
style: Document the StyleComplexColor sugar. 2017-01-02 12:57:58 +01:00
Emilio Cobos Álvarez
51134b9dc8
style: Disallow new undocumented code by default for Servo.
Still a bunch of Gecko-only code to document.
2017-01-02 12:57:58 +01:00
Emilio Cobos Álvarez
939557260c
style: Allow the attr module to be without documentation, for now. 2017-01-02 12:57:57 +01:00
Emilio Cobos Álvarez
c6144df470
style: Document the font_face module. 2017-01-02 12:57:57 +01:00
Emilio Cobos Álvarez
369c2f299e
style: Simplify the cascade function in the custom_properties module. 2017-01-02 12:57:56 +01:00
Emilio Cobos Álvarez
c44826f1cc
style: Document the custom_properties module. 2017-01-02 12:57:56 +01:00
Emilio Cobos Álvarez
3cd6cba1ee
style: Allow the atomic_refcell module to be undocumented, for now.
Given Bobby is rewriting it as I write this.
2017-01-02 12:57:55 +01:00
Emilio Cobos Álvarez
c9ffd9b429
style: Allow the logical_geometry module to be undocumented, for now. 2017-01-02 12:57:55 +01:00
Emilio Cobos Álvarez
0b3c1a8924
style: Document the keyframes module. 2017-01-02 12:57:54 +01:00
Emilio Cobos Álvarez
3f7f914e16
style: Allow the lack of documentation for the media_queries module.
I'm rewriting all that stuff soon, so it's kind of pointless to document the
existing stuff right now.
2017-01-02 12:57:54 +01:00
Emilio Cobos Álvarez
b31470dddb
style: Document the owning_handle module. 2017-01-02 12:57:53 +01:00
Emilio Cobos Álvarez
081b8399e6
style: Document the scoped_tls module. 2017-01-02 12:57:53 +01:00
Emilio Cobos Álvarez
c7bcbad3b9
style: Document the StyleContext module. 2017-01-02 12:57:53 +01:00
Emilio Cobos Álvarez
e8d947430a
style: Document and clean up the parser module. 2017-01-02 12:57:52 +01:00
Emilio Cobos Álvarez
fa8874fb14
style: Document the restyle hints code, and make it operate on TElement.
This removes the annoying constraint of having to provide the current state from
outside of the restyle hints code.
2017-01-02 12:57:52 +01:00
Emilio Cobos Álvarez
c5f2142d8f
style: Document the stylist module. 2017-01-02 12:57:51 +01:00
Emilio Cobos Álvarez
082866aba6
style: Export fnv's FnvHashMap, instead of rewriting it. 2017-01-02 12:57:51 +01:00
Emilio Cobos Álvarez
121b718e99
style: Remove a bunch of duplicated logic in add_stylesheet.
This is remminiscent of my recent @import refactor, and stayed there
incorrectly.

Note that it's the same code that lives in `update` (where it should live).
2017-01-02 12:57:50 +01:00