frozen_mpy.c 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. #include "py/mpconfig.h"
  2. #include "py/objint.h"
  3. #include "py/objstr.h"
  4. #include "py/emitglue.h"
  5. #include "py/nativeglue.h"
  6. #if MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE != 0
  7. #error "incompatible MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE"
  8. #endif
  9. #if MICROPY_LONGINT_IMPL != 2
  10. #error "incompatible MICROPY_LONGINT_IMPL"
  11. #endif
  12. #if MICROPY_PY_BUILTINS_FLOAT
  13. typedef struct _mp_obj_float_t {
  14. mp_obj_base_t base;
  15. mp_float_t value;
  16. } mp_obj_float_t;
  17. #endif
  18. #if MICROPY_PY_BUILTINS_COMPLEX
  19. typedef struct _mp_obj_complex_t {
  20. mp_obj_base_t base;
  21. mp_float_t real;
  22. mp_float_t imag;
  23. } mp_obj_complex_t;
  24. #endif
  25. enum {
  26. MP_QSTR_frozentest_dot_py = MP_QSTRnumber_of,
  27. MP_QSTR_uPy,
  28. //MP_QSTR_i,
  29. };
  30. extern const qstr_pool_t mp_qstr_const_pool;
  31. const qstr_pool_t mp_qstr_frozen_const_pool = {
  32. (qstr_pool_t*)&mp_qstr_const_pool, // previous pool
  33. MP_QSTRnumber_of, // previous pool size
  34. 3, // allocated entries
  35. 3, // used entries
  36. {
  37. (const byte*)"\xfe\x0d" "frozentest.py",
  38. (const byte*)"\xf9\x03" "uPy",
  39. (const byte*)"\xcc\x01" "i",
  40. },
  41. };
  42. // frozen bytecode for file frozentest.py, scope frozentest_<module>
  43. STATIC const byte fun_data_frozentest__lt_module_gt_[85] = {
  44. 0x10, 0x16,
  45. MP_QSTR__lt_module_gt_ & 0xff, MP_QSTR__lt_module_gt_ >> 8,
  46. MP_QSTR_frozentest_dot_py & 0xff, MP_QSTR_frozentest_dot_py >> 8,
  47. 0x29, 0x28, 0x28, 0x28, 0x2b, 0x28, 0x00,
  48. 0x11, MP_QSTR_print & 0xff, MP_QSTR_print >> 8,
  49. 0x10, MP_QSTR_uPy & 0xff, MP_QSTR_uPy >> 8,
  50. 0x34, 0x01,
  51. 0x59,
  52. 0x11, MP_QSTR_print & 0xff, MP_QSTR_print >> 8,
  53. 0x23, 0x00,
  54. 0x34, 0x01,
  55. 0x59,
  56. 0x11, MP_QSTR_print & 0xff, MP_QSTR_print >> 8,
  57. 0x23, 0x01,
  58. 0x34, 0x01,
  59. 0x59,
  60. 0x11, MP_QSTR_print & 0xff, MP_QSTR_print >> 8,
  61. 0x23, 0x02,
  62. 0x34, 0x01,
  63. 0x59,
  64. 0x11, MP_QSTR_print & 0xff, MP_QSTR_print >> 8,
  65. 0x22, 0xba, 0xef, 0x9a, 0x15,
  66. 0x34, 0x01,
  67. 0x59,
  68. 0x80,
  69. 0x42, 0x0f, 0x80,
  70. 0x57,
  71. 0x16, MP_QSTR_i & 0xff, MP_QSTR_i >> 8,
  72. 0x11, MP_QSTR_print & 0xff, MP_QSTR_print >> 8,
  73. 0x11, MP_QSTR_i & 0xff, MP_QSTR_i >> 8,
  74. 0x34, 0x01,
  75. 0x59,
  76. 0x81,
  77. 0xe5,
  78. 0x57,
  79. 0x84,
  80. 0xd7,
  81. 0x43, 0xeb, 0x7f,
  82. 0x59,
  83. 0x51,
  84. 0x63,
  85. };
  86. STATIC const mp_obj_str_t const_obj_frozentest__lt_module_gt__0 = {{&mp_type_str}, 246, 34, (const byte*)"\x61\x20\x6c\x6f\x6e\x67\x20\x73\x74\x72\x69\x6e\x67\x20\x74\x68\x61\x74\x20\x69\x73\x20\x6e\x6f\x74\x20\x69\x6e\x74\x65\x72\x6e\x65\x64"};
  87. STATIC const mp_obj_str_t const_obj_frozentest__lt_module_gt__1 = {{&mp_type_str}, 200, 38, (const byte*)"\x61\x20\x73\x74\x72\x69\x6e\x67\x20\x74\x68\x61\x74\x20\x68\x61\x73\x20\x75\x6e\x69\x63\x6f\x64\x65\x20\xce\xb1\xce\xb2\xce\xb3\x20\x63\x68\x61\x72\x73"};
  88. STATIC const mp_obj_str_t const_obj_frozentest__lt_module_gt__2 = {{&mp_type_bytes}, 57, 11, (const byte*)"\x62\x79\x74\x65\x73\x20\x31\x32\x33\x34\x01"};
  89. STATIC const mp_rom_obj_t const_table_data_frozentest__lt_module_gt_[3] = {
  90. MP_ROM_PTR(&const_obj_frozentest__lt_module_gt__0),
  91. MP_ROM_PTR(&const_obj_frozentest__lt_module_gt__1),
  92. MP_ROM_PTR(&const_obj_frozentest__lt_module_gt__2),
  93. };
  94. const mp_raw_code_t raw_code_frozentest__lt_module_gt_ = {
  95. .kind = MP_CODE_BYTECODE,
  96. .scope_flags = 0x00,
  97. .n_pos_args = 0,
  98. .fun_data = fun_data_frozentest__lt_module_gt_,
  99. .const_table = (mp_uint_t*)const_table_data_frozentest__lt_module_gt_,
  100. #if MICROPY_PERSISTENT_CODE_SAVE
  101. .fun_data_len = 85,
  102. .n_obj = 3,
  103. .n_raw_code = 0,
  104. #if MICROPY_PY_SYS_SETTRACE
  105. .prelude = {
  106. .n_state = 3,
  107. .n_exc_stack = 0,
  108. .scope_flags = 0,
  109. .n_pos_args = 0,
  110. .n_kwonly_args = 0,
  111. .n_def_pos_args = 0,
  112. .qstr_block_name = MP_QSTR__lt_module_gt_,
  113. .qstr_source_file = MP_QSTR_frozentest_dot_py,
  114. .line_info = fun_data_frozentest__lt_module_gt_ + 0,
  115. .opcodes = fun_data_frozentest__lt_module_gt_ + 13,
  116. },
  117. .line_of_definition = 0,
  118. #endif
  119. #if MICROPY_EMIT_MACHINE_CODE
  120. .prelude_offset = 0,
  121. .n_qstr = 0,
  122. .qstr_link = NULL,
  123. #endif
  124. #endif
  125. #if MICROPY_EMIT_MACHINE_CODE
  126. .type_sig = 0,
  127. #endif
  128. };
  129. const char mp_frozen_mpy_names[] = {
  130. "frozentest.py\0"
  131. "\0"};
  132. const mp_raw_code_t *const mp_frozen_mpy_content[] = {
  133. &raw_code_frozentest__lt_module_gt_,
  134. };