Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Toss more dead code.
  • Loading branch information
jnthn committed May 18, 2013
1 parent 660b25c commit d048df5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 55 deletions.
28 changes: 2 additions & 26 deletions src/vm/jvm/QAST/Compiler.nqp
Expand Up @@ -2339,35 +2339,22 @@ class QAST::CompilerJAST {
has %!cuid_to_idx;
has @!jastmeth_names;
has @!cuids;
has @!names;
has @!lexical_name_lists;
has @!outer_mappings;
has @!callsites;
has %!callsite_map;
has @!handlers;

method BUILD() {
$!cur_idx := 0;
%!cuid_to_idx := {};
@!jastmeth_names := [];
@!cuids := [];
@!names := [];
@!lexical_name_lists := [];
@!outer_mappings := [];
@!callsites := [];
%!callsite_map := {};
@!handlers := [];
}

my $nolex := [[],[],[],[]];
my $noargs := [0,0,0,0];
method register_method($jastmeth, $cuid, $name, @handlers) {
method register_method($jastmeth, $cuid) {
%!cuid_to_idx{$cuid} := $!cur_idx;
nqp::push(@!jastmeth_names, $jastmeth.name);
nqp::push(@!cuids, $cuid);
nqp::push(@!names, $name);
nqp::push(@!lexical_name_lists, $nolex);
nqp::push(@!handlers, @handlers);
$!cur_idx := $!cur_idx + 1;
}

Expand All @@ -2381,15 +2368,6 @@ class QAST::CompilerJAST {
@!jastmeth_names[self.cuid_to_idx($cuid)]
}

method set_lexical_names($cuid, @ilex, @nlex, @slex, @olex) {
@!lexical_name_lists[self.cuid_to_idx($cuid)] := [@ilex, @nlex, @slex, @olex];
}

method set_outer($cuid, $outer_cuid) {
nqp::push(@!outer_mappings,
[self.cuid_to_idx($cuid), self.cuid_to_idx($outer_cuid)]);
}

method get_callsite_idx(@arg_types, @arg_names) {
my $key := join("-", @arg_types) ~ ';' ~ join("\0", @arg_names);
if nqp::existskey(%!callsite_map, $key) {
Expand Down Expand Up @@ -3033,12 +3011,11 @@ class QAST::CompilerJAST {
my $*JMETH := JAST::Method.new( :name(self.unique('qb_')), :returns('Void'), :static(0) );
$*JMETH.cr_name($node.name);
$*JMETH.cr_cuid($node.cuid);
$*CODEREFS.register_method($*JMETH, $node.cuid, $node.name, @handlers);
$*CODEREFS.register_method($*JMETH, $node.cuid);

# Set outer if we have one.
if nqp::istype($outer, BlockInfo) {
$*JMETH.cr_outer($outer.qast.cuid);
$*CODEREFS.set_outer($node.cuid, $outer.qast.cuid);
}

# Always take ThreadContext and callsite descriptor as arguments.
Expand All @@ -3063,7 +3040,6 @@ class QAST::CompilerJAST {

# Stash lexical names.
my @lex_names := $block.lexical_names_by_type();
$*CODEREFS.set_lexical_names($node.cuid, |@lex_names);
$*JMETH.cr_olex(@lex_names[$RT_OBJ]);
$*JMETH.cr_ilex(@lex_names[$RT_INT]);
$*JMETH.cr_nlex(@lex_names[$RT_NUM]);
Expand Down
16 changes: 0 additions & 16 deletions src/vm/jvm/runtime/org/perl6/nqp/runtime/CodeRef.java
Expand Up @@ -46,22 +46,6 @@ public CodeRef(CompilationUnit compUnit, MethodHandle mh,
handlers, this);
}

/**
* Sets up the code-ref data structure.
*/
public CodeRef(CompilationUnit compUnit, MethodHandle mh,
String name, String uniqueId,
String oLexicalNames, String iLexicalNames,
String nLexicalNames, String sLexicalNames,
long[][] handlers) {
staticInfo = new StaticCodeInfo(compUnit, mh, name,uniqueId,
oLexicalNames == null ? null : oLexicalNames.split("\\x00"),
iLexicalNames == null ? null : iLexicalNames.split("\\x00"),
nLexicalNames == null ? null : nLexicalNames.split("\\x00"),
sLexicalNames == null ? null : sLexicalNames.split("\\x00"),
handlers, this);
}

/**
* Clones the object.
*/
Expand Down
13 changes: 0 additions & 13 deletions src/vm/jvm/runtime/org/perl6/nqp/runtime/CompilationUnit.java
Expand Up @@ -174,19 +174,6 @@ public CodeRef lookupCodeRef(String uniqueId) {
return cuidToCodeRef.get(uniqueId);
}

/**
* Installs a static lexical value.
* XXX Legacy, can go after re-bootstrap.
*/
public SixModelObject setStaticLex(SixModelObject value, String name, String uniqueId) {
CodeRef cr = cuidToCodeRef.get(uniqueId);
Integer idx = cr.staticInfo.oTryGetLexicalIdx(name);
if (idx == null)
new RuntimeException("Invalid lexical name '" + name + "' in static lexical installation");
cr.staticInfo.oLexStatic[idx] = value;
return value;
}

/**
* Parses a bunch of info on static lexical values for a block and
* installs each of them. TODO: lazify so we don't do it for blocks we
Expand Down

0 comments on commit d048df5

Please sign in to comment.