diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2021-07-09 20:54:09 +0300 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2021-11-17 06:46:30 +0300 |
commit | e6d8ae05b2cba68594d6ffd7cce721f19b1722bd (patch) | |
tree | c7de05c7401b1d5fd5ce570c86a03433c707dfe9 /src/node_external_reference.h | |
parent | 4265f2769bf91c0edb002da675fce98bbf61de04 (diff) |
process: support hrtime in the snapshot
Put the hrtime backing store in the process methods binding data
so that it can be integrated into the snapshot builder. For
now we simply discard the contents of the hrtime buffer during
serialization and create new buffers upon deserialization because
the contents are only useful in a synchronous call.
This also moves the helper function for creating V8 FastAPI methods
into `Environment::SetFastMethod()` for code reuse. The v8::CFunction
need to be created before the Environment is created so that we
have the CTypeInfo address available for external reference
registration.
PR-URL: https://github.com/nodejs/node/pull/40649
Refs: https://github.com/nodejs/node/issues/35711
Refs: https://github.com/nodejs/node/issues/37476
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_external_reference.h')
-rw-r--r-- | src/node_external_reference.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/node_external_reference.h b/src/node_external_reference.h index 445ca19f3fb..347945a7496 100644 --- a/src/node_external_reference.h +++ b/src/node_external_reference.h @@ -5,10 +5,13 @@ #include <cinttypes> #include <vector> +#include "v8-fast-api-calls.h" #include "v8.h" namespace node { +using CFunctionCallback = void (*)(v8::Local<v8::Value> receiver); + // This class manages the external references from the V8 heap // to the C++ addresses in Node.js. class ExternalReferenceRegistry { @@ -16,6 +19,8 @@ class ExternalReferenceRegistry { ExternalReferenceRegistry(); #define ALLOWED_EXTERNAL_REFERENCE_TYPES(V) \ + V(CFunctionCallback) \ + V(const v8::CFunctionInfo*) \ V(v8::FunctionCallback) \ V(v8::AccessorGetterCallback) \ V(v8::AccessorSetterCallback) \ |