_frozen_mpy.c 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #include "py/mpconfig.h"
  2. #include "py/objint.h"
  3. #include "py/objstr.h"
  4. #include "py/emitglue.h"
  5. #if MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE != 0
  6. #error "incompatible MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE"
  7. #endif
  8. #if MICROPY_LONGINT_IMPL != 2
  9. #error "incompatible MICROPY_LONGINT_IMPL"
  10. #endif
  11. #if MICROPY_PY_BUILTINS_FLOAT
  12. typedef struct _mp_obj_float_t {
  13. mp_obj_base_t base;
  14. mp_float_t value;
  15. } mp_obj_float_t;
  16. #endif
  17. #if MICROPY_PY_BUILTINS_COMPLEX
  18. typedef struct _mp_obj_complex_t {
  19. mp_obj_base_t base;
  20. mp_float_t real;
  21. mp_float_t imag;
  22. } mp_obj_complex_t;
  23. #endif
  24. enum {
  25. MP_QSTR_frozentest_dot_py = MP_QSTRnumber_of,
  26. MP_QSTR_uPy,
  27. MP_QSTR_i,
  28. };
  29. extern const qstr_pool_t mp_qstr_const_pool;
  30. const qstr_pool_t mp_qstr_frozen_const_pool = {
  31. (qstr_pool_t*)&mp_qstr_const_pool, // previous pool
  32. MP_QSTRnumber_of, // previous pool size
  33. 3, // allocated entries
  34. 3, // used entries
  35. {
  36. (const byte*)"\xfe\x0d" "frozentest.py",
  37. (const byte*)"\xf9\x03" "uPy",
  38. (const byte*)"\xcc\x01" "i",
  39. },
  40. };
  41. // frozen bytecode for file frozentest.py, scope frozentest_<module>
  42. STATIC const byte bytecode_data_frozentest__lt_module_gt_[92] = {
  43. 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d,
  44. MP_QSTR__lt_module_gt_ & 0xff, MP_QSTR__lt_module_gt_ >> 8,
  45. MP_QSTR_frozentest_dot_py & 0xff, MP_QSTR_frozentest_dot_py >> 8,
  46. 0x2a, 0x28, 0x28, 0x28, 0x2b, 0x28, 0x00, 0x00, 0xff,
  47. 0x1b, MP_QSTR_print & 0xff, MP_QSTR_print >> 8,
  48. 0x16, MP_QSTR_uPy & 0xff, MP_QSTR_uPy >> 8,
  49. 0x64, 0x01,
  50. 0x32,
  51. 0x1b, MP_QSTR_print & 0xff, MP_QSTR_print >> 8,
  52. 0x17, 0x00,
  53. 0x64, 0x01,
  54. 0x32,
  55. 0x1b, MP_QSTR_print & 0xff, MP_QSTR_print >> 8,
  56. 0x17, 0x01,
  57. 0x64, 0x01,
  58. 0x32,
  59. 0x1b, MP_QSTR_print & 0xff, MP_QSTR_print >> 8,
  60. 0x17, 0x02,
  61. 0x64, 0x01,
  62. 0x32,
  63. 0x1b, MP_QSTR_print & 0xff, MP_QSTR_print >> 8,
  64. 0x14, 0xba, 0xef, 0x9a, 0x15,
  65. 0x64, 0x01,
  66. 0x32,
  67. 0x80,
  68. 0x35, 0x0f, 0x80,
  69. 0x30,
  70. 0x24, MP_QSTR_i & 0xff, MP_QSTR_i >> 8,
  71. 0x1b, MP_QSTR_print & 0xff, MP_QSTR_print >> 8,
  72. 0x1b, MP_QSTR_i & 0xff, MP_QSTR_i >> 8,
  73. 0x64, 0x01,
  74. 0x32,
  75. 0x81,
  76. 0xe5,
  77. 0x30,
  78. 0x84,
  79. 0xd7,
  80. 0x36, 0xeb, 0x7f,
  81. 0x32,
  82. 0x11,
  83. 0x5b,
  84. };
  85. 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"};
  86. 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"};
  87. 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"};
  88. STATIC const mp_rom_obj_t const_table_data_frozentest__lt_module_gt_[3] = {
  89. MP_ROM_PTR(&const_obj_frozentest__lt_module_gt__0),
  90. MP_ROM_PTR(&const_obj_frozentest__lt_module_gt__1),
  91. MP_ROM_PTR(&const_obj_frozentest__lt_module_gt__2),
  92. };
  93. const mp_raw_code_t raw_code_frozentest__lt_module_gt_ = {
  94. .kind = MP_CODE_BYTECODE,
  95. .scope_flags = 0x00,
  96. .n_pos_args = 0,
  97. .data.u_byte = {
  98. .bytecode = bytecode_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. .bc_len = 92,
  102. .n_obj = 3,
  103. .n_raw_code = 0,
  104. #endif
  105. },
  106. };
  107. const char mp_frozen_mpy_names[] = {
  108. "frozentest.py\0"
  109. "\0"};
  110. const mp_raw_code_t *const mp_frozen_mpy_content[] = {
  111. &raw_code_frozentest__lt_module_gt_,
  112. };