Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Set up the __6MODEL_CORE__ SC.
  • Loading branch information
jnthn committed Jan 18, 2013
1 parent 3f98780 commit 3094a4b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/org/perl6/nqp/sixmodel/KnowHOWBootstrapper.java
Expand Up @@ -60,7 +60,16 @@ private static void bootstrapKnowHOW(ThreadContext tc, CompilationUnit knowhowUn

/* Associate the created objects with the initial core serialization
* context. */
/* XXX TODO */
SerializationContext sc = new SerializationContext("__6MODEL_CORE__");
tc.gc.scs.put("__6MODEL_CORE__", sc);
sc.root_objects.add(knowhow);
knowhow.sc = sc;
sc.root_objects.add(knowhow_how);
knowhow_how.sc = sc;
sc.root_stables.add(knowhow.st);
knowhow.st.sc = sc;
sc.root_stables.add(knowhow_how.st);
knowhow_how.st.sc = sc;

/* Stash the created KnowHOW. */
tc.gc.KnowHOW = knowhow;
Expand Down Expand Up @@ -90,6 +99,14 @@ private static void bootstrapKnowHOWAttribute(ThreadContext tc, CompilationUnit
type_obj.st.MethodCache = meta_obj.methods;
type_obj.st.ModeFlags = STable.METHOD_CACHE_AUTHORITATIVE;

/* Associate the created object with the intial core serialization
* context. */
SerializationContext sc = tc.gc.scs.get("__6MODEL_CORE__");
sc.root_objects.add(type_obj);
type_obj.sc = sc;
sc.root_stables.add(type_obj.st);
type_obj.st.sc = sc;

/* Stash the created type object. */
tc.gc.KnowHOWAttribute = type_obj;
}
Expand Down

0 comments on commit 3094a4b

Please sign in to comment.