< prev index next >

src/share/vm/runtime/javaCalls.cpp

Print this page




 155 // Helper methods
 156 static BasicType runtime_type_from(JavaValue* result) {
 157   switch (result->get_type()) {
 158     case T_BOOLEAN: // fall through
 159     case T_CHAR   : // fall through
 160     case T_SHORT  : // fall through
 161     case T_INT    : // fall through
 162 #ifndef _LP64
 163     case T_OBJECT : // fall through
 164     case T_ARRAY  : // fall through
 165 #endif
 166     case T_BYTE   : // fall through
 167     case T_VOID   : return T_INT;
 168     case T_LONG   : return T_LONG;
 169     case T_FLOAT  : return T_FLOAT;
 170     case T_DOUBLE : return T_DOUBLE;
 171 #ifdef _LP64
 172     case T_ARRAY  : // fall through
 173     case T_OBJECT:  return T_OBJECT;
 174 #endif
 175   }
 176   ShouldNotReachHere();
 177   return T_ILLEGAL;

 178 }
 179 
 180 // ============ Virtual calls ============
 181 
 182 void JavaCalls::call_virtual(JavaValue* result, Klass* spec_klass, Symbol* name, Symbol* signature, JavaCallArguments* args, TRAPS) {
 183   CallInfo callinfo;
 184   Handle receiver = args->receiver();
 185   Klass* recvrKlass = receiver.is_null() ? (Klass*)NULL : receiver->klass();
 186   LinkInfo link_info(spec_klass, name, signature);
 187   LinkResolver::resolve_virtual_call(
 188           callinfo, receiver, recvrKlass, link_info, true, CHECK);
 189   methodHandle method = callinfo.selected_method();
 190   assert(method.not_null(), "should have thrown exception");
 191 
 192   // Invoke the method
 193   JavaCalls::call(result, method, args, CHECK);
 194 }
 195 
 196 
 197 void JavaCalls::call_virtual(JavaValue* result, Handle receiver, Klass* spec_klass, Symbol* name, Symbol* signature, TRAPS) {




 155 // Helper methods
 156 static BasicType runtime_type_from(JavaValue* result) {
 157   switch (result->get_type()) {
 158     case T_BOOLEAN: // fall through
 159     case T_CHAR   : // fall through
 160     case T_SHORT  : // fall through
 161     case T_INT    : // fall through
 162 #ifndef _LP64
 163     case T_OBJECT : // fall through
 164     case T_ARRAY  : // fall through
 165 #endif
 166     case T_BYTE   : // fall through
 167     case T_VOID   : return T_INT;
 168     case T_LONG   : return T_LONG;
 169     case T_FLOAT  : return T_FLOAT;
 170     case T_DOUBLE : return T_DOUBLE;
 171 #ifdef _LP64
 172     case T_ARRAY  : // fall through
 173     case T_OBJECT:  return T_OBJECT;
 174 #endif
 175     default:
 176       ShouldNotReachHere();
 177       return T_ILLEGAL;
 178   }
 179 }
 180 
 181 // ============ Virtual calls ============
 182 
 183 void JavaCalls::call_virtual(JavaValue* result, Klass* spec_klass, Symbol* name, Symbol* signature, JavaCallArguments* args, TRAPS) {
 184   CallInfo callinfo;
 185   Handle receiver = args->receiver();
 186   Klass* recvrKlass = receiver.is_null() ? (Klass*)NULL : receiver->klass();
 187   LinkInfo link_info(spec_klass, name, signature);
 188   LinkResolver::resolve_virtual_call(
 189           callinfo, receiver, recvrKlass, link_info, true, CHECK);
 190   methodHandle method = callinfo.selected_method();
 191   assert(method.not_null(), "should have thrown exception");
 192 
 193   // Invoke the method
 194   JavaCalls::call(result, method, args, CHECK);
 195 }
 196 
 197 
 198 void JavaCalls::call_virtual(JavaValue* result, Handle receiver, Klass* spec_klass, Symbol* name, Symbol* signature, TRAPS) {


< prev index next >