GitLab will be upgraded on June 2nd 2020 at 2.00 pm (AEDT) to 3.00 pm (AEDT) due to Critical Security Patch Availability. During the update, GitLab and Mattermost services will not be available. If you have any concerns with this, please talk to local Gitlab admin team.

Commit dc7f409b authored by Isaac Oscar Gariano's avatar Isaac Oscar Gariano

Implemented native dumping and loading of rust objects

parent 0454a7fa
# Copyright 2017 The Australian National University # Copyright 2017 The Australian National University
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
[package] [package]
name = "mu" name = "mu"
version = "0.0.1" version = "0.0.1"
...@@ -28,26 +28,28 @@ aot = [] ...@@ -28,26 +28,28 @@ aot = []
jit = [] jit = []
[build-dependencies] [build-dependencies]
gcc = "0.3" gcc = "*"
[dependencies] [dependencies]
ast = {path = "src/ast"} ast = {path = "src/ast"}
utils = {path = "src/utils"} utils = {path = "src/utils"}
gc = {path = "src/gc"} gc = {path = "src/gc"}
#rodal = {path = "rodal"}
rodal = { git = "https://gitlab.anu.edu.au/mu/rodal" }
field-offset = "0.1.1" libc="*"
libloading = "0.3" field-offset = "*"
lazy_static = "0.1.15" libloading = "*"
log = "0.3.5" lazy_static = "*"
stderrlog = "0.2.2" log = "*"
hprof = "0.1.3" stderrlog = "*"
memmap = "0.4.0" hprof = "*"
memmap = "*"
memsec = "0.1.9" memsec = "0.1.9"
rustc-serialize = "*" serde = "*"
time = "0.1.34" serde_derive = "*"
maplit = "0.1.4" time = "*"
docopt = "0.6" maplit = "*"
petgraph = "0.4.1" docopt = "*"
petgraph = "*"
extprim = "*" extprim = "*"
num-traits = "*" num-traits = "*"
...@@ -22,7 +22,8 @@ crate-type = ["rlib"] ...@@ -22,7 +22,8 @@ crate-type = ["rlib"]
[dependencies] [dependencies]
utils = {path = "../utils"} utils = {path = "../utils"}
lazy_static = "0.1.15" lazy_static = "*"
log = "0.3.5" log = "*"
simple_logger = "0.4.0" simple_logger = "*"
rustc-serialize = "*" #rodal = {path = "../../rodal"}
\ No newline at end of file rodal = { git = "https://gitlab.anu.edu.au/mu/rodal" }
...@@ -23,7 +23,7 @@ use utils::vec_utils; ...@@ -23,7 +23,7 @@ use utils::vec_utils;
use std::fmt; use std::fmt;
#[derive(Debug)] #[derive(Debug)]
// this implements RustcEncodable, RustcDecodable, Clone and Display // this implements Clone and Display
pub struct Instruction { pub struct Instruction {
pub hdr: MuEntityHeader, pub hdr: MuEntityHeader,
pub value : Option<Vec<P<Value>>>, pub value : Option<Vec<P<Value>>>,
...@@ -33,43 +33,6 @@ pub struct Instruction { ...@@ -33,43 +33,6 @@ pub struct Instruction {
impl_mu_entity!(Instruction); impl_mu_entity!(Instruction);
use rustc_serialize::{Encodable, Encoder, Decodable, Decoder};
impl Encodable for Instruction {
fn encode<S: Encoder> (&self, s: &mut S) -> Result<(), S::Error> {
s.emit_struct("Instruction", 4, |s| {
try!(s.emit_struct_field("hdr", 0, |s| self.hdr.encode(s)));
try!(s.emit_struct_field("value", 1, |s| self.value.encode(s)));
let ref ops = self.ops;
try!(s.emit_struct_field("ops", 2, |s| ops.encode(s)));
try!(s.emit_struct_field("v", 3, |s| self.v.encode(s)));
Ok(())
})
}
}
impl Decodable for Instruction {
fn decode<D: Decoder>(d: &mut D) -> Result<Instruction, D::Error> {
d.read_struct("Instruction", 4, |d| {
let hdr = try!(d.read_struct_field("hdr", 0, |d| Decodable::decode(d)));
let value = try!(d.read_struct_field("value", 1, |d| Decodable::decode(d)));
let ops = try!(d.read_struct_field("ops", 2, |d| Decodable::decode(d)));
let v = try!(d.read_struct_field("v", 3, |d| Decodable::decode(d)));
Ok(Instruction{
hdr: hdr,
value: value,
ops: ops,
v: v
})
})
}
}
impl Clone for Instruction { impl Clone for Instruction {
fn clone(&self) -> Self { fn clone(&self) -> Self {
Instruction { Instruction {
...@@ -164,7 +127,7 @@ impl fmt::Display for Instruction { ...@@ -164,7 +127,7 @@ impl fmt::Display for Instruction {
} }
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
#[derive(Debug, Clone, RustcEncodable, RustcDecodable)] #[derive(Debug, Clone)]
pub enum Instruction_ { pub enum Instruction_ {
// non-terminal instruction // non-terminal instruction
...@@ -494,7 +457,7 @@ impl Instruction_ { ...@@ -494,7 +457,7 @@ impl Instruction_ {
} }
} }
#[derive(Copy, Clone, RustcEncodable, RustcDecodable)] #[derive(Copy, Clone)]
pub struct BinOpStatus { pub struct BinOpStatus {
pub flag_n: bool, pub flag_n: bool,
pub flag_z: bool, pub flag_z: bool,
...@@ -542,7 +505,7 @@ impl fmt::Debug for BinOpStatus { ...@@ -542,7 +505,7 @@ impl fmt::Debug for BinOpStatus {
} }
} }
#[derive(Copy, Clone, Debug, RustcEncodable, RustcDecodable)] #[derive(Copy, Clone, Debug)]
pub enum MemoryOrder { pub enum MemoryOrder {
NotAtomic, NotAtomic,
Relaxed, Relaxed,
...@@ -553,18 +516,18 @@ pub enum MemoryOrder { ...@@ -553,18 +516,18 @@ pub enum MemoryOrder {
SeqCst SeqCst
} }
#[derive(Copy, Clone, Debug, RustcEncodable, RustcDecodable)] #[derive(Copy, Clone, Debug)]
pub enum CallConvention { pub enum CallConvention {
Mu, Mu,
Foreign(ForeignFFI) Foreign(ForeignFFI)
} }
#[derive(Copy, Clone, Debug, RustcEncodable, RustcDecodable)] #[derive(Copy, Clone, Debug)]
pub enum ForeignFFI { pub enum ForeignFFI {
C C
} }
#[derive(Clone, Debug, RustcEncodable, RustcDecodable)] #[derive(Clone, Debug)]
pub struct CallData { pub struct CallData {
pub func: OpIndex, pub func: OpIndex,
pub args: Vec<OpIndex>, pub args: Vec<OpIndex>,
...@@ -581,7 +544,7 @@ impl CallData { ...@@ -581,7 +544,7 @@ impl CallData {
} }
} }
#[derive(Clone, Debug, RustcEncodable, RustcDecodable)] #[derive(Clone, Debug)]
pub struct ResumptionData { pub struct ResumptionData {
pub normal_dest: Destination, pub normal_dest: Destination,
pub exn_dest: Destination pub exn_dest: Destination
...@@ -593,7 +556,7 @@ impl ResumptionData { ...@@ -593,7 +556,7 @@ impl ResumptionData {
} }
} }
#[derive(Clone, Debug, RustcEncodable, RustcDecodable)] #[derive(Clone, Debug)]
pub struct Destination { pub struct Destination {
pub target: MuID, pub target: MuID,
pub args: Vec<DestArg> pub args: Vec<DestArg>
...@@ -636,7 +599,7 @@ impl Destination { ...@@ -636,7 +599,7 @@ impl Destination {
} }
} }
#[derive(Clone, Debug, RustcEncodable, RustcDecodable)] #[derive(Clone, Debug)]
pub enum DestArg { pub enum DestArg {
Normal(OpIndex), Normal(OpIndex),
Freshbound(usize) Freshbound(usize)
......
...@@ -21,6 +21,7 @@ use utils::vec_utils; ...@@ -21,6 +21,7 @@ use utils::vec_utils;
use utils::LinkedHashMap; use utils::LinkedHashMap;
use utils::LinkedHashSet; use utils::LinkedHashSet;
use std;
use std::fmt; use std::fmt;
use std::default; use std::default;
use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
...@@ -77,7 +78,8 @@ pub fn new_internal_id() -> MuID { ...@@ -77,7 +78,8 @@ pub fn new_internal_id() -> MuID {
ret ret
} }
#[derive(Debug, RustcEncodable, RustcDecodable)] rodal_struct!(MuFunction{hdr, sig, cur_ver, all_vers});
#[derive(Debug)]
pub struct MuFunction { pub struct MuFunction {
pub hdr: MuEntityHeader, pub hdr: MuEntityHeader,
...@@ -112,7 +114,6 @@ impl fmt::Display for MuFunction { ...@@ -112,7 +114,6 @@ impl fmt::Display for MuFunction {
} }
} }
#[derive(RustcEncodable, RustcDecodable)]
pub struct MuFunctionVersion { pub struct MuFunctionVersion {
pub hdr: MuEntityHeader, pub hdr: MuEntityHeader,
...@@ -315,7 +316,7 @@ impl MuFunctionVersion { ...@@ -315,7 +316,7 @@ impl MuFunctionVersion {
} }
} }
#[derive(Clone, RustcEncodable, RustcDecodable)] #[derive(Clone)]
pub struct FunctionContent { pub struct FunctionContent {
pub entry: MuID, pub entry: MuID,
pub blocks: LinkedHashMap<MuID, Block>, pub blocks: LinkedHashMap<MuID, Block>,
...@@ -384,7 +385,7 @@ impl FunctionContent { ...@@ -384,7 +385,7 @@ impl FunctionContent {
} }
} }
#[derive(Default, Debug, RustcEncodable, RustcDecodable)] #[derive(Default, Debug)]
pub struct FunctionContext { pub struct FunctionContext {
pub values: LinkedHashMap<MuID, SSAVarEntry> pub values: LinkedHashMap<MuID, SSAVarEntry>
} }
...@@ -427,7 +428,7 @@ impl FunctionContext { ...@@ -427,7 +428,7 @@ impl FunctionContext {
} }
} }
#[derive(RustcEncodable, RustcDecodable, Clone)] #[derive(Clone)]
pub struct Block { pub struct Block {
pub hdr: MuEntityHeader, pub hdr: MuEntityHeader,
pub content: Option<BlockContent>, pub content: Option<BlockContent>,
...@@ -468,7 +469,7 @@ impl Block { ...@@ -468,7 +469,7 @@ impl Block {
} }
} }
#[derive(Debug, RustcEncodable, RustcDecodable, Clone)] #[derive(Debug, Clone)]
pub struct ControlFlow { pub struct ControlFlow {
pub preds : Vec<MuID>, pub preds : Vec<MuID>,
pub succs : Vec<BlockEdge> pub succs : Vec<BlockEdge>
...@@ -507,7 +508,7 @@ impl default::Default for ControlFlow { ...@@ -507,7 +508,7 @@ impl default::Default for ControlFlow {
} }
} }
#[derive(Copy, Clone, Debug, RustcEncodable, RustcDecodable)] #[derive(Copy, Clone, Debug)]
pub struct BlockEdge { pub struct BlockEdge {
pub target: MuID, pub target: MuID,
pub kind: EdgeKind, pub kind: EdgeKind,
...@@ -521,12 +522,12 @@ impl fmt::Display for BlockEdge { ...@@ -521,12 +522,12 @@ impl fmt::Display for BlockEdge {
} }
} }
#[derive(Copy, Clone, Debug, RustcEncodable, RustcDecodable)] #[derive(Copy, Clone, Debug)]
pub enum EdgeKind { pub enum EdgeKind {
Forward, Backward Forward, Backward
} }
#[derive(RustcEncodable, RustcDecodable, Clone)] #[derive(Clone)]
pub struct BlockContent { pub struct BlockContent {
pub args: Vec<P<Value>>, pub args: Vec<P<Value>>,
pub exn_arg: Option<P<Value>>, pub exn_arg: Option<P<Value>>,
...@@ -622,7 +623,7 @@ impl BlockContent { ...@@ -622,7 +623,7 @@ impl BlockContent {
} }
} }
#[derive(Debug, RustcEncodable, RustcDecodable, Clone)] #[derive(Debug, Clone)]
/// always use with P<TreeNode> /// always use with P<TreeNode>
pub struct TreeNode { pub struct TreeNode {
pub op: OpCode, pub op: OpCode,
...@@ -697,14 +698,15 @@ impl fmt::Display for TreeNode { ...@@ -697,14 +698,15 @@ impl fmt::Display for TreeNode {
} }
} }
#[derive(Debug, RustcEncodable, RustcDecodable, Clone)] #[derive(Debug, Clone)]
pub enum TreeNode_ { pub enum TreeNode_ {
Value(P<Value>), Value(P<Value>),
Instruction(Instruction) Instruction(Instruction)
} }
/// always use with P<Value> /// always use with P<Value>
#[derive(PartialEq, RustcEncodable, RustcDecodable)] rodal_struct!(Value{hdr, ty, v});
#[derive(PartialEq)]
pub struct Value { pub struct Value {
pub hdr: MuEntityHeader, pub hdr: MuEntityHeader,
pub ty: P<MuType>, pub ty: P<MuType>,
...@@ -847,7 +849,8 @@ impl fmt::Display for Value { ...@@ -847,7 +849,8 @@ impl fmt::Display for Value {
} }
} }
#[derive(Debug, Clone, PartialEq, RustcEncodable, RustcDecodable)] rodal_enum!(Value_{(SSAVar: id), (Constant: val), (Global: ty), (Memory: location)});
#[derive(Debug, Clone, PartialEq)]
pub enum Value_ { pub enum Value_ {
SSAVar(MuID), SSAVar(MuID),
Constant(Constant), Constant(Constant),
...@@ -870,41 +873,6 @@ pub struct SSAVarEntry { ...@@ -870,41 +873,6 @@ pub struct SSAVarEntry {
split: Option<Vec<P<Value>>> split: Option<Vec<P<Value>>>
} }
impl Encodable for SSAVarEntry {
fn encode<S: Encoder> (&self, s: &mut S) -> Result<(), S::Error> {
s.emit_struct("SSAVarEntry", 3, |s| {
try!(s.emit_struct_field("val", 0, |s| self.val.encode(s)));
let count = self.use_count.load(Ordering::SeqCst);
try!(s.emit_struct_field("use_count", 1, |s| s.emit_usize(count)));
try!(s.emit_struct_field("expr", 2, |s| self.expr.encode(s)));
try!(s.emit_struct_field("split", 3, |s| self.split.encode(s)));
Ok(())
})
}
}
impl Decodable for SSAVarEntry {
fn decode<D: Decoder>(d: &mut D) -> Result<SSAVarEntry, D::Error> {
d.read_struct("SSAVarEntry", 3, |d| {
let val = try!(d.read_struct_field("val", 0, |d| Decodable::decode(d)));
let count = try!(d.read_struct_field("use_count", 1, |d| d.read_usize()));
let expr = try!(d.read_struct_field("expr", 2, |d| Decodable::decode(d)));
let split = try!(d.read_struct_field("split", 3, |d| Decodable::decode(d)));
let ret = SSAVarEntry {
val: val,
use_count: ATOMIC_USIZE_INIT,
expr: expr,
split: split
};
ret.use_count.store(count, Ordering::SeqCst);
Ok(ret)
})
}
}
impl SSAVarEntry { impl SSAVarEntry {
pub fn new(val: P<Value>) -> SSAVarEntry { pub fn new(val: P<Value>) -> SSAVarEntry {
let ret = SSAVarEntry { let ret = SSAVarEntry {
...@@ -965,7 +933,9 @@ impl fmt::Display for SSAVarEntry { ...@@ -965,7 +933,9 @@ impl fmt::Display for SSAVarEntry {
} }
} }
#[derive(Debug, Clone, PartialEq, RustcEncodable, RustcDecodable)] rodal_enum!(Constant{(Int: val), (IntEx: val), (Float: val), (Double: val), (FuncRef: val),
(Vector: val), NullRef, (ExternSym: val), (List: val)});
#[derive(Debug, Clone, PartialEq)]
pub enum Constant { pub enum Constant {
Int(u64), Int(u64),
IntEx(Vec<u64>), IntEx(Vec<u64>),
...@@ -1015,10 +985,12 @@ impl fmt::Display for Constant { ...@@ -1015,10 +985,12 @@ impl fmt::Display for Constant {
} }
#[cfg(target_arch = "x86_64")] #[cfg(target_arch = "x86_64")]
#[derive(Debug, Clone, PartialEq, RustcEncodable, RustcDecodable)] rodal_enum!(MemoryLocation{{Address: scale, base, offset, index}, {Symbolic: is_global, base, label}});
#[cfg(target_arch = "x86_64")]
#[derive(Debug, Clone, PartialEq)]
pub enum MemoryLocation { pub enum MemoryLocation {
Address{ Address{
base: P<Value>, base: P<Value>, // +8
offset: Option<P<Value>>, offset: Option<P<Value>>,
index: Option<P<Value>>, index: Option<P<Value>>,
scale: Option<u8> scale: Option<u8>
...@@ -1059,17 +1031,19 @@ impl fmt::Display for MemoryLocation { ...@@ -1059,17 +1031,19 @@ impl fmt::Display for MemoryLocation {
} }
#[cfg(target_arch = "aarch64")] #[cfg(target_arch = "aarch64")]
#[derive(Debug, Clone, PartialEq, RustcEncodable, RustcDecodable)] rodal_enum!(MemoryLocation{{VirtualAddress: signed, base, offset, scale}, {Address: base, offset, shift, signed}, {Symbolic: label, is_global}});
#[cfg(target_arch = "aarch64")]
#[derive(Debug, Clone, PartialEq)]
pub enum MemoryLocation { pub enum MemoryLocation {
// Represents how an adress should be computed, // Represents how an adress should be computed,
// will need to be converted to a real Address before being used // will need to be converted to a real Address before being used
VirtualAddress{ VirtualAddress{
// Represents base + offset*scale // Represents base + offset*scale
// With offset being inerpreted as signed if 'signed' is true // With offset being inerpreted as signed if 'signed' is true
base: P<Value>, base: P<Value>, //+8
offset: Option<P<Value>>, offset: Option<P<Value>>, //+16
scale: u64, signed: bool, //+1
signed: bool scale: u64 //+24
}, },
Address{ Address{
base: P<Value>, // Must be a normal 64-bit register or SP base: P<Value>, // Must be a normal 64-bit register or SP
...@@ -1119,6 +1093,7 @@ impl fmt::Display for MemoryLocation { ...@@ -1119,6 +1093,7 @@ impl fmt::Display for MemoryLocation {
} }
} }
rodal_struct!(MuEntityHeader{id, name});
#[repr(C)] #[repr(C)]
#[derive(Debug)] // Display, PartialEq, Clone #[derive(Debug)] // Display, PartialEq, Clone
pub struct MuEntityHeader { pub struct MuEntityHeader {
...@@ -1135,34 +1110,6 @@ impl Clone for MuEntityHeader { ...@@ -1135,34 +1110,6 @@ impl Clone for MuEntityHeader {
} }
} }
use rustc_serialize::{Encodable, Encoder, Decodable, Decoder};
impl Encodable for MuEntityHeader {
fn encode<S: Encoder> (&self, s: &mut S) -> Result<(), S::Error> {
s.emit_struct("MuEntityHeader", 2, |s| {
try!(s.emit_struct_field("id", 0, |s| self.id.encode(s)));
let name = &self.name;
try!(s.emit_struct_field("name", 1, |s| name.encode(s)));
Ok(())
})
}
}
impl Decodable for MuEntityHeader {
fn decode<D: Decoder>(d: &mut D) -> Result<MuEntityHeader, D::Error> {
d.read_struct("MuEntityHeader", 2, |d| {
let id = try!(d.read_struct_field("id", 0, |d| {d.read_usize()}));
let name = try!(d.read_struct_field("name", 1, |d| Decodable::decode(d)));
Ok(MuEntityHeader{
id: id,
name: name
})
})
}
}
pub fn name_check(name: MuName) -> MuName { pub fn name_check(name: MuName) -> MuName {
let name = name.replace('.', "$"); let name = name.replace('.', "$");
......
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
extern crate log; #[macro_use]
extern crate rodal;
extern crate simple_logger; extern crate simple_logger;
#[macro_use] #[macro_use]
extern crate lazy_static; extern crate lazy_static;
extern crate rustc_serialize;
extern crate utils; extern crate utils;
#[macro_export] #[macro_export]
......
...@@ -17,7 +17,7 @@ use types::*; ...@@ -17,7 +17,7 @@ use types::*;
use inst::*; use inst::*;
use types::MuType_::*; use types::MuType_::*;
#[derive(Copy, Clone, Debug, PartialEq, RustcEncodable, RustcDecodable)] #[derive(Copy, Clone, Debug, PartialEq)]
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
pub enum OpCode { pub enum OpCode {
// SSA // SSA
...@@ -140,7 +140,7 @@ pub fn pick_op_code_for_value(ty: &P<MuType>) -> OpCode { ...@@ -140,7 +140,7 @@ pub fn pick_op_code_for_value(ty: &P<MuType>) -> OpCode {
} }
} }
#[derive(Copy, Clone, Debug, PartialEq, RustcEncodable, RustcDecodable)] #[derive(Copy, Clone, Debug, PartialEq)]
pub enum BinOp { pub enum BinOp {
// Int(n) BinOp Int(n) -> Int(n) // Int(n) BinOp Int(n) -> Int(n)
Add, Add,
...@@ -167,7 +167,7 @@ pub enum BinOp { ...@@ -167,7 +167,7 @@ pub enum BinOp {
FRem FRem
} }
#[derive(Copy, Clone, Debug, PartialEq, RustcEncodable, RustcDecodable)] #[derive(Copy, Clone, Debug, PartialEq)]
pub enum CmpOp { pub enum CmpOp {
// for Int comparison // for Int comparison
EQ, EQ,
...@@ -300,7 +300,7 @@ impl CmpOp { ...@@ -300,7 +300,7 @@ impl CmpOp {
} }
} }
#[derive(Copy, Clone, Debug, PartialEq, RustcEncodable, RustcDecodable)] #[derive(Copy, Clone, Debug, PartialEq)]
pub enum ConvOp { pub enum ConvOp {
TRUNC, TRUNC,
ZEXT, ZEXT,
...@@ -316,7 +316,7 @@ pub enum ConvOp { ...@@ -316,7 +316,7 @@ pub enum ConvOp {
PTRCAST PTRCAST
} }
#[derive(Copy, Clone, Debug, PartialEq, RustcEncodable, RustcDecodable)] #[derive(Copy, Clone, Debug, PartialEq)]
pub enum AtomicRMWOp { pub enum AtomicRMWOp {
XCHG, XCHG,
ADD, ADD,
......
// Copyright 2017 The Australian National University
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at // file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT. // http://rust-lang.org/COPYRIGHT.
...@@ -53,7 +39,6 @@ ...@@ -53,7 +39,6 @@
//use std::fmt::{self, Display, Debug}; //use std::fmt::{self, Display, Debug};
//use std::hash::{Hash, Hasher}; //use std::hash::{Hash, Hasher};
//use std::ops::Deref; //use std::ops::Deref;
//use rustc_serialize::{Encodable, Encoder, Decodable, Decoder};
use std::sync::Arc; use std::sync::Arc;
...@@ -112,10 +97,4 @@ pub fn P<T>(value: T) -> P<T> { ...@@ -112,10 +97,4 @@ pub fn P<T>(value: T) -> P<T> {
// fn hash<H: Hasher>(&self, state: &mut H) { // fn hash<H: Hasher>(&self, state: &mut H) {
// (**self).hash(state); // (**self).hash(state);
// } // }
//} //}
\ No newline at end of file
//impl<T: MuEntity> Encodable for P<T> {
// fn encode<S: Encoder> (&self, s: &mut S) -> Result<(), S::Error> {
// s.emit_usize(self.id())
// }
//}