#![crate_name = "jit"]
#![allow(raw_pointer_derive, non_camel_case_types, non_upper_case_globals)]
#![deny(unused_attributes, dead_code, unused_parens, unknown_lints, unreachable_code, unused_allocation, unused_allocation, unused_must_use)]
#![feature(alloc, core, plugin, unboxed_closures, optin_builtin_traits, associated_consts)]
#![plugin(rustc_bitflags)]
#[no_link] #[macro_use]
extern crate rustc_bitflags;
extern crate alloc;
extern crate libc;
extern crate libjit_sys as raw;
use raw::*;
use libc::c_void;
use std::mem;
pub use compile::Compile;
pub use context::Context;
pub use elf::*;
pub use function::{flags, Abi, UncompiledFunction, Func, CompiledFunction};
pub use function::flags::CallFlags;
pub use label::Label;
pub use insn::{Block, Instruction, InstructionIter};
pub use types::kind::TypeKind;
pub use types::{kind, get, Type, Field, Fields, Params, CowType, StaticType, Ty, TaggedType};
pub use types::consts as typecs;
pub use value::Val;
extern fn free_data<T>(data: *mut c_void) {
unsafe {
let actual_data:Box<T> = mem::transmute(data);
mem::drop(actual_data);
}
}
#[inline]
pub fn init() -> () {
unsafe {
jit_init()
}
}
#[inline]
pub fn uses_interpreter() -> bool {
unsafe {
jit_uses_interpreter() != 0
}
}
#[inline]
pub fn supports_threads() -> bool {
unsafe {
jit_supports_threads() != 0
}
}
#[inline]
pub fn supports_virtual_memory() -> bool {
unsafe {
jit_supports_virtual_memory() != 0
}
}
#[macro_use]
mod macros;
mod context;
mod compile;
mod elf;
mod function;
mod insn;
mod label;
mod types;
mod util;
mod value;