Permalink
Browse files

Top removal: SubInfo.ctor, STable.ctor

  • Loading branch information...
sorear committed Nov 13, 2012
1 parent 532462b commit 8864bf61172b623ad61c8231ad1701d674eb7ab2
Showing with 93 additions and 83 deletions.
  1. +4 −4 lib/Builtins.cs
  2. +3 −2 lib/CodeGen.cs
  3. +3 −5 lib/Cursor.cs
  4. +70 −61 lib/Kernel.cs
  5. +7 −7 lib/NieczaCLR.cs
  6. +6 −4 lib/ObjModel.cs
View
@@ -2717,7 +2717,7 @@ class CrossSource: ItemSource {
while (Kernel.IterHasFlat(iter, true))
roles.Add(iter.Shift().Fetch().mo);
- STable n = new STable(obj.mo.name + "+" + Kernel.JoinS(",", roles));
+ STable n = new STable(c.setting, obj.mo.name + "+" + Kernel.JoinS(",", roles));
n.how = Kernel.BoxAny<STable>(n, obj.mo.how).Fetch();
n.typeObj = n.initObj = new P6opaque(n);
@@ -2800,7 +2800,7 @@ class CrossSource: ItemSource {
}
public static Variable enum_mixin_role(string name, P6any meth) {
- STable r = new STable('{' + name + '}');
+ STable r = new STable(meth.mo.setting, '{' + name + '}');
r.mo.FillRole(new STable[0], null);
r.typeObj = r.initObj = new P6opaque(r);
r.mo.AddMethod(0, name, meth);
@@ -2811,7 +2811,7 @@ class CrossSource: ItemSource {
// TODO: merge
public static Variable cat_mixin_role(string name, P6any meth) {
- STable r = new STable('{' + name + '}');
+ STable r = new STable(meth.mo.setting, '{' + name + '}');
r.mo.FillRole(new STable[0], null);
r.typeObj = r.initObj = new P6opaque(r);
r.mo.AddMethod(P6how.M_MULTI, name, meth);
@@ -2823,7 +2823,7 @@ class CrossSource: ItemSource {
public static Variable type_mixin_role(Variable type, Variable meth) {
STable stype = type.Fetch().mo;
string name = stype.name;
- STable r = new STable("ANON");
+ STable r = new STable(stype.setting, "ANON");
r.mo.FillRole(new STable[0], null);
r.typeObj = r.initObj = new P6opaque(r);
View
@@ -356,7 +356,7 @@ sealed class Tokens {
public static readonly MethodInfo Kernel_NewLabelVar =
typeof(Kernel).GetMethod("NewLabelVar");
public static readonly MethodInfo Kernel_MakeDispatcher =
- typeof(Kernel).GetMethod("MakeDispatcher");
+ typeof(Kernel).GetMethod("MakeDispatcherF");
public static readonly MethodInfo Kernel_Die =
typeof(Kernel).GetMethod("Die");
public static readonly MethodInfo Kernel_SFH =
@@ -2278,6 +2278,7 @@ class NamProcessor {
}
return CpsOp.MethodCall(Tokens.Kernel_MakeDispatcher,
+ CpsOp.CallFrame(),
CpsOp.StringLiteral(prefix), proto,
CpsOp.NewArray(Tokens.P6any, cands.ToArray()));
}
@@ -4331,7 +4332,7 @@ public class DowncallReceiver : CallReceiver {
STable nst = mof == null ? null : (STable)mof.GetValue(ru.setting);
if (nst == null) { // not all FooMO are initialized by kernel
- nst = new STable(name);
+ nst = new STable(ru.setting, name);
if (mof != null) mof.SetValue(ru.setting, nst);
}
// Hack - we don't clear the MRO here, because we might need
View
@@ -601,7 +601,7 @@ public sealed class RxFrame: IFreeze {
}
public Frame proto_dispatch(Frame th, Variable unused) {
- Frame nth = th.MakeChild(null, Lexer.StandardProtoSI, global.setting.AnyP);
+ Frame nth = th.MakeChild(null, th.info.setting.StandardLexerSI, global.setting.AnyP);
nth.pos = new Variable[] { MakeCursorV() };
return nth;
}
@@ -2147,8 +2147,6 @@ public class Lexer {
return ret;
}
- internal static SubInfo StandardProtoSI =
- new SubInfo("KERNEL protoregex", StandardProtoC);
internal static Frame StandardProtoC(Frame th) {
Variable[] al;
switch (th.ip) {
@@ -2183,13 +2181,13 @@ public class Lexer {
}
}
- public static P6any MakeDispatcher(string name, P6any proto, P6any[] cands) {
+ public static P6any MakeDispatcher(Compartment s, string name, P6any proto, P6any[] cands) {
if (proto != null) {
SubInfo si = new SubInfo(Kernel.GetInfo(proto));
si.param = new object[] { cands, null };
return Kernel.MakeSub(si, Kernel.GetOuter(proto));
} else {
- SubInfo si = new SubInfo(name, StandardProtoC);
+ SubInfo si = new SubInfo(s, name, StandardProtoC);
si.param = new object[] { cands, null };
si.ltm = new LADDispatcher();
return Kernel.MakeSub(si, null);
Oops, something went wrong.

0 comments on commit 8864bf6

Please sign in to comment.