1. Mark Shannon
  2. hotpy_2

Commits

Mark Shannon  committed 832ff84 Draft

Optimise EXIT_IF_VALUE_IN_OBJECT_DICT for types with no __dict__

  • Participants
  • Parent commits 087c67d
  • Branches default

Comments (0)

Files changed (1)

File Python/trace_specialiser.c

View file
         break;
     }
     case EXIT_IF_VALUE_IN_OBJECT_DICT:
+    {
+        PyObject *type;
         /* XXX - Check keys */
+        info = POP();
         DROP();
-        DROP();
+        type = type_of(info);
+        if (type != Py_None && Py_TYPE(type)->tp_dictoffset == 0) {
+            x->next->opcode(x->next, POP_TOP);
+            x->next->opcode(x->next, POP_TOP);
+            return NULL;
+        }
         break;
     }
     case EXIT: