* gc.c, vm.c, vm_core.h: remove USE_VALUE_CACHE option.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2d189f672b
commit
f6b2490fdb
@ -1,3 +1,7 @@
|
|||||||
|
Wed Nov 3 08:58:59 2010 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* gc.c, vm.c, vm_core.h: remove USE_VALUE_CACHE option.
|
||||||
|
|
||||||
Wed Nov 3 07:47:25 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Wed Nov 3 07:47:25 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* lib/irb/ruby-lex.rb (RubyLex#identify_string): parse multiple
|
* lib/irb/ruby-lex.rb (RubyLex#identify_string): parse multiple
|
||||||
|
62
gc.c
62
gc.c
@ -1034,6 +1034,13 @@ heaps_increment(rb_objspace_t *objspace)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
rb_during_gc(void)
|
||||||
|
{
|
||||||
|
rb_objspace_t *objspace = &rb_objspace;
|
||||||
|
return during_gc;
|
||||||
|
}
|
||||||
|
|
||||||
#define RANY(o) ((RVALUE*)(o))
|
#define RANY(o) ((RVALUE*)(o))
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
@ -1061,49 +1068,10 @@ rb_newobj_from_heap(rb_objspace_t *objspace)
|
|||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_VALUE_CACHE
|
|
||||||
static VALUE
|
|
||||||
rb_fill_value_cache(rb_thread_t *th)
|
|
||||||
{
|
|
||||||
rb_objspace_t *objspace = &rb_objspace;
|
|
||||||
int i;
|
|
||||||
VALUE rv;
|
|
||||||
|
|
||||||
/* LOCK */
|
|
||||||
for (i=0; i<RUBY_VM_VALUE_CACHE_SIZE; i++) {
|
|
||||||
VALUE v = rb_newobj_from_heap(objspace);
|
|
||||||
|
|
||||||
th->value_cache[i] = v;
|
|
||||||
RBASIC(v)->flags = FL_MARK;
|
|
||||||
}
|
|
||||||
th->value_cache_ptr = &th->value_cache[0];
|
|
||||||
rv = rb_newobj_from_heap(objspace);
|
|
||||||
/* UNLOCK */
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
|
||||||
rb_during_gc(void)
|
|
||||||
{
|
|
||||||
rb_objspace_t *objspace = &rb_objspace;
|
|
||||||
return during_gc;
|
|
||||||
}
|
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
rb_newobj(void)
|
rb_newobj(void)
|
||||||
{
|
{
|
||||||
#if USE_VALUE_CACHE || (defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE)
|
|
||||||
rb_thread_t *th = GET_THREAD();
|
|
||||||
#endif
|
|
||||||
#if USE_VALUE_CACHE
|
|
||||||
VALUE v = *th->value_cache_ptr;
|
|
||||||
#endif
|
|
||||||
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
|
|
||||||
rb_objspace_t *objspace = th->vm->objspace;
|
|
||||||
#else
|
|
||||||
rb_objspace_t *objspace = &rb_objspace;
|
rb_objspace_t *objspace = &rb_objspace;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (during_gc) {
|
if (during_gc) {
|
||||||
dont_gc = 1;
|
dont_gc = 1;
|
||||||
@ -1111,23 +1079,7 @@ rb_newobj(void)
|
|||||||
rb_bug("object allocation during garbage collection phase");
|
rb_bug("object allocation during garbage collection phase");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_VALUE_CACHE
|
|
||||||
if (v) {
|
|
||||||
RBASIC(v)->flags = 0;
|
|
||||||
th->value_cache_ptr++;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
v = rb_fill_value_cache(th);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(GC_DEBUG)
|
|
||||||
printf("cache index: %d, v: %p, th: %p\n",
|
|
||||||
th->value_cache_ptr - th->value_cache, v, th);
|
|
||||||
#endif
|
|
||||||
return v;
|
|
||||||
#else
|
|
||||||
return rb_newobj_from_heap(objspace);
|
return rb_newobj_from_heap(objspace);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NODE*
|
NODE*
|
||||||
|
16
vm.c
16
vm.c
@ -1709,18 +1709,6 @@ thread_free(void *ptr)
|
|||||||
st_free_table(th->local_storage);
|
st_free_table(th->local_storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_VALUE_CACHE
|
|
||||||
{
|
|
||||||
VALUE *ptr = th->value_cache_ptr;
|
|
||||||
while (*ptr) {
|
|
||||||
VALUE v = *ptr;
|
|
||||||
RBASIC(v)->flags = 0;
|
|
||||||
RBASIC(v)->klass = 0;
|
|
||||||
ptr++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (th->vm && th->vm->main_thread == th) {
|
if (th->vm && th->vm->main_thread == th) {
|
||||||
RUBY_GC_INFO("main thread\n");
|
RUBY_GC_INFO("main thread\n");
|
||||||
}
|
}
|
||||||
@ -1796,10 +1784,6 @@ th_init2(rb_thread_t *th, VALUE self)
|
|||||||
th->status = THREAD_RUNNABLE;
|
th->status = THREAD_RUNNABLE;
|
||||||
th->errinfo = Qnil;
|
th->errinfo = Qnil;
|
||||||
th->last_status = Qnil;
|
th->last_status = Qnil;
|
||||||
|
|
||||||
#if USE_VALUE_CACHE
|
|
||||||
th->value_cache_ptr = &th->value_cache[0];
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -365,9 +365,6 @@ struct rb_vm_protect_tag {
|
|||||||
struct rb_vm_protect_tag *prev;
|
struct rb_vm_protect_tag *prev;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define RUBY_VM_VALUE_CACHE_SIZE 0x1000
|
|
||||||
#define USE_VALUE_CACHE 0
|
|
||||||
|
|
||||||
struct rb_unblock_callback {
|
struct rb_unblock_callback {
|
||||||
rb_unblock_function_t *func;
|
rb_unblock_function_t *func;
|
||||||
void *arg;
|
void *arg;
|
||||||
@ -437,10 +434,6 @@ typedef struct rb_thread_struct {
|
|||||||
|
|
||||||
/* storage */
|
/* storage */
|
||||||
st_table *local_storage;
|
st_table *local_storage;
|
||||||
#if USE_VALUE_CACHE
|
|
||||||
VALUE value_cache[RUBY_VM_VALUE_CACHE_SIZE + 1];
|
|
||||||
VALUE *value_cache_ptr;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct rb_thread_struct *join_list_next;
|
struct rb_thread_struct *join_list_next;
|
||||||
struct rb_thread_struct *join_list_head;
|
struct rb_thread_struct *join_list_head;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user