Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
more attempts at optimization
  • Loading branch information
diakopter committed Nov 8, 2011
1 parent 71853d0 commit 2941d14
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions lua/compiler/PAST2LSTCompiler.pm
Expand Up @@ -484,8 +484,9 @@ our multi sub lst_for(PAST::Block $block) {
# low level code object.
if $block.blocktype eq 'immediate' {
return LST::MethodCall.new(
:name('[1]:Invoke'), :type('RakudoObject'),
:name('[1][3]'), :type('RakudoObject'),
"StaticBlockInfo[$our_sbi]",
"StaticBlockInfo[$our_sbi][1]",
TC(),
"StaticBlockInfo[$our_sbi]",
LST::MethodCall.new(
Expand Down Expand Up @@ -590,20 +591,22 @@ our multi sub lst_for(PAST::Op $op) {
my $callee := LST::Local.new(
:name(get_unique_id('callee')), :isdecl(1), :type('RakudoObject'),
LST::MethodCall.new(
:on($inv.name), :name('[1]:FindMethod'), :type('RakudoObject'),
:on($inv.name ~ '[1]'), :name('[2]'), :type('RakudoObject'),
$inv.name ~ '[1]',
TC(),
$inv.name,
$name,
'Hints.NO_HINT'
'-1'
)
);

# Emit the call.
return LST::Stmts.new(
$inv,
LST::MethodCall.new(
:name('[1]:Invoke'), :type('RakudoObject'),
:name('[1][3]'), :type('RakudoObject'),
$callee,
$callee.name ~ '[1]',
TC(),
$callee.name,
form_capture(@args, $inv)
Expand All @@ -629,8 +632,9 @@ our multi sub lst_for(PAST::Op $op) {

# Emit call.
return LST::MethodCall.new(
:name('[1]:Invoke'), :type('RakudoObject'),
:name('[1][3]'), :type('RakudoObject'),
$callee,
$callee.name ~ '[1]',
TC(),
$callee.name,
form_capture(@args)
Expand Down
2 changes: 1 addition & 1 deletion lua/runtime/Runtime/Ops/Metamodel.lua
Expand Up @@ -87,7 +87,7 @@ end
Ops[55] = Ops.type_check;

function Ops.publish_type_check_cache(TC, WHAT, TypeList)
WHAT.STable.TypeCheckCache = TypeList.Storage;
WHAT.STable.TypeCheckCache = TypeList.Storage:Clone();
end
Ops[56] = Ops.publish_type_check_cache;

Expand Down

0 comments on commit 2941d14

Please sign in to comment.