Bug 21703

Summary: Devirtualize JSValue::toBoolean()
Product: WebKit Reporter: Cameron Zwarich (cpst) <zwarich>
Component: JavaScriptCoreAssignee: Cameron Zwarich (cpst) <zwarich>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: barraclough, mjs
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 20813    
Attachments:
Description Flags
Patch for JavaScriptCore none

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 ***