Permalink
Browse files

s:g/[type|init]Obj<(ect//

  • Loading branch information...
sorear committed May 27, 2012
1 parent 581727d commit 51f3253f1520f1210f1882fd225480b409ac1aa8
Showing with 61 additions and 61 deletions.
  1. +15 −15 lib/Builtins.cs
  2. +13 −13 lib/CodeGen.cs
  3. +1 −1 lib/Cursor.cs
  4. +19 −19 lib/Kernel.cs
  5. +3 −3 lib/NieczaCLR.cs
  6. +10 −10 lib/ObjModel.cs
View
@@ -141,7 +141,7 @@ class SubstrLValue: Variable {
public override P6any Fetch() {
string str = backing.Fetch().mo.mro_raw_Str.Get(backing);
string sub = Builtins.LaxSubstring2(str, from, length);
- return sub == null ? Kernel.StrMO.typeObject :
+ return sub == null ? Kernel.StrMO.typeObj :
Kernel.BoxRaw(sub,Kernel.StrMO);
}
@@ -2636,14 +2636,14 @@ class CrossSource: ItemSource {
STable n = new STable(obj.mo.name + "+" + Kernel.JoinS(",", roles));
n.how = Kernel.BoxAny<STable>(n, obj.mo.how).Fetch();
- n.typeObject = n.initObject = new P6opaque(n);
- n.typeVar = n.initVar = n.typeObject;
- ((P6opaque)n.typeObject).slots = null;
+ n.typeObj = n.initObj = new P6opaque(n);
+ n.typeVar = n.initVar = n.typeObj;
+ ((P6opaque)n.typeObj).slots = null;
n.mo.superclasses.Add(obj.mo);
n.mo.local_roles = roles;
n.mo.Compose();
- newtype.Store(n.typeObject);
+ newtype.Store(n.typeObj);
string aname = null;
if (init != Kernel.AnyMO.typeVar) {
@@ -2680,10 +2680,10 @@ class CrossSource: ItemSource {
if ((ai.flags & P6how.A_TYPE) == P6how.A_SCALAR) {
if (ai.type == null)
obj = Kernel.NewMuScalar(
- vx != null ? vx.Fetch() : Kernel.AnyMO.typeObject);
+ vx != null ? vx.Fetch() : Kernel.AnyMO.typeObj);
else
obj = Kernel.NewRWScalar(ai.type,
- vx != null ? vx.Fetch() : ai.type.initObject);
+ vx != null ? vx.Fetch() : ai.type.initObj);
} else {
obj = (ai.flags & P6how.A_HASH) != 0 ?
Kernel.CreateHash() : Kernel.CreateArray();
@@ -2722,8 +2722,8 @@ class CrossSource: ItemSource {
public static Variable enum_mixin_role(string name, P6any meth) {
STable r = new STable('{' + name + '}');
r.mo.FillRole(new STable[0], null);
- r.typeObject = r.initObject = new P6opaque(r);
- r.typeVar = r.initVar = r.typeObject;
+ r.typeObj = r.initObj = new P6opaque(r);
+ r.typeVar = r.initVar = r.typeObj;
r.mo.AddMethod(0, name, meth);
r.mo.Revalidate();
r.SetupVTables();
@@ -2734,8 +2734,8 @@ class CrossSource: ItemSource {
public static Variable cat_mixin_role(string name, P6any meth) {
STable r = new STable('{' + name + '}');
r.mo.FillRole(new STable[0], null);
- r.typeObject = r.initObject = new P6opaque(r);
- r.typeVar = r.initVar = r.typeObject;
+ r.typeObj = r.initObj = new P6opaque(r);
+ r.typeVar = r.initVar = r.typeObj;
r.mo.AddMethod(P6how.M_MULTI, name, meth);
r.mo.Revalidate();
r.SetupVTables();
@@ -2748,8 +2748,8 @@ class CrossSource: ItemSource {
STable r = new STable("ANON");
r.mo.FillRole(new STable[0], null);
- r.typeObject = r.initObject = new P6opaque(r);
- r.typeVar = r.initVar = r.typeObject;
+ r.typeObj = r.initObj = new P6opaque(r);
+ r.typeVar = r.initVar = r.typeObj;
r.mo.AddMethod(0, name, meth.Fetch());
r.mo.AddMethod(P6how.V_PRIVATE, name, meth.Fetch());
r.mo.AddAttribute(name, P6how.A_PUBLIC, null, stype);
@@ -2809,7 +2809,7 @@ public class Blackhole : Variable {
}
public static P6any code_signature(P6any obj) {
- return Kernel.GetInfo(obj).sig ?? Kernel.AnyMO.typeObject;
+ return Kernel.GetInfo(obj).sig ?? Kernel.AnyMO.typeObj;
}
public static Variable code_candidates(P6any sub) {
@@ -2846,7 +2846,7 @@ public class Blackhole : Variable {
return (P6any)o;
}
}
- return Kernel.AnyMO.typeObject;
+ return Kernel.AnyMO.typeObj;
}
public static Variable param_value_constraints(P6any param) {
View
@@ -480,12 +480,12 @@ sealed class Tokens {
SubInfo.GetField("mo");
public static readonly FieldInfo P6opaque_slots =
P6opaque.GetField("slots");
- public static readonly FieldInfo DMO_typeObject =
- STable.GetField("typeObject");
+ public static readonly FieldInfo DMO_typeObj =
+ STable.GetField("typeObj");
public static readonly FieldInfo DMO_typeVar =
STable.GetField("typeVar");
- public static readonly FieldInfo DMO_initObject =
- STable.GetField("initObject");
+ public static readonly FieldInfo DMO_initObj =
+ STable.GetField("initObj");
public static readonly FieldInfo DMO_initVar =
STable.GetField("initVar");
public static readonly FieldInfo DMO_how =
@@ -3056,7 +3056,7 @@ class NamProcessor {
thandlers["var_islist"] = Methody(null, Tokens.Variable.GetMethod("get_List"));
thandlers["var_is_rw"] = Methody(null, Tokens.Variable.GetMethod("get_Rw"));
thandlers["llhow_name"] = FieldGet(Tokens.STable, "name");
- thandlers["stab_what"] = FieldGet(Tokens.STable, "typeObject");
+ thandlers["stab_what"] = FieldGet(Tokens.STable, "typeObj");
thandlers["obj_llhow"] = FieldGet(Tokens.P6any, "mo");
thandlers["varhash_clear"] = Methody(null, Tokens.VarHash.GetMethod("Clear"));
thandlers["varhash_new"] = Constructy(Tokens.VarHash.GetConstructor(new Type[0]));
@@ -4369,21 +4369,21 @@ public class DowncallReceiver : CallReceiver {
nst.mo.superclasses.Clear();
// OTOH, it needs call structures set up to avoid internal errors
nst.mo.Revalidate();
- if (nst.typeObject == null) // AnyMO.typeObject is set up early
- nst.typeObject = new P6opaque(nst, 0);
- ((P6opaque)nst.typeObject).slots = null;
- nst.typeVar = nst.typeObject;
+ if (nst.typeObj == null) // AnyMO.typeObj is set up early
+ nst.typeObj = new P6opaque(nst, 0);
+ ((P6opaque)nst.typeObj).slots = null;
+ nst.typeVar = nst.typeObj;
if (ru.name == "CORE" && name == "Nil") {
// this anomalous type object is iterable
- nst.typeVar = Kernel.NewRWListVar(nst.typeObject);
+ nst.typeVar = Kernel.NewRWListVar(nst.typeObj);
}
if (pf != null)
- pf.SetValue(null, nst.typeObject);
+ pf.SetValue(null, nst.typeObj);
nst.initVar = nst.typeVar;
- nst.initObject = nst.typeObject;
+ nst.initObj = nst.typeObj;
nst.who = Kernel.BoxRaw(who, Kernel.StashMO);
nst.how = Kernel.BoxRaw<STable>(nst, Kernel.ClassHOWMO);
nst.mo.rtype = type;
@@ -4406,7 +4406,7 @@ public class DowncallReceiver : CallReceiver {
STable basety = (STable)Handle.Unbox(args[2]);
subset.mo.FillSubset(basety);
- subset.initObject = basety.initObject;
+ subset.initObj = basety.initObj;
subset.initVar = basety.initVar;
return null;
}
View
@@ -884,7 +884,7 @@ public Cursor(P6any proto, string text, P6any actions)
public string Reduced() { return reduced; }
public P6any AST() {
P6any a = (feedback != null) ? feedback.ast : ast;
- return a ?? Kernel.AnyMO.typeObject;
+ return a ?? Kernel.AnyMO.typeObj;
}
// TODO: cache generated lists
View
@@ -248,7 +248,7 @@ public sealed class SimpleVariable: Variable {
throw new NieczaException("Writing to readonly scalar");
}
if (v == Kernel.NilP) {
- v = type == null ? Kernel.AnyP : type.initObject;
+ v = type == null ? Kernel.AnyP : type.initObj;
}
if (type != null && !v.Does(type)) {
throw new NieczaException("Nominal type check failed for scalar store; got " + v.mo.name + ", needed " + type.name + " or subtype");
@@ -530,7 +530,7 @@ sealed class EmitUnit {
return RefConstant(s == null ? "" : s.name, "MO", s, Tokens.STable);
}
internal CpsOp TypeConstantP(STable s) {
- return RefConstant(s.name, "P", s.typeObject, Tokens.P6any);
+ return RefConstant(s.name, "P", s.typeObj, Tokens.P6any);
}
internal CpsOp TypeConstantV(STable s) {
return RefConstant(s.name, "V", s.typeVar, Tokens.Variable);
@@ -4176,9 +4176,9 @@ public struct StashCursor {
public static Variable MakePackage(string name, P6any who) {
STable st = new STable(name);
st.who = who;
- st.typeObject = st.initObject = new P6opaque(st, 0);
- ((P6opaque)st.typeObject).slots = null;
- st.typeVar = st.initVar = st.typeObject;
+ st.typeObj = st.initObj = new P6opaque(st, 0);
+ ((P6opaque)st.typeObj).slots = null;
+ st.typeVar = st.initVar = st.typeObj;
st.mo.type = P6how.PACKAGE;
st.mo.rtype = "package";
// XXX should be PackageHOW
@@ -4888,8 +4888,8 @@ public class Kernel {
[CORESaved] public static STable SignatureMO;
[CORESaved] public static P6any StashP;
- [CORESaved] public static Variable TrueV;
- [CORESaved] public static Variable FalseV;
+ [CORESaved] public static BoxObject<int> TrueV;
+ [CORESaved] public static BoxObject<int> FalseV;
public static P6any MakeSub(SubInfo info, Frame outer) {
P6opaque n = new P6opaque(info.mo ?? CodeMO, 2);
@@ -5163,7 +5163,7 @@ internal class MMDCandidate : MultiCandidate {
info.code = SaferTrap;
}
public static Variable BoxAny<T>(T v, P6any proto) {
- if (proto == BoolMO.typeObject) {
+ if (proto == BoolMO.typeObj) {
if (v is bool)
return ((bool) (object) v) ? TrueV : FalseV;
else
@@ -5235,9 +5235,9 @@ internal class MMDCandidate : MultiCandidate {
public static Variable NewTypedScalar(STable t) {
if (t == null)
- return new SimpleVariable(null, null, AnyMO.typeObject);
+ return new SimpleVariable(null, null, AnyMO.typeObj);
- return new SimpleVariable(t, null, t.initObject);
+ return new SimpleVariable(t, null, t.initObj);
}
public static Variable NewRWListVar(P6any container) {
@@ -5717,8 +5717,8 @@ internal class MMDCandidate : MultiCandidate {
r.mo.role_typecheck_list = new List<STable>(prole.mo.role_typecheck_list);
r.mo.role_typecheck_list.Add(r);
r.mo.local_roles = prole.mo.local_roles;
- r.typeObject = r.initObject = new P6opaque(r);
- r.typeVar = r.initVar = r.typeObject;
+ r.typeObj = r.initObj = new P6opaque(r);
+ r.typeVar = r.initVar = r.typeObj;
foreach (var mi in prole.mo.lmethods)
r.mo.lmethods.Add(mi);
foreach (var ai in prole.mo.local_attr)
@@ -5753,8 +5753,8 @@ internal class MMDCandidate : MultiCandidate {
r.mo.type = P6how.ROLE;
r.mo.rtype = "role";
r.mo.role_typecheck_list = arg.mo.role_typecheck_list;
- r.typeObject = r.initObject = new P6opaque(r);
- r.typeVar = r.initVar = r.typeObject;
+ r.typeObj = r.initObj = new P6opaque(r);
+ r.typeVar = r.initVar = r.typeObj;
// Hack - reseat role to this closure-clone of methods
foreach (var mi in arg.mo.lmethods) {
var nmi = mi;
@@ -5885,9 +5885,9 @@ internal class MMDCandidate : MultiCandidate {
STable n = new STable(b.name + " but " + role.name);
n.how = BoxAny<STable>(n, b.how).Fetch();
- n.typeObject = n.initObject = new P6opaque(n);
- n.typeVar = n.initVar = n.typeObject;
- ((P6opaque)n.typeObject).slots = null;
+ n.typeObj = n.initObj = new P6opaque(n);
+ n.typeVar = n.initVar = n.typeObj;
+ ((P6opaque)n.typeObj).slots = null;
n.mo.superclasses.Add(b);
n.mo.local_roles.Add(role);
@@ -6102,9 +6102,9 @@ class LastFrameNode {
MuMO.FillProtoClass(null, new string[0], new STable[0]);
MuMO.Invalidate();
- // AnyMO.typeObject is needed very early, while setting up the
+ // AnyMO.typeObj is needed very early, while setting up the
// root $_
- AnyMO.typeObject = new P6opaque(AnyMO, 0);
+ AnyMO.typeObj = new P6opaque(AnyMO, 0);
Handler_Vonly(AnyMO, "list", new CtxAnyList(), null);
WrapIndexy(AnyMO, "postcircumfix:<[ ]>", new IxAnyAtPos(),
null, null, new IxAnyBindPos());
View
@@ -757,16 +757,16 @@ public class CLRWrapperProvider {
m.Invalidate();
m.box_type = t;
- m.typeObject = m.initObject = new BoxObject<object>(null, m);
- m.typeVar = m.initVar = m.typeObject;
+ m.typeObj = m.initObj = new BoxObject<object>(null, m);
+ m.typeVar = m.initVar = m.typeObj;
if (CLROpts.Debug) {
Console.WriteLine("--- Created box for {0} ---", m.name);
foreach (var o in m.mo.type_list)
Console.WriteLine("type {0}", o.name);
}
RuntimeUnit.reg.InstallFakeUnit("CLR," + t.AssemblyQualifiedName,
- m, m.who, m.how, m.mo, m.typeObject, m.typeVar);
+ m, m.who, m.how, m.mo, m.typeObj, m.typeVar);
return m;
}
View
@@ -66,7 +66,7 @@ public abstract class P6any: Variable, IFreeze {
}
public P6any GetTypeObject() {
- return mo.typeObject;
+ return mo.typeObj;
}
public string GetTypeName() {
@@ -719,9 +719,9 @@ public class DispatchSet {
STable n = new STable(stable.name);
n.how = Kernel.BoxAnyMO<STable>(n, Kernel.ClassHOWMO).Fetch();
- n.typeObject = n.initObject = new P6opaque(n);
- n.typeVar = n.initVar = n.typeObject;
- ((P6opaque)n.typeObject).slots = null;
+ n.typeObj = n.initObj = new P6opaque(n);
+ n.typeVar = n.initVar = n.typeObj;
+ ((P6opaque)n.typeObj).slots = null;
n.mo.local_roles.Add(stable);
n.mo.Compose();
@@ -895,7 +895,7 @@ public class STable: IFreeze {
public P6how mo;
public P6any how, who;
- public P6any typeObject, initObject;
+ public P6any typeObj, initObj;
public Variable typeVar, initVar;
public string name;
public bool useAcceptsType;
@@ -1112,8 +1112,8 @@ public class STable: IFreeze {
fb.ObjRef(mo);
fb.ObjRef(how);
fb.ObjRef(who);
- fb.ObjRef(typeObject);
- fb.ObjRef(initObject);
+ fb.ObjRef(typeObj);
+ fb.ObjRef(initObj);
fb.ObjRef(typeVar);
fb.ObjRef(initVar);
fb.String(name);
@@ -1129,8 +1129,8 @@ public class STable: IFreeze {
n.mo = (P6how)tb.ObjRef();
n.how = (P6any)tb.ObjRef();
n.who = (P6any)tb.ObjRef();
- n.typeObject = (P6any)tb.ObjRef();
- n.initObject = (P6any)tb.ObjRef();
+ n.typeObj = (P6any)tb.ObjRef();
+ n.initObj = (P6any)tb.ObjRef();
n.typeVar = (Variable)tb.ObjRef();
n.initVar = (Variable)tb.ObjRef();
n.name = tb.String();
@@ -1221,7 +1221,7 @@ public class P6opaque: P6any {
}
public override bool IsDefined() {
- return this != mo.typeObject;
+ return this != mo.typeObj;
}
public override void Freeze(FreezeBuffer fb) {

0 comments on commit 51f3253

Please sign in to comment.