src/share/vm/c1/c1_Instruction.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/c1

src/share/vm/c1/c1_Instruction.hpp

Print this page
rev 5349 : 8023657: New type profiling points: arguments to call
Summary: x86 interpreter and c1 type profiling for arguments at calls
Reviewed-by:
rev 5350 : 8026054: New type profiling points: type of return values at calls
Summary: x86 interpreter and c1 type profiling for return values at calls
Reviewed-by:


  90 class       IfInstanceOf;
  91 class       Switch;
  92 class         TableSwitch;
  93 class         LookupSwitch;
  94 class       Return;
  95 class       Throw;
  96 class       Base;
  97 class   RoundFP;
  98 class   UnsafeOp;
  99 class     UnsafeRawOp;
 100 class       UnsafeGetRaw;
 101 class       UnsafePutRaw;
 102 class     UnsafeObjectOp;
 103 class       UnsafeGetObject;
 104 class       UnsafePutObject;
 105 class         UnsafeGetAndSetObject;
 106 class       UnsafePrefetch;
 107 class         UnsafePrefetchRead;
 108 class         UnsafePrefetchWrite;
 109 class   ProfileCall;

 110 class   ProfileInvoke;
 111 class   RuntimeCall;
 112 class   MemBar;
 113 class   RangeCheckPredicate;
 114 #ifdef ASSERT
 115 class   Assert;
 116 #endif
 117 
 118 // A Value is a reference to the instruction creating the value
 119 typedef Instruction* Value;
 120 define_array(ValueArray, Value)
 121 define_stack(Values, ValueArray)
 122 
 123 define_array(ValueStackArray, ValueStack*)
 124 define_stack(ValueStackStack, ValueStackArray)
 125 
 126 // BlockClosure is the base class for block traversal/iteration.
 127 
 128 class BlockClosure: public CompilationResourceObj {
 129  public:


 194   virtual void do_BlockBegin     (BlockBegin*      x) = 0;
 195   virtual void do_Goto           (Goto*            x) = 0;
 196   virtual void do_If             (If*              x) = 0;
 197   virtual void do_IfInstanceOf   (IfInstanceOf*    x) = 0;
 198   virtual void do_TableSwitch    (TableSwitch*     x) = 0;
 199   virtual void do_LookupSwitch   (LookupSwitch*    x) = 0;
 200   virtual void do_Return         (Return*          x) = 0;
 201   virtual void do_Throw          (Throw*           x) = 0;
 202   virtual void do_Base           (Base*            x) = 0;
 203   virtual void do_OsrEntry       (OsrEntry*        x) = 0;
 204   virtual void do_ExceptionObject(ExceptionObject* x) = 0;
 205   virtual void do_RoundFP        (RoundFP*         x) = 0;
 206   virtual void do_UnsafeGetRaw   (UnsafeGetRaw*    x) = 0;
 207   virtual void do_UnsafePutRaw   (UnsafePutRaw*    x) = 0;
 208   virtual void do_UnsafeGetObject(UnsafeGetObject* x) = 0;
 209   virtual void do_UnsafePutObject(UnsafePutObject* x) = 0;
 210   virtual void do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) = 0;
 211   virtual void do_UnsafePrefetchRead (UnsafePrefetchRead*  x) = 0;
 212   virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) = 0;
 213   virtual void do_ProfileCall    (ProfileCall*     x) = 0;

 214   virtual void do_ProfileInvoke  (ProfileInvoke*   x) = 0;
 215   virtual void do_RuntimeCall    (RuntimeCall*     x) = 0;
 216   virtual void do_MemBar         (MemBar*          x) = 0;
 217   virtual void do_RangeCheckPredicate(RangeCheckPredicate* x) = 0;
 218 #ifdef ASSERT
 219   virtual void do_Assert         (Assert*          x) = 0;
 220 #endif
 221 };
 222 
 223 
 224 // Hashing support
 225 //
 226 // Note: This hash functions affect the performance
 227 //       of ValueMap - make changes carefully!
 228 
 229 #define HASH1(x1            )                    ((intx)(x1))
 230 #define HASH2(x1, x2        )                    ((HASH1(x1        ) << 7) ^ HASH1(x2))
 231 #define HASH3(x1, x2, x3    )                    ((HASH2(x1, x2    ) << 7) ^ HASH1(x3))
 232 #define HASH4(x1, x2, x3, x4)                    ((HASH3(x1, x2, x3) << 7) ^ HASH1(x4))
 233 


2497   ciMethod* callee()             const { return _callee; }
2498   Value recv()                   const { return _recv; }
2499   ciKlass* known_holder()        const { return _known_holder; }
2500   int nb_profiled_args()         const { return _obj_args == NULL ? 0 : _obj_args->length(); }
2501   Value profiled_arg_at(int i)   const { return _obj_args->at(i); }
2502   bool arg_needs_null_check(int i) const {
2503     return _nonnull_state.arg_needs_null_check(i);
2504   }
2505   bool inlined()                 const { return _inlined; }
2506 
2507   void set_arg_needs_null_check(int i, bool check) {
2508     _nonnull_state.set_arg_needs_null_check(i, check);
2509   }
2510 
2511   virtual void input_values_do(ValueVisitor* f)   {
2512     if (_recv != NULL) {
2513       f->visit(&_recv);
2514     }
2515     for (int i = 0; i < nb_profiled_args(); i++) {
2516       f->visit(_obj_args->adr_at(i));
































2517     }
2518   }
2519 };
2520 
2521 // Call some C runtime function that doesn't safepoint,
2522 // optionally passing the current thread as the first argument.
2523 LEAF(RuntimeCall, Instruction)
2524  private:
2525   const char* _entry_name;
2526   address     _entry;
2527   Values*     _args;
2528   bool        _pass_thread;  // Pass the JavaThread* as an implicit first argument
2529 
2530  public:
2531   RuntimeCall(ValueType* type, const char* entry_name, address entry, Values* args, bool pass_thread = true)
2532     : Instruction(type)
2533     , _entry(entry)
2534     , _args(args)
2535     , _entry_name(entry_name)
2536     , _pass_thread(pass_thread) {




  90 class       IfInstanceOf;
  91 class       Switch;
  92 class         TableSwitch;
  93 class         LookupSwitch;
  94 class       Return;
  95 class       Throw;
  96 class       Base;
  97 class   RoundFP;
  98 class   UnsafeOp;
  99 class     UnsafeRawOp;
 100 class       UnsafeGetRaw;
 101 class       UnsafePutRaw;
 102 class     UnsafeObjectOp;
 103 class       UnsafeGetObject;
 104 class       UnsafePutObject;
 105 class         UnsafeGetAndSetObject;
 106 class       UnsafePrefetch;
 107 class         UnsafePrefetchRead;
 108 class         UnsafePrefetchWrite;
 109 class   ProfileCall;
 110 class   ProfileReturnType;
 111 class   ProfileInvoke;
 112 class   RuntimeCall;
 113 class   MemBar;
 114 class   RangeCheckPredicate;
 115 #ifdef ASSERT
 116 class   Assert;
 117 #endif
 118 
 119 // A Value is a reference to the instruction creating the value
 120 typedef Instruction* Value;
 121 define_array(ValueArray, Value)
 122 define_stack(Values, ValueArray)
 123 
 124 define_array(ValueStackArray, ValueStack*)
 125 define_stack(ValueStackStack, ValueStackArray)
 126 
 127 // BlockClosure is the base class for block traversal/iteration.
 128 
 129 class BlockClosure: public CompilationResourceObj {
 130  public:


 195   virtual void do_BlockBegin     (BlockBegin*      x) = 0;
 196   virtual void do_Goto           (Goto*            x) = 0;
 197   virtual void do_If             (If*              x) = 0;
 198   virtual void do_IfInstanceOf   (IfInstanceOf*    x) = 0;
 199   virtual void do_TableSwitch    (TableSwitch*     x) = 0;
 200   virtual void do_LookupSwitch   (LookupSwitch*    x) = 0;
 201   virtual void do_Return         (Return*          x) = 0;
 202   virtual void do_Throw          (Throw*           x) = 0;
 203   virtual void do_Base           (Base*            x) = 0;
 204   virtual void do_OsrEntry       (OsrEntry*        x) = 0;
 205   virtual void do_ExceptionObject(ExceptionObject* x) = 0;
 206   virtual void do_RoundFP        (RoundFP*         x) = 0;
 207   virtual void do_UnsafeGetRaw   (UnsafeGetRaw*    x) = 0;
 208   virtual void do_UnsafePutRaw   (UnsafePutRaw*    x) = 0;
 209   virtual void do_UnsafeGetObject(UnsafeGetObject* x) = 0;
 210   virtual void do_UnsafePutObject(UnsafePutObject* x) = 0;
 211   virtual void do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) = 0;
 212   virtual void do_UnsafePrefetchRead (UnsafePrefetchRead*  x) = 0;
 213   virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) = 0;
 214   virtual void do_ProfileCall    (ProfileCall*     x) = 0;
 215   virtual void do_ProfileReturnType (ProfileReturnType*  x) = 0;
 216   virtual void do_ProfileInvoke  (ProfileInvoke*   x) = 0;
 217   virtual void do_RuntimeCall    (RuntimeCall*     x) = 0;
 218   virtual void do_MemBar         (MemBar*          x) = 0;
 219   virtual void do_RangeCheckPredicate(RangeCheckPredicate* x) = 0;
 220 #ifdef ASSERT
 221   virtual void do_Assert         (Assert*          x) = 0;
 222 #endif
 223 };
 224 
 225 
 226 // Hashing support
 227 //
 228 // Note: This hash functions affect the performance
 229 //       of ValueMap - make changes carefully!
 230 
 231 #define HASH1(x1            )                    ((intx)(x1))
 232 #define HASH2(x1, x2        )                    ((HASH1(x1        ) << 7) ^ HASH1(x2))
 233 #define HASH3(x1, x2, x3    )                    ((HASH2(x1, x2    ) << 7) ^ HASH1(x3))
 234 #define HASH4(x1, x2, x3, x4)                    ((HASH3(x1, x2, x3) << 7) ^ HASH1(x4))
 235 


2499   ciMethod* callee()             const { return _callee; }
2500   Value recv()                   const { return _recv; }
2501   ciKlass* known_holder()        const { return _known_holder; }
2502   int nb_profiled_args()         const { return _obj_args == NULL ? 0 : _obj_args->length(); }
2503   Value profiled_arg_at(int i)   const { return _obj_args->at(i); }
2504   bool arg_needs_null_check(int i) const {
2505     return _nonnull_state.arg_needs_null_check(i);
2506   }
2507   bool inlined()                 const { return _inlined; }
2508 
2509   void set_arg_needs_null_check(int i, bool check) {
2510     _nonnull_state.set_arg_needs_null_check(i, check);
2511   }
2512 
2513   virtual void input_values_do(ValueVisitor* f)   {
2514     if (_recv != NULL) {
2515       f->visit(&_recv);
2516     }
2517     for (int i = 0; i < nb_profiled_args(); i++) {
2518       f->visit(_obj_args->adr_at(i));
2519     }
2520   }
2521 };
2522 
2523 LEAF(ProfileReturnType, Instruction)
2524  private:
2525   ciMethod*        _method;
2526   ciMethod*        _callee;
2527   int              _bci_of_invoke;
2528   Value            _ret;
2529 
2530  public:
2531   ProfileReturnType(ciMethod* method, int bci, ciMethod* callee, Value ret)
2532     : Instruction(voidType)
2533     , _method(method)
2534     , _callee(callee)
2535     , _bci_of_invoke(bci)
2536     , _ret(ret)
2537   {
2538     set_needs_null_check(true);
2539     // The ProfileType has side-effects and must occur precisely where located
2540     pin();
2541   }
2542 
2543   ciMethod* method()             const { return _method; }
2544   ciMethod* callee()             const { return _callee; }
2545   int bci_of_invoke()            const { return _bci_of_invoke; }
2546   Value ret()                    const { return _ret; }
2547 
2548   virtual void input_values_do(ValueVisitor* f)   {
2549     if (_ret != NULL) {
2550       f->visit(&_ret);
2551     }
2552   }
2553 };
2554 
2555 // Call some C runtime function that doesn't safepoint,
2556 // optionally passing the current thread as the first argument.
2557 LEAF(RuntimeCall, Instruction)
2558  private:
2559   const char* _entry_name;
2560   address     _entry;
2561   Values*     _args;
2562   bool        _pass_thread;  // Pass the JavaThread* as an implicit first argument
2563 
2564  public:
2565   RuntimeCall(ValueType* type, const char* entry_name, address entry, Values* args, bool pass_thread = true)
2566     : Instruction(type)
2567     , _entry(entry)
2568     , _args(args)
2569     , _entry_name(entry_name)
2570     , _pass_thread(pass_thread) {


src/share/vm/c1/c1_Instruction.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File