summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/bytecode/CodeBlock.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-07-16 14:51:15 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-07-16 14:51:15 +0200
commit4e6b3a206fa4ad8bb0b664f7674c9a70376d6e26 (patch)
tree7bb9ad7e31c24d1cf1707e03e6f1a80f6d033951 /Source/JavaScriptCore/bytecode/CodeBlock.cpp
parent3977e3d2f72f7fe2c887c1ec0e0c342e1d169f42 (diff)
downloadqtwebkit-4e6b3a206fa4ad8bb0b664f7674c9a70376d6e26.tar.gz
Imported WebKit commit 953baa67aa07087b6ecd4199351ec554c724e27d (http://svn.webkit.org/repository/webkit/trunk@122676)
Diffstat (limited to 'Source/JavaScriptCore/bytecode/CodeBlock.cpp')
-rw-r--r--Source/JavaScriptCore/bytecode/CodeBlock.cpp62
1 files changed, 39 insertions, 23 deletions
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
index 48d0fe728..d417a5fbd 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
@@ -2026,16 +2026,16 @@ void CodeBlock::visitWeakReferences(SlotVisitor& visitor)
performTracingFixpointIteration(visitor);
}
-void CodeBlock::finalizeUnconditionally()
-{
#if ENABLE(JIT)
#if ENABLE(JIT_VERBOSE_OSR)
- static const bool verboseUnlinking = true;
+static const bool verboseUnlinking = true;
#else
- static const bool verboseUnlinking = false;
+static const bool verboseUnlinking = false;
#endif
#endif // ENABLE(JIT)
+void CodeBlock::finalizeUnconditionally()
+{
#if ENABLE(LLINT)
Interpreter* interpreter = m_globalData->interpreter;
// interpreter->classicEnabled() returns true if the old C++ interpreter is enabled. If that's enabled
@@ -2141,28 +2141,10 @@ void CodeBlock::finalizeUnconditionally()
for (size_t size = m_structureStubInfos.size(), i = 0; i < size; ++i) {
StructureStubInfo& stubInfo = m_structureStubInfos[i];
- AccessType accessType = static_cast<AccessType>(stubInfo.accessType);
-
if (stubInfo.visitWeakReferences())
continue;
- if (verboseUnlinking)
- dataLog("Clearing structure cache (kind %d) in %p.\n", stubInfo.accessType, this);
-
- if (isGetByIdAccess(accessType)) {
- if (getJITCode().jitType() == JITCode::DFGJIT)
- DFG::dfgResetGetByID(repatchBuffer, stubInfo);
- else
- JIT::resetPatchGetById(repatchBuffer, &stubInfo);
- } else {
- ASSERT(isPutByIdAccess(accessType));
- if (getJITCode().jitType() == JITCode::DFGJIT)
- DFG::dfgResetPutByID(repatchBuffer, stubInfo);
- else
- JIT::resetPatchPutById(repatchBuffer, &stubInfo);
- }
-
- stubInfo.reset();
+ resetStubInternal(repatchBuffer, stubInfo);
}
for (size_t size = m_methodCallLinkInfos.size(), i = 0; i < size; ++i) {
@@ -2198,6 +2180,40 @@ void CodeBlock::finalizeUnconditionally()
#endif
}
+#if ENABLE(JIT)
+void CodeBlock::resetStub(StructureStubInfo& stubInfo)
+{
+ if (stubInfo.accessType == access_unset)
+ return;
+
+ RepatchBuffer repatchBuffer(this);
+ resetStubInternal(repatchBuffer, stubInfo);
+}
+
+void CodeBlock::resetStubInternal(RepatchBuffer& repatchBuffer, StructureStubInfo& stubInfo)
+{
+ AccessType accessType = static_cast<AccessType>(stubInfo.accessType);
+
+ if (verboseUnlinking)
+ dataLog("Clearing structure cache (kind %d) in %p.\n", stubInfo.accessType, this);
+
+ if (isGetByIdAccess(accessType)) {
+ if (getJITCode().jitType() == JITCode::DFGJIT)
+ DFG::dfgResetGetByID(repatchBuffer, stubInfo);
+ else
+ JIT::resetPatchGetById(repatchBuffer, &stubInfo);
+ } else {
+ ASSERT(isPutByIdAccess(accessType));
+ if (getJITCode().jitType() == JITCode::DFGJIT)
+ DFG::dfgResetPutByID(repatchBuffer, stubInfo);
+ else
+ JIT::resetPatchPutById(repatchBuffer, &stubInfo);
+ }
+
+ stubInfo.reset();
+}
+#endif
+
void CodeBlock::stronglyVisitStrongReferences(SlotVisitor& visitor)
{
visitor.append(&m_globalObject);