Created
March 19, 2015 20:20
-
-
Save peschwa/f37c69a4e97814ddfc6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/vm/jvm/QAST/Compiler.nqp b/src/vm/jvm/QAST/Compiler.nqp | |
index c545b1c..3bf55b3 100644 | |
--- a/src/vm/jvm/QAST/Compiler.nqp | |
+++ b/src/vm/jvm/QAST/Compiler.nqp | |
@@ -4165,13 +4165,20 @@ class QAST::CompilerJAST { | |
} | |
} | |
- # Both lexicalref and attributeref in the context we want a | |
- # non-object devolve to lexical and attribute, since we'd only | |
- # de-ref right away anyway. | |
my $want := $*WANT; | |
- if nqp::defined($want) && $want != $RT_OBJ { | |
- $scope := 'lexical' if $scope eq 'lexicalref'; | |
- $scope := 'attribute' if $scope eq 'attributeref'; | |
+ # If we know what we're after, some opts: | |
+ if nqp::isconcrete($want) { | |
+ if $want == $RT_VOID { | |
+ return result(JAST::Instruction.new(:op('nop')), $RT_VOID); | |
+ } | |
+ | |
+ # Both lexicalref and attributeref in the context we want a | |
+ # non-object devolve to lexical and attribute, since we'd only | |
+ # de-ref right away anyway. | |
+ if nqp::defined($want) && $want != $RT_OBJ { | |
+ $scope := 'lexical' if $scope eq 'lexicalref'; | |
+ $scope := 'attribute' if $scope eq 'attributeref'; | |
+ } | |
} | |
# Now go by scope. | |
@@ -4312,13 +4319,6 @@ class QAST::CompilerJAST { | |
"getlex_{$c}_si", $jtype, $TYPE_CF, 'Integer', 'Integer' )); | |
} | |
- if $ref { | |
- # Need to de-ref the container. | |
- $il.append($ALOAD_1); | |
- $il.append(JAST::Instruction.new( :op('invokestatic'), $TYPE_OPS, | |
- "decont_{typechar($reftype)}", jtype($reftype), $TYPE_SMO, $TYPE_TC )); | |
- } | |
- | |
return result($il, $type); | |
} | |
elsif $scope eq 'lexicalref' { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment