Bug 223884 - Reduce bytecode instruction count emitted for `class extends`
Summary: Reduce bytecode instruction count emitted for `class extends`
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Enhancement
Assignee: Alexey Shvayka
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-29 10:37 PDT by Alexey Shvayka
Modified: 2021-04-02 14:21 PDT (History)
8 users (show)

See Also:


Attachments
Patch (19.75 KB, patch)
2021-03-29 10:40 PDT, Alexey Shvayka
no flags Details | Formatted Diff | Diff
Patch (21.33 KB, patch)
2021-03-30 15:44 PDT, Alexey Shvayka
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>