@@ -472,8 +472,7 @@ class GlobalCompilerVisitor
472
472
my_recv = autobox (recv , object_type )
473
473
end
474
474
var thunk = new CustomizedThunkFunction (mmethoddef , my_recv .mtype .as (MClassType ))
475
- thunk .polymorph_call_flag = not my_recv .is_exact #true
476
- #thunk.force_polymorphism = not my_recv.is_exact
475
+ thunk .polymorph_call_flag = not my_recv .is_exact
477
476
compiler .todo (method )
478
477
compiler .todo (thunk )
479
478
@@ -499,12 +498,7 @@ class GlobalCompilerVisitor
499
498
var ret_mtype = mmethoddef .msignature .return_mtype
500
499
501
500
if ret_mtype != null then
502
- # TODO check for separate compiler
503
501
ret_mtype = resolve_for (ret_mtype , routine )
504
- # var temp = ret_mtype
505
- # If mmethoddef has a return type, use the type defined
506
- # in the routine instance instead.
507
- #ret_mtype = routine_type.arguments.last
508
502
end
509
503
var callsite = "{underlying_method } ( {ss } ) "
510
504
if ret_mtype != null then
@@ -1122,17 +1116,17 @@ private class CustomizedRuntimeFunction
1122
1116
# class A[E]
1123
1117
# fun toto(x: E)
1124
1118
# do
1125
- # ...do something with x...
1119
+ # # ...do something with x...
1126
1120
# end
1127
1121
# end
1128
1122
# end
1129
1123
# var a = new A[nullable Int]
1130
1124
# var f = &a.toto
1131
- # f.call(null) <-- Will produce a proper C callsite, but it will
1132
- # -- produce unreachable (dead code) for type checking
1133
- # -- and covariance. Thus, creating warnings when
1134
- # -- compiling in global. However, if you ignore
1135
- # -- those warnings, the binary works perfectly fine.
1125
+ # f.call(null) # Will produce a proper C callsite, but it will
1126
+ # # produce unreachable (dead code) for type checking
1127
+ # # and covariance. Thus, creating warnings when
1128
+ # # compiling in global. However, if you ignore
1129
+ # # those warnings, the binary works perfectly fine.
1136
1130
# ~~~~
1137
1131
var intromclassdef = self .mmethoddef .mproperty .intro_mclassdef
1138
1132
var is_callref = v .compiler .all_routine_types_name .has (intromclassdef .name )
@@ -1165,12 +1159,12 @@ private class CustomizedRuntimeFunction
1165
1159
end
1166
1160
end
1167
1161
1162
+ # Thunk implementation for global compiler.
1163
+ # For more detail see `abstract_compiler::ThunkFunction` documentation.
1168
1164
class CustomizedThunkFunction
1169
1165
super ThunkFunction
1170
1166
super CustomizedRuntimeFunction
1171
1167
1172
- #var force_polymorphism = false
1173
-
1174
1168
redef fun c_name
1175
1169
do
1176
1170
return "THUNK_ " + super
0 commit comments