src: do not cache `NumberOfHeapSpaces()` globally
While NumberOfHeapSpaces()
currently returns a constant value,
that is not strictly guaranteed by the V8 API as far as I can tell.
Therefore, caching it globally does not seem appropriate.
(The motivation here is that this squelches warnings which are produced by concurrency debugging tooling due to the apparent race conditions when accessing the global variable.)
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes (presumably) -
commit message follows commit guidelines