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 parity_wasm; | |
use std::env; | |
use std::fmt; | |
use std::rc::Rc; | |
use parity_wasm::elements::Module; | |
use parity_wasm::interpreter::{Error as InterpreterError, HostModule, HostModuleBuilder, | |
ModuleInstance, UserError}; | |
#[derive(Debug)] |
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 parity_wasm; | |
use std::env; | |
use std::fmt; | |
use std::rc::Rc; | |
use parity_wasm::elements::Module; | |
use parity_wasm::interpreter::{Error as InterpreterError, HostModule, HostModuleBuilder, | |
ModuleInstance, UserError}; | |
#[derive(Debug)] |
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 parity_wasm; | |
use std::env; | |
use std::fmt; | |
use std::rc::Rc; | |
use parity_wasm::elements::Module; | |
use parity_wasm::interpreter::{ | |
Error as InterpreterError, HostModule, HostModuleBuilder, | |
ModuleInstance, UserError, HostState, StateKey}; |
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
#![feature(prelude_import)] | |
#![no_std] | |
// Copyright 2017 Parity Technologies (UK) Ltd. | |
// This file is part of Polkadot. | |
// Polkadot is free software: you can redistribute it and/or modify | |
// it under the terms of the GNU General Public License as published by | |
// the Free Software Foundation, either version 3 of the License, or | |
// (at your option) any later version. |
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 Resolver; | |
impl<'a> Data<'a> { | |
fn resolver() -> Resolver { | |
Resolver | |
} | |
} | |
impl ImportResolver for Resolver { | |
fn resolve_func(&self, name: &str, _signature: &FunctionType) -> FuncRef { | |
if name == "add" { |
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
// #![feature(log_syntax)] | |
// #![feature(trace_macros)] | |
// trace_macros!(true); | |
#[derive(Debug, PartialEq, Eq)] | |
pub struct FuncInstance; | |
pub struct MemoryInstance; |
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
/* The Computer Language Benchmarks Game | |
* http://benchmarksgame.alioth.debian.org/ | |
* | |
* contributed by Christoph Bauer | |
* | |
*/ | |
#include <math.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
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
(module | |
(type $0 (func)) | |
(type $1 (func (param i32))) | |
(type $2 (func (param i32 i32) (result i32))) | |
(type $3 (func (param i32 i32 i32 i32) (result i32))) | |
(type $4 (func (result i32))) | |
(import "env" "abort" (func $import$0)) | |
(import "env" "exit" (func $import$1 (param i32))) | |
(table 0 anyfunc) | |
(memory $0 17) |
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
(module | |
(type $FUNCSIG$vi (func (param i32))) | |
(import "env" "exit" (func $exit (param i32))) | |
(table 0 anyfunc) | |
(memory $0 17) | |
(data (i32.const 4) " \00\10\00") | |
(data (i32.const 12) "\00\00\00\00") | |
(export "memory" (memory $0)) | |
(export "f" (func $f)) | |
(export "main" (func $main)) |
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
a; | |
struct b h; | |
struct b { | |
struct { | |
struct { | |
int c | |
} d | |
} e | |
} f(struct b *i) { | |
for (; a < i->e.d.c; a++) { |