src/share/vm/code/compiledIC.cpp

changeset 6985
c64b6b0c40c8
parent 6680
78bbf4d43a14
child 6991
882004b9e7e1
     1.1 --- a/src/share/vm/code/compiledIC.cpp	Wed Jun 25 08:28:01 2014 +0200
     1.2 +++ b/src/share/vm/code/compiledIC.cpp	Wed Jun 25 08:56:57 2014 +0200
     1.3 @@ -159,6 +159,30 @@
     1.4  //-----------------------------------------------------------------------------
     1.5  // High-level access to an inline cache. Guaranteed to be MT-safe.
     1.6  
     1.7 +CompiledIC::CompiledIC(nmethod* nm, NativeCall* call)
     1.8 +  : _ic_call(call)
     1.9 +{
    1.10 +  address ic_call = call->instruction_address();
    1.11 +
    1.12 +  assert(ic_call != NULL, "ic_call address must be set");
    1.13 +  assert(nm != NULL, "must pass nmethod");
    1.14 +  assert(nm->contains(ic_call), "must be in nmethod");
    1.15 +
    1.16 +  // Search for the ic_call at the given address.
    1.17 +  RelocIterator iter(nm, ic_call, ic_call+1);
    1.18 +  bool ret = iter.next();
    1.19 +  assert(ret == true, "relocInfo must exist at this address");
    1.20 +  assert(iter.addr() == ic_call, "must find ic_call");
    1.21 +  if (iter.type() == relocInfo::virtual_call_type) {
    1.22 +    virtual_call_Relocation* r = iter.virtual_call_reloc();
    1.23 +    _is_optimized = false;
    1.24 +    _value = nativeMovConstReg_at(r->cached_value());
    1.25 +  } else {
    1.26 +    assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call");
    1.27 +    _is_optimized = true;
    1.28 +    _value = NULL;
    1.29 +  }
    1.30 +}
    1.31  
    1.32  bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode, TRAPS) {
    1.33    assert(CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");

mercurial