forked from rubinius/rubinius
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompiled_method.rb
44 lines (39 loc) · 1.04 KB
/
compiled_method.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
module Rubinius
class CompiledMethod < Executable
def self.allocate
Ruby.primitive :compiledmethod_allocate
raise PrimitiveFailure, "CompiledMethod.allocate primitive failed"
end
def dup
Ruby.primitive :compiledmethod_dup
raise PrimitiveFailure, "CompiledMethod#dup primitive failed"
end
def jit_now
Ruby.primitive :compiledmethod_jit_now
raise PrimitiveFailure, "CompiledMethod#jit_now primitive failed"
end
def jit_soon
Ruby.primitive :compiledmethod_jit_soon
raise PrimitiveFailure, "CompiledMethod#jit_soon primitive failed"
end
# Return the CompiledMethod for caller of the method that called
# .of_sender.
#
# For example:
#
# def g
# f_cm = Rubinius::CompiledMethod.of_sender
# end
#
# def f
# g
# end
#
# f_cm is the CompiledMethod of f as requested by g.
#
def self.of_sender
Ruby.primitive :compiledmethod_of_sender
raise PrimitiveFailure, "CompiledMethod.of_sender failed"
end
end
end