commit_hash
stringlengths
40
40
author
stringlengths
1
57
date
timestamp[s]date
2010-07-26 04:45:09
2026-04-14 18:21:10
message
stringlengths
8
1.39M
diff
stringlengths
68
51.2k
files_changed
int64
1
136
insertions
int64
0
2.35k
deletions
int64
0
1.9k
c7b1bb5f9e19ae02abf09575c190a736eb865d65
Dan Gohman
2017-09-12T19:51:34
Simplify using `map_err` and `expect`.
diff --git a/cranelift/src/wasm.rs b/cranelift/src/wasm.rs index 4dddddf65..e0b4d1777 100644 --- a/cranelift/src/wasm.rs +++ b/cranelift/src/wasm.rs @@ -67,17 +67,14 @@ pub fn run( for filename in files { let path = Path::new(&filename); let name = String::from(path.as_os_str().to_string_lossy())...
3
40
95
2e046d68ce1c20c31e69d7fd479a48e232e01b7b
Dan Gohman
2017-09-12T19:28:25
Remove obsolete derivations of Hash.
diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs index 00e637789..696dad655 100644 --- a/lib/frontend/src/frontend.rs +++ b/lib/frontend/src/frontend.rs @@ -8,12 +8,11 @@ use cretonne::ir::function::DisplayFunction; use cretonne::isa::TargetIsa; use ssa::{SSABuilder, SideEffects, Block}; use ...
3
19
19
cc35b5e7246672b0768a14d4e004c76026dcf84c
Jakob Stoklund Olesen
2017-09-12T15:59:35
Flush the debug trace file after each dbg!(). When debugging code built with panic=about, the debug trace buffer is not flushed on a panic and important messages are lost. This does slow down debug tracing a bit, but this is still better than unbuffered or line buffered I/O since the dbg!() macro can write out many l...
diff --git a/lib/cretonne/src/dbg.rs b/lib/cretonne/src/dbg.rs index 0ac03f4c4..9bd5500e3 100644 --- a/lib/cretonne/src/dbg.rs +++ b/lib/cretonne/src/dbg.rs @@ -63,7 +63,11 @@ thread_local! { /// /// This is for use by the `dbg!` macro. pub fn writeln_with_format_args(args: fmt::Arguments) -> io::Result<()> { - W...
1
5
1
ddd398b790bff42a22edbc987c086db4b5543ba6
Dan Gohman
2017-09-12T16:00:32
Remove a redundant copy of pretty_verifier_error.
diff --git a/cranelift/src/wasm.rs b/cranelift/src/wasm.rs index 0dda98b52..c915379d7 100644 --- a/cranelift/src/wasm.rs +++ b/cranelift/src/wasm.rs @@ -12,9 +12,6 @@ use cretonne::flowgraph::ControlFlowGraph; use cretonne::dominator_tree::DominatorTree; use cretonne::Context; use cretonne::result::CtonError; -use c...
1
1
24
de27abcb2b7089dcf29e7cec1ecc6e7e5f6d0090
Dan Gohman
2017-09-11T23:37:50
Change translate_module to use FuncTranslator.
diff --git a/lib/wasm/Cargo.toml b/lib/wasm/Cargo.toml index 9cabdc1b9..3de76671d 100644 --- a/lib/wasm/Cargo.toml +++ b/lib/wasm/Cargo.toml @@ -11,6 +11,6 @@ license = "Apache-2.0" name = "cton_wasm" [dependencies] -wasmparser = "0.9.4" +wasmparser = "0.10.0" cretonne = { path = "../cretonne" } cretonne-frontend...
4
50
118
95e2566d6fec83a2b2f463251b1616beb6373bbb
Dan Gohman
2017-09-11T20:58:49
Use TranslationState's popn/peekn functions. (#151) This entailed reorganizing surrounding code to minimize the extent of mutable borrows of the control-flow stack.
diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index 70fbf98c6..8a1b7c4e1 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -224,18 +224,17 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>( // and push a new control frame with a ...
1
39
35
9bce21c17cee54c2d2b711e731f90f343933f151
Dan Gohman
2017-09-11T18:34:39
Update to wasmparser 0.9.4 for a bugfix in create_binary_reader.
diff --git a/lib/wasm/Cargo.toml b/lib/wasm/Cargo.toml index 8cc3b4081..9cabdc1b9 100644 --- a/lib/wasm/Cargo.toml +++ b/lib/wasm/Cargo.toml @@ -11,6 +11,6 @@ license = "Apache-2.0" name = "cton_wasm" [dependencies] -wasmparser = "0.9.3" +wasmparser = "0.9.4" cretonne = { path = "../cretonne" } cretonne-frontend ...
1
1
1
f8f6878b2cf086dcadf6a90198b31316843b19be
Dan Gohman
2017-09-02T11:14:11
Switch to wasmparser's create_binary_reader() API for reading function bodies. A subtle difference here is that the `end` at the end of a function body now gets handled by translate_operator/translate_unreachable_operator, so we no longer have to do as much special-case cleanup at the end of the function body. This i...
diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index ad099dc39..70fbf98c6 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -27,7 +27,7 @@ use cretonne::ir::types::*; use cretonne::ir::immediates::{Ieee32, Ieee64}; use cretonne::ir::condcodes::{IntCC...
1
8
30
7bf2747e1ee7655bb47c08e0a3d02c9deb44f2ee
Dan Gohman
2017-09-11T15:32:02
Replace a match with a `?`.
diff --git a/lib/wasm/src/module_translator.rs b/lib/wasm/src/module_translator.rs index b66e89638..984f5ab78 100644 --- a/lib/wasm/src/module_translator.rs +++ b/lib/wasm/src/module_translator.rs @@ -220,7 +220,7 @@ pub fn translate_module( _ => return Err(String::from("wrong content in code section")), ...
1
3
5
a2542ed71d329f9482f53bc44ec15e6bb5ae2126
Dan Gohman
2017-09-11T15:31:35
Replace a match with a .unwrap_or_default().
diff --git a/lib/wasm/src/module_translator.rs b/lib/wasm/src/module_translator.rs index 113330d4c..b66e89638 100644 --- a/lib/wasm/src/module_translator.rs +++ b/lib/wasm/src/module_translator.rs @@ -192,10 +192,7 @@ pub fn translate_module( } // At this point we've entered the code section // First we ...
1
1
4
47bc963ba5e7cba890d8b2091d14018bd5af943e
Dan Gohman
2017-09-10T23:17:03
Add a JumpTableData::with_capacity and use it. As with Vec::with_capacity, this helps reduce intermediate heap allocation.
diff --git a/lib/cretonne/src/ir/jumptable.rs b/lib/cretonne/src/ir/jumptable.rs index 6d9734145..319eeb1ed 100644 --- a/lib/cretonne/src/ir/jumptable.rs +++ b/lib/cretonne/src/ir/jumptable.rs @@ -31,6 +31,14 @@ impl JumpTableData { } } + /// Create a new empty jump table with the specified capacity....
2
10
2
620f1f49e26d401803cc50353bb292b9ab099848
Dan Gohman
2017-09-07T19:02:45
Move several functions from FunctionBuilder to Function. With FuncEnvironment using FuncCursors in place of full FunctionBuilders, it's useful to move several of these convenience functions from FunctionBuilder to Function.
diff --git a/lib/cretonne/src/ir/function.rs b/lib/cretonne/src/ir/function.rs index 95b645855..0c86ac66e 100644 --- a/lib/cretonne/src/ir/function.rs +++ b/lib/cretonne/src/ir/function.rs @@ -7,6 +7,8 @@ use entity::{PrimaryMap, EntityMap}; use ir; use ir::{FunctionName, CallConv, Signature, DataFlowGraph, Layout}; ...
9
99
52
2fa0a7a3a46301b9d44cb18a0454e35d07a4bb4d
Dan Gohman
2017-09-09T00:12:32
Fix a confusion between EndDataSectionEntry and EndDataSectionEntryBody.
diff --git a/lib/wasm/src/sections_translator.rs b/lib/wasm/src/sections_translator.rs index e2dae0a58..3df3e7e3d 100644 --- a/lib/wasm/src/sections_translator.rs +++ b/lib/wasm/src/sections_translator.rs @@ -295,7 +295,7 @@ pub fn parse_data_section( loop { let data = match *parser.read() { ...
1
5
1
3775fa4867b8238cb7f982bc2576e34739bc9f57
Dan Gohman
2017-09-08T23:16:19
Update to wasmparser 0.9.3. wasmparser's API is changing in anticipation of streaming decoding, so it will now hand large data section initializers back in chunks rather than all at once.
diff --git a/lib/wasm/Cargo.toml b/lib/wasm/Cargo.toml index 15dd4bb34..8cc3b4081 100644 --- a/lib/wasm/Cargo.toml +++ b/lib/wasm/Cargo.toml @@ -11,6 +11,6 @@ license = "Apache-2.0" name = "cton_wasm" [dependencies] -wasmparser = "0.8.2" +wasmparser = "0.9.3" cretonne = { path = "../cretonne" } cretonne-frontend ...
2
10
8
0c16f13c6b8062bf0c00c5d294236741233f0c2d
Jakob Stoklund Olesen
2017-09-08T21:53:55
Add a Function::clear() method. This makes it possible to clear out a Function data structure so it can be reused for compiling multiple functions. Also add clear() methods to various sub-structures.
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index 240c5377c..b81bbe96f 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -74,6 +74,17 @@ impl DataFlowGraph { } } + /// Clear everything. + pub fn clear(&mut self) { + self.insts.clear(); + ...
4
41
0
439a40e5e42c90853dd1615b51de7d9cf5e9cd1b
Jakob Stoklund Olesen
2017-09-01T20:19:31
Add a WebAssembly function translator. The new FuncTranslator type can be used to translate binary WebAssembly functions to Cretonne IL one at a time. It is independent of the module-level parser also present in the cretonne-wasm crate.
diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index 2cb61d323..04a3770ee 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -94,11 +94,7 @@ pub fn translate_function_body( let parser_state = parser.read(); match *parser_state ...
3
327
9
c0f3eaafbc13dd6767f3110d6b5c003003e9b65d
Dan Gohman
2017-09-07T11:42:01
Publically declare GlobalValue. It's used in the publically declared FuncEnvironment trait, so library users should be able to name it.
diff --git a/lib/wasm/src/lib.rs b/lib/wasm/src/lib.rs index e334570cf..0559f7412 100644 --- a/lib/wasm/src/lib.rs +++ b/lib/wasm/src/lib.rs @@ -24,6 +24,6 @@ mod state; mod translation_utils; pub use module_translator::{translate_module, TranslationResult}; -pub use runtime::{FuncEnvironment, WasmRuntime, DummyRun...
1
1
1
388a96421be1ae25f6f3049e4d8665e5a8ba490e
Dan Gohman
2017-09-07T11:40:06
Add documentation comments to GlobalValue's fields.
diff --git a/lib/wasm/src/runtime/spec.rs b/lib/wasm/src/runtime/spec.rs index e7cbb1ec9..9f093e9a0 100644 --- a/lib/wasm/src/runtime/spec.rs +++ b/lib/wasm/src/runtime/spec.rs @@ -12,7 +12,12 @@ pub enum GlobalValue { Const(ir::Value), /// This is a variable in memory that should be referenced as a `Global...
1
6
1
d6f6af104b9b3a470fcc60ed39e91f5431e1c84b
Jakob Stoklund Olesen
2017-09-06T23:24:55
Make translate_operator() generic on FuncEnvironment. This makes it clear that this function only uses the FuncEnvironment trait and not WasmRuntime. Also make the translate_{grow,current}_memory() methods take &self instead of &mut self. The &mut was left on there by accident.
diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index 681eb3b7d..2cb61d323 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -132,11 +132,11 @@ pub fn translate_function_body( /// Translates wasm operators into Cretonne IL instructions. Returns `true...
3
36
36
062dd41c937078d4661875408770672acf12b1ce
Jakob Stoklund Olesen
2017-09-06T22:56:39
Don't export the 'Local' type from cton_wasm. This type is not longer used in any public interface, it has become an internal implementation detail. Also remove some unused exported types from the crate.
diff --git a/lib/wasm/src/lib.rs b/lib/wasm/src/lib.rs index 22fb1c929..e334570cf 100644 --- a/lib/wasm/src/lib.rs +++ b/lib/wasm/src/lib.rs @@ -25,5 +25,5 @@ mod translation_utils; pub use module_translator::{translate_module, TranslationResult}; pub use runtime::{FuncEnvironment, WasmRuntime, DummyRuntime}; -pub ...
2
2
6
b10faca5340b6fa444194ccb7c3d1318f18e5081
Jakob Stoklund Olesen
2017-09-06T22:44:23
Move translate_grow_memory and translate_current_memory too. This moves the last instruction-level callbacks into FuncEnvironment such that the trait has all the information required to translate a whole function. Change the position argument to a FuncCursor. This eliminates all exposure of FunctionBuilder<Local>, so...
diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index 02cd7e1b1..681eb3b7d 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -28,7 +28,7 @@ use cretonne::ir::condcodes::{IntCC, FloatCC}; use cton_frontend::{ILBuilder, FunctionBuilder}; use wasmparser:...
3
72
22
26048c2eccb4a5921f52bd450debff524e1c63d1
Jakob Stoklund Olesen
2017-09-06T22:06:28
Move WasmRuntime::translate_call_indirect() into FuncEnvironment. Add two new arguments: - table_index is the WebAssembly table referenced in the indirect call. - sig_index is the WebAssembly signature index. We still have the SigRef that was created by make_indirect_sig(), but the WebAssembly signature index may...
diff --git a/lib/cretonne/src/cursor.rs b/lib/cretonne/src/cursor.rs index 8de400a1f..442d820c0 100644 --- a/lib/cretonne/src/cursor.rs +++ b/lib/cretonne/src/cursor.rs @@ -19,6 +19,8 @@ pub use ir::layout::Cursor as LayoutCursor; /// encoding. pub struct FuncCursor<'f> { pos: CursorPosition, + + /// The refe...
7
129
54
dc2bee9cef874eeca4779d072f00ccabb57ccbd9
Jakob Stoklund Olesen
2017-09-06T18:44:52
Add a FuncEnvironment::make_direct_func() callback. This allows the environment to control the signatures used for direct function calls. The signature and calling convention may depend on whether the function is imported or local. Also add WasmRuntime::declare_func_{import,type} to notify the runtime about imported ...
diff --git a/cranelift/src/wasm.rs b/cranelift/src/wasm.rs index 87efd7d62..0dda98b52 100644 --- a/cranelift/src/wasm.rs +++ b/cranelift/src/wasm.rs @@ -5,7 +5,7 @@ //! IL. Can also executes the `start` function of the module by laying out the memories, globals //! and tables, then emitting the translated code with h...
10
154
223
45b093ea596a8397360e2bd0f2db06a0ee273a08
Dan Gohman
2017-09-06T15:50:57
Use `write_all()` to write to write an entire string rather than `write()`. https://github.com/rust-lang-nursery/rust-clippy/wiki#unused_io_amount
diff --git a/cranelift/src/cton-util.rs b/cranelift/src/cton-util.rs index 3d9b979e2..bd104e9d5 100644 --- a/cranelift/src/cton-util.rs +++ b/cranelift/src/cton-util.rs @@ -96,7 +96,7 @@ fn main() { if !msg.ends_with('\n') { msg.push('\n'); } - io::stderr().write(msg.as_bytes()).un...
1
1
1
73f5adb19d16a120d79d2e76d53bb4a8c1505a98
Dan Gohman
2017-09-06T16:36:25
Clippy cleanups.
diff --git a/lib/wasmstandalone/src/execution.rs b/lib/wasmstandalone/src/execution.rs index 900f5714d..e85d1806c 100644 --- a/lib/wasmstandalone/src/execution.rs +++ b/lib/wasmstandalone/src/execution.rs @@ -6,7 +6,7 @@ use cretonne::verifier; use cretonne::settings::Configurable; use cretonne::result::CtonError; u...
3
46
46
cb7e66d12a050615c05dc484bf2bdba70b24af84
Dan Gohman
2017-09-06T16:19:34
Fix missing documentation comment.
diff --git a/lib/wasmstandalone/src/execution.rs b/lib/wasmstandalone/src/execution.rs index 76d1378fe..900f5714d 100644 --- a/lib/wasmstandalone/src/execution.rs +++ b/lib/wasmstandalone/src/execution.rs @@ -139,7 +139,7 @@ pub fn compile_module(trans_result: &TranslationResult) -> Result<ExecutableCode } } -/...
1
1
1
6c80e81c6c4b0189053e310fd9ab983f3ef4da31
Dan Gohman
2017-09-06T16:18:18
Remove trivial numeric casts.
diff --git a/lib/wasmstandalone/src/standalone.rs b/lib/wasmstandalone/src/standalone.rs index fa3ac0817..b35f927b3 100644 --- a/lib/wasmstandalone/src/standalone.rs +++ b/lib/wasmstandalone/src/standalone.rs @@ -78,8 +78,8 @@ impl WasmRuntime for StandaloneRuntime { global_index: GlobalIndex, ) -> Value ...
1
11
11
54a3f1fcd40c242b4ce23ae8e6912148d09dce46
Dan Gohman
2017-09-06T15:59:10
Fix redundant qualification.
diff --git a/lib/wasmstandalone/src/execution.rs b/lib/wasmstandalone/src/execution.rs index b159f7967..76d1378fe 100644 --- a/lib/wasmstandalone/src/execution.rs +++ b/lib/wasmstandalone/src/execution.rs @@ -254,7 +254,7 @@ pub fn pretty_verifier_error( } /// Pretty-print a Cretonne error. -pub fn pretty_error(fun...
1
1
1
6c30cf8f0068be9e4269b84307cc8ef4d8b90f96
Dan Gohman
2017-09-06T15:54:30
Enable deny(missing_docs) in the wasmstandalone library.
diff --git a/lib/wasmstandalone/src/lib.rs b/lib/wasmstandalone/src/lib.rs index 5fc0c6d5b..faa7f1d09 100644 --- a/lib/wasmstandalone/src/lib.rs +++ b/lib/wasmstandalone/src/lib.rs @@ -3,6 +3,8 @@ //! the translation the base addresses of regions of memory that will hold the globals, tables and //! linear memories. ...
1
2
0
386846791719739f0aaa27538bc2b99f82fd2d59
Dan Gohman
2017-09-06T15:37:12
Format with rustfmt 0.9.0.
diff --git a/lib/wasmstandalone/src/execution.rs b/lib/wasmstandalone/src/execution.rs index a8965fcca..b159f7967 100644 --- a/lib/wasmstandalone/src/execution.rs +++ b/lib/wasmstandalone/src/execution.rs @@ -66,20 +66,20 @@ pub struct ExecutableCode { /// Executes a module that has been translated with the `Standalon...
3
227
203
320c88f3654b06a02a1b0f606d2257f3bdac10a1
Dan Gohman
2017-09-05T23:27:38
Rename cretonne_wasm to cton_wasm, for consistency with the other libraries.
diff --git a/cranelift/src/cton-util.rs b/cranelift/src/cton-util.rs index b94094752..3d9b979e2 100644 --- a/cranelift/src/cton-util.rs +++ b/cranelift/src/cton-util.rs @@ -1,7 +1,7 @@ #[macro_use(dbg)] extern crate cretonne; extern crate cton_reader; -extern crate cretonne_wasm; +extern crate cton_wasm; extern cra...
4
7
4
d3712575b523daea161d6e661c6fb6522e2e0245
Dan Gohman
2017-09-05T20:55:33
Use mem::replace instead of mem::swap when it's cleaner.
diff --git a/lib/filecheck/src/checker.rs b/lib/filecheck/src/checker.rs index d48c0ba3e..bad8e4774 100644 --- a/lib/filecheck/src/checker.rs +++ b/lib/filecheck/src/checker.rs @@ -132,8 +132,7 @@ impl CheckerBuilder { pub fn finish(&mut self) -> Checker { // Move directives into the new checker, leaving ...
2
3
6
0ac1d0dd942fafb47b165f7ea63361d036905ce1
Jakob Stoklund Olesen
2017-09-05T20:11:35
Add FuncEnvironment trait. This trait is used to provide the environment necessary to translate a single WebAssembly function without having other global data structures for the WebAssembly module. The WasmRuntime trait extends the FuncEnvironment trait for those uses that want to parse a whole WebAssembly module. -...
diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs index beb5dfdcf..8eb90dd1d 100644 --- a/lib/frontend/src/frontend.rs +++ b/lib/frontend/src/frontend.rs @@ -26,7 +26,10 @@ pub struct FunctionBuilder<'a, Variable: 'a> where Variable: EntityRef + Hash + Default, { - func: &'a mut Functio...
6
240
190
19c8ba5021fd6d046921f2b00b2fb7e99e49828b
Jakob Stoklund Olesen
2017-09-05T18:51:32
Eliminate the `sig` argument to translate_operator. The current function's return types are pushed as the first control stack frame.
diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index 0b540782f..1e96b02c4 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -126,7 +126,6 @@ pub fn translate_function_body( &mut builder, runtime...
1
1
3
2671cbb092e51df410e60751438ee8fe11dfb718
Jakob Stoklund Olesen
2017-09-05T18:46:08
Add TranslationState::in_unreachable_code(). Move an unreachable code test and sanity check into this method.
diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index 0ffa89806..0b540782f 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -118,11 +118,7 @@ pub fn translate_function_body( let parser_state = parser.read(); match *parser_stat...
2
11
5
6f864f2926564c6a063e9950dc86b9ae63cf04f4
Jakob Stoklund Olesen
2017-09-05T17:52:31
Move translation state initialization into a method.
diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index b057aa11c..0ffa89806 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -108,17 +108,11 @@ pub fn translate_function_body( } } - let mut state = TranslationState::new();...
2
27
10
ef3ea724220aa37f80469de2b40471a7ff822f40
Dan Gohman
2017-09-05T16:15:29
Avoid calling Vec::split_off, avoiding more heap allocations.
diff --git a/lib/filecheck/src/checker.rs b/lib/filecheck/src/checker.rs index 9c88df8eb..d48c0ba3e 100644 --- a/lib/filecheck/src/checker.rs +++ b/lib/filecheck/src/checker.rs @@ -6,6 +6,7 @@ use std::borrow::Cow; use std::collections::HashMap; use std::cmp::max; use std::fmt::{self, Display, Formatter}; +use std::...
2
54
35
9ea40ad44a9b035d0835d638f928c590d7e3c618
Dan Gohman
2017-09-02T11:11:51
Replace SSABuilder's variables HashMaps with EntityMaps. (#150) * Replace SSABuilder's variables HashMaps with EntityMaps. Current measurements show that memory usage is approximately the same, and it's about 20% faster. * Add EntityMap::with_default and use it. * rustfmt * Use var_defs[block].expand().
diff --git a/lib/cretonne/src/entity/map.rs b/lib/cretonne/src/entity/map.rs index 5db852238..200aa464c 100644 --- a/lib/cretonne/src/entity/map.rs +++ b/lib/cretonne/src/entity/map.rs @@ -41,6 +41,17 @@ where } } + /// Create a new empty map with a specified default value. + /// + /// This con...
2
19
8
67621948013d186fb5cb9ccb6b922e054425bafc
Jakob Stoklund Olesen
2017-09-01T21:27:25
Move stack and control_stack into TranslationState. This reduces the number of function arguments passed around and it keeps related information together.
diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index 751f528f6..48e689dbe 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -126,13 +126,27 @@ impl ControlStackFrame { /// Contains information passed along during the translation and that records: /...
1
35
28
0c2ab06e6601b0b2428e1384f15997015ef3ac4e
Dan Gohman
2017-09-01T20:25:37
Make EntitySet::contains return false for out-of-bounds indices. This is consistent with EntityMap.
diff --git a/lib/cretonne/src/entity/set.rs b/lib/cretonne/src/entity/set.rs index 6d8d88fad..b1c351b65 100644 --- a/lib/cretonne/src/entity/set.rs +++ b/lib/cretonne/src/entity/set.rs @@ -34,8 +34,11 @@ where /// Get the element at `k` if it exists. pub fn contains(&self, k: K) -> bool { let index =...
1
8
2
de92b2b9676e30dfea9eb1c9f7f1d2028d0d7788
Dan Gohman
2017-09-01T20:20:03
Use Vec::resize.
diff --git a/lib/cretonne/src/entity/set.rs b/lib/cretonne/src/entity/set.rs index be9d76bb4..6d8d88fad 100644 --- a/lib/cretonne/src/entity/set.rs +++ b/lib/cretonne/src/entity/set.rs @@ -56,16 +56,7 @@ where /// Resize the set to have `n` entries by adding default entries as needed. pub fn resize(&mut sel...
1
1
10
52cbbcd069d28fdd3d5879e6781727085f8c5c0b
Jakob Stoklund Olesen
2017-09-01T20:06:05
Add a CtonError::InvalidInput variant. This error code will be used to complain when a WebAssembly binary code can't be parsed.
diff --git a/cranelift/src/wasm.rs b/cranelift/src/wasm.rs index c54cfa85d..c418c3cc2 100644 --- a/cranelift/src/wasm.rs +++ b/cranelift/src/wasm.rs @@ -195,6 +195,7 @@ fn handle_module( CtonError::Verifier(err) => { return Err(pretty_verifier_error(&context.func, N...
2
11
0
8237893113ac15fd99cc2e0ab95b7a4ffe81079f
Dan Gohman
2017-09-01T19:50:51
Eliminate a temporary heap allocation when splitting a critical edge.
diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index a1b9d56de..2cabe2ced 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -539,24 +539,15 @@ where // In the case of a jump table, the situation is tricky because br_table doesn't // support arguments...
1
4
13
d4c53935b435a863cb4b1a51d573b16082219d82
Dan Gohman
2017-09-01T17:13:41
Introduce EntitySet, and use it to replace the HashSet in the frontend.
diff --git a/lib/cretonne/src/entity/mod.rs b/lib/cretonne/src/entity/mod.rs index 6702c43da..4fc40ea56 100644 --- a/lib/cretonne/src/entity/mod.rs +++ b/lib/cretonne/src/entity/mod.rs @@ -4,8 +4,8 @@ //! `usize` as usual, but by *entity references* which are integers wrapped in new-types. This has //! a couple advan...
3
154
6
fe12fe0e6367dd45293af25795ba85b924080e3c
Dan Gohman
2017-09-01T17:12:23
Avoid unneeded calls to .as_slice().
diff --git a/lib/cretonne/src/regalloc/solver.rs b/lib/cretonne/src/regalloc/solver.rs index b99da23d4..c9215f4eb 100644 --- a/lib/cretonne/src/regalloc/solver.rs +++ b/lib/cretonne/src/regalloc/solver.rs @@ -649,7 +649,7 @@ impl Solver { |v| v.from != v.to, )); - dbg!("collect_moves: {}"...
4
17
31
9d2fbdae62b341ded21090730262885e00cd0086
Dan Gohman
2017-09-01T17:16:30
Avoid cloning a jump argument vector to the heap.
diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index 62d5adcfe..34c68bf81 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -562,7 +562,7 @@ fn translate_operator( let default_ebb = control_stack[control_stack.len() - 1 - (default as u...
1
1
1
28779dc7e47ac435901644d373c5a0bf6ebfea01
Dan Gohman
2017-09-01T19:11:30
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.
diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index eccdfc2da..a1b9d56de 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -168,7 +168,7 @@ where enum ZeroOneOrMore<T> { Zero(), One(T), - More(Vec<T>), + More(), } #[derive(Debug)] @@ -409,7 +409,7 @@ where ...
1
47
42
9bc4264a33705b98a92c4a2e93178f0f6ad4cd60
Jakob Stoklund Olesen
2017-09-01T16:31:05
Update dependency to wasmparser v0.8.2. Soon we'll need the BinaryReader::read_local_decl() method which was added in that release.
diff --git a/lib/wasm/Cargo.toml b/lib/wasm/Cargo.toml index d03f178cd..28710bdc7 100644 --- a/lib/wasm/Cargo.toml +++ b/lib/wasm/Cargo.toml @@ -8,6 +8,6 @@ repository = "https://github.com/stoklund/cretonne" license = "Apache-2.0" [dependencies] -wasmparser = "0.6.1" +wasmparser = "0.8.2" cretonne = { path = "../...
1
1
1
7049cc78ae11e987e35e7ce11636adf8bdd38056
Dan Gohman
2017-09-01T00:49:39
Refactor out an append helper function for SideEffects.
diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index 51cbe1e25..eccdfc2da 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -66,6 +66,13 @@ impl SideEffects { instructions_added_to_ebbs: Vec::new(), } } + + fn append(&mut self, mut more: SideEffects) { +...
1
11
17
ec3972f515c6c30e52e043bdc2a8adda840a7f20
Dan Gohman
2017-09-01T00:42:19
Avoid allocating a vector for predecessor variables in the single-value case.
diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index e2e618d0f..51cbe1e25 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -161,7 +161,7 @@ where enum ZeroOneOrMore<T> { Zero(), One(T), - More(), + More(Vec<T>), } #[derive(Debug)] @@ -409,9 +409,7 @@ where ...
1
18
19
52335c9e0f076b6b3e7ef8ef41bcb4f5d3062f0f
Dan Gohman
2017-09-01T00:06:14
Delete an obsolete TODO comment.
diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index ecfe57b23..e2e618d0f 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -164,7 +164,6 @@ enum ZeroOneOrMore<T> { More(), } -/// TODO: use entity list instead of vec #[derive(Debug)] enum UseVarCases { Unsealed(Value),
1
0
1
566c772e2018fcca0b840123eb471edd4cb39094
Dan Gohman
2017-08-31T23:51:06
Eliminate more unnecessary calls to .iter().
diff --git a/cranelift/src/wasm.rs b/cranelift/src/wasm.rs index 3a972e971..c54cfa85d 100644 --- a/cranelift/src/wasm.rs +++ b/cranelift/src/wasm.rs @@ -57,7 +57,7 @@ pub fn run( flag_optimize: bool, flag_check: bool, ) -> Result<(), String> { - for filename in files.iter() { + for filename in files { ...
4
7
7
de029761625b526d117c1b124552b1684115ce72
Dan Gohman
2017-08-31T23:16:08
Minor comment cleanups.
diff --git a/lib/cretonne/src/abi.rs b/lib/cretonne/src/abi.rs index 49620bcfd..38bc6781d 100644 --- a/lib/cretonne/src/abi.rs +++ b/lib/cretonne/src/abi.rs @@ -162,7 +162,7 @@ pub fn legalize_abi_value(have: Type, arg: &ArgumentType) -> ValueConversion { } // We have the same number of bits as the ar...
3
5
5
1d03244e902bb0f02b4e366bcbee71e824f188b5
Dan Gohman
2017-08-31T23:36:18
Use debug_assert instead of assert in code where performance is important.
diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index 6ec44c5f7..498b0b0ea 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -119,7 +119,7 @@ struct EbbHeaderBlockData<Variable> { pub struct Block(u32); impl EntityRef for Block { fn new(index: usize) -> Self { - assert!(...
2
5
5
583487bfac14a26481a761f6cec812141a8f6cbd
Dan Gohman
2017-08-31T23:30:00
Refactor the non-local case of use_var into a separate function.
diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index 016d8f0ce..6ec44c5f7 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -225,9 +225,23 @@ where if let Some(val) = var_defs.get(&block) { return (*val, SideEffects::new()); } - }; - ...
1
17
3
e3227e38ce25f371dcae2566e083ed39a9e06691
Dan Gohman
2017-08-31T23:09:26
Avoid cloning precessor lists to the heap.
diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index c9f763cf7..016d8f0ce 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -169,7 +169,7 @@ enum ZeroOneOrMore<T> { enum UseVarCases { Unsealed(Value), SealedOnePredecessor(Block), - SealedMultiplePredecessors(Vec<(Block,...
1
26
12
539a5b33787d204b535ce5cee059c8566adf6df4
Dan Gohman
2017-08-31T21:56:27
Avoid a heap allocation for a block's undef_variables.
diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index 603f81073..c9f763cf7 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -16,6 +16,7 @@ use std::u32; use cretonne::ir::types::{F32, F64}; use cretonne::ir::immediates::{Ieee32, Ieee64}; use std::collections::HashMap; +use std::me...
1
8
7
79f257060f645313df41e930d92b0cb3f35484b3
Dan Gohman
2017-08-31T21:49:53
Inline resolve_undef_vars, and collapse the resulting redundancy.
diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index 279630ef0..603f81073 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -334,6 +334,8 @@ where /// /// This method modifies the function's `Layout` by adding arguments to the `Ebb`s to /// take into account the Phi fu...
1
5
30
2d9b902d2e0851c825744a9592cc5cca1ebae8e3
Dan Gohman
2017-08-31T21:35:19
Clean up a redundant cast.
diff --git a/lib/cretonne/src/ir/immediates.rs b/lib/cretonne/src/ir/immediates.rs index 2ab486f86..f33e13ecc 100644 --- a/lib/cretonne/src/ir/immediates.rs +++ b/lib/cretonne/src/ir/immediates.rs @@ -259,7 +259,7 @@ impl FromStr for Offset32 { if !(s.starts_with('-') || s.starts_with('+')) { retu...
1
1
1
7be0abb442090dc3247e691d813450c529c36612
Dan Gohman
2017-08-31T21:15:25
Remove an unneeded extern crate.
diff --git a/cranelift/src/cton-util.rs b/cranelift/src/cton-util.rs index 4e18001a0..b94094752 100644 --- a/cranelift/src/cton-util.rs +++ b/cranelift/src/cton-util.rs @@ -3,7 +3,6 @@ extern crate cretonne; extern crate cton_reader; extern crate cretonne_wasm; extern crate docopt; -extern crate serde; #[macro_use]...
1
0
1
af74cdf36439a38c6537e16b5c48fe0b753760c9
Dan Gohman
2017-08-31T20:40:35
Cretonne's top-level tools don't need to directly depend on wasmparser.
diff --git a/cranelift/Cargo.toml b/cranelift/Cargo.toml index 3d5080974..6523a9d2d 100644 --- a/cranelift/Cargo.toml +++ b/cranelift/Cargo.toml @@ -18,7 +18,6 @@ cretonne-reader = { path = "lib/reader" } cretonne-frontend = { path = "lib/frontend" } cretonne-wasm = { path = "lib/wasm" } filecheck = { path = "lib/fi...
1
0
1
bc528917fd2ec690268eec3029d061cb1142529b
Dan Gohman
2017-08-31T19:18:03
Avoid redundant '@ _' in match patterns. https://github.com/rust-lang-nursery/rust-clippy/wiki#redundant_pattern
diff --git a/lib/wasm/src/module_translator.rs b/lib/wasm/src/module_translator.rs index a5949fef3..6a2e5f396 100644 --- a/lib/wasm/src/module_translator.rs +++ b/lib/wasm/src/module_translator.rs @@ -68,7 +68,7 @@ pub fn translate_module( ParserState::Error(BinaryReaderError { message, offset }) => { ...
2
24
26
ebbb836bb95a78c5a532574d988cb2f26f811614
Dan Gohman
2017-08-31T19:16:44
Use debug_assert_eq rather than debug_assert with an ==.
diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs index 0210e43a5..a7d98004d 100644 --- a/lib/frontend/src/frontend.rs +++ b/lib/frontend/src/frontend.rs @@ -319,8 +319,9 @@ where /// Register a new definition of a user variable. Panics if the type of the value is not the /// same as th...
1
6
4
a7d629c3689e6ea978fff7bf767666b528964bd2
Dan Gohman
2017-08-31T19:12:04
Use the `Self` keyword where applicable. https://github.com/rust-lang-nursery/rust-clippy/wiki#use_self
diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs index 008610f62..0210e43a5 100644 --- a/lib/frontend/src/frontend.rs +++ b/lib/frontend/src/frontend.rs @@ -51,8 +51,8 @@ where { /// Creates a ILBuilder structure. The structure is automatically cleared each time it is /// passed to a ...
7
14
14
99b361567abe9c49f9bb3260f5252229d0ca0832
Dan Gohman
2017-08-31T19:09:42
Remove unneeded `mut` keywords.
diff --git a/lib/cretonne/src/entity/list.rs b/lib/cretonne/src/entity/list.rs index 3f5eace69..03c66a8ec 100644 --- a/lib/cretonne/src/entity/list.rs +++ b/lib/cretonne/src/entity/list.rs @@ -467,7 +467,7 @@ impl<T: EntityRef> EntityList<T> { /// Since the memory comes from the pool, this will be either zero enti...
2
4
4
55ae51acfedfab17eda23f169b3e29d8b3f0b6bf
Dan Gohman
2017-08-31T19:09:33
Add an underscore between a literal value and its suffix. https://github.com/rust-lang-nursery/rust-clippy/wiki#unseparated_literal_suffix
diff --git a/lib/reader/src/parser.rs b/lib/reader/src/parser.rs index 39bac8af7..f8e90de1a 100644 --- a/lib/reader/src/parser.rs +++ b/lib/reader/src/parser.rs @@ -1312,7 +1312,7 @@ impl<'a> Parser<'a> { let mut data = JumpTableData::new(); // jump-table-decl ::= JumpTable(jt) "=" "jump_table" * jt...
1
1
1
da2c2151b1bd5d8cd84ca5bf0aa9172a2e8a64a7
Dan Gohman
2017-08-31T19:07:54
Fix trivial_numeric_casts errors.
diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index d6fd219bd..a98c9ad4f 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -186,7 +186,7 @@ pub fn translate_function_body( for (i, arg_type) in sig.argument_types.iter().enumerate() { ...
3
11
17
9726bb7367e470a7fbb04459f080a5ca07af1e67
Dan Gohman
2017-08-31T18:59:26
Avoid matching with reference patterns. https://github.com/rust-lang-nursery/rust-clippy/wiki#match_ref_pats
diff --git a/cranelift/src/wasm.rs b/cranelift/src/wasm.rs index 7dc85b8aa..3a972e971 100644 --- a/cranelift/src/wasm.rs +++ b/cranelift/src/wasm.rs @@ -149,9 +149,9 @@ fn handle_module( vprint!(flag_verbose, "Checking... "); terminal.reset().unwrap(); for func in translation.functions.iter...
6
54
54
5a8d1a9fda56aeabc60e6ee45f5cb1700a8a6aa4
Dan Gohman
2017-08-31T18:57:03
Use `if let` instead of `match`. https://github.com/rust-lang-nursery/rust-clippy/wiki#single_match
diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs index 20c660a1f..008610f62 100644 --- a/lib/frontend/src/frontend.rs +++ b/lib/frontend/src/frontend.rs @@ -147,15 +147,14 @@ impl<'short, 'long, Variable> InstBuilderBase<'short> for FuncInstBuilder<'short } None...
2
31
53
574031e4d2779fc2804d92f85715205545434c17
Dan Gohman
2017-08-31T18:49:33
Avoid unneeded passing by value. https://github.com/rust-lang-nursery/rust-clippy/wiki#needless_pass_by_value
diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index f4547f500..a4ad9f744 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -156,7 +156,7 @@ impl FunctionImports { pub fn translate_function_body( parser: &mut Parser, function_index: Function...
3
4
4
b6641ff44387afb6863a6fb00530f37c52394bb8
Dan Gohman
2017-08-31T18:48:14
Avoid clone() on a `Copy` type. https://github.com/rust-lang-nursery/rust-clippy/wiki#clone_on_copy
diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs index 3c92e24bc..20c660a1f 100644 --- a/lib/frontend/src/frontend.rs +++ b/lib/frontend/src/frontend.rs @@ -136,7 +136,7 @@ impl<'short, 'long, Variable> InstBuilderBase<'short> for FuncInstBuilder<'short match data.analyz...
4
4
4
105998944e3c633be0cc36eac2900d0abf03d086
Dan Gohman
2017-08-31T18:46:45
Avoid redundant borrows. https://github.com/rust-lang-nursery/rust-clippy/wiki#needless_borrow
diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index 4729ddbaa..067834827 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -250,10 +250,10 @@ pub fn translate_function_body( &mut stack, &mut co...
1
4
4
9a8f01b832ba972c162d7f089a9fcdbc57331e48
Dan Gohman
2017-08-31T18:46:05
Avoid unnecessary '&' in matches. https://github.com/rust-lang-nursery/rust-clippy/wiki#match_ref_pats
diff --git a/lib/cretonne/src/legalizer/globalvar.rs b/lib/cretonne/src/legalizer/globalvar.rs index 308c8df9e..42856edc9 100644 --- a/lib/cretonne/src/legalizer/globalvar.rs +++ b/lib/cretonne/src/legalizer/globalvar.rs @@ -10,8 +10,8 @@ use ir::{self, InstBuilder}; /// Expand a `global_addr` instruction according to...
4
16
16
acf4f1009bad36b2e5b3de5e11dc591edbf846aa
Dan Gohman
2017-08-31T18:43:54
Eliminate redundant uses of format!. https://github.com/rust-lang-nursery/rust-clippy/wiki#useless_format
diff --git a/lib/wasm/src/module_translator.rs b/lib/wasm/src/module_translator.rs index 0aaa35e69..81b0baa65 100644 --- a/lib/wasm/src/module_translator.rs +++ b/lib/wasm/src/module_translator.rs @@ -254,7 +254,7 @@ pub fn translate_module( .collect() } ParserState::EndSe...
2
2
2
abbc6ddf240b0c868f18eaa43a310a3da858ced8
Dan Gohman
2017-08-31T18:40:18
Use is_empty() instead of comparing len() with 0. https://github.com/rust-lang-nursery/rust-clippy/wiki#len_zero
diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs index 60b427b71..3c92e24bc 100644 --- a/lib/frontend/src/frontend.rs +++ b/lib/frontend/src/frontend.rs @@ -530,7 +530,7 @@ where fn ebb_args_adjustement(&mut self, dest_ebb: Ebb, jump_args: &[Type]) { let ty_to_append: Option<Vec<...
1
1
1
adfdd773119492812a0d4f789d1281a039a5cd42
Dan Gohman
2017-08-31T18:38:55
Avoid creating a reference to a reference. https://github.com/rust-lang-nursery/rust-clippy/wiki#needless_borrow
diff --git a/lib/cretonne/src/regalloc/coalescing.rs b/lib/cretonne/src/regalloc/coalescing.rs index 35957f90c..509f5a45e 100644 --- a/lib/cretonne/src/regalloc/coalescing.rs +++ b/lib/cretonne/src/regalloc/coalescing.rs @@ -468,7 +468,7 @@ impl<'a> Context<'a> { /// Leave `self.values` unchanged on failure. ...
2
2
2
b411d01d6dcf791452c7fd56dee21a15eba42989
Dan Gohman
2017-08-31T18:37:58
Use `[]` instead of `.get().unwrap()`. https://github.com/rust-lang-nursery/rust-clippy/wiki#get_unwrap
diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index 12f382933..c500ba7c0 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -567,7 +567,7 @@ fn translate_operator( acc.insert(depth as usize, branch_ebb); ...
2
2
2
46fb64cbb442b7c3750a6f70755b6008c69e026a
Dan Gohman
2017-08-07T20:59:26
Add SideEffects::new().
diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index dcc2a092b..f25b3eaa7 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -57,6 +57,15 @@ pub struct SideEffects { pub instructions_added_to_ebbs: Vec<Ebb>, } +impl SideEffects { + fn new() -> SideEffects { + SideEff...
1
13
18
52186b83908a20e481740bea3d1b69090449769d
Dan Gohman
2017-08-31T16:33:07
Refactor code for obtaining the header block.
diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index 0e4bcfcb9..dcc2a092b 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -310,13 +310,8 @@ impl<Variable> SSABuilder<Variable> /// Callers are expected to avoid adding the same predecessor more than once in the case /// of ...
1
5
18
fc374b6c068760f317696c8a72f2a893e7f4c516
Dan Gohman
2017-08-31T14:45:39
Test that stack layout with an unsupported offset is rejected cleanly.
diff --git a/lib/cretonne/src/stack_layout.rs b/lib/cretonne/src/stack_layout.rs index f968e56a0..c36784909 100644 --- a/lib/cretonne/src/stack_layout.rs +++ b/lib/cretonne/src/stack_layout.rs @@ -111,6 +111,8 @@ mod tests { use ir::StackSlots; use ir::types; use super::layout_stack; + use ir::stacksl...
1
6
0
bd0590604d1da3c9bccbdcadd09f2b0b3997ac47
Dan Gohman
2017-08-31T14:45:35
Test dfg's next_inst().
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index 219557aeb..8a1447f85 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -866,7 +866,10 @@ mod tests { let mut dfg = DataFlowGraph::new(); let idata = InstructionData::Nullary { opcode: Opcode::Iconst ...
1
3
0
4c3ac6053f4493a3f6306c67ae067bd195a0e41b
Dan Gohman
2017-08-31T14:45:29
Test the error case of condcode parsing.
diff --git a/lib/cretonne/src/ir/condcodes.rs b/lib/cretonne/src/ir/condcodes.rs index f63bd6093..26d81ede6 100644 --- a/lib/cretonne/src/ir/condcodes.rs +++ b/lib/cretonne/src/ir/condcodes.rs @@ -303,6 +303,7 @@ mod tests { let cc = *r; assert_eq!(cc.to_string().parse(), Ok(cc)); } +...
1
2
0
6702221e94d1f3176fad24edd4f5fe65f6754f75
Dan Gohman
2017-08-31T15:54:34
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.
diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs index 1b69acab0..5535feebc 100644 --- a/lib/frontend/src/frontend.rs +++ b/lib/frontend/src/frontend.rs @@ -7,6 +7,7 @@ use cretonne::ir::function::DisplayFunction; use cretonne::isa::TargetIsa; use ssa::{SSABuilder, SideEffects, Block}; use cr...
2
22
20
a0a3401ef1874ae680761e554604a37bf8a4e56d
Dan Gohman
2017-08-30T16:21:58
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.
diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index dcab3f369..708bdba6f 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -523,17 +523,15 @@ fn translate_operator(op: &Operator, if jump_args_count == 0 { // No jump argum...
1
36
46
4ccd21ba94148505b2d64e99675a7703b535f938
Dan Gohman
2017-08-30T18:21:02
Simplify iteration.
diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index f4b73c280..01baf27e2 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -397,7 +397,7 @@ impl<Variable> SSABuilder<Variable> }; // For each undef var we look up values in the predecessors and create an Ebb argument...
1
1
1
110697cfddbb2b8698ad45eb643d2a01ad30c10d
Dan Gohman
2017-08-30T18:17:25
Replace match blocks with .expect calls.
diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index 3d20e9d86..f4b73c280 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -298,15 +298,11 @@ impl<Variable> SSABuilder<Variable> /// Gets the header block corresponding to an Ebb, panics if the Ebb or the header block /// is...
1
5
9
5e99a4fb6a954e78703b44473072f96d6a9c4980
Dan Gohman
2017-08-30T18:12:05
Simplify a pattern-match.
diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index 9de49b95b..3d20e9d86 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -242,7 +242,7 @@ impl<Variable> SSABuilder<Variable> UseVarCases::Unsealed(val) } } - BlockData::E...
1
1
1
0cc8bd06cd1755d841d90db619d1cfb33cd3c854
Dan Gohman
2017-08-30T16:10:50
Remove unnecessary `()` values.
diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index 310434e54..9de49b95b 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -72,7 +72,6 @@ impl<Variable> BlockData<Variable> { &mut BlockData::EbbBody { .. } => panic!("you can't add a predecessor to a body block"), ...
2
0
2
8647b10135a54dbbc56137d159d4d268eb108c98
Dan Gohman
2017-08-10T20:59:46
Loop over references to containers instead of using explicit iteration methods. https://github.com/rust-lang-nursery/rust-clippy/wiki#explicit_iter_loop
diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs index 57c0aaa9e..1b69acab0 100644 --- a/lib/frontend/src/frontend.rs +++ b/lib/frontend/src/frontend.rs @@ -492,7 +492,7 @@ impl<'a, Variable> FunctionBuilder<'a, Variable> fn fill_function_args_values(&mut self, ebb: Ebb) { debug_...
4
5
5
03698f6bc8560e77e3f78dad43286870e85fa667
Dan Gohman
2017-08-10T21:18:27
Use slices rather than Vec borrows. https://github.com/rust-lang-nursery/rust-clippy/wiki#ptr_arg
diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index 9e4969ebb..d5d2b51bc 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -433,7 +433,7 @@ impl<Variable> SSABuilder<Variable> temp_arg_val: Value, temp_arg_var: Variable, ...
3
13
13
01744d6f65b7e99be1671f72ab08dd4017a41641
Dan Gohman
2017-08-30T19:40:44
Avoid unneeded return keywords.
diff --git a/lib/cretonne/src/bitset.rs b/lib/cretonne/src/bitset.rs index cfca8371f..58e26a933 100644 --- a/lib/cretonne/src/bitset.rs +++ b/lib/cretonne/src/bitset.rs @@ -31,7 +31,7 @@ impl<T> BitSet<T> pub fn contains(&self, num: u8) -> bool { assert!((num as usize) < Self::bits()); assert!((n...
2
9
10
9ea5226b891c502f3195732d3e8705a11849ff3d
Dan Gohman
2017-08-30T21:32:42
Add simple_gvn to the optimization pipeline for WebAssembly functions.
diff --git a/cranelift/src/wasm.rs b/cranelift/src/wasm.rs index c83df807f..49292dbe2 100644 --- a/cranelift/src/wasm.rs +++ b/cranelift/src/wasm.rs @@ -196,6 +196,18 @@ fn handle_module(flag_verbose: bool, } } }; + match context.simple_gvn() { + ...
1
12
0
dcb65b59c1edcd8f3bf53f0e2fb23b4ff0305da1
Dan Gohman
2017-08-29T13:25:19
Remove an unnecessary `mut`, fixing a compiler warning.
diff --git a/lib/wasm/tests/testsuite.rs b/lib/wasm/tests/testsuite.rs index ed3f33942..3853ba170 100644 --- a/lib/wasm/tests/testsuite.rs +++ b/lib/wasm/tests/testsuite.rs @@ -61,7 +61,7 @@ fn handle_module(path: PathBuf) -> Result<(), String> { }; let mut dummy_runtime = DummyRuntime::new(); let transl...
1
1
1
b2fcb1ad177fb5a467f9b9355af6ad798328dd93
Dan Gohman
2017-08-29T13:21:28
Change translate_module to use a slice rather than a borrowed Vec. This makes it more convenient to call from a cargo-fuzz fuzzer.
diff --git a/lib/wasm/src/module_translator.rs b/lib/wasm/src/module_translator.rs index 11acbb1b4..99071b1bc 100644 --- a/lib/wasm/src/module_translator.rs +++ b/lib/wasm/src/module_translator.rs @@ -58,10 +58,10 @@ impl ImportMappings { /// [`Function`](../cretonne/ir/function/struct.Function.html). /// Returns the...
1
2
2
5303e7708bd2edc05c609252abcc5baae9e7ca33
Dan Gohman
2017-08-29T13:16:22
Handle wasmparser errors gracefully.
diff --git a/lib/wasm/src/module_translator.rs b/lib/wasm/src/module_translator.rs index 10dbbbc43..11acbb1b4 100644 --- a/lib/wasm/src/module_translator.rs +++ b/lib/wasm/src/module_translator.rs @@ -1,6 +1,6 @@ //! Translation skeletton that traverses the whole WebAssembly module and call helper functions //! to de...
1
4
1
c380df1d04fcda885b9017524a98b7f0ca6361a5
Dan Gohman
2017-08-29T12:44:40
Eliminate a heap allocation.
diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index f2521fcdd..efd54617f 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -167,10 +167,6 @@ pub fn translate_function_body(parser: &mut Parser, // First we build the Function object with its name a...
1
2
6
4afa5df3b6b488c37c75dde00ef4c7a585ed5a37
Dan Gohman
2017-08-29T11:40:48
Remove the last_inst_return field. It's not necessary to explicitly track whether the last instruction is a return; if the builder for the last block isn't filled by the time we reach the end, it needs a return to fill it.
diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index 696d91b30..f2521fcdd 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -126,11 +126,9 @@ impl ControlStackFrame { /// Contains information passed along during the translation and that records: //...
1
1
9
ea1d05383125dbb2a2b5eeb866957a15ab966546
Dan Gohman
2017-08-29T10:36:38
Simplify the "am I in unreachable code" predicate. The phantom unreachable stack is only used when the real unreachable stack is active, so it's sufficient to check whether the real unreachable stack is empty.
diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index 748a151e4..696d91b30 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -236,8 +236,9 @@ pub fn translate_function_body(parser: &mut Parser, let parser_state = parser.read(); ...
1
3
2
c71d4fc01b0650abd909c0af54a4fc057c6173e3
Dan Gohman
2017-08-29T10:30:22
Remove a stale comment.
diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index b1647a9ae..748a151e4 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -129,8 +129,6 @@ impl ControlStackFrame { /// - if the last instruction added was a `return`; /// - the depth of the two unrea...
1
0
2
253f602a4c942b42d7dcc1e4b510cadc59ee93e6
Dan Gohman
2017-08-29T00:17:41
Fix a few warnings.
diff --git a/cranelift/src/cton-util.rs b/cranelift/src/cton-util.rs index e85eb138c..5b7991bac 100644 --- a/cranelift/src/cton-util.rs +++ b/cranelift/src/cton-util.rs @@ -2,7 +2,6 @@ extern crate cretonne; extern crate cton_reader; extern crate cretonne_wasm; -extern crate wasmparser; extern crate docopt; extern...
2
1
2