WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
profiling side is done
blah.patch (text/plain), 20.05 KB, created by
Filip Pizlo
on 2014-02-22 12:28:39 PST
(
hide
)
Description:
profiling side is done
Filename:
MIME Type:
Creator:
Filip Pizlo
Created:
2014-02-22 12:28:39 PST
Size:
20.05 KB
patch
obsolete
>Index: Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >=================================================================== >--- Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (revision 164545) >+++ Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (working copy) >@@ -357,6 +357,8 @@ > 0F9332A314CA7DD70085F3C6 /* PutByIdStatus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F93329914CA7DC10085F3C6 /* PutByIdStatus.cpp */; }; > 0F9332A414CA7DD90085F3C6 /* PutByIdStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F93329A14CA7DC10085F3C6 /* PutByIdStatus.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0F9332A514CA7DDD0085F3C6 /* StructureSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F93329B14CA7DC10085F3C6 /* StructureSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ 0F93B4A918B92C4D00178A3F /* PutByIdVariant.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F93B4A718B92C4D00178A3F /* PutByIdVariant.cpp */; }; >+ 0F93B4AA18B92C4D00178A3F /* PutByIdVariant.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F93B4A818B92C4D00178A3F /* PutByIdVariant.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0F963B3813FC6FE90002D9B2 /* ValueProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F963B3613FC6FDE0002D9B2 /* ValueProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0F96EBB316676EF6008BADE3 /* CodeBlockWithJITType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F96EBB116676EF4008BADE3 /* CodeBlockWithJITType.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0F9749711687ADE400A4FF6A /* JSCellInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F97496F1687ADE200A4FF6A /* JSCellInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -1832,6 +1834,8 @@ > 0F93329914CA7DC10085F3C6 /* PutByIdStatus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PutByIdStatus.cpp; sourceTree = "<group>"; }; > 0F93329A14CA7DC10085F3C6 /* PutByIdStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PutByIdStatus.h; sourceTree = "<group>"; }; > 0F93329B14CA7DC10085F3C6 /* StructureSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructureSet.h; sourceTree = "<group>"; }; >+ 0F93B4A718B92C4D00178A3F /* PutByIdVariant.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PutByIdVariant.cpp; sourceTree = "<group>"; }; >+ 0F93B4A818B92C4D00178A3F /* PutByIdVariant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PutByIdVariant.h; sourceTree = "<group>"; }; > 0F963B3613FC6FDE0002D9B2 /* ValueProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValueProfile.h; sourceTree = "<group>"; }; > 0F96EBB116676EF4008BADE3 /* CodeBlockWithJITType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeBlockWithJITType.h; sourceTree = "<group>"; }; > 0F97496F1687ADE200A4FF6A /* JSCellInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCellInlines.h; sourceTree = "<group>"; }; >@@ -4585,6 +4589,8 @@ > 0FC97F32182020D7002C9B26 /* ProfiledCodeBlockJettisoningWatchpoint.h */, > 0F93329914CA7DC10085F3C6 /* PutByIdStatus.cpp */, > 0F93329A14CA7DC10085F3C6 /* PutByIdStatus.h */, >+ 0F93B4A718B92C4D00178A3F /* PutByIdVariant.cpp */, >+ 0F93B4A818B92C4D00178A3F /* PutByIdVariant.h */, > 0F9FC8C114E1B5FB00D52AE0 /* PutKind.h */, > 0FF60ABF16740F8100029779 /* ReduceWhitespace.cpp */, > 0FF60AC016740F8100029779 /* ReduceWhitespace.h */, >@@ -5383,6 +5389,7 @@ > 0F2FCCFC18A60070001A27F8 /* DFGSafepoint.h in Headers */, > 860161E50F3A83C100F84710 /* MacroAssemblerX86_64.h in Headers */, > 860161E60F3A83C100F84710 /* MacroAssemblerX86Common.h in Headers */, >+ 0F93B4AA18B92C4D00178A3F /* PutByIdVariant.h in Headers */, > A700873A17CBE85300C3E643 /* MapConstructor.h in Headers */, > A78507D717CBC6FD0011F6E7 /* MapData.h in Headers */, > A700873E17CBE8D300C3E643 /* MapPrototype.h in Headers */, >@@ -6176,6 +6183,7 @@ > 0F9FB4F417FCB91700CB67F8 /* DFGStackLayoutPhase.cpp in Sources */, > 0F6B1CBD1861246A00845D97 /* RegisterPreservationWrapperGenerator.cpp in Sources */, > 0FC097A1146B28CA00CF2442 /* DFGThunks.cpp in Sources */, >+ 0F93B4A918B92C4D00178A3F /* PutByIdVariant.cpp in Sources */, > 0FD8A32717D51F5700CA2C40 /* DFGTierUpCheckInjectionPhase.cpp in Sources */, > 0FD8A32917D51F5700CA2C40 /* DFGToFTLDeferredCompilationCallback.cpp in Sources */, > 0F485327187DFDEC0083B687 /* FTLAvailableRecovery.cpp in Sources */, >Index: Source/JavaScriptCore/bytecode/PutByIdStatus.cpp >=================================================================== >--- Source/JavaScriptCore/bytecode/PutByIdStatus.cpp (revision 164545) >+++ Source/JavaScriptCore/bytecode/PutByIdStatus.cpp (working copy) >@@ -123,25 +123,22 @@ PutByIdStatus PutByIdStatus::computeForS > return PutByIdStatus(); > > if (stubInfo->resetByGC) >- return PutByIdStatus(TakesSlowPath, 0, 0, 0, invalidOffset); >+ return PutByIdStatus(TakesSlowPath); > > switch (stubInfo->accessType) { > case access_unset: > // If the JIT saw it but didn't optimize it, then assume that this takes slow path. >- return PutByIdStatus(TakesSlowPath, 0, 0, 0, invalidOffset); >+ return PutByIdStatus(TakesSlowPath); > > case access_put_by_id_replace: { > PropertyOffset offset = > stubInfo->u.putByIdReplace.baseObjectStructure->getConcurrently( > *profiledBlock->vm(), uid); > if (isValidOffset(offset)) { >- return PutByIdStatus( >- SimpleReplace, >- stubInfo->u.putByIdReplace.baseObjectStructure.get(), >- 0, 0, >- offset); >+ return PutByIdVariant::replace( >+ stubInfo->u.putByIdReplace.baseObjectStructure.get(), offset); > } >- return PutByIdStatus(TakesSlowPath, 0, 0, 0, invalidOffset); >+ return PutByIdStatus(TakesSlowPath); > } > > case access_put_by_id_transition_normal: >@@ -151,8 +148,7 @@ PutByIdStatus PutByIdStatus::computeForS > stubInfo->u.putByIdTransition.structure->getConcurrently( > *profiledBlock->vm(), uid); > if (isValidOffset(offset)) { >- return PutByIdStatus( >- SimpleTransition, >+ return PutByIdVariant::transition( > stubInfo->u.putByIdTransition.previousStructure.get(), > stubInfo->u.putByIdTransition.structure.get(), > stubInfo->u.putByIdTransition.chain ? adoptRef(new IntendedStructureChain( >@@ -160,13 +156,51 @@ PutByIdStatus PutByIdStatus::computeForS > stubInfo->u.putByIdTransition.chain.get())) : 0, > offset); > } >- return PutByIdStatus(TakesSlowPath, 0, 0, 0, invalidOffset); >+ return PutByIdStatus(TakesSlowPath); >+ } >+ >+ case access_put_by_id_list: { >+ PolymorphicPutByIdList* list = stubInfo->u.putByIdList.list; >+ >+ PutByIdStatus result; >+ result.m_state = Simple; >+ >+ for (unsigned i = 0; i < list->size(); ++i) { >+ const PutByIdAccess& access = list->at(i); >+ >+ switch (access.type()) { >+ case PutByIdAccess::Replace: { >+ Structure* structure = access.structure(); >+ PropertyOffset offset = structure->getConcurrently(*profiledBlock->vm(), uid); >+ if (!isValidOffset(offset)) >+ return PutByIdStatus(TakesSlowPath); >+ result.m_variants.append(PutByIdVariant::simple(structure, offset)); >+ break; >+ } >+ >+ case PutByIdAccess::Transition: { >+ PropertyOffset offset = >+ access.newStructure()->getConcurrently(*profiledBlock->vm(), uid); >+ if (!isValidOffset(offset)) >+ return PutByIdStatus(TakesSlowPath); >+ result.m_variants.append(PutByIdVariant::transition( >+ access.structure(), access.newStructure(), >+ access.chain() ? adoptRef(new IntendedStructureChain( >+ profiledBlock, access.structure(), access.chain())) : 0, >+ offset)); >+ break; >+ } >+ >+ default: >+ return PutByIdStatus(TakesSlowPath); >+ } >+ } >+ >+ return result; > } > > 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); >+ return PutByIdStatus(TakesSlowPath); > } > } > #endif >@@ -223,7 +257,7 @@ PutByIdStatus PutByIdStatus::computeFor( > // the specialized slot. > return PutByIdStatus(TakesSlowPath); > } >- return PutByIdStatus(SimpleReplace, structure, 0, 0, offset); >+ return PutByIdVariant::replace(structure, offset); > } > > // Our hypothesis is that we're doing a transition. Before we prove that this is really >@@ -276,7 +310,26 @@ PutByIdStatus PutByIdStatus::computeFor( > ASSERT(!transition->transitionDidInvolveSpecificValue()); > ASSERT(isValidOffset(offset)); > >- return PutByIdStatus(SimpleTransition, structure, transition, chain.release(), offset); >+ return PutByIdVariant::transition(structure, transition, chain.release(), offset); >+} >+ >+void PutByIdStatus::dump(PrintStream& out) const >+{ >+ switch (m_state) { >+ case NoInformation: >+ out.print("(NoInformation)"); >+ return; >+ >+ case Simple: >+ out.print("(", listDump(m_variants), ")"); >+ return; >+ >+ case TakesSlowPath: >+ out.print("(TakesSlowPath)"); >+ return; >+ } >+ >+ RELEASE_ASSERT_NOT_REACHED(); > } > > } // namespace JSC >Index: Source/JavaScriptCore/bytecode/PutByIdStatus.h >=================================================================== >--- Source/JavaScriptCore/bytecode/PutByIdStatus.h (revision 164545) >+++ Source/JavaScriptCore/bytecode/PutByIdStatus.h (working copy) >@@ -27,8 +27,7 @@ > #define PutByIdStatus_h > > #include "ExitingJITType.h" >-#include "IntendedStructureChain.h" >-#include "PropertyOffset.h" >+#include "PutByIdVariant.h" > #include "StructureStubInfo.h" > #include <wtf/text/StringImpl.h> > >@@ -45,51 +44,27 @@ public: > enum State { > // It's uncached so we have no information. > NoInformation, >- // It's cached as a direct store into an object property for cases where the object >- // already has the property. >- SimpleReplace, >- // It's cached as a transition from one structure that lacks the property to one that >- // includes the property, and a direct store to this new property. >- SimpleTransition, >+ // It's cached as a simple store of some kind. >+ Simple, > // It's known to often take slow path. > TakesSlowPath > }; > > PutByIdStatus() > : m_state(NoInformation) >- , m_oldStructure(0) >- , m_newStructure(0) >- , m_structureChain(0) >- , m_offset(invalidOffset) > { > } > > explicit PutByIdStatus(State state) > : m_state(state) >- , m_oldStructure(0) >- , m_newStructure(0) >- , m_structureChain(0) >- , m_offset(invalidOffset) > { > ASSERT(m_state == NoInformation || m_state == TakesSlowPath); > } > >- PutByIdStatus( >- State state, >- Structure* oldStructure, >- Structure* newStructure, >- PassRefPtr<IntendedStructureChain> structureChain, >- PropertyOffset offset) >- : m_state(state) >- , m_oldStructure(oldStructure) >- , m_newStructure(newStructure) >- , m_structureChain(structureChain) >- , m_offset(offset) >+ PutByIdStatus(const PutByIdVariant& variant) >+ : m_state(Simple) > { >- ASSERT((m_state == NoInformation || m_state == TakesSlowPath) == !m_oldStructure); >- ASSERT((m_state != SimpleTransition) == !m_newStructure); >- ASSERT(!((m_state != SimpleTransition) && m_structureChain)); >- ASSERT((m_state == NoInformation || m_state == TakesSlowPath) == (m_offset == invalidOffset)); >+ m_variants.append(variant); > } > > static PutByIdStatus computeFor(CodeBlock*, StubInfoMap&, unsigned bytecodeIndex, StringImpl* uid); >@@ -101,14 +76,15 @@ public: > > bool isSet() const { return m_state != NoInformation; } > bool operator!() const { return m_state == NoInformation; } >- bool isSimpleReplace() const { return m_state == SimpleReplace; } >- bool isSimpleTransition() const { return m_state == SimpleTransition; } >+ bool isSimple() const { return m_state == Simple; } > bool takesSlowPath() const { return m_state == TakesSlowPath; } > >- Structure* oldStructure() const { return m_oldStructure; } >- Structure* newStructure() const { return m_newStructure; } >- IntendedStructureChain* structureChain() const { return m_structureChain.get(); } >- PropertyOffset offset() const { return m_offset; } >+ size_t numVariants() const { return m_variants.size(); } >+ const Vector<PutByIdVariant, 1>& variants() const { return m_variants; } >+ const PutByIdVariant& at(size_t index) const { return m_variants[index]; } >+ const PutByIdVariant& operator[](size_t index) const { return at(index); } >+ >+ void dump(PrintStream&) const; > > private: > #if ENABLE(DFG_JIT) >@@ -120,10 +96,7 @@ private: > static PutByIdStatus computeFromLLInt(CodeBlock*, unsigned bytecodeIndex, StringImpl* uid); > > State m_state; >- Structure* m_oldStructure; >- Structure* m_newStructure; >- RefPtr<IntendedStructureChain> m_structureChain; >- PropertyOffset m_offset; >+ Vector<PutByIdVariant, 1> m_variants; > }; > > } // namespace JSC >Index: Source/JavaScriptCore/bytecode/PutByIdVariant.cpp >=================================================================== >--- Source/JavaScriptCore/bytecode/PutByIdVariant.cpp (revision 0) >+++ Source/JavaScriptCore/bytecode/PutByIdVariant.cpp (working copy) >@@ -0,0 +1,59 @@ >+/* >+ * Copyright (C) 2014 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "PutByIdVariant.h" >+ >+namespace JSC { >+ >+void PutByIdVariant::dump(PrintStream& out) const >+{ >+ dumpInContext(out, 0); >+} >+ >+void PutByIdVariant::dumpInContext(PrintStream& out, DumpContext* context) const >+{ >+ switch (kind()) { >+ case NotSet: >+ out.print("<empty>"); >+ return; >+ >+ case Replace: >+ out.print("<Replace: ", inContext(structure(), context), ", ", offset(), ">"); >+ return; >+ >+ case Transition: >+ out.print( >+ "<Transition: ", inContext(oldStructure(), context), " -> ", >+ inContext(newStructure(), context), ", ", >+ pointerDumpInContext(structureChain(), context), ", ", offset(), ">"); >+ return; >+ } >+ >+ RELEASE_ASSERT_NOT_REACHED(); >+} >+ >+} // namespace JSC >+ >Index: Source/JavaScriptCore/bytecode/PutByIdVariant.h >=================================================================== >--- Source/JavaScriptCore/bytecode/PutByIdVariant.h (revision 0) >+++ Source/JavaScriptCore/bytecode/PutByIdVariant.h (working copy) >@@ -0,0 +1,119 @@ >+/* >+ * Copyright (C) 2014 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef PutByIdVariant_h >+#define PutByIdVariant_h >+ >+#include "IntendedStructureChain.h" >+#include "PropertyOffset.h" >+ >+namespace JSC { >+ >+class PutByIdVariant { >+public: >+ enum Kind { >+ NotSet, >+ Replace, >+ Transition >+ }; >+ >+ PutByIdVariant() >+ : m_kind(NotSet) >+ , m_oldStructure(0) >+ , m_newStructure(0) >+ , m_offset(invalid) >+ { >+ } >+ >+ static PutByIdVariant replace(Structure* structure, PropertyOffset offset) >+ { >+ PutByIdVariant result; >+ result.m_oldStructure = structure; >+ result.m_offset = offset; >+ return result; >+ } >+ >+ static PutByIdVariant transition( >+ Structure* oldStructure, Structure* newStructure, >+ PassRefPtr<IntendedStructureChain> structureChain, PropertyOffset offset) >+ { >+ PutByIdVariant result; >+ result.m_oldStructure = oldStructure; >+ result.m_newStructure = newStructure; >+ result.m_structureChain = structureChain; >+ result.m_offset = offset; >+ return result; >+ } >+ >+ Kind kind() const { return m_kind; } >+ >+ bool isSet() const { return kind() != NotSet; } >+ bool operator!() const { return !isSet(); } >+ >+ Structure* structure() const >+ { >+ ASSERT(kind() == Replace); >+ return m_oldStructure; >+ } >+ >+ Structure* oldStructure() const >+ { >+ ASSERT(kind() == Transition); >+ return m_oldStructure; >+ } >+ >+ Structure* newStructure() const >+ { >+ ASSERT(kind() == Transition); >+ return m_newStructure; >+ } >+ >+ IntendedStructureChain* structureChain() const >+ { >+ ASSERT(kind() == Transition); >+ return m_structureChain.get(); >+ } >+ >+ PropertyOffset offset() const >+ { >+ ASSERT(isSet()); >+ return m_offset; >+ } >+ >+ void dump(PrintStream&) const; >+ void dumpInContext(PrintStream&, DumpContext*) const; >+ >+private: >+ Kind m_kind; >+ Structure* m_oldStructure; >+ Structure* m_newStructure; >+ RefPtr<IntendedStructureChain> m_structureChain; >+ PropertyOffset m_offset; >+}; >+ >+} // namespace JSC >+ >+#endif // PutByIdVariant_h >+
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 129210
:
224977
|
224980
|
224990
|
224991
|
225023
|
225025
|
225026
|
225071
|
225073