WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
almost works
blah.patch (text/plain), 29.03 KB, created by
Filip Pizlo
on 2013-10-13 18:56:22 PDT
(
hide
)
Description:
almost works
Filename:
MIME Type:
Creator:
Filip Pizlo
Created:
2013-10-13 18:56:22 PDT
Size:
29.03 KB
patch
obsolete
>Index: Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >=================================================================== >--- Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (revision 157345) >+++ Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (working copy) >@@ -373,6 +373,8 @@ > 0FC815151405119B00CFA603 /* VTableSpectrum.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC815141405118D00CFA603 /* VTableSpectrum.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0FC81516140511B500CFA603 /* VTableSpectrum.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC815121405118600CFA603 /* VTableSpectrum.cpp */; }; > 0FCCAE4516D0CF7400D0C65B /* ParserError.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCCAE4316D0CF6E00D0C65B /* ParserError.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ 0FCEFAAB1804C13E00472CE4 /* FTLSaveRestore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FCEFAA91804C13E00472CE4 /* FTLSaveRestore.cpp */; }; >+ 0FCEFAAC1804C13E00472CE4 /* FTLSaveRestore.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCEFAAA1804C13E00472CE4 /* FTLSaveRestore.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0FCEFAB01805CA6D00472CE4 /* InitializeLLVM.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCEFAAE1805CA6D00472CE4 /* InitializeLLVM.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0FCEFAB11805CA6D00472CE4 /* InitializeLLVMMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCEFAAF1805CA6D00472CE4 /* InitializeLLVMMac.mm */; }; > 0FCEFAC11805D94E00472CE4 /* LLVMOverrides.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FCEFAC01805D94100472CE4 /* LLVMOverrides.cpp */; }; >@@ -389,8 +391,6 @@ > 0FCEFAD71806174600472CE4 /* LLVMAnchor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FCEFAD61806174600472CE4 /* LLVMAnchor.cpp */; }; > 0FCEFADA180620DA00472CE4 /* LLVMAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCEFAC81805E75500472CE4 /* LLVMAPI.h */; }; > 0FCEFADC18064A1400472CE4 /* config_llvm.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCEFADB18064A1400472CE4 /* config_llvm.h */; }; >- 0FCEFAAB1804C13E00472CE4 /* FTLSaveRestore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FCEFAA91804C13E00472CE4 /* FTLSaveRestore.cpp */; }; >- 0FCEFAAC1804C13E00472CE4 /* FTLSaveRestore.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCEFAAA1804C13E00472CE4 /* FTLSaveRestore.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0FCEFADF180738C000472CE4 /* FTLLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FCEFADD180738C000472CE4 /* FTLLocation.cpp */; }; > 0FCEFAE0180738C000472CE4 /* FTLLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCEFADE180738C000472CE4 /* FTLLocation.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0FD2C92416D01EE900C7803F /* StructureInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD2C92316D01EE900C7803F /* StructureInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -1627,6 +1627,8 @@ > 0FC815141405118D00CFA603 /* VTableSpectrum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VTableSpectrum.h; sourceTree = "<group>"; }; > 0FCB408515C0A3C30048932B /* SlotVisitorInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SlotVisitorInlines.h; sourceTree = "<group>"; }; > 0FCCAE4316D0CF6E00D0C65B /* ParserError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParserError.h; sourceTree = "<group>"; }; >+ 0FCEFAA91804C13E00472CE4 /* FTLSaveRestore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLSaveRestore.cpp; path = ftl/FTLSaveRestore.cpp; sourceTree = "<group>"; }; >+ 0FCEFAAA1804C13E00472CE4 /* FTLSaveRestore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLSaveRestore.h; path = ftl/FTLSaveRestore.h; sourceTree = "<group>"; }; > 0FCEFAAE1805CA6D00472CE4 /* InitializeLLVM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InitializeLLVM.h; path = llvm/InitializeLLVM.h; sourceTree = "<group>"; }; > 0FCEFAAF1805CA6D00472CE4 /* InitializeLLVMMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = InitializeLLVMMac.mm; path = llvm/InitializeLLVMMac.mm; sourceTree = "<group>"; }; > 0FCEFAB61805D61600472CE4 /* libllvmForJSC.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libllvmForJSC.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; >@@ -1642,8 +1644,6 @@ > 0FCEFAD21805EDCC00472CE4 /* LLVMHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLVMHeaders.h; path = llvm/LLVMHeaders.h; sourceTree = "<group>"; }; > 0FCEFAD61806174600472CE4 /* LLVMAnchor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LLVMAnchor.cpp; sourceTree = "<group>"; }; > 0FCEFADB18064A1400472CE4 /* config_llvm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config_llvm.h; sourceTree = "<group>"; }; >- 0FCEFAA91804C13E00472CE4 /* FTLSaveRestore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLSaveRestore.cpp; path = ftl/FTLSaveRestore.cpp; sourceTree = "<group>"; }; >- 0FCEFAAA1804C13E00472CE4 /* FTLSaveRestore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLSaveRestore.h; path = ftl/FTLSaveRestore.h; sourceTree = "<group>"; }; > 0FCEFADD180738C000472CE4 /* FTLLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLLocation.cpp; path = ftl/FTLLocation.cpp; sourceTree = "<group>"; }; > 0FCEFADE180738C000472CE4 /* FTLLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLLocation.h; path = ftl/FTLLocation.h; sourceTree = "<group>"; }; > 0FD2C92316D01EE900C7803F /* StructureInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructureInlines.h; sourceTree = "<group>"; }; >Index: Source/JavaScriptCore/bytecode/CodeBlock.cpp >=================================================================== >--- Source/JavaScriptCore/bytecode/CodeBlock.cpp (revision 157345) >+++ Source/JavaScriptCore/bytecode/CodeBlock.cpp (working copy) >@@ -2382,7 +2382,7 @@ void CodeBlock::resetStubInternal(Repatc > JIT::resetPatchGetById(repatchBuffer, &stubInfo); > else { > RELEASE_ASSERT(isPutByIdAccess(accessType)); >- JIT::resetPatchPutById(repatchBuffer, &stubInfo); >+ resetPutByID(repatchBuffer, stubInfo); > } > break; > case JITCode::DFGJIT: >Index: Source/JavaScriptCore/bytecode/PutByIdStatus.cpp >=================================================================== >--- Source/JavaScriptCore/bytecode/PutByIdStatus.cpp (revision 157345) >+++ Source/JavaScriptCore/bytecode/PutByIdStatus.cpp (working copy) >@@ -141,6 +141,8 @@ PutByIdStatus PutByIdStatus::computeFor( > } > > default: >+ // FIXME: We should handle polymorphic PutById. We probably have some interesting things >+ // we could do about it. > return PutByIdStatus(TakesSlowPath, 0, 0, 0, invalidOffset); > } > #else // ENABLE(JIT) >Index: Source/JavaScriptCore/jit/JIT.cpp >=================================================================== >--- Source/JavaScriptCore/jit/JIT.cpp (revision 157345) >+++ Source/JavaScriptCore/jit/JIT.cpp (working copy) >@@ -489,13 +489,13 @@ ALWAYS_INLINE void PropertyStubCompilati > ASSERT(bytecodeIndex != std::numeric_limits<unsigned>::max()); > info.codeOrigin = CodeOrigin(bytecodeIndex); > info.callReturnLocation = linkBuffer.locationOf(callReturnLocation); >- info.hotPathBegin = linkBuffer.locationOf(hotPathBegin); > > switch (m_type) { > case GetById: { > CodeLocationLabel hotPathBeginLocation = linkBuffer.locationOf(hotPathBegin); >- info.patch.baseline.u.get.structureToCompare = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(getStructureToCompare)); >- info.patch.baseline.u.get.structureCheck = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(getStructureCheck)); >+ info.hotPathBegin = hotPathBeginLocation; >+ info.patch.baseline.u.get.structureToCompare = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(structureToCompare)); >+ info.patch.baseline.u.get.structureCheck = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(structureCheck)); > info.patch.baseline.u.get.propertyStorageLoad = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(propertyStorageLoad)); > #if USE(JSVALUE64) > info.patch.baseline.u.get.displacementLabel = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(getDisplacementLabel)); >@@ -503,20 +503,40 @@ ALWAYS_INLINE void PropertyStubCompilati > info.patch.baseline.u.get.displacementLabel1 = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(getDisplacementLabel1)); > info.patch.baseline.u.get.displacementLabel2 = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(getDisplacementLabel2)); > #endif >- info.patch.baseline.u.get.putResult = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(getPutResult)); >- info.patch.baseline.u.get.coldPathBegin = MacroAssembler::differenceBetweenCodePtr(linkBuffer.locationOf(getColdPathBegin), linkBuffer.locationOf(callReturnLocation)); >+ info.patch.baseline.u.get.putResult = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(done)); >+ info.patch.baseline.u.get.coldPathBegin = MacroAssembler::differenceBetweenCodePtr(linkBuffer.locationOf(coldPathBegin), linkBuffer.locationOf(callReturnLocation)); > break; > } > case PutById: >- CodeLocationLabel hotPathBeginLocation = linkBuffer.locationOf(hotPathBegin); >- info.patch.baseline.u.put.structureToCompare = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(putStructureToCompare)); >- info.patch.baseline.u.put.propertyStorageLoad = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(propertyStorageLoad)); >+ info.patch.dfg.deltaCheckImmToCall = MacroAssembler::differenceBetweenCodePtr(linkBuffer.locationOf(structureToCompare), info.callReturnLocation); >+ info.patch.dfg.deltaCallToStructCheck = MacroAssembler::differenceBetweenCodePtr(info.callReturnLocation, linkBuffer.locationOf(structureCheck)); >+#if USE(JSVALUE64) >+ info.patch.dfg.deltaCallToLoadOrStore = MacroAssembler::differenceBetweenCodePtr(info.callReturnLocation, linkBuffer.locationOf(putDisplacementLabel)); >+#else >+ info.patch.dfg.deltaCallToTagLoadOrStore = MacroAssembler::differenceBetweenCodePtr(info.callReturnLocation, linkBuffer.locationOf(putDisplacementLabel2)); >+ info.patch.dfg.deltaCallToPayloadLoadOrStore = MacroAssembler::differenceBetweenCodePtr(info.callReturnLocation, linkBuffer.locationOf(putDisplacementLabel1)); >+#endif >+ info.patch.dfg.deltaCallToSlowCase = MacroAssembler::differenceBetweenCodePtr(info.callReturnLocation, linkBuffer.locationOf(coldPathBegin)); >+ info.patch.dfg.deltaCallToDone = MacroAssembler::differenceBetweenCodePtr(info.callReturnLocation, linkBuffer.locationOf(done)); >+ info.patch.dfg.deltaCallToStorageLoad = MacroAssembler::differenceBetweenCodePtr(info.callReturnLocation, linkBuffer.locationOf(propertyStorageLoad)); > #if USE(JSVALUE64) >- info.patch.baseline.u.put.displacementLabel = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(putDisplacementLabel)); >+ info.patch.dfg.baseGPR = GPRInfo::regT0; >+ info.patch.dfg.valueGPR = GPRInfo::regT1; >+ RegisterSet usedRegisters; >+ usedRegisters.set(GPRInfo::regT0); >+ usedRegisters.set(GPRInfo::regT1); >+ usedRegisters.copyInfo(info.patch.dfg.usedRegisters); > #else >- info.patch.baseline.u.put.displacementLabel1 = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(putDisplacementLabel1)); >- info.patch.baseline.u.put.displacementLabel2 = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(putDisplacementLabel2)); >+ info.patch.dfg.baseGPR = GPRInfo::regT0; >+ info.patch.dfg.valueGPR = GPRInfo::regT2; >+ info.patch.dfg.valueTagGPR = GPRInfo::regT3; >+ RegisterSet usedRegisters; >+ usedRegisters.set(GPRInfo::regT0); >+ usedRegisters.set(GPRInfo::regT2); >+ usedRegisters.set(GPRInfo::regT3); >+ usedRegisters.copyInfo(info.patch.dfg.usedRegisters); > #endif >+ info.patch.dfg.registersFlushed = true; > break; > } > } >Index: Source/JavaScriptCore/jit/JIT.h >=================================================================== >--- Source/JavaScriptCore/jit/JIT.h (revision 157345) >+++ Source/JavaScriptCore/jit/JIT.h (working copy) >@@ -155,8 +155,8 @@ namespace JSC { > unsigned bytecodeIndex; > MacroAssembler::Call callReturnLocation; > MacroAssembler::Label hotPathBegin; >- MacroAssembler::DataLabelPtr getStructureToCompare; >- MacroAssembler::PatchableJump getStructureCheck; >+ MacroAssembler::DataLabelPtr structureToCompare; >+ MacroAssembler::PatchableJump structureCheck; > MacroAssembler::ConvertibleLoadLabel propertyStorageLoad; > #if USE(JSVALUE64) > MacroAssembler::DataLabelCompact getDisplacementLabel; >@@ -164,9 +164,8 @@ namespace JSC { > MacroAssembler::DataLabelCompact getDisplacementLabel1; > MacroAssembler::DataLabelCompact getDisplacementLabel2; > #endif >- MacroAssembler::Label getPutResult; >- MacroAssembler::Label getColdPathBegin; >- MacroAssembler::DataLabelPtr putStructureToCompare; >+ MacroAssembler::Label done; >+ MacroAssembler::Label coldPathBegin; > #if USE(JSVALUE64) > MacroAssembler::DataLabel32 putDisplacementLabel; > #else >@@ -193,12 +192,12 @@ namespace JSC { > MacroAssembler::DataLabelCompact displacementLabel1, > MacroAssembler::DataLabelCompact displacementLabel2, > #endif >- MacroAssembler::Label putResult) >+ MacroAssembler::Label done) > : m_type(GetById) > , bytecodeIndex(bytecodeIndex) > , hotPathBegin(hotPathBegin) >- , getStructureToCompare(structureToCompare) >- , getStructureCheck(structureCheck) >+ , structureToCompare(structureToCompare) >+ , structureCheck(structureCheck) > , propertyStorageLoad(propertyStorageLoad) > #if USE(JSVALUE64) > , getDisplacementLabel(displacementLabel) >@@ -206,7 +205,7 @@ namespace JSC { > , getDisplacementLabel1(displacementLabel1) > , getDisplacementLabel2(displacementLabel2) > #endif >- , getPutResult(putResult) >+ , done(done) > { > } > >@@ -224,8 +223,8 @@ namespace JSC { > : m_type(PutById) > , bytecodeIndex(bytecodeIndex) > , hotPathBegin(hotPathBegin) >+ , structureToCompare(structureToCompare) > , propertyStorageLoad(propertyStorageLoad) >- , putStructureToCompare(structureToCompare) > #if USE(JSVALUE64) > , putDisplacementLabel(displacementLabel) > #else >@@ -235,16 +234,41 @@ namespace JSC { > { > } > >- void slowCaseInfo(PropertyStubGetById_T, MacroAssembler::Label coldPathBegin, MacroAssembler::Call call) >+ PropertyStubCompilationInfo( >+ PropertyStubPutById_T, unsigned bytecodeIndex, >+ MacroAssembler::DataLabelPtr structureToCompare, >+ MacroAssembler::PatchableJump structureCheck, >+ MacroAssembler::ConvertibleLoadLabel propertyStorageLoad, >+#if USE(JSVALUE64) >+ MacroAssembler::DataLabel32 displacementLabel, >+#else >+ MacroAssembler::DataLabel32 displacementLabel1, >+ MacroAssembler::DataLabel32 displacementLabel2, >+#endif >+ MacroAssembler::Label done) >+ : m_type(PutById) >+ , bytecodeIndex(bytecodeIndex) >+ , structureToCompare(structureToCompare) >+ , structureCheck(structureCheck) >+ , propertyStorageLoad(propertyStorageLoad) >+ , done(done) >+#if USE(JSVALUE64) >+ , putDisplacementLabel(displacementLabel) >+#else >+ , putDisplacementLabel1(displacementLabel1) >+ , putDisplacementLabel2(displacementLabel2) >+#endif >+ { >+ } >+ >+ void slowCaseInfo(MacroAssembler::Label coldPathBegin, MacroAssembler::Call call) > { >- ASSERT(m_type == GetById); > callReturnLocation = call; >- getColdPathBegin = coldPathBegin; >+ this->coldPathBegin = coldPathBegin; > } > >- void slowCaseInfo(PropertyStubPutById_T, MacroAssembler::Call call) >+ void slowCaseInfo(MacroAssembler::Call call) > { >- ASSERT(m_type == PutById); > callReturnLocation = call; > } > >@@ -882,6 +906,11 @@ namespace JSC { > MacroAssembler::Call callOperation(S_JITOperation_EJ, RegisterID); > MacroAssembler::Call callOperation(S_JITOperation_EJJ, RegisterID, RegisterID); > MacroAssembler::Call callOperation(S_JITOperation_EOJss, RegisterID, RegisterID); >+#if USE(JSVALUE64) >+ MacroAssembler::Call callOperation(V_JITOperation_EJCI, RegisterID, RegisterID, StringImpl*); >+#else >+ MacroAssembler::Call callOperation(V_JITOperation_EJCI, RegisterID, RegisterID, RegisterID, StringImpl*); >+#endif > MacroAssembler::Call callOperationWithCallFrameRollbackOnException(J_JITOperation_E); > MacroAssembler::Call callOperationWithCallFrameRollbackOnException(V_JITOperation_ECb, CodeBlock*); > MacroAssembler::Call callOperationWithCallFrameRollbackOnException(Z_JITOperation_E); >Index: Source/JavaScriptCore/jit/JITInlines.h >=================================================================== >--- Source/JavaScriptCore/jit/JITInlines.h (revision 157345) >+++ Source/JavaScriptCore/jit/JITInlines.h (working copy) >@@ -345,6 +345,12 @@ ALWAYS_INLINE MacroAssembler::Call JIT:: > return appendCallWithExceptionCheck(operation); > } > >+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_EJCI operation, RegisterID regOp1Tag, RegisterID regOp1Payload, RegisterID regOp2, StringImpl* uid) >+{ >+ setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG regOp1Payload, regOp1Tag, regOp2, TrustedImmPtr(uid)); >+ return appendCallWithExceptionCheck(operation); >+} >+ > #undef EABI_32BIT_DUMMY_ARG > #undef SH4_32BIT_DUMMY_ARG > >@@ -356,6 +362,12 @@ ALWAYS_INLINE MacroAssembler::Call JIT:: > return appendCallWithExceptionCheckSetJSValueResult(operation, dst); > } > >+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_EJCI operation, RegisterID regOp1, RegisterID regOp2, StringImpl* uid) >+{ >+ setupArgumentsWithExecState(regOp1, regOp2, TrustedImmPtr(uid)); >+ return appendCallWithExceptionCheck(operation); >+} >+ > #endif // USE(JSVALUE32_64) > > ALWAYS_INLINE JIT::Jump JIT::checkStructure(RegisterID reg, Structure* structure) >Index: Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp >=================================================================== >--- Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp (revision 157345) >+++ Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp (working copy) >@@ -532,7 +532,7 @@ void JIT::compileGetByIdSlowCase(int dst > END_UNINTERRUPTED_SEQUENCE_FOR_PUT(sequenceGetByIdSlowCase, dst); > > // Track the location of the call; this will be used to recover patch information. >- m_propertyAccessCompilationInfo[m_propertyAccessInstructionIndex++].slowCaseInfo(PropertyStubGetById, coldPathBegin, call); >+ m_propertyAccessCompilationInfo[m_propertyAccessInstructionIndex++].slowCaseInfo(coldPathBegin, call); > } > > void JIT::emit_op_put_by_id(Instruction* currentInstruction) >@@ -548,42 +548,62 @@ void JIT::emit_op_put_by_id(Instruction* > > emitJumpSlowCaseIfNotJSCell(base, regT1); > >- BEGIN_UNINTERRUPTED_SEQUENCE(sequencePutById); >- >- Label hotPathBegin(this); >- >- // It is important that the following instruction plants a 32bit immediate, in order that it can be patched over. > DataLabelPtr structureToCompare; >- addSlowCase(branchPtrWithPatch(NotEqual, Address(regT0, JSCell::structureOffset()), structureToCompare, TrustedImmPtr(reinterpret_cast<void*>(patchGetByIdDefaultStructure)))); >+ PatchableJump structureCheck = patchableBranchPtrWithPatch( >+ NotEqual,Address(regT0, JSCell::structureOffset()), structureToCompare, >+ TrustedImmPtr(reinterpret_cast<void*>(unusedPointer))); > >- ConvertibleLoadLabel propertyStorageLoad = convertibleLoadPtr(Address(regT0, JSObject::butterflyOffset()), regT1); >- DataLabel32 displacementLabel1 = storePtrWithAddressOffsetPatch(regT2, Address(regT1, patchPutByIdDefaultOffset)); // payload >- DataLabel32 displacementLabel2 = storePtrWithAddressOffsetPatch(regT3, Address(regT1, patchPutByIdDefaultOffset)); // tag >+ addSlowCase(structureCheck); > >- END_UNINTERRUPTED_SEQUENCE(sequencePutById); >- > emitWriteBarrier(regT0, regT2, regT1, regT2, ShouldFilterImmediates, WriteBarrierForPropertyAccess); > >- m_propertyAccessCompilationInfo.append(PropertyStubCompilationInfo(PropertyStubPutById, m_bytecodeOffset, hotPathBegin, structureToCompare, propertyStorageLoad, displacementLabel1, displacementLabel2)); >+ ConvertibleLoadLabel propertyStorageLoad = >+ convertibleLoadPtr(Address(regT0, JSObject::butterflyOffset()), regT1); >+ >+ // Payload. >+ DataLabel32 storeWithPatch1 = >+ store32WithAddressOffsetPatch(regT2, Address(regT1, patchPutByIdDefaultOffset)); >+ // Tag. >+ DataLabel32 storeWithPatch2 = >+ store32WithAddressOffsetPatch(regT3, Address(regT1, patchPutByIdDefaultOffset)); >+ >+ Label done = label(); >+ >+ m_propertyAccessCompilationInfo.append( >+ PropertyStubCompilationInfo( >+ PropertyStubPutById, m_bytecodeOffset, structureToCompare, structureCheck, >+ propertyStorageLoad, storeWithPatch1, storeWithPatch2, done)); >+ BEGIN_UNINTERRUPTED_SEQUENCE(sequencePutById); > } > > void JIT::emitSlow_op_put_by_id(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) > { > int base = currentInstruction[1].u.operand; >- int ident = currentInstruction[2].u.operand; >+ const Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand)); > int direct = currentInstruction[8].u.operand; > > linkSlowCaseIfNotJSCell(iter, base); > linkSlowCase(iter); > >- JITStubCall stubCall(this, direct ? cti_op_put_by_id_direct : cti_op_put_by_id); >- stubCall.addArgument(base); >- stubCall.addArgument(TrustedImmPtr(&(m_codeBlock->identifier(ident)))); >- stubCall.addArgument(regT3, regT2); >- Call call = stubCall.call(); >+ Label coldPathBegin(this); > >+ V_JITOperation_EJCI optimizedCall; >+ if (m_codeBlock->isStrictMode()) { >+ if (direct) >+ optimizedCall = operationPutByIdDirectStrictOptimize; >+ else >+ optimizedCall = operationPutByIdStrictOptimize; >+ } else { >+ if (direct) >+ optimizedCall = operationPutByIdDirectNonStrictOptimize; >+ else >+ optimizedCall = operationPutByIdNonStrictOptimize; >+ } >+ >+ Call call = callOperation(optimizedCall, regT3, regT2, regT0, ident->impl()); >+ > // Track the location of the call; this will be used to recover patch information. >- m_propertyAccessCompilationInfo[m_propertyAccessInstructionIndex++].slowCaseInfo(PropertyStubPutById, call); >+ m_propertyAccessCompilationInfo[m_propertyAccessInstructionIndex++].slowCaseInfo(coldPathBegin, call); > } > > // Compile a store into an object's property storage. May overwrite base. >Index: Source/JavaScriptCore/jit/JITPropertyAccess.cpp >=================================================================== >--- Source/JavaScriptCore/jit/JITPropertyAccess.cpp (revision 157345) >+++ Source/JavaScriptCore/jit/JITPropertyAccess.cpp (working copy) >@@ -551,11 +551,11 @@ void JIT::compileGetByIdHotPath(int base > ConvertibleLoadLabel propertyStorageLoad = convertibleLoadPtr(Address(regT0, JSObject::butterflyOffset()), regT0); > DataLabelCompact displacementLabel = load64WithCompactAddressOffsetPatch(Address(regT0, patchGetByIdDefaultOffset), regT0); > >- Label putResult(this); >+ Label done(this); > > END_UNINTERRUPTED_SEQUENCE(sequenceGetByIdHotPath); > >- m_propertyAccessCompilationInfo.append(PropertyStubCompilationInfo(PropertyStubGetById, m_bytecodeOffset, hotPathBegin, structureToCompare, structureCheck, propertyStorageLoad, displacementLabel, putResult)); >+ m_propertyAccessCompilationInfo.append(PropertyStubCompilationInfo(PropertyStubGetById, m_bytecodeOffset, hotPathBegin, structureToCompare, structureCheck, propertyStorageLoad, displacementLabel, done)); > } > > void JIT::emitSlow_op_get_by_id(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) >@@ -590,7 +590,7 @@ void JIT::compileGetByIdSlowCase(int res > END_UNINTERRUPTED_SEQUENCE(sequenceGetByIdSlowCase); > > // Track the location of the call; this will be used to recover patch information. >- m_propertyAccessCompilationInfo[m_propertyAccessInstructionIndex++].slowCaseInfo(PropertyStubGetById, coldPathBegin, call); >+ m_propertyAccessCompilationInfo[m_propertyAccessInstructionIndex++].slowCaseInfo(coldPathBegin, call); > } > > void JIT::emit_op_put_by_id(Instruction* currentInstruction) >@@ -607,22 +607,27 @@ void JIT::emit_op_put_by_id(Instruction* > // Jump to a slow case if either the base object is an immediate, or if the Structure does not match. > emitJumpSlowCaseIfNotJSCell(regT0, baseVReg); > >- BEGIN_UNINTERRUPTED_SEQUENCE(sequencePutById); >- >- Label hotPathBegin(this); >- >- // It is important that the following instruction plants a 32bit immediate, in order that it can be patched over. > DataLabelPtr structureToCompare; >- addSlowCase(branchPtrWithPatch(NotEqual, Address(regT0, JSCell::structureOffset()), structureToCompare, TrustedImmPtr(reinterpret_cast<void*>(patchGetByIdDefaultStructure)))); >- >- ConvertibleLoadLabel propertyStorageLoad = convertibleLoadPtr(Address(regT0, JSObject::butterflyOffset()), regT2); >- DataLabel32 displacementLabel = store64WithAddressOffsetPatch(regT1, Address(regT2, patchPutByIdDefaultOffset)); >- >- END_UNINTERRUPTED_SEQUENCE(sequencePutById); >- >+ PatchableJump structureCheck = patchableBranchPtrWithPatch( >+ NotEqual,Address(regT0, JSCell::structureOffset()), structureToCompare, >+ TrustedImmPtr(reinterpret_cast<void*>(unusedPointer))); >+ >+ addSlowCase(structureCheck); >+ > emitWriteBarrier(regT0, regT1, regT2, regT3, ShouldFilterImmediates, WriteBarrierForPropertyAccess); > >- m_propertyAccessCompilationInfo.append(PropertyStubCompilationInfo(PropertyStubPutById, m_bytecodeOffset, hotPathBegin, structureToCompare, propertyStorageLoad, displacementLabel)); >+ ConvertibleLoadLabel propertyStorageLoad = >+ convertibleLoadPtr(Address(regT0, JSObject::butterflyOffset()), regT2); >+ >+ DataLabel32 storeWithPatch = >+ store64WithAddressOffsetPatch(regT1, Address(regT2, patchPutByIdDefaultOffset)); >+ >+ Label done = label(); >+ >+ m_propertyAccessCompilationInfo.append( >+ PropertyStubCompilationInfo( >+ PropertyStubPutById, m_bytecodeOffset, structureToCompare, structureCheck, >+ propertyStorageLoad, storeWithPatch, done)); > } > > void JIT::emitSlow_op_put_by_id(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) >@@ -634,15 +639,25 @@ void JIT::emitSlow_op_put_by_id(Instruct > linkSlowCaseIfNotJSCell(iter, baseVReg); > linkSlowCase(iter); > >- JITStubCall stubCall(this, direct ? cti_op_put_by_id_direct : cti_op_put_by_id); >- stubCall.addArgument(regT0); >- stubCall.addArgument(TrustedImmPtr(ident)); >- stubCall.addArgument(regT1); >- move(regT0, nonArgGPR1); >- Call call = stubCall.call(); >+ Label coldPathBegin(this); >+ >+ V_JITOperation_EJCI optimizedCall; >+ if (m_codeBlock->isStrictMode()) { >+ if (direct) >+ optimizedCall = operationPutByIdDirectStrictOptimize; >+ else >+ optimizedCall = operationPutByIdStrictOptimize; >+ } else { >+ if (direct) >+ optimizedCall = operationPutByIdDirectNonStrictOptimize; >+ else >+ optimizedCall = operationPutByIdNonStrictOptimize; >+ } >+ >+ Call call = callOperation(optimizedCall, regT1, regT0, ident->impl()); > > // Track the location of the call; this will be used to recover patch information. >- m_propertyAccessCompilationInfo[m_propertyAccessInstructionIndex++].slowCaseInfo(PropertyStubPutById, call); >+ m_propertyAccessCompilationInfo[m_propertyAccessInstructionIndex++].slowCaseInfo(coldPathBegin, call); > } > > // Compile a store into an object's property storage. May overwrite the
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 122704
:
214068
|
214110
|
214115
|
214120
|
214124
|
214125
|
214291