2008-11-21 Gavin Barraclough <barraclough@apple.com>
Reviewed by Oliver Hunt.
Add (really) polymorphic caching for get by id self.
Very similar to caching of prototype accesses, described below.
Oh, also, probably shouldn't have been leaking those structure list objects.
4% preogression on deltablue.
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dump):
(JSC::CodeBlock::derefStructures):
(JSC::PrototypeStructureList::derefStructures):
* bytecode/Instruction.h:
* bytecode/Opcode.h:
* interpreter/Interpreter.cpp:
(JSC::Interpreter::privateExecute):
(JSC::Interpreter::cti_op_get_by_id_self_fail):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileGetByIdSelfList):
(JSC::JIT::patchGetByIdSelf):
* jit/JIT.h:
(JSC::JIT::compileGetByIdSelfList):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@38688 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/jit/JIT.h b/JavaScriptCore/jit/JIT.h
index 8f3e649..f72d33d 100644
--- a/JavaScriptCore/jit/JIT.h
+++ b/JavaScriptCore/jit/JIT.h
@@ -109,7 +109,7 @@
struct CallLinkInfo;
struct Instruction;
struct OperandTypes;
- struct PrototypeStructureList;
+ struct PolymorphicAccessStructureList;
struct StructureStubInfo;
typedef JSValue* (SFX_CALL *CTIHelper_j)(CTI_ARGS);
@@ -320,7 +320,12 @@
}
#if USE(CTI_REPATCH_PIC)
- static void compileGetByIdProtoList(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PrototypeStructureList* prototypeStructureList, int currentIndex, Structure* structure, Structure* prototypeStructure, size_t cachedOffset)
+ static void compileGetByIdSelfList(JSGlobalData* globalData, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, size_t cachedOffset)
+ {
+ JIT jit(globalData, codeBlock);
+ jit.privateCompileGetByIdSelfList(stubInfo, polymorphicStructures, currentIndex, structure, cachedOffset);
+ }
+ static void compileGetByIdProtoList(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructureList, int currentIndex, Structure* structure, Structure* prototypeStructure, size_t cachedOffset)
{
JIT jit(globalData, codeBlock);
jit.privateCompileGetByIdProtoList(stubInfo, prototypeStructureList, currentIndex, structure, prototypeStructure, cachedOffset, callFrame);
@@ -379,7 +384,8 @@
void privateCompileGetByIdSelf(Structure*, size_t cachedOffset, void* returnAddress);
void privateCompileGetByIdProto(Structure*, Structure* prototypeStructure, size_t cachedOffset, void* returnAddress, CallFrame* callFrame);
#if USE(CTI_REPATCH_PIC)
- void privateCompileGetByIdProtoList(StructureStubInfo*, PrototypeStructureList*, int, Structure*, Structure* prototypeStructure, size_t cachedOffset, CallFrame* callFrame);
+ void privateCompileGetByIdSelfList(StructureStubInfo*, PolymorphicAccessStructureList*, int, Structure*, size_t cachedOffset);
+ void privateCompileGetByIdProtoList(StructureStubInfo*, PolymorphicAccessStructureList*, int, Structure*, Structure* prototypeStructure, size_t cachedOffset, CallFrame* callFrame);
#endif
void privateCompileGetByIdChain(Structure*, StructureChain*, size_t count, size_t cachedOffset, void* returnAddress, CallFrame* callFrame);
void privateCompilePutByIdReplace(Structure*, size_t cachedOffset, void* returnAddress);