Permalink
Browse files

Cleanup of InlineCache validation methods

  • Loading branch information...
1 parent 7661c1e commit aacddf7e594d0df55437e434cb7d8778220393ba @dbussink dbussink committed Apr 24, 2013
Showing with 8 additions and 30 deletions.
  1. +2 −23 vm/builtin/inline_cache.cpp
  2. +1 −2 vm/builtin/inline_cache.hpp
  3. +2 −2 vm/instructions.def
  4. +3 −3 vm/llvm/jit_util.cpp
@@ -87,36 +87,15 @@ namespace rubinius {
return dis.method_missing == eNone;
}
- InlineCacheEntry* InlineCache::update_and_validate(STATE, CallFrame* call_frame, Object* recv) {
+ InlineCacheEntry* InlineCache::update_and_validate(STATE, CallFrame* call_frame, Object* recv, Symbol* vis) {
Class* const recv_class = recv->lookup_begin(state);
InlineCacheEntry* ice = get_cache(recv_class);
if(likely(ice)) return ice;
MethodMissingReason reason =
- fill(state, call_frame->self(), recv_class, name_, recv_class, G(sym_public), ice);
- if(reason != eNone) return 0;
-
- if(unlikely(growth_cache_size(ice->receiver_class_id()) > 0)) {
- execute_backend_ = check_cache_poly;
- }
-
- write_barrier(state, ice);
- set_cache(ice);
-
- return ice;
- }
-
- InlineCacheEntry* InlineCache::update_and_validate_private(STATE, CallFrame* call_frame, Object* recv) {
-
- Class* const recv_class = recv->lookup_begin(state);
- InlineCacheEntry* ice = get_cache(recv_class);
-
- if(likely(ice)) return ice;
-
- MethodMissingReason reason =
- fill(state, call_frame->self(), recv_class, name_, recv_class, G(sym_private), ice);
+ fill(state, call_frame->self(), recv_class, name_, recv_class, vis, ice);
if(reason != eNone) return 0;
if(unlikely(growth_cache_size(ice->receiver_class_id()) > 0)) {
@@ -188,8 +188,7 @@ namespace rubinius {
bool fill_method_missing(STATE, Object* self, Class* klass, MethodMissingReason reason, InlineCacheEntry*& ice);
- InlineCacheEntry* update_and_validate(STATE, CallFrame* call_frame, Object* recv);
- InlineCacheEntry* update_and_validate_private(STATE, CallFrame* call_frame, Object* recv);
+ InlineCacheEntry* update_and_validate(STATE, CallFrame* call_frame, Object* recv, Symbol* vis);
void print(STATE, std::ostream& stream);
View
@@ -1698,7 +1698,7 @@ instruction check_serial(literal serial) [ receiver -- boolean ]
InlineCache* cache = reinterpret_cast<InlineCache*>(literal);
InlineCacheEntry* ice =
- cache->update_and_validate(state, call_frame, recv);
+ cache->update_and_validate(state, call_frame, recv, G(sym_public));
stack_push(RBOOL(ice && ice->method()->serial()->to_native() == serial));
end
@@ -1714,7 +1714,7 @@ instruction check_serial_private(literal serial) [ receiver -- boolean ]
InlineCache* cache = reinterpret_cast<InlineCache*>(literal);
InlineCacheEntry* ice =
- cache->update_and_validate_private(state, call_frame, recv);
+ cache->update_and_validate(state, call_frame, recv, G(sym_private));
stack_push(RBOOL(ice && ice->method()->serial()->to_native() == serial));
end
View
@@ -546,16 +546,16 @@ extern "C" {
}
Object* rbx_check_serial(STATE, CallFrame* call_frame, InlineCache* cache,
- int serial, Object* recv)
+ int serial, Object* recv, Symbol* vis)
{
- InlineCacheEntry* ice = cache->update_and_validate(state, call_frame, recv);
+ InlineCacheEntry* ice = cache->update_and_validate(state, call_frame, recv, G(sym_public));
return RBOOL(ice && ice->method()->serial()->to_native() == serial);
}
Object* rbx_check_serial_private(STATE, CallFrame* call_frame, InlineCache* cache,
int serial, Object* recv)
{
- InlineCacheEntry* ice = cache->update_and_validate_private(state, call_frame, recv);
+ InlineCacheEntry* ice = cache->update_and_validate(state, call_frame, recv, G(sym_private));
return RBOOL(ice && ice->method()->serial()->to_native() == serial);
}

0 comments on commit aacddf7

Please sign in to comment.