summaryrefslogtreecommitdiff
path: root/src/node_perf.cc
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2018-08-19 08:41:26 -0700
committerJames M Snell <jasnell@gmail.com>2018-08-21 22:29:08 -0700
commit588fb05e7858e11e556d5a50213e293a2a66e631 (patch)
treeb3c54c92e88f078da8b87c922e69f63c391d9238 /src/node_perf.cc
parent4e2fa8b0dc1acd95f558cd5f123711b9cc936c72 (diff)
downloadnode-new-588fb05e7858e11e556d5a50213e293a2a66e631.tar.gz
perf_hooks: move strings to env
Move repeatedly created strings to env PR-URL: https://github.com/nodejs/node/pull/22401 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'src/node_perf.cc')
-rw-r--r--src/node_perf.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/node_perf.cc b/src/node_perf.cc
index 9c995d3b8d..1564b9582c 100644
--- a/src/node_perf.cc
+++ b/src/node_perf.cc
@@ -80,7 +80,7 @@ inline void InitObject(const PerformanceEntry& entry, Local<Object> obj) {
attr)
.FromJust();
obj->DefineOwnProperty(context,
- FIXED_ONE_BYTE_STRING(isolate, "entryType"),
+ env->entry_type_string(),
String::NewFromUtf8(isolate,
entry.type().c_str(),
v8::NewStringType::kNormal)
@@ -88,11 +88,11 @@ inline void InitObject(const PerformanceEntry& entry, Local<Object> obj) {
attr)
.FromJust();
obj->DefineOwnProperty(context,
- FIXED_ONE_BYTE_STRING(isolate, "startTime"),
+ env->start_time_string(),
Number::New(isolate, entry.startTime()),
attr).FromJust();
obj->DefineOwnProperty(context,
- FIXED_ONE_BYTE_STRING(isolate, "duration"),
+ env->duration_string(),
Number::New(isolate, entry.duration()),
attr).FromJust();
}
@@ -249,7 +249,7 @@ void PerformanceGCCallback(Environment* env, void* ptr) {
v8::PropertyAttribute attr =
static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete);
obj->DefineOwnProperty(context,
- FIXED_ONE_BYTE_STRING(env->isolate(), "kind"),
+ env->kind_string(),
Integer::New(env->isolate(), entry->gckind()),
attr).FromJust();
PerformanceEntry::Notify(env, entry->kind(), obj);