GitLab will be upgraded to the 12.10.14-ce.0 on 28 Sept 2020 at 2.00pm (AEDT) to 2.30pm (AEDT). During the update, GitLab and Mattermost services will not be available. If you have any concerns with this, please talk to us at N110 (b) CSIT building.

Commit 226a7b25 authored by qinsoon's avatar qinsoon

do not serialize function versions. do not print stack trace during

unwinding
parent 3a67a193
...@@ -5,6 +5,7 @@ use utils::Address; ...@@ -5,6 +5,7 @@ use utils::Address;
use utils::Word; use utils::Word;
use utils::POINTER_SIZE; use utils::POINTER_SIZE;
use runtime::thread; use runtime::thread;
use runtime::PRINT_BACKTRACE;
use std::sync::RwLock; use std::sync::RwLock;
use std::sync::RwLockReadGuard; use std::sync::RwLockReadGuard;
...@@ -99,7 +100,9 @@ pub extern fn throw_exception_internal(exception_obj: Address, last_frame_callee ...@@ -99,7 +100,9 @@ pub extern fn throw_exception_internal(exception_obj: Address, last_frame_callee
} }
}; };
print_backtrace(throw_frame_callsite, cursor.clone()); if PRINT_BACKTRACE {
print_backtrace(throw_frame_callsite, cursor.clone());
}
let mut callsite = rust_frame_return_addr; let mut callsite = rust_frame_return_addr;
......
...@@ -5,6 +5,7 @@ use utils::Address; ...@@ -5,6 +5,7 @@ use utils::Address;
use utils::Word; use utils::Word;
use utils::POINTER_SIZE; use utils::POINTER_SIZE;
use runtime::thread; use runtime::thread;
use runtime::PRINT_BACKTRACE;
use std::sync::RwLock; use std::sync::RwLock;
use std::sync::RwLockReadGuard; use std::sync::RwLockReadGuard;
...@@ -83,7 +84,9 @@ pub extern fn throw_exception_internal(exception_obj: Address, last_frame_callee ...@@ -83,7 +84,9 @@ pub extern fn throw_exception_internal(exception_obj: Address, last_frame_callee
} }
}; };
print_backtrace(throw_frame_callsite, cursor.clone()); if PRINT_BACKTRACE {
print_backtrace(throw_frame_callsite, cursor.clone());
}
let mut callsite = rust_frame_return_addr; let mut callsite = rust_frame_return_addr;
......
...@@ -18,6 +18,8 @@ pub mod thread; ...@@ -18,6 +18,8 @@ pub mod thread;
pub mod math; pub mod math;
pub mod entrypoints; pub mod entrypoints;
const PRINT_BACKTRACE : bool = false;
#[cfg(target_arch = "x86_64")] #[cfg(target_arch = "x86_64")]
#[path = "exception_x64.rs"] #[path = "exception_x64.rs"]
pub mod exception; pub mod exception;
......
...@@ -75,7 +75,7 @@ pub struct VM { ...@@ -75,7 +75,7 @@ pub struct VM {
use std::u64; use std::u64;
const PENDING_FUNCREF : u64 = u64::MAX; const PENDING_FUNCREF : u64 = u64::MAX;
const VM_SERIALIZE_FIELDS : usize = 14; const VM_SERIALIZE_FIELDS : usize = 13;
impl Encodable for VM { impl Encodable for VM {
fn encode<S: Encoder> (&self, s: &mut S) -> Result<(), S::Error> { fn encode<S: Encoder> (&self, s: &mut S) -> Result<(), S::Error> {
...@@ -181,25 +181,6 @@ impl Encodable for VM { ...@@ -181,25 +181,6 @@ impl Encodable for VM {
})); }));
} }
field_i += 1; field_i += 1;
// func_vers
trace!("...serializing func_vers");
{
let func_vers : &HashMap<_, _> = &self.func_vers.read().unwrap();
try!(s.emit_struct_field("func_vers", field_i, |s| {
s.emit_map(func_vers.len(), |s| {
let mut i = 0;
for (k, v) in func_vers.iter() {
try!(s.emit_map_elt_key(i, |s| k.encode(s)));
let func_ver : &MuFunctionVersion = &v.read().unwrap();
try!(s.emit_map_elt_val(i, |s| func_ver.encode(s)));
i += 1;
}
Ok(())
})
}));
}
field_i += 1;
// primordial // primordial
trace!("...serializing primordial"); trace!("...serializing primordial");
...@@ -325,20 +306,6 @@ impl Decodable for VM { ...@@ -325,20 +306,6 @@ impl Decodable for VM {
})); }));
field_i += 1; field_i += 1;
// func_vers
let func_vers = try!(d.read_struct_field("func_vers", field_i, |d| {
d.read_map(|d, len| {
let mut map = HashMap::new();
for i in 0..len {
let key = try!(d.read_map_elt_key(i, |d| Decodable::decode(d)));
let val = RwLock::new(try!(d.read_map_elt_val(i, |d| Decodable::decode(d))));
map.insert(key, val);
}
Ok(map)
})
}));
field_i += 1;
// primordial // primordial
let primordial = try!(d.read_struct_field("primordial", field_i, |d| Decodable::decode(d))); let primordial = try!(d.read_struct_field("primordial", field_i, |d| Decodable::decode(d)));
field_i += 1; field_i += 1;
...@@ -376,7 +343,7 @@ impl Decodable for VM { ...@@ -376,7 +343,7 @@ impl Decodable for VM {
global_locations: RwLock::new(hashmap!{}), global_locations: RwLock::new(hashmap!{}),
func_sigs: RwLock::new(func_sigs), func_sigs: RwLock::new(func_sigs),
funcs: RwLock::new(funcs), funcs: RwLock::new(funcs),
func_vers: RwLock::new(func_vers), func_vers: RwLock::new(hashmap!{}),
primordial: RwLock::new(primordial), primordial: RwLock::new(primordial),
is_running: ATOMIC_BOOL_INIT, is_running: ATOMIC_BOOL_INIT,
vm_options: vm_options, vm_options: vm_options,
......
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