renamed adapter
seemed more appropriate as it makes the parfait work in the vm (i.e. adapts parfait)
This commit is contained in:
parent
422ec64105
commit
a28b41a5f5
@ -12,4 +12,4 @@ require "parfait/frame"
|
|||||||
require "parfait/space"
|
require "parfait/space"
|
||||||
|
|
||||||
#if we are in the ruby run-time / generating an executable
|
#if we are in the ruby run-time / generating an executable
|
||||||
require "virtual/compile_parfait"
|
require "virtual/parfait_adapter"
|
||||||
|
@ -7,7 +7,7 @@ The run-time needs to contain quite a lot of functionality for a dynamic system.
|
|||||||
And a large part of that functionality must actually be used at compile time too.
|
And a large part of that functionality must actually be used at compile time too.
|
||||||
|
|
||||||
We reuse the Parfait code at compile-time, to create the data for the compiled vm.
|
We reuse the Parfait code at compile-time, to create the data for the compiled vm.
|
||||||
To do this the vm (re) defines the object memory (in compile_parfait).
|
To do this the vm (re) defines the object memory (in parfait_adapter).
|
||||||
|
|
||||||
To do the actual compiling we parse and compile the parfait code and inline it to
|
To do the actual compiling we parse and compile the parfait code and inline it to
|
||||||
appropriate places (ie send, get_instance_variable etc). We have to inline to avoid recursion.
|
appropriate places (ie send, get_instance_variable etc). We have to inline to avoid recursion.
|
||||||
|
@ -6,11 +6,30 @@
|
|||||||
|
|
||||||
module FakeMem
|
module FakeMem
|
||||||
def initialize
|
def initialize
|
||||||
|
if( self.class.name == "Parfait::Space")
|
||||||
|
puts "YES , I am SPACE"
|
||||||
|
end
|
||||||
@memory = [0,nil]
|
@memory = [0,nil]
|
||||||
|
if Parfait::Space.object_space and Parfait::Space.object_space.objects
|
||||||
|
Parfait::Space.object_space.add_object self
|
||||||
|
puts "got it #{self.class.name}"
|
||||||
|
else
|
||||||
|
puts "it escaped #{self.class.name}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
def init_layout
|
||||||
|
class_name = self.class.name
|
||||||
|
puts "CLASS #{class_name}"
|
||||||
|
puts "Check for #{class_name}"
|
||||||
|
cl = Parfait::Space.space.get_class(class_name)
|
||||||
|
puts "found #{cl}" if cl
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
module Parfait
|
module Parfait
|
||||||
|
Space.class_eval do
|
||||||
|
attr_accessor :vm_objects
|
||||||
|
end
|
||||||
# Objects memory functions. Object memory is 1 based
|
# Objects memory functions. Object memory is 1 based
|
||||||
# but we implement it with ruby array (0 based) and use 0 as type-word
|
# but we implement it with ruby array (0 based) and use 0 as type-word
|
||||||
# These are the same functions that Builtin implements at run-time
|
# These are the same functions that Builtin implements at run-time
|
Loading…
x
Reference in New Issue
Block a user