WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
95633
Improve JSC use of Strings after the UString->String change
https://bugs.webkit.org/show_bug.cgi?id=95633
Summary
Improve JSC use of Strings after the UString->String change
Benjamin Poulain
Reported
2012-08-31 21:43:16 PDT
Take advantage of the goodness of String. Some microbenchmark improved:
http://jsperf.com/js-error-bench
Attachments
Patch
(103.75 KB, patch)
2012-08-31 22:33 PDT
,
Benjamin Poulain
no flags
Details
Formatted Diff
Diff
Patch
(102.67 KB, patch)
2012-08-31 23:03 PDT
,
Benjamin Poulain
no flags
Details
Formatted Diff
Diff
Patch
(102.75 KB, patch)
2012-09-02 13:27 PDT
,
Benjamin Poulain
no flags
Details
Formatted Diff
Diff
Patch
(103.15 KB, patch)
2012-09-02 14:09 PDT
,
Benjamin Poulain
no flags
Details
Formatted Diff
Diff
Patch
(97.10 KB, patch)
2012-09-04 12:31 PDT
,
Benjamin Poulain
no flags
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Benjamin Poulain
Comment 1
2012-08-31 22:33:32 PDT
Created
attachment 161815
[details]
Patch
Benjamin Poulain
Comment 2
2012-08-31 23:03:57 PDT
Created
attachment 161817
[details]
Patch
Build Bot
Comment 3
2012-08-31 23:21:34 PDT
Comment on
attachment 161817
[details]
Patch
Attachment 161817
[details]
did not pass mac-ews (mac): Output:
http://queues.webkit.org/results/13724456
Geoffrey Garen
Comment 4
2012-09-01 01:23:34 PDT
Comment on
attachment 161817
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=161817&action=review
This patch looks good, but I'm wondering about these null -> empty string changes.
> Source/JavaScriptCore/runtime/Error.h:92 > - function->finishCreation(exec->globalData(), ""); > + function->finishCreation(exec->globalData(), String());
Why is this change from empty string to null string OK?
> Source/JavaScriptCore/runtime/FunctionPrototype.h:35 > - prototype->finishCreation(exec, ""); > + prototype->finishCreation(exec, String());
Why is this change from empty string to null string OK?
> Source/JavaScriptCore/runtime/InternalFunction.cpp:47 > - putDirect(globalData, globalData.propertyNames->name, jsString(&globalData, name.isNull() ? "" : name), DontDelete | ReadOnly | DontEnum); > + putDirect(globalData, globalData.propertyNames->name, jsString(&globalData, name), DontDelete | ReadOnly | DontEnum);
Why is this change from empty string to null string OK?
> Source/JavaScriptCore/runtime/JSFunction.cpp:99 > - putDirect(exec->globalData(), exec->globalData().propertyNames->name, jsString(exec, name.isNull() ? "" : name), DontDelete | ReadOnly | DontEnum); > + putDirect(exec->globalData(), exec->globalData().propertyNames->name, jsString(exec, name), DontDelete | ReadOnly | DontEnum);
Why is this change from empty string to null string OK?
> Source/JavaScriptCore/runtime/JSGlobalObject.cpp:210 > - protoAccessor->setGetter(exec->globalData(), JSFunction::create(exec, this, 0, "", globalFuncProtoGetter)); > - protoAccessor->setSetter(exec->globalData(), JSFunction::create(exec, this, 0, "", globalFuncProtoSetter)); > + protoAccessor->setGetter(exec->globalData(), JSFunction::create(exec, this, 0, String(), globalFuncProtoGetter)); > + protoAccessor->setSetter(exec->globalData(), JSFunction::create(exec, this, 0, String(), globalFuncProtoSetter));
Why is this change from empty string to null string OK?
> Source/JavaScriptCore/runtime/JSGlobalObject.cpp:329 > - JSFunction* thrower = JSFunction::create(exec, this, 0, "", globalFuncThrowTypeError); > + JSFunction* thrower = JSFunction::create(exec, this, 0, String(), globalFuncThrowTypeError);
Why is this change from empty string to null string OK?
Benjamin Poulain
Comment 5
2012-09-01 01:29:38 PDT
(In reply to
comment #4
)
> (From update of
attachment 161817
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=161817&action=review
> > This patch looks good, but I'm wondering about these null -> empty string changes.
Every case is described in the ChangeLog. They are in the comments per function, not at the beginning.
Geoffrey Garen
Comment 6
2012-09-01 10:56:20 PDT
Comment on
attachment 161817
[details]
Patch Reading is fundamental! :) r=me
Benjamin Poulain
Comment 7
2012-09-02 13:27:22 PDT
Created
attachment 161847
[details]
Patch
Benjamin Poulain
Comment 8
2012-09-02 14:09:47 PDT
Created
attachment 161849
[details]
Patch
Benjamin Poulain
Comment 9
2012-09-02 14:11:22 PDT
GCC 4.2 has a bug with CFSTR and strict-aliasing. I don't really get why it believes there is aliasing there... Anyway, I added a workaround for EWS, just using the old code. I think every other bot use Clang.
Benjamin Poulain
Comment 10
2012-09-04 12:31:34 PDT
Created
attachment 162079
[details]
Patch
Benjamin Poulain
Comment 11
2012-09-04 14:18:57 PDT
Committed
r127505
: <
http://trac.webkit.org/changeset/127505
>
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