Jakob Stoklund Olesen
03939e4f9f
Move TranslationState into its own module.
...
Add some convenience methods for common state access patterns.
2017-09-01 15:55:02 -07:00
Jakob Stoklund Olesen
6762194801
Move stack and control_stack into TranslationState.
...
This reduces the number of function arguments passed around and it keeps
related information together.
2017-09-01 14:29:35 -07:00
Dan Gohman
0c2ab06e66
Make EntitySet::contains return false for out-of-bounds indices.
...
This is consistent with EntityMap.
2017-09-01 14:04:38 -07:00
Dan Gohman
de92b2b967
Use Vec::resize.
2017-09-01 14:04:38 -07:00
Jakob Stoklund Olesen
52cbbcd069
Add a CtonError::InvalidInput variant.
...
This error code will be used to complain when a WebAssembly binary code
can't be parsed.
2017-09-01 13:08:07 -07:00
Dan Gohman
8237893113
Eliminate a temporary heap allocation when splitting a critical edge.
2017-09-01 12:50:51 -07:00
Dan Gohman
d4c53935b4
Introduce EntitySet, and use it to replace the HashSet in the frontend.
2017-09-01 12:23:53 -07:00
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