fix mod4 name
really did div4
This commit is contained in:
@ -20,6 +20,9 @@ module Mom
|
||||
@cache_entry = cache_entry
|
||||
end
|
||||
|
||||
def to_s
|
||||
"ResolveMethod #{name}"
|
||||
end
|
||||
|
||||
# When the method is resolved, a cache_entry is used to hold the result.
|
||||
# That cache_entry (holding type and method) is checked before, and
|
||||
|
@ -44,10 +44,9 @@ module Parfait
|
||||
@arguments_type = arguments_type
|
||||
@frame_type = frame_type
|
||||
@binary = BinaryCode.new(0)
|
||||
source = "_init_method"
|
||||
name = "#{@for_type.name}.#{@name}"
|
||||
@risc_instructions = Risc.label(source, name)
|
||||
@risc_instructions << Risc.label( source, "unreachable")
|
||||
@risc_instructions = Risc.label(self, name)
|
||||
@risc_instructions << Risc.label( self, "unreachable")
|
||||
end
|
||||
|
||||
def translate_cpu(translator)
|
||||
|
@ -181,7 +181,7 @@ module Risc
|
||||
end
|
||||
|
||||
obj = space.get_class_by_name(:Integer)
|
||||
[ :putint, :mod4, :div10, :+ , :- , :*].each do |f| #mod4 is just a forward declaration
|
||||
[ :putint, :div4, :div10, :+ , :- , :*].each do |f| #div4 is just a forward declaration
|
||||
obj.instance_type.add_method Builtin::Integer.send(f , nil)
|
||||
end
|
||||
end
|
||||
|
@ -5,9 +5,9 @@ module Risc
|
||||
module ClassMethods
|
||||
include CompileHelper
|
||||
|
||||
def mod4(context)
|
||||
source = "mod4"
|
||||
compiler = compiler_for(:Integer,:mod4 ,{})
|
||||
def div4(context)
|
||||
source = "div4"
|
||||
compiler = compiler_for(:Integer,:div4 ,{})
|
||||
builder = compiler.builder(true, compiler.method)
|
||||
me = builder.add_known( :receiver )
|
||||
builder.reduce_int( source , me )
|
||||
|
Reference in New Issue
Block a user