Commit 07174d85 authored by msaboff@apple.com's avatar msaboff@apple.com

Default HashTraits for Opcode don't work for Opcode = 0

https://bugs.webkit.org/show_bug.cgi?id=75595

Reviewed by Oliver Hunt.

Removed the populating of the m_opcodeIDTable table in the
case where the OpcodeID and Opcode are the same (m_enabled is false).
Instead we just cast the one type to the other.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::initialize):
(JSC::Interpreter::isOpcode):
* interpreter/Interpreter.h:
(JSC::Interpreter::getOpcodeID):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104338 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent cca140f1
2012-01-05 Michael Saboff <msaboff@apple.com>
Default HashTraits for Opcode don't work for Opcode = 0
https://bugs.webkit.org/show_bug.cgi?id=75595
Reviewed by Oliver Hunt.
Removed the populating of the m_opcodeIDTable table in the
case where the OpcodeID and Opcode are the same (m_enabled is false).
Instead we just cast the one type to the other.
* interpreter/Interpreter.cpp:
(JSC::Interpreter::initialize):
(JSC::Interpreter::isOpcode):
* interpreter/Interpreter.h:
(JSC::Interpreter::getOpcodeID):
2012-01-06 Sam Weinig <sam@webkit.org>
Add a DecayArray type trait as a first step towards merging OwnPtr and OwnArrayPtr
......@@ -556,7 +556,6 @@ void Interpreter::initialize(bool canUseJIT)
for (int i = 0; i < numOpcodeIDs; ++i) {
Opcode opcode = bitwise_cast<void*>(static_cast<uintptr_t>(i));
m_opcodeTable[i] = opcode;
m_opcodeIDTable.add(opcode, static_cast<OpcodeID>(i));
}
} else {
privateExecute(InitializeAndReturn, 0, 0);
......@@ -669,6 +668,8 @@ void Interpreter::dumpRegisters(CallFrame* callFrame)
bool Interpreter::isOpcode(Opcode opcode)
{
#if ENABLE(COMPUTED_GOTO_INTERPRETER)
if (!m_enabled)
return opcode >= 0 && static_cast<OpcodeID>(bitwise_cast<uintptr_t>(opcode)) <= op_end;
return opcode != HashTraits<Opcode>::emptyValue()
&& !HashTraits<Opcode>::isDeletedValue(opcode)
&& m_opcodeIDTable.contains(opcode);
......
......@@ -114,11 +114,9 @@ namespace JSC {
ASSERT(m_initialized);
#if ENABLE(COMPUTED_GOTO_INTERPRETER)
ASSERT(isOpcode(opcode));
if (!m_enabled) {
OpcodeID result = static_cast<OpcodeID>(bitwise_cast<uintptr_t>(opcode));
ASSERT(result == m_opcodeIDTable.get(opcode));
return result;
}
if (!m_enabled)
return static_cast<OpcodeID>(bitwise_cast<uintptr_t>(opcode));
return m_opcodeIDTable.get(opcode);
#else
return opcode;
......
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