Bug 223884

Summary: Reduce bytecode instruction count emitted for `class extends`
Product: WebKit Reporter: Alexey Shvayka <ashvayka>
Component: JavaScriptCoreAssignee: Alexey Shvayka <ashvayka>
Status: RESOLVED FIXED    
Severity: Enhancement CC: ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch none

Description Alexey Shvayka 2021-03-29 10:37:12 PDT
Reduce bytecode instruction count emitted for `class extends`
Comment 1 Alexey Shvayka 2021-03-29 10:40:21 PDT
Created attachment 424544 [details]
Patch
Comment 2 Alexey Shvayka 2021-03-30 15:44:28 PDT
Created attachment 424707 [details]
Patch

Fix divots to point to correct location.
Comment 3 Yusuke Suzuki 2021-04-02 13:47:32 PDT
Comment on attachment 424707 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=424707&action=review

r=me

> Source/JavaScriptCore/runtime/ExceptionHelpers.cpp:275
> +static String invalidPrototypeSourceAppender(const String& originalMessage, const String& sourceText, RuntimeType, ErrorInstance::SourceTextWhereErrorOccurred occurrence)
> +{
> +    if (occurrence == ErrorInstance::FoundApproximateSource)
> +        return defaultApproximateSourceError(originalMessage, sourceText);
> +
> +    auto extendsIndex = sourceText.reverseFind("extends");
> +    if (extendsIndex == notFound || sourceText.find("extends") != extendsIndex)
> +        return makeString(originalMessage, " (evaluating '", sourceText, "')");
> +
> +    return "The value of the superclass's prototype property is not an object or null."_s;
> +}

This is awesome.
Comment 4 EWS 2021-04-02 14:20:51 PDT
Committed r275439: <https://commits.webkit.org/r275439>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 424707 [details].
Comment 5 Radar WebKit Bug Importer 2021-04-02 14:21:24 PDT
<rdar://problem/76165091>