Dan Gohman
fe12fe0e63
Avoid unneeded calls to .as_slice().
2017-09-01 12:15:14 -07:00
Dan Gohman
9d2fbdae62
Avoid cloning a jump argument vector to the heap.
2017-09-01 12:15:14 -07:00
Dan Gohman
28779dc7e4
Avoid allocating jump arguments on the heap.
...
Instead of allocating a vector to store jump arguments for processing
later, just have the later code rescan through the predecessors to
obtain the values, which are memoized.
This also eliminates a linear search through the predecessor list when
splitting a critical edge.
2017-09-01 12:15:14 -07:00
Jakob Stoklund Olesen
9bc4264a33
Update dependency to wasmparser v0.8.2.
...
Soon we'll need the BinaryReader::read_local_decl() method which was
added in that release.
2017-09-01 09:31:39 -07:00
Dan Gohman
7049cc78ae
Refactor out an append helper function for SideEffects.
2017-08-31 17:49:39 -07:00
Dan Gohman
ec3972f515
Avoid allocating a vector for predecessor variables in the single-value case.
2017-08-31 17:42:19 -07:00
Dan Gohman
52335c9e0f
Delete an obsolete TODO comment.
2017-08-31 17:06:14 -07:00
Dan Gohman
566c772e20
Eliminate more unnecessary calls to .iter().
2017-08-31 17:03:12 -07:00
Dan Gohman
de02976162
Minor comment cleanups.
2017-08-31 17:02:26 -07:00
Dan Gohman
1d03244e90
Use debug_assert instead of assert in code where performance is important.
2017-08-31 16:36:18 -07:00
Dan Gohman
583487bfac
Refactor the non-local case of use_var into a separate function.
2017-08-31 16:32:48 -07:00
Dan Gohman
e3227e38ce
Avoid cloning precessor lists to the heap.
2017-08-31 16:09:26 -07:00
Dan Gohman
539a5b3378
Avoid a heap allocation for a block's undef_variables.
2017-08-31 15:42:37 -07:00
Dan Gohman
79f257060f
Inline resolve_undef_vars, and collapse the resulting redundancy.
2017-08-31 14:49:53 -07:00
Dan Gohman
2d9b902d2e
Clean up a redundant cast.
2017-08-31 14:35:19 -07:00
Dan Gohman
7be0abb442
Remove an unneeded extern crate.
2017-08-31 14:31:45 -07:00
Dan Gohman
0cacba15b9
Replace as casts with type-conversion functions.
...
https://github.com/rust-lang-nursery/rust-clippy/wiki#cast_lossless
2017-08-31 14:31:23 -07:00
Dan Gohman
af74cdf364
Cretonne's top-level tools don't need to directly depend on wasmparser.
2017-08-31 13:40:35 -07:00
Dan Gohman
dc79d155ff
Comment wording cleanups.
2017-08-31 12:47:05 -07:00
Dan Gohman
bc528917fd
Avoid redundant '@ _' in match patterns.
...
https://github.com/rust-lang-nursery/rust-clippy/wiki#redundant_pattern
2017-08-31 12:47:05 -07:00
Dan Gohman
ebbb836bb9
Use debug_assert_eq rather than debug_assert with an ==.
2017-08-31 12:47:05 -07:00
Dan Gohman
3c5755cfbd
Avoid unneeded return keywords.
2017-08-31 12:47:05 -07:00
Dan Gohman
a7d629c368
Use the Self keyword where applicable.
...
https://github.com/rust-lang-nursery/rust-clippy/wiki#use_self
2017-08-31 12:47:05 -07:00
Dan Gohman
99b361567a
Remove unneeded mut keywords.
2017-08-31 12:47:05 -07:00
Dan Gohman
55ae51acfe
Add an underscore between a literal value and its suffix.
...
https://github.com/rust-lang-nursery/rust-clippy/wiki#unseparated_literal_suffix
2017-08-31 12:47:05 -07:00
Dan Gohman
da2c2151b1
Fix trivial_numeric_casts errors.
2017-08-31 12:47:05 -07:00
Dan Gohman
9726bb7367
Avoid matching with reference patterns.
...
https://github.com/rust-lang-nursery/rust-clippy/wiki#match_ref_pats
2017-08-31 12:47:05 -07:00
Dan Gohman
5a8d1a9fda
Use if let instead of match.
...
https://github.com/rust-lang-nursery/rust-clippy/wiki#single_match
2017-08-31 12:47:05 -07:00
Dan Gohman
574031e4d2
Avoid unneeded passing by value.
...
https://github.com/rust-lang-nursery/rust-clippy/wiki#needless_pass_by_value
2017-08-31 12:47:05 -07:00
Dan Gohman
b6641ff443
Avoid clone() on a Copy type.
...
https://github.com/rust-lang-nursery/rust-clippy/wiki#clone_on_copy
2017-08-31 12:47:05 -07:00
Dan Gohman
105998944e
Avoid redundant borrows.
...
https://github.com/rust-lang-nursery/rust-clippy/wiki#needless_borrow
2017-08-31 12:47:05 -07:00
Dan Gohman
9a8f01b832
Avoid unnecessary '&' in matches.
...
https://github.com/rust-lang-nursery/rust-clippy/wiki#match_ref_pats
2017-08-31 12:47:05 -07:00
Dan Gohman
acf4f1009b
Eliminate redundant uses of format!.
...
https://github.com/rust-lang-nursery/rust-clippy/wiki#useless_format
2017-08-31 12:47:05 -07:00
Dan Gohman
abbc6ddf24
Use is_empty() instead of comparing len() with 0.
...
https://github.com/rust-lang-nursery/rust-clippy/wiki#len_zero
2017-08-31 12:47:05 -07:00
Dan Gohman
adfdd77311
Avoid creating a reference to a reference.
...
https://github.com/rust-lang-nursery/rust-clippy/wiki#needless_borrow
2017-08-31 12:47:05 -07:00
Dan Gohman
b411d01d6d
Use [] instead of .get().unwrap().
...
https://github.com/rust-lang-nursery/rust-clippy/wiki#get_unwrap
2017-08-31 12:47:05 -07:00
Dan Gohman
2efdc0ed37
Update rustfmt to 0.9.0.
2017-08-31 10:44:59 -07:00
Dan Gohman
46fb64cbb4
Add SideEffects::new().
2017-08-31 10:28:56 -07:00
Dan Gohman
52186b8390
Refactor code for obtaining the header block.
2017-08-31 10:28:56 -07:00
Dan Gohman
fc374b6c06
Test that stack layout with an unsupported offset is rejected cleanly.
2017-08-31 08:54:50 -07:00
Dan Gohman
bd0590604d
Test dfg's next_inst().
2017-08-31 08:54:50 -07:00
Dan Gohman
4c3ac6053f
Test the error case of condcode parsing.
2017-08-31 08:54:50 -07:00
Dan Gohman
6702221e94
Change EbbHeaderBlockData's predecessors list from a HashMap to a Vec. ( #148 )
...
In addition to efficiency, this change also eliminates some nondeterminsm
resulting from HashMap key ordering.
2017-08-31 08:54:34 -07:00
Dan Gohman
a0a3401ef1
Don't special-case br_table with an empty table.
...
Empty br_table tables are very uncommon (they're easy for wasm producers to
optimize away), so we don't need to special-case them.
2017-08-30 15:05:00 -07:00
Dan Gohman
4ccd21ba94
Simplify iteration.
2017-08-30 15:04:53 -07:00
Dan Gohman
110697cfdd
Replace match blocks with .expect calls.
2017-08-30 14:53:49 -07:00
Dan Gohman
5e99a4fb6a
Simplify a pattern-match.
2017-08-30 14:53:39 -07:00
Dan Gohman
0cc8bd06cd
Remove unnecessary () values.
2017-08-30 14:53:34 -07:00
Dan Gohman
8647b10135
Loop over references to containers instead of using explicit iteration methods.
...
https://github.com/rust-lang-nursery/rust-clippy/wiki#explicit_iter_loop
2017-08-30 14:52:17 -07:00
Dan Gohman
03698f6bc8
Use slices rather than Vec borrows.
...
https://github.com/rust-lang-nursery/rust-clippy/wiki#ptr_arg
2017-08-30 14:48:17 -07:00