Title: [104338] trunk/Source/_javascript_Core
Revision
104338
Author
[email protected]
Date
2012-01-06 14:15:31 -0800 (Fri, 06 Jan 2012)

Log Message

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):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (104337 => 104338)


--- trunk/Source/_javascript_Core/ChangeLog	2012-01-06 22:14:49 UTC (rev 104337)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-01-06 22:15:31 UTC (rev 104338)
@@ -1,3 +1,20 @@
+2012-01-05  Michael Saboff  <[email protected]>
+
+        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  <[email protected]>
 
         Add a DecayArray type trait as a first step towards merging OwnPtr and OwnArrayPtr

Modified: trunk/Source/_javascript_Core/interpreter/Interpreter.cpp (104337 => 104338)


--- trunk/Source/_javascript_Core/interpreter/Interpreter.cpp	2012-01-06 22:14:49 UTC (rev 104337)
+++ trunk/Source/_javascript_Core/interpreter/Interpreter.cpp	2012-01-06 22:15:31 UTC (rev 104338)
@@ -556,7 +556,6 @@
         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 @@
 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);

Modified: trunk/Source/_javascript_Core/interpreter/Interpreter.h (104337 => 104338)


--- trunk/Source/_javascript_Core/interpreter/Interpreter.h	2012-01-06 22:14:49 UTC (rev 104337)
+++ trunk/Source/_javascript_Core/interpreter/Interpreter.h	2012-01-06 22:15:31 UTC (rev 104338)
@@ -114,11 +114,9 @@
             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;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to