< prev index next >

src/share/vm/runtime/javaCalls.hpp

Print this page




  36 #include CPU_HEADER(jniTypes)
  37 
  38 // A JavaCallWrapper is constructed before each JavaCall and destructed after the call.
  39 // Its purpose is to allocate/deallocate a new handle block and to save/restore the last
  40 // Java fp/sp. A pointer to the JavaCallWrapper is stored on the stack.
  41 
  42 class JavaCallWrapper: StackObj {
  43   friend class VMStructs;
  44  private:
  45   JavaThread*      _thread;                 // the thread to which this call belongs
  46   JNIHandleBlock*  _handles;                // the saved handle block
  47   Method*          _callee_method;          // to be able to collect arguments if entry frame is top frame
  48   oop              _receiver;               // the receiver of the call (if a non-static call)
  49 
  50   JavaFrameAnchor  _anchor;                 // last thread anchor state that we must restore
  51 
  52   JavaValue*       _result;                 // result value
  53 
  54  public:
  55   // Construction/destruction
  56    JavaCallWrapper(methodHandle callee_method, Handle receiver, JavaValue* result, TRAPS);
  57   ~JavaCallWrapper();
  58 
  59   // Accessors
  60   JavaThread*      thread() const           { return _thread; }
  61   JNIHandleBlock*  handles() const          { return _handles; }
  62 
  63   JavaFrameAnchor* anchor(void)             { return &_anchor; }
  64 
  65   JavaValue*       result() const           { return _result; }
  66   // GC support
  67   Method*          callee_method()          { return _callee_method; }
  68   oop              receiver()               { return _receiver; }
  69   void             oops_do(OopClosure* f);
  70 
  71   bool             is_first_frame() const   { return _anchor.last_Java_sp() == NULL; }
  72 
  73 };
  74 
  75 
  76 // Encapsulates arguments to a JavaCall (faster, safer, and more convenient than using var-args)




  36 #include CPU_HEADER(jniTypes)
  37 
  38 // A JavaCallWrapper is constructed before each JavaCall and destructed after the call.
  39 // Its purpose is to allocate/deallocate a new handle block and to save/restore the last
  40 // Java fp/sp. A pointer to the JavaCallWrapper is stored on the stack.
  41 
  42 class JavaCallWrapper: StackObj {
  43   friend class VMStructs;
  44  private:
  45   JavaThread*      _thread;                 // the thread to which this call belongs
  46   JNIHandleBlock*  _handles;                // the saved handle block
  47   Method*          _callee_method;          // to be able to collect arguments if entry frame is top frame
  48   oop              _receiver;               // the receiver of the call (if a non-static call)
  49 
  50   JavaFrameAnchor  _anchor;                 // last thread anchor state that we must restore
  51 
  52   JavaValue*       _result;                 // result value
  53 
  54  public:
  55   // Construction/destruction
  56    JavaCallWrapper(const methodHandle& callee_method, Handle receiver, JavaValue* result, TRAPS);
  57   ~JavaCallWrapper();
  58 
  59   // Accessors
  60   JavaThread*      thread() const           { return _thread; }
  61   JNIHandleBlock*  handles() const          { return _handles; }
  62 
  63   JavaFrameAnchor* anchor(void)             { return &_anchor; }
  64 
  65   JavaValue*       result() const           { return _result; }
  66   // GC support
  67   Method*          callee_method()          { return _callee_method; }
  68   oop              receiver()               { return _receiver; }
  69   void             oops_do(OopClosure* f);
  70 
  71   bool             is_first_frame() const   { return _anchor.last_Java_sp() == NULL; }
  72 
  73 };
  74 
  75 
  76 // Encapsulates arguments to a JavaCall (faster, safer, and more convenient than using var-args)


< prev index next >