mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Couple opcode/cache/stack metadata with iterator pairs, generator preambles, ordinary import packing, common constants, compiler lowering and VM/JIT consumers. Pin official source/tool hashes and retain strict raw code and marshal comparisons. Use private development magic 0xDA16 and cache tag devabi2 until serialization and Python integration are coherent. Final clean corpus matches recursive code fields in 111/111 requests; full marshal/header exactness remains 0/111. Eight existing disassembly tests remain blocked by unchanged Lib metadata. Monitoring export and frozendict/update_lib integration remain explicit follow-on gates. Validation: compiler-core 23, codegen 807, CAPI 121 (4 existing ignored), focused certified-controller pytest, release/frozen witnesses, workspace and CAPI all-target Clippy. Independent source/artifact review covers manifest ec1013591ae97b4c519f4a2c78a8200664f3479f0c5452991b5fea4d1be669ea. Assisted-by: OpenAI Codex:model identifier unavailable
19 lines
589 B
C
19 lines
589 B
C
#define Py_BUILD_CORE
|
|
#define NEED_OPCODE_METADATA
|
|
#include "Python.h"
|
|
#include "pycore_opcode_metadata.h"
|
|
#include <stdio.h>
|
|
int main(void) {
|
|
const int args[] = {0,1,2,3,4,5,7,8,15,16,31,255,256,65535};
|
|
for (int op=0; op<512; op++) {
|
|
for (unsigned int i=0; i<sizeof(args)/sizeof(args[0]); i++) {
|
|
int popped = _PyOpcode_num_popped(op,args[i]);
|
|
int pushed = _PyOpcode_num_pushed(op,args[i]);
|
|
if (popped >= 0 && pushed >= 0) {
|
|
printf("%d %d %d %d\n",op,args[i],popped,pushed);
|
|
}
|
|
}
|
|
}
|
|
return 0;
|
|
}
|