Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Issue 2715073002: Devirtualize ExceptionState's helper throwing methods.

Created:
3 years, 10 months ago by dcheng
Modified:
3 years, 9 months ago
Reviewers:
jbroman
CC:
chromium-reviews, blink-reviews, blink-reviews-bindings_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Devirtualize ExceptionState's helper throwing methods. All the helper methods end up delegating to setException(), so only setException() needs to be virtual. This reduces binary size by 44KB on a Linux x64 build. A minor disadvantage is throwing with the subclasses is less efficient now: an Exception object is created, only to be discarded when calling setException(). However, throwing an exception shouldn't be on the hot code path, so the trade off should be acceptable. BUG=none

Patch Set 1 #

Total comments: 1

Patch Set 2 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -67 lines) Patch
M third_party/WebKit/Source/bindings/core/v8/ExceptionState.h View 1 4 chunks +18 lines, -25 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ExceptionState.cpp View 1 5 chunks +25 lines, -42 lines 0 comments Download

Messages

Total messages: 10 (5 generated)
dcheng
This one may be more controversial. =) Note that it's possible to get rid of ...
3 years, 10 months ago (2017-02-25 12:00:33 UTC) #2
dcheng
https://codereview.chromium.org/2715073002/diff/1/third_party/WebKit/Source/bindings/core/v8/ExceptionState.cpp File third_party/WebKit/Source/bindings/core/v8/ExceptionState.cpp (right): https://codereview.chromium.org/2715073002/diff/1/third_party/WebKit/Source/bindings/core/v8/ExceptionState.cpp#newcode64 third_party/WebKit/Source/bindings/core/v8/ExceptionState.cpp:64: const String& processedMessage = addExceptionContext(message); The alternative here is ...
3 years, 10 months ago (2017-02-25 12:02:35 UTC) #3
dcheng
Ah... I guess this has to be done with a shouldThrow() virtual, as the subclasses ...
3 years, 9 months ago (2017-02-26 11:48:06 UTC) #8
haraken
On 2017/02/26 11:48:06, dcheng wrote: > Ah... I guess this has to be done with ...
3 years, 9 months ago (2017-02-26 16:14:27 UTC) #9
dcheng
3 years, 9 months ago (2017-02-27 10:53:22 UTC) #10
On 2017/02/26 16:14:27, haraken wrote:
> On 2017/02/26 11:48:06, dcheng wrote:
> > Ah... I guess this has to be done with a shouldThrow() virtual, as the
> > subclasses don't set an isolate. Blah =)
> 
> So, is this ready for review?

Sorry, my original approach doesn't work. I didn't realize it originally, but
DummyExceptionStateForTesting is also problematic: the header says it ignores
all thrown exceptions, but for tests, it's still important to correctly track
whether or not an exception was thrown...
It's likely the tests should just be using a real ExceptionState, but I will
need to investigate and see how difficult that will be.

I'll re-ping when this is ready for review.

Powered by Google App Engine
This is Rietveld 408576698