Ignore:
Timestamp:
Nov 20, 2008, 9:04:19 PM (17 years ago)
Author:
[email protected]
Message:

2008-11-19 Gavin Barraclough <[email protected]>

Reviewed by Darin Adler.

Add support for (really) polymorphic caching of prototype accesses.


If a cached prototype access misses, cti_op_get_by_id_proto_list is called.
When this occurs the Structure pointers from the instruction stream are copied
off into a new ProtoStubInfo object. A second prototype access trampoline is
generated, and chained onto the first. Subsequent missed call to
cti_op_get_by_id_proto_list_append, which append futher new trampolines, up to
PROTOTYPE_LIST_CACHE_SIZE (currently 4). If any of the misses result in an
access other than to a direct prototype property, list formation is halted (or
for the initial miss, does not take place at all).

Separate fail case functions are provided for each access since this contributes
to the performance progression (enables better processor branch prediction).

Overall this is a near 5% progression on v8, with around 10% wins on richards
and deltablue.

  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::derefStructures):
  • bytecode/Instruction.h: (JSC::ProtoStructureList::ProtoStubInfo::set): (JSC::ProtoStructureList::ProtoStructureList): (JSC::Instruction::Instruction): (JSC::Instruction::):
  • bytecode/Opcode.h:
  • interpreter/Interpreter.cpp: (JSC::Interpreter::privateExecute): (JSC::Interpreter::tryCTICacheGetByID): (JSC::Interpreter::cti_op_put_by_id_fail): (JSC::Interpreter::cti_op_get_by_id_self_fail): (JSC::Interpreter::cti_op_get_by_id_proto_list): (JSC::Interpreter::cti_op_get_by_id_proto_list_append): (JSC::Interpreter::cti_op_get_by_id_proto_list_full): (JSC::Interpreter::cti_op_get_by_id_proto_fail): (JSC::Interpreter::cti_op_get_by_id_chain_fail): (JSC::Interpreter::cti_op_get_by_id_array_fail): (JSC::Interpreter::cti_op_get_by_id_string_fail):
  • interpreter/Interpreter.h:
  • jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileGetByIdSelf): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChain): (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompilePatchGetArrayLength):
  • jit/JIT.h: (JSC::JIT::compileGetByIdProtoList):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/interpreter/Interpreter.h

    r38511 r38652  
    188188        static JSValue* SFX_CALL cti_op_get_by_id_second(CTI_ARGS);
    189189        static JSValue* SFX_CALL cti_op_get_by_id_generic(CTI_ARGS);
    190         static JSValue* SFX_CALL cti_op_get_by_id_fail(CTI_ARGS);
     190        static JSValue* SFX_CALL cti_op_get_by_id_self_fail(CTI_ARGS);
     191        static JSValue* SFX_CALL cti_op_get_by_id_proto_list(CTI_ARGS);
     192        static JSValue* SFX_CALL cti_op_get_by_id_proto_list_full(CTI_ARGS);
     193        static JSValue* SFX_CALL cti_op_get_by_id_proto_fail(CTI_ARGS);
     194        static JSValue* SFX_CALL cti_op_get_by_id_chain_fail(CTI_ARGS);
     195        static JSValue* SFX_CALL cti_op_get_by_id_array_fail(CTI_ARGS);
     196        static JSValue* SFX_CALL cti_op_get_by_id_string_fail(CTI_ARGS);
    191197        static JSValue* SFX_CALL cti_op_del_by_id(CTI_ARGS);
    192198        static JSValue* SFX_CALL cti_op_instanceof(CTI_ARGS);
Note: See TracChangeset for help on using the changeset viewer.