summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-13 09:30:23 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-13 09:30:23 +0000
commit20d9aefccbc5d9b5f9feacef9ee52dc1731aec55 (patch)
tree4a46ed32d9918e8fdbf3d63cdda79a6526032b5b /vm_core.h
parent762f9b28c675b49a4667bfae011857e9e02bcea5 (diff)
* vm_core.h, compile.c: declare struct iseq_inline_cache_entry.
Inline cache (IC) entries are no longer GC managed object. IC entries are freed when ISeq is freed. * iseq.c: fix mark, free, memsize functions for above change. * insns.def: remove rb_gc_write_barrier(). * vm_insnhelper.c (vm_method_search): ditto. * tool/instruction.rb, template/insns_info.inc.tmpl (insn_iclen): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/vm_core.h b/vm_core.h
index 8019e63a27..799ac52b89 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -106,6 +106,18 @@ typedef struct rb_compile_option_struct {
int debug_level;
} rb_compile_option_t;
+struct iseq_inline_cache_entry {
+ long ic_vmstat;
+ VALUE ic_class;
+ union {
+ NODE *method;
+ VALUE value;
+ } value;
+#define ic_value value.value
+#define ic_method value.method
+#define ic_index ic_vmstat
+};
+
#if 1
#define GetCoreDataFromValue(obj, type, ptr) do { \
ptr = (type*)DATA_PTR(obj); \
@@ -143,6 +155,9 @@ struct rb_iseq_struct {
/* method, class frame: sizeof(vars) + 1, block frame: sizeof(vars) */
int local_size;
+ struct iseq_inline_cache_entry *ic_entries;
+ int ic_size;
+
/**
* argument information
*
@@ -522,13 +537,8 @@ typedef struct {
(VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_CFUNC)
-/* inline (method|const) cache */
-#define NEW_INLINE_CACHE_ENTRY() NEW_NODE_LONGLIFE(NODE_WHILE, Qundef, 0, 0)
-#define ic_class u1.value
-#define ic_method u2.node
-#define ic_value u2.value
-#define ic_vmstat u3.value
-typedef NODE *IC;
+/* inline cache */
+typedef struct iseq_inline_cache_entry *IC;
void rb_vm_change_state(void);