3 Ruby.primitive :vm_stats
4 raise PrimitiveFailure, "primitive failed"
7 def self.load_library(path, name)
8 Ruby.primitive :load_library
9 raise PrimitiveFailure, "primitive failed"
12 def self.reset_method_cache(sym)
13 Ruby.primitive :reset_method_cache
14 raise PrimitiveFailure, "primitive failed"
17 def self.save_encloser_path
18 Ruby.primitive :save_encloser_path
19 raise PrimitiveFailure, "primitive failed"
22 def self.restore_encloser_path
23 Ruby.primitive :restore_encloser_path
24 raise PrimitiveFailure, "primitive failed"
27 def self.coerce_to_array(object)
28 array = object.respond_to?(:to_a) ? object.to_a : [object]
29 raise TypeError.new("`to_a' did not return Array") unless array.is_a?(Array)
33 # Semantics of this are very important. ret MUST be returned.
34 def self.perform_hook(obj, meth, arg, ret)
35 # The VM already verified the method exists
36 obj.__send__(meth, arg)
40 def self.spawn_prim(args)
41 Ruby.primitive :machine_new
42 raise PrimitiveFailure, "primitive failed"
46 Ruby.primitive :machine_join
47 raise PrimitiveFailure, "primitive failed"
51 Ruby.primitive :machine_get_message
52 raise PrimitiveFailure, "primitive failed"
55 def self.send_message(id, obj)
56 Ruby.primitive :machine_send_message
57 raise PrimitiveFailure, "primitive failed"