Skip to content

src: use object to pass `Environment` to functions

Use a v8::Object with an internal field, rather than a v8::External.

On a GetReturnValue().Set(Environment::GetCurrent(args) == nullptr) noop function, this benchmarks as a ~60 % speedup, as calls to obj->GetAlignedPointerFromInternalField() can be inlined.

This also makes breaking up some pieces of the Environment class into per-native-binding data easier, if we want to pursue that path in the future.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Merge request reports

Loading