vm_map_insert() first determines if the previous map entry's object can be extended, and then determines if the previous map entry can be extended. Testing prev_entry->eflags == protoeflags and the previous entry's wire count at first goes beyond determining whether the object can be extended.
To be clear, all that I am trying to achieve in vm_map_insert() is object coalescing. Later, when vm_map_wire() runs, it will coalesce the map entries, but that's not possible without the object coalescing in vm_map_insert().
I'm not proposing to commit the change to vm_mmap.c. That change made it easier to see the effects of the rest.