This file contains hidden or 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
failed test: tests/testsuite/proposals/function-references/br_on_null.wast | |
Caused by: | |
unexpected token, expected one of: `func`, `extern`, `any`, `exn`, `eq`, `i31`, an index | |
--> tests/testsuite/proposals/function-references/br_on_null.wast:20:66 | |
| | |
20 | (func (export "nullable-null") (result i32) (call $n (ref.null (type $t)))) | |
| ^ | |
failed test: tests/testsuite/proposals/function-references/br_table.wast |
This file contains hidden or 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
fn main() { | |
let n = 42; | |
println!("fib({}) = {}", n, fib(n)); | |
} | |
fn fib(n: u32) -> u32 { | |
if n <= 2 { | |
1 | |
} else { | |
fib(n - 1) + fib(n - 2) |
This file contains hidden or 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
; ModuleID = 'foo.3a1fbbbh-cgu.0' | |
source_filename = "foo.3a1fbbbh-cgu.0" | |
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" | |
target triple = "wasm32-unknown-unknown" | |
; Function Attrs: nounwind | |
define void @bar() unnamed_addr #0 { | |
start: | |
tail call void @inline_me() | |
ret void |
This file contains hidden or 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
fn hex_encode_fallback<'a>(src: &[u8], dst: &'a mut [u8]) -> Result<&'a str, usize> { | |
fn hex(byte: u8) -> u8 { | |
static TABLE: &[u8] = b"0123456789abcdef"; | |
TABLE[byte as usize] | |
} | |
for (byte, slots) in src.iter().zip(dst.chunks_mut(2)) { | |
slots[0] = hex((*byte >> 4) & 0xf); | |
slots[1] = hex(*byte & 0xf); | |
} |
This file contains hidden or 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
JITDUMP specification version 2 | |
Last Revised: 09/15/2016 | |
Author: Stephane Eranian <[email protected]> | |
-------------------------------------------------------- | |
| Revision | Date | Description | | |
-------------------------------------------------------- | |
| 1 | 09/07/2016 | Initial revision | | |
-------------------------------------------------------- | |
| 2 | 09/15/2016 | Add JIT_CODE_UNWINDING_INFO | |
This file contains hidden or 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
#![allow(warnings)] | |
#![crate_type = "rlib"] | |
use std::io::Read; | |
type Result<T> = std::result::Result<T, ()>; | |
pub struct TypeSectionReader<'a>(&'a ()); | |
pub struct ImportSectionReader<'a>(&'a ()); | |
pub struct ModuleSectionReader<'a>(&'a ()); |
This file contains hidden or 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
--- before 2020-06-25 13:55:56.943297377 -0700 | |
+++ after 2020-06-25 13:56:35.715449471 -0700 | |
@@ -1,8 +1,8 @@ | |
if value != null: | |
value.ref_count += 1 | |
let current_elem = table[index] | |
+table[index] = value | |
if current_elem != null: | |
current_elem.ref_count -= 1 | |
if current_elem.ref_count == 0: |
This file contains hidden or 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
--- before 2020-06-25 13:55:56.943297377 -0700 | |
+++ after 2020-06-25 13:56:01.743316233 -0700 | |
@@ -1,8 +1,8 @@ | |
if value != null: | |
value.ref_count += 1 | |
let current_elem = table[index] | |
+table[index] = value | |
if current_elem != null: | |
current_elem.ref_count -= 1 | |
if current_elem.ref_count == 0: |
This file contains hidden or 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 std::cell::RefCell; | |
use std::rc::Rc; | |
use wasmtime::*; | |
struct A { | |
table: Table, | |
put_the_thing: Rc<RefCell<Option<Val>>>, | |
contents: String, | |
} |
This file contains hidden or 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 wasmtime::*; | |
struct A { | |
table: Table, | |
a: i32, | |
} | |
impl Drop for A { | |
fn drop(&mut self) { | |
let me = self.table.get(0).unwrap(); |