Index: mkopcodeh.awk ================================================================== --- mkopcodeh.awk +++ mkopcodeh.awk @@ -23,21 +23,15 @@ # code generator run (infinitesimally) faster and more importantly it makes # the library footprint smaller. # # This script also scans for lines of the form: # -# case OP_aaaa: /* no-push */ -# -# When the no-push comment is found on an opcode, it means that that -# opcode does not leave a result on the stack. By identifying which -# opcodes leave results on the stack it is possible to determine a -# much smaller upper bound on the size of the stack. This allows -# a smaller stack to be allocated, which is important to embedded -# systems with limited memory space. This script generates a series -# of "NOPUSH_MASK" defines that contain bitmaps of opcodes that leave -# results on the stack. The NOPUSH_MASK defines are used in vdbeaux.c -# to help determine the maximum stack size. +# case OP_aaaa: /* jump, in1, in2, in3, out2-prerelease, out3 */ +# +# When such comments are found on an opcode, it means that certain +# properties apply to that opcode. Set corresponding flags using the +# OPFLG_INITIALIZER macro. # # Remember the TK_ values from the parse.h file /^#define TK_/ { @@ -78,10 +72,11 @@ in3[name] = 1 }else if(x=="out3"){ out3[name] = 1 } } + order[n_op++] = name; } # Assign numbers to all opcodes and output the result. END { cnt = 0 @@ -88,11 +83,12 @@ max = 0 print "/* Automatically generated. Do not edit */" print "/* See the mkopcodeh.awk script for details */" op["OP_Noop"] = -1; op["OP_Explain"] = -1; - for(name in op){ + for(i=0; i