< prev index next >

src/hotspot/share/runtime/sharedRuntime.cpp

Print this page




2276     switch (in) {
2277       case T_BOOLEAN:
2278       case T_BYTE:
2279       case T_SHORT:
2280       case T_CHAR: {
2281         if (is_valuetype) {
2282           // Do not widen value type field types
2283           assert(ValueTypePassFieldsAsArgs, "must be enabled");
2284           return in;
2285         } else {
2286           // They are all promoted to T_INT in the calling convention
2287           return T_INT;
2288         }
2289       }
2290 
2291       case T_VALUETYPE: {
2292         // If value types are passed as fields, return 'in' to differentiate
2293         // between a T_VALUETYPE and a T_OBJECT in the signature.
2294         return ValueTypePassFieldsAsArgs ? in : adapter_encoding(T_OBJECT, false);
2295       }

2296       case T_VALUETYPEPTR:


2297       case T_OBJECT:
2298       case T_ARRAY:
2299         // In other words, we assume that any register good enough for
2300         // an int or long is good enough for a managed pointer.
2301 #ifdef _LP64
2302         return T_LONG;
2303 #else
2304         return T_INT;
2305 #endif
2306 
2307       case T_INT:
2308       case T_LONG:
2309       case T_FLOAT:
2310       case T_DOUBLE:
2311       case T_VOID:
2312         return in;
2313 
2314       default:
2315         ShouldNotReachHere();
2316         return T_CONFLICT;


2658       Klass* holder = method->method_holder();
2659       GrowableArray<BasicType> sig_bt_tmp;
2660 
2661       int i = 0;
2662       if (!method->is_static()) {  // Pass in receiver first
2663         if (holder->is_value()) {
2664           ValueKlass* vk = ValueKlass::cast(holder);
2665           if (!ValueTypePassFieldsAsArgs) {
2666             // If we don't pass value types as arguments or if the holder of
2667             // the method is __Value, we must pass a reference.
2668             sig_extended.push(SigEntry(T_VALUETYPEPTR));
2669           } else {
2670             const Array<SigEntry>* sig_vk = vk->extended_sig();
2671             sig_extended.appendAll(sig_vk);
2672           }
2673         } else {
2674           sig_extended.push(SigEntry(T_OBJECT));
2675         }
2676       }
2677       for (SignatureStream ss(method->signature()); !ss.at_return_type(); ss.next()) {
2678         if (ss.type() == T_VALUETYPE) {
2679           Symbol* name = ss.as_symbol(CHECK_NULL);
2680           if (!ValueTypePassFieldsAsArgs) {
2681             sig_extended.push(SigEntry(T_VALUETYPEPTR));
2682           } else {
2683             // Method handle intrinsics with a __Value argument may be created during
2684             // compilation. Only do a full system dictionary lookup if the argument name
2685             // is not __Value, to avoid lookups from the compiler thread.
2686             Klass* k = ss.as_klass(Handle(THREAD, holder->class_loader()),
2687                                    Handle(THREAD, holder->protection_domain()),
2688                                    SignatureStream::ReturnNull, CHECK_NULL);
2689             const Array<SigEntry>* sig_vk = ValueKlass::cast(k)->extended_sig();
2690             sig_extended.appendAll(sig_vk);
2691           }
2692         } else {
2693           sig_extended.push(SigEntry(ss.type()));
2694           if (ss.type() == T_LONG || ss.type() == T_DOUBLE) {
2695             sig_extended.push(SigEntry(T_VOID));
2696           }
2697         }
2698       }
2699     }




2276     switch (in) {
2277       case T_BOOLEAN:
2278       case T_BYTE:
2279       case T_SHORT:
2280       case T_CHAR: {
2281         if (is_valuetype) {
2282           // Do not widen value type field types
2283           assert(ValueTypePassFieldsAsArgs, "must be enabled");
2284           return in;
2285         } else {
2286           // They are all promoted to T_INT in the calling convention
2287           return T_INT;
2288         }
2289       }
2290 
2291       case T_VALUETYPE: {
2292         // If value types are passed as fields, return 'in' to differentiate
2293         // between a T_VALUETYPE and a T_OBJECT in the signature.
2294         return ValueTypePassFieldsAsArgs ? in : adapter_encoding(T_OBJECT, false);
2295       }
2296 
2297       case T_VALUETYPEPTR:
2298         return T_VALUETYPE; // TODO hack because we don't have enough bits to represent T_VALUETYPEPTR.
2299 
2300       case T_OBJECT:
2301       case T_ARRAY:
2302         // In other words, we assume that any register good enough for
2303         // an int or long is good enough for a managed pointer.
2304 #ifdef _LP64
2305         return T_LONG;
2306 #else
2307         return T_INT;
2308 #endif
2309 
2310       case T_INT:
2311       case T_LONG:
2312       case T_FLOAT:
2313       case T_DOUBLE:
2314       case T_VOID:
2315         return in;
2316 
2317       default:
2318         ShouldNotReachHere();
2319         return T_CONFLICT;


2661       Klass* holder = method->method_holder();
2662       GrowableArray<BasicType> sig_bt_tmp;
2663 
2664       int i = 0;
2665       if (!method->is_static()) {  // Pass in receiver first
2666         if (holder->is_value()) {
2667           ValueKlass* vk = ValueKlass::cast(holder);
2668           if (!ValueTypePassFieldsAsArgs) {
2669             // If we don't pass value types as arguments or if the holder of
2670             // the method is __Value, we must pass a reference.
2671             sig_extended.push(SigEntry(T_VALUETYPEPTR));
2672           } else {
2673             const Array<SigEntry>* sig_vk = vk->extended_sig();
2674             sig_extended.appendAll(sig_vk);
2675           }
2676         } else {
2677           sig_extended.push(SigEntry(T_OBJECT));
2678         }
2679       }
2680       for (SignatureStream ss(method->signature()); !ss.at_return_type(); ss.next()) {
2681         Symbol* sym = ss.as_symbol_or_null();
2682         if (sym != NULL && method->method_holder()->is_declared_value_type(sym)) {
2683           if (!ValueTypePassFieldsAsArgs) {
2684             sig_extended.push(SigEntry(T_VALUETYPEPTR));
2685           } else {
2686             // Method handle intrinsics with a __Value argument may be created during
2687             // compilation. Only do a full system dictionary lookup if the argument name
2688             // is not __Value, to avoid lookups from the compiler thread.
2689             Klass* k = ss.as_klass(Handle(THREAD, holder->class_loader()),
2690                                    Handle(THREAD, holder->protection_domain()),
2691                                    SignatureStream::ReturnNull, CHECK_NULL);
2692             const Array<SigEntry>* sig_vk = ValueKlass::cast(k)->extended_sig();
2693             sig_extended.appendAll(sig_vk);
2694           }
2695         } else {
2696           sig_extended.push(SigEntry(ss.type()));
2697           if (ss.type() == T_LONG || ss.type() == T_DOUBLE) {
2698             sig_extended.push(SigEntry(T_VOID));
2699           }
2700         }
2701       }
2702     }


< prev index next >