Bug 193858

Summary: [JSC] Offer @makeTypeError instead of exposing @TypeError
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: JavaScriptCoreAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, mark.lam, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch mark.lam: review+

Description Yusuke Suzuki 2019-01-25 17:41:16 PST
And by doing so, we can make TypeError, ErrorPrototype, ErrorConstructor etc.'s dependency tree lazily-allocated.
Comment 1 Yusuke Suzuki 2019-03-03 02:37:57 PST
Created attachment 363454 [details]
Patch
Comment 2 EWS Watchlist 2019-03-03 02:41:22 PST
Attachment 363454 [details] did not pass style-queue:


ERROR: Source/WebCore/ChangeLog:8:  You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 1 in 18 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Yusuke Suzuki 2019-03-03 03:27:34 PST
Created attachment 363455 [details]
Patch
Comment 4 Mark Lam 2019-03-03 12:55:08 PST
Comment on attachment 363455 [details]
Patch

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

r=me

> Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:698
> +

This seems unnecessary.

> Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:762
> -    JSGlobalObject* globalObject = exec->lexicalGlobalObject();
> -    VM& vm = globalObject->vm();
> +    VM& vm = exec->vm();
>      auto scope = DECLARE_THROW_SCOPE(vm);
>  
> +    JSGlobalObject* globalObject = exec->lexicalGlobalObject();

Why make this change?  It's more efficient to get the vm from the globalObject than from the ExecState, and getting the lexicalGlobalObject() cannot throw an exception, can it?
Comment 5 Yusuke Suzuki 2019-03-04 10:52:37 PST
Comment on attachment 363455 [details]
Patch

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

Thank you

>> Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:698
>> +
> 
> This seems unnecessary.

Removed.

>> Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:762
>> +    JSGlobalObject* globalObject = exec->lexicalGlobalObject();
> 
> Why make this change?  It's more efficient to get the vm from the globalObject than from the ExecState, and getting the lexicalGlobalObject() cannot throw an exception, can it?

I aligned this code to the other places, but it seems that this code is better in terms of performance. Reverted.
Comment 6 Yusuke Suzuki 2019-03-04 10:56:32 PST
Committed r242365: <https://trac.webkit.org/changeset/242365>
Comment 7 Radar WebKit Bug Importer 2019-03-04 10:57:18 PST
<rdar://problem/48568181>