< prev index next >

src/hotspot/share/prims/jni.cpp

Print this page

        

@@ -872,10 +872,11 @@
   virtual void get_int    () = 0;
   virtual void get_long   () = 0;
   virtual void get_float  () = 0;
   virtual void get_double () = 0;
   virtual void get_object () = 0;
+  virtual void get_valuetype() = 0;
 
   JNI_ArgumentPusher(Symbol* signature) : SignatureIterator(signature) {
     this->_return_type = T_ILLEGAL;
     _arguments = NULL;
   }

@@ -892,10 +893,11 @@
   inline void do_int()                      { if (!is_return_type()) get_int();    }
   inline void do_long()                     { if (!is_return_type()) get_long();   }
   inline void do_float()                    { if (!is_return_type()) get_float();  }
   inline void do_double()                   { if (!is_return_type()) get_double(); }
   inline void do_object(int begin, int end) { if (!is_return_type()) get_object(); }
+  inline void do_valuetype(int begin, int end) { if (!is_return_type()) get_valuetype();  }
   inline void do_array(int begin, int end)  { if (!is_return_type()) get_object(); } // do_array uses get_object -- there is no get_array
   inline void do_void()                     { }
 
   JavaCallArguments* arguments()     { return _arguments; }
   void push_receiver(Handle h)       { _arguments->push_oop(h); }

@@ -923,10 +925,11 @@
 
   inline void get_long()   { _arguments->push_long(va_arg(_ap, jlong)); }
   inline void get_float()  { _arguments->push_float((jfloat)va_arg(_ap, jdouble)); } // float is coerced to double w/ va_arg
   inline void get_double() { _arguments->push_double(va_arg(_ap, jdouble)); }
   inline void get_object() { _arguments->push_jobject(va_arg(_ap, jobject)); }
+  inline void get_valuetype() { _arguments->push_jobject(va_arg(_ap, jobject)); }
 
   inline void set_ap(va_list rap) {
     va_copy(_ap, rap);
   }
 

@@ -1012,10 +1015,12 @@
 
   inline void get_long()   { _arguments->push_long((_ap++)->j);  }
   inline void get_float()  { _arguments->push_float((_ap++)->f); }
   inline void get_double() { _arguments->push_double((_ap++)->d);}
   inline void get_object() { _arguments->push_jobject((_ap++)->l); }
+  // value types are implemented with oops too
+  inline void get_valuetype() { _arguments->push_jobject((_ap++)->l); }
 
   inline void set_ap(const jvalue *rap) { _ap = rap; }
 
  public:
   JNI_ArgumentPusherArray(Symbol* signature, const jvalue *rap)

@@ -1106,11 +1111,11 @@
 
   // Invoke the method. Result is returned as oop.
   JavaCalls::call(result, method, &java_args, CHECK);
 
   // Convert result
-  if (result->get_type() == T_OBJECT || result->get_type() == T_ARRAY) {
+  if (result->get_type() == T_OBJECT || result->get_type() == T_ARRAY || result->get_type() == T_VALUETYPE) {
     result->set_jobject(JNIHandles::make_local(env, (oop) result->get_jobject()));
   }
 }
 
 

@@ -1169,11 +1174,11 @@
 
   // Invoke the method. Result is returned as oop.
   JavaCalls::call(result, method, &java_args, CHECK);
 
   // Convert result
-  if (result->get_type() == T_OBJECT || result->get_type() == T_ARRAY) {
+  if (result->get_type() == T_OBJECT || result->get_type() == T_ARRAY || result->get_type() == T_VALUETYPE) {
     result->set_jobject(JNIHandles::make_local(env, (oop) result->get_jobject()));
   }
 }
 
 
< prev index next >