Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add SC data structure and SC tables.
  • Loading branch information
jnthn committed Jan 18, 2013
1 parent ba7a5bf commit 248a860
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/org/perl6/nqp/runtime/GlobalContext.java
Expand Up @@ -56,12 +56,25 @@ public class GlobalContext {
*/
private HashMap<String, HLLConfig> hllConfiguration;

/**
* Serialization context lookup hash.
*/
public HashMap<String, SerializationContext> scs;

/**
* Serialization context wrapper object hash.
*/
public HashMap<String, SixModelObject> scWrappers;

/**
* Initializes the runtime environment.
*/
public GlobalContext()
{
hllConfiguration = new HashMap<String, HLLConfig>();
scs = new HashMap<String, SerializationContext>();
scWrappers = new HashMap<String, SixModelObject>();

mainThread = new ThreadContext(this);
KnowHOWBootstrapper.bootstrap(mainThread);
setupConfig(hllConfiguration.get("")); // BOOT* not available earlier.
Expand Down
29 changes: 29 additions & 0 deletions src/org/perl6/nqp/runtime/SerializationContext.java
@@ -0,0 +1,29 @@
package org.perl6.nqp.runtime;

import java.util.ArrayList;

import org.perl6.nqp.sixmodel.STable;
import org.perl6.nqp.sixmodel.SixModelObject;

public class SerializationContext {
/* The handle of this SC. */
public String handle;

/* Description (probably the file name) if any. */
public String description;

/* The root set of objects that live in this SC. */
public ArrayList<SixModelObject> root_objects;

/* The root set of STables that live in this SC. */
public ArrayList<STable> root_stables;

/* The root set of code refs that live in this SC. */
public ArrayList<CodeRef> root_codes;

/* Repossession info. The following lists have matching indexes, each
* representing the integer of an object in our root set along with the SC
* that the object was originally from. */
public ArrayList<Integer> rep_indexes;
public ArrayList<SerializationContext> rep_scs;
}

0 comments on commit 248a860

Please sign in to comment.