[stack-trace] Introduce two usage counters for two CallSite API builtins
This CL introduces two usage counters for two CallSite functions in sloppy mode: - getFunction() - getThis() Chromium CL: https://crrev.com/c/1657902 Bug: v8:8742 Change-Id: I81e8fec48534f5932a72de86d9d21f3b370c66a7 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1657919 Commit-Queue: Simon Zünd <szuend@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{#62164}
This commit is contained in:
parent
dadb59eb42
commit
1c1aa818af
@ -7631,6 +7631,8 @@ class V8_EXPORT Isolate {
|
||||
kRegExpMatchIsFalseishOnJSRegExp = 73,
|
||||
kDateGetTimezoneOffset = 74,
|
||||
kStringNormalize = 75,
|
||||
kCallSiteAPIGetFunctionSloppyCall = 76,
|
||||
kCallSiteAPIGetThisSloppyCall = 77,
|
||||
|
||||
// If you add new values here, you'll also need to update Chromium's:
|
||||
// web_feature.mojom, UseCounterCallback.cpp, and enums.xml. V8 changes to
|
||||
|
@ -76,6 +76,9 @@ BUILTIN(CallSitePrototypeGetFunction) {
|
||||
|
||||
StackFrameBase* frame = it.Frame();
|
||||
if (frame->IsStrict()) return ReadOnlyRoots(isolate).undefined_value();
|
||||
|
||||
isolate->CountUsage(v8::Isolate::kCallSiteAPIGetFunctionSloppyCall);
|
||||
|
||||
return *frame->GetFunction();
|
||||
}
|
||||
|
||||
@ -135,6 +138,9 @@ BUILTIN(CallSitePrototypeGetThis) {
|
||||
|
||||
StackFrameBase* frame = it.Frame();
|
||||
if (frame->IsStrict()) return ReadOnlyRoots(isolate).undefined_value();
|
||||
|
||||
isolate->CountUsage(v8::Isolate::kCallSiteAPIGetThisSloppyCall);
|
||||
|
||||
return *frame->GetReceiver();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user