Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (90059 => 90060)
--- trunk/Source/_javascript_Core/ChangeLog 2011-06-29 22:56:54 UTC (rev 90059)
+++ trunk/Source/_javascript_Core/ChangeLog 2011-06-29 23:11:59 UTC (rev 90060)
@@ -1,3 +1,32 @@
+2011-06-29 Geoffrey Garen <[email protected]>
+
+ Reviewed by Oliver Hunt.
+
+ Added a dummy write barrier emitting function in all the right places in the old JIT
+ https://bugs.webkit.org/show_bug.cgi?id=63667
+
+ SunSpider reports no change.
+
+ * jit/JIT.h:
+ * jit/JITPropertyAccess.cpp:
+ (JSC::JIT::emit_op_put_by_id):
+ (JSC::JIT::emit_op_put_scoped_var): Do it.
+
+ (JSC::JIT::emit_op_put_global_var): Global object needs to be in a register
+ for the sake of the write barrier.
+
+ (JSC::JIT::emitWriteBarrier): Empty for now. Not for long!
+
+ * jit/JITPropertyAccess32_64.cpp:
+ (JSC::JIT::emit_op_put_by_val):
+ (JSC::JIT::emit_op_put_by_id):
+ (JSC::JIT::emit_op_put_scoped_var): Do it.
+
+ (JSC::JIT::emit_op_put_global_var): Global object needs to be in a register
+ for the sake of the write barrier.
+
+ (JSC::JIT::emitWriteBarrier): Empty for now. Not for long!
+
2011-06-29 Filip Pizlo <[email protected]>
Reviewed by Gavin Barraclough.
Modified: trunk/Source/_javascript_Core/jit/JIT.h (90059 => 90060)
--- trunk/Source/_javascript_Core/jit/JIT.h 2011-06-29 22:56:54 UTC (rev 90059)
+++ trunk/Source/_javascript_Core/jit/JIT.h 2011-06-29 23:11:59 UTC (rev 90060)
@@ -299,6 +299,8 @@
void testPrototype(JSValue, JumpList& failureCases);
+ void emitWriteBarrier(RegisterID owner, RegisterID scratch);
+
#if USE(JSVALUE32_64)
bool getOperandConstantImmediateInt(unsigned op1, unsigned op2, unsigned& op, int32_t& constant);
Modified: trunk/Source/_javascript_Core/jit/JITPropertyAccess.cpp (90059 => 90060)
--- trunk/Source/_javascript_Core/jit/JITPropertyAccess.cpp 2011-06-29 22:56:54 UTC (rev 90059)
+++ trunk/Source/_javascript_Core/jit/JITPropertyAccess.cpp 2011-06-29 23:11:59 UTC (rev 90060)
@@ -432,6 +432,8 @@
// Jump to a slow case if either the base object is an immediate, or if the Structure does not match.
emitJumpSlowCaseIfNotJSCell(regT0, baseVReg);
+ emitWriteBarrier(regT0, regT2);
+
BEGIN_UNINTERRUPTED_SEQUENCE(sequencePutById);
Label hotPathBegin(this);
@@ -972,8 +974,9 @@
{
int skip = currentInstruction[2].u.operand;
+ emitGetVirtualRegister(currentInstruction[3].u.operand, regT0);
+
emitGetFromCallFrameHeaderPtr(RegisterFile::ScopeChain, regT1);
- emitGetVirtualRegister(currentInstruction[3].u.operand, regT0);
bool checkTopLevel = m_codeBlock->codeType() == FunctionCode && m_codeBlock->needsFullScopeChain();
ASSERT(skip || !checkTopLevel);
if (checkTopLevel && skip--) {
@@ -985,8 +988,10 @@
}
while (skip--)
loadPtr(Address(regT1, OBJECT_OFFSETOF(ScopeChainNode, next)), regT1);
+ loadPtr(Address(regT1, OBJECT_OFFSETOF(ScopeChainNode, object)), regT1);
- loadPtr(Address(regT1, OBJECT_OFFSETOF(ScopeChainNode, object)), regT1);
+ emitWriteBarrier(regT1, regT2);
+
loadPtr(Address(regT1, OBJECT_OFFSETOF(JSVariableObject, m_registers)), regT1);
storePtr(regT0, Address(regT1, currentInstruction[1].u.operand * sizeof(Register)));
}
@@ -1001,12 +1006,23 @@
void JIT::emit_op_put_global_var(Instruction* currentInstruction)
{
- emitGetVirtualRegister(currentInstruction[2].u.operand, regT1);
- JSVariableObject* globalObject = m_codeBlock->globalObject();
- loadPtr(&globalObject->m_registers, regT0);
- storePtr(regT1, Address(regT0, currentInstruction[1].u.operand * sizeof(Register)));
+ JSGlobalObject* globalObject = m_codeBlock->globalObject();
+
+ emitGetVirtualRegister(currentInstruction[2].u.operand, regT0);
+ move(TrustedImmPtr(globalObject), regT1);
+
+ emitWriteBarrier(regT1, regT2);
+
+ loadPtr(Address(regT1, OBJECT_OFFSETOF(JSVariableObject, m_registers)), regT1);
+ storePtr(regT0, Address(regT1, currentInstruction[1].u.operand * sizeof(Register)));
}
+void JIT::emitWriteBarrier(RegisterID owner, RegisterID scratch)
+{
+ UNUSED_PARAM(owner);
+ UNUSED_PARAM(scratch);
+}
+
#endif // USE(JSVALUE64)
void JIT::testPrototype(JSValue prototype, JumpList& failureCases)
Modified: trunk/Source/_javascript_Core/jit/JITPropertyAccess32_64.cpp (90059 => 90060)
--- trunk/Source/_javascript_Core/jit/JITPropertyAccess32_64.cpp 2011-06-29 22:56:54 UTC (rev 90059)
+++ trunk/Source/_javascript_Core/jit/JITPropertyAccess32_64.cpp 2011-06-29 23:11:59 UTC (rev 90060)
@@ -259,6 +259,7 @@
addSlowCase(branch32(NotEqual, regT3, TrustedImm32(JSValue::Int32Tag)));
emitJumpSlowCaseIfNotJSCell(base, regT1);
+ emitWriteBarrier(regT0, regT1);
addSlowCase(branchPtr(NotEqual, Address(regT0), TrustedImmPtr(m_globalData->jsArrayVPtr)));
addSlowCase(branch32(AboveOrEqual, regT2, Address(regT0, JSArray::vectorLengthOffset())));
@@ -394,6 +395,8 @@
emitJumpSlowCaseIfNotJSCell(base, regT1);
+ emitWriteBarrier(regT0, regT1);
+
BEGIN_UNINTERRUPTED_SEQUENCE(sequencePutById);
Label hotPathBegin(this);
@@ -1028,10 +1031,11 @@
}
while (skip--)
loadPtr(Address(regT2, OBJECT_OFFSETOF(ScopeChainNode, next)), regT2);
+ loadPtr(Address(regT2, OBJECT_OFFSETOF(ScopeChainNode, object)), regT2);
- loadPtr(Address(regT2, OBJECT_OFFSETOF(ScopeChainNode, object)), regT2);
+ emitWriteBarrier(regT2, regT3);
+
loadPtr(Address(regT2, OBJECT_OFFSETOF(JSVariableObject, m_registers)), regT2);
-
emitStore(index, regT1, regT0, regT2);
map(m_bytecodeOffset + OPCODE_LENGTH(op_put_scoped_var), value, regT1, regT0);
}
@@ -1052,18 +1056,27 @@
void JIT::emit_op_put_global_var(Instruction* currentInstruction)
{
- JSGlobalObject* globalObject = m_codeBlock->globalObject();
- ASSERT(globalObject->isGlobalObject());
int index = currentInstruction[1].u.operand;
int value = currentInstruction[2].u.operand;
+ JSGlobalObject* globalObject = m_codeBlock->globalObject();
+
emitLoad(value, regT1, regT0);
+ move(TrustedImmPtr(globalObject), regT2);
- loadPtr(&globalObject->m_registers, regT2);
+ emitWriteBarrier(regT2, regT3);
+
+ loadPtr(Address(regT2, OBJECT_OFFSETOF(JSVariableObject, m_registers)), regT2);
emitStore(index, regT1, regT0, regT2);
map(m_bytecodeOffset + OPCODE_LENGTH(op_put_global_var), value, regT1, regT0);
}
+void JIT::emitWriteBarrier(RegisterID owner, RegisterID scratch)
+{
+ UNUSED_PARAM(owner);
+ UNUSED_PARAM(scratch);
+}
+
} // namespace JSC
#endif // USE(JSVALUE32_64)