Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Run mainlines of modules at BEGIN time
  • Loading branch information
sorear committed Nov 1, 2011
1 parent 81deb74 commit 122ac5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 4 additions & 0 deletions lib/CodeGen.cs
Expand Up @@ -4291,9 +4291,13 @@ public class DowncallReceiver : CallReceiver {
for (int i = 0; i < s.nam_refs.Length; i++)
s.nam_refs[i] = Handle.Unbox(args[i+3]);
s.code = RuntimeUnit.JitCompileSub;
if (s.protopad != null)
s.protopad.code = s.code;
return null;
} else if (cmd == "save_unit") {
RuntimeUnit ru = (RuntimeUnit)Handle.Unbox(args[1]);
if (!ru.is_mainish && ru.bottom == null)
ru.RunMainline();
ru.Save();
return null;
} else if (cmd == "run_unit") {
Expand Down
3 changes: 0 additions & 3 deletions lib/Kernel.cs
Expand Up @@ -786,9 +786,6 @@ public sealed class RuntimeUnit : IFreeze {

Kernel.FirePhasers(this, Kernel.PHASER_UNIT_INIT, false);
Kernel.FirePhasers(this, Kernel.PHASER_INIT, false);

if (!is_mainish && bottom == null && filename != "(eval)")
RunMainline();
}

internal void RunMainline() {
Expand Down

0 comments on commit 122ac5d

Please sign in to comment.