Commit 66ae4dc4 authored by fpizlo@apple.com's avatar fpizlo@apple.com

op_captured_mov and op_new_captured_func in UnlinkedCodeBlocks should use the...

op_captured_mov and op_new_captured_func in UnlinkedCodeBlocks should use the IdentifierMap instead of the strings directly
https://bugs.webkit.org/show_bug.cgi?id=127311
<rdar://problem/15853958>

Reviewed by Andreas Kling.
        
This makes UnlinkedCodeBlocks use 32-bit instruction streams again.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedInstruction::UnlinkedInstruction):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::addVar):
(JSC::BytecodeGenerator::emitInitLazyRegister):
(JSC::BytecodeGenerator::createArgumentsIfNecessary):
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::watchableVariable):
(JSC::BytecodeGenerator::hasWatchableVariable):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162390 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 26a6692f
2014-01-20 Filip Pizlo <fpizlo@apple.com>
op_captured_mov and op_new_captured_func in UnlinkedCodeBlocks should use the IdentifierMap instead of the strings directly
https://bugs.webkit.org/show_bug.cgi?id=127311
<rdar://problem/15853958>
Reviewed by Andreas Kling.
This makes UnlinkedCodeBlocks use 32-bit instruction streams again.
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedInstruction::UnlinkedInstruction):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::addVar):
(JSC::BytecodeGenerator::emitInitLazyRegister):
(JSC::BytecodeGenerator::createArgumentsIfNecessary):
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::watchableVariable):
(JSC::BytecodeGenerator::hasWatchableVariable):
2014-01-20 Mark Lam <mark.lam@apple.com>
Removing CodeBlock::opDebugBytecodeOffsetForLineAndColumn() and friends.
......
......@@ -1815,9 +1815,11 @@ CodeBlock::CodeBlock(ScriptExecutable* ownerExecutable, UnlinkedCodeBlock* unlin
case op_captured_mov:
case op_new_captured_func: {
StringImpl* uid = pc[i + 3].u.uid;
if (!uid)
if (pc[i + 3].u.index == UINT_MAX) {
instructions[i + 3].u.watchpointSet = 0;
break;
}
StringImpl* uid = identifier(pc[i + 3].u.index).impl();
RELEASE_ASSERT(didCloneSymbolTable);
ConcurrentJITLocker locker(m_symbolTable->m_lock);
SymbolTable::Map::iterator iter = m_symbolTable->find(locker, uid);
......
......@@ -228,11 +228,10 @@ struct UnlinkedInstruction {
UnlinkedInstruction() { u.operand = 0; }
UnlinkedInstruction(OpcodeID opcode) { u.opcode = opcode; }
UnlinkedInstruction(int operand) { u.operand = operand; }
UnlinkedInstruction(StringImpl* uid) { u.uid = uid; }
union {
OpcodeID opcode;
int32_t operand;
StringImpl* uid;
unsigned index;
} u;
};
......
......@@ -132,8 +132,8 @@ bool BytecodeGenerator::addVar(
if (watchMode == IsWatchable) {
while (m_watchableVariables.size() < static_cast<size_t>(m_codeBlock->m_numVars))
m_watchableVariables.append(nullptr);
m_watchableVariables.append(ident.impl());
m_watchableVariables.append(Identifier());
m_watchableVariables.append(ident);
}
r0 = addVar();
......@@ -469,7 +469,7 @@ RegisterID* BytecodeGenerator::emitInitLazyRegister(RegisterID* reg)
{
emitOpcode(op_init_lazy_reg);
instructions().append(reg->index());
ASSERT(!watchableVariable(reg->index()));
ASSERT(!hasWatchableVariable(reg->index()));
return reg;
}
......@@ -1628,7 +1628,7 @@ void BytecodeGenerator::createArgumentsIfNecessary()
emitOpcode(op_create_arguments);
instructions().append(m_codeBlock->argumentsRegister().offset());
ASSERT(!watchableVariable(m_codeBlock->argumentsRegister().offset()));
ASSERT(!hasWatchableVariable(m_codeBlock->argumentsRegister().offset()));
}
void BytecodeGenerator::createActivationIfNecessary()
......
......@@ -591,14 +591,22 @@ namespace JSC {
void createActivationIfNecessary();
RegisterID* createLazyRegisterIfNecessary(RegisterID*);
StringImpl* watchableVariable(int operand)
unsigned watchableVariable(int operand)
{
VirtualRegister reg(operand);
if (!reg.isLocal())
return 0;
return UINT_MAX;
if (static_cast<size_t>(reg.toLocal()) >= m_watchableVariables.size())
return 0;
return m_watchableVariables[reg.toLocal()];
return UINT_MAX;
Identifier& ident = m_watchableVariables[reg.toLocal()];
if (ident.isNull())
return UINT_MAX;
return addConstant(ident);
}
bool hasWatchableVariable(int operand)
{
return watchableVariable(operand) != UINT_MAX;
}
Vector<UnlinkedInstruction, 0, UnsafeVectorOverflow> m_instructions;
......@@ -620,7 +628,7 @@ namespace JSC {
RegisterID* m_activationRegister;
RegisterID* m_emptyValueRegister;
RegisterID* m_globalObjectRegister;
Vector<StringImpl*, 16> m_watchableVariables;
Vector<Identifier, 16> m_watchableVariables;
SegmentedVector<RegisterID, 32> m_constantPoolRegisters;
SegmentedVector<RegisterID, 32> m_calleeRegisters;
SegmentedVector<RegisterID, 32> m_parameters;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment