You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following program:
package main
func main() {
_ = foo().(int)
}
func foo() interface{} {
return 42
}
compiler calls runtime.assertE2T which calls assertE2Tret which calls copyout.
Compiler should inline this conversion. All is needed is:
if(sizeof(T) == sizeof(void*) && eface.type == targetType)
return eface.word;
else
return runtime.assertE2T(eface);
The text was updated successfully, but these errors were encountered:
I don't believe these kinds of optimizations are worthwhile unless the function call is
avoided entirely. That's not possible here. Probably not worth doing.
Certainly not until the compiler is written in Go.
I don't understand. The function is called only in case of panic, so it can be
considered not called at all. Most of the time we just compare type word with constant
and that's it.
The text was updated successfully, but these errors were encountered: