Add runtime callstats scopes to some internal accessors

BUG=v8:5557
R=cbruni@chromium.org

Review-Url: https://codereview.chromium.org/2448473002
Cr-Commit-Position: refs/heads/master@{#40560}
This commit is contained in:
jochen 2016-10-25 05:30:54 -07:00 committed by Commit bot
parent ee2f80c6bd
commit b3bdb05f71
2 changed files with 16 additions and 0 deletions

View File

@ -151,6 +151,8 @@ void Accessors::ArrayLengthGetter(
v8::Local<v8::Name> name,
const v8::PropertyCallbackInfo<v8::Value>& info) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate());
RuntimeCallTimerScope timer(
isolate, &RuntimeCallStats::AccessorNameGetterCallback_ArrayLength);
DisallowHeapAllocation no_allocation;
HandleScope scope(isolate);
JSArray* holder = JSArray::cast(*Utils::OpenHandle(*info.Holder()));
@ -255,6 +257,8 @@ void Accessors::StringLengthGetter(
v8::Local<v8::Name> name,
const v8::PropertyCallbackInfo<v8::Value>& info) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate());
RuntimeCallTimerScope timer(
isolate, &RuntimeCallStats::AccessorNameGetterCallback_StringLength);
DisallowHeapAllocation no_allocation;
HandleScope scope(isolate);
@ -735,6 +739,8 @@ void Accessors::FunctionPrototypeGetter(
v8::Local<v8::Name> name,
const v8::PropertyCallbackInfo<v8::Value>& info) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate());
RuntimeCallTimerScope timer(
isolate, &RuntimeCallStats::AccessorNameGetterCallback_FunctionPrototype);
HandleScope scope(isolate);
Handle<JSFunction> function =
Handle<JSFunction>::cast(Utils::OpenHandle(*info.Holder()));
@ -1108,6 +1114,9 @@ Handle<AccessorInfo> Accessors::FunctionCallerInfo(
void Accessors::BoundFunctionLengthGetter(
v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate());
RuntimeCallTimerScope timer(
isolate,
&RuntimeCallStats::AccessorNameGetterCallback_BoundFunctionLength);
HandleScope scope(isolate);
Handle<JSBoundFunction> function =
Handle<JSBoundFunction>::cast(Utils::OpenHandle(*info.Holder()));
@ -1142,6 +1151,8 @@ Handle<AccessorInfo> Accessors::BoundFunctionLengthInfo(
void Accessors::BoundFunctionNameGetter(
v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate());
RuntimeCallTimerScope timer(
isolate, &RuntimeCallStats::AccessorNameGetterCallback_BoundFunctionName);
HandleScope scope(isolate);
Handle<JSBoundFunction> function =
Handle<JSBoundFunction>::cast(Utils::OpenHandle(*info.Holder()));

View File

@ -671,6 +671,11 @@ class RuntimeCallTimer {
#define FOR_EACH_MANUAL_COUNTER(V) \
V(AccessorGetterCallback) \
V(AccessorNameGetterCallback) \
V(AccessorNameGetterCallback_ArrayLength) \
V(AccessorNameGetterCallback_BoundFunctionLength) \
V(AccessorNameGetterCallback_BoundFunctionName) \
V(AccessorNameGetterCallback_FunctionPrototype) \
V(AccessorNameGetterCallback_StringLength) \
V(AccessorNameSetterCallback) \
V(Compile) \
V(CompileCode) \