Diff
Modified: releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/ChangeLog (242427 => 242428)
--- releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/ChangeLog 2019-03-05 08:44:02 UTC (rev 242427)
+++ releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/ChangeLog 2019-03-05 08:44:06 UTC (rev 242428)
@@ -1,3 +1,22 @@
+2019-02-20 Yusuke Suzuki <ysuz...@apple.com>
+
+ [JSC] Remove WatchpointSet creation for SymbolTable entries if VM::canUseJIT() returns false
+ https://bugs.webkit.org/show_bug.cgi?id=194891
+
+ Reviewed by Geoffrey Garen.
+
+ WatchpointSet in SymbolTable is used to fold the value into a constant in JIT tiers. And it is
+ not useful under the non-JIT mode. This patch avoids creation of WatchpointSet in SymbolTable
+ if VM::canUseJIT() returns false.
+
+ * llint/LowLevelInterpreter32_64.asm:
+ * llint/LowLevelInterpreter64.asm:
+ * runtime/SymbolTable.cpp:
+ (JSC::SymbolTableEntry::addWatchpoint): Deleted.
+ * runtime/SymbolTable.h:
+ (JSC::SymbolTableEntry::isWatchable const):
+ (JSC::SymbolTableEntry::watchpointSet):
+
2019-02-20 Mark Lam <mark....@apple.com>
Add code to validate expected GC activity modelled by doesGC() against what the runtime encounters.
Modified: releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm (242427 => 242428)
--- releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm 2019-03-05 08:44:02 UTC (rev 242427)
+++ releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm 2019-03-05 08:44:06 UTC (rev 242428)
@@ -2274,7 +2274,9 @@
get(m_value, t0)
loadConstantOrVariable(size, t0, t1, t2)
loadp OpPutToScope::Metadata::m_watchpointSet[t5], t3
+ btpz t3, .noVariableWatchpointSet
notifyWrite(t3, .pDynamic)
+ .noVariableWatchpointSet:
loadp OpPutToScope::Metadata::m_operand[t5], t0
storei t1, TagOffset[t0]
storei t2, PayloadOffset[t0]
Modified: releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/llint/LowLevelInterpreter64.asm (242427 => 242428)
--- releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/llint/LowLevelInterpreter64.asm 2019-03-05 08:44:02 UTC (rev 242427)
+++ releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/llint/LowLevelInterpreter64.asm 2019-03-05 08:44:06 UTC (rev 242428)
@@ -2310,8 +2310,10 @@
get(m_value, t0)
loadConstantOrVariable(size, t0, t1)
loadp OpPutToScope::Metadata::m_watchpointSet[t5], t2
+ btpz t2, .noVariableWatchpointSet
+ notifyWrite(t2, .pDynamic)
+ .noVariableWatchpointSet:
loadp OpPutToScope::Metadata::m_operand[t5], t0
- notifyWrite(t2, .pDynamic)
storeq t1, [t0]
end
Modified: releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/runtime/SymbolTable.cpp (242427 => 242428)
--- releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/runtime/SymbolTable.cpp 2019-03-05 08:44:02 UTC (rev 242427)
+++ releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/runtime/SymbolTable.cpp 2019-03-05 08:44:06 UTC (rev 242428)
@@ -70,11 +70,6 @@
entry->m_watchpoints = adoptRef(new WatchpointSet(ClearWatchpoint));
}
-void SymbolTableEntry::addWatchpoint(Watchpoint* watchpoint)
-{
- fatEntry()->m_watchpoints->add(watchpoint);
-}
-
SymbolTableEntry::FatEntry* SymbolTableEntry::inflateSlow()
{
FatEntry* entry = new FatEntry(m_bits);
Modified: releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/runtime/SymbolTable.h (242427 => 242428)
--- releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/runtime/SymbolTable.h 2019-03-05 08:44:02 UTC (rev 242427)
+++ releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/runtime/SymbolTable.h 2019-03-05 08:44:06 UTC (rev 242428)
@@ -229,7 +229,7 @@
bool isWatchable() const
{
- return (m_bits & KindBitsMask) == ScopeKindBits;
+ return (m_bits & KindBitsMask) == ScopeKindBits && VM::canUseJIT();
}
// Asserts if the offset is anything but a scope offset. This structures the assertions
@@ -291,8 +291,6 @@
void prepareToWatch();
- void addWatchpoint(Watchpoint*);
-
// This watchpoint set is initialized clear, and goes through the following state transitions:
//
// First write to this var, in any scope that has this symbol table: Clear->IsWatched.
@@ -312,10 +310,12 @@
// initializes that var in just one of them. This means that a compilation could constant-fold to one
// of the scopes that still has an undefined value for this variable. That's fine, because at that
// point any write to any of the instances of that variable would fire the watchpoint.
+ //
+ // Note that watchpointSet() returns nullptr if JIT is disabled.
WatchpointSet* watchpointSet()
{
if (!isFat())
- return 0;
+ return nullptr;
return fatEntry()->m_watchpoints.get();
}