Commit 84e5d475 authored by qinsoon's avatar qinsoon

VM Options

parent 89ad018a
#![allow(unused_variables)]
use compiler::backend;
use compiler::backend::ByteSize;
use utils::ByteSize;
use compiler::backend::x86_64;
use compiler::backend::x86_64::CodeGenerator;
use vm::machine_code::MachineCode;
use vm::context::VMContext;
use vm::MachineCode;
use vm::VMContext;
use utils::string_utils;
......
......@@ -2,7 +2,7 @@ use ast::ptr::P;
use ast::ir::*;
use ast::inst::*;
use vm::machine_code::MachineCode;
use vm::MachineCode;
pub trait CodeGenerator {
fn start_code(&mut self, func_name: MuTag);
......
......@@ -8,8 +8,8 @@ use ast::inst::MemoryOrder;
use ast::op;
use ast::types;
use ast::types::MuType_;
use vm::context::VMContext;
use vm::machine_code::CompiledFunction;
use vm::VMContext;
use vm::CompiledFunction;
use compiler::CompilerPass;
use compiler::backend::x86_64;
......
......@@ -2,7 +2,7 @@
use compiler::CompilerPass;
use ast::ir::*;
use vm::context::VMContext;
use vm::VMContext;
use compiler::backend::emit_code;
pub struct CodeEmission {
......
......@@ -3,7 +3,7 @@ pub mod reg_alloc;
pub mod peephole_opt;
pub mod code_emission;
pub type ByteSize = usize;
use utils::ByteSize;
// X86_64
......@@ -39,7 +39,7 @@ mod arm;
// common data structure with target specific info
use vm::context::VMContext;
use vm::VMContext;
use ast::types::*;
use ast::ptr::*;
pub fn resolve_backend_type_info (ty: &MuType, vm: &VMContext) -> BackendTypeInfo {
......
use compiler::CompilerPass;
use ast::ir::*;
use vm::context::VMContext;
use vm::machine_code::CompiledFunction;
use vm::VMContext;
use vm::CompiledFunction;
pub struct PeepholeOptimization {
name: &'static str
......
extern crate nalgebra;
use vm::machine_code::CompiledFunction;
use vm::machine_code::MachineCode;
use vm::CompiledFunction;
use vm::MachineCode;
use ast::ir::*;
use ast::types;
use compiler::backend;
......
......@@ -4,7 +4,7 @@ use compiler::CompilerPass;
use compiler::PassExecutionResult;
use compiler;
use ast::ir::*;
use vm::context::VMContext;
use vm::VMContext;
use compiler::backend::init_machine_regs_for_func;
......
extern crate hprof;
use ast::ir::*;
use vm::context::VMContext;
use vm::VMContext;
use std::cell::RefCell;
use std::sync::Arc;
......
use ast::ir::*;
use ast::inst::Instruction_::*;
use utils::vec_utils::as_str as vector_as_str;
use vm::context::VMContext;
use vm::VMContext;
use compiler::CompilerPass;
......
use ast::ir::*;
use ast::ptr::*;
use vm::context::VMContext;
use vm::VMContext;
use compiler::CompilerPass;
......
use ast::ir::*;
use vm::context::VMContext;
use vm::VMContext;
mod def_use;
mod tree_gen;
......
use ast::ir::*;
use vm::context::VMContext;
use vm::VMContext;
use compiler::CompilerPass;
pub struct TraceGen {
......
......@@ -2,7 +2,7 @@ use ast::ir::*;
use ast::inst::*;
use ast::ir_semantics::*;
use vm::context::VMContext;
use vm::VMContext;
use compiler::CompilerPass;
use compiler::PassExecutionResult;
......
#![allow(dead_code)]
pub type ByteSize = usize;
mod linked_hashset;
pub use utils::linked_hashset::LinkedHashSet;
pub use utils::linked_hashset::LinkedHashMap;
......
extern crate immix_rust as gc;
use std::collections::HashMap;
use ast::ptr::P;
......@@ -6,6 +8,7 @@ use ast::types::*;
use compiler::backend;
use compiler::backend::BackendTypeInfo;
use vm::machine_code::CompiledFunction;
use vm::vm_options::VMOptions;
use std::sync::RwLock;
use std::cell::RefCell;
......@@ -51,6 +54,9 @@ impl <'a> VMContext {
ret.is_running.store(false, Ordering::SeqCst);
ret.next_id.store(RESERVED_NODE_IDS_FOR_MACHINE, Ordering::SeqCst);
let options = VMOptions::default();
gc::gc_init(options.immix_size, options.lo_size, options.n_gcthreads);
ret
}
......
pub mod context;
mod context;
mod vm_options;
mod machine_code;
pub mod machine_code;
pub use vm::context::VMContext;
pub use vm::vm_options::VMOptions;
pub use vm::machine_code::CompiledFunction;
pub use vm::machine_code::MachineCode;
\ No newline at end of file
use std::default::Default;
use utils::ByteSize;
pub struct VMOptions {
// gc options
pub immix_size: ByteSize,
pub lo_size: ByteSize,
pub n_gcthreads: usize
}
pub const DEFAULT_IMMIX_SIZE : ByteSize = 1 << 16; // 64Mb
pub const DEFAULT_LO_SIZE : ByteSize = 1 << 16; // 64Mb
pub const DEFAULT_N_GCTHREADS: usize = 8;
impl Default for VMOptions {
fn default() -> VMOptions {
VMOptions {
immix_size: DEFAULT_IMMIX_SIZE,
lo_size: DEFAULT_LO_SIZE,
n_gcthreads: DEFAULT_N_GCTHREADS
}
}
}
\ No newline at end of file
......@@ -5,7 +5,7 @@ use self::mu::ast::ir::*;
use self::mu::ast::inst::*;
use self::mu::ast::ptr::*;
use self::mu::ast::op::*;
use self::mu::vm::context::*;
use self::mu::vm::*;
use std::cell::RefCell;
use std::collections::HashMap;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment