Permalink
Browse files

Rollout r82500

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82519 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information...
oliver@apple.com
oliver@apple.com committed Mar 30, 2011
1 parent c4695b2 commit 9d5d1b0f5904273266f8622c574faf902136b9e2
@@ -1,3 +1,62 @@
+2011-03-30 Oliver Hunt <oliver@apple.com>
+
+ Rollout r82500
+
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::dump):
+ (JSC::CodeBlock::derefStructures):
+ (JSC::CodeBlock::refStructures):
+ (JSC::CodeBlock::markAggregate):
+ * bytecode/Instruction.h:
+ (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
+ (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
+ (JSC::PolymorphicAccessStructureList::derefStructures):
+ (JSC::Instruction::Instruction):
+ * bytecode/StructureStubInfo.cpp:
+ (JSC::StructureStubInfo::deref):
+ * bytecode/StructureStubInfo.h:
+ (JSC::StructureStubInfo::initGetByIdChain):
+ (JSC::StructureStubInfo::initPutByIdTransition):
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::emitJumpIfNotFunctionCall):
+ (JSC::BytecodeGenerator::emitJumpIfNotFunctionApply):
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_jneq_ptr):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emit_op_jneq_ptr):
+ * jit/JITPropertyAccess.cpp:
+ (JSC::JIT::privateCompileGetByIdChainList):
+ * jit/JITPropertyAccess32_64.cpp:
+ (JSC::JIT::privateCompileGetByIdChainList):
+ * jit/JITStubs.cpp:
+ (JSC::getPolymorphicAccessStructureListSlot):
+ (JSC::DEFINE_STUB_FUNCTION):
+ * runtime/JSCell.h:
+ * runtime/JSGlobalData.cpp:
+ (JSC::JSGlobalData::JSGlobalData):
+ * runtime/JSGlobalData.h:
+ * runtime/JSGlobalObject.cpp:
+ (JSC::markIfNeeded):
+ * runtime/JSGlobalObject.h:
+ (JSC::Structure::prototypeChain):
+ * runtime/JSObject.h:
+ (JSC::JSObject::markChildrenDirect):
+ * runtime/JSPropertyNameIterator.cpp:
+ (JSC::JSPropertyNameIterator::create):
+ (JSC::JSPropertyNameIterator::get):
+ (JSC::JSPropertyNameIterator::markChildren):
+ * runtime/JSPropertyNameIterator.h:
+ (JSC::JSPropertyNameIterator::setCachedPrototypeChain):
+ * runtime/MarkStack.h:
+ (JSC::MarkStack::append):
+ * runtime/Structure.h:
+ * runtime/StructureChain.cpp:
+ (JSC::StructureChain::StructureChain):
+ * runtime/StructureChain.h:
+ (JSC::StructureChain::create):
+
2011-03-29 Matthew Delaney <mdelaney@apple.com>
Reviewed by Simon Fraser.
@@ -731,7 +731,7 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
case op_resolve_global_dynamic: {
int r0 = (++it)->u.operand;
int id0 = (++it)->u.operand;
- JSValue scope = JSValue((++it)->u.jsCell.get());
+ JSValue scope = JSValue((++it)->u.jsCell);
++it;
int depth = (++it)->u.operand;
printf("[%4d] resolve_global_dynamic\t %s, %s, %s, %d\n", location, registerName(exec, r0).data(), valueToSourceString(exec, scope).utf8().data(), idName(id0, m_identifiers[id0]).data(), depth);
@@ -1437,11 +1437,13 @@ void CodeBlock::derefStructures(Instruction* vPC) const
}
if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_chain)) {
vPC[4].u.structure->deref();
+ vPC[5].u.structureChain->deref();
return;
}
if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_transition)) {
vPC[4].u.structure->deref();
vPC[5].u.structure->deref();
+ vPC[6].u.structureChain->deref();
return;
}
if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_replace)) {
@@ -1484,11 +1486,13 @@ void CodeBlock::refStructures(Instruction* vPC) const
}
if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_chain)) {
vPC[4].u.structure->ref();
+ vPC[5].u.structureChain->ref();
return;
}
if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_transition)) {
vPC[4].u.structure->ref();
vPC[5].u.structure->ref();
+ vPC[6].u.structureChain->ref();
return;
}
if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_replace)) {
@@ -1523,20 +1527,6 @@ void CodeBlock::markAggregate(MarkStack& markStack)
if (callLinkInfo(i).isLinked())
markStack.append(&callLinkInfo(i).callee);
#endif
-#if ENABLE(INTERPRETER)
- Interpreter* interpreter = m_globalData->interpreter;
- for (size_t size = m_propertyAccessInstructions.size(), i = 0; i < size; ++i) {
- Instruction* vPC = &m_instructions[m_propertyAccessInstructions[i]];
- if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_chain))
- markStack.append(&vPC[5].u.structureChain);
- else if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_transition))
- markStack.append(&vPC[6].u.structureChain);
- }
-#endif
-#if ENABLE(JIT)
- for (size_t size = m_structureStubInfos.size(), i = 0; i < size; ++i)
- m_structureStubInfos[i].markAggregate(markStack);
-#endif
}
HandlerInfo* CodeBlock::handlerForBytecodeOffset(unsigned bytecodeOffset)
@@ -63,7 +63,7 @@ namespace JSC {
Structure* base;
union {
Structure* proto;
- WriteBarrierBase<StructureChain> chain;
+ StructureChain* chain;
} u;
void set(PolymorphicAccessStructureListStubRoutineType _stubRoutine, Structure* _base)
@@ -82,11 +82,11 @@ namespace JSC {
isChain = false;
}
- void set(JSGlobalData& globalData, JSCell* owner, PolymorphicAccessStructureListStubRoutineType _stubRoutine, Structure* _base, StructureChain* _chain)
+ void set(PolymorphicAccessStructureListStubRoutineType _stubRoutine, Structure* _base, StructureChain* _chain)
{
stubRoutine = _stubRoutine;
base = _base;
- u.chain.set(globalData, owner, _chain);
+ u.chain = _chain;
isChain = true;
}
} list[POLYMORPHIC_LIST_CACHE_SIZE];
@@ -101,9 +101,9 @@ namespace JSC {
list[0].set(stubRoutine, firstBase, firstProto);
}
- PolymorphicAccessStructureList(JSGlobalData& globalData, JSCell* owner, PolymorphicAccessStructureListStubRoutineType stubRoutine, Structure* firstBase, StructureChain* firstChain)
+ PolymorphicAccessStructureList(PolymorphicAccessStructureListStubRoutineType stubRoutine, Structure* firstBase, StructureChain* firstChain)
{
- list[0].set(globalData, owner, stubRoutine, firstBase, firstChain);
+ list[0].set(stubRoutine, firstBase, firstChain);
}
void derefStructures(int count)
@@ -115,22 +115,13 @@ namespace JSC {
info.base->deref();
if (info.u.proto) {
- if (!info.isChain)
+ if (info.isChain)
+ info.u.chain->deref();
+ else
info.u.proto->deref();
}
}
}
-
- void markAggregate(MarkStack& markStack, int count)
- {
- for (int i = 0; i < count; ++i) {
- PolymorphicStubInfo& info = list[i];
- ASSERT(info.base);
-
- if (info.u.proto && info.isChain)
- markStack.append(&info.u.chain);
- }
- }
};
struct Instruction {
@@ -139,7 +130,7 @@ namespace JSC {
#if !ENABLE(COMPUTED_GOTO_INTERPRETER)
// We have to initialize one of the pointer members to ensure that
// the entire struct is initialized, when opcode is not a pointer.
- u.jsCell.clear();
+ u.jsCell = 0;
#endif
u.opcode = opcode;
}
@@ -148,30 +139,22 @@ namespace JSC {
{
// We have to initialize one of the pointer members to ensure that
// the entire struct is initialized in 64-bit.
- u.jsCell.clear();
+ u.jsCell = 0;
u.operand = operand;
}
Instruction(Structure* structure) { u.structure = structure; }
- Instruction(JSGlobalData& globalData, JSCell* owner, StructureChain* structureChain)
- {
- u.structureChain.clear();
- u.structureChain.set(globalData, owner, structureChain);
- }
- Instruction(JSGlobalData& globalData, JSCell* owner, JSCell* jsCell)
- {
- u.jsCell.clear();
- u.jsCell.set(globalData, owner, jsCell);
- }
+ Instruction(StructureChain* structureChain) { u.structureChain = structureChain; }
+ Instruction(JSCell* jsCell) { u.jsCell = jsCell; }
Instruction(PolymorphicAccessStructureList* polymorphicStructures) { u.polymorphicStructures = polymorphicStructures; }
Instruction(PropertySlot::GetValueFunc getterFunc) { u.getterFunc = getterFunc; }
union {
Opcode opcode;
int operand;
Structure* structure;
- WriteBarrierBase<StructureChain> structureChain;
- WriteBarrierBase<JSCell> jsCell;
+ StructureChain* structureChain;
+ JSCell* jsCell;
PolymorphicAccessStructureList* polymorphicStructures;
PropertySlot::GetValueFunc getterFunc;
} u;
@@ -44,6 +44,7 @@ void StructureStubInfo::deref()
return;
case access_get_by_id_chain:
u.getByIdChain.baseObjectStructure->deref();
+ u.getByIdChain.chain->deref();
return;
case access_get_by_id_self_list: {
PolymorphicAccessStructureList* polymorphicStructures = u.getByIdSelfList.structureList;
@@ -60,6 +61,7 @@ void StructureStubInfo::deref()
case access_put_by_id_transition:
u.putByIdTransition.previousStructure->deref();
u.putByIdTransition.structure->deref();
+ u.putByIdTransition.chain->deref();
return;
case access_put_by_id_replace:
u.putByIdReplace.baseObjectStructure->deref();
@@ -76,42 +78,6 @@ void StructureStubInfo::deref()
ASSERT_NOT_REACHED();
}
}
-
-void StructureStubInfo::markAggregate(MarkStack& markStack)
-{
- switch (accessType) {
- case access_get_by_id_self:
- return;
- case access_get_by_id_proto:
- return;
- case access_get_by_id_chain:
- return;
- case access_get_by_id_self_list: {
- PolymorphicAccessStructureList* polymorphicStructures = u.getByIdSelfList.structureList;
- polymorphicStructures->markAggregate(markStack, u.getByIdSelfList.listSize);
- return;
- }
- case access_get_by_id_proto_list: {
- PolymorphicAccessStructureList* polymorphicStructures = u.getByIdProtoList.structureList;
- polymorphicStructures->markAggregate(markStack, u.getByIdProtoList.listSize);
- return;
- }
- case access_put_by_id_transition:
- return;
- case access_put_by_id_replace:
- return;
- case access_get_by_id:
- case access_put_by_id:
- case access_get_by_id_generic:
- case access_put_by_id_generic:
- case access_get_array_length:
- case access_get_string_length:
- // These instructions don't ref their Structures.
- return;
- default:
- ASSERT_NOT_REACHED();
- }
-}
#endif
} // namespace JSC
@@ -85,6 +85,7 @@ namespace JSC {
baseObjectStructure->ref();
u.getByIdChain.chain = chain;
+ chain->ref();
}
void initGetByIdSelfList(PolymorphicAccessStructureList* structureList, int listSize)
@@ -116,6 +117,7 @@ namespace JSC {
structure->ref();
u.putByIdTransition.chain = chain;
+ chain->ref();
}
void initPutByIdReplace(Structure* baseObjectStructure)
@@ -127,7 +129,6 @@ namespace JSC {
}
void deref();
- void markAggregate(MarkStack&);
bool seenOnce()
{
@@ -925,7 +925,7 @@ PassRefPtr<Label> BytecodeGenerator::emitJumpIfNotFunctionCall(RegisterID* cond,
emitOpcode(op_jneq_ptr);
instructions().append(cond->index());
- instructions().append(Instruction(*m_globalData, m_codeBlock->ownerExecutable(), m_scopeChain->globalObject->callFunction()));
+ instructions().append(m_scopeChain->globalObject->callFunction());
instructions().append(target->bind(begin, instructions().size()));
return target;
}
@@ -936,7 +936,7 @@ PassRefPtr<Label> BytecodeGenerator::emitJumpIfNotFunctionApply(RegisterID* cond
emitOpcode(op_jneq_ptr);
instructions().append(cond->index());
- instructions().append(Instruction(*m_globalData, m_codeBlock->ownerExecutable(), m_scopeChain->globalObject->applyFunction()));
+ instructions().append(m_scopeChain->globalObject->applyFunction());
instructions().append(target->bind(begin, instructions().size()));
return target;
}
@@ -3537,9 +3537,10 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
to ptr, using pointer equality.
*/
int src = vPC[1].u.operand;
+ JSValue ptr = JSValue(vPC[2].u.jsCell);
int target = vPC[3].u.operand;
JSValue srcValue = callFrame->r(src).jsValue();
- if (srcValue != vPC[2].u.jsCell.get()) {
+ if (srcValue != ptr) {
vPC += target;
NEXT_INSTRUCTION();
}
@@ -762,7 +762,7 @@ void JIT::emit_op_jneq_null(Instruction* currentInstruction)
void JIT::emit_op_jneq_ptr(Instruction* currentInstruction)
{
unsigned src = currentInstruction[1].u.operand;
- JSCell* ptr = currentInstruction[2].u.jsCell.get();
+ JSCell* ptr = currentInstruction[2].u.jsCell;
unsigned target = currentInstruction[3].u.operand;
emitGetVirtualRegister(src, regT0);
@@ -979,7 +979,7 @@ void JIT::emit_op_jneq_null(Instruction* currentInstruction)
void JIT::emit_op_jneq_ptr(Instruction* currentInstruction)
{
unsigned src = currentInstruction[1].u.operand;
- JSCell* ptr = currentInstruction[2].u.jsCell.get();
+ JSCell* ptr = currentInstruction[2].u.jsCell;
unsigned target = currentInstruction[3].u.operand;
emitLoad(src, regT1, regT0);
@@ -979,7 +979,8 @@ void JIT::privateCompileGetByIdChainList(StructureStubInfo* stubInfo, Polymorphi
// Track the stub we have created so that it will be deleted later.
structure->ref();
- prototypeStructures->list[currentIndex].set(callFrame->globalData(), m_codeBlock->ownerExecutable(), entryLabel, structure, chain);
+ chain->ref();
+ prototypeStructures->list[currentIndex].set(entryLabel, structure, chain);
// Finally patch the jump to slow case back in the hot path to jump here instead.
CodeLocationJump jumpLocation = stubInfo->hotPathBegin.jumpAtOffset(patchOffsetGetByIdBranchToSlowCase);
@@ -1007,7 +1007,8 @@ void JIT::privateCompileGetByIdChainList(StructureStubInfo* stubInfo, Polymorphi
// Track the stub we have created so that it will be deleted later.
structure->ref();
- prototypeStructures->list[currentIndex].set(callFrame->globalData(), m_codeBlock->ownerExecutable(), entryLabel, structure, chain);
+ chain->ref();
+ prototypeStructures->list[currentIndex].set(entryLabel, structure, chain);
// Finally patch the jump to slow case back in the hot path to jump here instead.
CodeLocationJump jumpLocation = stubInfo->hotPathBegin.jumpAtOffset(patchOffsetGetByIdBranchToSlowCase);
Oops, something went wrong.

0 comments on commit 9d5d1b0

Please sign in to comment.