WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit 9c9c9b2b authored by qinsoon's avatar qinsoon
Browse files

[wip] small fixes

parent e53f5d4f
...@@ -684,7 +684,7 @@ pub enum TreeNode_ { ...@@ -684,7 +684,7 @@ pub enum TreeNode_ {
} }
/// always use with P<Value> /// always use with P<Value>
#[derive(Debug, PartialEq, RustcEncodable, RustcDecodable)] #[derive(PartialEq, RustcEncodable, RustcDecodable)]
pub struct Value { pub struct Value {
pub hdr: MuEntityHeader, pub hdr: MuEntityHeader,
pub ty: P<MuType>, pub ty: P<MuType>,
...@@ -769,6 +769,12 @@ impl Value { ...@@ -769,6 +769,12 @@ impl Value {
const DISPLAY_TYPE : bool = false; const DISPLAY_TYPE : bool = false;
impl fmt::Debug for Value {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self)
}
}
impl fmt::Display for Value { impl fmt::Display for Value {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
if DISPLAY_TYPE { if DISPLAY_TYPE {
...@@ -792,7 +798,7 @@ impl fmt::Display for Value { ...@@ -792,7 +798,7 @@ impl fmt::Display for Value {
write!(f, "%{}", self.hdr) write!(f, "%{}", self.hdr)
}, },
Value_::Constant(ref c) => { Value_::Constant(ref c) => {
write!(f, "{} @{}", c, self.hdr) write!(f, "{}", c)
}, },
Value_::Global(_) => { Value_::Global(_) => {
write!(f, "GLOBAL @{}", self.hdr) write!(f, "GLOBAL @{}", self.hdr)
...@@ -921,7 +927,7 @@ pub enum Constant { ...@@ -921,7 +927,7 @@ pub enum Constant {
impl fmt::Display for Constant { impl fmt::Display for Constant {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self { match self {
&Constant::Int(v) => write!(f, "{}", v), &Constant::Int(v) => write!(f, "{}", v as i64),
&Constant::Float(v) => write!(f, "{}", v), &Constant::Float(v) => write!(f, "{}", v),
&Constant::Double(v) => write!(f, "{}", v), &Constant::Double(v) => write!(f, "{}", v),
// &Constant::IRef(v) => write!(f, "{}", v), // &Constant::IRef(v) => write!(f, "{}", v),
......
...@@ -173,7 +173,7 @@ impl AliveEntries { ...@@ -173,7 +173,7 @@ impl AliveEntries {
} }
pub fn add_temp_in_mem(&mut self, temp: MuID, mem: P<Value>) { pub fn add_temp_in_mem(&mut self, temp: MuID, mem: P<Value>) {
debug!("alive alive temp in mem: {} in {}", temp, mem); debug!("adding alive temp in mem: {} in {}", temp, mem);
let entry_exists = self.has_entries_for_temp(temp); let entry_exists = self.has_entries_for_temp(temp);
......
...@@ -46,9 +46,10 @@ pub fn validate_regalloc(cf: &CompiledFunction, ...@@ -46,9 +46,10 @@ pub fn validate_regalloc(cf: &CompiledFunction,
for (_, reg) in frame.argument_by_reg.iter() { for (_, reg) in frame.argument_by_reg.iter() {
alive.new_alive_reg(alias(reg.id())); alive.new_alive_reg(alias(reg.id()));
} }
for (_, stack) in frame.argument_by_stack.iter() { // we do not consider mem loc for arguments - we do consider mem loc for spilling
alive.new_alive_mem(stack.clone()); // for (_, stack) in frame.argument_by_stack.iter() {
} // alive.new_alive_mem(stack.clone());
// }
debug!("alive entries in the beginning"); debug!("alive entries in the beginning");
debug!("{}", alive); debug!("{}", alive);
......
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