diff options
author | Anatoli Papirovski <apapirovski@mac.com> | 2017-12-27 13:47:51 -0500 |
---|---|---|
committer | Anatoli Papirovski <apapirovski@mac.com> | 2017-12-30 19:05:58 -0500 |
commit | 58467864244924b705c6cb4e2e5c79ab9e031697 (patch) | |
tree | 0bb51cc579a45808d443280ae03ee3c61346e087 /src/env-inl.h | |
parent | 2c94424a0d9941f7e2290f86f3417b66905acdef (diff) | |
download | node-new-58467864244924b705c6cb4e2e5c79ab9e031697.tar.gz |
src: use AliasedBuffer for TickInfo
PR-URL: https://github.com/nodejs/node/pull/17881
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'src/env-inl.h')
-rw-r--r-- | src/env-inl.h | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/env-inl.h b/src/env-inl.h index 07fc359758..c25e126549 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -217,21 +217,15 @@ inline bool Environment::AsyncCallbackScope::in_makecallback() const { return env_->makecallback_cntr_ > 1; } -inline Environment::TickInfo::TickInfo() { - for (int i = 0; i < kFieldsCount; ++i) - fields_[i] = 0; -} +inline Environment::TickInfo::TickInfo(v8::Isolate* isolate) + : fields_(isolate, kFieldsCount) {} -inline uint8_t* Environment::TickInfo::fields() { +inline AliasedBuffer<uint8_t, v8::Uint8Array>& Environment::TickInfo::fields() { return fields_; } -inline int Environment::TickInfo::fields_count() const { - return kFieldsCount; -} - -inline uint8_t Environment::TickInfo::scheduled() const { - return fields_[kScheduled]; +inline bool Environment::TickInfo::has_scheduled() const { + return fields_[kHasScheduled] == 1; } inline void Environment::AssignToContext(v8::Local<v8::Context> context, @@ -269,6 +263,7 @@ inline Environment::Environment(IsolateData* isolate_data, v8::Local<v8::Context> context) : isolate_(context->GetIsolate()), isolate_data_(isolate_data), + tick_info_(context->GetIsolate()), timer_base_(uv_now(isolate_data->event_loop())), using_domains_(false), printed_error_(false), |