Skip to content

Commit

Permalink
Fix swap_stack
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoqun committed Nov 30, 2013
1 parent c21c8cb commit 6e17e2b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scripts/inject.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,7 @@ def setup_import_and_export(instruction)
instruction.exports.unshift(shuffle)
end
elsif instruction.op_code == :swap_stack
instruction.stack_produced.times.to_a.reverse.each do |index|
instruction.stack_produced.times.to_a.each do |index|
shuffle = create_oprand(DataFlow::Shuffle, index, instruction, :export)
instruction.exports.unshift(shuffle)
end
Expand Down Expand Up @@ -1543,20 +1543,20 @@ def pop_from_stack(stack, instruction)
end
when :swap_stack
source = stack.pop
shuffle1 = create_oprand(DataFlow::Shuffle, 1, instruction, :import)
shuffle1 = create_oprand(DataFlow::Shuffle, 0, instruction, :import)
create_data_flow(source, shuffle1)

source = stack.pop
shuffle2 = create_oprand(DataFlow::Shuffle, 0, instruction, :import)
shuffle2 = create_oprand(DataFlow::Shuffle, 1, instruction, :import)
create_data_flow(source, shuffle2)

when :kind_of
source = stack.pop
shuffle = create_oprand(DataFlow::Class, instruction)
shuffle = create_oprand(DataFlow::Object, instruction)
create_data_flow(source, shuffle)

source = stack.pop
shuffle = create_oprand(DataFlow::Object, instruction)
shuffle = create_oprand(DataFlow::Class, instruction)
create_data_flow(source, shuffle)
when :move_down
(instruction.stack_consumed + 1).times.to_a.reverse.each do |index|
Expand Down Expand Up @@ -3059,10 +3059,10 @@ def loo
loo
#code = Array.instance_method(:set_index).executable
#code = Array.instance_method(:bottom_up_merge).executable
code = method(:loo).executable
#code = method(:loo).executable
#code = "".method(:dump).executable
#code = "".method(:[]).executable
#code = [].method(:[]).executable
code = [].method(:[]).executable
#code = "".method(:start_with?).executable
#code = "".method(:start_with?).executable
#code = Enumerable.instance_method(:minmax).executable
Expand Down Expand Up @@ -3092,7 +3092,7 @@ def loo
opt.add_pass(Rubinius::Optimizer::DataFlowPrinter, "original")
opt.add_pass(Rubinius::Optimizer::StackPrinter, "original")
#opt.add_pass(Rubinius::Optimizer::PruneUnused)
opt.add_pass(Rubinius::Optimizer::Inliner)
#opt.add_pass(Rubinius::Optimizer::Inliner)
#opt.add_pass(Rubinius::Optimizer::PruneUnused)
opt.add_pass(Rubinius::Optimizer::FlowPrinter, "after")
#opt.add_pass(Rubinius::Optimizer::StackAnalyzer)
Expand Down

0 comments on commit 6e17e2b

Please sign in to comment.