Skip to content

Commit 28b67af

Browse files
7600.3.13
1 parent e20324b commit 28b67af

17 files changed

+367
-46
lines changed

ChangeLog

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,216 @@
1+
2014-12-16 Matthew Hanson <matthew_hanson@apple.com>
2+
3+
Merge r176399. rdar://problem/19267545
4+
5+
2014-11-19 Mark Lam <mark.lam@apple.com>
6+
7+
WTFCrashWithSecurityImplication under SpeculativeJIT::compile() when loading a page from theblaze.com.
8+
<https://webkit.org/b/137642>
9+
10+
Reviewed by Filip Pizlo.
11+
12+
In the DFG, we have a ConstantFolding phase that occurs after all LocalCSE
13+
phases have already transpired. Hence, Identity nodes introduced in the
14+
ConstantFolding phase will be left in the node graph. Subsequently, the
15+
DFG code generator asserts that CSE phases have consumed all Identity nodes.
16+
This turns out to not be true. Hence, the crash. We fix this by teaching
17+
the DFG code generator to emit code for Identity nodes.
18+
19+
Unlike the DFG, the FTL does not have this issue. That is because the FTL
20+
plan has GlobalCSE phases that come after ConstantFolding and any other
21+
phases that can generate Identity nodes. Hence, for the FTL, it is true that
22+
CSE will consume all Identity nodes, and the code generator should not see any
23+
Identity nodes.
24+
25+
* dfg/DFGSpeculativeJIT32_64.cpp:
26+
(JSC::DFG::SpeculativeJIT::compile):
27+
* dfg/DFGSpeculativeJIT64.cpp:
28+
(JSC::DFG::SpeculativeJIT::compile):
29+
30+
2014-12-10 Matthew Hanson <matthew_hanson@apple.com>
31+
32+
Merge r176972. <rdar://problem/19196762>
33+
34+
2014-12-08 Mark Lam <mark.lam@apple.com>
35+
36+
CFA wrongly assumes that a speculation for SlowPutArrayStorageShape disallows ArrayStorageShape arrays.
37+
<https://webkit.org/b/139327>
38+
39+
Reviewed by Michael Saboff.
40+
41+
The code generator and runtime slow paths expects otherwise. This patch fixes
42+
CFA to match the code generator's expectation.
43+
44+
* dfg/DFGArrayMode.h:
45+
(JSC::DFG::ArrayMode::arrayModesThatPassFiltering):
46+
(JSC::DFG::ArrayMode::arrayModesWithIndexingShapes):
47+
48+
49+
2014-12-10 Matthew Hanson <matthew_hanson@apple.com>
50+
51+
Merge r175653. <rdar://problem/19196762>
52+
53+
2014-11-05 Mark Lam <mark.lam@apple.com>
54+
55+
PutById inline caches should have a store barrier when it triggers a structure transition.
56+
<https://webkit.org/b/138441>
57+
58+
Reviewed by Geoffrey Garen.
59+
60+
After r174025, we no longer insert DFG store barriers when the payload of a
61+
PutById operation is not a cell. However, this can lead to a crash when we have
62+
PutById inline cache code transitioning the structure and re-allocating the
63+
butterfly of an old gen object. The lack of a store barrier in that inline
64+
cache results in the old gen object not being noticed during an eden GC scan.
65+
As a result, its newly allocated butterfly will not be kept alive, which leads
66+
to a stale butterfly pointer and, eventually, a crash.
67+
68+
It is also possible that the new structure can be collected by the eden GC if
69+
(at GC time):
70+
1. It is in the eden gen.
71+
2. The inline cache that installed it has been evicted.
72+
3. There are no live eden gen objects referring to it.
73+
74+
The chances of this should be more rare than the butterfly re-allocation, but
75+
it is still possible. Hence, the fix is to always add a store barrier if the
76+
inline caches performs a structure transition.
77+
78+
* jit/Repatch.cpp:
79+
(JSC::emitPutTransitionStub):
80+
- Added store barrier code based on SpeculativeJIT::storeToWriteBarrierBuffer()'s
81+
implementation.
82+
83+
84+
2014-12-10 Matthew Hanson <matthew_hanson@apple.com>
85+
86+
Merge r175593. <rdar://problem/19196762>
87+
88+
2014-11-04 Mark Lam <mark.lam@apple.com>
89+
90+
Rename checkMarkByte() to jumpIfIsRememberedOrInEden().
91+
<https://webkit.org/b/138369>
92+
93+
Reviewed by Geoffrey Garen.
94+
95+
Write barriers are needed for GC Eden collections so that we can scan pointers
96+
pointing from old generation objects to eden generation objects. The barrier
97+
currently checks the mark byte in a cell to see if we should skip adding the
98+
cell to the GC remembered set. The addition should be skipped if:
99+
100+
1. The cell is in the young generation. It has no old to eden pointers by
101+
definition.
102+
2. The cell is already in the remembered set. While it is ok to add the cell
103+
to the GC remembered set more than once, it would be redundant. Hence,
104+
we skip this as an optimization to avoid doing unnecessary work.
105+
106+
The barrier currently names this check as checkMarkByte(). We should rename it
107+
to jumpIfIsRememberedOrInEden() to be clearer about its intent.
108+
109+
Similarly, Jump results of this check are currently named
110+
ownerNotMarkedOrAlreadyRemembered. This can be misinterpreted as the owner is
111+
not marked or not already remembered. We should rename it to
112+
ownerIsRememberedOrInEden which is clearer about the intent of the
113+
check. What we are really checking for is that the cell is in the eden gen,
114+
which is implied by it being "not marked".
115+
116+
* dfg/DFGOSRExitCompilerCommon.cpp:
117+
(JSC::DFG::osrWriteBarrier):
118+
* dfg/DFGSpeculativeJIT.cpp:
119+
(JSC::DFG::SpeculativeJIT::writeBarrier):
120+
* dfg/DFGSpeculativeJIT32_64.cpp:
121+
(JSC::DFG::SpeculativeJIT::writeBarrier):
122+
* dfg/DFGSpeculativeJIT64.cpp:
123+
(JSC::DFG::SpeculativeJIT::writeBarrier):
124+
* jit/AssemblyHelpers.h:
125+
(JSC::AssemblyHelpers::jumpIfIsRememberedOrInEden):
126+
(JSC::AssemblyHelpers::checkMarkByte): Deleted.
127+
* jit/JITPropertyAccess.cpp:
128+
(JSC::JIT::emitWriteBarrier):
129+
* llint/LowLevelInterpreter.asm:
130+
* llint/LowLevelInterpreter32_64.asm:
131+
* llint/LowLevelInterpreter64.asm:
132+
* runtime/JSCell.h:
133+
134+
135+
2014-12-10 Matthew Hanson <matthew_hanson@apple.com>
136+
137+
Merge r175243. <rdar://problem/19196762>
138+
139+
2014-10-27 Mark Lam <mark.lam@apple.com>
140+
141+
Crash when attempting to perform array iteration on a non-array with numeric keys not initialized.
142+
<https://webkit.org/b/137814>
143+
144+
Reviewed by Geoffrey Garen.
145+
146+
The arrayIteratorNextThunkGenerator() thunk was not checking for the case where
147+
the butterfly may be NULL. This was the source of the crash, and is now fixed.
148+
149+
In addition, it is also not checking for the case where a property named "length"
150+
may have been set on the iterated object. The thunk only checks the butterfly's
151+
publicLength for its iteration operation. Array objects will work fine with this
152+
because it always updates its butterfly's publicLength when its length changes.
153+
In the case of iterable non-Array objects, the "length" property will require a
154+
look up outside of the scope of this thunk. The fix is simply to limit the fast
155+
case checks in this thunk to Array objects.
156+
157+
* jit/ThunkGenerators.cpp:
158+
(JSC::arrayIteratorNextThunkGenerator):
159+
160+
161+
2014-12-04 Dana Burkart <dburkart@apple.com>
162+
163+
Merge r176803. <rdar://problem/19034499>
164+
165+
2014-12-04 Oliver Hunt <oliver@apple.com>
166+
167+
Serialization of MapData object provides unsafe access to internal types
168+
https://bugs.webkit.org/show_bug.cgi?id=138653
169+
170+
Reviewed by Geoffrey Garen.
171+
172+
Converting these ASSERTs into RELEASE_ASSERTs, as it is now obvious
173+
that despite trying hard to be safe in all cases it's simply to easy
174+
to use an iterator in an unsafe state.
175+
176+
* runtime/MapData.h:
177+
(JSC::MapData::const_iterator::key):
178+
(JSC::MapData::const_iterator::value):
179+
180+
181+
2014-11-05 Matthew Hanson <matthew_hanson@apple.com>
182+
183+
Merge r175629. <rdar://problem/18883540>
184+
185+
2014-11-05 Alexey Proskuryakov <ap@apple.com>
186+
187+
Incorrect sandbox_check in RemoteInspector.mm
188+
https://bugs.webkit.org/show_bug.cgi?id=138408
189+
190+
Reviewed by Joseph Pecoraro.
191+
192+
* inspector/remote/RemoteInspector.mm:
193+
(Inspector::canAccessWebInspectorMachPort):
194+
195+
196+
2014-10-21 Dana Burkart <dburkart@apple.com>
197+
198+
Merge r173238
199+
200+
2014-09-03 Joseph Pecoraro <pecoraro@apple.com>
201+
202+
Avoid warning if a process does not have access to com.apple.webinspector
203+
https://bugs.webkit.org/show_bug.cgi?id=136473
204+
205+
Reviewed by Alexey Proskuryakov.
206+
207+
Pre-check for access to the mach port to avoid emitting warnings
208+
in syslog for processes that do not have access.
209+
210+
* inspector/remote/RemoteInspector.mm:
211+
(Inspector::canAccessWebInspectorMachPort):
212+
(Inspector::RemoteInspector::shared):
213+
1214
2014-08-21 Matthew Hanson <matthew_hanson@apple.com>
2215

3216
Merge r172707. <rdar://problem/18043281>

Configurations/Version.xcconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2323

2424
MAJOR_VERSION = 600;
25-
MINOR_VERSION = 1;
26-
TINY_VERSION = 17;
25+
MINOR_VERSION = 3;
26+
TINY_VERSION = 13;
2727
MICRO_VERSION = 0;
2828
NANO_VERSION = 0;
2929
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(TINY_VERSION);

dfg/DFGArrayMode.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ class ArrayMode {
406406
case Array::ArrayStorage:
407407
return arrayModesWithIndexingShape(ArrayStorageShape);
408408
case Array::SlowPutArrayStorage:
409-
return arrayModesWithIndexingShape(SlowPutArrayStorageShape);
409+
return arrayModesWithIndexingShapes(SlowPutArrayStorageShape, ArrayStorageShape);
410410
default:
411411
return asArrayModes(NonArray);
412412
}
@@ -462,6 +462,13 @@ class ArrayMode {
462462
}
463463
}
464464

465+
ArrayModes arrayModesWithIndexingShapes(IndexingType shape1, IndexingType shape2) const
466+
{
467+
ArrayModes arrayMode1 = arrayModesWithIndexingShape(shape1);
468+
ArrayModes arrayMode2 = arrayModesWithIndexingShape(shape2);
469+
return arrayMode1 | arrayMode2;
470+
}
471+
465472
bool alreadyChecked(Graph&, Node*, AbstractValue&, IndexingType shape) const;
466473

467474
union {

dfg/DFGOSRExitCompilerCommon.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ void reifyInlinedCallFrames(CCallHelpers& jit, const OSRExitBase& exit)
177177
#if ENABLE(GGC)
178178
static void osrWriteBarrier(CCallHelpers& jit, GPRReg owner, GPRReg scratch)
179179
{
180-
AssemblyHelpers::Jump ownerNotMarkedOrAlreadyRemembered = jit.checkMarkByte(owner);
180+
AssemblyHelpers::Jump ownerIsRememberedOrInEden = jit.jumpIfIsRememberedOrInEden(owner);
181181

182182
// We need these extra slots because setupArgumentsWithExecState will use poke on x86.
183183
#if CPU(X86)
@@ -192,7 +192,7 @@ static void osrWriteBarrier(CCallHelpers& jit, GPRReg owner, GPRReg scratch)
192192
jit.addPtr(MacroAssembler::TrustedImm32(sizeof(void*) * 3), MacroAssembler::stackPointerRegister);
193193
#endif
194194

195-
ownerNotMarkedOrAlreadyRemembered.link(&jit);
195+
ownerIsRememberedOrInEden.link(&jit);
196196
}
197197
#endif // ENABLE(GGC)
198198

dfg/DFGSpeculativeJIT.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5440,16 +5440,16 @@ void SpeculativeJIT::writeBarrier(GPRReg ownerGPR, JSCell* value, GPRReg scratch
54405440
if (Heap::isMarked(value))
54415441
return;
54425442

5443-
JITCompiler::Jump ownerNotMarkedOrAlreadyRemembered = m_jit.checkMarkByte(ownerGPR);
5443+
JITCompiler::Jump ownerIsRememberedOrInEden = m_jit.jumpIfIsRememberedOrInEden(ownerGPR);
54445444
storeToWriteBarrierBuffer(ownerGPR, scratch1, scratch2);
5445-
ownerNotMarkedOrAlreadyRemembered.link(&m_jit);
5445+
ownerIsRememberedOrInEden.link(&m_jit);
54465446
}
54475447

54485448
void SpeculativeJIT::writeBarrier(GPRReg ownerGPR, GPRReg scratch1, GPRReg scratch2)
54495449
{
5450-
JITCompiler::Jump ownerNotMarkedOrAlreadyRemembered = m_jit.checkMarkByte(ownerGPR);
5450+
JITCompiler::Jump ownerIsRememberedOrInEden = m_jit.jumpIfIsRememberedOrInEden(ownerGPR);
54515451
storeToWriteBarrierBuffer(ownerGPR, scratch1, scratch2);
5452-
ownerNotMarkedOrAlreadyRemembered.link(&m_jit);
5452+
ownerIsRememberedOrInEden.link(&m_jit);
54535453
}
54545454
#else
54555455
void SpeculativeJIT::compileStoreBarrier(Node* node)

dfg/DFGSpeculativeJIT32_64.cpp

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,26 @@ void SpeculativeJIT::compile(Node* node)
16881688
break;
16891689

16901690
case Identity: {
1691-
RELEASE_ASSERT_NOT_REACHED();
1691+
speculate(node, node->child1());
1692+
switch (node->child1().useKind()) {
1693+
case DoubleRepUse:
1694+
case DoubleRepRealUse: {
1695+
SpeculateDoubleOperand op(this, node->child1());
1696+
doubleResult(op.fpr(), node);
1697+
break;
1698+
}
1699+
case Int52RepUse:
1700+
case MachineIntUse:
1701+
case DoubleRepMachineIntUse: {
1702+
RELEASE_ASSERT_NOT_REACHED();
1703+
break;
1704+
}
1705+
default: {
1706+
JSValueOperand op(this, node->child1());
1707+
jsValueResult(op.tagGPR(), op.payloadGPR(), node);
1708+
break;
1709+
}
1710+
} // switch
16921711
break;
16931712
}
16941713

@@ -4657,9 +4676,9 @@ void SpeculativeJIT::writeBarrier(GPRReg ownerGPR, GPRReg valueTagGPR, Edge valu
46574676
if (!isKnownCell(valueUse.node()))
46584677
isNotCell = m_jit.branch32(JITCompiler::NotEqual, valueTagGPR, JITCompiler::TrustedImm32(JSValue::CellTag));
46594678

4660-
JITCompiler::Jump ownerNotMarkedOrAlreadyRemembered = m_jit.checkMarkByte(ownerGPR);
4679+
JITCompiler::Jump ownerIsRememberedOrInEden = m_jit.jumpIfIsRememberedOrInEden(ownerGPR);
46614680
storeToWriteBarrierBuffer(ownerGPR, scratch1, scratch2);
4662-
ownerNotMarkedOrAlreadyRemembered.link(&m_jit);
4681+
ownerIsRememberedOrInEden.link(&m_jit);
46634682

46644683
if (!isKnownCell(valueUse.node()))
46654684
isNotCell.link(&m_jit);
@@ -4671,9 +4690,9 @@ void SpeculativeJIT::writeBarrier(JSCell* owner, GPRReg valueTagGPR, Edge valueU
46714690
if (!isKnownCell(valueUse.node()))
46724691
isNotCell = m_jit.branch32(JITCompiler::NotEqual, valueTagGPR, JITCompiler::TrustedImm32(JSValue::CellTag));
46734692

4674-
JITCompiler::Jump ownerNotMarkedOrAlreadyRemembered = m_jit.checkMarkByte(owner);
4693+
JITCompiler::Jump ownerIsRememberedOrInEden = m_jit.jumpIfIsRememberedOrInEden(owner);
46754694
storeToWriteBarrierBuffer(owner, scratch1, scratch2);
4676-
ownerNotMarkedOrAlreadyRemembered.link(&m_jit);
4695+
ownerIsRememberedOrInEden.link(&m_jit);
46774696

46784697
if (!isKnownCell(valueUse.node()))
46794698
isNotCell.link(&m_jit);

dfg/DFGSpeculativeJIT64.cpp

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,6 +1803,26 @@ void SpeculativeJIT::compile(Node* node)
18031803
case Identity: {
18041804
// CSE should always eliminate this.
18051805
RELEASE_ASSERT_NOT_REACHED();
1806+
speculate(node, node->child1());
1807+
switch (node->child1().useKind()) {
1808+
case DoubleRepUse:
1809+
case DoubleRepRealUse:
1810+
case DoubleRepMachineIntUse: {
1811+
SpeculateDoubleOperand op(this, node->child1());
1812+
doubleResult(op.fpr(), node);
1813+
break;
1814+
}
1815+
case Int52RepUse: {
1816+
SpeculateInt52Operand op(this, node->child1());
1817+
int52Result(op.gpr(), node);
1818+
break;
1819+
}
1820+
default: {
1821+
JSValueOperand op(this, node->child1());
1822+
jsValueResult(op.gpr(), node);
1823+
break;
1824+
}
1825+
} // switch
18061826
break;
18071827
}
18081828

@@ -4784,9 +4804,9 @@ void SpeculativeJIT::writeBarrier(GPRReg ownerGPR, GPRReg valueGPR, Edge valueUs
47844804
if (!isKnownCell(valueUse.node()))
47854805
isNotCell = branchNotCell(JSValueRegs(valueGPR));
47864806

4787-
JITCompiler::Jump ownerNotMarkedOrAlreadyRemembered = m_jit.checkMarkByte(ownerGPR);
4807+
JITCompiler::Jump ownerIsRememberedOrInEden = m_jit.jumpIfIsRememberedOrInEden(ownerGPR);
47884808
storeToWriteBarrierBuffer(ownerGPR, scratch1, scratch2);
4789-
ownerNotMarkedOrAlreadyRemembered.link(&m_jit);
4809+
ownerIsRememberedOrInEden.link(&m_jit);
47904810

47914811
if (!isKnownCell(valueUse.node()))
47924812
isNotCell.link(&m_jit);
@@ -4798,9 +4818,9 @@ void SpeculativeJIT::writeBarrier(JSCell* owner, GPRReg valueGPR, Edge valueUse,
47984818
if (!isKnownCell(valueUse.node()))
47994819
isNotCell = branchNotCell(JSValueRegs(valueGPR));
48004820

4801-
JITCompiler::Jump ownerNotMarkedOrAlreadyRemembered = m_jit.checkMarkByte(owner);
4821+
JITCompiler::Jump ownerIsRememberedOrInEden = m_jit.jumpIfIsRememberedOrInEden(owner);
48024822
storeToWriteBarrierBuffer(owner, scratch1, scratch2);
4803-
ownerNotMarkedOrAlreadyRemembered.link(&m_jit);
4823+
ownerIsRememberedOrInEden.link(&m_jit);
48044824

48054825
if (!isKnownCell(valueUse.node()))
48064826
isNotCell.link(&m_jit);

0 commit comments

Comments
 (0)