Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/vm/prims/methodHandleWalk.hpp
          +++ new/src/share/vm/prims/methodHandleWalk.hpp
↓ open down ↓ 239 lines elided ↑ open up ↑
 240  240    ArgToken walk(TRAPS);
 241  241  };
 242  242  
 243  243  
 244  244  // An abstract interpreter for method handle chains.
 245  245  // Produces an account of the semantics of a chain, in terms of a static IR.
 246  246  // The IR happens to be JVM bytecodes.
 247  247  class MethodHandleCompiler : public MethodHandleWalker {
 248  248  private:
 249  249    methodHandle _callee;
      250 +  int          _invoke_count;  // count the original call site has been executed
 250  251    KlassHandle  _rklass;        // Return type for casting.
 251  252    BasicType    _rtype;
 252  253    KlassHandle  _target_klass;
 253  254    Thread*      _thread;
 254  255  
 255  256    // Fake constant pool entry.
 256  257    class ConstantValue {
 257  258    private:
 258  259      int       _tag;   // Constant pool tag type.
 259  260      JavaValue _value;
↓ open down ↓ 149 lines elided ↑ open up ↑
 409  410    virtual ArgToken make_fetch(BasicType type, klassOop tk, Bytecodes::Code op, const ArgToken& base, const ArgToken& offset, TRAPS);
 410  411    virtual ArgToken make_invoke(methodOop m, vmIntrinsics::ID iid, Bytecodes::Code op, bool tailcall, int argc, ArgToken* argv, TRAPS);
 411  412  
 412  413    // Get a real constant pool.
 413  414    constantPoolHandle get_constant_pool(TRAPS) const;
 414  415  
 415  416    // Get a real methodOop.
 416  417    methodHandle get_method_oop(TRAPS) const;
 417  418  
 418  419  public:
 419      -  MethodHandleCompiler(Handle root, methodHandle call_method, bool for_invokedynamic, TRAPS);
      420 +  MethodHandleCompiler(Handle root, methodHandle call_method, int invoke_count, bool for_invokedynamic, TRAPS);
 420  421  
 421  422    // Compile the given MH chain into bytecode.
 422  423    methodHandle compile(TRAPS);
 423  424  
 424  425    // Tests if the given class is a MH adapter holder.
 425  426    static bool klass_is_method_handle_adapter_holder(klassOop klass) {
 426  427      return (klass == SystemDictionary::MethodHandle_klass());
 427  428    }
 428  429  };
 429  430  
 430  431  #endif // SHARE_VM_PRIMS_METHODHANDLEWALK_HPP
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX