]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agorustup to rustc 1.14.0-nightly (7c69b0d5a 2016-11-01)
Oliver Schneider [Thu, 3 Nov 2016 09:38:08 +0000 (10:38 +0100)]
rustup to rustc 1.14.0-nightly (7c69b0d5a 2016-11-01)

7 years agoMerge pull request #72 from bluss/rustup
Scott Olson [Tue, 1 Nov 2016 22:59:24 +0000 (15:59 -0700)]
Merge pull request #72 from bluss/rustup

rustup to rustc 1.14.0-nightly (3f4408347 2016-10-27)

7 years agorustup to rustc 1.14.0-nightly (3f4408347 2016-10-27)
bluss [Tue, 1 Nov 2016 22:26:04 +0000 (23:26 +0100)]
rustup to rustc 1.14.0-nightly (3f4408347 2016-10-27)

7 years agoMerge pull request #70 from plietar/patch-1
Scott Olson [Tue, 1 Nov 2016 00:02:06 +0000 (17:02 -0700)]
Merge pull request #70 from plietar/patch-1

README.md: Fix logging environment variable name

7 years agoREADME.md: Fix logging environment variable name
Paul Lietar [Mon, 31 Oct 2016 16:37:54 +0000 (16:37 +0000)]
README.md: Fix logging environment variable name

7 years agoMerge pull request #69 from oli-obk/master
Scott Olson [Fri, 21 Oct 2016 17:06:19 +0000 (11:06 -0600)]
Merge pull request #69 from oli-obk/master

don't force allocations for most casts

7 years agodon't force allocate for most Unsize casts
Oliver Schneider [Fri, 21 Oct 2016 13:18:12 +0000 (15:18 +0200)]
don't force allocate for most Unsize casts

only Arc<T> -> Arc<Trait> unsize casts are left

7 years agodon't force allocate for UnsafeFnPointer casts
Oliver Schneider [Fri, 21 Oct 2016 12:55:49 +0000 (14:55 +0200)]
don't force allocate for UnsafeFnPointer casts

7 years agodon't force allocate for ReifyFnPointer casts
Oliver Schneider [Fri, 21 Oct 2016 12:54:37 +0000 (14:54 +0200)]
don't force allocate for ReifyFnPointer casts

7 years agodon't force allocate for Misc casts
Oliver Schneider [Fri, 21 Oct 2016 11:56:38 +0000 (13:56 +0200)]
don't force allocate for Misc casts

7 years agoMerge pull request #68 from oli-obk/master
Scott Olson [Fri, 21 Oct 2016 10:08:20 +0000 (04:08 -0600)]
Merge pull request #68 from oli-obk/master

priroda requirements + static impl

7 years agoadjust some comments referencing locals
Oliver Schneider [Fri, 21 Oct 2016 10:03:34 +0000 (12:03 +0200)]
adjust some comments referencing locals

7 years agoremove GlobalKind
Oliver Schneider [Fri, 21 Oct 2016 09:54:38 +0000 (11:54 +0200)]
remove GlobalKind

7 years agopreemptively change some assertions into errors
Oliver Schneider [Fri, 21 Oct 2016 09:51:24 +0000 (11:51 +0200)]
preemptively change some assertions into errors

7 years agorename more [Ss]tatic* to [Gg]lobal*
Oliver Schneider [Fri, 21 Oct 2016 09:48:56 +0000 (11:48 +0200)]
rename more [Ss]tatic* to [Gg]lobal*

7 years agorename statics/Constant/ConstantId/ConstantKind to [gG]lobal*
Oliver Schneider [Fri, 21 Oct 2016 09:39:39 +0000 (11:39 +0200)]
rename statics/Constant/ConstantId/ConstantKind to [gG]lobal*

7 years agochoose better function and argument names
Oliver Schneider [Fri, 21 Oct 2016 09:24:10 +0000 (11:24 +0200)]
choose better function and argument names

7 years agoconstant ids are `Copy` now
Oliver Schneider [Fri, 21 Oct 2016 09:21:52 +0000 (11:21 +0200)]
constant ids are `Copy` now

7 years agoSimplify PrimValKind and remove a horrible hack.
Scott Olson [Fri, 21 Oct 2016 09:17:53 +0000 (03:17 -0600)]
Simplify PrimValKind and remove a horrible hack.

This takes the `AllocId` out of PrimValKind, replacing it with a
`relocation` field on `PrimVal`, which is closer to an earlier design
for `PrimVal` I discussed with @eddyb.

This commit prepares the code for removing the `PrimValKind` from
`PrimVal` and making them more pure bitbags. The only code dealing with
`PrimValKind` will be code making decisions like "what kind of operation
do I need to do on these bits", like operators and casting. Transmutes
of `PrimVal`s will become true no-ops, not even adjusting a `kind`
field.

This commit also removes my horrible `value_to_primval` hack that made
an allocation for every `ByVal` passed in, so it could use `read_value`
to get a `PrimVal` with the right kind. Now I just compute the
`PrimValKind` from the `Ty` and re-tag the `PrimVal`.

The code got slightly messier in some areas here, but I think a _lot_ of
code will simplify in obvious ways once I remove the `kind` field from
`PrimVal`.

Gosh, if my commit messages aren't turning into essays these days.

7 years agomore priroda requirements
Oliver Schneider [Fri, 21 Oct 2016 08:45:01 +0000 (10:45 +0200)]
more priroda requirements

7 years agoyield a miri error instead of panicking on uninitialized statics
Oliver Schneider [Fri, 21 Oct 2016 08:44:48 +0000 (10:44 +0200)]
yield a miri error instead of panicking on uninitialized statics

7 years agodon't allocate statics unless a reference to them is created
Oliver Schneider [Fri, 21 Oct 2016 08:32:27 +0000 (10:32 +0200)]
don't allocate statics unless a reference to them is created

7 years agosplit eval_and_read_lvalue into two functions
Oliver Schneider [Fri, 21 Oct 2016 08:31:13 +0000 (10:31 +0200)]
split eval_and_read_lvalue into two functions

7 years agoadd a 'tcx lifetime to Lvalue in preparation for statics
Oliver Schneider [Fri, 21 Oct 2016 08:29:56 +0000 (10:29 +0200)]
add a 'tcx lifetime to Lvalue in preparation for statics

7 years agomake some pieces public that are required by priroda
Oliver Schneider [Thu, 20 Oct 2016 11:10:22 +0000 (13:10 +0200)]
make some pieces public that are required by priroda

7 years agoRepresent PrimVals as "bitbags".
Scott Olson [Thu, 20 Oct 2016 10:42:19 +0000 (04:42 -0600)]
Represent PrimVals as "bitbags".

Now instead of holding a native type based on the tag, all PrimVals
store a u64 (the `bits`), along with a `kind` corresponding to the
variant as it would be in the old PrimVal representation.

This commit makes no major optimizations and attempts to not change any
behaviour. There will be commits to follow that make use of this
representation to eliminate unnecessary allocation hacks like in
`value_to_primval`.

A number of places could be even more cleaned up after this commit,
particularly in `cast.rs`.

7 years agoExpand on "uninit" FIXME.
Scott Olson [Thu, 20 Oct 2016 02:27:35 +0000 (20:27 -0600)]
Expand on "uninit" FIXME.

7 years agoFix local dump check.
Scott Olson [Wed, 19 Oct 2016 05:24:30 +0000 (23:24 -0600)]
Fix local dump check.

7 years agoClean up read_value.
Scott Olson [Wed, 19 Oct 2016 04:31:21 +0000 (22:31 -0600)]
Clean up read_value.

7 years agoDump local values on Lvalue creation.
Scott Olson [Wed, 19 Oct 2016 03:51:36 +0000 (21:51 -0600)]
Dump local values on Lvalue creation.

7 years agoDump local values when they are read.
Scott Olson [Wed, 19 Oct 2016 03:45:48 +0000 (21:45 -0600)]
Dump local values when they are read.

7 years agoAdd test for 39bb1254d.
Scott Olson [Wed, 19 Oct 2016 03:45:11 +0000 (21:45 -0600)]
Add test for 39bb1254d.

7 years agoFix write_value of ByVal into a ByRef.
Scott Olson [Wed, 19 Oct 2016 03:02:37 +0000 (21:02 -0600)]
Fix write_value of ByVal into a ByRef.

Previously, you could perform the following, if you assume we could make
`Cell<i32>` into a primitive. (Alternately, you could achieve this with
unsafe code):

    x = Cell::new(12);
    y = &x;

    // Miri locals array:
    //   x = ByRef(alloc123);
    //   y = ByVal(Ptr(alloc123));
    //
    // Miri allocations:
    //   alloc123: [12, 0, 0, 0]

    x.set(42);

    // Miri locals array:
    //   x = ByVal(I32(42));
    //   y = ByVal(Ptr(alloc123));
    //
    // Miri allocations:
    //   alloc123: [12, 0, 0, 0]

Notice how `y` still refers to the allocation that used to represent
`x`. But now `x` was changed to `42` and `y` is still looking at memory
containing `12`.

Now, instead, we keep `x` as a `ByRef` and write the `42` constant into
it.

Unit test to follow in the next commit.

7 years agoMake locals debug printing configurable.
Scott Olson [Mon, 17 Oct 2016 03:08:45 +0000 (21:08 -0600)]
Make locals debug printing configurable.

7 years agoOptimize reads of field projections of ByValPairs.
Scott Olson [Mon, 17 Oct 2016 01:58:22 +0000 (19:58 -0600)]
Optimize reads of field projections of ByValPairs.

This helps in the case of field projections of the results of checked
binary operations. E.g.:

    _1 = CheckedAdd(const 1i32, const 2i32);
    assert(!(_1.1: bool), "attempt to add with overflow" -> bb1

Previously, the `_1.1` field projection lvalue would force_allocate `_1`
so it could read the memory in the old-style way. Now checked math with
its assertions will not allocate at all.

The oom2.rs compile-fail test had to be re-written, because the old
version of it no longer allocates _at all_ (yay!), so it would hit the
stack depth limit instead, from recursion.

7 years agoMake locals debug printing smarter.
Scott Olson [Sun, 16 Oct 2016 23:18:56 +0000 (17:18 -0600)]
Make locals debug printing smarter.

7 years agoDo not force_allocate checked binop destination.
Scott Olson [Sun, 16 Oct 2016 23:18:06 +0000 (17:18 -0600)]
Do not force_allocate checked binop destination.

7 years agoRefactor writing ByValPair to pointers.
Scott Olson [Sun, 16 Oct 2016 21:31:02 +0000 (15:31 -0600)]
Refactor writing ByValPair to pointers.

7 years agoDeallocate primval conversion hack allocs.
Scott Olson [Sun, 16 Oct 2016 09:21:41 +0000 (03:21 -0600)]
Deallocate primval conversion hack allocs.

It's a hack, sure, but it should learn some manners.

7 years agoDo not force_allocate Deref base.
Scott Olson [Sun, 16 Oct 2016 08:57:59 +0000 (02:57 -0600)]
Do not force_allocate Deref base.

This makes `eval_lvalue` a bit less DRY for now, but it will be easier
to remove force_allocate in more places piecewise.

7 years agoDo not force_allocate Ref destination.
Scott Olson [Sun, 16 Oct 2016 08:12:46 +0000 (02:12 -0600)]
Do not force_allocate Ref destination.

7 years agoPass thin self ptr to virtual calls.
Scott Olson [Sun, 16 Oct 2016 08:12:26 +0000 (02:12 -0600)]
Pass thin self ptr to virtual calls.

7 years agoDo not force_allocate CEnum destination.
Scott Olson [Sun, 16 Oct 2016 06:41:25 +0000 (00:41 -0600)]
Do not force_allocate CEnum destination.

7 years agoDo not force_allocate Box destination.
Scott Olson [Sun, 16 Oct 2016 06:12:27 +0000 (00:12 -0600)]
Do not force_allocate Box destination.

7 years agoRefactor alloc_ptr.
Scott Olson [Sun, 16 Oct 2016 06:12:11 +0000 (00:12 -0600)]
Refactor alloc_ptr.

7 years agoDo not force_allocate SwitchInt discrs.
Scott Olson [Sun, 16 Oct 2016 05:59:01 +0000 (23:59 -0600)]
Do not force_allocate SwitchInt discrs.

7 years agoDo not pre-allocate local variables.
Scott Olson [Sun, 16 Oct 2016 05:31:42 +0000 (23:31 -0600)]
Do not pre-allocate local variables.

Thanks to the `Value` locals refactoring, now primitive locals (ints,
floats, chars, bools, and the like) will not require `Allocation`s at
all, and locals that are never initialized at all because of conditional
control flow won't be wasting memory.

7 years agoHold an Lvalue for the return pointer in a frame.
Scott Olson [Sun, 16 Oct 2016 01:48:30 +0000 (19:48 -0600)]
Hold an Lvalue for the return pointer in a frame.

Previously ReturnPointer was just the first slot in the locals array,
which had type `Vec<Pointer>`. But after my recent refactoring, locals
is `Vec<Value>` and it became increasingly hacky to pull a pointer out
of the first slot to be the value. Besides, that hack wouldn't allow
ReturnPointer to ever be an `Lvalue::Local`, referring directly to a
local on a higher stack frame.

Now ReturnPointer has no presence in the locals array, instead being
upgraded to its own field on `Frame`.

This introduces a couple of new hacks, detailed by some of my FIXME
comments, so that I could get the tests passing again and commit. More
commits coming soon should clean up these hacks without much trouble,
and overall I feel that the code is converging on a cleaner, more
efficient design.

7 years agoUpdate for changes in rustc.
Scott Olson [Sat, 15 Oct 2016 04:59:50 +0000 (22:59 -0600)]
Update for changes in rustc.

7 years agoAdd support for local `Value`s in `Lvalue`.
Scott Olson [Sat, 15 Oct 2016 04:10:06 +0000 (22:10 -0600)]
Add support for local `Value`s in `Lvalue`.

The new `Lvalue` has an additional form, `Lvalue::Local`, with the old
form being `Lvalue::Ptr`. In an upcoming commit, we will start producing
the new form for locals, and enable reading and writing of primitive
locals without ever touching `Memory`.

Statics should be able to get a similar treatment, where primitive
statics can be stored and accessed without touching `Memory`.

7 years agoFix some long lines.
Scott Olson [Fri, 14 Oct 2016 09:52:23 +0000 (03:52 -0600)]
Fix some long lines.

7 years agoImplement atomic_{load,store}.
Scott Olson [Fri, 14 Oct 2016 09:49:02 +0000 (03:49 -0600)]
Implement atomic_{load,store}.

7 years agoRefactor in preparation for `Value` locals.
Scott Olson [Fri, 14 Oct 2016 09:31:45 +0000 (03:31 -0600)]
Refactor in preparation for `Value` locals.

Turning locals into `Vec<Value>` will allow writing `PrimVal` results
directly into the locals array without creating `memory::Allocation`s
for every local.

This will entail passing around a generalized kind of `Lvalue` instead
of `Pointer`s for the destinations of operations. Replacing `Pointer`
with `Lvalue` is mostly done with this commit, but expanding `Lvalue`
will come later.

This commit turns every local from `Pointer` into `Value::ByRef(ptr)`.
Locals which are `Value::ByVal(prim_val)` will come in a later commit.

7 years ago`cargo update` to fix compiletest build.
Scott Olson [Sun, 9 Oct 2016 23:50:01 +0000 (17:50 -0600)]
`cargo update` to fix compiletest build.

7 years agoUpdate for changes in rustc.
Scott Olson [Tue, 4 Oct 2016 02:45:50 +0000 (20:45 -0600)]
Update for changes in rustc.

7 years agoMerge pull request #67 from oli-obk/master
Scott Olson [Mon, 3 Oct 2016 23:40:02 +0000 (17:40 -0600)]
Merge pull request #67 from oli-obk/master

fix multi field enum variants and some intrinsics + rustup

7 years agorustup
Oliver Schneider [Sat, 1 Oct 2016 13:33:07 +0000 (15:33 +0200)]
rustup

7 years agobump compiletest
Oliver Schneider [Sat, 1 Oct 2016 13:30:29 +0000 (15:30 +0200)]
bump compiletest

7 years agofix enum variants with multiple fields
Oliver Schneider [Fri, 30 Sep 2016 08:45:52 +0000 (10:45 +0200)]
fix enum variants with multiple fields

7 years agoremove some debug output
Oliver Schneider [Fri, 30 Sep 2016 08:45:13 +0000 (10:45 +0200)]
remove some debug output

7 years agofactor out shared code
Oliver Schneider [Thu, 29 Sep 2016 14:42:01 +0000 (16:42 +0200)]
factor out shared code

7 years agofix intrinsics and implement more of them
Oliver Schneider [Thu, 29 Sep 2016 13:58:26 +0000 (15:58 +0200)]
fix intrinsics and implement more of them

7 years agoMerge pull request #65 from oli-obk/master
Scott Olson [Wed, 28 Sep 2016 17:53:40 +0000 (11:53 -0600)]
Merge pull request #65 from oli-obk/master

small fixes

7 years agoReword inline assembly error.
Scott Olson [Wed, 28 Sep 2016 17:48:43 +0000 (11:48 -0600)]
Reword inline assembly error.

7 years agoallow tuple field indexing into anonymous tuples
Oliver Schneider [Wed, 28 Sep 2016 16:22:53 +0000 (18:22 +0200)]
allow tuple field indexing into anonymous tuples

7 years agodon't panic on asm!
Oliver Schneider [Wed, 28 Sep 2016 16:22:25 +0000 (18:22 +0200)]
don't panic on asm!

7 years agoimplement slice patterns
Oliver Schneider [Wed, 28 Sep 2016 16:22:09 +0000 (18:22 +0200)]
implement slice patterns

7 years agofix run-pass test error message parsing
Oliver Schneider [Wed, 28 Sep 2016 12:53:43 +0000 (14:53 +0200)]
fix run-pass test error message parsing

7 years agorun compile-fail tests after run-pass tests
Oliver Schneider [Wed, 28 Sep 2016 12:53:11 +0000 (14:53 +0200)]
run compile-fail tests after run-pass tests

it's annoying when debugging miri to have compile-fail tests fail due to some temporary
assertions or panics.

7 years agoMerge pull request #64 from oli-obk/bugfixes
Scott Olson [Tue, 27 Sep 2016 19:11:38 +0000 (13:11 -0600)]
Merge pull request #64 from oli-obk/bugfixes

Bugfixes

7 years agowe can get the Session from the TyCtxt
Oliver Schneider [Tue, 27 Sep 2016 16:06:51 +0000 (18:06 +0200)]
we can get the Session from the TyCtxt

7 years agoimplement Arc<T> -> Arc<Trait> unsizing
Oliver Schneider [Tue, 27 Sep 2016 16:01:33 +0000 (18:01 +0200)]
implement Arc<T> -> Arc<Trait> unsizing

7 years agodon't abort on the first failed test
Oliver Schneider [Tue, 27 Sep 2016 15:02:24 +0000 (17:02 +0200)]
don't abort on the first failed test

7 years agobe able to find statics in other crates
Oliver Schneider [Tue, 27 Sep 2016 15:02:04 +0000 (17:02 +0200)]
be able to find statics in other crates

7 years agoprint stacktrace when miri can't find the MIR for something
Oliver Schneider [Tue, 27 Sep 2016 15:01:06 +0000 (17:01 +0200)]
print stacktrace when miri can't find the MIR for something

7 years agorustup
Oliver Schneider [Tue, 27 Sep 2016 14:59:48 +0000 (16:59 +0200)]
rustup

7 years agofix matching on chars
Oliver Schneider [Tue, 27 Sep 2016 09:10:25 +0000 (11:10 +0200)]
fix matching on chars

fixes #63

7 years agoMerge pull request #60 from oli-obk/dst
Scott Olson [Tue, 27 Sep 2016 08:46:57 +0000 (02:46 -0600)]
Merge pull request #60 from oli-obk/dst

some more cleanups getting rid of intermediate allocations and bad fat ptr assumptions

7 years agofix warnings
Oliver Schneider [Tue, 27 Sep 2016 08:39:14 +0000 (10:39 +0200)]
fix warnings

7 years agoremove FIXME cleared up in the PR
Oliver Schneider [Tue, 27 Sep 2016 08:36:44 +0000 (10:36 +0200)]
remove FIXME cleared up in the PR

7 years agotypecheck `write_value` for `ByValPair`
Oliver Schneider [Tue, 27 Sep 2016 08:33:47 +0000 (10:33 +0200)]
typecheck `write_value` for `ByValPair`

7 years agoreintroduce Lvalue and LvalueExtra
Oliver Schneider [Tue, 27 Sep 2016 08:14:53 +0000 (10:14 +0200)]
reintroduce Lvalue and LvalueExtra

7 years agoactually error on failing miri-pass tests
Oliver Schneider [Mon, 26 Sep 2016 15:49:53 +0000 (17:49 +0200)]
actually error on failing miri-pass tests

+ remove a test that never succeeded

7 years agorefactor `Lvalue` and `PrimVal::{SlicePtr, VtablePtr}` into `Value::ByValPair`
Oliver Schneider [Mon, 26 Sep 2016 15:49:30 +0000 (17:49 +0200)]
refactor `Lvalue` and `PrimVal::{SlicePtr, VtablePtr}` into `Value::ByValPair`

7 years agoremove `move_value`, which is a dupe of `write_value`
Oliver Schneider [Mon, 26 Sep 2016 09:40:09 +0000 (11:40 +0200)]
remove `move_value`, which is a dupe of `write_value`

7 years agocheck `Pointer::to_int` for non-integer pointers
Oliver Schneider [Mon, 26 Sep 2016 09:37:23 +0000 (11:37 +0200)]
check `Pointer::to_int` for non-integer pointers

7 years agoMerge remote-tracking branch 'origin/master' into dst
Oliver Schneider [Mon, 26 Sep 2016 09:27:59 +0000 (11:27 +0200)]
Merge remote-tracking branch 'origin/master' into dst

7 years agoMerge pull request #59 from oli-obk/master
Scott Olson [Sat, 24 Sep 2016 00:07:02 +0000 (18:07 -0600)]
Merge pull request #59 from oli-obk/master

enable A<Struct> -> A<Trait> downcasting where `A<Trait>` is a fat pointer

7 years agorefactor away `get_fat_ptr`
Oliver Schneider [Fri, 23 Sep 2016 13:48:23 +0000 (15:48 +0200)]
refactor away `get_fat_ptr`

7 years agoclean up get_fat_ptr usage in Unsize
Oliver Schneider [Fri, 23 Sep 2016 13:23:01 +0000 (15:23 +0200)]
clean up get_fat_ptr usage in Unsize

7 years agoimplement "type_name" intrinsic
Oliver Schneider [Fri, 23 Sep 2016 08:38:30 +0000 (10:38 +0200)]
implement "type_name" intrinsic

7 years agorefactor away intermediate allocations, stage1
Oliver Schneider [Fri, 23 Sep 2016 08:27:14 +0000 (10:27 +0200)]
refactor away intermediate allocations, stage1

7 years agorefactor away IntegerPtr
Oliver Schneider [Thu, 22 Sep 2016 13:47:16 +0000 (15:47 +0200)]
refactor away IntegerPtr

7 years agoremove the ZST allocation and abort all zero byte writes/reads
Oliver Schneider [Thu, 22 Sep 2016 13:22:00 +0000 (15:22 +0200)]
remove the ZST allocation and abort all zero byte writes/reads

7 years agomake Memory::dump use `trace!` instead of `println!`
Oliver Schneider [Thu, 22 Sep 2016 11:01:08 +0000 (13:01 +0200)]
make Memory::dump use `trace!` instead of `println!`

7 years agofully implement `size_of_val` and add various tests that now succeed
Oliver Schneider [Thu, 22 Sep 2016 11:00:43 +0000 (13:00 +0200)]
fully implement `size_of_val` and add various tests that now succeed

7 years agoMerge branch 'master' of https://github.com/tsion/miri
Oliver Schneider [Thu, 22 Sep 2016 07:50:15 +0000 (09:50 +0200)]
Merge branch 'master' of https://github.com/tsion/miri

7 years agoRename AbstractPtr to Ptr.
Scott Olson [Thu, 22 Sep 2016 05:23:50 +0000 (23:23 -0600)]
Rename AbstractPtr to Ptr.

7 years agoUpdate for changes in rustc.
Scott Olson [Thu, 22 Sep 2016 05:16:31 +0000 (23:16 -0600)]
Update for changes in rustc.

7 years agoRemove more eval_operand_to_ptr.
Scott Olson [Tue, 20 Sep 2016 01:40:56 +0000 (19:40 -0600)]
Remove more eval_operand_to_ptr.