From 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 9 Feb 2012 14:16:12 +0100 Subject: Imported WebKit commit e09a82039aa4273ab318b71122e92d8e5f233525 (http://svn.webkit.org/repository/webkit/trunk@107223) --- Source/JavaScriptCore/jit/JIT.cpp | 4 ++++ Source/JavaScriptCore/jit/JIT.h | 18 ++++++++++++------ Source/JavaScriptCore/jit/JITDriver.h | 8 -------- Source/JavaScriptCore/jit/JITInlineMethods.h | 9 ++++++--- 4 files changed, 22 insertions(+), 17 deletions(-) (limited to 'Source/JavaScriptCore/jit') diff --git a/Source/JavaScriptCore/jit/JIT.cpp b/Source/JavaScriptCore/jit/JIT.cpp index 247495aaf..c8584a316 100644 --- a/Source/JavaScriptCore/jit/JIT.cpp +++ b/Source/JavaScriptCore/jit/JIT.cpp @@ -606,7 +606,11 @@ JITCode JIT::privateCompile(CodePtr* functionEntryArityCheck) load32(payloadFor(RegisterFile::ArgumentCount), regT1); branch32(AboveOrEqual, regT1, TrustedImm32(m_codeBlock->m_numParameters)).linkTo(beginLabel, this); + m_bytecodeOffset = 0; JITStubCall(this, m_codeBlock->m_isConstructor ? cti_op_construct_arityCheck : cti_op_call_arityCheck).call(callFrameRegister); +#if !ASSERT_DISABLED + m_bytecodeOffset = (unsigned)-1; // Reset this, in order to guard its use with ASSERTs. +#endif jump(beginLabel); } diff --git a/Source/JavaScriptCore/jit/JIT.h b/Source/JavaScriptCore/jit/JIT.h index c357e8c39..8dd332893 100644 --- a/Source/JavaScriptCore/jit/JIT.h +++ b/Source/JavaScriptCore/jit/JIT.h @@ -207,34 +207,40 @@ namespace JSC { static void compileGetByIdProto(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, ReturnAddressPtr returnAddress) { JIT jit(globalData, codeBlock); + jit.m_bytecodeOffset = stubInfo->bytecodeIndex; jit.privateCompileGetByIdProto(stubInfo, structure, prototypeStructure, ident, slot, cachedOffset, returnAddress, callFrame); } static void compileGetByIdSelfList(JSGlobalData* globalData, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset) { JIT jit(globalData, codeBlock); + jit.m_bytecodeOffset = stubInfo->bytecodeIndex; jit.privateCompileGetByIdSelfList(stubInfo, polymorphicStructures, currentIndex, structure, ident, slot, cachedOffset); } static void compileGetByIdProtoList(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructureList, int currentIndex, Structure* structure, Structure* prototypeStructure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset) { JIT jit(globalData, codeBlock); + jit.m_bytecodeOffset = stubInfo->bytecodeIndex; jit.privateCompileGetByIdProtoList(stubInfo, prototypeStructureList, currentIndex, structure, prototypeStructure, ident, slot, cachedOffset, callFrame); } static void compileGetByIdChainList(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructureList, int currentIndex, Structure* structure, StructureChain* chain, size_t count, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset) { JIT jit(globalData, codeBlock); + jit.m_bytecodeOffset = stubInfo->bytecodeIndex; jit.privateCompileGetByIdChainList(stubInfo, prototypeStructureList, currentIndex, structure, chain, count, ident, slot, cachedOffset, callFrame); } static void compileGetByIdChain(JSGlobalData* globalData, CallFrame* callFrame, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, ReturnAddressPtr returnAddress) { JIT jit(globalData, codeBlock); + jit.m_bytecodeOffset = stubInfo->bytecodeIndex; jit.privateCompileGetByIdChain(stubInfo, structure, chain, count, ident, slot, cachedOffset, returnAddress, callFrame); } static void compilePutByIdTransition(JSGlobalData* globalData, CodeBlock* codeBlock, StructureStubInfo* stubInfo, Structure* oldStructure, Structure* newStructure, size_t cachedOffset, StructureChain* chain, ReturnAddressPtr returnAddress, bool direct) { JIT jit(globalData, codeBlock); + jit.m_bytecodeOffset = stubInfo->bytecodeIndex; jit.privateCompilePutByIdTransition(stubInfo, oldStructure, newStructure, cachedOffset, chain, returnAddress, direct); } @@ -398,9 +404,9 @@ namespace JSC { static const int patchOffsetGetByIdPropertyMapOffset2 = 22; static const int patchOffsetGetByIdPutResult = 22; #if ENABLE(OPCODE_SAMPLING) - static const int patchOffsetGetByIdSlowCaseCall = 37; + static const int patchOffsetGetByIdSlowCaseCall = 44; #else - static const int patchOffsetGetByIdSlowCaseCall = 33; + static const int patchOffsetGetByIdSlowCaseCall = 40; #endif static const int patchOffsetOpCallCompareToJump = 6; @@ -421,7 +427,7 @@ namespace JSC { #if ENABLE(OPCODE_SAMPLING) #error "OPCODE_SAMPLING is not yet supported" #else - static const int patchOffsetGetByIdSlowCaseCall = 40; + static const int patchOffsetGetByIdSlowCaseCall = 48; #endif static const int patchOffsetOpCallCompareToJump = 12; @@ -458,7 +464,7 @@ namespace JSC { #if ENABLE(OPCODE_SAMPLING) #error "OPCODE_SAMPLING is not yet supported" #else - static const int patchOffsetGetByIdSlowCaseCall = 40; + static const int patchOffsetGetByIdSlowCaseCall = 48; #endif static const int patchOffsetOpCallCompareToJump = 16; @@ -634,9 +640,9 @@ namespace JSC { static const int patchOffsetGetByIdPropertyMapOffset = 28; static const int patchOffsetGetByIdPutResult = 28; #if ENABLE(OPCODE_SAMPLING) - static const int patchOffsetGetByIdSlowCaseCall = 64; + static const int patchOffsetGetByIdSlowCaseCall = 72; #else - static const int patchOffsetGetByIdSlowCaseCall = 54; + static const int patchOffsetGetByIdSlowCaseCall = 62; #endif static const int patchOffsetOpCallCompareToJump = 9; diff --git a/Source/JavaScriptCore/jit/JITDriver.h b/Source/JavaScriptCore/jit/JITDriver.h index 7e010cdfe..4b8df4751 100644 --- a/Source/JavaScriptCore/jit/JITDriver.h +++ b/Source/JavaScriptCore/jit/JITDriver.h @@ -55,10 +55,6 @@ inline bool jitCompileIfAppropriate(JSGlobalData& globalData, OwnPtrhandleBytecodeDiscardingOpportunity(); -#endif codeBlock->setJITCode(jitCode, MacroAssemblerCodePtr()); return true; @@ -83,10 +79,6 @@ inline bool jitCompileFunctionIfAppropriate(JSGlobalData& globalData, OwnPtrhandleBytecodeDiscardingOpportunity(); -#endif codeBlock->setJITCode(jitCode, jitCodeWithArityCheck); diff --git a/Source/JavaScriptCore/jit/JITInlineMethods.h b/Source/JavaScriptCore/jit/JITInlineMethods.h index e617961b5..dfcfbd499 100644 --- a/Source/JavaScriptCore/jit/JITInlineMethods.h +++ b/Source/JavaScriptCore/jit/JITInlineMethods.h @@ -264,6 +264,9 @@ ALWAYS_INLINE void JIT::restoreArgumentReference() ALWAYS_INLINE void JIT::updateTopCallFrame() { + ASSERT(static_cast(m_bytecodeOffset) >= 0); + if (m_bytecodeOffset) + store32(Imm32(m_bytecodeOffset + 1), intTagFor(RegisterFile::ArgumentCount)); storePtr(callFrameRegister, &m_globalData->topCallFrame); } @@ -401,13 +404,13 @@ ALWAYS_INLINE bool JIT::isOperandConstantImmediateChar(unsigned src) template inline void JIT::emitAllocateBasicJSObject(StructureType structure, RegisterID result, RegisterID storagePtr) { - MarkedSpace::SizeClass* sizeClass = &m_globalData->heap.sizeClassForObject(sizeof(ClassType)); - loadPtr(&sizeClass->firstFreeCell, result); + MarkedAllocator* allocator = &m_globalData->heap.allocatorForObject(sizeof(ClassType)); + loadPtr(&allocator->m_firstFreeCell, result); addSlowCase(branchTestPtr(Zero, result)); // remove the object from the free list loadPtr(Address(result), storagePtr); - storePtr(storagePtr, &sizeClass->firstFreeCell); + storePtr(storagePtr, &allocator->m_firstFreeCell); // initialize the object's structure storePtr(structure, Address(result, JSCell::structureOffset())); -- cgit v1.2.1