Skip to content
Browse files

Run mainlines of modules at BEGIN time

  • Loading branch information...
1 parent 81deb74 commit 122ac5d0420dc4be6e347896104916c19b1db275 @sorear committed Oct 31, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −0 lib/CodeGen.cs
  2. +0 −3 lib/Kernel.cs
View
4 lib/CodeGen.cs
@@ -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") {
View
3 lib/Kernel.cs
@@ -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() {

0 comments on commit 122ac5d

Please sign in to comment.
Something went wrong with that request. Please try again.