Ruby
1.9.3p484(2013-11-22revision43786)
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 */
127
Generated on Fri Nov 22 2013 07:04:12 for Ruby by
1.8.3