Permalink
Browse files

use UUIDs instead of Run. to segragate runtime and compiler module ve…

…rsions; build is quite shot at this point
  • Loading branch information...
1 parent da13155 commit 9ce3bae6fe4721b5572a3aa80826b024cd2172fe @sorear committed Nov 21, 2012
Showing with 8 additions and 21 deletions.
  1. +3 −3 Makefile
  2. +0 −8 lib/CodeGen.cs
  3. +3 −8 lib/Kernel.cs
  4. +2 −2 lib/Serialize.cs
View
@@ -22,13 +22,13 @@ srcunits=CClass CgOp Op OpHelpers Sig RxOp STD NieczaGrammar OptRxSimple \
Operator NieczaActions NieczaFrontendSTD NieczaPassSimplifier \
OptBeta NieczaPathSearch NieczaBackendDotnet NieczaCompiler GetOptLong
-all: run/Niecza.exe run/Run.Kernel.dll obj/Run.CORE.dll
+all: run/Niecza.exe run/Run.Kernel.dll obj/CORE.dll
$(patsubst %,boot/obj/Run.%.ser,$(srcunits)): boot/obj/Run.%.ser: .fetch-stamp src/%.pm6 boot/obj/Run.CORE.ser
cd src && NIECZA_KEEP_IL=1 $(RUN_CLR) ../boot/run/Niecza.exe --obj-dir ../boot/obj -C $*
# hack - put VERSION info in place so the setting build can embed it
-obj/Run.CORE.dll: run/Niecza.exe obj/Run.Kernel.dll lib/CORE.setting
+obj/CORE.dll: run/Niecza.exe obj/Run.Kernel.dll lib/CORE.setting
@git describe --tags > VERSION
$(RUN_CLR) run/Niecza.exe --obj-dir obj -C CORE
@@ -78,7 +78,7 @@ aot: all
test: all
$(RUN_CLR) run/Niecza.exe --obj-dir obj -c test.pl
- prove -e "$(RUN_CLR)" obj/Run.MAIN.exe
+ prove -e "$(RUN_CLR)" obj/MAIN.exe
spectest: all
@t/run_spectests
View
@@ -3002,12 +3002,6 @@ class NamProcessor {
return CpsOp.MethodCall(mi, rst); };
handlers["rawscall"] = delegate(NamProcessor th, object[] z) {
string name = JScalar.S(z[1]);
- // Horrible, horrible hack. We need to redirect references
- // to CompilerBlob while compiling the compiler because
- // otherwise they will be resolved to the compiler compiler's
- // copy.
- if (Backend.prefix == "Run.")
- name = name.Replace("CompilerBlob", "Run.CompilerBlob");
int ixn = name.LastIndexOf(':');
Type cpsrt = null;
if (ixn >= 0) {
@@ -3419,8 +3413,6 @@ class NamProcessor {
public class Backend {
[TrueGlobal]
- public static string prefix = (typeof(Backend).Assembly.GetName().Name == "Kernel") ? "" : "Run.";
- [TrueGlobal]
public static bool cross_level_load;
public static string LocStr(string fo, int lo, string fn, int ln) {
View
@@ -734,8 +734,8 @@ public sealed class RuntimeUnit : IFreeze {
if (name == "CORE")
Kernel.CreateBasicTypes(setting);
- this.asm_name = Backend.prefix + name.Replace("::", ".");
- this.dll_name = asm_name + (main ? ".exe" : ".dll");
+ this.asm_name = name.Replace("::", ".") + "." + Guid.NewGuid(); // force unique assembly names so that we can load multiple versions in a process
+ this.dll_name = name.Replace("::", ".") + (main ? ".exe" : ".dll");
our_subs = new List<SubInfo>();
}
@@ -6766,26 +6766,21 @@ class LastFrameNode {
// procedure, because initial code generation makes Run.CORE
// and we need to turn it into CORE for the compiler proper.
- if (Backend.prefix != "") {
- Console.Error.WriteLine("-gen-app may only be used with Kernel.dll");
- Environment.Exit(1);
- }
+ // this needs to be rethought for the new segregation model
string exename = args[1];
string fromdir = args[2];
// allow loading of Run. files, but don't try to load the
// assemblies, since we're not Run.Kernel
comp.obj_dir = fromdir;
- Backend.prefix = "Run.";
Backend.cross_level_load = true;
RuntimeUnit root = (RuntimeUnit)
comp.reg.LoadUnit("MAIN").root;
// reset for writing
comp.obj_dir = AppDomain.CurrentDomain.BaseDirectory;
- Backend.prefix = "";
RewriteUnits(root, root, new HashSet<RuntimeUnit>());
View
@@ -151,7 +151,7 @@ struct ObjRef {
return units[name];
}
- string file = Path.Combine(setting.obj_dir, Backend.prefix +
+ string file = Path.Combine(setting.obj_dir,
name.Replace("::",".") + ".ser");
byte[] bytes = File.ReadAllBytes(file);
@@ -203,7 +203,7 @@ struct ObjRef {
throw new InvalidOperationException("unit " +name+ " exists");
bool success = false;
- string file = Path.Combine(setting.obj_dir, Backend.prefix +
+ string file = Path.Combine(setting.obj_dir,
name.Replace("::",".") + ".ser");
FreezeBuffer fb = new FreezeBuffer(this, su);

0 comments on commit 9ce3bae

Please sign in to comment.