1045 #ifdef ASSERT
1046 bool LIR_OpVisitState::no_operands(LIR_Op* op) {
1047 visit(op);
1048
1049 return opr_count(inputMode) == 0 &&
1050 opr_count(outputMode) == 0 &&
1051 opr_count(tempMode) == 0 &&
1052 info_count() == 0 &&
1053 !has_call() &&
1054 !has_slow_case();
1055 }
1056 #endif
1057
1058 //---------------------------------------------------
1059
1060
1061 void LIR_OpJavaCall::emit_code(LIR_Assembler* masm) {
1062 masm->emit_call(this);
1063 }
1064
1065 bool LIR_OpJavaCall::maybe_return_as_fields() const {
1066 if (ValueTypeReturnedAsFields) {
1067 if (method()->signature()->returns_never_null()) {
1068 ciType* return_type = method()->return_type();
1069 if (return_type->is_valuetype()) {
1070 ciValueKlass* vk = return_type->as_value_klass();
1071 if (vk->can_be_returned_as_fields()) {
1072 return true;
1073 }
1074 }
1075 } else if (is_method_handle_invoke()) {
1076 BasicType bt = method()->return_type()->basic_type();
1077 if (bt == T_OBJECT || bt == T_VALUETYPE) {
1078 // A value type might be returned from the call but we don't know its
1079 // type.
1080 return true;
1081 }
1082 }
1083 }
1084 return false;
1085 }
1086
1087 void LIR_OpRTCall::emit_code(LIR_Assembler* masm) {
1088 masm->emit_rtcall(this);
1089 }
1090
1091 void LIR_OpLabel::emit_code(LIR_Assembler* masm) {
1092 masm->emit_opLabel(this);
1093 }
1094
1095 void LIR_OpArrayCopy::emit_code(LIR_Assembler* masm) {
1096 masm->emit_arraycopy(this);
1097 masm->append_code_stub(stub());
1098 }
1099
|
1045 #ifdef ASSERT
1046 bool LIR_OpVisitState::no_operands(LIR_Op* op) {
1047 visit(op);
1048
1049 return opr_count(inputMode) == 0 &&
1050 opr_count(outputMode) == 0 &&
1051 opr_count(tempMode) == 0 &&
1052 info_count() == 0 &&
1053 !has_call() &&
1054 !has_slow_case();
1055 }
1056 #endif
1057
1058 //---------------------------------------------------
1059
1060
1061 void LIR_OpJavaCall::emit_code(LIR_Assembler* masm) {
1062 masm->emit_call(this);
1063 }
1064
1065 bool LIR_OpJavaCall::maybe_return_as_fields(ciValueKlass** vk_ret) const {
1066 if (ValueTypeReturnedAsFields) {
1067 if (method()->signature()->returns_never_null()) {
1068 ciType* return_type = method()->return_type();
1069 if (return_type->is_valuetype()) {
1070 ciValueKlass* vk = return_type->as_value_klass();
1071 if (vk->can_be_returned_as_fields()) {
1072 if (vk_ret != NULL) {
1073 *vk_ret = vk;
1074 }
1075 return true;
1076 }
1077 }
1078 } else if (is_method_handle_invoke()) {
1079 BasicType bt = method()->return_type()->basic_type();
1080 if (bt == T_OBJECT || bt == T_VALUETYPE) {
1081 // A value type might be returned from the call but we don't know its
1082 // type. Either we get a buffered value (and nothing needs to be done)
1083 // or one of the values being returned is the klass of the value type
1084 // (RAX on x64, with LSB set to 1) and we need to allocate a value
1085 // type instance of that type and initialize it with other values being
1086 // returned (in other registers).
1087 // type.
1088 if (vk_ret != NULL) {
1089 *vk_ret = NULL;
1090 }
1091 return true;
1092 }
1093 }
1094 }
1095 return false;
1096 }
1097
1098 void LIR_OpRTCall::emit_code(LIR_Assembler* masm) {
1099 masm->emit_rtcall(this);
1100 }
1101
1102 void LIR_OpLabel::emit_code(LIR_Assembler* masm) {
1103 masm->emit_opLabel(this);
1104 }
1105
1106 void LIR_OpArrayCopy::emit_code(LIR_Assembler* masm) {
1107 masm->emit_arraycopy(this);
1108 masm->append_code_stub(stub());
1109 }
1110
|