opcodes.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifdef OPCODE
  2. OPCODE(NO_OP)
  3. OPCODE(LOAD_CONST)
  4. OPCODE(IMPORT_NAME)
  5. OPCODE(PRINT_EXPR)
  6. OPCODE(POP_TOP)
  7. OPCODE(CALL)
  8. OPCODE(RETURN_VALUE)
  9. OPCODE(BINARY_OP)
  10. OPCODE(COMPARE_OP)
  11. OPCODE(IS_OP)
  12. OPCODE(CONTAINS_OP)
  13. OPCODE(UNARY_NEGATIVE)
  14. OPCODE(UNARY_NOT)
  15. OPCODE(DUP_TOP)
  16. OPCODE(BUILD_LIST)
  17. OPCODE(BUILD_MAP)
  18. OPCODE(BUILD_SLICE)
  19. OPCODE(LIST_APPEND)
  20. OPCODE(GET_ITER)
  21. OPCODE(FOR_ITER)
  22. OPCODE(POP_JUMP_IF_FALSE)
  23. OPCODE(JUMP_ABSOLUTE)
  24. OPCODE(JUMP_IF_TRUE_OR_POP)
  25. OPCODE(JUMP_IF_FALSE_OR_POP)
  26. // non-standard python opcodes
  27. OPCODE(LOAD_NONE)
  28. OPCODE(LOAD_TRUE)
  29. OPCODE(LOAD_FALSE)
  30. OPCODE(LOAD_EVAL_FN) // load eval() callable into stack
  31. OPCODE(LOAD_LAMBDA) // LOAD_CONST + set __module__ attr
  32. OPCODE(ASSERT)
  33. OPCODE(RAISE_ERROR)
  34. OPCODE(STORE_FUNCTION)
  35. OPCODE(BUILD_CLASS)
  36. OPCODE(LOAD_NAME_PTR) // no arg
  37. OPCODE(BUILD_ATTR_PTR) // arg for the name_ptr, [ptr, name_ptr] -> (*ptr).name_ptr
  38. OPCODE(BUILD_INDEX_PTR) // no arg, [ptr, expr] -> (*ptr)[expr]
  39. OPCODE(STORE_NAME_PTR) // arg for the name_ptr, [expr], directly store to the name_ptr without pushing it to the stack
  40. OPCODE(STORE_PTR) // no arg, [ptr, expr] -> *ptr = expr
  41. OPCODE(DELETE_PTR) // no arg, [ptr] -> [] -> delete ptr
  42. OPCODE(BUILD_SMART_TUPLE) // if all elements are pointers, build a compound pointer, otherwise build a tuple
  43. OPCODE(BUILD_STRING) // arg is the expr count, build a string from the top of the stack
  44. #endif