This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
time: 0.088; rss: 74MB parsing | |
time: 0.000; rss: 74MB attributes injection | |
time: 0.000; rss: 74MB recursion limit | |
time: 0.000; rss: 74MB crate injection | |
time: 0.000; rss: 74MB plugin loading | |
time: 0.000; rss: 74MB plugin registration | |
time: 0.005; rss: 74MB pre ast expansion lint checks | |
time: 0.305; rss: 163MB expand crate | |
time: 0.000; rss: 163MB check unused macros | |
time: 0.305; rss: 163MB expansion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Extracted from the scopeguard crate | |
use core::ops::{Deref, DerefMut}; | |
pub struct ScopeGuard<T, F> | |
where | |
F: FnMut(&mut T), | |
{ | |
dropfn: F, | |
value: T, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use core::hint; | |
pub mod encode { | |
#[inline] | |
pub fn shift_immed(ty: u32, imm5: u32, Rm: u32, Rd: u32) -> u32 { | |
let mut out = 0; | |
out |= 0x0 << 29; | |
out |= (ty as u32 & 0x3) << 27; | |
out |= (imm5 as u32 & 0x1f) << 22; | |
out |= (Rm as u32 & 0x7) << 19; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Instruction::SMLAW_16(fields) => { | |
if trans.config().strict_unpredictable { | |
if fields.Rd() == 15 || fields.Rm() == 15 || fields.Rn() == 15 { | |
return translate_unpredictable(trans); | |
} | |
} | |
let n = trans.get_reg(fields.Rn()); | |
let m = trans.get_reg(fields.Rm()); | |
let a = if fields.Ra() == 15 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ RUST_BACKTRACE=1 target/release/cton-util wasm -T --set is_64bit=1 --isa x86 ../wasm-collection/misc-valid/AngryBots1.wasm | |
thread 'main' panicked at 'Invalid type for vsplit', libcore/option.rs:914:5 | |
stack backtrace: | |
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace | |
at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49 | |
1: std::sys_common::backtrace::print | |
at libstd/sys_common/backtrace.rs:71 | |
at libstd/sys_common/backtrace.rs:59 | |
2: std::panicking::default_hook::{{closure}} | |
at libstd/panicking.rs:211 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
thread 'main' panicked at 'Expected register: Unassigned', lib/codegen/src/ir/valueloc.rs:40:18 | |
stack backtrace: | |
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace | |
at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49 | |
1: std::sys_common::backtrace::print | |
at libstd/sys_common/backtrace.rs:71 | |
at libstd/sys_common/backtrace.rs:59 | |
2: std::panicking::default_hook::{{closure}} | |
at libstd/panicking.rs:211 | |
3: std::panicking::default_hook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct SendHandle { | |
handle: Handle, | |
guard: Option<Guard>, | |
} | |
unsafe impl Send for SendHandle {} | |
impl SendHandle { | |
pub fn new(handle: Handle) -> SendHandle { | |
SendHandle { | |
handle, | |
guard: None, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate crossbeam; | |
extern crate fringe; | |
use fringe::generator::*; | |
use fringe::OsStack; | |
use std::ptr; | |
use std::thread; | |
fn do_stuff(x: &mut i32) { | |
loop { | |
unsafe { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/generator.rs b/src/generator.rs | |
index 6870c29..9065e38 100644 | |
--- a/src/generator.rs | |
+++ b/src/generator.rs | |
@@ -88,6 +88,32 @@ pub struct Generator<Input: Send, Output: Send, Stack: stack::Stack> { | |
phantom: (PhantomData<*const Input>, PhantomData<*const Output>) | |
} | |
+unsafe fn encode<T>(val: &T) -> usize { | |
+ if mem::size_of::<T>() <= mem::size_of::<usize>() && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x86_64 | |
====== | |
master: | |
context: 4.7 ns | |
generator: 7.3 ns | |
Amanieu: | |
context: 4.7 ns | |
generator: 6.5 ns |