Commit Graph

22012 Commits

Author SHA1 Message Date
Patrick Walton 25337a7f9f librustc: De-@mut CrateContext::type_hashcodes 2013-12-26 13:01:24 -08:00
Patrick Walton a1747a6091 librustc: De-@mut CrateContext::adt_reprs 2013-12-26 13:01:24 -08:00
Patrick Walton db83a957b6 librustc: De-@mut CrateContext::llsizingtypes 2013-12-26 13:01:24 -08:00
Patrick Walton 06805209e4 librustc: De-@mut lltypes. 2013-12-26 13:01:24 -08:00
Patrick Walton 8c194a0136 librustc: De-@mut CrateContext::module_data 2013-12-26 13:01:24 -08:00
Patrick Walton 1185fcc437 librustc: De-@mut the impl_method_cache 2013-12-26 13:01:24 -08:00
Patrick Walton 37e3f2fe63 librustc: De-@mut CrateContext::extern_const_values 2013-12-26 13:01:24 -08:00
Patrick Walton d16cca1f50 librustc: De-@mut const_values. 2013-12-26 13:01:23 -08:00
Patrick Walton 28943e96cb librustc: De-@mut RefCell::const_globals. 2013-12-26 13:01:23 -08:00
Patrick Walton 0e2041c54b librustc: De-@mut CrateContext::const_cstr_cache. 2013-12-26 13:01:23 -08:00
Patrick Walton 13f85cb097 librustc: De-@mut CrateContext::vtables. 2013-12-26 13:01:23 -08:00
Patrick Walton 5dcc5165a6 librustc: Remove unused discrim_symbols field from the crate context 2013-12-26 13:01:23 -08:00
Patrick Walton 0f3e4fea4f librustc: Remove unused field enum_sizes from the crate context 2013-12-26 13:01:23 -08:00
Patrick Walton df7f1374d7 librustc: De-@mut item_symbols 2013-12-26 13:01:23 -08:00
Patrick Walton 610096d8c8 librustc: De-@mut CrateContext::item_vals 2013-12-26 13:01:23 -08:00
Patrick Walton d3f58c59e4 librustc: De-@mut the monomorphizing field in CrateContext 2013-12-26 13:01:23 -08:00
Patrick Walton b5218ba6ad librustc: De-@mut monomorphized in the crate context 2013-12-26 13:01:23 -08:00
Patrick Walton 6a0450c67d librustc: De-@mut the tc_cache 2013-12-26 13:01:23 -08:00
Patrick Walton ba2e6c1e95 librustc: De-@mut the needs_unwind_cleanup_cache 2013-12-26 13:01:23 -08:00
Patrick Walton 2e46ac6449 librustc: De-@mut the short names cache 2013-12-26 13:01:22 -08:00
Patrick Walton 2612d76d22 librustc: De-@mut intrinsic_defs 2013-12-26 13:01:22 -08:00
Patrick Walton 2ead970b21 librustc: De-@mut trait_defs 2013-12-26 13:01:22 -08:00
Patrick Walton 3f444dca5b librustc: De-@mut trait_refs 2013-12-26 13:01:22 -08:00
Patrick Walton efdbd60a87 librustc: De-@mut the impl_trait_cache 2013-12-26 13:01:22 -08:00
Patrick Walton 02f13adaa3 librustc: De-@mut the trait_methods_cache 2013-12-26 13:01:22 -08:00
Patrick Walton 214d6bc34a librustc: De-@mut the trait_method_def_ids table. 2013-12-26 13:01:22 -08:00
Patrick Walton f15f9388dc librustc: De-@mut the type context's methods table 2013-12-26 13:01:22 -08:00
Patrick Walton 386300d4b0 librustc: De-@mut the node_type_substs table 2013-12-26 13:01:22 -08:00
Patrick Walton fffbe7a8cd librustc: De-@mut the type interner 2013-12-26 13:01:22 -08:00
Patrick Walton 09589aae4f librustc: De-@mut FnCtxt. 2013-12-26 13:01:21 -08:00
Patrick Walton c9432327c4 librustc: Change @mut Block to @Block. 2013-12-26 13:01:21 -08:00
Alex Crichton ab431a20c0 Register new snapshots 2013-12-26 11:30:23 -08:00
bors 1f34f50ce6 auto merge of #11127 : huonw/rust/vec-docs, r=alexcrichton 2013-12-26 04:31:50 -08:00
bors 9477c49a7b auto merge of #10965 : alexcrichton/rust/libgreen, r=brson
This pull request extracts all scheduling functionality from libstd, moving it into its own separate crates. The new libnative and libgreen will be the new way in which 1:1 and M:N scheduling is implemented. The standard library still requires an interface to the runtime, however, (think of things like `std::comm` and `io::println`). The interface is now defined by the `Runtime` trait inside of `std::rt`.

The booting process is now that libgreen defines the start lang-item and that's it. I want to extend this soon to have libnative also have a "start lang item" but also allow libgreen and libnative to be linked together in the same process. For now though, only libgreen can be used to start a program (unless you define the start lang item yourself). Again though, I want to change this soon, I just figured that this pull request is large enough as-is.

This certainly wasn't a smooth transition, certain functionality has no equivalent in this new separation, and some functionality is now better enabled through this new system. I did my best to separate all of the commits by topic and keep things fairly bite-sized, although are indeed larger than others.

As a note, this is currently rebased on top of my `std::comm` rewrite (or at least an old copy of it), but none of those commits need reviewing (that will all happen in another pull request).
2013-12-26 01:01:54 -08:00
Alex Crichton 6cad8f4f14 Test fixes and rebase conflicts
* vec::raw::to_ptr is gone
* Pausible => Pausable
* Removing @
* Calling the main task "<main>"
* Removing unused imports
* Removing unused mut
* Bringing some libextra tests up to date
* Allowing compiletest to work at stage0
* Fixing the bootstrap-from-c rmake tests
* assert => rtassert in a few cases
* printing to stderr instead of stdout in fail!()
2013-12-25 23:10:46 -08:00
Steven Fackler c7cf5dc270 Method-ify CStore 2013-12-25 21:50:36 -07:00
Steven Fackler 4d5243dd08 Remove out of date test
The associated issue has been closed for 2 years!
2013-12-25 10:58:03 -07:00
Brian Anderson f82246f56d Remove rust_globals.h 2013-12-24 20:09:49 -08:00
Alex Crichton b47ff23673 green: Move a scheduler test inside libgreen
This test also had a race condition in using the cvar/lock, so I fixed that up
as well. The race originated from one half trying to destroy the lock when
another half was using it.
2013-12-24 19:59:55 -08:00
Alex Crichton 7f48345904 std: Remove must deferred sending functions
These functions are all unnecessary now, and they only have meaning in the M:N
context. Removing these functions uncovered a bug in the librustuv timer
bindings, but it was fairly easy to cover (and the test is already committed).

These cannot be completely removed just yet due to their usage in the WaitQueue
of extra::sync, and until the mutex in libextra is rewritten it will not be
possible to remove the deferred sends for channels.
2013-12-24 19:59:54 -08:00
Alex Crichton 1c4af5e3d9 rustuv: Remove the id() function from IoFactory
The only user of this was the homing code in librustuv, and it just manually
does the cast from a pointer to a uint now.
2013-12-24 19:59:54 -08:00
Alex Crichton 3dc38b0c51 std: Stop reexporting the contents of 'mod consts'
This prevents usage of the win32 utf-16 helper functions from outside of libstd.

Closes #9053
2013-12-24 19:59:54 -08:00
Alex Crichton 9f005866e5 rustuv: Fix a memory leak (documented inside)
This happened because the environment of a procedure was never deallocated.
2013-12-24 19:59:54 -08:00
Alex Crichton f25c81a51a rustuv: Fix a use-after-free on destruction
The uv loop was being destroyed before the async handle was being destroyed, so
closing the async handle was causing a use-after-free in the uv loop. This was
fixed by moving destruction of the queue's async handle to an earlier location
and then actually freeing it once the loop has been dropped.
2013-12-24 19:59:54 -08:00
Alex Crichton 962af9198f native: Protect against spurious wakeups on cvars
This is a very real problem with cvars on normal systems, and all of channels
will not work if spurious wakeups are accepted. This problem is just solved with
a synchronized flag (accessed in the cvar's lock) to see whether a signal()
actually happened or whether it's spurious.
2013-12-24 19:59:54 -08:00
Alex Crichton e121d7556c rustuv: Fix a use-after-free bug
The queue has an async handle which must be destroyed before the loop is
destroyed, so use a little bit of an option dance to get around this
requirement.
2013-12-24 19:59:54 -08:00
Alex Crichton 51c03c1f35 green: Properly wait for main before shutdown
There was a race in the code previously where schedulers would *immediately*
shut down after spawning the main task (because the global task count would
still be 0). This fixes the logic by blocking the sched pool task in receving on
a port instead of spawning a task into the pool to receive on a port.

The modifications necessary were to have a "simple task" running by the time the
code is executing, but this is a simple enough thing to implement and I forsee
this being necessary to have implemented in the future anyway.
2013-12-24 19:59:54 -08:00
Alex Crichton 282f3d99a5 Test fixes and rebase problems
Note that this removes a number of run-pass tests which are exercising behavior
of the old runtime. This functionality no longer exists and is thoroughly tested
inside of libgreen and libnative. There isn't really the notion of "starting the
runtime" any more. The major notion now is "bootstrapping the initial task".
2013-12-24 19:59:53 -08:00
Alex Crichton 39dbcd7b01 rustc: Temporarily inject libgreen with librustuv
This measure is simply to allow programs to continue compiling as they once did.
In the future, this needs a more robust solution to choose how to start with
libgreen or libnative.
2013-12-24 19:59:53 -08:00
Alex Crichton aad9fbf6b6 green: Fixing all tests from previous refactorings 2013-12-24 19:59:53 -08:00