diff options
author | Gus Caplan <me@gus.host> | 2018-03-04 14:59:51 -0600 |
---|---|---|
committer | Gus Caplan <me@gus.host> | 2018-03-07 12:19:38 -0600 |
commit | c9b4de55c061ecb8d64cda9e36821c21f8150925 (patch) | |
tree | 51813a516bb2ac257ff51d8b1a9059a30bc07013 /src/env-inl.h | |
parent | a6c14b2f4259a9ca080a7b486dc934e4ccef8938 (diff) | |
download | node-new-c9b4de55c061ecb8d64cda9e36821c21f8150925.tar.gz |
src: standardise context embedder indices
PR-URL: https://github.com/nodejs/node/pull/19135
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matheus Marchini <matheus@sthima.com>
Diffstat (limited to 'src/env-inl.h')
-rw-r--r-- | src/env-inl.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/env-inl.h b/src/env-inl.h index 365ace5578..89a321a920 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -31,6 +31,7 @@ #include "uv.h" #include "v8.h" #include "node_perf_common.h" +#include "node_context_data.h" #include <stddef.h> #include <stdint.h> @@ -283,7 +284,8 @@ inline void Environment::TickInfo::set_has_thrown(bool state) { inline void Environment::AssignToContext(v8::Local<v8::Context> context, const ContextInfo& info) { - context->SetAlignedPointerInEmbedderData(kContextEmbedderDataIndex, this); + context->SetAlignedPointerInEmbedderData( + ContextEmbedderIndex::kEnvironment, this); #if HAVE_INSPECTOR inspector_agent()->ContextCreated(context, info); #endif // HAVE_INSPECTOR @@ -295,7 +297,8 @@ inline Environment* Environment::GetCurrent(v8::Isolate* isolate) { inline Environment* Environment::GetCurrent(v8::Local<v8::Context> context) { return static_cast<Environment*>( - context->GetAlignedPointerFromEmbedderData(kContextEmbedderDataIndex)); + context->GetAlignedPointerFromEmbedderData( + ContextEmbedderIndex::kEnvironment)); } inline Environment* Environment::GetCurrent( @@ -368,8 +371,8 @@ inline Environment::~Environment() { inspector_agent_.reset(); #endif - context()->SetAlignedPointerInEmbedderData(kContextEmbedderDataIndex, - nullptr); + context()->SetAlignedPointerInEmbedderData( + ContextEmbedderIndex::kEnvironment, nullptr); delete[] heap_statistics_buffer_; delete[] heap_space_statistics_buffer_; |