Ruby
2.5.0dev(2017-10-22revision60238)
|
#include "internal.h"
#include "ruby/util.h"
#include "eval_intern.h"
#include "gc.h"
#include "vm_core.h"
#include "iseq.h"
#include "id_table.h"
#include "insns.inc"
#include "insns_info.inc"
#include "node_name.inc"
Go to the source code of this file.
Data Structures | |
struct | set_specifc_data |
Macros | |
#define | hidden_obj_p(obj) (!SPECIAL_CONST_P(obj) && !RBASIC(obj)->klass) |
#define | SET_COMPILE_OPTION(o, h, mem) |
#define | SET_COMPILE_OPTION_NUM(o, h, mem) |
#define | SET_COMPILE_OPTION(o, h, mem) rb_hash_aset((h), ID2SYM(rb_intern(#mem)), (o)->mem ? Qtrue : Qfalse) |
#define | SET_COMPILE_OPTION_NUM(o, h, mem) rb_hash_aset((h), ID2SYM(rb_intern(#mem)), INT2NUM((o)->mem)) |
#define | CHECK_ARRAY(v) rb_convert_type_with_id((v), T_ARRAY, "Array", idTo_ary) |
#define | CHECK_HASH(v) rb_convert_type_with_id((v), T_HASH, "Hash", idTo_hash) |
#define | CHECK_STRING(v) rb_convert_type_with_id((v), T_STRING, "String", idTo_str) |
#define | CHECK_SYMBOL(v) rb_convert_type_with_id((v), T_SYMBOL, "Symbol", idTo_sym) |
#define | INITIALIZED volatile /* suppress warnings by gcc 4.8 */ |
#define | DECL_SYMBOL(name) static VALUE sym_##name |
#define | INIT_SYMBOL(name) sym_##name = ID2SYM(rb_intern(#name)) |
#define | PARAM_TYPE(type) rb_ary_push(a = rb_ary_new2(2), ID2SYM(type)) |
#define | PARAM_ID(i) iseq->body->local_table[(i)] |
#define | PARAM(i, type) |
Variables | |
VALUE | rb_cISeq |
#define CHECK_ARRAY | ( | v | ) | rb_convert_type_with_id((v), T_ARRAY, "Array", idTo_ary) |
#define CHECK_HASH | ( | v | ) | rb_convert_type_with_id((v), T_HASH, "Hash", idTo_hash) |
#define CHECK_STRING | ( | v | ) | rb_convert_type_with_id((v), T_STRING, "String", idTo_str) |
#define CHECK_SYMBOL | ( | v | ) | rb_convert_type_with_id((v), T_SYMBOL, "Symbol", idTo_sym) |
#define hidden_obj_p | ( | obj | ) | (!SPECIAL_CONST_P(obj) && !RBASIC(obj)->klass) |
#define INITIALIZED volatile /* suppress warnings by gcc 4.8 */ |
#define PARAM | ( | i, | |
type | |||
) |
Referenced by rb_iseq_parameters().
#define PARAM_ID | ( | i | ) | iseq->body->local_table[(i)] |
Referenced by rb_iseq_parameters().
#define PARAM_TYPE | ( | type | ) | rb_ary_push(a = rb_ary_new2(2), ID2SYM(type)) |
Referenced by rb_iseq_parameters().
#define SET_COMPILE_OPTION | ( | o, | |
h, | |||
mem | |||
) |
#define SET_COMPILE_OPTION | ( | o, | |
h, | |||
mem | |||
) | rb_hash_aset((h), ID2SYM(rb_intern(#mem)), (o)->mem ? Qtrue : Qfalse) |
#define SET_COMPILE_OPTION_NUM | ( | o, | |
h, | |||
mem | |||
) |
#define SET_COMPILE_OPTION_NUM | ( | o, | |
h, | |||
mem | |||
) | rb_hash_aset((h), ID2SYM(rb_intern(#mem)), INT2NUM((o)->mem)) |
void Init_ISeq | ( | void | ) |
Definition at line 2460 of file iseq.c.
References rb_cISeq, rb_cObject, rb_cRubyVM, rb_define_class_under(), rb_define_method(), and rb_undef_alloc_func().
VALUE rb_insn_operand_intern | ( | const rb_iseq_t * | iseq, |
VALUE | insn, | ||
int | op_no, | ||
VALUE | op, | ||
int | len, | ||
size_t | pos, | ||
const VALUE * | pnop, | ||
VALUE | child | ||
) |
Definition at line 1287 of file iseq.c.
References rb_iseq_struct::body, level, rb_iseq_constant_body::local_table, rb_iseq_constant_body::local_table_size, rb_iseq_constant_body::parent_iseq, PRIdVALUE, PRIuVALUE, Qundef, rb_sprintf(), and VM_ENV_DATA_SIZE.
Referenced by rb_iseq_disasm_insn().
Definition at line 704 of file iseq.c.
References rb_iseq_realpath().
Definition at line 280 of file iseq.c.
References ISEQ_MARK_ARY, and rb_ary_push().
Definition at line 716 of file iseq.c.
References rb_iseq_location_struct::base_label, rb_iseq_struct::body, and rb_iseq_constant_body::location.
Definition at line 680 of file iseq.c.
References Qnil, and rb_iseq_compile_with_option().
rb_iseq_t* rb_iseq_compile_on_base | ( | VALUE | src, |
VALUE | file, | ||
VALUE | line, | ||
const struct rb_block * | base_block | ||
) |
Definition at line 686 of file iseq.c.
References Qnil, and rb_iseq_compile_with_option().
rb_iseq_t* rb_iseq_compile_with_option | ( | VALUE | src, |
VALUE | file, | ||
VALUE | realpath, | ||
VALUE | line, | ||
const struct rb_block * | base_block, | ||
VALUE | opt | ||
) |
Definition at line 632 of file iseq.c.
References GET_THREAD, and NULL.
Referenced by rb_iseq_compile(), and rb_iseq_compile_on_base().
Definition at line 743 of file iseq.c.
References ISEQ_COVERAGE.
VALUE rb_iseq_defined_string | ( | enum defined_type | type | ) |
Definition at line 2211 of file iseq.c.
References GET_VM, numberof, OBJ_FREEZE, rb_gc_register_mark_object(), rb_str_new_cstr(), and ruby_xcalloc().
Definition at line 1515 of file iseq.c.
References rb_iseq_struct::body, rb_iseq_constant_body::iseq_size, rb_ary_tmp_new(), rb_secure(), rb_str_cat2(), rb_str_concat(), rb_str_new(), and size.
int rb_iseq_disasm_insn | ( | VALUE | ret, |
const VALUE * | code, | ||
size_t | pos, | ||
const rb_iseq_t * | iseq, | ||
VALUE | child | ||
) |
Disassemble a instruction Iseq -> Iseq inspect object.
Definition at line 1431 of file iseq.c.
References len, PRIuSIZE, rb_insn_operand_intern(), rb_str_cat2(), rb_str_catf(), rb_str_concat(), and rb_str_new().
Referenced by rb_vmdebug_debug_print_pre().
Definition at line 722 of file iseq.c.
References rb_iseq_struct::body, rb_iseq_location_struct::first_lineno, and rb_iseq_constant_body::location.
Definition at line 70 of file iseq.c.
References rb_iseq_struct::body, rb_iseq_constant_body::catch_table, rb_iseq_constant_body::cc_entries, rb_iseq_constant_body::ci_entries, rb_iseq_constant_body::ci_kw_size, rb_iseq_constant_body::ci_size, rb_iseq_constant_body::is_entries, rb_iseq_constant_body::iseq_encoded, rb_iseq_constant_body::keyword, rb_call_info_with_kwarg::kw_arg, rb_iseq_constant_body::line_info_table, rb_iseq_constant_body::local_table, NULL, rb_iseq_constant_body::opt_table, rb_iseq_constant_body::param, RUBY_FREE_ENTER, and ruby_xfree().
Definition at line 710 of file iseq.c.
References rb_iseq_struct::body, rb_iseq_location_struct::label, and rb_iseq_constant_body::location.
Definition at line 512 of file iseq.c.
References rb_check_funcall(), rb_cISeq, rb_intern, RBASIC_CLASS, and SPECIAL_CONST_P.
void rb_iseq_make_compile_option | ( | rb_compile_option_t * | option, |
VALUE | opt | ||
) |
Definition at line 401 of file iseq.c.
References Check_Type, and T_HASH.
Definition at line 106 of file iseq.c.
References rb_iseq_struct::aux, rb_iseq_location_struct::base_label, rb_iseq_struct::body, iseq_compile_data::catch_table_ary, iseq_compile_data::err_info, FL_TEST, ISEQ_COMPILE_DATA, ISEQ_NOT_LOADED_YET, rb_iseq_location_struct::label, rb_iseq_struct::loader, rb_iseq_constant_body::location, iseq_compile_data::mark_ary, rb_iseq_constant_body::mark_ary, rb_iseq_constant_body::parent_iseq, rb_iseq_location_struct::pathobj, rb_gc_mark(), RUBY_MARK_ENTER, RUBY_MARK_LEAVE, and RUBY_MARK_UNLESS_NULL.
Definition at line 728 of file iseq.c.
References rb_iseq_location_struct::base_label, rb_iseq_struct::body, rb_iseq_constant_body::local_iseq, rb_iseq_constant_body::location, Qnil, and rb_iseq_constant_body::type.
rb_iseq_t* rb_iseq_new | ( | NODE * | node, |
VALUE | name, | ||
VALUE | path, | ||
VALUE | realpath, | ||
const rb_iseq_t * | parent, | ||
enum iseq_type | type | ||
) |
Definition at line 458 of file iseq.c.
References INT2FIX, and rb_iseq_new_with_opt().
Referenced by rb_vm_call_cfunc().
Definition at line 473 of file iseq.c.
References INT2FIX, rb_fstring_cstr(), and rb_iseq_new_with_opt().
rb_iseq_t* rb_iseq_new_top | ( | NODE * | node, |
VALUE | name, | ||
VALUE | path, | ||
VALUE | realpath, | ||
const rb_iseq_t * | parent | ||
) |
Definition at line 466 of file iseq.c.
References INT2FIX, and rb_iseq_new_with_opt().
rb_iseq_t* rb_iseq_new_with_opt | ( | NODE * | node, |
VALUE | name, | ||
VALUE | path, | ||
VALUE | realpath, | ||
VALUE | first_lineno, | ||
const rb_iseq_t * | parent, | ||
enum iseq_type | type, | ||
const rb_compile_option_t * | option | ||
) |
Definition at line 495 of file iseq.c.
References iseq_alloc().
Referenced by rb_iseq_new(), rb_iseq_new_main(), and rb_iseq_new_top().
Definition at line 2125 of file iseq.c.
References rb_iseq_constant_body::block_start, rb_iseq_struct::body, CONST_ID, rb_iseq_constant_body::flags, ID2SYM, key, rb_iseq_constant_body::keyword, rb_iseq_constant_body::lead_num, rb_iseq_constant_body::opt_num, rb_iseq_constant_body::param, PARAM, PARAM_ID, PARAM_TYPE, rb_iseq_constant_body::post_num, rb_iseq_constant_body::post_start, Qnil, rb_ary_new2, rb_ary_push(), rb_id2str, rb_iseq_constant_body::rest_start, and rb_iseq_constant_body::size.
Definition at line 692 of file iseq.c.
Referenced by rb_source_location(), rb_sourcefile(), rb_sourcefilename(), and rb_thread_current_status().
Definition at line 217 of file iseq.c.
References NIL_P, Qnil, rb_ary_new_from_args(), rb_fstring(), rb_obj_freeze(), rb_str_cmp(), RB_TYPE_P, T_STRING, and VM_ASSERT.
Referenced by rb_iseq_pathobj_set().
Definition at line 236 of file iseq.c.
References rb_iseq_struct::body, rb_iseq_constant_body::location, rb_iseq_location_struct::pathobj, rb_iseq_pathobj_new(), and RB_OBJ_WRITE.
Referenced by rb_vm_set_progname().
Definition at line 698 of file iseq.c.
Referenced by rb_iseq_absolute_path(), and rb_vm_set_progname().
int rb_iseqw_line_trace_each | ( | VALUE | iseqw, |
int(*)(int line, rb_event_flag_t *events_ptr, void *d) | func, | ||
void * | data | ||
) |
Definition at line 2255 of file iseq.c.
Referenced by rb_iseqw_line_trace_specify().
Definition at line 2354 of file iseq.c.
References NUM2INT, set_specifc_data::pos, set_specifc_data::prev, Qfalse, Qtrue, rb_eTypeError, rb_iseqw_line_trace_each(), rb_raise(), and set_specifc_data::set.
const char* ruby_node_name | ( | int | node | ) |
VALUE rb_cISeq |
Definition at line 29 of file iseq.c.
Referenced by Init_ISeq(), and rb_iseq_load_iseq().