Skip to content

Commit

Permalink
[js] Remove dead code.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmurias committed Jul 22, 2016
1 parent e9e34f4 commit a98d5f5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 45 deletions.
21 changes: 0 additions & 21 deletions src/vm/js/Compiler.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -926,27 +926,6 @@ class QAST::CompilerJS does DWIMYNameMangling does SerializeOnce {
Chunk.void(|@capture_inners);
}

# Should we compile it to a form that's more efficent when used as a method
method looks_like_a_method(QAST::Block $block) {
# Disable it as we currently don't make use of it at runtime
return 0;

if $block.blocktype eq 'declaration_static'
&& nqp::istype($block[0], QAST::Stmts)
&& nqp::istype($block[0][0], QAST::Var)
&& $block[0][0].decl eq 'param'
&& !$block[0][0].default && !$block[0][0].named
&& $block.node() {
my $sub := nqp::rindex($block.node.orig(), "sub", $block.node.from());
my $method := nqp::rindex($block.node.orig(), "method", $block.node.from());

$method != -1 && $method > $sub;
}
else {
0;
}
}

method compile_block(QAST::Block $node, $outer, $outer_loop, :$want, :@extra_args=[], :$cps) {

my $outer_ctx := try $*CTX // "null";
Expand Down
24 changes: 0 additions & 24 deletions src/vm/js/nqp-runtime/code-ref.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,6 @@ CodeRef.prototype.capture = function(block) {
return this;
};

CodeRef.prototype.method = function(method) {
this.$call = function() {
var args = [];
args.push(arguments[0]);
args.push(arguments[1]);
for (var i = 3; i < arguments.length; i++) {
args.push(arguments[i]);
}
return method.apply(arguments[2], args);
};

/* TODO - think about cloning */

return this;
};

CodeRef.prototype.closure = function(block) {
var closure = new CodeRef(this.name, undefined);
Expand All @@ -74,15 +59,6 @@ CodeRef.prototype.closure = function(block) {
return closure;
};

CodeRef.prototype.closureMethod = function(block) {
var closure = new CodeRef(this.name, undefined);
closure.codeObj = this.codeObj;
closure.cuid = this.cuid;
closure.method(block);
closure.staticCode = this;
return closure;
};

CodeRef.prototype.CPS = function(block) {
this.$callCPS = block;
return this;
Expand Down

0 comments on commit a98d5f5

Please sign in to comment.