Commit 439221f2 authored by qinsoon's avatar qinsoon

seperate crates for ast/utils/gc

parent cf276acb
target/* **/target/*
emit/* emit/*
Cargo.lock Cargo.lock
*.log *.log
......
File added
...@@ -11,17 +11,17 @@ crate-type = ["staticlib", "rlib"] ...@@ -11,17 +11,17 @@ crate-type = ["staticlib", "rlib"]
gcc = "0.3" gcc = "0.3"
[dependencies] [dependencies]
ast = {path = "src/ast"}
utils = {path = "src/utils"}
gc = {path = "src/gc"}
libloading = "0.3" libloading = "0.3"
lazy_static = "0.1.15" lazy_static = "0.1.15"
log = "0.3.5" log = "0.3.5"
simple_logger = "0.4.0" simple_logger = "0.4.0"
nalgebra = "0.8.2" nalgebra = "0.8.2"
linked-hash-map = "0.0.10"
hprof = "0.1.3" hprof = "0.1.3"
memmap = "0.4.0" memmap = "0.4.0"
memsec = "0.1.9" memsec = "0.1.9"
rustc-serialize = "*" rustc-serialize = "*"
time = "0.1.34" time = "0.1.34"
aligned_alloc = "0.1.2" \ No newline at end of file
crossbeam = "0.2.8"
byteorder = "0.5.3"
...@@ -4,7 +4,6 @@ extern crate gcc; ...@@ -4,7 +4,6 @@ extern crate gcc;
#[cfg(target_arch = "x86_64")] #[cfg(target_arch = "x86_64")]
fn main() { fn main() {
gcc::compile_library("libruntime.a", &["src/runtime/runtime_x64_macos.c"]); gcc::compile_library("libruntime.a", &["src/runtime/runtime_x64_macos.c"]);
gcc::compile_library("libgc_clib_x64.a", &["src/runtime/mm/heap/gc/clib_x64.c"]);
gcc::Config::new().flag("-O3") gcc::Config::new().flag("-O3")
.file("src/runtime/swap_stack_x64_macos.s") .file("src/runtime/swap_stack_x64_macos.s")
......
[package]
name = "ast"
version = "0.0.1"
authors = ["qinsoon <qinsoon@gmail.com>"]
[lib]
crate-type = ["rlib"]
[dependencies]
utils = {path = "../utils"}
lazy_static = "0.1.15"
log = "0.3.5"
simple_logger = "0.4.0"
rustc-serialize = "*"
\ No newline at end of file
#[macro_use]
pub mod ir;
pub mod inst;
pub mod types;
pub mod ir_semantics;
pub mod ptr;
pub mod op;
\ No newline at end of file
use ast::ir::*; use ir::*;
use ast::ptr::*; use ptr::*;
use ast::types::*; use types::*;
use ast::op::*; use op::*;
use utils::vec_utils::as_str as vector_as_str;
use utils::vec_utils; use utils::vec_utils;
use std::fmt; use std::fmt;
...@@ -69,7 +69,7 @@ impl fmt::Display for Instruction { ...@@ -69,7 +69,7 @@ impl fmt::Display for Instruction {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let ops = &self.ops.read().unwrap(); let ops = &self.ops.read().unwrap();
if self.value.is_some() { if self.value.is_some() {
write!(f, "{} = {}", vector_as_str(self.value.as_ref().unwrap()), self.v.debug_str(ops)) write!(f, "{} = {}", vec_utils::as_str(self.value.as_ref().unwrap()), self.v.debug_str(ops))
} else { } else {
write!(f, "{}", self.v.debug_str(ops)) write!(f, "{}", self.v.debug_str(ops))
} }
...@@ -434,4 +434,4 @@ impl DestArg { ...@@ -434,4 +434,4 @@ impl DestArg {
&DestArg::Freshbound(n) => format!("${}", n) &DestArg::Freshbound(n) => format!("${}", n)
} }
} }
} }
\ No newline at end of file
use ast::ptr::P; use ptr::P;
use ast::types::*; use types::*;
use ast::inst::*; use inst::*;
use ast::op::*; use op::*;
use utils::vec_utils::as_str as vector_as_str;
use utils::vec_utils; use utils::vec_utils;
use std::collections::HashMap; use std::collections::HashMap;
...@@ -272,8 +272,8 @@ impl ControlFlow { ...@@ -272,8 +272,8 @@ impl ControlFlow {
impl fmt::Display for ControlFlow { impl fmt::Display for ControlFlow {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "preds: [{}], ", vector_as_str(&self.preds)).unwrap(); write!(f, "preds: [{}], ", vec_utils::as_str(&self.preds)).unwrap();
write!(f, "succs: [{}]", vector_as_str(&self.succs)) write!(f, "succs: [{}]", vec_utils::as_str(&self.succs))
} }
} }
...@@ -764,25 +764,6 @@ pub trait MuEntity { ...@@ -764,25 +764,6 @@ pub trait MuEntity {
fn as_entity(&self) -> &MuEntity; fn as_entity(&self) -> &MuEntity;
} }
macro_rules! impl_mu_entity {
($entity: ty) => {
impl MuEntity for $entity {
#[inline(always)]
fn id(&self) -> MuID {self.hdr.id}
#[inline(always)]
fn name(&self) -> Option<MuName> {self.hdr.name()}
fn set_name(&self, name: MuName) {
let mut write_guard = self.hdr.name.write().unwrap();
*write_guard = Some(name);
}
fn as_entity(&self) -> &MuEntity {
let ref_ty : &$entity = self;
ref_ty as &MuEntity
}
}
}
}
impl_mu_entity!(MuFunction); impl_mu_entity!(MuFunction);
impl_mu_entity!(MuFunctionVersion); impl_mu_entity!(MuFunctionVersion);
impl_mu_entity!(Block); impl_mu_entity!(Block);
...@@ -801,4 +782,4 @@ pub fn op_vector_str(vec: &Vec<OpIndex>, ops: &Vec<P<TreeNode>>) -> String { ...@@ -801,4 +782,4 @@ pub fn op_vector_str(vec: &Vec<OpIndex>, ops: &Vec<P<TreeNode>>) -> String {
} }
} }
ret ret
} }
\ No newline at end of file
use ast::inst::*; use inst::*;
use ast::inst::Instruction_::*; use inst::Instruction_::*;
pub fn is_terminal_inst(inst: &Instruction_) -> bool { pub fn is_terminal_inst(inst: &Instruction_) -> bool {
match inst { match inst {
......
#[macro_use]
extern crate log;
extern crate simple_logger;
#[macro_use]
extern crate lazy_static;
extern crate rustc_serialize;
extern crate utils;
#[macro_export]
macro_rules! impl_mu_entity {
($entity: ty) => {
impl MuEntity for $entity {
#[inline(always)]
fn id(&self) -> MuID {self.hdr.id}
#[inline(always)]
fn name(&self) -> Option<MuName> {self.hdr.name()}
fn set_name(&self, name: MuName) {
let mut write_guard = self.hdr.name.write().unwrap();
*write_guard = Some(name);
}
fn as_entity(&self) -> &MuEntity {
let ref_ty : &$entity = self;
ref_ty as &MuEntity
}
}
}
}
macro_rules! select_value {
($cond: expr, $res1 : expr, $res2 : expr) => {
if $cond {
$res1
} else {
$res2
}
}
}
#[macro_use]
pub mod ir;
pub mod inst;
pub mod types;
pub mod ir_semantics;
pub mod ptr;
pub mod op;
\ No newline at end of file
use ast::ptr::P; use ptr::P;
use ast::types::*; use types::*;
use ast::inst::*; use inst::*;
use types::MuType_::*;
#[derive(Copy, Clone, Debug, PartialEq, RustcEncodable, RustcDecodable)] #[derive(Copy, Clone, Debug, PartialEq, RustcEncodable, RustcDecodable)]
pub enum OpCode { pub enum OpCode {
...@@ -55,7 +56,6 @@ pub enum OpCode { ...@@ -55,7 +56,6 @@ pub enum OpCode {
} }
pub fn pick_op_code_for_ssa(ty: &P<MuType>) -> OpCode { pub fn pick_op_code_for_ssa(ty: &P<MuType>) -> OpCode {
use ast::types::MuType_::*;
let a : &MuType = ty; let a : &MuType = ty;
match a.v { match a.v {
// currently use i64 for all ints // currently use i64 for all ints
...@@ -84,7 +84,6 @@ pub fn pick_op_code_for_ssa(ty: &P<MuType>) -> OpCode { ...@@ -84,7 +84,6 @@ pub fn pick_op_code_for_ssa(ty: &P<MuType>) -> OpCode {
} }
pub fn pick_op_code_for_value(ty: &P<MuType>) -> OpCode { pub fn pick_op_code_for_value(ty: &P<MuType>) -> OpCode {
use ast::types::MuType_::*;
let a : &MuType = ty; let a : &MuType = ty;
match a.v { match a.v {
// currently use i64 for all ints // currently use i64 for all ints
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
use std::sync::Arc; use std::sync::Arc;
use ast::ir::MuEntity; use ir::MuEntity;
pub type P<T> = Arc<T>; pub type P<T> = Arc<T>;
//pub struct P<T: MuEntity> { //pub struct P<T: MuEntity> {
......
use ast::ptr::P; use ptr::P;
use ast::ir::*; use ir::*;
use utils::vec_utils::as_str as vector_as_str;
use utils::vec_utils;
use std::fmt; use std::fmt;
use std::collections::HashMap; use std::collections::HashMap;
...@@ -87,7 +88,7 @@ impl fmt::Display for MuType_ { ...@@ -87,7 +88,7 @@ impl fmt::Display for MuType_ {
&MuType_::WeakRef(ref ty) => write!(f, "weakref<{}>", ty), &MuType_::WeakRef(ref ty) => write!(f, "weakref<{}>", ty),
&MuType_::UPtr(ref ty) => write!(f, "uptr<{}>", ty), &MuType_::UPtr(ref ty) => write!(f, "uptr<{}>", ty),
&MuType_::Array(ref ty, size) => write!(f, "array<{} {}>", ty, size), &MuType_::Array(ref ty, size) => write!(f, "array<{} {}>", ty, size),
&MuType_::Hybrid(ref fix_tys, ref var_ty) => write!(f, "hybrid<[{}] {}>", vector_as_str(fix_tys), var_ty), &MuType_::Hybrid(ref fix_tys, ref var_ty) => write!(f, "hybrid<[{}] {}>", vec_utils::as_str(fix_tys), var_ty),
&MuType_::Void => write!(f, "void"), &MuType_::Void => write!(f, "void"),
&MuType_::ThreadRef => write!(f, "threadref"), &MuType_::ThreadRef => write!(f, "threadref"),
&MuType_::StackRef => write!(f, "stackref"), &MuType_::StackRef => write!(f, "stackref"),
...@@ -334,6 +335,6 @@ pub struct MuFuncSig { ...@@ -334,6 +335,6 @@ pub struct MuFuncSig {
impl fmt::Display for MuFuncSig { impl fmt::Display for MuFuncSig {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "[{}] -> [{}]", vector_as_str(&self.ret_tys), vector_as_str(&self.arg_tys)) write!(f, "[{}] -> [{}]", vec_utils::as_str(&self.ret_tys), vec_utils::as_str(&self.arg_tys))
} }
} }
[package]
name = "gc"
version = "0.0.1"
authors = ["qinsoon <qinsoon@gmail.com>"]
build = "build.rs"
[lib]
crate-type = ["rlib"]
[build-dependencies]
gcc = "0.3"
[dependencies]
utils = {path = "../utils"}
lazy_static = "0.1.15"
log = "0.3.5"
simple_logger = "0.4.0"
aligned_alloc = "0.1.2"
crossbeam = "0.2.8"
\ No newline at end of file
extern crate gcc;
#[cfg(target_os = "macos")]
#[cfg(target_arch = "x86_64")]
fn main() {
gcc::compile_library("libgc_clib_x64.a", &["src/heap/gc/clib_x64.c"]);
}
\ No newline at end of file
use runtime::mm::common::LOG_POINTER_SIZE; use utils::LOG_POINTER_SIZE;
use runtime::mm::common::Address; use utils::Address;
use runtime::mm::common::bitmap::Bitmap; use common::bitmap::Bitmap;
#[derive(Clone)] #[derive(Clone)]
pub struct AddressBitmap { pub struct AddressBitmap {
......
use std::mem; use std::mem;
use runtime::mm::common::LOG_POINTER_SIZE; use utils::LOG_POINTER_SIZE;
use runtime::mm::common::Address; use utils::Address;
use runtime::mm::heap::gc::malloc_zero; use heap::gc::malloc_zero;
#[derive(Clone)] #[derive(Clone)]
pub struct AddressMap<T: Copy> { pub struct AddressMap<T: Copy> {
......
use std::mem; use std::mem;
use runtime::mm::heap::gc::malloc_zero; use heap::gc::malloc_zero;
#[derive(Clone)] #[derive(Clone)]
pub struct Bitmap { pub struct Bitmap {
......
mod bitmap;
mod address_bitmap;
mod address_map;
pub use self::address_bitmap::AddressBitmap;
pub use self::address_map::AddressMap;
\ No newline at end of file
use runtime::mm::common::Address; use utils::Address;
use runtime::mm::heap::immix; use heap::immix;
use heap::gc;
extern crate aligned_alloc; use aligned_alloc;
use std::collections::LinkedList; use std::collections::LinkedList;
use std::sync::Arc; use std::sync::Arc;
...@@ -35,7 +35,7 @@ impl FreeListSpace { ...@@ -35,7 +35,7 @@ impl FreeListSpace {
if self.used_bytes + size > self.size { if self.used_bytes + size > self.size {
None None
} else { } else {
let ret = self::aligned_alloc::aligned_alloc(size, align); let ret = aligned_alloc::aligned_alloc(size, align);
let addr = Address::from_ptr::<()>(ret); let addr = Address::from_ptr::<()>(ret);
...@@ -64,7 +64,7 @@ impl FreeListSpace { ...@@ -64,7 +64,7 @@ impl FreeListSpace {
NodeMark::PrevLive | NodeMark::FreshAlloc => { NodeMark::PrevLive | NodeMark::FreshAlloc => {
let ptr = node.start.to_ptr::<()>() as *mut (); let ptr = node.start.to_ptr::<()>() as *mut ();
// free the memory // free the memory
unsafe {self::aligned_alloc::aligned_free(ptr);} unsafe {aligned_alloc::aligned_free(ptr);}
// do not add this node into new linked list // do not add this node into new linked list
} }
} }
...@@ -121,7 +121,6 @@ pub fn alloc_large(size: usize, align: usize, mutator: &mut immix::ImmixMutatorL ...@@ -121,7 +121,6 @@ pub fn alloc_large(size: usize, align: usize, mutator: &mut immix::ImmixMutatorL
return addr; return addr;
}, },
None => { None => {
use runtime::mm::heap::gc;
gc::trigger_gc(); gc::trigger_gc();
} }
} }
......
use runtime::mm::heap::immix::MUTATORS; use heap::immix::MUTATORS;
use runtime::mm::heap::immix::N_MUTATORS; use heap::immix::N_MUTATORS;
use runtime::mm::heap::immix::ImmixMutatorLocal; use heap::immix::ImmixMutatorLocal;
use runtime::mm::heap::immix::ImmixSpace; use heap::immix::ImmixSpace;
use runtime::mm::heap::immix::ImmixLineMarkTable; use heap::immix::ImmixLineMarkTable;
use runtime::mm::heap::freelist::FreeListSpace; use heap::freelist::FreeListSpace;
use runtime::mm::objectmodel; use objectmodel;
use runtime::mm::common; use common::AddressMap;
use runtime::mm::common::{Address, ObjectReference}; use utils::{Address, ObjectReference};
use runtime::mm::common::AddressMap; use utils::POINTER_SIZE;
use utils::bit_utils;
use std::sync::atomic::{AtomicIsize, Ordering}; use std::sync::atomic::{AtomicIsize, Ordering};
use std::sync::{Arc, Mutex, Condvar, RwLock}; use std::sync::{Arc, Mutex, Condvar, RwLock};
extern crate crossbeam;
#[cfg(feature = "mt-trace")] #[cfg(feature = "mt-trace")]
use self::crossbeam::sync::chase_lev::*; use crossbeam::sync::chase_lev::*;
#[cfg(feature = "mt-trace")] #[cfg(feature = "mt-trace")]
use std::sync::mpsc; use std::sync::mpsc;
#[cfg(feature = "mt-trace")] #[cfg(feature = "mt-trace")]
...@@ -89,7 +88,7 @@ pub fn is_valid_object(addr: Address, start: Address, end: Address, live_map: &A ...@@ -89,7 +88,7 @@ pub fn is_valid_object(addr: Address, start: Address, end: Address, live_map: &A
return false; return false;
} }
common::test_nth_bit(live_map.get(addr), objectmodel::OBJ_START_BIT) bit_utils::test_nth_bit(live_map.get(addr), objectmodel::OBJ_START_BIT)
} }
pub fn stack_scan() -> Vec<ObjectReference> { pub fn stack_scan() -> Vec<ObjectReference> {
...@@ -109,7 +108,7 @@ pub fn stack_scan() -> Vec<ObjectReference> { ...@@ -109,7 +108,7 @@ pub fn stack_scan() -> Vec<ObjectReference> {
ret.push(unsafe {value.to_object_reference()}); ret.push(unsafe {value.to_object_reference()});
} }
cursor = cursor.plus(common::POINTER_SIZE); cursor = cursor.plus(POINTER_SIZE);
} }
let roots_from_stack = ret.len(); let roots_from_stack = ret.len();
...@@ -298,7 +297,6 @@ pub fn start_trace(work_stack: &mut Vec<ObjectReference>, immix_space: Arc<Immix ...@@ -298,7 +297,6 @@ pub fn start_trace(work_stack: &mut Vec<ObjectReference>, immix_space: Arc<Immix
#[inline(never)] #[inline(never)]
#[cfg(not(feature = "mt-trace"))] #[cfg(not(feature = "mt-trace"))]
pub fn start_trace(local_queue: &mut Vec<ObjectReference>, immix_space: Arc<ImmixSpace>, lo_space: Arc<RwLock<FreeListSpace>>) { pub fn start_trace(local_queue: &mut Vec<ObjectReference>, immix_space: Arc<ImmixSpace>, lo_space: Arc<RwLock<FreeListSpace>>) {
use runtime::mm::objectmodel;
let mark_state = objectmodel::MARK_STATE.load(Ordering::SeqCst) as u8; let mark_state = objectmodel::MARK_STATE.load(Ordering::SeqCst) as u8;
while !local_queue.is_empty() { while !local_queue.is_empty() {
...@@ -401,8 +399,6 @@ pub fn steal_process_edge(addr: Address, local_queue:&mut Vec<ObjectReference>, ...@@ -401,8 +399,6 @@ pub fn steal_process_edge(addr: Address, local_queue:&mut Vec<ObjectReference>,
#[inline(always)] #[inline(always)]
pub fn trace_object(obj: ObjectReference, local_queue: &mut Vec<ObjectReference>, alloc_map: *mut u8, trace_map: *mut u8, line_mark_table: &ImmixLineMarkTable, immix_start: Address, immix_end: Address, mark_state: u8) { pub fn trace_object(obj: ObjectReference, local_queue: &mut Vec<ObjectReference>, alloc_map: *mut u8, trace_map: *mut u8, line_mark_table: &ImmixLineMarkTable, immix_start: Address, immix_end: Address, mark_state: u8) {
use runtime::mm::objectmodel;
objectmodel::mark_as_traced(trace_map, immix_start, obj, mark_state); objectmodel::mark_as_traced(trace_map, immix_start, obj, mark_state);
let addr = obj.to_address(); let addr = obj.to_address();
...@@ -416,7 +412,7 @@ pub fn trace_object(obj: ObjectReference, local_queue: &mut Vec<ObjectReference> ...@@ -416,7 +412,7 @@ pub fn trace_object(obj: ObjectReference, local_queue: &mut Vec<ObjectReference>
let mut base = addr; let mut base = addr;
loop { loop {
let value = objectmodel::get_ref_byte(alloc_map, immix_start, obj); let value = objectmodel::get_ref_byte(alloc_map, immix_start, obj);
let (ref_bits, short_encode) = (common::lower_bits(value, objectmodel::REF_BITS_LEN), common::test_nth_bit(value, objectmodel::SHORT_ENCODE_BIT)); let (ref_bits, short_encode) = (bit_utils::lower_bits(value, objectmodel::REF_BITS_LEN), bit_utils::test_nth_bit(value, objectmodel::SHORT_ENCODE_BIT));
match ref_bits { match ref_bits {
0b0000_0001 => { 0b0000_0001 => {
...@@ -448,8 +444,6 @@ pub fn trace_object(obj: ObjectReference, local_queue: &mut Vec<ObjectReference> ...@@ -448,8 +444,6 @@ pub fn trace_object(obj: ObjectReference, local_queue: &mut Vec<ObjectReference>
#[inline(always)] #[inline(always)]
pub fn process_edge(addr: Address, local_queue:&mut Vec<ObjectReference>, trace_map: *mut u8, space_start: Address, mark_state: u8) { pub fn process_edge(addr: Address, local_queue:&mut Vec<ObjectReference>, trace_map: *mut u8, space_start: Address, mark_state: u8) {
use runtime::mm::objectmodel;
let obj_addr : ObjectReference = unsafe{addr.load()}; let obj_addr : ObjectReference = unsafe{addr.load()};
if !obj_addr.to_address().is_zero() && !objectmodel::is_traced(trace_map, space_start, obj_addr, mark_state) { if !obj_addr.to_address().is_zero() && !objectmodel::is_traced(trace_map, space_start, obj_addr, mark_state) {
......
use runtime::mm::heap::immix; use heap::immix;
use runtime::mm::heap::immix::ImmixSpace; use heap::immix::ImmixSpace;
use runtime::mm::heap::immix::immix_space::ImmixBlock; use heap::immix::immix_space::ImmixBlock;
use runtime::mm::heap::gc; use heap::gc;
use runtime::mm::common::LOG_POINTER_SIZE; use utils::LOG_POINTER_SIZE;
use runtime::mm::common::Address; use utils::Address;
use std::*; use std::*;
use std::sync::Arc; use std::sync::Arc;
......
use runtime::mm::heap::immix; use heap::immix;
use runtime::mm::heap::gc; use heap::gc;
use runtime::mm::common::Address; use utils::Address;
use runtime::mm::common::AddressMap; use common::AddressMap;
use runtime::mm::heap::gc::malloc_zero; use heap::gc::malloc_zero;
extern crate std; use utils::mem::memmap;
extern crate memmap;
use std::*; use std::*;
use std::collections::LinkedList; use std::collections::LinkedList;
...@@ -267,7 +266,7 @@ impl ImmixSpace { ...@@ -267,7 +266,7 @@ impl ImmixSpace {
if full_blocks == self.total_blocks { if full_blocks == self.total_blocks {
println!("Out of memory in Immix Space"); println!("Out of memory in Immix Space");
std::process::exit(1); process::exit(1);
} }
debug_assert!(full_blocks + usable_blocks == self.total_blocks); debug_assert!(full_blocks + usable_blocks == self.total_blocks);
......
use runtime::mm::common::Address; use utils::Address;
use std::sync::atomic::AtomicUsize; use std::sync::atomic::AtomicUsize;
pub mod immix; pub mod immix;
......
extern crate utils;
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate log;
extern crate simple_logger;
extern crate aligned_alloc;
extern crate crossbeam;
use std::sync::atomic::Ordering; use std::sync::atomic::Ordering;
pub mod common; pub mod common;
pub mod objectmodel; pub mod objectmodel;
pub mod heap; pub mod heap;
pub use runtime::mm::heap::immix::ImmixMutatorLocal as Mutator; pub use heap::immix::ImmixMutatorLocal as Mutator;
use runtime::mm::common::ObjectReference; use utils::ObjectReference;
use runtime::mm::heap::immix::ImmixSpace; use heap::immix::ImmixSpace;
use runtime::mm::heap::immix::ImmixMutatorLocal; use heap::immix::ImmixMutatorLocal;
use runtime::mm::heap::freelist; use heap::freelist;
use runtime::mm::heap::freelist::FreeListSpace; use heap::freelist::FreeListSpace;
use std::fmt; use std::fmt;
use std::sync::Arc; use std::sync::Arc;
......
use std::sync::atomic; use std::sync::atomic;
pub static MARK_STATE : atomic::AtomicUsize = atomic::ATOMIC_USIZE_INIT; pub static MARK_STATE : atomic::AtomicUsize = atomic::ATOMIC_USIZE_INIT;
use runtime::mm::common::ObjectReference; use utils::{Address, ObjectReference};
use runtime::mm::common::Address; use utils::LOG_POINTER_SIZE;
use runtime::mm::common::LOG_POINTER_SIZE;