WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
162995
[JSC] Add @throwXXXError bytecode intrinsic
https://bugs.webkit.org/show_bug.cgi?id=162995
Summary
[JSC] Add @throwXXXError bytecode intrinsic
Yusuke Suzuki
Reported
2016-10-05 22:04:29 PDT
In builtin JS, there are so many `throw @TypeError(".....");` things. But it spreads so large byte code sequence, effectively enlarges the size of bytecodes, and prevent us from inlining! [ 15] resolve_scope loc8, loc3, PrivateSymbol.TypeError(@id0), <GlobalVar>, 0, 0x110bdc0a0 [ 22] get_from_scope loc9, loc8, PrivateSymbol.TypeError(@id0), 2049<ThrowIfNotFound|GlobalVar|NotInitialization>, 238692432 predicting None [ 30] mov loc12, loc9 [ 33] mov loc11, String (atomic) (identifier): Properties can only be defined on Objects., ID: 4(const0) [ 36] construct loc9, loc9, 2, 18 (this at loc12) status(Could Take Slow Path) predicting None [ 45] throw loc9 [ 47] ... Oh, it bloats 32 intructions! We already have great solution. Let's emit op_throw_static_error instead (size is only 3).
Attachments
Patch
(79.90 KB, patch)
2016-10-05 23:58 PDT
,
Yusuke Suzuki
saam
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Yusuke Suzuki
Comment 1
2016-10-05 22:10:40 PDT
Some motivation: we would like to implement Object.defineProperty in builtin JS and allows it inlined. By doing so, property descriptor object { value: xxx } can get a chance to be allocation sinked in FTL. But it turns out that @TypeError etc. operations easily enlarge the size of byte code sequence and prevent us from inlining.
Yusuke Suzuki
Comment 2
2016-10-05 23:58:13 PDT
Created
attachment 290786
[details]
Patch
Saam Barati
Comment 3
2016-10-06 00:40:38 PDT
Comment on
attachment 290786
[details]
Patch Maybe it's worth fixing the builtins in WebCore too? Or maybe in a follow up patch?
Yusuke Suzuki
Comment 4
2016-10-06 00:44:46 PDT
(In reply to
comment #3
)
> Comment on
attachment 290786
[details]
> Patch > > Maybe it's worth fixing the builtins in WebCore too? Or maybe in a follow up > patch?
Yeah, it's worth fixing in WebCore! I'll upload it separately soon.
Yusuke Suzuki
Comment 5
2016-10-06 00:46:57 PDT
Committed
r206853
: <
http://trac.webkit.org/changeset/206853
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug