[webkit-reviews] review granted: [Bug 22480] We should cache get by id chain accesses polymorphically. : [Attachment 25475] The patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 25 13:23:34 PST 2008


Geoffrey Garen <ggaren at apple.com> has granted Gavin Barraclough
<barraclough at apple.com>'s request for review:
Bug 22480: We should cache get by id chain accesses polymorphically.
https://bugs.webkit.org/show_bug.cgi?id=22480

Attachment 25475: The patch
https://bugs.webkit.org/attachment.cgi?id=25475&action=review

------- Additional Comments from Geoffrey Garen <ggaren at apple.com>
> +    } else if (vPC[0].u.opcode ==
interpreter->getOpcode(op_get_by_id_chain)) {
> +	   prototypeStructureList = new
PolymorphicAccessStructureList(vPC[6].u.operand, stubInfo->stubRoutine,
vPC[4].u.structure, vPC[5].u.structureChain);
> +	   stubInfo->stubRoutine = 0;
> +
> +	   vPC[0] = interpreter->getOpcode(op_get_by_id_proto_list);
> +	   vPC[4] = prototypeStructureList;
> +	   vPC[5] = 2;
> +    } else {

Should ASSERT here which opcode is in vPC[0].

> -	       vPC[0] =
ARG_globalData->interpreter->getOpcode(op_get_by_id_proto_list);
> -	       vPC[4] = prototypeStructureList;
> -	       vPC[5] = 2;
> -	   } else {
> -	       prototypeStructureList = vPC[4].u.polymorphicStructures;
> -	       listIndex = vPC[5].u.operand;
> +	       StructureChain* chain = structure->cachedPrototypeChain();
> +	       if (!chain)
> +		   chain = cachePrototypeChain(callFrame, structure);
> +	       ASSERT(chain);
>  
> -	       vPC[5] = listIndex + 1;
> -	   }
> +	   StructureStubInfo* stubInfo =
&codeBlock->getStubInfo(CTI_RETURN_ADDRESS);
> +	   int listIndex;
> +	   PolymorphicAccessStructureList* prototypeStructureList =
getPolymorphicAccessStructureListSlot(ARG_globalData->interpreter, stubInfo,
vPC, listIndex);

Incorrect indentation here? Is "chain" ever used? Why do we compute it?

I hope we can refactor some of this code soon to make the memory management
automatic.

It would be nice to eventually add a feature for re-caching by starting over
from scratch in the case where the prototype has changed.

r=me


More information about the webkit-reviews mailing list