Cherry pick 588e15c and c0d4bb8 from upstream V8
Checklist
-
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines
Affected core subsystem(s)
deps
Description of change
Backport of bugfix from upstream V8. This is already fixed in versions 5.2 and 5.3 of V8 but is needed for 5.1.
cc @nodejs/v8