Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-03-01 23:31:40 +0300
committerAnna Henningsen <anna@addaleax.net>2019-03-05 02:56:37 +0300
commit955be8623d58566849cf6a59ff82e78cf14f239a (patch)
treeff4ad2ccd691527045ef10eb57f5b5dc4c773dac /src/node_process.h
parent1bdcfa7abe308bb7f79cd3679e9f345b58b37334 (diff)
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 and the field is stored with one level of indirection less. 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. PR-URL: https://github.com/nodejs/node/pull/26382 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/node_process.h')
-rw-r--r--src/node_process.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_process.h b/src/node_process.h
index 452805ada31..4edf10a1c54 100644
--- a/src/node_process.h
+++ b/src/node_process.h
@@ -9,7 +9,7 @@ namespace node {
v8::MaybeLocal<v8::Object> CreateEnvVarProxy(v8::Local<v8::Context> context,
v8::Isolate* isolate,
- v8::Local<v8::Value> data);
+ v8::Local<v8::Object> data);
// Most of the time, it's best to use `console.error` to write
// to the process.stderr stream. However, in some cases, such as