get some old builtin code backonline and improve imports

This commit is contained in:
Torsten Ruger
2014-09-09 18:03:13 +03:00
parent 61e80d4f28
commit 5a5e977b8f
11 changed files with 25 additions and 24 deletions

View File

@ -31,7 +31,7 @@ module Builtin
context.object_space.add_object buffer # and save it (function local variable: a no no)
int = putint_function.receiver
moved_int = putint_function.new_local
utoa = context.object_space.get_or_create_class(:Object).resolve_function(:utoa)
utoa = context.object_space.get_or_create_class(:Object).resolve_method(:utoa)
putint_function.instance_eval do
mov( moved_int , int ) # move arg up
add( int , buffer ,nil ) # string to write to (add string address to pc)

View File

@ -24,22 +24,22 @@ module Builtin
# The at_index is just "below" the api, something we need but don't want to expose, so we can't code the above in ruby
def _get_instance_variable context , name = Virtual::Integer
get_function = Virtual::CompiledMethod.new(:_get_instance_variable , [ Virtual::Reference ] , Virtual::Reference ,Virtual::Mystery )
return get_function
# return get_function
me = get_function.receiver
var_name = get_function.args.first
return_to = get_function.return_type
index_function = context.object_space.get_or_create_class(:Object).resolve_function(:index_of)
get_function.push( [me] )
index = get_function.call( index_function )
index_function = ::Virtual::BootSpace.space.get_or_create_class(:Object).resolve_method(:index_of)
# get_function.push( [me] )
# index = get_function.call( index_function )
after_body = get_function.new_block("after_index")
get_function.current after_body
get_function.pop([me])
return_to.at_index( get_function , me , return_to )
# get_function.pop([me])
# return_to.at_index( get_function , me , return_to )
get_function.set_return return_to
# get_function.set_return return_to
return get_function
end
@ -50,7 +50,7 @@ module Builtin
me = set_function.receiver
var_name = set_function.args.first
return_to = set_function.return_type
index_function = context.object_space.get_or_create_class(:Object).resolve_function(:index_of)
index_function = context.object_space.get_or_create_class(:Object).resolve_method(:index_of)
set_function.push( [me] )
set_function.call( index_function )
after_body = set_function.new_block("after_index")