Bug 134635 - Fast path for jsStringWithCache() when asked for the same string repeatedly.
Summary: Fast path for jsStringWithCache() when asked for the same string repeatedly.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-04 10:24 PDT by Andreas Kling
Modified: 2014-07-07 11:21 PDT (History)
6 users (show)

See Also:


Attachments
Patch (8.47 KB, patch)
2014-07-04 10:28 PDT, Andreas Kling
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-09 for mac-mountainlion-wk2 (518.68 KB, application/zip)
2014-07-04 12:51 PDT, Build Bot
no flags Details
Patch (10.04 KB, patch)
2014-07-04 15:33 PDT, Andreas Kling
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2014-07-04 10:24:17 PDT
Something I talked about with Geoff a while ago, that other JS engines already do, that we could save some easy cycles with..
Comment 1 Andreas Kling 2014-07-04 10:28:09 PDT
Created attachment 234414 [details]
Patch
Comment 2 Darin Adler 2014-07-04 12:15:45 PDT
Comment on attachment 234414 [details]
Patch

Windows export issue:

     1>WebKit.exp : error LNK2001: unresolved external symbol "class JSC::JSValue __cdecl WebCore::jsStringWithCache(class JSC::ExecState *,class WTF::String const &)" (?jsStringWithCache@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@ABVString@WTF@@@Z)
Comment 3 Build Bot 2014-07-04 12:51:18 PDT
Comment on attachment 234414 [details]
Patch

Attachment 234414 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/6239582064476160

New failing tests:
media/W3C/video/networkState/networkState_during_loadstart.html
Comment 4 Build Bot 2014-07-04 12:51:21 PDT
Created attachment 234417 [details]
Archive of layout-test-results from webkit-ews-09 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-09  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 5 Andreas Kling 2014-07-04 15:33:57 PDT
Created attachment 234423 [details]
Patch

Try to fix Windows build.
Comment 6 Andreas Kling 2014-07-04 20:37:04 PDT
Committed r170818: <http://trac.webkit.org/changeset/170818>
Comment 7 Geoffrey Garen 2014-07-07 11:21:23 PDT
Comment on attachment 234423 [details]
Patch

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

> Source/JavaScriptCore/runtime/JSString.cpp:383
> +    vm.lastCachedString = addResult.iterator->value.get();
> +    return vm.lastCachedString.get();

Weak<T>::get() is non-trivial, so it is better to put the value in a local variable and return the local variable. The compiler can't optimize away this get().