Cleared some warnings

parent adc531da
Pipeline #3541 failed with stages
in 1 minute and 44 seconds
...@@ -24,7 +24,7 @@ use std; ...@@ -24,7 +24,7 @@ use std;
use std::fmt; use std::fmt;
pub use std::sync::Arc; pub use std::sync::Arc;
use std::default; use std::default;
use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; use std::sync::atomic::{AtomicUsize, Ordering};
pub type WPID = usize; pub type WPID = usize;
pub type MuID = usize; pub type MuID = usize;
...@@ -44,12 +44,12 @@ pub type OpIndex = usize; ...@@ -44,12 +44,12 @@ pub type OpIndex = usize;
lazy_static! { lazy_static! {
pub static ref MACHINE_ID : AtomicUsize = { pub static ref MACHINE_ID : AtomicUsize = {
let a = ATOMIC_USIZE_INIT; let a = AtomicUsize::new(0);
a.store(MACHINE_ID_START, Ordering::SeqCst); a.store(MACHINE_ID_START, Ordering::SeqCst);
a a
}; };
pub static ref INTERNAL_ID : AtomicUsize = { pub static ref INTERNAL_ID : AtomicUsize = {
let a = ATOMIC_USIZE_INIT; let a = AtomicUsize::new(0);
a.store(INTERNAL_ID_START, Ordering::SeqCst); a.store(INTERNAL_ID_START, Ordering::SeqCst);
a a
}; };
...@@ -1210,7 +1210,7 @@ impl SSAVarEntry { ...@@ -1210,7 +1210,7 @@ impl SSAVarEntry {
pub fn new(val: P<Value>) -> SSAVarEntry { pub fn new(val: P<Value>) -> SSAVarEntry {
let ret = SSAVarEntry { let ret = SSAVarEntry {
val: val, val: val,
use_count: ATOMIC_USIZE_INIT, use_count: AtomicUsize::new(0),
expr: None, expr: None,
split: None, split: None,
def: None def: None
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
use heap::*; use heap::*;
use objectmodel::*; use objectmodel::*;
use MY_GC; use MY_GC;
use std::sync::atomic::{AtomicIsize, AtomicBool, Ordering}; use std::sync::atomic::{AtomicIsize, AtomicUsize, AtomicBool, Ordering};
use std::sync::{Arc, Mutex, Condvar, RwLock}; use std::sync::{Arc, Mutex, Condvar, RwLock};
use crossbeam::sync::chase_lev::*; use crossbeam::sync::chase_lev::*;
...@@ -33,9 +33,9 @@ lazy_static! { ...@@ -33,9 +33,9 @@ lazy_static! {
static ref ROOTS : RwLock<Vec<ObjectReference>> = RwLock::new(vec![]); static ref ROOTS : RwLock<Vec<ObjectReference>> = RwLock::new(vec![]);
} }
pub static ENABLE_GC: AtomicBool = atomic::ATOMIC_BOOL_INIT; pub static ENABLE_GC: AtomicBool = AtomicBool::new(false);
static CONTROLLER: AtomicIsize = atomic::ATOMIC_ISIZE_INIT; static CONTROLLER: AtomicIsize = AtomicIsize::new(0);
const NO_CONTROLLER: isize = -1; const NO_CONTROLLER: isize = -1;
pub fn init(n_gcthreads: usize) { pub fn init(n_gcthreads: usize) {
...@@ -228,7 +228,7 @@ fn block_current_thread(mutator: &mut Mutator) { ...@@ -228,7 +228,7 @@ fn block_current_thread(mutator: &mut Mutator) {
trace!("Mutator{} unblocked", mutator.id()); trace!("Mutator{} unblocked", mutator.id());
} }
pub static GC_COUNT: atomic::AtomicUsize = atomic::ATOMIC_USIZE_INIT; pub static GC_COUNT: atomic::AtomicUsize = AtomicUsize::new(0);
fn gc() { fn gc() {
if !ENABLE_GC.load(Ordering::SeqCst) { if !ENABLE_GC.load(Ordering::SeqCst) {
...@@ -286,7 +286,7 @@ fn gc() { ...@@ -286,7 +286,7 @@ fn gc() {
} }
pub const PUSH_BACK_THRESHOLD: usize = 50; pub const PUSH_BACK_THRESHOLD: usize = 50;
pub static GC_THREADS: atomic::AtomicUsize = atomic::ATOMIC_USIZE_INIT; pub static GC_THREADS: atomic::AtomicUsize = AtomicUsize::new(0);
const TRACE_GC: bool = true; const TRACE_GC: bool = true;
...@@ -406,16 +406,18 @@ pub fn steal_trace_object( ...@@ -406,16 +406,18 @@ pub fn steal_trace_object(
}; };
// mark as traced // mark as traced
hdr.gc_byte = 1; hdr.gc_byte = 1;
match hdr.encode { unsafe {
ObjectEncode::Tiny(ref enc) => trace_tiny_object(obj, enc, local_queue, job_sender), match hdr.encode {
ObjectEncode::Small(ref enc) => { ObjectEncode::Tiny(ref enc) => trace_tiny_object(obj, enc, local_queue, job_sender),
trace_small_object(obj, enc, local_queue, job_sender) ObjectEncode::Small(ref enc) => {
} trace_small_object(obj, enc, local_queue, job_sender)
ObjectEncode::Medium(ref enc) => { }
trace_medium_object(obj, enc, local_queue, job_sender) ObjectEncode::Medium(ref enc) => {
} trace_medium_object(obj, enc, local_queue, job_sender)
ObjectEncode::Large(ref enc) => { }
trace_large_object(obj, enc, local_queue, job_sender) ObjectEncode::Large(ref enc) => {
trace_large_object(obj, enc, local_queue, job_sender)
}
} }
} }
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
// limitations under the License. // limitations under the License.
use std::sync::RwLock; use std::sync::RwLock;
use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; use std::sync::atomic::{AtomicUsize, Ordering};
use std::collections::HashMap; use std::collections::HashMap;
use std::mem; use std::mem;
use utils::mem::*; use utils::mem::*;
...@@ -48,9 +48,9 @@ const LARGE_ENTRY_CAP: usize = N_TYPES; ...@@ -48,9 +48,9 @@ const LARGE_ENTRY_CAP: usize = N_TYPES;
const FULL_ENTRY_START: usize = LARGE_ENTRY_CAP + 1; const FULL_ENTRY_START: usize = LARGE_ENTRY_CAP + 1;
/// storing a pointer to the actual type table /// storing a pointer to the actual type table
static GLOBAL_TYPE_TABLE_PTR: AtomicUsize = ATOMIC_USIZE_INIT; static GLOBAL_TYPE_TABLE_PTR: AtomicUsize = AtomicUsize::new(0);
/// storing a pointer to the metadata of the type table /// storing a pointer to the metadata of the type table
static GLOBAL_TYPE_TABLE_META: AtomicUsize = ATOMIC_USIZE_INIT; static GLOBAL_TYPE_TABLE_META: AtomicUsize = AtomicUsize::new(0);
impl GlobalTypeTable { impl GlobalTypeTable {
pub fn init() { pub fn init() {
......
...@@ -75,42 +75,42 @@ impl MuCtx { ...@@ -75,42 +75,42 @@ impl MuCtx {
pub fn handle_from_sint8(&mut self, num: i8, len: c_int) -> *const APIHandle { pub fn handle_from_sint8(&mut self, num: i8, len: c_int) -> *const APIHandle {
trace!("handle_from_sint8"); trace!("handle_from_sint8");
prepare_handle((self.get_mvm().vm.handle_from_sint8(num, len as usize))) prepare_handle(self.get_mvm().vm.handle_from_sint8(num, len as usize))
} }
pub fn handle_from_uint8(&mut self, num: u8, len: c_int) -> *const APIHandle { pub fn handle_from_uint8(&mut self, num: u8, len: c_int) -> *const APIHandle {
trace!("handle_from_uint8"); trace!("handle_from_uint8");
prepare_handle((self.get_mvm().vm.handle_from_uint8(num, len as usize))) prepare_handle(self.get_mvm().vm.handle_from_uint8(num, len as usize))
} }
pub fn handle_from_sint16(&mut self, num: i16, len: c_int) -> *const APIHandle { pub fn handle_from_sint16(&mut self, num: i16, len: c_int) -> *const APIHandle {
trace!("handle_from_sint16"); trace!("handle_from_sint16");
prepare_handle((self.get_mvm().vm.handle_from_sint16(num, len as usize))) prepare_handle(self.get_mvm().vm.handle_from_sint16(num, len as usize))
} }
pub fn handle_from_uint16(&mut self, num: u16, len: c_int) -> *const APIHandle { pub fn handle_from_uint16(&mut self, num: u16, len: c_int) -> *const APIHandle {
trace!("handle_from_uint16"); trace!("handle_from_uint16");
prepare_handle((self.get_mvm().vm.handle_from_uint16(num, len as usize))) prepare_handle(self.get_mvm().vm.handle_from_uint16(num, len as usize))
} }
pub fn handle_from_sint32(&mut self, num: i32, len: c_int) -> *const APIHandle { pub fn handle_from_sint32(&mut self, num: i32, len: c_int) -> *const APIHandle {
trace!("handle_from_sint32"); trace!("handle_from_sint32");
prepare_handle((self.get_mvm().vm.handle_from_sint32(num, len as usize))) prepare_handle(self.get_mvm().vm.handle_from_sint32(num, len as usize))
} }
pub fn handle_from_uint32(&mut self, num: u32, len: c_int) -> *const APIHandle { pub fn handle_from_uint32(&mut self, num: u32, len: c_int) -> *const APIHandle {
trace!("handle_from_uint32"); trace!("handle_from_uint32");
prepare_handle((self.get_mvm().vm.handle_from_uint32(num, len as usize))) prepare_handle(self.get_mvm().vm.handle_from_uint32(num, len as usize))
} }
pub fn handle_from_sint64(&mut self, num: i64, len: c_int) -> *const APIHandle { pub fn handle_from_sint64(&mut self, num: i64, len: c_int) -> *const APIHandle {
trace!("handle_from_sint64"); trace!("handle_from_sint64");
prepare_handle((self.get_mvm().vm.handle_from_sint64(num, len as usize))) prepare_handle(self.get_mvm().vm.handle_from_sint64(num, len as usize))
} }
pub fn handle_from_uint64(&mut self, num: u64, len: c_int) -> *const APIHandle { pub fn handle_from_uint64(&mut self, num: u64, len: c_int) -> *const APIHandle {
trace!("handle_from_uint64"); trace!("handle_from_uint64");
prepare_handle((self.get_mvm().vm.handle_from_uint64(num, len as usize))) prepare_handle(self.get_mvm().vm.handle_from_uint64(num, len as usize))
} }
pub fn handle_from_uint64s(&mut self, nums: &[u64], len: c_int) -> *const APIHandle { pub fn handle_from_uint64s(&mut self, nums: &[u64], len: c_int) -> *const APIHandle {
...@@ -120,26 +120,26 @@ impl MuCtx { ...@@ -120,26 +120,26 @@ impl MuCtx {
pub fn handle_from_float(&mut self, num: f32) -> *const APIHandle { pub fn handle_from_float(&mut self, num: f32) -> *const APIHandle {
trace!("handle_from_float"); trace!("handle_from_float");
prepare_handle((self.get_mvm().vm.handle_from_float(num))) prepare_handle(self.get_mvm().vm.handle_from_float(num))
} }
pub fn handle_from_double(&mut self, num: f64) -> *const APIHandle { pub fn handle_from_double(&mut self, num: f64) -> *const APIHandle {
trace!("handle_from_double"); trace!("handle_from_double");
prepare_handle((self.get_mvm().vm.handle_from_double(num))) prepare_handle(self.get_mvm().vm.handle_from_double(num))
} }
pub fn handle_from_ptr(&mut self, mu_type: MuID, ptr: CMuCPtr) -> *const APIHandle { pub fn handle_from_ptr(&mut self, mu_type: MuID, ptr: CMuCPtr) -> *const APIHandle {
trace!("handle_from_ptr: ty#{}, {:?}", mu_type, ptr); trace!("handle_from_ptr: ty#{}, {:?}", mu_type, ptr);
let addr = Address::from_mut_ptr(ptr); let addr = Address::from_mut_ptr(ptr);
prepare_handle((self.get_mvm().vm.handle_from_uptr(mu_type, addr))) prepare_handle(self.get_mvm().vm.handle_from_uptr(mu_type, addr))
} }
pub fn handle_from_fp(&mut self, mu_type: MuID, fp: CMuCFP) -> *const APIHandle { pub fn handle_from_fp(&mut self, mu_type: MuID, fp: CMuCFP) -> *const APIHandle {
trace!("handle_from_fp: ty#{}, {:?}", mu_type, fp); trace!("handle_from_fp: ty#{}, {:?}", mu_type, fp);
let addr = Address::from_mut_ptr(fp); let addr = Address::from_mut_ptr(fp);
prepare_handle((self.get_mvm().vm.handle_from_ufp(mu_type, addr))) prepare_handle(self.get_mvm().vm.handle_from_ufp(mu_type, addr))
} }
pub fn handle_to_sint8(&mut self, opnd: &APIHandle) -> i8 { pub fn handle_to_sint8(&mut self, opnd: &APIHandle) -> i8 {
......
...@@ -41,7 +41,7 @@ use std::sync::Arc; ...@@ -41,7 +41,7 @@ use std::sync::Arc;
use std::sync::RwLock; use std::sync::RwLock;
use std::sync::Mutex; use std::sync::Mutex;
use std::sync::RwLockWriteGuard; use std::sync::RwLockWriteGuard;
use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; use std::sync::atomic::{AtomicUsize, Ordering};
use std::thread::JoinHandle; use std::thread::JoinHandle;
use std::collections::LinkedList; use std::collections::LinkedList;
use std; use std;
...@@ -231,7 +231,7 @@ impl<'a> VM { ...@@ -231,7 +231,7 @@ impl<'a> VM {
VM::start_logging(options.flag_log_level); VM::start_logging(options.flag_log_level);
let ret = VM { let ret = VM {
next_id: ATOMIC_USIZE_INIT, next_id: AtomicUsize::new(0),
vm_options: options, vm_options: options,
id_name_map: RwLock::new(HashMap::new()), id_name_map: RwLock::new(HashMap::new()),
name_id_map: RwLock::new(HashMap::new()), name_id_map: RwLock::new(HashMap::new()),
...@@ -251,7 +251,7 @@ impl<'a> VM { ...@@ -251,7 +251,7 @@ impl<'a> VM {
aot_pending_funcref_store: RwLock::new(HashMap::new()), aot_pending_funcref_store: RwLock::new(HashMap::new()),
compiled_callsite_table: RwLock::new(HashMap::new()), compiled_callsite_table: RwLock::new(HashMap::new()),
primordial_threadlocal: RwLock::new(None), primordial_threadlocal: RwLock::new(None),
callsite_count: ATOMIC_USIZE_INIT, callsite_count: AtomicUsize::new(0),
pending_joins: Mutex::new(LinkedList::new()) pending_joins: Mutex::new(LinkedList::new())
}; };
...@@ -282,7 +282,7 @@ impl<'a> VM { ...@@ -282,7 +282,7 @@ impl<'a> VM {
VM::start_logging(options.flag_log_level); VM::start_logging(options.flag_log_level);
let mut ret = VM { let mut ret = VM {
next_id: ATOMIC_USIZE_INIT, next_id: AtomicUsize::new(0),
vm_options: options, vm_options: options,
id_name_map: RwLock::new(HashMap::new()), id_name_map: RwLock::new(HashMap::new()),
name_id_map: RwLock::new(HashMap::new()), name_id_map: RwLock::new(HashMap::new()),
...@@ -299,7 +299,7 @@ impl<'a> VM { ...@@ -299,7 +299,7 @@ impl<'a> VM {
primordial: RwLock::new(None), primordial: RwLock::new(None),
aot_pending_funcref_store: RwLock::new(HashMap::new()), aot_pending_funcref_store: RwLock::new(HashMap::new()),
compiled_callsite_table: RwLock::new(HashMap::new()), compiled_callsite_table: RwLock::new(HashMap::new()),
callsite_count: ATOMIC_USIZE_INIT callsite_count: AtomicUsize::new(0)
}; };
// currently, the default sizes don't work on sel4-rumprun platform // currently, the default sizes don't work on sel4-rumprun platform
...@@ -1875,7 +1875,7 @@ impl<'a> VM { ...@@ -1875,7 +1875,7 @@ impl<'a> VM {
id: handle_id, id: handle_id,
v: APIHandleValue::Ref(types::REF_VOID_TYPE.clone(), unsafe { v: APIHandleValue::Ref(types::REF_VOID_TYPE.clone(), unsafe {
Address::from_usize( Address::from_usize(
((opnd & 0x7ffffffffff8u64) | u64_asr((opnd & 0x8000000000000000u64), 16)) as ((opnd & 0x7ffffffffff8u64) | u64_asr(opnd & 0x8000000000000000u64, 16)) as
usize usize
) )
}) })
...@@ -1889,7 +1889,7 @@ impl<'a> VM { ...@@ -1889,7 +1889,7 @@ impl<'a> VM {
self.new_handle(APIHandle { self.new_handle(APIHandle {
id: handle_id, id: handle_id,
v: APIHandleValue::Int( v: APIHandleValue::Int(
u64_asr((opnd & 0x000f800000000000u64), 46) | (u64_asr((opnd & 0x4), 2)), u64_asr(opnd & 0x000f800000000000u64, 46) | (u64_asr(opnd & 0x4, 2)),
6 6
) )
}) })
......
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