Bug 20821 - Cache property transitions to speed up object initialization
Summary: Cache property transitions to speed up object initialization
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Oliver Hunt
URL:
Keywords:
Depends on:
Blocks: 20813
  Show dependency treegraph
 
Reported: 2008-09-12 18:07 PDT by Maciej Stachowiak
Modified: 2008-09-14 01:19 PDT (History)
0 users

See Also:


Attachments
patch mostly by oliver with some bug fixes by me (needs ChangeLog, cleanup) (27.20 KB, patch)
2008-09-13 02:03 PDT, Maciej Stachowiak
no flags Details | Formatted Diff | Diff
Fully implemented transition cache, now with a bonus feature: correctness (31.54 KB, patch)
2008-09-13 23:51 PDT, Oliver Hunt
zwarich: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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