summaryrefslogtreecommitdiff
path: root/src/env-inl.h
diff options
context:
space:
mode:
authorTrevor Norris <trev.norris@gmail.com>2013-08-27 11:30:06 -0700
committerTrevor Norris <trev.norris@gmail.com>2013-10-29 15:09:44 -0700
commit4b84e42f67d7754574bf7d289524f6dffcb5e14a (patch)
treea494daf6e4a3910d622ec1d708154ff5a0dacd77 /src/env-inl.h
parenta9a53ca05a410b8ca1067b4f1f2357c319e113d8 (diff)
downloadnode-new-4b84e42f67d7754574bf7d289524f6dffcb5e14a.tar.gz
node: don't share state with in_tick/last_threw
There was no need to share state between C++ and JS for these two values. So they have been moved to their respective locations. This will help performance only a tiny bit, but it does help code complexity much more.
Diffstat (limited to 'src/env-inl.h')
-rw-r--r--src/env-inl.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/env-inl.h b/src/env-inl.h
index 0c5d272842..b520e07129 100644
--- a/src/env-inl.h
+++ b/src/env-inl.h
@@ -85,7 +85,7 @@ inline uint32_t Environment::DomainFlag::count() const {
return fields_[kCount];
}
-inline Environment::TickInfo::TickInfo() {
+inline Environment::TickInfo::TickInfo() : in_tick_(false), last_threw_(false) {
for (int i = 0; i < kFieldsCount; ++i) fields_[i] = 0;
}
@@ -97,28 +97,32 @@ inline int Environment::TickInfo::fields_count() const {
return kFieldsCount;
}
-inline uint32_t Environment::TickInfo::in_tick() const {
- return fields_[kInTick];
+inline bool Environment::TickInfo::in_tick() const {
+ return in_tick_;
}
inline uint32_t Environment::TickInfo::index() const {
return fields_[kIndex];
}
-inline uint32_t Environment::TickInfo::last_threw() const {
- return fields_[kLastThrew];
+inline bool Environment::TickInfo::last_threw() const {
+ return last_threw_;
}
inline uint32_t Environment::TickInfo::length() const {
return fields_[kLength];
}
+inline void Environment::TickInfo::set_in_tick(bool value) {
+ in_tick_ = value;
+}
+
inline void Environment::TickInfo::set_index(uint32_t value) {
fields_[kIndex] = value;
}
-inline void Environment::TickInfo::set_last_threw(uint32_t value) {
- fields_[kLastThrew] = value;
+inline void Environment::TickInfo::set_last_threw(bool value) {
+ last_threw_ = value;
}
inline Environment* Environment::New(v8::Local<v8::Context> context) {