Commit graph

252 commits

Author SHA1 Message Date
Patrick Walton
fda3791487 util: Turn on ndebug in release mode, and fix task-state to not crash
when `ndebug` is on.
2015-03-20 10:09:52 -07:00
Jack Moffitt
331c7030d9 Fix overflowed arithmetic.
This uses wrapping_add, which was always the intended operation.

Fixes #5275.
2015-03-19 09:31:40 -06:00
bors-servo
34950418ea auto merge of #5269 : Manishearth/servo/old_impl, r=jdm
Brings us to zero old impls. \o/

Feel free to add this to a larger warning fix PR
2015-03-18 22:33:47 -06:00
bors-servo
0b1c2a1798 auto merge of #5267 : Adenilson/servo/squashWarnings02, r=jdm 2015-03-18 20:54:48 -06:00
Manish Goregaokar
0d7afc37e3 rm unnecessary old_impl_check 2015-03-19 07:16:03 +05:30
Adenilson Cavalcanti
375dbeff1e Squashing a few warnings. 2015-03-18 16:26:16 -07:00
Matt Brubeck
6ef9cb4e18 Remove workaround for rust-lang/rust#22244 2015-03-18 14:44:34 -07:00
Matt Brubeck
1ead92b474 Rename dlist to linked_list. 2015-03-18 14:44:34 -07:00
Simon Sapin
6a58cbd118 Fix more warnings everywhere. 2015-03-18 22:11:20 +01:00
Simon Sapin
1e858ecbc6 Fix some warnings in util. 2015-03-18 21:35:06 +01:00
Ms2ger
5f15eb5fbf Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-dev. 2015-03-18 13:18:31 -04:00
bors-servo
29b158e985 auto merge of #5252 : nnethercote/servo/system-reporter, r=jdm
Currently the system memory measurements ("resident", "vsize", etc.) are
not reported through the generic memory reporting mechanism, simply
because they pre-date that mechanism. This changeset removes that
special-casing.

One consequence of this is that previously if a platform didn't
implement one of the basic measurements, a '???' entry would be printed.
Now nothing will be printed. This is no great loss and matches what
Firefox does.

Another consequence is that the order in which the measurements are
printed is changed. I plan to fix this soon so that reports are sorted
in a more sensible fashion.
2015-03-17 14:31:10 -06:00
Nicholas Nethercote
f306febd13 Put system memory measurements in a memory reporter.
Currently the system memory measurements ("resident", "vsize", etc.) are
not reported through the generic memory reporting mechanism, simply
because they pre-date that mechanism. This changeset removes that
special-casing.

One consequence of this is that previously if a platform didn't
implement one of the basic measurements, a '???' entry would be printed.
Now nothing will be printed. This is no great loss and matches what
Firefox does.

Another consequence is that the order in which the measurements are
printed is changed. I plan to fix this soon so that reports are sorted
in a more sensible fashion.
2015-03-17 12:24:33 -07:00
Patrick Walton
d10627a2b3 layout: Implement 2D CSS transforms per CSS-TRANSFORMS § 5, 6, 7, and 8. 2015-03-17 11:30:55 -07:00
Nicholas Nethercote
fa9ca206ef Remove the fake memory profiler thread.
Currently if you don't specify the '-m' option, a fake do-nothing memory
profiler thread gets created instead of the real one. It ignores all
events except for `Exit`. And the timer thread doesn't get created so no
`Print` events are sent.

This changeset instead always creates the real thread. If you specify
'-m' the *timer* thread is still absent and it won't print anything.
However, the memory profiler thread will respond to register/unregister
events, which is good, because if there's a bug in those (e.g.
double-registration of a particular name) it'll show up in invocations
that lack '-m'.
2015-03-16 18:12:28 -07:00
Nicholas Nethercote
ece2711185 Add memory reporting infrastructure and use it to measure the display list.
This changeset implements the beginnings of fine-grained measurement of
Servo's data structures.

- It adds a new `SizeOf` trait, which is used to measure the memory used
  by heap data structures, and implements it for some std types: Box,
  String, Option, Arc, Vec, and DList.

- It adds a new `MemoryReporter` trait which is used to report memory
  measurements from other threads to the memory profiler. Reporters are
  registered and unregistered with the memory profiler, and the memory
  profiler makes measurement requests of reporters when necessary.

- It plumbs a MemoryProfilerChan through to the layout task so it can
  register a memory reporter.

- It implements the `SizeOf` trait for `DisplayList` and associated
  types, and adds a memory reporter that uses it.

The display list hits 14.77 MiB when viewing
tests/html/perf-rainbow.html, and 2.51 MiB when viewing the Guardians of
the Galaxy Wikipedia page from servo-static-suite. Example output:

  0.29: display-list::http://www.reddit.com/
  0.00: display-list::http://static.adzerk.net/reddit/ads.html?sr=-reddit.com,loggedout&bust2#http://www.reddit.com
  0.00: display-list::http://www.reddit.com/static/createadframe.html

There are a number of FIXME comments indicating sub-optimal things. This
is a big enough change for now that doing them as follow-ups seems best.
2015-03-16 18:12:26 -07:00
Manish Goregaokar
9119bb2041 Add --no-ssl flag for bypassing SSL checking 2015-03-14 19:17:07 +05:30
Patrick Walton
f9cdd05d58 layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1
§ 12.3-12.5.

Only simple alphabetic and numeric counter styles are supported. (This
is most of them though.)

Although this PR adds a sequential pass to layout, I verified that on
pages that contain a reasonable number of ordered lists (Reddit
`/r/rust`), the time spent in generated content resolution is dwarfed by
the time spent in the parallelizable parts of layout. So I don't expect
this to negatively affect our parallelism expect perhaps in pathological
cases.
2015-03-09 17:13:45 -07:00
Adenilson Cavalcanti
618f56410d Implements reflow events debugging.
Start servo with -Z relayout-event and you should have
reflow events printed to the terminal.
2015-03-06 12:27:18 -08:00
Adenilson Cavalcanti
463f03826f Cleanup compilation warning in OSX (should still work on Linux). 2015-03-03 16:01:25 -08:00
Simon Sapin
4c1d778ced Revert "layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1"
This reverts commit 30fd28d107.
2015-03-03 21:16:24 +01:00
Patrick Walton
30fd28d107 layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1
§ 12.3-12.5.

Only simple alphabetic and numeric counter styles are supported. (This
is most of them though.)

Although this PR adds a sequential pass to layout, I verified that on
pages that contain a reasonable number of ordered lists (Reddit
`/r/rust`), the time spent in generated content resolution is dwarfed by
the time spent in the parallelizable parts of layout. So I don't expect
this to negatively affect our parallelism expect perhaps in pathological
cases.
2015-03-03 17:31:19 +01:00
Prabhjyot Singh Sodhi
dbc654ffa8 Replacing uses of accumulating fold with sum 2015-03-02 06:11:39 -05:00
Ankit Agrawal
c8de895094 Add profiling to image decoding.
This extracts some independently useful parts of
<https://github.com/servo/servo/pull/4215>.
2015-02-28 18:35:48 +01:00
Alexandru Cojocaru
aaf7a7e439 Remove uint/int inside components/util (partial #4745).
This leaves range.rs alone.
2015-02-28 15:03:07 +01:00
Adenilson Cavalcanti
b9e9d7471d Implements a DisplayList dumper.
This patch will iterate through the DisplayList after the reflow
is done and print its elements (as also any sub-lists associated
to a child node stacking context).

It adds a new CLI parameter to trigger the function to dump the display list
to console (i.e. servo --debug dump-display-list url).

Using both display list and flow tree information is helpful to debug
rendering issues.
2015-02-25 19:10:05 -08:00
Nicholas Nethercote
34a384241a Report detailed RSS measurements from /proc/<pid>/smaps on Linux.
All anonymous segments are aggregated into a single measurement, as are
all segments smaller than 512 KiB.

Example output:

      142.89: resident-according-to-smaps
       97.84: - anonymous (rw-p)
       23.98: - /home/njn/moz/servo/components/servo/target/servo (r-xp)
        6.58: - [heap] (rw-p)
        5.36: - other
        3.51: - /usr/lib/x86_64-linux-gnu/dri/i965_dri.so (r-xp)
        1.33: - /lib/x86_64-linux-gnu/libc-2.19.so (r-xp)
        0.93: - /home/njn/moz/servo/components/servo/target/servo (r--p)
        0.76: - /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20 (r-xp)
        0.74: - /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0 (r-xp)
        0.50: - /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (r-xp)
        0.50: - /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1 (r-xp)
        0.45: - /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0 (r-xp)
        0.43: - /lib/x86_64-linux-gnu/libm-2.19.so (r-xp)
2015-02-23 15:20:32 -08:00
Nicholas Nethercote
121394a121 Switch ordering of the memory profiler's output columns.
Because _size_ is always small, but _category_ can be long, so it makes
sense to have the _size_ on the left.
2015-02-23 14:03:10 -08:00
Simon Sapin
2a50755c8a Move selector matching to an external library, for use outside Servo. 2015-02-23 16:29:34 +01:00
Edit Balint
325400dce4 Implement Canvas pixel manipulation 2015-02-22 13:41:58 -05:00
Patrick Walton
40a3b41758 layout: Add an option to visualize parallel layout 2015-02-20 19:11:35 -08:00
Ms2ger
125df55222 Move util to libc from crates.io. 2015-02-20 08:58:23 +01:00
Jack Moffitt
7acc0619e6 Correct usage of number of painting threads.
Previously this used the number of layout threads to allocate the
threadpool. This also makes the member name consistent with the rest of
the structure.
2015-02-19 16:17:55 -07:00
Jack Moffitt
923676d443 Added overlay for demoing parallel painting. 2015-02-19 16:17:55 -07:00
Ms2ger
aaed4a54c7 Use rustc-serialize rather than the built-in deprecated serialize. 2015-02-17 13:24:15 +01:00
Ms2ger
52439eda9c Cleanup memory.rs a bit. 2015-02-13 16:52:54 +01:00
bors-servo
7acc6887d5 auto merge of #4917 : nnethercote/servo/fix-jemalloc-reporting, r=jdm
It turns out you need to send an "epoch" request to jemalloc before
asking for a measurement otherwise you get stale data! Heavens.
2015-02-13 06:54:56 -07:00
Ms2ger
830e6741c7 Fix warnings in util. 2015-02-13 11:42:13 +01:00
Nicholas Nethercote
eaee46de7c Fix jemalloc memory measurements.
It turns out you need to send an "epoch" request to jemalloc before
asking for a measurement otherwise you get stale data! Heavens.
2015-02-12 21:18:11 -08:00
Matt Brubeck
04fb3a5267 Make dlist::split use new DList::split_off. 2015-02-12 15:39:08 -08:00
Matt Brubeck
76a2653f8f Replace append_from and prepend_from with DList::append 2015-02-12 15:38:46 -08:00
Simon Sapin
d5dd1d658e Upgrade to rustc ba2f13ef0 2015-02-04 2015-02-11 14:48:34 -08:00
bors-servo
d1c8ed4359 auto merge of #4858 : nnethercote/servo/mallinfo, r=glennw
Although Rust allocations are on the jemalloc heap, allocations done by
Skia and the graphics driver are on the system heap, so it's worth
reporting that as well.

One thing I'm not sure about: I think mallinfo() might be a glibc-only thing, and I'm not sure if `target_os="linux"` implies glibc for Servo. So confirmation of that would be good.
2015-02-09 17:30:45 -07:00
Josh Matthews
446f0f447e Allow unused variables, imports, and mutable. 2015-02-09 17:41:57 -05:00
Nicholas Nethercote
d6fc52f927 Use mallinfo() to report the system heap size on Linux.
Although Rust allocations are on the jemalloc heap, allocations done by
Skia and the graphics driver are on the system heap, so it's worth
reporting that as well.
2015-02-05 18:47:49 -08:00
bors-servo
1e72608f5c auto merge of #4823 : Ms2ger/servo/warnings, r=jdm 2015-02-03 17:57:51 -07:00
Ms2ger
e2408355a7 Fix build warnings. 2015-02-03 18:22:27 +01:00
Alexandru Cojocaru
685fee02a0 add unwrap to send/recv calls 2015-02-03 16:05:13 +01:00
Manish Goregaokar
40c9e7f72e Move RangeIndex to associated types (avoids old impl check) 2015-01-31 15:55:05 +05:30
Josh Matthews
9e01d91947 Lock crates.io dependencies to specific versions. 2015-01-31 01:27:26 +01:00