Bug 20821

Summary: Cache property transitions to speed up object initialization
Product: WebKit Reporter: Maciej Stachowiak <mjs>
Component: JavaScriptCoreAssignee: Oliver Hunt <oliver>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 20813    
Attachments:
Description Flags
patch mostly by oliver with some bug fixes by me (needs ChangeLog, cleanup)
none
Fully implemented transition cache, now with a bonus feature: correctness zwarich: review+

Description Maciej Stachowiak 2008-09-12 18:07:38 PDT
EarlyBoyer spends 16.6% of its time in cti_op_put_by_id_generic, much of it under StructureID::addPropertyTransition. A lot of this time could be removed by inline caching property transitions - the old structure ID, the new structureID, and the offset to write to (and a call to resize if needed). DeltaBlue is also somewhat affected (3.6% in put_by_id_generic) as is Raytrace, though in the case of RayTrace much of the badness could just be due to Arguments not being very clever.

See bug 20813.
Comment 1 Maciej Stachowiak 2008-09-13 02:03:29 PDT
Created attachment 23389 [details]
patch mostly by oliver with some bug fixes by me (needs ChangeLog, cleanup)
Comment 2 Oliver Hunt 2008-09-13 23:51:11 PDT
Created attachment 23406 [details]
Fully implemented transition cache, now with a bonus feature: correctness
Comment 3 Oliver Hunt 2008-09-14 00:30:59 PDT
Comment on attachment 23406 [details]
Fully implemented transition cache, now with a bonus feature: correctness

Removing review flag, this apparently breaks gmail :-(
Comment 4 Oliver Hunt 2008-09-14 00:46:19 PDT
Comment on attachment 23406 [details]
Fully implemented transition cache, now with a bonus feature: correctness

Cameron lied to me, it works fine!
Comment 5 Cameron Zwarich (cpst) 2008-09-14 01:08:11 PDT
Comment on attachment 23406 [details]
Fully implemented transition cache, now with a bonus feature: correctness

I think "failuresCases" would probably be better as "failureCases".

You have some extra blank lines, like CTI.cpp:1900 and Machine.cpp:2474.

Perhaps sIDC would be better as structureIDChain or chain? What do you think?

Other than that, r=me.
Comment 6 Oliver Hunt 2008-09-14 01:19:15 PDT
	M	JavaScriptCore/ChangeLog
	M	JavaScriptCore/VM/CTI.cpp
	M	JavaScriptCore/VM/CTI.h
	M	JavaScriptCore/VM/CodeBlock.cpp
	M	JavaScriptCore/VM/CodeGenerator.cpp
	M	JavaScriptCore/VM/Machine.cpp
	M	JavaScriptCore/VM/Machine.h
	M	JavaScriptCore/VM/Opcode.h
	M	JavaScriptCore/kjs/JSObject.h
	M	JavaScriptCore/kjs/PutPropertySlot.h
	M	JavaScriptCore/kjs/StructureID.cpp
	M	JavaScriptCore/kjs/StructureID.h
	M	JavaScriptCore/masm/X86Assembler.h
Committed r36401