Permalink
Browse files

Simplify check_serial code in JIT helpers

  • Loading branch information...
1 parent 3059758 commit 88b7461f0562a72cb527e641534f6ea607009baf @dbussink dbussink committed Feb 25, 2013
Showing with 4 additions and 18 deletions.
  1. +4 −18 vm/llvm/jit_util.cpp
View
@@ -580,29 +580,15 @@ extern "C" {
Object* rbx_check_serial(STATE, CallFrame* call_frame, InlineCache* cache,
int serial, Object* recv)
{
- if(cache->update_and_validate(state, call_frame, recv)) {
- InlineCacheHit* caches = cache->caches();
- for(int i = 0; i < cTrackedICHits; ++i) {
- MethodCacheEntry* mce = caches[i].entry();
- if(mce && mce->method()->serial()->to_native() != serial) return cFalse;
- }
- }
-
- return cTrue;
+ MethodCacheEntry* mce = cache->update_and_validate(state, call_frame, recv);
+ return RBOOL(mce && mce->method()->serial()->to_native() == serial);
}
Object* rbx_check_serial_private(STATE, CallFrame* call_frame, InlineCache* cache,
int serial, Object* recv)
{
- if(cache->update_and_validate_private(state, call_frame, recv)) {
- InlineCacheHit* caches = cache->caches();
- for(int i = 0; i < cTrackedICHits; ++i) {
- MethodCacheEntry* mce = caches[i].entry();
- if(mce && mce->method()->serial()->to_native() != serial) return cFalse;
- }
- }
-
- return cTrue;
+ MethodCacheEntry* mce = cache->update_and_validate_private(state, call_frame, recv);
+ return RBOOL(mce && mce->method()->serial()->to_native() == serial);
}
Object* rbx_find_const(STATE, CallFrame* call_frame, int index, Object* top) {

0 comments on commit 88b7461

Please sign in to comment.