Bug 21703 - Devirtualize JSValue::toBoolean()
Summary: Devirtualize JSValue::toBoolean()
Status: RESOLVED DUPLICATE of bug 67727
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Cameron Zwarich (cpst)
URL:
Keywords:
Depends on:
Blocks: 20813
  Show dependency treegraph
 
Reported: 2008-10-16 23:12 PDT by Cameron Zwarich (cpst)
Modified: 2011-09-09 20:18 PDT (History)
2 users (show)

See Also:


Attachments
Patch for JavaScriptCore (19.24 KB, patch)
2008-10-17 02:49 PDT, Cameron Zwarich (cpst)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron Zwarich (cpst) 2008-10-16 23:12:21 PDT
Currently JSValue::toBoolean() is implemented with a virtual call. While this is avoidable in general, due to the ability to override toBoolean() in the JavaScriptGlue API, we should be able to speed up the common case and use a bit in the StructureID TypeInfo for the slow case.
Comment 1 Cameron Zwarich (cpst) 2008-10-17 02:49:22 PDT
Created attachment 24456 [details]
Patch for JavaScriptCore

Maciej sent me his earlier toBoolean() patch, which ignored the fact that JavaScriptGlue exposes the ability to overload toBoolean(). It was a small speedup, but this new patch, which adds a TypeInfo bit to account for that, is a small slowdown. The way to speed it up is probably to inline the fast cases into machine code.
Comment 2 Gavin Barraclough 2011-09-09 20:18:26 PDT
This will now be fixed by 67727.

*** This bug has been marked as a duplicate of bug 67727 ***