Skip to content

Commit

Permalink
[mm] Link GLOBAL/PROCESS to $*FOO
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Sep 28, 2010
1 parent f5ecfd8 commit 465e4b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 1 addition & 8 deletions lib/Kernel.cs
Expand Up @@ -916,10 +916,8 @@ public class Kernel {
}
}

// XXX should be per-unit
public static Variable Global;
// used as the fallbacks for $*FOO
public static IP6 GlobalO;
public static Variable Process;
public static IP6 ProcessO;

static Kernel() {
Expand All @@ -938,11 +936,6 @@ public class Kernel {
ScalarMO = new DynMetaObject("Scalar");
ScalarMO.AddAttribute("value");
ScalarMO.Complete();

GlobalO = new CLRImportObject(new Dictionary<string,BValue>());
Global = NewROScalar(GlobalO);
ProcessO = new CLRImportObject(new Dictionary<string,BValue>());
Process = NewROScalar(ProcessO);
}

public static Dictionary<string, int> usedNames = new Dictionary<string, int>();
Expand Down
4 changes: 4 additions & 0 deletions src/CSharpBackend.pm
Expand Up @@ -124,6 +124,10 @@ sub stash2 {
push @decls, $p;
push @thaw, CgOp::rawsset($p, CgOp::rawnew('CLRImportObject',
CgOp::rawnew('Dictionary<string,BValue>')));
if (@{ $_->path } == 1 && $_->path->[0] =~ /^(?:GLOBAL|PROCESS)$/) {
push @thaw, CgOp::rawsset('Kernel.' . ucfirst(lc($_->path->[0])) .
'O', CgOp::rawsget($p));
}
}

# xxx check for SAFE::
Expand Down

0 comments on commit 465e4b7

Please sign in to comment.