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.2% of users enabled 2FA.

Commit 1b6f904a authored by qinsoon's avatar qinsoon
Browse files

move constants of prologue/epilogue name to compiler/mod.rs (instead of

in the backend)
parent 89dcb164
...@@ -32,8 +32,8 @@ use runtime::entrypoints::RuntimeEntrypoint; ...@@ -32,8 +32,8 @@ use runtime::entrypoints::RuntimeEntrypoint;
use compiler::CompilerPass; use compiler::CompilerPass;
use compiler::backend::PROLOGUE_BLOCK_NAME; use compiler::PROLOGUE_BLOCK_NAME;
use compiler::backend::EPILOGUE_BLOCK_NAME; use compiler::EPILOGUE_BLOCK_NAME;
use compiler::backend::aarch64::*; use compiler::backend::aarch64::*;
use compiler::backend::make_block_name; use compiler::backend::make_block_name;
......
...@@ -30,7 +30,7 @@ use runtime::entrypoints::RuntimeEntrypoint; ...@@ -30,7 +30,7 @@ use runtime::entrypoints::RuntimeEntrypoint;
use compiler::CompilerPass; use compiler::CompilerPass;
use compiler::backend::BackendType; use compiler::backend::BackendType;
use compiler::backend::RegGroup; use compiler::backend::RegGroup;
use compiler::backend::PROLOGUE_BLOCK_NAME; use compiler::PROLOGUE_BLOCK_NAME;
use compiler::backend::x86_64; use compiler::backend::x86_64;
use compiler::backend::x86_64::CodeGenerator; use compiler::backend::x86_64::CodeGenerator;
use compiler::backend::x86_64::ASMCodeGen; use compiler::backend::x86_64::ASMCodeGen;
......
...@@ -33,11 +33,6 @@ use num::integer::lcm; ...@@ -33,11 +33,6 @@ use num::integer::lcm;
#[cfg(feature = "aot")] #[cfg(feature = "aot")]
pub const AOT_EMIT_CONTEXT_FILE : &'static str = "context.S"; pub const AOT_EMIT_CONTEXT_FILE : &'static str = "context.S";
/// name for prologue (this is not full name, but prologue name is generated from this)
pub const PROLOGUE_BLOCK_NAME: &'static str = "prologue";
/// name for epilogue (this is not full name, but epilogue name is generated from this)
pub const EPILOGUE_BLOCK_NAME: &'static str = "epilogue";
// type alias to make backend code more readable // type alias to make backend code more readable
pub type Reg<'a> = &'a P<Value>; pub type Reg<'a> = &'a P<Value>;
pub type Mem<'a> = &'a P<Value>; pub type Mem<'a> = &'a P<Value>;
......
...@@ -24,7 +24,7 @@ use ast::ir::*; ...@@ -24,7 +24,7 @@ use ast::ir::*;
use ast::ptr::*; use ast::ptr::*;
use compiler::machine_code::CompiledFunction; use compiler::machine_code::CompiledFunction;
use compiler::backend::get_color_for_precolored as alias; use compiler::backend::get_color_for_precolored as alias;
use compiler::backend::PROLOGUE_BLOCK_NAME; use compiler::PROLOGUE_BLOCK_NAME;
mod alive_entry; mod alive_entry;
use compiler::backend::reg_alloc::validate::alive_entry::*; use compiler::backend::reg_alloc::validate::alive_entry::*;
......
...@@ -29,6 +29,11 @@ pub mod machine_code; ...@@ -29,6 +29,11 @@ pub mod machine_code;
pub use compiler::passes::CompilerPass; pub use compiler::passes::CompilerPass;
/// name for prologue (this is not full name, but prologue name is generated from this)
pub const PROLOGUE_BLOCK_NAME: &'static str = "prologue";
/// name for epilogue (this is not full name, but epilogue name is generated from this)
pub const EPILOGUE_BLOCK_NAME: &'static str = "epilogue";
/// Zebu compiler /// Zebu compiler
pub struct Compiler<'vm> { pub struct Compiler<'vm> {
/// policy decides what passes to be executed /// policy decides what passes to be executed
......
...@@ -17,6 +17,7 @@ use ast::inst::*; ...@@ -17,6 +17,7 @@ use ast::inst::*;
use ast::ptr::*; use ast::ptr::*;
use vm::VM; use vm::VM;
use compiler::CompilerPass; use compiler::CompilerPass;
use compiler::EPILOGUE_BLOCK_NAME;
use std::any::Any; use std::any::Any;
/// Mu IR the client gives us may contain several RET instructions. However, /// Mu IR the client gives us may contain several RET instructions. However,
...@@ -49,7 +50,7 @@ impl CompilerPass for RetSink { ...@@ -49,7 +50,7 @@ impl CompilerPass for RetSink {
// create a return sink // create a return sink
let return_sink = { let return_sink = {
let block_name = format!("{}:epilogue", func.name()); let block_name = format!("{}:{}", func.name(), EPILOGUE_BLOCK_NAME);
trace!("created return sink {}", block_name); trace!("created return sink {}", block_name);
let mut block = Block::new(MuEntityHeader::named(vm.next_id(), block_name)); let mut block = Block::new(MuEntityHeader::named(vm.next_id(), block_name));
......
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