Use a primop for getting the fields of the AP_STACK rather than an FFI call