Ruby
1.9.3p551(2014-11-13revision48407)
Main Page
Modules
Data Structures
Files
File List
Globals
iseq.h
Go to the documentation of this file.
1
/**********************************************************************
2
3
iseq.h -
4
5
$Author: usa $
6
created at: 04/01/01 23:36:57 JST
7
8
Copyright (C) 2004-2008 Koichi Sasada
9
10
**********************************************************************/
11
12
#ifndef RUBY_COMPILE_H
13
#define RUBY_COMPILE_H
14
15
#if defined __GNUC__ && __GNUC__ >= 4
16
#pragma GCC visibility push(default)
17
#endif
18
19
/* compile.c */
20
VALUE
rb_iseq_compile_node
(
VALUE
self
,
NODE
*node);
21
int
rb_iseq_translate_threaded_code
(
rb_iseq_t
*
iseq
);
22
VALUE
rb_iseq_build_from_ary
(
rb_iseq_t
*
iseq
,
VALUE
locals,
VALUE
args
,
23
VALUE
exception,
VALUE
body);
24
25
/* iseq.c */
26
VALUE
rb_iseq_load
(
VALUE
data
,
VALUE
parent,
VALUE
opt);
27
VALUE
rb_iseq_parameters
(
const
rb_iseq_t
*
iseq
,
int
is_proc);
28
struct
st_table
*
ruby_insn_make_insn_table
(
void
);
29
30
/* proc.c */
31
rb_iseq_t
*
rb_method_get_iseq
(
VALUE
body);
32
rb_iseq_t
*
rb_proc_get_iseq
(
VALUE
proc
,
int
*is_proc);
33
34
struct
rb_compile_option_struct
{
35
int
inline_const_cache
;
36
int
peephole_optimization
;
37
int
tailcall_optimization
;
38
int
specialized_instruction
;
39
int
operands_unification
;
40
int
instructions_unification
;
41
int
stack_caching
;
42
int
trace_instruction
;
43
int
debug_level
;
44
};
45
46
struct
iseq_insn_info_entry
{
47
unsigned
short
position
;
48
unsigned
short
line_no
;
49
unsigned
short
sp
;
50
};
51
52
struct
iseq_catch_table_entry
{
53
enum
catch_type
{
54
CATCH_TYPE_RESCUE
,
55
CATCH_TYPE_ENSURE
,
56
CATCH_TYPE_RETRY
,
57
CATCH_TYPE_BREAK
,
58
CATCH_TYPE_REDO
,
59
CATCH_TYPE_NEXT
60
}
type
;
61
VALUE
iseq
;
62
unsigned
long
start
;
63
unsigned
long
end
;
64
unsigned
long
cont
;
65
unsigned
long
sp
;
66
};
67
68
#define INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE (512)
69
70
struct
iseq_compile_data_storage
{
71
struct
iseq_compile_data_storage
*
next
;
72
unsigned
long
pos
;
73
unsigned
long
size
;
74
char
*
buff
;
75
};
76
77
struct
iseq_compile_data
{
78
/* GC is needed */
79
VALUE
err_info
;
80
VALUE
mark_ary
;
81
VALUE
catch_table_ary
;
/* Array */
82
83
/* GC is not needed */
84
struct
iseq_label_data
*
start_label
;
85
struct
iseq_label_data
*
end_label
;
86
struct
iseq_label_data
*
redo_label
;
87
VALUE
current_block
;
88
VALUE
ensure_node
;
89
VALUE
for_iseq
;
90
struct
iseq_compile_data_ensure_node_stack
*
ensure_node_stack
;
91
int
loopval_popped
;
/* used by NODE_BREAK */
92
int
cached_const
;
93
struct
iseq_compile_data_storage
*
storage_head
;
94
struct
iseq_compile_data_storage
*
storage_current
;
95
int
last_line
;
96
int
last_coverable_line
;
97
int
label_no
;
98
int
node_level
;
99
const
rb_compile_option_t
*
option
;
100
#if SUPPORT_JOKE
101
st_table
*labels_table;
102
#endif
103
};
104
105
/* defined? */
106
107
enum
defined_type
{
108
DEFINED_IVAR
= 1,
109
DEFINED_IVAR2
,
110
DEFINED_GVAR
,
111
DEFINED_CVAR
,
112
DEFINED_CONST
,
113
DEFINED_METHOD
,
114
DEFINED_YIELD
,
115
DEFINED_REF
,
116
DEFINED_ZSUPER
,
117
DEFINED_FUNC
118
};
119
120
#define DEFAULT_SPECIAL_VAR_COUNT 2
121
122
#if defined __GNUC__ && __GNUC__ >= 4
123
#pragma GCC visibility pop
124
#endif
125
126
#endif
/* RUBY_COMPILE_H */
DEFINED_IVAR2
Definition:
iseq.h:109
iseq_catch_table_entry::catch_type
catch_type
Definition:
iseq.h:53
iseq_compile_data_storage::size
unsigned long size
Definition:
iseq.h:73
st_table
Definition:
st.h:77
DEFINED_ZSUPER
Definition:
iseq.h:116
iseq_catch_table_entry::end
unsigned long end
Definition:
iseq.h:63
iseq_catch_table_entry::CATCH_TYPE_RETRY
Definition:
iseq.h:56
DEFINED_YIELD
Definition:
iseq.h:114
DEFINED_METHOD
Definition:
iseq.h:113
proc
VALUE proc
Definition:
tcltklib.c:2948
rb_compile_option_struct::inline_const_cache
int inline_const_cache
Definition:
iseq.h:35
iseq_compile_data::storage_head
struct iseq_compile_data_storage * storage_head
Definition:
iseq.h:93
iseq_compile_data::catch_table_ary
VALUE catch_table_ary
Definition:
iseq.h:81
rb_compile_option_struct::stack_caching
int stack_caching
Definition:
iseq.h:41
ruby_insn_make_insn_table
struct st_table * ruby_insn_make_insn_table(void)
rb_iseq_translate_threaded_code
int rb_iseq_translate_threaded_code(rb_iseq_t *iseq)
Definition:
compile.c:555
VALUE
unsigned long VALUE
Definition:
ruby.h:88
rb_compile_option_struct::operands_unification
int operands_unification
Definition:
iseq.h:39
iseq_compile_data::start_label
struct iseq_label_data * start_label
Definition:
iseq.h:84
iseq_compile_data_storage::next
struct iseq_compile_data_storage * next
Definition:
iseq.h:71
iseq_insn_info_entry::sp
unsigned short sp
Definition:
iseq.h:49
rb_compile_option_struct::peephole_optimization
int peephole_optimization
Definition:
iseq.h:36
rb_iseq_compile_node
VALUE rb_iseq_compile_node(VALUE self, NODE *node)
Definition:
compile.c:462
iseq_compile_data::ensure_node_stack
struct iseq_compile_data_ensure_node_stack * ensure_node_stack
Definition:
iseq.h:90
args
VALUE VALUE args
Definition:
tcltklib.c:2550
iseq_compile_data::current_block
VALUE current_block
Definition:
iseq.h:87
iseq_compile_data::option
const rb_compile_option_t * option
Definition:
iseq.h:99
rb_compile_option_struct::tailcall_optimization
int tailcall_optimization
Definition:
iseq.h:37
RNode
Definition:
ripper.y:236
iseq_catch_table_entry::type
enum iseq_catch_table_entry::catch_type type
iseq_compile_data_storage::pos
unsigned long pos
Definition:
iseq.h:72
data
void * data
Definition:
yaml2byte.c:131
rb_compile_option_struct::specialized_instruction
int specialized_instruction
Definition:
iseq.h:38
iseq_catch_table_entry::CATCH_TYPE_RESCUE
Definition:
iseq.h:54
iseq_compile_data::mark_ary
VALUE mark_ary
Definition:
iseq.h:80
rb_compile_option_struct::instructions_unification
int instructions_unification
Definition:
iseq.h:40
iseq_compile_data::last_line
int last_line
Definition:
iseq.h:95
iseq_compile_data_storage
Definition:
iseq.h:70
DEFINED_CVAR
Definition:
iseq.h:111
iseq_catch_table_entry::start
unsigned long start
Definition:
iseq.h:62
iseq_catch_table_entry::CATCH_TYPE_ENSURE
Definition:
iseq.h:55
iseq_catch_table_entry::CATCH_TYPE_NEXT
Definition:
iseq.h:59
defined_type
defined_type
Definition:
iseq.h:107
DEFINED_CONST
Definition:
iseq.h:112
rb_iseq_build_from_ary
VALUE rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args, VALUE exception, VALUE body)
Definition:
compile.c:5452
iseq_compile_data::redo_label
struct iseq_label_data * redo_label
Definition:
iseq.h:86
rb_proc_get_iseq
rb_iseq_t * rb_proc_get_iseq(VALUE proc, int *is_proc)
Definition:
proc.c:657
rb_compile_option_struct::debug_level
int debug_level
Definition:
iseq.h:43
iseq_compile_data
Definition:
iseq.h:77
iseq_catch_table_entry
Definition:
iseq.h:52
DEFINED_IVAR
Definition:
iseq.h:108
rb_iseq_load
VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt)
Definition:
iseq.c:544
iseq_catch_table_entry::CATCH_TYPE_BREAK
Definition:
iseq.h:57
iseq_compile_data::err_info
VALUE err_info
Definition:
iseq.h:79
DEFINED_GVAR
Definition:
iseq.h:110
iseq_compile_data_storage::buff
char * buff
Definition:
iseq.h:74
iseq_catch_table_entry::CATCH_TYPE_REDO
Definition:
iseq.h:58
iseq_catch_table_entry::sp
unsigned long sp
Definition:
iseq.h:65
iseq_insn_info_entry
Definition:
iseq.h:46
iseq_compile_data::ensure_node
VALUE ensure_node
Definition:
iseq.h:88
rb_compile_option_struct::trace_instruction
int trace_instruction
Definition:
iseq.h:42
iseq_compile_data::cached_const
int cached_const
Definition:
iseq.h:92
iseq_compile_data::for_iseq
VALUE for_iseq
Definition:
iseq.h:89
iseq_compile_data::storage_current
struct iseq_compile_data_storage * storage_current
Definition:
iseq.h:94
DEFINED_FUNC
Definition:
iseq.h:117
iseq_compile_data::last_coverable_line
int last_coverable_line
Definition:
iseq.h:96
iseq_insn_info_entry::line_no
unsigned short line_no
Definition:
iseq.h:48
rb_method_get_iseq
rb_iseq_t * rb_method_get_iseq(VALUE body)
Definition:
proc.c:1704
rb_compile_option_struct
Definition:
iseq.h:34
rb_iseq_struct
Definition:
vm_core.h:151
iseq_catch_table_entry::cont
unsigned long cont
Definition:
iseq.h:64
iseq_compile_data::end_label
struct iseq_label_data * end_label
Definition:
iseq.h:85
iseq_compile_data::loopval_popped
int loopval_popped
Definition:
iseq.h:91
iseq_catch_table_entry::iseq
VALUE iseq
Definition:
iseq.h:61
iseq_compile_data::label_no
int label_no
Definition:
iseq.h:97
iseq_compile_data::node_level
int node_level
Definition:
iseq.h:98
DEFINED_REF
Definition:
iseq.h:115
iseq_insn_info_entry::position
unsigned short position
Definition:
iseq.h:47
rb_iseq_parameters
VALUE rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
Definition:
iseq.c:1388
iseq_compile_data_ensure_node_stack
Definition:
compile.c:72
iseq_label_data
Definition:
compile.c:42
Generated by
1.8.5