Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do typeof string check before looking for String constructor (#4198)
In `constructNewChildrenArray` we look for the `String` constructor to support #4151 (i.e. strings created with `new String`). However, doing this check first leads to a megamorphic deopt in `constructorNewChildrenArray` since V8 has many different internal types for strings, leading to a megamorphic access for `childVNode.constructor` in the common case (normal strings and VNodes). This PR adds back the `typeof childVNode == 'string'` check to catch normal strings first before falling back to `childVNode.constructor == String` to check for manually constructed strings. Commits: * Add back typeof string check in diffChildren (+5 B) * Store matching oldVNode in variable in constructNewChildrenArray (-4 B) * Inline insertion checks into skew block (-3 B)
- Loading branch information