Bug 132351 - JSProxies should be cacheable
Summary: JSProxies should be cacheable
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Hahnenberg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-29 12:59 PDT by Mark Hahnenberg
Modified: 2014-04-29 15:22 PDT (History)
1 user (show)

See Also:


Attachments
Patch (14.67 KB, patch)
2014-04-29 13:05 PDT, Mark Hahnenberg
no flags Details | Formatted Diff | Diff
Patch (19.64 KB, patch)
2014-04-29 14:06 PDT, Mark Hahnenberg
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hahnenberg 2014-04-29 12:59:27 PDT
Whenever we encounter a proxy in an inline cache we should try to cache on the proxy's target instead of giving up.
Comment 1 Mark Hahnenberg 2014-04-29 13:05:25 PDT
Created attachment 230406 [details]
Patch
Comment 2 WebKit Commit Bot 2014-04-29 13:07:23 PDT
Attachment 230406 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/jit/Repatch.cpp:311:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/JavaScriptCore/jit/Repatch.cpp:322:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/JavaScriptCore/runtime/Operations.h:264:  Multi line control clauses should use braces.  [whitespace/braces] [4]
Total errors found: 3 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Filip Pizlo 2014-04-29 13:07:35 PDT
Comment on attachment 230406 [details]
Patch

Lol can has some tests?  I'd add a fako Proxy in jsc.cpp that behaves like JSGLobalObject (maybe we have one already?) and then write some tests that various try and either succeed or fail in caching on it.
Comment 4 Mark Hahnenberg 2014-04-29 14:06:11 PDT
Created attachment 230414 [details]
Patch
Comment 5 WebKit Commit Bot 2014-04-29 14:08:14 PDT
Attachment 230414 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/Operations.h:264:  Multi line control clauses should use braces.  [whitespace/braces] [4]
Total errors found: 1 in 13 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Geoffrey Garen 2014-04-29 14:54:49 PDT
Comment on attachment 230414 [details]
Patch

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

r=me

> Source/JavaScriptCore/ChangeLog:15
> +        This is performance neutral on the benchmarks we track, although currently we won't

I would remove "although", and just start a new sentence.

> Source/JavaScriptCore/jsc.cpp:611
> +    Structure* structure = Proxy::createStructure(exec->vm(), exec->lexicalGlobalObject(), jsTarget->prototype());

You could just instantiate JSProxy here.

> Source/JavaScriptCore/jit/Repatch.cpp:746
> +        if (!structure->propertyAccessesAreCacheable())
> +            return false;

Let's rearrange this to share the propertyAccessesAreCacheable() check. It's nice to keep the PureForwardingProxyType thingy only substituting the base, and not doing anything else.
Comment 7 Mark Hahnenberg 2014-04-29 15:22:40 PDT
Committed r167963: <http://trac.webkit.org/changeset/167963>