rename code.length tp mem_length with lots of noise impact

This commit is contained in:
Torsten Ruger
2014-09-16 17:16:56 +03:00
parent cffa7f1953
commit 8b8a8eea56
14 changed files with 124 additions and 50 deletions

View File

@ -19,7 +19,7 @@ module Virtual
@codes = []
end
attr_reader :name , :codes , :method , :position
attr_reader :name , :codes , :method
attr_accessor :branch
def reachable ret = []
@ -58,13 +58,14 @@ module Virtual
def set_position at
@position = at
@codes.each do |code|
code.position = at
at += code.length
code.set_position( at)
raise code.inspect unless code.mem_length
at += code.mem_length
end
end
def length
@codes.inject(0){|count , instruction| count += instruction.length }
def mem_length
@codes.inject(0){|count , instruction| count += instruction.mem_length }
end
private