servo/servo — pull request #3164 by cgaebel (2014-08-27 00:17:31+00:00)
Title: Avoid using message passing for simple JS -> Layout "rpc-like" queries.

When JS would query the layout with questions like "is this under the cursor?",
we send a message with the question, and a message with the response.

Unfortunately, many javascript benchmarks like to test the layout engine by doing
a ton of these calls in tight loops. This makes servo look bad because of the
message passing overhead.

This pull request adds a simple RPC interface to the layout, which uses a mutex
and shared state to communicate between the threads. It should be a performance
win, as long as it's used sparingly for short queries.