Ruby 1.9.2p136(2010-12-25revision30365)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

# vm.inc

Go to the documentation of this file.

    00001 /* -*-c-*- *********************************************************/
    00002 /*******************************************************************/
    00003 /*******************************************************************/
    00015 INSN_ENTRY(nop){
    00016 {
    00017
    00018
    00019   DEBUG_ENTER_INSN("nop");
    00020   ADD_PC(1+0);
    00021   PREFETCH(GET_PC());
    00022   #define CURRENT_INSN_nop 1
    00023   #define INSN_IS_SC()     0
    00024   #define INSN_LABEL(lab)  LABEL_nop_##lab
    00025   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00026   USAGE_ANALYSIS_INSN(BIN(nop));
    00027 {
    00028 #line 40 "insns.def"
    00029     /* none */
    00030
    00031 #line 32 "vm.inc"
    00032 #undef CURRENT_INSN_nop
    00033 #undef INSN_IS_SC
    00034 #undef INSN_LABEL
    00035 #undef LABEL_IS_SC
    00036   END_INSN(nop);}}}
    00037 INSN_ENTRY(getlocal){
    00038 {
    00039   VALUE val;
    00040   lindex_t idx = (lindex_t)GET_OPERAND(1);
    00041
    00042   DEBUG_ENTER_INSN("getlocal");
    00043   ADD_PC(1+1);
    00044   PREFETCH(GET_PC());
    00045   #define CURRENT_INSN_getlocal 1
    00046   #define INSN_IS_SC()     0
    00047   #define INSN_LABEL(lab)  LABEL_getlocal_##lab
    00048   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00049   USAGE_ANALYSIS_INSN(BIN(getlocal));
    00050   USAGE_ANALYSIS_OPERAND(BIN(getlocal), 0, idx);
    00051 {
    00052 #line 58 "insns.def"
    00053     val = *(GET_LFP() - idx);
    00054
    00055 #line 56 "vm.inc"
    00056   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00057   PUSH(val);
    00058 #undef CURRENT_INSN_getlocal
    00059 #undef INSN_IS_SC
    00060 #undef INSN_LABEL
    00061 #undef LABEL_IS_SC
    00062   END_INSN(getlocal);}}}
    00063 INSN_ENTRY(setlocal){
    00064 {
    00065   lindex_t idx = (lindex_t)GET_OPERAND(1);
    00066   VALUE val = TOPN(0);
    00067   DEBUG_ENTER_INSN("setlocal");
    00068   ADD_PC(1+1);
    00069   PREFETCH(GET_PC());
    00070   POPN(1);
    00071   #define CURRENT_INSN_setlocal 1
    00072   #define INSN_IS_SC()     0
    00073   #define INSN_LABEL(lab)  LABEL_setlocal_##lab
    00074   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00075   USAGE_ANALYSIS_INSN(BIN(setlocal));
    00076   USAGE_ANALYSIS_OPERAND(BIN(setlocal), 0, idx);
    00077 {
    00078 #line 72 "insns.def"
    00079     (*(GET_LFP() - idx)) = val;
    00080
    00081 #line 82 "vm.inc"
    00082 #undef CURRENT_INSN_setlocal
    00083 #undef INSN_IS_SC
    00084 #undef INSN_LABEL
    00085 #undef LABEL_IS_SC
    00086   END_INSN(setlocal);}}}
    00087 INSN_ENTRY(getspecial){
    00088 {
    00089   VALUE val;
    00090   rb_num_t type = (rb_num_t)GET_OPERAND(2);
    00091   VALUE key = (VALUE)GET_OPERAND(1);
    00092
    00093   DEBUG_ENTER_INSN("getspecial");
    00094   ADD_PC(1+2);
    00095   PREFETCH(GET_PC());
    00096   #define CURRENT_INSN_getspecial 1
    00097   #define INSN_IS_SC()     0
    00098   #define INSN_LABEL(lab)  LABEL_getspecial_##lab
    00099   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00100   USAGE_ANALYSIS_INSN(BIN(getspecial));
    00101   USAGE_ANALYSIS_OPERAND(BIN(getspecial), 0, key);
    00102   USAGE_ANALYSIS_OPERAND(BIN(getspecial), 1, type);
    00103 {
    00104 #line 86 "insns.def"
    00105     val = vm_getspecial(th, GET_LFP(), key, type);
    00106
    00107 #line 108 "vm.inc"
    00108   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00109   PUSH(val);
    00110 #undef CURRENT_INSN_getspecial
    00111 #undef INSN_IS_SC
    00112 #undef INSN_LABEL
    00113 #undef LABEL_IS_SC
    00114   END_INSN(getspecial);}}}
    00115 INSN_ENTRY(setspecial){
    00116 {
    00117   VALUE key = (VALUE)GET_OPERAND(1);
    00118   VALUE obj = TOPN(0);
    00119   DEBUG_ENTER_INSN("setspecial");
    00120   ADD_PC(1+1);
    00121   PREFETCH(GET_PC());
    00122   POPN(1);
    00123   #define CURRENT_INSN_setspecial 1
    00124   #define INSN_IS_SC()     0
    00125   #define INSN_LABEL(lab)  LABEL_setspecial_##lab
    00126   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00127   USAGE_ANALYSIS_INSN(BIN(setspecial));
    00128   USAGE_ANALYSIS_OPERAND(BIN(setspecial), 0, key);
    00129 {
    00130 #line 100 "insns.def"
    00131     lfp_svar_set(th, GET_LFP(), key, obj);
    00132
    00133 #line 134 "vm.inc"
    00134 #undef CURRENT_INSN_setspecial
    00135 #undef INSN_IS_SC
    00136 #undef INSN_LABEL
    00137 #undef LABEL_IS_SC
    00138   END_INSN(setspecial);}}}
    00139 INSN_ENTRY(getdynamic){
    00140 {
    00141   VALUE val;
    00142   rb_num_t level = (rb_num_t)GET_OPERAND(2);
    00143   dindex_t idx = (dindex_t)GET_OPERAND(1);
    00144
    00145   DEBUG_ENTER_INSN("getdynamic");
    00146   ADD_PC(1+2);
    00147   PREFETCH(GET_PC());
    00148   #define CURRENT_INSN_getdynamic 1
    00149   #define INSN_IS_SC()     0
    00150   #define INSN_LABEL(lab)  LABEL_getdynamic_##lab
    00151   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00152   USAGE_ANALYSIS_INSN(BIN(getdynamic));
    00153   USAGE_ANALYSIS_OPERAND(BIN(getdynamic), 0, idx);
    00154   USAGE_ANALYSIS_OPERAND(BIN(getdynamic), 1, level);
    00155 {
    00156 #line 116 "insns.def"
    00157     rb_num_t i;
    00158     VALUE *dfp2 = GET_DFP();
    00159     for (i = 0; i < level; i++) {
    00160         dfp2 = GET_PREV_DFP(dfp2);
    00161     }
    00162     val = *(dfp2 - idx);
    00163
    00164 #line 165 "vm.inc"
    00165   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00166   PUSH(val);
    00167 #undef CURRENT_INSN_getdynamic
    00168 #undef INSN_IS_SC
    00169 #undef INSN_LABEL
    00170 #undef LABEL_IS_SC
    00171   END_INSN(getdynamic);}}}
    00172 INSN_ENTRY(setdynamic){
    00173 {
    00174   rb_num_t level = (rb_num_t)GET_OPERAND(2);
    00175   dindex_t idx = (dindex_t)GET_OPERAND(1);
    00176   VALUE val = TOPN(0);
    00177   DEBUG_ENTER_INSN("setdynamic");
    00178   ADD_PC(1+2);
    00179   PREFETCH(GET_PC());
    00180   POPN(1);
    00181   #define CURRENT_INSN_setdynamic 1
    00182   #define INSN_IS_SC()     0
    00183   #define INSN_LABEL(lab)  LABEL_setdynamic_##lab
    00184   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00185   USAGE_ANALYSIS_INSN(BIN(setdynamic));
    00186   USAGE_ANALYSIS_OPERAND(BIN(setdynamic), 0, idx);
    00187   USAGE_ANALYSIS_OPERAND(BIN(setdynamic), 1, level);
    00188 {
    00189 #line 137 "insns.def"
    00190     rb_num_t i;
    00191     VALUE *dfp2 = GET_DFP();
    00192     for (i = 0; i < level; i++) {
    00193         dfp2 = GET_PREV_DFP(dfp2);
    00194     }
    00195     *(dfp2 - idx) = val;
    00196
    00197 #line 198 "vm.inc"
    00198 #undef CURRENT_INSN_setdynamic
    00199 #undef INSN_IS_SC
    00200 #undef INSN_LABEL
    00201 #undef LABEL_IS_SC
    00202   END_INSN(setdynamic);}}}
    00203 INSN_ENTRY(getinstancevariable){
    00204 {
    00205   VALUE val;
    00206   IC ic = (IC)GET_OPERAND(2);
    00207   ID id = (ID)GET_OPERAND(1);
    00208
    00209   DEBUG_ENTER_INSN("getinstancevariable");
    00210   ADD_PC(1+2);
    00211   PREFETCH(GET_PC());
    00212   #define CURRENT_INSN_getinstancevariable 1
    00213   #define INSN_IS_SC()     0
    00214   #define INSN_LABEL(lab)  LABEL_getinstancevariable_##lab
    00215   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00216   USAGE_ANALYSIS_INSN(BIN(getinstancevariable));
    00217   USAGE_ANALYSIS_OPERAND(BIN(getinstancevariable), 0, id);
    00218   USAGE_ANALYSIS_OPERAND(BIN(getinstancevariable), 1, ic);
    00219 {
    00220 #line 157 "insns.def"
    00221     val = vm_getivar(GET_SELF(), id, ic);
    00222
    00223 #line 224 "vm.inc"
    00224   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00225   PUSH(val);
    00226 #undef CURRENT_INSN_getinstancevariable
    00227 #undef INSN_IS_SC
    00228 #undef INSN_LABEL
    00229 #undef LABEL_IS_SC
    00230   END_INSN(getinstancevariable);}}}
    00231 INSN_ENTRY(setinstancevariable){
    00232 {
    00233   IC ic = (IC)GET_OPERAND(2);
    00234   ID id = (ID)GET_OPERAND(1);
    00235   VALUE val = TOPN(0);
    00236   DEBUG_ENTER_INSN("setinstancevariable");
    00237   ADD_PC(1+2);
    00238   PREFETCH(GET_PC());
    00239   POPN(1);
    00240   #define CURRENT_INSN_setinstancevariable 1
    00241   #define INSN_IS_SC()     0
    00242   #define INSN_LABEL(lab)  LABEL_setinstancevariable_##lab
    00243   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00244   USAGE_ANALYSIS_INSN(BIN(setinstancevariable));
    00245   USAGE_ANALYSIS_OPERAND(BIN(setinstancevariable), 0, id);
    00246   USAGE_ANALYSIS_OPERAND(BIN(setinstancevariable), 1, ic);
    00247 {
    00248 #line 172 "insns.def"
    00249     vm_setivar(GET_SELF(), id, val, ic);
    00250
    00251 #line 252 "vm.inc"
    00252 #undef CURRENT_INSN_setinstancevariable
    00253 #undef INSN_IS_SC
    00254 #undef INSN_LABEL
    00255 #undef LABEL_IS_SC
    00256   END_INSN(setinstancevariable);}}}
    00257 INSN_ENTRY(getclassvariable){
    00258 {
    00259   VALUE val;
    00260   ID id = (ID)GET_OPERAND(1);
    00261
    00262   DEBUG_ENTER_INSN("getclassvariable");
    00263   ADD_PC(1+1);
    00264   PREFETCH(GET_PC());
    00265   #define CURRENT_INSN_getclassvariable 1
    00266   #define INSN_IS_SC()     0
    00267   #define INSN_LABEL(lab)  LABEL_getclassvariable_##lab
    00268   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00269   USAGE_ANALYSIS_INSN(BIN(getclassvariable));
    00270   USAGE_ANALYSIS_OPERAND(BIN(getclassvariable), 0, id);
    00271 {
    00272 #line 186 "insns.def"
    00273     NODE * const cref = vm_get_cref(GET_ISEQ(), GET_LFP(), GET_DFP());
    00274     val = rb_cvar_get(vm_get_cvar_base(cref), id);
    00275
    00276 #line 277 "vm.inc"
    00277   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00278   PUSH(val);
    00279 #undef CURRENT_INSN_getclassvariable
    00280 #undef INSN_IS_SC
    00281 #undef INSN_LABEL
    00282 #undef LABEL_IS_SC
    00283   END_INSN(getclassvariable);}}}
    00284 INSN_ENTRY(setclassvariable){
    00285 {
    00286   ID id = (ID)GET_OPERAND(1);
    00287   VALUE val = TOPN(0);
    00288   DEBUG_ENTER_INSN("setclassvariable");
    00289   ADD_PC(1+1);
    00290   PREFETCH(GET_PC());
    00291   POPN(1);
    00292   #define CURRENT_INSN_setclassvariable 1
    00293   #define INSN_IS_SC()     0
    00294   #define INSN_LABEL(lab)  LABEL_setclassvariable_##lab
    00295   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00296   USAGE_ANALYSIS_INSN(BIN(setclassvariable));
    00297   USAGE_ANALYSIS_OPERAND(BIN(setclassvariable), 0, id);
    00298 {
    00299 #line 201 "insns.def"
    00300     NODE * const cref = vm_get_cref(GET_ISEQ(), GET_LFP(), GET_DFP());
    00301     rb_cvar_set(vm_get_cvar_base(cref), id, val);
    00302
    00303 #line 304 "vm.inc"
    00304 #undef CURRENT_INSN_setclassvariable
    00305 #undef INSN_IS_SC
    00306 #undef INSN_LABEL
    00307 #undef LABEL_IS_SC
    00308   END_INSN(setclassvariable);}}}
    00309 INSN_ENTRY(getconstant){
    00310 {
    00311   VALUE val;
    00312   ID id = (ID)GET_OPERAND(1);
    00313   VALUE klass = TOPN(0);
    00314   DEBUG_ENTER_INSN("getconstant");
    00315   ADD_PC(1+1);
    00316   PREFETCH(GET_PC());
    00317   POPN(1);
    00318   #define CURRENT_INSN_getconstant 1
    00319   #define INSN_IS_SC()     0
    00320   #define INSN_LABEL(lab)  LABEL_getconstant_##lab
    00321   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00322   USAGE_ANALYSIS_INSN(BIN(getconstant));
    00323   USAGE_ANALYSIS_OPERAND(BIN(getconstant), 0, id);
    00324 {
    00325 #line 223 "insns.def"
    00326     val = vm_get_ev_const(th, GET_ISEQ(), klass, id, 0);
    00327
    00328 #line 329 "vm.inc"
    00329   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00330   PUSH(val);
    00331 #undef CURRENT_INSN_getconstant
    00332 #undef INSN_IS_SC
    00333 #undef INSN_LABEL
    00334 #undef LABEL_IS_SC
    00335   END_INSN(getconstant);}}}
    00336 INSN_ENTRY(setconstant){
    00337 {
    00338   ID id = (ID)GET_OPERAND(1);
    00339   VALUE val = TOPN(1);
    00340   VALUE cbase = TOPN(0);
    00341   DEBUG_ENTER_INSN("setconstant");
    00342   ADD_PC(1+1);
    00343   PREFETCH(GET_PC());
    00344   POPN(2);
    00345   #define CURRENT_INSN_setconstant 1
    00346   #define INSN_IS_SC()     0
    00347   #define INSN_LABEL(lab)  LABEL_setconstant_##lab
    00348   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00349   USAGE_ANALYSIS_INSN(BIN(setconstant));
    00350   USAGE_ANALYSIS_OPERAND(BIN(setconstant), 0, id);
    00351 {
    00352 #line 245 "insns.def"
    00353     vm_check_if_namespace(cbase);
    00354     rb_const_set(cbase, id, val);
    00355     INC_VM_STATE_VERSION();
    00356
    00357 #line 358 "vm.inc"
    00358 #undef CURRENT_INSN_setconstant
    00359 #undef INSN_IS_SC
    00360 #undef INSN_LABEL
    00361 #undef LABEL_IS_SC
    00362   END_INSN(setconstant);}}}
    00363 INSN_ENTRY(getglobal){
    00364 {
    00365   VALUE val;
    00366   GENTRY entry = (GENTRY)GET_OPERAND(1);
    00367
    00368   DEBUG_ENTER_INSN("getglobal");
    00369   ADD_PC(1+1);
    00370   PREFETCH(GET_PC());
    00371   #define CURRENT_INSN_getglobal 1
    00372   #define INSN_IS_SC()     0
    00373   #define INSN_LABEL(lab)  LABEL_getglobal_##lab
    00374   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00375   USAGE_ANALYSIS_INSN(BIN(getglobal));
    00376   USAGE_ANALYSIS_OPERAND(BIN(getglobal), 0, entry);
    00377 {
    00378 #line 261 "insns.def"
    00379     val = GET_GLOBAL(entry);
    00380
    00381 #line 382 "vm.inc"
    00382   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00383   PUSH(val);
    00384 #undef CURRENT_INSN_getglobal
    00385 #undef INSN_IS_SC
    00386 #undef INSN_LABEL
    00387 #undef LABEL_IS_SC
    00388   END_INSN(getglobal);}}}
    00389 INSN_ENTRY(setglobal){
    00390 {
    00391   GENTRY entry = (GENTRY)GET_OPERAND(1);
    00392   VALUE val = TOPN(0);
    00393   DEBUG_ENTER_INSN("setglobal");
    00394   ADD_PC(1+1);
    00395   PREFETCH(GET_PC());
    00396   POPN(1);
    00397   #define CURRENT_INSN_setglobal 1
    00398   #define INSN_IS_SC()     0
    00399   #define INSN_LABEL(lab)  LABEL_setglobal_##lab
    00400   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00401   USAGE_ANALYSIS_INSN(BIN(setglobal));
    00402   USAGE_ANALYSIS_OPERAND(BIN(setglobal), 0, entry);
    00403 {
    00404 #line 275 "insns.def"
    00405     SET_GLOBAL(entry, val);
    00406
    00407 #line 408 "vm.inc"
    00408 #undef CURRENT_INSN_setglobal
    00409 #undef INSN_IS_SC
    00410 #undef INSN_LABEL
    00411 #undef LABEL_IS_SC
    00412   END_INSN(setglobal);}}}
    00413 INSN_ENTRY(putnil){
    00414 {
    00415   VALUE val;
    00416
    00417
    00418   DEBUG_ENTER_INSN("putnil");
    00419   ADD_PC(1+0);
    00420   PREFETCH(GET_PC());
    00421   #define CURRENT_INSN_putnil 1
    00422   #define INSN_IS_SC()     0
    00423   #define INSN_LABEL(lab)  LABEL_putnil_##lab
    00424   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00425   USAGE_ANALYSIS_INSN(BIN(putnil));
    00426 {
    00427 #line 294 "insns.def"
    00428     val = Qnil;
    00429
    00430 #line 431 "vm.inc"
    00431   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00432   PUSH(val);
    00433 #undef CURRENT_INSN_putnil
    00434 #undef INSN_IS_SC
    00435 #undef INSN_LABEL
    00436 #undef LABEL_IS_SC
    00437   END_INSN(putnil);}}}
    00438 INSN_ENTRY(putself){
    00439 {
    00440   VALUE val;
    00441
    00442
    00443   DEBUG_ENTER_INSN("putself");
    00444   ADD_PC(1+0);
    00445   PREFETCH(GET_PC());
    00446   #define CURRENT_INSN_putself 1
    00447   #define INSN_IS_SC()     0
    00448   #define INSN_LABEL(lab)  LABEL_putself_##lab
    00449   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00450   USAGE_ANALYSIS_INSN(BIN(putself));
    00451 {
    00452 #line 308 "insns.def"
    00453     val = GET_SELF();
    00454
    00455 #line 456 "vm.inc"
    00456   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00457   PUSH(val);
    00458 #undef CURRENT_INSN_putself
    00459 #undef INSN_IS_SC
    00460 #undef INSN_LABEL
    00461 #undef LABEL_IS_SC
    00462   END_INSN(putself);}}}
    00463 INSN_ENTRY(putobject){
    00464 {
    00465   VALUE val = (VALUE)GET_OPERAND(1);
    00466
    00467   DEBUG_ENTER_INSN("putobject");
    00468   ADD_PC(1+1);
    00469   PREFETCH(GET_PC());
    00470   #define CURRENT_INSN_putobject 1
    00471   #define INSN_IS_SC()     0
    00472   #define INSN_LABEL(lab)  LABEL_putobject_##lab
    00473   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00474   USAGE_ANALYSIS_INSN(BIN(putobject));
    00475   USAGE_ANALYSIS_OPERAND(BIN(putobject), 0, val);
    00476 {
    00477 #line 324 "insns.def"
    00478     /* */
    00479
    00480 #line 481 "vm.inc"
    00481   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00482   PUSH(val);
    00483 #undef CURRENT_INSN_putobject
    00484 #undef INSN_IS_SC
    00485 #undef INSN_LABEL
    00486 #undef LABEL_IS_SC
    00487   END_INSN(putobject);}}}
    00488 INSN_ENTRY(putspecialobject){
    00489 {
    00490   VALUE val;
    00491   rb_num_t value_type = (rb_num_t)GET_OPERAND(1);
    00492
    00493   DEBUG_ENTER_INSN("putspecialobject");
    00494   ADD_PC(1+1);
    00495   PREFETCH(GET_PC());
    00496   #define CURRENT_INSN_putspecialobject 1
    00497   #define INSN_IS_SC()     0
    00498   #define INSN_LABEL(lab)  LABEL_putspecialobject_##lab
    00499   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00500   USAGE_ANALYSIS_INSN(BIN(putspecialobject));
    00501   USAGE_ANALYSIS_OPERAND(BIN(putspecialobject), 0, value_type);
    00502 {
    00503 #line 339 "insns.def"
    00504     switch (value_type) {
    00505       case VM_SPECIAL_OBJECT_VMCORE:
    00506         val = rb_mRubyVMFrozenCore;
    00507         break;
    00508       case VM_SPECIAL_OBJECT_CBASE:
    00509         val = vm_get_cbase(GET_ISEQ(), GET_LFP(), GET_DFP());
    00510         break;
    00511       case VM_SPECIAL_OBJECT_CONST_BASE:
    00512         val = vm_get_const_base(GET_ISEQ(), GET_LFP(), GET_DFP());
    00513         break;
    00514       default:
    00515         rb_bug("putspecialobject insn: unknown value_type");
    00516     }
    00517
    00518 #line 519 "vm.inc"
    00519   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00520   PUSH(val);
    00521 #undef CURRENT_INSN_putspecialobject
    00522 #undef INSN_IS_SC
    00523 #undef INSN_LABEL
    00524 #undef LABEL_IS_SC
    00525   END_INSN(putspecialobject);}}}
    00526 INSN_ENTRY(putiseq){
    00527 {
    00528   VALUE ret;
    00529   ISEQ iseq = (ISEQ)GET_OPERAND(1);
    00530
    00531   DEBUG_ENTER_INSN("putiseq");
    00532   ADD_PC(1+1);
    00533   PREFETCH(GET_PC());
    00534   #define CURRENT_INSN_putiseq 1
    00535   #define INSN_IS_SC()     0
    00536   #define INSN_LABEL(lab)  LABEL_putiseq_##lab
    00537   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00538   USAGE_ANALYSIS_INSN(BIN(putiseq));
    00539   USAGE_ANALYSIS_OPERAND(BIN(putiseq), 0, iseq);
    00540 {
    00541 #line 365 "insns.def"
    00542     ret = iseq->self;
    00543
    00544 #line 545 "vm.inc"
    00545   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00546   PUSH(ret);
    00547 #undef CURRENT_INSN_putiseq
    00548 #undef INSN_IS_SC
    00549 #undef INSN_LABEL
    00550 #undef LABEL_IS_SC
    00551   END_INSN(putiseq);}}}
    00552 INSN_ENTRY(putstring){
    00553 {
    00554   VALUE val;
    00555   VALUE str = (VALUE)GET_OPERAND(1);
    00556
    00557   DEBUG_ENTER_INSN("putstring");
    00558   ADD_PC(1+1);
    00559   PREFETCH(GET_PC());
    00560   #define CURRENT_INSN_putstring 1
    00561   #define INSN_IS_SC()     0
    00562   #define INSN_LABEL(lab)  LABEL_putstring_##lab
    00563   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00564   USAGE_ANALYSIS_INSN(BIN(putstring));
    00565   USAGE_ANALYSIS_OPERAND(BIN(putstring), 0, str);
    00566 {
    00567 #line 379 "insns.def"
    00568     val = rb_str_resurrect(str);
    00569
    00570 #line 571 "vm.inc"
    00571   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00572   PUSH(val);
    00573 #undef CURRENT_INSN_putstring
    00574 #undef INSN_IS_SC
    00575 #undef INSN_LABEL
    00576 #undef LABEL_IS_SC
    00577   END_INSN(putstring);}}}
    00578 INSN_ENTRY(concatstrings){
    00579 {
    00580   VALUE val;
    00581   rb_num_t num = (rb_num_t)GET_OPERAND(1);
    00582
    00583   DEBUG_ENTER_INSN("concatstrings");
    00584   ADD_PC(1+1);
    00585   PREFETCH(GET_PC());
    00586   #define CURRENT_INSN_concatstrings 1
    00587   #define INSN_IS_SC()     0
    00588   #define INSN_LABEL(lab)  LABEL_concatstrings_##lab
    00589   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00590   USAGE_ANALYSIS_INSN(BIN(concatstrings));
    00591   USAGE_ANALYSIS_OPERAND(BIN(concatstrings), 0, num);
    00592 {
    00593 #line 393 "insns.def"
    00594     rb_num_t i = num;
    00595
    00596     val = rb_str_new(0, 0);
    00597     while (i-- > 0) {
    00598         const VALUE v = TOPN(i);
    00599         rb_str_append(val, v);
    00600     }
    00601     POPN(num);
    00602
    00603 #line 604 "vm.inc"
    00604   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00605   PUSH(val);
    00606 #undef CURRENT_INSN_concatstrings
    00607 #undef INSN_IS_SC
    00608 #undef INSN_LABEL
    00609 #undef LABEL_IS_SC
    00610   END_INSN(concatstrings);}}}
    00611 INSN_ENTRY(tostring){
    00612 {
    00613
    00614   VALUE val = TOPN(0);
    00615   DEBUG_ENTER_INSN("tostring");
    00616   ADD_PC(1+0);
    00617   PREFETCH(GET_PC());
    00618   POPN(1);
    00619   #define CURRENT_INSN_tostring 1
    00620   #define INSN_IS_SC()     0
    00621   #define INSN_LABEL(lab)  LABEL_tostring_##lab
    00622   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00623   USAGE_ANALYSIS_INSN(BIN(tostring));
    00624 {
    00625 #line 414 "insns.def"
    00626     val = rb_obj_as_string(val);
    00627
    00628 #line 629 "vm.inc"
    00629   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00630   PUSH(val);
    00631 #undef CURRENT_INSN_tostring
    00632 #undef INSN_IS_SC
    00633 #undef INSN_LABEL
    00634 #undef LABEL_IS_SC
    00635   END_INSN(tostring);}}}
    00636 INSN_ENTRY(toregexp){
    00637 {
    00638   VALUE val;
    00639   rb_num_t cnt = (rb_num_t)GET_OPERAND(2);
    00640   rb_num_t opt = (rb_num_t)GET_OPERAND(1);
    00641
    00642   DEBUG_ENTER_INSN("toregexp");
    00643   ADD_PC(1+2);
    00644   PREFETCH(GET_PC());
    00645   #define CURRENT_INSN_toregexp 1
    00646   #define INSN_IS_SC()     0
    00647   #define INSN_LABEL(lab)  LABEL_toregexp_##lab
    00648   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00649   USAGE_ANALYSIS_INSN(BIN(toregexp));
    00650   USAGE_ANALYSIS_OPERAND(BIN(toregexp), 0, opt);
    00651   USAGE_ANALYSIS_OPERAND(BIN(toregexp), 1, cnt);
    00652 {
    00653 #line 429 "insns.def"
    00654     VALUE rb_reg_new_ary(VALUE ary, int options);
    00655     rb_num_t i;
    00656     const VALUE ary = rb_ary_tmp_new(cnt);
    00657     for (i = 0; i < cnt; i++) {
    00658         rb_ary_store(ary, cnt-i-1, TOPN(i));
    00659     }
    00660     POPN(cnt);
    00661     val = rb_reg_new_ary(ary, (int)opt);
    00662     rb_ary_clear(ary);
    00663
    00664 #line 665 "vm.inc"
    00665   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00666   PUSH(val);
    00667 #undef CURRENT_INSN_toregexp
    00668 #undef INSN_IS_SC
    00669 #undef INSN_LABEL
    00670 #undef LABEL_IS_SC
    00671   END_INSN(toregexp);}}}
    00672 INSN_ENTRY(newarray){
    00673 {
    00674   VALUE val;
    00675   rb_num_t num = (rb_num_t)GET_OPERAND(1);
    00676
    00677   DEBUG_ENTER_INSN("newarray");
    00678   ADD_PC(1+1);
    00679   PREFETCH(GET_PC());
    00680   #define CURRENT_INSN_newarray 1
    00681   #define INSN_IS_SC()     0
    00682   #define INSN_LABEL(lab)  LABEL_newarray_##lab
    00683   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00684   USAGE_ANALYSIS_INSN(BIN(newarray));
    00685   USAGE_ANALYSIS_OPERAND(BIN(newarray), 0, num);
    00686 {
    00687 #line 451 "insns.def"
    00688     val = rb_ary_new4((long)num, STACK_ADDR_FROM_TOP(num));
    00689     POPN(num);
    00690
    00691 #line 692 "vm.inc"
    00692   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00693   PUSH(val);
    00694 #undef CURRENT_INSN_newarray
    00695 #undef INSN_IS_SC
    00696 #undef INSN_LABEL
    00697 #undef LABEL_IS_SC
    00698   END_INSN(newarray);}}}
    00699 INSN_ENTRY(duparray){
    00700 {
    00701   VALUE val;
    00702   VALUE ary = (VALUE)GET_OPERAND(1);
    00703
    00704   DEBUG_ENTER_INSN("duparray");
    00705   ADD_PC(1+1);
    00706   PREFETCH(GET_PC());
    00707   #define CURRENT_INSN_duparray 1
    00708   #define INSN_IS_SC()     0
    00709   #define INSN_LABEL(lab)  LABEL_duparray_##lab
    00710   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00711   USAGE_ANALYSIS_INSN(BIN(duparray));
    00712   USAGE_ANALYSIS_OPERAND(BIN(duparray), 0, ary);
    00713 {
    00714 #line 466 "insns.def"
    00715     val = rb_ary_resurrect(ary);
    00716
    00717 #line 718 "vm.inc"
    00718   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00719   PUSH(val);
    00720 #undef CURRENT_INSN_duparray
    00721 #undef INSN_IS_SC
    00722 #undef INSN_LABEL
    00723 #undef LABEL_IS_SC
    00724   END_INSN(duparray);}}}
    00725 INSN_ENTRY(expandarray){
    00726 {
    00727   rb_num_t flag = (rb_num_t)GET_OPERAND(2);
    00728   rb_num_t num = (rb_num_t)GET_OPERAND(1);
    00729   VALUE ary = TOPN(0);
    00730   DEBUG_ENTER_INSN("expandarray");
    00731   ADD_PC(1+2);
    00732   PREFETCH(GET_PC());
    00733   POPN(1);
    00734   #define CURRENT_INSN_expandarray 1
    00735   #define INSN_IS_SC()     0
    00736   #define INSN_LABEL(lab)  LABEL_expandarray_##lab
    00737   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00738   USAGE_ANALYSIS_INSN(BIN(expandarray));
    00739   USAGE_ANALYSIS_OPERAND(BIN(expandarray), 0, num);
    00740   USAGE_ANALYSIS_OPERAND(BIN(expandarray), 1, flag);
    00741 {
    00742 #line 487 "insns.def"
    00743     vm_expandarray(GET_CFP(), ary, num, (int)flag);
    00744
    00745 #line 746 "vm.inc"
    00746 #undef CURRENT_INSN_expandarray
    00747 #undef INSN_IS_SC
    00748 #undef INSN_LABEL
    00749 #undef LABEL_IS_SC
    00750   END_INSN(expandarray);}}}
    00751 INSN_ENTRY(concatarray){
    00752 {
    00753   VALUE ary;
    00754
    00755   VALUE ary1 = TOPN(1);
    00756   VALUE ary2st = TOPN(0);
    00757   DEBUG_ENTER_INSN("concatarray");
    00758   ADD_PC(1+0);
    00759   PREFETCH(GET_PC());
    00760   POPN(2);
    00761   #define CURRENT_INSN_concatarray 1
    00762   #define INSN_IS_SC()     0
    00763   #define INSN_LABEL(lab)  LABEL_concatarray_##lab
    00764   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00765   USAGE_ANALYSIS_INSN(BIN(concatarray));
    00766 {
    00767 #line 501 "insns.def"
    00768     const VALUE ary2 = ary2st;
    00769     VALUE tmp1 = rb_check_convert_type(ary1, T_ARRAY, "Array", "to_a");
    00770     VALUE tmp2 = rb_check_convert_type(ary2, T_ARRAY, "Array", "to_a");
    00771
    00772     if (NIL_P(tmp1)) {
    00773         tmp1 = rb_ary_new3(1, ary1);
    00774     }
    00775
    00776     if (NIL_P(tmp2)) {
    00777         tmp2 = rb_ary_new3(1, ary2);
    00778     }
    00779
    00780     if (tmp1 == ary1) {
    00781         tmp1 = rb_ary_dup(ary1);
    00782     }
    00783     ary = rb_ary_concat(tmp1, tmp2);
    00784
    00785 #line 786 "vm.inc"
    00786   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00787   PUSH(ary);
    00788 #undef CURRENT_INSN_concatarray
    00789 #undef INSN_IS_SC
    00790 #undef INSN_LABEL
    00791 #undef LABEL_IS_SC
    00792   END_INSN(concatarray);}}}
    00793 INSN_ENTRY(splatarray){
    00794 {
    00795   VALUE obj;
    00796
    00797   VALUE ary = TOPN(0);
    00798   DEBUG_ENTER_INSN("splatarray");
    00799   ADD_PC(1+1);
    00800   PREFETCH(GET_PC());
    00801   POPN(1);
    00802   #define CURRENT_INSN_splatarray 1
    00803   #define INSN_IS_SC()     0
    00804   #define INSN_LABEL(lab)  LABEL_splatarray_##lab
    00805   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00806   USAGE_ANALYSIS_INSN(BIN(splatarray));
    00807   USAGE_ANALYSIS_OPERAND(BIN(splatarray), 0, flag);
    00808 {
    00809 #line 530 "insns.def"
    00810     VALUE tmp = rb_check_convert_type(ary, T_ARRAY, "Array", "to_a");
    00811     if (NIL_P(tmp)) {
    00812         tmp = rb_ary_new3(1, ary);
    00813     }
    00814     obj = tmp;
    00815
    00816 #line 817 "vm.inc"
    00817   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00818   PUSH(obj);
    00819 #undef CURRENT_INSN_splatarray
    00820 #undef INSN_IS_SC
    00821 #undef INSN_LABEL
    00822 #undef LABEL_IS_SC
    00823   END_INSN(splatarray);}}}
    00824 INSN_ENTRY(checkincludearray){
    00825 {
    00826   VALUE result;
    00827   VALUE flag = (VALUE)GET_OPERAND(1);
    00828   VALUE obj = TOPN(1);
    00829   VALUE ary = TOPN(0);
    00830   DEBUG_ENTER_INSN("checkincludearray");
    00831   ADD_PC(1+1);
    00832   PREFETCH(GET_PC());
    00833   POPN(2);
    00834   #define CURRENT_INSN_checkincludearray 1
    00835   #define INSN_IS_SC()     0
    00836   #define INSN_LABEL(lab)  LABEL_checkincludearray_##lab
    00837   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00838   USAGE_ANALYSIS_INSN(BIN(checkincludearray));
    00839   USAGE_ANALYSIS_OPERAND(BIN(checkincludearray), 0, flag);
    00840 {
    00841 #line 548 "insns.def"
    00842     int i;
    00843     result = Qfalse;
    00844
    00845     if (TYPE(ary) != T_ARRAY) {
    00846         ary = rb_Array(ary);
    00847     }
    00848
    00849     if (flag == Qtrue) {
    00850         /* NODE_CASE */
    00851         for (i = 0; i < RARRAY_LEN(ary); i++) {
    00852             /* TODO: fix me (use another method dispatch) */
    00853             if (RTEST(rb_funcall2(RARRAY_PTR(ary)[i], idEqq, 1, &obj))) {
    00854                 result = Qtrue;
    00855                 break;
    00856             }
    00857         }
    00858     }
    00859     else {
    00860         obj = Qfalse;
    00861         /* NODE_WHEN */
    00862         for (i = 0; i < RARRAY_LEN(ary); i++) {
    00863             if (RTEST(RARRAY_PTR(ary)[i])) {
    00864                 obj = result = Qtrue;
    00865                 break;
    00866             }
    00867         }
    00868     }
    00869
    00870 #line 871 "vm.inc"
    00871   CHECK_STACK_OVERFLOW(REG_CFP, 2);
    00872   PUSH(obj);
    00873   PUSH(result);
    00874 #undef CURRENT_INSN_checkincludearray
    00875 #undef INSN_IS_SC
    00876 #undef INSN_LABEL
    00877 #undef LABEL_IS_SC
    00878   END_INSN(checkincludearray);}}}
    00879 INSN_ENTRY(newhash){
    00880 {
    00881   VALUE val;
    00882   rb_num_t num = (rb_num_t)GET_OPERAND(1);
    00883
    00884   DEBUG_ENTER_INSN("newhash");
    00885   ADD_PC(1+1);
    00886   PREFETCH(GET_PC());
    00887   #define CURRENT_INSN_newhash 1
    00888   #define INSN_IS_SC()     0
    00889   #define INSN_LABEL(lab)  LABEL_newhash_##lab
    00890   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00891   USAGE_ANALYSIS_INSN(BIN(newhash));
    00892   USAGE_ANALYSIS_OPERAND(BIN(newhash), 0, num);
    00893 {
    00894 #line 589 "insns.def"
    00895     rb_num_t i;
    00896     val = rb_hash_new();
    00897
    00898     for (i = num; i > 0; i -= 2) {
    00899         const VALUE v = TOPN(i - 2);
    00900         const VALUE k = TOPN(i - 1);
    00901         rb_hash_aset(val, k, v);
    00902     }
    00903     POPN(num);
    00904
    00905 #line 906 "vm.inc"
    00906   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00907   PUSH(val);
    00908 #undef CURRENT_INSN_newhash
    00909 #undef INSN_IS_SC
    00910 #undef INSN_LABEL
    00911 #undef LABEL_IS_SC
    00912   END_INSN(newhash);}}}
    00913 INSN_ENTRY(newrange){
    00914 {
    00915   VALUE val;
    00916   rb_num_t flag = (rb_num_t)GET_OPERAND(1);
    00917   VALUE low = TOPN(1);
    00918   VALUE high = TOPN(0);
    00919   DEBUG_ENTER_INSN("newrange");
    00920   ADD_PC(1+1);
    00921   PREFETCH(GET_PC());
    00922   POPN(2);
    00923   #define CURRENT_INSN_newrange 1
    00924   #define INSN_IS_SC()     0
    00925   #define INSN_LABEL(lab)  LABEL_newrange_##lab
    00926   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00927   USAGE_ANALYSIS_INSN(BIN(newrange));
    00928   USAGE_ANALYSIS_OPERAND(BIN(newrange), 0, flag);
    00929 {
    00930 #line 611 "insns.def"
    00931     val = rb_range_new(low, high, (int)flag);
    00932
    00933 #line 934 "vm.inc"
    00934   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    00935   PUSH(val);
    00936 #undef CURRENT_INSN_newrange
    00937 #undef INSN_IS_SC
    00938 #undef INSN_LABEL
    00939 #undef LABEL_IS_SC
    00940   END_INSN(newrange);}}}
    00941 INSN_ENTRY(pop){
    00942 {
    00943
    00944   VALUE val = TOPN(0);
    00945   DEBUG_ENTER_INSN("pop");
    00946   ADD_PC(1+0);
    00947   PREFETCH(GET_PC());
    00948   POPN(1);
    00949   #define CURRENT_INSN_pop 1
    00950   #define INSN_IS_SC()     0
    00951   #define INSN_LABEL(lab)  LABEL_pop_##lab
    00952   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00953   USAGE_ANALYSIS_INSN(BIN(pop));
    00954 {
    00955 #line 629 "insns.def"
    00956     val = val;
    00957     /* none */
    00958
    00959 #line 960 "vm.inc"
    00960 #undef CURRENT_INSN_pop
    00961 #undef INSN_IS_SC
    00962 #undef INSN_LABEL
    00963 #undef LABEL_IS_SC
    00964   END_INSN(pop);}}}
    00965 INSN_ENTRY(dup){
    00966 {
    00967   VALUE val2;
    00968   VALUE val1;
    00969
    00970   VALUE val = TOPN(0);
    00971   DEBUG_ENTER_INSN("dup");
    00972   ADD_PC(1+0);
    00973   PREFETCH(GET_PC());
    00974   POPN(1);
    00975   #define CURRENT_INSN_dup 1
    00976   #define INSN_IS_SC()     0
    00977   #define INSN_LABEL(lab)  LABEL_dup_##lab
    00978   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    00979   USAGE_ANALYSIS_INSN(BIN(dup));
    00980 {
    00981 #line 644 "insns.def"
    00982     val1 = val2 = val;
    00983
    00984 #line 985 "vm.inc"
    00985   CHECK_STACK_OVERFLOW(REG_CFP, 2);
    00986   PUSH(val1);
    00987   PUSH(val2);
    00988 #undef CURRENT_INSN_dup
    00989 #undef INSN_IS_SC
    00990 #undef INSN_LABEL
    00991 #undef LABEL_IS_SC
    00992   END_INSN(dup);}}}
    00993 INSN_ENTRY(dupn){
    00994 {
    00995   rb_num_t n = (rb_num_t)GET_OPERAND(1);
    00996
    00997   DEBUG_ENTER_INSN("dupn");
    00998   ADD_PC(1+1);
    00999   PREFETCH(GET_PC());
    01000   #define CURRENT_INSN_dupn 1
    01001   #define INSN_IS_SC()     0
    01002   #define INSN_LABEL(lab)  LABEL_dupn_##lab
    01003   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01004   USAGE_ANALYSIS_INSN(BIN(dupn));
    01005   USAGE_ANALYSIS_OPERAND(BIN(dupn), 0, n);
    01006 {
    01007 #line 658 "insns.def"
    01008     rb_num_t i;
    01009     VALUE *sp = STACK_ADDR_FROM_TOP(n);
    01010     for (i = 0; i < n; i++) {
    01011         GET_SP()[i] = sp[i];
    01012     }
    01013     INC_SP(n);
    01014
    01015 #line 1016 "vm.inc"
    01016 #undef CURRENT_INSN_dupn
    01017 #undef INSN_IS_SC
    01018 #undef INSN_LABEL
    01019 #undef LABEL_IS_SC
    01020   END_INSN(dupn);}}}
    01021 INSN_ENTRY(swap){
    01022 {
    01023
    01024   VALUE val = TOPN(1);
    01025   VALUE obj = TOPN(0);
    01026   DEBUG_ENTER_INSN("swap");
    01027   ADD_PC(1+0);
    01028   PREFETCH(GET_PC());
    01029   POPN(2);
    01030   #define CURRENT_INSN_swap 1
    01031   #define INSN_IS_SC()     0
    01032   #define INSN_LABEL(lab)  LABEL_swap_##lab
    01033   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01034   USAGE_ANALYSIS_INSN(BIN(swap));
    01035 {
    01036 #line 678 "insns.def"
    01037     /* none */
    01038
    01039 #line 1040 "vm.inc"
    01040   CHECK_STACK_OVERFLOW(REG_CFP, 2);
    01041   PUSH(obj);
    01042   PUSH(val);
    01043 #undef CURRENT_INSN_swap
    01044 #undef INSN_IS_SC
    01045 #undef INSN_LABEL
    01046 #undef LABEL_IS_SC
    01047   END_INSN(swap);}}}
    01048 INSN_ENTRY(reput){
    01049 {
    01050
    01051   VALUE val = TOPN(0);
    01052   DEBUG_ENTER_INSN("reput");
    01053   ADD_PC(1+0);
    01054   PREFETCH(GET_PC());
    01055   POPN(1);
    01056   #define CURRENT_INSN_reput 1
    01057   #define INSN_IS_SC()     0
    01058   #define INSN_LABEL(lab)  LABEL_reput_##lab
    01059   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01060   USAGE_ANALYSIS_INSN(BIN(reput));
    01061 {
    01062 #line 692 "insns.def"
    01063     /* none */
    01064
    01065 #line 1066 "vm.inc"
    01066   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    01067   PUSH(val);
    01068 #undef CURRENT_INSN_reput
    01069 #undef INSN_IS_SC
    01070 #undef INSN_LABEL
    01071 #undef LABEL_IS_SC
    01072   END_INSN(reput);}}}
    01073 INSN_ENTRY(topn){
    01074 {
    01075   VALUE val;
    01076   rb_num_t n = (rb_num_t)GET_OPERAND(1);
    01077
    01078   DEBUG_ENTER_INSN("topn");
    01079   ADD_PC(1+1);
    01080   PREFETCH(GET_PC());
    01081   #define CURRENT_INSN_topn 1
    01082   #define INSN_IS_SC()     0
    01083   #define INSN_LABEL(lab)  LABEL_topn_##lab
    01084   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01085   USAGE_ANALYSIS_INSN(BIN(topn));
    01086   USAGE_ANALYSIS_OPERAND(BIN(topn), 0, n);
    01087 {
    01088 #line 706 "insns.def"
    01089     val = TOPN(n);
    01090
    01091 #line 1092 "vm.inc"
    01092   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    01093   PUSH(val);
    01094 #undef CURRENT_INSN_topn
    01095 #undef INSN_IS_SC
    01096 #undef INSN_LABEL
    01097 #undef LABEL_IS_SC
    01098   END_INSN(topn);}}}
    01099 INSN_ENTRY(setn){
    01100 {
    01101   rb_num_t n = (rb_num_t)GET_OPERAND(1);
    01102   VALUE val = TOPN(0);
    01103   DEBUG_ENTER_INSN("setn");
    01104   ADD_PC(1+1);
    01105   PREFETCH(GET_PC());
    01106   POPN(1);
    01107   #define CURRENT_INSN_setn 1
    01108   #define INSN_IS_SC()     0
    01109   #define INSN_LABEL(lab)  LABEL_setn_##lab
    01110   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01111   USAGE_ANALYSIS_INSN(BIN(setn));
    01112   USAGE_ANALYSIS_OPERAND(BIN(setn), 0, n);
    01113 {
    01114 #line 720 "insns.def"
    01115     TOPN(n-1) = val;
    01116
    01117 #line 1118 "vm.inc"
    01118   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    01119   PUSH(val);
    01120 #undef CURRENT_INSN_setn
    01121 #undef INSN_IS_SC
    01122 #undef INSN_LABEL
    01123 #undef LABEL_IS_SC
    01124   END_INSN(setn);}}}
    01125 INSN_ENTRY(adjuststack){
    01126 {
    01127   rb_num_t n = (rb_num_t)GET_OPERAND(1);
    01128
    01129   DEBUG_ENTER_INSN("adjuststack");
    01130   ADD_PC(1+1);
    01131   PREFETCH(GET_PC());
    01132   #define CURRENT_INSN_adjuststack 1
    01133   #define INSN_IS_SC()     0
    01134   #define INSN_LABEL(lab)  LABEL_adjuststack_##lab
    01135   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01136   USAGE_ANALYSIS_INSN(BIN(adjuststack));
    01137   USAGE_ANALYSIS_OPERAND(BIN(adjuststack), 0, n);
    01138 {
    01139 #line 734 "insns.def"
    01140     DEC_SP(n);
    01141
    01142 #line 1143 "vm.inc"
    01143 #undef CURRENT_INSN_adjuststack
    01144 #undef INSN_IS_SC
    01145 #undef INSN_LABEL
    01146 #undef LABEL_IS_SC
    01147   END_INSN(adjuststack);}}}
    01148 INSN_ENTRY(defined){
    01149 {
    01150   VALUE val;
    01151   VALUE needstr = (VALUE)GET_OPERAND(3);
    01152   VALUE obj = (VALUE)GET_OPERAND(2);
    01153   rb_num_t type = (rb_num_t)GET_OPERAND(1);
    01154   VALUE v = TOPN(0);
    01155   DEBUG_ENTER_INSN("defined");
    01156   ADD_PC(1+3);
    01157   PREFETCH(GET_PC());
    01158   POPN(1);
    01159   #define CURRENT_INSN_defined 1
    01160   #define INSN_IS_SC()     0
    01161   #define INSN_LABEL(lab)  LABEL_defined_##lab
    01162   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01163   USAGE_ANALYSIS_INSN(BIN(defined));
    01164   USAGE_ANALYSIS_OPERAND(BIN(defined), 0, type);
    01165   USAGE_ANALYSIS_OPERAND(BIN(defined), 1, obj);
    01166   USAGE_ANALYSIS_OPERAND(BIN(defined), 2, needstr);
    01167 {
    01168 #line 753 "insns.def"
    01169     VALUE klass;
    01170     const char *expr_type = 0;
    01171     val = Qnil;
    01172
    01173     switch (type) {
    01174       case DEFINED_IVAR:
    01175         if (rb_ivar_defined(GET_SELF(), SYM2ID(obj))) {
    01176             expr_type = "instance-variable";
    01177         }
    01178         break;
    01179       case DEFINED_IVAR2:
    01180         klass = vm_get_cbase(GET_ISEQ(), GET_LFP(), GET_DFP());
    01181         break;
    01182       case DEFINED_GVAR:
    01183         if (rb_gvar_defined(rb_global_entry(SYM2ID(obj)))) {
    01184             expr_type = "global-variable";
    01185         }
    01186         break;
    01187       case DEFINED_CVAR:
    01188         klass = vm_get_cbase(GET_ISEQ(), GET_LFP(), GET_DFP());
    01189         if (rb_cvar_defined(klass, SYM2ID(obj))) {
    01190             expr_type = "class variable";
    01191         }
    01192         break;
    01193       case DEFINED_CONST:
    01194         klass = v;
    01195         if (vm_get_ev_const(th, GET_ISEQ(), klass, SYM2ID(obj), 1)) {
    01196             expr_type = "constant";
    01197         }
    01198         break;
    01199       case DEFINED_FUNC:
    01200         klass = CLASS_OF(v);
    01201         if (rb_method_boundp(klass, SYM2ID(obj), 0)) {
    01202             expr_type = "method";
    01203         }
    01204         break;
    01205       case DEFINED_METHOD:{
    01206         VALUE klass = CLASS_OF(v);
    01207         const rb_method_entry_t *me = rb_method_entry(klass, SYM2ID(obj));
    01208
    01209         if (me) {
    01210             if (!(me->flag & NOEX_PRIVATE)) {
    01211                 if (!((me->flag & NOEX_PROTECTED) &&
    01212                       !rb_obj_is_kind_of(GET_SELF(),
    01213                                          rb_class_real(klass)))) {
    01214                     expr_type = "method";
    01215                 }
    01216             }
    01217         }
    01218         {
    01219             VALUE args[2];
    01220             VALUE r;
    01221
    01222             args[0] = obj; args[1] = Qfalse;
    01223             r = rb_check_funcall(v, rb_intern("respond_to_missing?"), 2, args);
    01224             if (r != Qundef && RTEST(r))
    01225                 expr_type = "method";
    01226         }
    01227         break;
    01228       }
    01229       case DEFINED_YIELD:
    01230         if (GET_BLOCK_PTR()) {
    01231             expr_type = "yield";
    01232         }
    01233         break;
    01234       case DEFINED_ZSUPER:{
    01235         rb_iseq_t *ip = GET_ISEQ();
    01236         while (ip) {
    01237             if (ip->defined_method_id) {
    01238                 break;
    01239             }
    01240             ip = ip->parent_iseq;
    01241         }
    01242         if (ip) {
    01243             VALUE klass = vm_search_normal_superclass(ip->klass, GET_SELF());
    01244             if (rb_method_boundp(klass, ip->defined_method_id, 0)) {
    01245                 expr_type = "super";
    01246             }
    01247         }
    01248         break;
    01249       }
    01250       case DEFINED_REF:{
    01251         val = vm_getspecial(th, GET_LFP(), Qfalse, FIX2INT(obj));
    01252         if (val != Qnil) {
    01253             expr_type = "global-variable";
    01254         }
    01255         break;
    01256       }
    01257       default:
    01258         rb_bug("unimplemented defined? type (VM)");
    01259         break;
    01260     }
    01261     if (expr_type != 0) {
    01262         if (needstr != Qfalse) {
    01263             val = rb_str_new2(expr_type);
    01264         }
    01265         else {
    01266             val = Qtrue;
    01267         }
    01268     }
    01269
    01270 #line 1271 "vm.inc"
    01271   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    01272   PUSH(val);
    01273 #undef CURRENT_INSN_defined
    01274 #undef INSN_IS_SC
    01275 #undef INSN_LABEL
    01276 #undef LABEL_IS_SC
    01277   END_INSN(defined);}}}
    01278 INSN_ENTRY(trace){
    01279 {
    01280   rb_num_t nf = (rb_num_t)GET_OPERAND(1);
    01281
    01282   DEBUG_ENTER_INSN("trace");
    01283   ADD_PC(1+1);
    01284   PREFETCH(GET_PC());
    01285   #define CURRENT_INSN_trace 1
    01286   #define INSN_IS_SC()     0
    01287   #define INSN_LABEL(lab)  LABEL_trace_##lab
    01288   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01289   USAGE_ANALYSIS_INSN(BIN(trace));
    01290   USAGE_ANALYSIS_OPERAND(BIN(trace), 0, nf);
    01291 {
    01292 #line 866 "insns.def"
    01293     rb_event_flag_t flag = (rb_event_flag_t)nf;
    01294
    01295     EXEC_EVENT_HOOK(th, flag, GET_SELF(), 0, 0 /* TODO: id, klass */);
    01296
    01297 #line 1298 "vm.inc"
    01298 #undef CURRENT_INSN_trace
    01299 #undef INSN_IS_SC
    01300 #undef INSN_LABEL
    01301 #undef LABEL_IS_SC
    01302   END_INSN(trace);}}}
    01303 INSN_ENTRY(defineclass){
    01304 {
    01305   VALUE val;
    01306   rb_num_t define_type = (rb_num_t)GET_OPERAND(3);
    01307   ISEQ class_iseq = (ISEQ)GET_OPERAND(2);
    01308   ID id = (ID)GET_OPERAND(1);
    01309   VALUE cbase = TOPN(1);
    01310   VALUE super = TOPN(0);
    01311   DEBUG_ENTER_INSN("defineclass");
    01312   ADD_PC(1+3);
    01313   PREFETCH(GET_PC());
    01314   POPN(2);
    01315   #define CURRENT_INSN_defineclass 1
    01316   #define INSN_IS_SC()     0
    01317   #define INSN_LABEL(lab)  LABEL_defineclass_##lab
    01318   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01319   USAGE_ANALYSIS_INSN(BIN(defineclass));
    01320   USAGE_ANALYSIS_OPERAND(BIN(defineclass), 0, id);
    01321   USAGE_ANALYSIS_OPERAND(BIN(defineclass), 1, class_iseq);
    01322   USAGE_ANALYSIS_OPERAND(BIN(defineclass), 2, define_type);
    01323 {
    01324 #line 890 "insns.def"
    01325     VALUE klass;
    01326
    01327     switch ((int)define_type) {
    01328       case 0:
    01329         /* val is dummy.  classdef returns class scope value */
    01330
    01331         if (super == Qnil) {
    01332             super = rb_cObject;
    01333         }
    01334
    01335         vm_check_if_namespace(cbase);
    01336
    01337         /* find klass */
    01338         rb_autoload_load(cbase, id);
    01339         if (rb_const_defined_at(cbase, id)) {
    01340             /* already exist */
    01341             klass = rb_const_get_at(cbase, id);
    01342             if (TYPE(klass) != T_CLASS) {
    01343                 rb_raise(rb_eTypeError, "%s is not a class", rb_id2name(id));
    01344             }
    01345
    01346             if (super != rb_cObject) {
    01347                 VALUE tmp;
    01348                 tmp = rb_class_real(RCLASS_SUPER(klass));
    01349
    01350                 if (tmp != super) {
    01351                     rb_raise(rb_eTypeError, "superclass mismatch for class %s",
    01352                              rb_id2name(id));
    01353                 }
    01354             }
    01355         }
    01356         else {
    01357             /* new class declaration */
    01358             klass = rb_define_class_id(id, super);
    01359             rb_set_class_path_string(klass, cbase, rb_id2str(id));
    01360             rb_const_set(cbase, id, klass);
    01361             rb_class_inherited(super, klass);
    01362         }
    01363         break;
    01364       case 1:
    01365         /* val is dummy.  classdef returns class scope value */
    01366         /* super is dummy */
    01367         klass = rb_singleton_class(cbase);
    01368         break;
    01369       case 2:
    01370         /* val is dummy.  classdef returns class scope value */
    01371         /* super is dummy */
    01372
    01373         vm_check_if_namespace(cbase);
    01374
    01375         /* find klass */
    01376         if (rb_const_defined_at(cbase, id)) {
    01377             klass = rb_const_get_at(cbase, id);
    01378             /* already exist */
    01379             if (TYPE(klass) != T_MODULE) {
    01380                 rb_raise(rb_eTypeError, "%s is not a module", rb_id2name(id));
    01381             }
    01382         }
    01383         else {
    01384             /* new module declaration */
    01385             klass = rb_define_module_id(id);
    01386             rb_set_class_path_string(klass, cbase, rb_id2str(id));
    01387             rb_const_set(cbase, id, klass);
    01388         }
    01389         break;
    01390       default:
    01391         rb_bug("unknown defineclass type: %d", (int)define_type);
    01392     }
    01393
    01394     COPY_CREF(class_iseq->cref_stack, vm_cref_push(th, klass, NOEX_PUBLIC, NULL));
    01395
    01396     /* enter scope */
    01397     vm_push_frame(th, class_iseq,
    01398                   VM_FRAME_MAGIC_CLASS, klass, (VALUE) GET_BLOCK_PTR(),
    01399                   class_iseq->iseq_encoded, GET_SP(), 0,
    01400                   class_iseq->local_size);
    01401     RESTORE_REGS();
    01402
    01403     INC_VM_STATE_VERSION();
    01404     NEXT_INSN();
    01405
    01406 #line 1407 "vm.inc"
    01407   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    01408   PUSH(val);
    01409 #undef CURRENT_INSN_defineclass
    01410 #undef INSN_IS_SC
    01411 #undef INSN_LABEL
    01412 #undef LABEL_IS_SC
    01413   END_INSN(defineclass);}}}
    01414 INSN_ENTRY(send){
    01415 {
    01416   VALUE val;
    01417   IC ic = (IC)GET_OPERAND(5);
    01418   rb_num_t op_flag = (rb_num_t)GET_OPERAND(4);
    01419   ISEQ blockiseq = (ISEQ)GET_OPERAND(3);
    01420   rb_num_t op_argc = (rb_num_t)GET_OPERAND(2);
    01421   ID op_id = (ID)GET_OPERAND(1);
    01422
    01423   DEBUG_ENTER_INSN("send");
    01424   ADD_PC(1+5);
    01425   PREFETCH(GET_PC());
    01426   #define CURRENT_INSN_send 1
    01427   #define INSN_IS_SC()     0
    01428   #define INSN_LABEL(lab)  LABEL_send_##lab
    01429   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01430   USAGE_ANALYSIS_INSN(BIN(send));
    01431   USAGE_ANALYSIS_OPERAND(BIN(send), 0, op_id);
    01432   USAGE_ANALYSIS_OPERAND(BIN(send), 1, op_argc);
    01433   USAGE_ANALYSIS_OPERAND(BIN(send), 2, blockiseq);
    01434   USAGE_ANALYSIS_OPERAND(BIN(send), 3, op_flag);
    01435   USAGE_ANALYSIS_OPERAND(BIN(send), 4, ic);
    01436 {
    01437 #line 994 "insns.def"
    01438     const rb_method_entry_t *me;
    01439     VALUE recv, klass;
    01440     rb_block_t *blockptr = 0;
    01441     int num = caller_setup_args(th, GET_CFP(), op_flag, (int)op_argc,
    01442                                 (rb_iseq_t *)blockiseq, &blockptr);
    01443     rb_num_t flag = op_flag;
    01444     ID id = op_id;
    01445
    01446     /* get receiver */
    01447     recv = (flag & VM_CALL_FCALL_BIT) ? GET_SELF() : TOPN(num);
    01448     klass = CLASS_OF(recv);
    01449     me = vm_method_search(id, klass, ic);
    01450     CALL_METHOD(num, blockptr, flag, id, me, recv);
    01451
    01452 #line 1453 "vm.inc"
    01453   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    01454   PUSH(val);
    01455 #undef CURRENT_INSN_send
    01456 #undef INSN_IS_SC
    01457 #undef INSN_LABEL
    01458 #undef LABEL_IS_SC
    01459   END_INSN(send);}}}
    01460 INSN_ENTRY(invokesuper){
    01461 {
    01462   VALUE val;
    01463   rb_num_t op_flag = (rb_num_t)GET_OPERAND(3);
    01464   ISEQ blockiseq = (ISEQ)GET_OPERAND(2);
    01465   rb_num_t op_argc = (rb_num_t)GET_OPERAND(1);
    01466
    01467   DEBUG_ENTER_INSN("invokesuper");
    01468   ADD_PC(1+3);
    01469   PREFETCH(GET_PC());
    01470   #define CURRENT_INSN_invokesuper 1
    01471   #define INSN_IS_SC()     0
    01472   #define INSN_LABEL(lab)  LABEL_invokesuper_##lab
    01473   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01474   USAGE_ANALYSIS_INSN(BIN(invokesuper));
    01475   USAGE_ANALYSIS_OPERAND(BIN(invokesuper), 0, op_argc);
    01476   USAGE_ANALYSIS_OPERAND(BIN(invokesuper), 1, blockiseq);
    01477   USAGE_ANALYSIS_OPERAND(BIN(invokesuper), 2, op_flag);
    01478 {
    01479 #line 1022 "insns.def"
    01480     rb_block_t *blockptr = !(op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? GET_BLOCK_PTR() : 0;
    01481     int num = caller_setup_args(th, GET_CFP(), op_flag,
    01482                                 (int)op_argc, blockiseq, &blockptr);
    01483     VALUE recv, klass;
    01484     ID id;
    01485     VALUE flag = VM_CALL_SUPER_BIT | VM_CALL_FCALL_BIT;
    01486     const rb_method_entry_t *me;
    01487
    01488     recv = GET_SELF();
    01489     vm_search_superclass(GET_CFP(), GET_ISEQ(), recv, TOPN(num), &id, &klass);
    01490
    01491     /* temporary measure for [Bug #2402] [Bug #2502] [Bug #3136] */
    01492     if (!rb_obj_is_kind_of(recv, klass)) {
    01493         rb_raise(rb_eNotImpError, "super from singleton method that is defined to multiple classes is not supported; this will be fixed in 1.9.3 or later");
    01494     }
    01495
    01496     me = rb_method_entry(klass, id);
    01497
    01498     CALL_METHOD(num, blockptr, flag, id, me, recv);
    01499
    01500 #line 1501 "vm.inc"
    01501   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    01502   PUSH(val);
    01503 #undef CURRENT_INSN_invokesuper
    01504 #undef INSN_IS_SC
    01505 #undef INSN_LABEL
    01506 #undef LABEL_IS_SC
    01507   END_INSN(invokesuper);}}}
    01508 INSN_ENTRY(invokeblock){
    01509 {
    01510   VALUE val;
    01511   rb_num_t flag = (rb_num_t)GET_OPERAND(2);
    01512   rb_num_t num = (rb_num_t)GET_OPERAND(1);
    01513
    01514   DEBUG_ENTER_INSN("invokeblock");
    01515   ADD_PC(1+2);
    01516   PREFETCH(GET_PC());
    01517   #define CURRENT_INSN_invokeblock 1
    01518   #define INSN_IS_SC()     0
    01519   #define INSN_LABEL(lab)  LABEL_invokeblock_##lab
    01520   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01521   USAGE_ANALYSIS_INSN(BIN(invokeblock));
    01522   USAGE_ANALYSIS_OPERAND(BIN(invokeblock), 0, num);
    01523   USAGE_ANALYSIS_OPERAND(BIN(invokeblock), 1, flag);
    01524 {
    01525 #line 1055 "insns.def"
    01526     val = vm_invoke_block(th, GET_CFP(), num, flag);
    01527     if (val == Qundef) {
    01528         RESTORE_REGS();
    01529         NEXT_INSN();
    01530     }
    01531
    01532 #line 1533 "vm.inc"
    01533   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    01534   PUSH(val);
    01535 #undef CURRENT_INSN_invokeblock
    01536 #undef INSN_IS_SC
    01537 #undef INSN_LABEL
    01538 #undef LABEL_IS_SC
    01539   END_INSN(invokeblock);}}}
    01540 INSN_ENTRY(leave){
    01541 {
    01542
    01543   VALUE val = TOPN(0);
    01544   DEBUG_ENTER_INSN("leave");
    01545   ADD_PC(1+0);
    01546   PREFETCH(GET_PC());
    01547   POPN(1);
    01548   #define CURRENT_INSN_leave 1
    01549   #define INSN_IS_SC()     0
    01550   #define INSN_LABEL(lab)  LABEL_leave_##lab
    01551   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01552   USAGE_ANALYSIS_INSN(BIN(leave));
    01553 {
    01554 #line 1073 "insns.def"
    01555     if (OPT_CHECKED_RUN) {
    01556         if (reg_cfp->sp != reg_cfp->bp) {
    01557             rb_bug("Stack consistency error (sp: %"PRIdPTRDIFF", bp: %"PRIdPTRDIFF")",
    01558                    VM_SP_CNT(th, reg_cfp->sp), VM_SP_CNT(th, reg_cfp->bp));
    01559         }
    01560     }
    01561
    01562     RUBY_VM_CHECK_INTS();
    01563     vm_pop_frame(th);
    01564     RESTORE_REGS();
    01565
    01566 #line 1567 "vm.inc"
    01567   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    01568   PUSH(val);
    01569 #undef CURRENT_INSN_leave
    01570 #undef INSN_IS_SC
    01571 #undef INSN_LABEL
    01572 #undef LABEL_IS_SC
    01573   END_INSN(leave);}}}
    01574 INSN_ENTRY(finish){
    01575 {
    01576
    01577   VALUE val = TOPN(0);
    01578   DEBUG_ENTER_INSN("finish");
    01579   ADD_PC(1+0);
    01580   PREFETCH(GET_PC());
    01581   POPN(1);
    01582   #define CURRENT_INSN_finish 1
    01583   #define INSN_IS_SC()     0
    01584   #define INSN_LABEL(lab)  LABEL_finish_##lab
    01585   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01586   USAGE_ANALYSIS_INSN(BIN(finish));
    01587 {
    01588 #line 1096 "insns.def"
    01589 #if OPT_CALL_THREADED_CODE
    01590     rb_bug("unused instruction on OPT_CALL_THREADED_CODE");
    01591 #else
    01592     th->cfp++;
    01593     return val;
    01594 #endif
    01595
    01596 #line 1597 "vm.inc"
    01597   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    01598   PUSH(val);
    01599 #undef CURRENT_INSN_finish
    01600 #undef INSN_IS_SC
    01601 #undef INSN_LABEL
    01602 #undef LABEL_IS_SC
    01603   END_INSN(finish);}}}
    01604 INSN_ENTRY(throw){
    01605 {
    01606   VALUE val;
    01607   rb_num_t throw_state = (rb_num_t)GET_OPERAND(1);
    01608   VALUE throwobj = TOPN(0);
    01609   DEBUG_ENTER_INSN("throw");
    01610   ADD_PC(1+1);
    01611   PREFETCH(GET_PC());
    01612   POPN(1);
    01613   #define CURRENT_INSN_throw 1
    01614   #define INSN_IS_SC()     0
    01615   #define INSN_LABEL(lab)  LABEL_throw_##lab
    01616   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01617   USAGE_ANALYSIS_INSN(BIN(throw));
    01618   USAGE_ANALYSIS_OPERAND(BIN(throw), 0, throw_state);
    01619 {
    01620 #line 1119 "insns.def"
    01621     RUBY_VM_CHECK_INTS();
    01622     val = vm_throw(th, GET_CFP(), throw_state, throwobj);
    01623     THROW_EXCEPTION(val);
    01624     /* unreachable */
    01625
    01626 #line 1627 "vm.inc"
    01627   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    01628   PUSH(val);
    01629 #undef CURRENT_INSN_throw
    01630 #undef INSN_IS_SC
    01631 #undef INSN_LABEL
    01632 #undef LABEL_IS_SC
    01633   END_INSN(throw);}}}
    01634 INSN_ENTRY(jump){
    01635 {
    01636   OFFSET dst = (OFFSET)GET_OPERAND(1);
    01637
    01638   DEBUG_ENTER_INSN("jump");
    01639   ADD_PC(1+1);
    01640   PREFETCH(GET_PC());
    01641   #define CURRENT_INSN_jump 1
    01642   #define INSN_IS_SC()     0
    01643   #define INSN_LABEL(lab)  LABEL_jump_##lab
    01644   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01645   USAGE_ANALYSIS_INSN(BIN(jump));
    01646   USAGE_ANALYSIS_OPERAND(BIN(jump), 0, dst);
    01647 {
    01648 #line 1140 "insns.def"
    01649     RUBY_VM_CHECK_INTS();
    01650     JUMP(dst);
    01651
    01652 #line 1653 "vm.inc"
    01653 #undef CURRENT_INSN_jump
    01654 #undef INSN_IS_SC
    01655 #undef INSN_LABEL
    01656 #undef LABEL_IS_SC
    01657   END_INSN(jump);}}}
    01658 INSN_ENTRY(branchif){
    01659 {
    01660   OFFSET dst = (OFFSET)GET_OPERAND(1);
    01661   VALUE val = TOPN(0);
    01662   DEBUG_ENTER_INSN("branchif");
    01663   ADD_PC(1+1);
    01664   PREFETCH(GET_PC());
    01665   POPN(1);
    01666   #define CURRENT_INSN_branchif 1
    01667   #define INSN_IS_SC()     0
    01668   #define INSN_LABEL(lab)  LABEL_branchif_##lab
    01669   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01670   USAGE_ANALYSIS_INSN(BIN(branchif));
    01671   USAGE_ANALYSIS_OPERAND(BIN(branchif), 0, dst);
    01672 {
    01673 #line 1155 "insns.def"
    01674     if (RTEST(val)) {
    01675         RUBY_VM_CHECK_INTS();
    01676         JUMP(dst);
    01677     }
    01678
    01679 #line 1680 "vm.inc"
    01680 #undef CURRENT_INSN_branchif
    01681 #undef INSN_IS_SC
    01682 #undef INSN_LABEL
    01683 #undef LABEL_IS_SC
    01684   END_INSN(branchif);}}}
    01685 INSN_ENTRY(branchunless){
    01686 {
    01687   OFFSET dst = (OFFSET)GET_OPERAND(1);
    01688   VALUE val = TOPN(0);
    01689   DEBUG_ENTER_INSN("branchunless");
    01690   ADD_PC(1+1);
    01691   PREFETCH(GET_PC());
    01692   POPN(1);
    01693   #define CURRENT_INSN_branchunless 1
    01694   #define INSN_IS_SC()     0
    01695   #define INSN_LABEL(lab)  LABEL_branchunless_##lab
    01696   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01697   USAGE_ANALYSIS_INSN(BIN(branchunless));
    01698   USAGE_ANALYSIS_OPERAND(BIN(branchunless), 0, dst);
    01699 {
    01700 #line 1172 "insns.def"
    01701     if (!RTEST(val)) {
    01702         RUBY_VM_CHECK_INTS();
    01703         JUMP(dst);
    01704     }
    01705
    01706 #line 1707 "vm.inc"
    01707 #undef CURRENT_INSN_branchunless
    01708 #undef INSN_IS_SC
    01709 #undef INSN_LABEL
    01710 #undef LABEL_IS_SC
    01711   END_INSN(branchunless);}}}
    01712 INSN_ENTRY(getinlinecache){
    01713 {
    01714   VALUE val;
    01715   IC ic = (IC)GET_OPERAND(2);
    01716   OFFSET dst = (OFFSET)GET_OPERAND(1);
    01717
    01718   DEBUG_ENTER_INSN("getinlinecache");
    01719   ADD_PC(1+2);
    01720   PREFETCH(GET_PC());
    01721   #define CURRENT_INSN_getinlinecache 1
    01722   #define INSN_IS_SC()     0
    01723   #define INSN_LABEL(lab)  LABEL_getinlinecache_##lab
    01724   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01725   USAGE_ANALYSIS_INSN(BIN(getinlinecache));
    01726   USAGE_ANALYSIS_OPERAND(BIN(getinlinecache), 0, dst);
    01727   USAGE_ANALYSIS_OPERAND(BIN(getinlinecache), 1, ic);
    01728 {
    01729 #line 1194 "insns.def"
    01730     if (ic->ic_vmstat == GET_VM_STATE_VERSION()) {
    01731         val = ic->ic_value.value;
    01732         JUMP(dst);
    01733     }
    01734     else {
    01735         /* none */
    01736         val = Qnil;
    01737     }
    01738
    01739 #line 1740 "vm.inc"
    01740   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    01741   PUSH(val);
    01742 #undef CURRENT_INSN_getinlinecache
    01743 #undef INSN_IS_SC
    01744 #undef INSN_LABEL
    01745 #undef LABEL_IS_SC
    01746   END_INSN(getinlinecache);}}}
    01747 INSN_ENTRY(onceinlinecache){
    01748 {
    01749   VALUE val;
    01750   IC ic = (IC)GET_OPERAND(2);
    01751   OFFSET dst = (OFFSET)GET_OPERAND(1);
    01752
    01753   DEBUG_ENTER_INSN("onceinlinecache");
    01754   ADD_PC(1+2);
    01755   PREFETCH(GET_PC());
    01756   #define CURRENT_INSN_onceinlinecache 1
    01757   #define INSN_IS_SC()     0
    01758   #define INSN_LABEL(lab)  LABEL_onceinlinecache_##lab
    01759   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01760   USAGE_ANALYSIS_INSN(BIN(onceinlinecache));
    01761   USAGE_ANALYSIS_OPERAND(BIN(onceinlinecache), 0, dst);
    01762   USAGE_ANALYSIS_OPERAND(BIN(onceinlinecache), 1, ic);
    01763 {
    01764 #line 1215 "insns.def"
    01765   retry:
    01766     if (ic->ic_vmstat) {
    01767         val = ic->ic_value.value;
    01768         JUMP(dst);
    01769     }
    01770     else if (ic->ic_value.value == Qundef)
    01771     {
    01772         RUBY_VM_CHECK_INTS();
    01773         rb_thread_schedule();
    01774         goto retry;
    01775     }
    01776     else {
    01777         /* none */
    01778         ic->ic_value.value = Qundef;
    01779         val = Qnil;
    01780     }
    01781
    01782 #line 1783 "vm.inc"
    01783   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    01784   PUSH(val);
    01785 #undef CURRENT_INSN_onceinlinecache
    01786 #undef INSN_IS_SC
    01787 #undef INSN_LABEL
    01788 #undef LABEL_IS_SC
    01789   END_INSN(onceinlinecache);}}}
    01790 INSN_ENTRY(setinlinecache){
    01791 {
    01792   IC ic = (IC)GET_OPERAND(1);
    01793   VALUE val = TOPN(0);
    01794   DEBUG_ENTER_INSN("setinlinecache");
    01795   ADD_PC(1+1);
    01796   PREFETCH(GET_PC());
    01797   POPN(1);
    01798   #define CURRENT_INSN_setinlinecache 1
    01799   #define INSN_IS_SC()     0
    01800   #define INSN_LABEL(lab)  LABEL_setinlinecache_##lab
    01801   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01802   USAGE_ANALYSIS_INSN(BIN(setinlinecache));
    01803   USAGE_ANALYSIS_OPERAND(BIN(setinlinecache), 0, ic);
    01804 {
    01805 #line 1244 "insns.def"
    01806     if (ic->ic_value.value == Qundef) {
    01807         rb_ary_push(GET_ISEQ()->mark_ary, val);
    01808     }
    01809     ic->ic_value.value = val;
    01810     ic->ic_vmstat = GET_VM_STATE_VERSION() - ruby_vm_const_missing_count;
    01811     ruby_vm_const_missing_count = 0;
    01812
    01813 #line 1814 "vm.inc"
    01814   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    01815   PUSH(val);
    01816 #undef CURRENT_INSN_setinlinecache
    01817 #undef INSN_IS_SC
    01818 #undef INSN_LABEL
    01819 #undef LABEL_IS_SC
    01820   END_INSN(setinlinecache);}}}
    01821 INSN_ENTRY(opt_case_dispatch){
    01822 {
    01823   OFFSET else_offset = (OFFSET)GET_OPERAND(2);
    01824   CDHASH hash = (CDHASH)GET_OPERAND(1);
    01825   VALUE key = TOPN(0);
    01826   DEBUG_ENTER_INSN("opt_case_dispatch");
    01827   ADD_PC(1+2);
    01828   PREFETCH(GET_PC());
    01829   POPN(1);
    01830   #define CURRENT_INSN_opt_case_dispatch 1
    01831   #define INSN_IS_SC()     0
    01832   #define INSN_LABEL(lab)  LABEL_opt_case_dispatch_##lab
    01833   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01834   USAGE_ANALYSIS_INSN(BIN(opt_case_dispatch));
    01835   USAGE_ANALYSIS_OPERAND(BIN(opt_case_dispatch), 0, hash);
    01836   USAGE_ANALYSIS_OPERAND(BIN(opt_case_dispatch), 1, else_offset);
    01837 {
    01838 #line 1263 "insns.def"
    01839     if (BASIC_OP_UNREDEFINED_P(BOP_EQQ)) {
    01840         VALUE val;
    01841         if (st_lookup(RHASH_TBL(hash), key, &val)) {
    01842             JUMP(FIX2INT(val));
    01843         }
    01844         else {
    01845             JUMP(else_offset);
    01846         }
    01847     }
    01848     else {
    01849         struct opt_case_dispatch_i_arg arg;
    01850
    01851         arg.obj = key;
    01852         arg.label = -1;
    01853         st_foreach(RHASH_TBL(hash), opt_case_dispatch_i, (st_data_t)&arg);
    01854
    01855         if (arg.label != -1) {
    01856             JUMP(arg.label);
    01857         }
    01858         else {
    01859             JUMP(else_offset);
    01860         }
    01861     }
    01862
    01863 #line 1864 "vm.inc"
    01864 #undef CURRENT_INSN_opt_case_dispatch
    01865 #undef INSN_IS_SC
    01866 #undef INSN_LABEL
    01867 #undef LABEL_IS_SC
    01868   END_INSN(opt_case_dispatch);}}}
    01869 INSN_ENTRY(opt_checkenv){
    01870 {
    01871
    01872
    01873   DEBUG_ENTER_INSN("opt_checkenv");
    01874   ADD_PC(1+0);
    01875   PREFETCH(GET_PC());
    01876   #define CURRENT_INSN_opt_checkenv 1
    01877   #define INSN_IS_SC()     0
    01878   #define INSN_LABEL(lab)  LABEL_opt_checkenv_##lab
    01879   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01880   USAGE_ANALYSIS_INSN(BIN(opt_checkenv));
    01881 {
    01882 #line 1299 "insns.def"
    01883     if (GET_CFP()->bp != GET_DFP() + 1) {
    01884         VALUE *new_dfp = GET_CFP()->bp - 1;
    01885         /* TODO: copy env and clean stack at creating env? */
    01886         *new_dfp = *GET_DFP();
    01887         SET_DFP(new_dfp);
    01888     }
    01889
    01890 #line 1891 "vm.inc"
    01891 #undef CURRENT_INSN_opt_checkenv
    01892 #undef INSN_IS_SC
    01893 #undef INSN_LABEL
    01894 #undef LABEL_IS_SC
    01895   END_INSN(opt_checkenv);}}}
    01896 INSN_ENTRY(opt_plus){
    01897 {
    01898   VALUE val;
    01899   IC ic = (IC)GET_OPERAND(1);
    01900   VALUE recv = TOPN(1);
    01901   VALUE obj = TOPN(0);
    01902   DEBUG_ENTER_INSN("opt_plus");
    01903   ADD_PC(1+1);
    01904   PREFETCH(GET_PC());
    01905   POPN(2);
    01906   #define CURRENT_INSN_opt_plus 1
    01907   #define INSN_IS_SC()     0
    01908   #define INSN_LABEL(lab)  LABEL_opt_plus_##lab
    01909   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    01910   USAGE_ANALYSIS_INSN(BIN(opt_plus));
    01911   USAGE_ANALYSIS_OPERAND(BIN(opt_plus), 0, ic);
    01912 {
    01913 #line 1321 "insns.def"
    01914     if (0) {
    01915
    01916     }
    01917 #if 1
    01918     else if (FIXNUM_2_P(recv, obj) &&
    01919              BASIC_OP_UNREDEFINED_P(BOP_PLUS)) {
    01920         /* fixnum + fixnum */
    01921 #ifndef LONG_LONG_VALUE
    01922         val = (recv + (obj & (~1)));
    01923         if ((~(recv ^ obj) & (recv ^ val)) &
    01924             ((VALUE)0x01 << ((sizeof(VALUE) * CHAR_BIT) - 1))) {
    01925             val = rb_big_plus(rb_int2big(FIX2LONG(recv)),
    01926                               rb_int2big(FIX2LONG(obj)));
    01927         }
    01928 #else
    01929         long a, b, c;
    01930         a = FIX2LONG(recv);
    01931         b = FIX2LONG(obj);
    01932         c = a + b;
    01933         if (FIXABLE(c)) {
    01934             val = LONG2FIX(c);
    01935         }
    01936         else {
    01937             val = rb_big_plus(rb_int2big(a), rb_int2big(b));
    01938         }
    01939 #endif
    01940     }
    01941 #endif
    01942
    01943     else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
    01944         if (0) {
    01945         }
    01946 #if 1
    01947         else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
    01948                  HEAP_CLASS_OF(obj) == rb_cFloat &&
    01949                  BASIC_OP_UNREDEFINED_P(BOP_PLUS)) {
    01950             val = DBL2NUM(RFLOAT_VALUE(recv) + RFLOAT_VALUE(obj));
    01951         }
    01952 #endif
    01953
    01954 #if 1
    01955         else if (HEAP_CLASS_OF(recv) == rb_cString &&
    01956                  HEAP_CLASS_OF(obj) == rb_cString &&
    01957                  BASIC_OP_UNREDEFINED_P(BOP_PLUS)) {
    01958             val = rb_str_plus(recv, obj);
    01959         }
    01960 #endif
    01961 #if 1
    01962         else if (HEAP_CLASS_OF(recv) == rb_cArray &&
    01963                  BASIC_OP_UNREDEFINED_P(BOP_PLUS)) {
    01964             val = rb_ary_plus(recv, obj);
    01965         }
    01966 #endif
    01967         else {
    01968             goto INSN_LABEL(normal_dispatch);
    01969         }
    01970     }
    01971     else {
    01972       INSN_LABEL(normal_dispatch):
    01973         PUSH(recv);
    01974         PUSH(obj);
    01975         CALL_SIMPLE_METHOD(1, idPLUS, recv);
    01976     }
    01977
    01978 #line 1979 "vm.inc"
    01979   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    01980   PUSH(val);
    01981 #undef CURRENT_INSN_opt_plus
    01982 #undef INSN_IS_SC
    01983 #undef INSN_LABEL
    01984 #undef LABEL_IS_SC
    01985   END_INSN(opt_plus);}}}
    01986 INSN_ENTRY(opt_minus){
    01987 {
    01988   VALUE val;
    01989   IC ic = (IC)GET_OPERAND(1);
    01990   VALUE recv = TOPN(1);
    01991   VALUE obj = TOPN(0);
    01992   DEBUG_ENTER_INSN("opt_minus");
    01993   ADD_PC(1+1);
    01994   PREFETCH(GET_PC());
    01995   POPN(2);
    01996   #define CURRENT_INSN_opt_minus 1
    01997   #define INSN_IS_SC()     0
    01998   #define INSN_LABEL(lab)  LABEL_opt_minus_##lab
    01999   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    02000   USAGE_ANALYSIS_INSN(BIN(opt_minus));
    02001   USAGE_ANALYSIS_OPERAND(BIN(opt_minus), 0, ic);
    02002 {
    02003 #line 1397 "insns.def"
    02004     if (FIXNUM_2_P(recv, obj) &&
    02005         BASIC_OP_UNREDEFINED_P(BOP_MINUS)) {
    02006         long a, b, c;
    02007
    02008         a = FIX2LONG(recv);
    02009         b = FIX2LONG(obj);
    02010         c = a - b;
    02011
    02012         if (FIXABLE(c)) {
    02013             val = LONG2FIX(c);
    02014         }
    02015         else {
    02016             val = rb_big_minus(rb_int2big(a), rb_int2big(b));
    02017         }
    02018     }
    02019     else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
    02020         if (0) {
    02021         }
    02022 #if 1
    02023         else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
    02024                  HEAP_CLASS_OF(obj) == rb_cFloat  &&
    02025                  BASIC_OP_UNREDEFINED_P(BOP_MINUS)) {
    02026             val = DBL2NUM(RFLOAT_VALUE(recv) - RFLOAT_VALUE(obj));
    02027         }
    02028 #endif
    02029         else {
    02030             goto INSN_LABEL(normal_dispatch);
    02031         }
    02032     }
    02033     else {
    02034         /* other */
    02035       INSN_LABEL(normal_dispatch):
    02036         PUSH(recv);
    02037         PUSH(obj);
    02038         CALL_SIMPLE_METHOD(1, idMINUS, recv);
    02039     }
    02040
    02041 #line 2042 "vm.inc"
    02042   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    02043   PUSH(val);
    02044 #undef CURRENT_INSN_opt_minus
    02045 #undef INSN_IS_SC
    02046 #undef INSN_LABEL
    02047 #undef LABEL_IS_SC
    02048   END_INSN(opt_minus);}}}
    02049 INSN_ENTRY(opt_mult){
    02050 {
    02051   VALUE val;
    02052   IC ic = (IC)GET_OPERAND(1);
    02053   VALUE recv = TOPN(1);
    02054   VALUE obj = TOPN(0);
    02055   DEBUG_ENTER_INSN("opt_mult");
    02056   ADD_PC(1+1);
    02057   PREFETCH(GET_PC());
    02058   POPN(2);
    02059   #define CURRENT_INSN_opt_mult 1
    02060   #define INSN_IS_SC()     0
    02061   #define INSN_LABEL(lab)  LABEL_opt_mult_##lab
    02062   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    02063   USAGE_ANALYSIS_INSN(BIN(opt_mult));
    02064   USAGE_ANALYSIS_OPERAND(BIN(opt_mult), 0, ic);
    02065 {
    02066 #line 1446 "insns.def"
    02067     if (FIXNUM_2_P(recv, obj) &&
    02068         BASIC_OP_UNREDEFINED_P(BOP_MULT)) {
    02069         long a, b, c;
    02070
    02071         a = FIX2LONG(recv);
    02072         if (a == 0) {
    02073             val = recv;
    02074         }
    02075         else {
    02076             b = FIX2LONG(obj);
    02077             c = a * b;
    02078
    02079             if (FIXABLE(c) && c / a == b) {
    02080                 val = LONG2FIX(c);
    02081             }
    02082             else {
    02083                 val = rb_big_mul(rb_int2big(a), rb_int2big(b));
    02084             }
    02085         }
    02086     }
    02087     else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
    02088         if (0) {
    02089         }
    02090 #if 1
    02091         else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
    02092                  HEAP_CLASS_OF(obj) == rb_cFloat  &&
    02093                  BASIC_OP_UNREDEFINED_P(BOP_MULT)) {
    02094             val = DBL2NUM(RFLOAT_VALUE(recv) * RFLOAT_VALUE(obj));
    02095         }
    02096 #endif
    02097         else {
    02098             goto INSN_LABEL(normal_dispatch);
    02099         }
    02100     }
    02101     else {
    02102       INSN_LABEL(normal_dispatch):
    02103         PUSH(recv);
    02104         PUSH(obj);
    02105         CALL_SIMPLE_METHOD(1, idMULT, recv);
    02106     }
    02107
    02108 #line 2109 "vm.inc"
    02109   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    02110   PUSH(val);
    02111 #undef CURRENT_INSN_opt_mult
    02112 #undef INSN_IS_SC
    02113 #undef INSN_LABEL
    02114 #undef LABEL_IS_SC
    02115   END_INSN(opt_mult);}}}
    02116 INSN_ENTRY(opt_div){
    02117 {
    02118   VALUE val;
    02119   IC ic = (IC)GET_OPERAND(1);
    02120   VALUE recv = TOPN(1);
    02121   VALUE obj = TOPN(0);
    02122   DEBUG_ENTER_INSN("opt_div");
    02123   ADD_PC(1+1);
    02124   PREFETCH(GET_PC());
    02125   POPN(2);
    02126   #define CURRENT_INSN_opt_div 1
    02127   #define INSN_IS_SC()     0
    02128   #define INSN_LABEL(lab)  LABEL_opt_div_##lab
    02129   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    02130   USAGE_ANALYSIS_INSN(BIN(opt_div));
    02131   USAGE_ANALYSIS_OPERAND(BIN(opt_div), 0, ic);
    02132 {
    02133 #line 1499 "insns.def"
    02134     if (FIXNUM_2_P(recv, obj) &&
    02135         BASIC_OP_UNREDEFINED_P(BOP_DIV)) {
    02136         long x, y, div;
    02137
    02138         x = FIX2LONG(recv);
    02139         y = FIX2LONG(obj);
    02140         {
    02141             /* copied from numeric.c#fixdivmod */
    02142             long mod;
    02143             if (y == 0)
    02144                 goto INSN_LABEL(normal_dispatch);
    02145             if (y < 0) {
    02146                 if (x < 0)
    02147                     div = -x / -y;
    02148                 else
    02149                     div = -(x / -y);
    02150             }
    02151             else {
    02152                 if (x < 0)
    02153                     div = -(-x / y);
    02154                 else
    02155                     div = x / y;
    02156             }
    02157             mod = x - div * y;
    02158             if ((mod < 0 && y > 0) || (mod > 0 && y < 0)) {
    02159                 mod += y;
    02160                 div -= 1;
    02161             }
    02162         }
    02163         val = LONG2NUM(div);
    02164     }
    02165     else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
    02166         if (0) {
    02167         }
    02168 #if 1
    02169         else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
    02170                  HEAP_CLASS_OF(obj) == rb_cFloat  &&
    02171                  BASIC_OP_UNREDEFINED_P(BOP_DIV)) {
    02172             val = DBL2NUM(RFLOAT_VALUE(recv) / RFLOAT_VALUE(obj));
    02173         }
    02174 #endif
    02175         else {
    02176             goto INSN_LABEL(normal_dispatch);
    02177         }
    02178     }
    02179     else {
    02180       INSN_LABEL(normal_dispatch):
    02181         PUSH(recv);
    02182         PUSH(obj);
    02183         CALL_SIMPLE_METHOD(1, idDIV, recv);
    02184     }
    02185
    02186 #line 2187 "vm.inc"
    02187   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    02188   PUSH(val);
    02189 #undef CURRENT_INSN_opt_div
    02190 #undef INSN_IS_SC
    02191 #undef INSN_LABEL
    02192 #undef LABEL_IS_SC
    02193   END_INSN(opt_div);}}}
    02194 INSN_ENTRY(opt_mod){
    02195 {
    02196   VALUE val;
    02197   IC ic = (IC)GET_OPERAND(1);
    02198   VALUE recv = TOPN(1);
    02199   VALUE obj = TOPN(0);
    02200   DEBUG_ENTER_INSN("opt_mod");
    02201   ADD_PC(1+1);
    02202   PREFETCH(GET_PC());
    02203   POPN(2);
    02204   #define CURRENT_INSN_opt_mod 1
    02205   #define INSN_IS_SC()     0
    02206   #define INSN_LABEL(lab)  LABEL_opt_mod_##lab
    02207   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    02208   USAGE_ANALYSIS_INSN(BIN(opt_mod));
    02209   USAGE_ANALYSIS_OPERAND(BIN(opt_mod), 0, ic);
    02210 {
    02211 #line 1563 "insns.def"
    02212     if (FIXNUM_2_P(recv, obj) &&
    02213         BASIC_OP_UNREDEFINED_P(BOP_MOD)) {
    02214         long x, y, mod;
    02215
    02216         x = FIX2LONG(recv);
    02217         y = FIX2LONG(obj);
    02218         {
    02219             /* copied from numeric.c#fixdivmod */
    02220             long div;
    02221
    02222             if (y == 0)
    02223                 rb_num_zerodiv();
    02224             if (y < 0) {
    02225                 if (x < 0)
    02226                     div = -x / -y;
    02227                 else
    02228                     div = -(x / -y);
    02229             }
    02230             else {
    02231                 if (x < 0)
    02232                     div = -(-x / y);
    02233                 else
    02234                     div = x / y;
    02235             }
    02236             mod = x - div * y;
    02237             if ((mod < 0 && y > 0) || (mod > 0 && y < 0)) {
    02238                 mod += y;
    02239                 div -= 1;
    02240             }
    02241         }
    02242         val = LONG2FIX(mod);
    02243     }
    02244     else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
    02245         if (0) {
    02246         }
    02247         else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
    02248                  HEAP_CLASS_OF(obj) == rb_cFloat &&
    02249                  BASIC_OP_UNREDEFINED_P(BOP_MOD)) {
    02250             double x = RFLOAT_VALUE(recv);
    02251             double y = RFLOAT_VALUE(obj);
    02252             double div, mod;
    02253
    02254             {
    02255                 double z;
    02256
    02257                 modf(x / y, &z);
    02258                 mod = x - z * y;
    02259             }
    02260
    02261             div = (x - mod) / y;
    02262             if (y * mod < 0) {
    02263                 mod += y;
    02264                 div -= 1.0;
    02265             }
    02266             val = DBL2NUM(mod);
    02267         }
    02268         else {
    02269             goto INSN_LABEL(normal_dispatch);
    02270         }
    02271     }
    02272     else {
    02273       INSN_LABEL(normal_dispatch):
    02274         PUSH(recv);
    02275         PUSH(obj);
    02276         CALL_SIMPLE_METHOD(1, idMOD, recv);
    02277     }
    02278
    02279 #line 2280 "vm.inc"
    02280   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    02281   PUSH(val);
    02282 #undef CURRENT_INSN_opt_mod
    02283 #undef INSN_IS_SC
    02284 #undef INSN_LABEL
    02285 #undef LABEL_IS_SC
    02286   END_INSN(opt_mod);}}}
    02287 INSN_ENTRY(opt_eq){
    02288 {
    02289   VALUE val;
    02290   IC ic = (IC)GET_OPERAND(1);
    02291   VALUE recv = TOPN(1);
    02292   VALUE obj = TOPN(0);
    02293   DEBUG_ENTER_INSN("opt_eq");
    02294   ADD_PC(1+1);
    02295   PREFETCH(GET_PC());
    02296   POPN(2);
    02297   #define CURRENT_INSN_opt_eq 1
    02298   #define INSN_IS_SC()     0
    02299   #define INSN_LABEL(lab)  LABEL_opt_eq_##lab
    02300   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    02301   USAGE_ANALYSIS_INSN(BIN(opt_eq));
    02302   USAGE_ANALYSIS_OPERAND(BIN(opt_eq), 0, ic);
    02303 {
    02304 #line 1642 "insns.def"
    02305     val = opt_eq_func(recv, obj, ic);
    02306
    02307     if (val == Qundef) {
    02308         /* other */
    02309         PUSH(recv);
    02310         PUSH(obj);
    02311         CALL_SIMPLE_METHOD(1, idEq, recv);
    02312     }
    02313
    02314 #line 2315 "vm.inc"
    02315   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    02316   PUSH(val);
    02317 #undef CURRENT_INSN_opt_eq
    02318 #undef INSN_IS_SC
    02319 #undef INSN_LABEL
    02320 #undef LABEL_IS_SC
    02321   END_INSN(opt_eq);}}}
    02322 INSN_ENTRY(opt_neq){
    02323 {
    02324   VALUE val;
    02325   IC ic_eq = (IC)GET_OPERAND(2);
    02326   IC ic = (IC)GET_OPERAND(1);
    02327   VALUE recv = TOPN(1);
    02328   VALUE obj = TOPN(0);
    02329   DEBUG_ENTER_INSN("opt_neq");
    02330   ADD_PC(1+2);
    02331   PREFETCH(GET_PC());
    02332   POPN(2);
    02333   #define CURRENT_INSN_opt_neq 1
    02334   #define INSN_IS_SC()     0
    02335   #define INSN_LABEL(lab)  LABEL_opt_neq_##lab
    02336   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    02337   USAGE_ANALYSIS_INSN(BIN(opt_neq));
    02338   USAGE_ANALYSIS_OPERAND(BIN(opt_neq), 0, ic);
    02339   USAGE_ANALYSIS_OPERAND(BIN(opt_neq), 1, ic_eq);
    02340 {
    02341 #line 1663 "insns.def"
    02342     extern VALUE rb_obj_not_equal(VALUE obj1, VALUE obj2);
    02343     const rb_method_entry_t *me = vm_method_search(idNeq, CLASS_OF(recv), ic);
    02344     val = Qundef;
    02345
    02346     if (check_cfunc(me, rb_obj_not_equal)) {
    02347         val = opt_eq_func(recv, obj, ic_eq);
    02348
    02349         if (val != Qundef) {
    02350             val = RTEST(val) ? Qfalse : Qtrue;
    02351         }
    02352     }
    02353
    02354     if (val == Qundef) {
    02355         /* other */
    02356         PUSH(recv);
    02357         PUSH(obj);
    02358         CALL_SIMPLE_METHOD(1, idNeq, recv);
    02359     }
    02360
    02361 #line 2362 "vm.inc"
    02362   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    02363   PUSH(val);
    02364 #undef CURRENT_INSN_opt_neq
    02365 #undef INSN_IS_SC
    02366 #undef INSN_LABEL
    02367 #undef LABEL_IS_SC
    02368   END_INSN(opt_neq);}}}
    02369 INSN_ENTRY(opt_lt){
    02370 {
    02371   VALUE val;
    02372   IC ic = (IC)GET_OPERAND(1);
    02373   VALUE recv = TOPN(1);
    02374   VALUE obj = TOPN(0);
    02375   DEBUG_ENTER_INSN("opt_lt");
    02376   ADD_PC(1+1);
    02377   PREFETCH(GET_PC());
    02378   POPN(2);
    02379   #define CURRENT_INSN_opt_lt 1
    02380   #define INSN_IS_SC()     0
    02381   #define INSN_LABEL(lab)  LABEL_opt_lt_##lab
    02382   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    02383   USAGE_ANALYSIS_INSN(BIN(opt_lt));
    02384   USAGE_ANALYSIS_OPERAND(BIN(opt_lt), 0, ic);
    02385 {
    02386 #line 1694 "insns.def"
    02387     if (FIXNUM_2_P(recv, obj) &&
    02388         BASIC_OP_UNREDEFINED_P(BOP_LT)) {
    02389         SIGNED_VALUE a = recv, b = obj;
    02390
    02391         if (a < b) {
    02392             val = Qtrue;
    02393         }
    02394         else {
    02395             val = Qfalse;
    02396         }
    02397     }
    02398     else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
    02399         if (0) {
    02400         }
    02401 #if 1
    02402         else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
    02403                  HEAP_CLASS_OF(obj) == rb_cFloat  &&
    02404                  BASIC_OP_UNREDEFINED_P(BOP_LT)) {
    02405             double a = RFLOAT_VALUE(recv);
    02406             double b = RFLOAT_VALUE(obj);
    02407 #if defined(_MSC_VER) && _MSC_VER < 1300
    02408             if (isnan(a) || isnan(b)) val = Qfalse;
    02409             else
    02410 #endif
    02411             val = a < b ? Qtrue : Qfalse;
    02412         }
    02413 #endif
    02414         else {
    02415             goto INSN_LABEL(normal_dispatch);
    02416         }
    02417     }
    02418     else {
    02419       INSN_LABEL(normal_dispatch):
    02420         PUSH(recv);
    02421         PUSH(obj);
    02422         CALL_SIMPLE_METHOD(1, idLT, recv);
    02423     }
    02424
    02425 #line 2426 "vm.inc"
    02426   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    02427   PUSH(val);
    02428 #undef CURRENT_INSN_opt_lt
    02429 #undef INSN_IS_SC
    02430 #undef INSN_LABEL
    02431 #undef LABEL_IS_SC
    02432   END_INSN(opt_lt);}}}
    02433 INSN_ENTRY(opt_le){
    02434 {
    02435   VALUE val;
    02436   IC ic = (IC)GET_OPERAND(1);
    02437   VALUE recv = TOPN(1);
    02438   VALUE obj = TOPN(0);
    02439   DEBUG_ENTER_INSN("opt_le");
    02440   ADD_PC(1+1);
    02441   PREFETCH(GET_PC());
    02442   POPN(2);
    02443   #define CURRENT_INSN_opt_le 1
    02444   #define INSN_IS_SC()     0
    02445   #define INSN_LABEL(lab)  LABEL_opt_le_##lab
    02446   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    02447   USAGE_ANALYSIS_INSN(BIN(opt_le));
    02448   USAGE_ANALYSIS_OPERAND(BIN(opt_le), 0, ic);
    02449 {
    02450 #line 1744 "insns.def"
    02451     if (FIXNUM_2_P(recv, obj) &&
    02452         BASIC_OP_UNREDEFINED_P(BOP_LE)) {
    02453         SIGNED_VALUE a = recv, b = obj;
    02454
    02455         if (a <= b) {
    02456             val = Qtrue;
    02457         }
    02458         else {
    02459             val = Qfalse;
    02460         }
    02461     }
    02462     else {
    02463         /* other */
    02464         PUSH(recv);
    02465         PUSH(obj);
    02466         CALL_SIMPLE_METHOD(1, idLE, recv);
    02467     }
    02468
    02469 #line 2470 "vm.inc"
    02470   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    02471   PUSH(val);
    02472 #undef CURRENT_INSN_opt_le
    02473 #undef INSN_IS_SC
    02474 #undef INSN_LABEL
    02475 #undef LABEL_IS_SC
    02476   END_INSN(opt_le);}}}
    02477 INSN_ENTRY(opt_gt){
    02478 {
    02479   VALUE val;
    02480   IC ic = (IC)GET_OPERAND(1);
    02481   VALUE recv = TOPN(1);
    02482   VALUE obj = TOPN(0);
    02483   DEBUG_ENTER_INSN("opt_gt");
    02484   ADD_PC(1+1);
    02485   PREFETCH(GET_PC());
    02486   POPN(2);
    02487   #define CURRENT_INSN_opt_gt 1
    02488   #define INSN_IS_SC()     0
    02489   #define INSN_LABEL(lab)  LABEL_opt_gt_##lab
    02490   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    02491   USAGE_ANALYSIS_INSN(BIN(opt_gt));
    02492   USAGE_ANALYSIS_OPERAND(BIN(opt_gt), 0, ic);
    02493 {
    02494 #line 1774 "insns.def"
    02495     if (FIXNUM_2_P(recv, obj) &&
    02496         BASIC_OP_UNREDEFINED_P(BOP_GT)) {
    02497         SIGNED_VALUE a = recv, b = obj;
    02498
    02499         if (a > b) {
    02500             val = Qtrue;
    02501         }
    02502         else {
    02503             val = Qfalse;
    02504         }
    02505     }
    02506     else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
    02507         if (0) {
    02508         }
    02509 #if 1
    02510         else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
    02511                  HEAP_CLASS_OF(obj) == rb_cFloat  &&
    02512                  BASIC_OP_UNREDEFINED_P(BOP_GT)) {
    02513             double a = RFLOAT_VALUE(recv);
    02514             double b = RFLOAT_VALUE(obj);
    02515 #if defined(_MSC_VER) && _MSC_VER < 1300
    02516             if (isnan(a) || isnan(b)) val = Qfalse;
    02517             else
    02518 #endif
    02519             val = a > b ? Qtrue : Qfalse;
    02520         }
    02521 #endif
    02522         else {
    02523             goto INSN_LABEL(normal_dispatch);
    02524         }
    02525     }
    02526     else {
    02527       INSN_LABEL(normal_dispatch):
    02528         PUSH(recv);
    02529         PUSH(obj);
    02530         CALL_SIMPLE_METHOD(1, idGT, recv);
    02531     }
    02532
    02533 #line 2534 "vm.inc"
    02534   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    02535   PUSH(val);
    02536 #undef CURRENT_INSN_opt_gt
    02537 #undef INSN_IS_SC
    02538 #undef INSN_LABEL
    02539 #undef LABEL_IS_SC
    02540   END_INSN(opt_gt);}}}
    02541 INSN_ENTRY(opt_ge){
    02542 {
    02543   VALUE val;
    02544   IC ic = (IC)GET_OPERAND(1);
    02545   VALUE recv = TOPN(1);
    02546   VALUE obj = TOPN(0);
    02547   DEBUG_ENTER_INSN("opt_ge");
    02548   ADD_PC(1+1);
    02549   PREFETCH(GET_PC());
    02550   POPN(2);
    02551   #define CURRENT_INSN_opt_ge 1
    02552   #define INSN_IS_SC()     0
    02553   #define INSN_LABEL(lab)  LABEL_opt_ge_##lab
    02554   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    02555   USAGE_ANALYSIS_INSN(BIN(opt_ge));
    02556   USAGE_ANALYSIS_OPERAND(BIN(opt_ge), 0, ic);
    02557 {
    02558 #line 1824 "insns.def"
    02559     if (FIXNUM_2_P(recv, obj) &&
    02560         BASIC_OP_UNREDEFINED_P(BOP_GE)) {
    02561         SIGNED_VALUE a = recv, b = obj;
    02562
    02563         if (a >= b) {
    02564             val = Qtrue;
    02565         }
    02566         else {
    02567             val = Qfalse;
    02568         }
    02569     }
    02570     else {
    02571         PUSH(recv);
    02572         PUSH(obj);
    02573         CALL_SIMPLE_METHOD(1, idGE, recv);
    02574     }
    02575
    02576 #line 2577 "vm.inc"
    02577   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    02578   PUSH(val);
    02579 #undef CURRENT_INSN_opt_ge
    02580 #undef INSN_IS_SC
    02581 #undef INSN_LABEL
    02582 #undef LABEL_IS_SC
    02583   END_INSN(opt_ge);}}}
    02584 INSN_ENTRY(opt_ltlt){
    02585 {
    02586   VALUE val;
    02587   IC ic = (IC)GET_OPERAND(1);
    02588   VALUE recv = TOPN(1);
    02589   VALUE obj = TOPN(0);
    02590   DEBUG_ENTER_INSN("opt_ltlt");
    02591   ADD_PC(1+1);
    02592   PREFETCH(GET_PC());
    02593   POPN(2);
    02594   #define CURRENT_INSN_opt_ltlt 1
    02595   #define INSN_IS_SC()     0
    02596   #define INSN_LABEL(lab)  LABEL_opt_ltlt_##lab
    02597   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    02598   USAGE_ANALYSIS_INSN(BIN(opt_ltlt));
    02599   USAGE_ANALYSIS_OPERAND(BIN(opt_ltlt), 0, ic);
    02600 {
    02601 #line 1853 "insns.def"
    02602     if (!SPECIAL_CONST_P(recv)) {
    02603         if (0) {
    02604         }
    02605         else if (HEAP_CLASS_OF(recv) == rb_cString &&
    02606                  BASIC_OP_UNREDEFINED_P(BOP_LTLT)) {
    02607             val = rb_str_concat(recv, obj);
    02608         }
    02609         else if (HEAP_CLASS_OF(recv) == rb_cArray &&
    02610                  BASIC_OP_UNREDEFINED_P(BOP_LTLT)) {
    02611             val = rb_ary_push(recv, obj);
    02612         }
    02613         else {
    02614             goto INSN_LABEL(normal_dispatch);
    02615         }
    02616     }
    02617     else {
    02618       INSN_LABEL(normal_dispatch):
    02619         PUSH(recv);
    02620         PUSH(obj);
    02621         CALL_SIMPLE_METHOD(1, idLTLT, recv);
    02622     }
    02623
    02624 #line 2625 "vm.inc"
    02625   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    02626   PUSH(val);
    02627 #undef CURRENT_INSN_opt_ltlt
    02628 #undef INSN_IS_SC
    02629 #undef INSN_LABEL
    02630 #undef LABEL_IS_SC
    02631   END_INSN(opt_ltlt);}}}
    02632 INSN_ENTRY(opt_aref){
    02633 {
    02634   VALUE val;
    02635   IC ic = (IC)GET_OPERAND(1);
    02636   VALUE recv = TOPN(1);
    02637   VALUE obj = TOPN(0);
    02638   DEBUG_ENTER_INSN("opt_aref");
    02639   ADD_PC(1+1);
    02640   PREFETCH(GET_PC());
    02641   POPN(2);
    02642   #define CURRENT_INSN_opt_aref 1
    02643   #define INSN_IS_SC()     0
    02644   #define INSN_LABEL(lab)  LABEL_opt_aref_##lab
    02645   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    02646   USAGE_ANALYSIS_INSN(BIN(opt_aref));
    02647   USAGE_ANALYSIS_OPERAND(BIN(opt_aref), 0, ic);
    02648 {
    02649 #line 1887 "insns.def"
    02650     if (!SPECIAL_CONST_P(recv) && BASIC_OP_UNREDEFINED_P(BOP_AREF)) {
    02651         if (HEAP_CLASS_OF(recv) == rb_cArray && FIXNUM_P(obj)) {
    02652             val = rb_ary_entry(recv, FIX2LONG(obj));
    02653         }
    02654         else if (HEAP_CLASS_OF(recv) == rb_cHash) {
    02655             val = rb_hash_aref(recv, obj);
    02656         }
    02657         else {
    02658             goto INSN_LABEL(normal_dispatch);
    02659         }
    02660     }
    02661     else {
    02662       INSN_LABEL(normal_dispatch):
    02663         PUSH(recv);
    02664         PUSH(obj);
    02665         CALL_SIMPLE_METHOD(1, idAREF, recv);
    02666     }
    02667
    02668 #line 2669 "vm.inc"
    02669   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    02670   PUSH(val);
    02671 #undef CURRENT_INSN_opt_aref
    02672 #undef INSN_IS_SC
    02673 #undef INSN_LABEL
    02674 #undef LABEL_IS_SC
    02675   END_INSN(opt_aref);}}}
    02676 INSN_ENTRY(opt_aset){
    02677 {
    02678   VALUE val;
    02679   IC ic = (IC)GET_OPERAND(1);
    02680   VALUE recv = TOPN(2);
    02681   VALUE obj = TOPN(1);
    02682   VALUE set = TOPN(0);
    02683   DEBUG_ENTER_INSN("opt_aset");
    02684   ADD_PC(1+1);
    02685   PREFETCH(GET_PC());
    02686   POPN(3);
    02687   #define CURRENT_INSN_opt_aset 1
    02688   #define INSN_IS_SC()     0
    02689   #define INSN_LABEL(lab)  LABEL_opt_aset_##lab
    02690   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    02691   USAGE_ANALYSIS_INSN(BIN(opt_aset));
    02692   USAGE_ANALYSIS_OPERAND(BIN(opt_aset), 0, ic);
    02693 {
    02694 #line 1917 "insns.def"
    02695     if (!SPECIAL_CONST_P(recv) &&
    02696         BASIC_OP_UNREDEFINED_P(BOP_ASET)) {
    02697         if (HEAP_CLASS_OF(recv) == rb_cArray && FIXNUM_P(obj)) {
    02698             rb_ary_store(recv, FIX2LONG(obj), set);
    02699             val = set;
    02700         }
    02701         else if (HEAP_CLASS_OF(recv) == rb_cHash) {
    02702             rb_hash_aset(recv, obj, set);
    02703             val = set;
    02704         }
    02705         else {
    02706             goto INSN_LABEL(normal_dispatch);
    02707         }
    02708     }
    02709     else {
    02710       INSN_LABEL(normal_dispatch):
    02711         PUSH(recv);
    02712         PUSH(obj);
    02713         PUSH(set);
    02714         CALL_SIMPLE_METHOD(2, idASET, recv);
    02715     }
    02716
    02717 #line 2718 "vm.inc"
    02718   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    02719   PUSH(val);
    02720 #undef CURRENT_INSN_opt_aset
    02721 #undef INSN_IS_SC
    02722 #undef INSN_LABEL
    02723 #undef LABEL_IS_SC
    02724   END_INSN(opt_aset);}}}
    02725 INSN_ENTRY(opt_length){
    02726 {
    02727   VALUE val;
    02728   IC ic = (IC)GET_OPERAND(1);
    02729   VALUE recv = TOPN(0);
    02730   DEBUG_ENTER_INSN("opt_length");
    02731   ADD_PC(1+1);
    02732   PREFETCH(GET_PC());
    02733   POPN(1);
    02734   #define CURRENT_INSN_opt_length 1
    02735   #define INSN_IS_SC()     0
    02736   #define INSN_LABEL(lab)  LABEL_opt_length_##lab
    02737   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    02738   USAGE_ANALYSIS_INSN(BIN(opt_length));
    02739   USAGE_ANALYSIS_OPERAND(BIN(opt_length), 0, ic);
    02740 {
    02741 #line 1951 "insns.def"
    02742     if (LIKELY(!SPECIAL_CONST_P(recv) &&
    02743                BASIC_OP_UNREDEFINED_P(BOP_LENGTH))) {
    02744         if (HEAP_CLASS_OF(recv) == rb_cString) {
    02745             val = rb_str_length(recv);
    02746         }
    02747         else if (HEAP_CLASS_OF(recv) == rb_cArray) {
    02748             val = LONG2NUM(RARRAY_LEN(recv));
    02749         }
    02750         else if (HEAP_CLASS_OF(recv) == rb_cHash) {
    02751             val = INT2FIX(RHASH_SIZE(recv));
    02752         }
    02753         else {
    02754             goto INSN_LABEL(normal_dispatch);
    02755         }
    02756     }
    02757     else {
    02758       INSN_LABEL(normal_dispatch):
    02759         PUSH(recv);
    02760         CALL_SIMPLE_METHOD(0, idLength, recv);
    02761     }
    02762
    02763 #line 2764 "vm.inc"
    02764   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    02765   PUSH(val);
    02766 #undef CURRENT_INSN_opt_length
    02767 #undef INSN_IS_SC
    02768 #undef INSN_LABEL
    02769 #undef LABEL_IS_SC
    02770   END_INSN(opt_length);}}}
    02771 INSN_ENTRY(opt_size){
    02772 {
    02773   VALUE val;
    02774   IC ic = (IC)GET_OPERAND(1);
    02775   VALUE recv = TOPN(0);
    02776   DEBUG_ENTER_INSN("opt_size");
    02777   ADD_PC(1+1);
    02778   PREFETCH(GET_PC());
    02779   POPN(1);
    02780   #define CURRENT_INSN_opt_size 1
    02781   #define INSN_IS_SC()     0
    02782   #define INSN_LABEL(lab)  LABEL_opt_size_##lab
    02783   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    02784   USAGE_ANALYSIS_INSN(BIN(opt_size));
    02785   USAGE_ANALYSIS_OPERAND(BIN(opt_size), 0, ic);
    02786 {
    02787 #line 1984 "insns.def"
    02788     if (LIKELY(BASIC_OP_UNREDEFINED_P(BOP_SIZE) &&
    02789                !SPECIAL_CONST_P(recv))) {
    02790         if (HEAP_CLASS_OF(recv) == rb_cString) {
    02791             val = rb_str_length(recv);
    02792         }
    02793         else if (HEAP_CLASS_OF(recv) == rb_cArray) {
    02794             val = LONG2NUM(RARRAY_LEN(recv));
    02795         }
    02796         else if (HEAP_CLASS_OF(recv) == rb_cHash) {
    02797             val = INT2FIX(RHASH_SIZE(recv));
    02798         }
    02799         else {
    02800             goto INSN_LABEL(normal_dispatch);
    02801         }
    02802     }
    02803     else {
    02804       INSN_LABEL(normal_dispatch):
    02805         PUSH(recv);
    02806         CALL_SIMPLE_METHOD(0, idSize, recv);
    02807     }
    02808
    02809 #line 2810 "vm.inc"
    02810   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    02811   PUSH(val);
    02812 #undef CURRENT_INSN_opt_size
    02813 #undef INSN_IS_SC
    02814 #undef INSN_LABEL
    02815 #undef LABEL_IS_SC
    02816   END_INSN(opt_size);}}}
    02817 INSN_ENTRY(opt_succ){
    02818 {
    02819   VALUE val;
    02820   IC ic = (IC)GET_OPERAND(1);
    02821   VALUE recv = TOPN(0);
    02822   DEBUG_ENTER_INSN("opt_succ");
    02823   ADD_PC(1+1);
    02824   PREFETCH(GET_PC());
    02825   POPN(1);
    02826   #define CURRENT_INSN_opt_succ 1
    02827   #define INSN_IS_SC()     0
    02828   #define INSN_LABEL(lab)  LABEL_opt_succ_##lab
    02829   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    02830   USAGE_ANALYSIS_INSN(BIN(opt_succ));
    02831   USAGE_ANALYSIS_OPERAND(BIN(opt_succ), 0, ic);
    02832 {
    02833 #line 2017 "insns.def"
    02834     if (SPECIAL_CONST_P(recv)) {
    02835         if (FIXNUM_P(recv) &&
    02836             BASIC_OP_UNREDEFINED_P(BOP_SUCC)) {
    02837             const VALUE obj = INT2FIX(1);
    02838             /* fixnum + INT2FIX(1) */
    02839             val = (recv + (obj & (~1)));
    02840             if ((~(recv ^ obj) & (recv ^ val)) & ((unsigned long)LONG_MAX + 1)) {
    02841                 val = rb_big_plus(rb_int2big(FIX2LONG(recv)),
    02842                                   rb_int2big(FIX2LONG(obj)));
    02843             }
    02844         }
    02845         else {
    02846             goto INSN_LABEL(normal_dispatch);
    02847         }
    02848     }
    02849     else {
    02850         if (HEAP_CLASS_OF(recv) == rb_cString &&
    02851             BASIC_OP_UNREDEFINED_P(BOP_SUCC)) {
    02852             val = rb_str_succ(recv);
    02853         }
    02854         else if (HEAP_CLASS_OF(recv) == rb_cTime &&
    02855                  BASIC_OP_UNREDEFINED_P(BOP_SUCC)) {
    02856             val = rb_time_succ(recv);
    02857         }
    02858         else
    02859           {
    02860             goto INSN_LABEL(normal_dispatch);
    02861         }
    02862     }
    02863     if (0) {
    02864       INSN_LABEL(normal_dispatch):
    02865         PUSH(recv);
    02866         CALL_SIMPLE_METHOD(0, idSucc, recv);
    02867     }
    02868
    02869 #line 2870 "vm.inc"
    02870   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    02871   PUSH(val);
    02872 #undef CURRENT_INSN_opt_succ
    02873 #undef INSN_IS_SC
    02874 #undef INSN_LABEL
    02875 #undef LABEL_IS_SC
    02876   END_INSN(opt_succ);}}}
    02877 INSN_ENTRY(opt_not){
    02878 {
    02879   VALUE val;
    02880   IC ic = (IC)GET_OPERAND(1);
    02881   VALUE recv = TOPN(0);
    02882   DEBUG_ENTER_INSN("opt_not");
    02883   ADD_PC(1+1);
    02884   PREFETCH(GET_PC());
    02885   POPN(1);
    02886   #define CURRENT_INSN_opt_not 1
    02887   #define INSN_IS_SC()     0
    02888   #define INSN_LABEL(lab)  LABEL_opt_not_##lab
    02889   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    02890   USAGE_ANALYSIS_INSN(BIN(opt_not));
    02891   USAGE_ANALYSIS_OPERAND(BIN(opt_not), 0, ic);
    02892 {
    02893 #line 2064 "insns.def"
    02894     extern VALUE rb_obj_not(VALUE obj);
    02895     const rb_method_entry_t *me = vm_method_search(idNot, CLASS_OF(recv), ic);
    02896
    02897     if (check_cfunc(me, rb_obj_not)) {
    02898         val = RTEST(recv) ? Qfalse : Qtrue;
    02899     }
    02900     else {
    02901         PUSH(recv);
    02902         CALL_SIMPLE_METHOD(0, idNot, recv);
    02903     }
    02904
    02905 #line 2906 "vm.inc"
    02906   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    02907   PUSH(val);
    02908 #undef CURRENT_INSN_opt_not
    02909 #undef INSN_IS_SC
    02910 #undef INSN_LABEL
    02911 #undef LABEL_IS_SC
    02912   END_INSN(opt_not);}}}
    02913 INSN_ENTRY(opt_regexpmatch1){
    02914 {
    02915   VALUE val;
    02916   VALUE r = (VALUE)GET_OPERAND(1);
    02917   VALUE obj = TOPN(0);
    02918   DEBUG_ENTER_INSN("opt_regexpmatch1");
    02919   ADD_PC(1+1);
    02920   PREFETCH(GET_PC());
    02921   POPN(1);
    02922   #define CURRENT_INSN_opt_regexpmatch1 1
    02923   #define INSN_IS_SC()     0
    02924   #define INSN_LABEL(lab)  LABEL_opt_regexpmatch1_##lab
    02925   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    02926   USAGE_ANALYSIS_INSN(BIN(opt_regexpmatch1));
    02927   USAGE_ANALYSIS_OPERAND(BIN(opt_regexpmatch1), 0, r);
    02928 {
    02929 #line 2088 "insns.def"
    02930     val = rb_reg_match(r, obj);
    02931
    02932 #line 2933 "vm.inc"
    02933   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    02934   PUSH(val);
    02935 #undef CURRENT_INSN_opt_regexpmatch1
    02936 #undef INSN_IS_SC
    02937 #undef INSN_LABEL
    02938 #undef LABEL_IS_SC
    02939   END_INSN(opt_regexpmatch1);}}}
    02940 INSN_ENTRY(opt_regexpmatch2){
    02941 {
    02942   VALUE val;
    02943
    02944   VALUE obj2 = TOPN(1);
    02945   VALUE obj1 = TOPN(0);
    02946   DEBUG_ENTER_INSN("opt_regexpmatch2");
    02947   ADD_PC(1+0);
    02948   PREFETCH(GET_PC());
    02949   POPN(2);
    02950   #define CURRENT_INSN_opt_regexpmatch2 1
    02951   #define INSN_IS_SC()     0
    02952   #define INSN_LABEL(lab)  LABEL_opt_regexpmatch2_##lab
    02953   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    02954   USAGE_ANALYSIS_INSN(BIN(opt_regexpmatch2));
    02955 {
    02956 #line 2102 "insns.def"
    02957     if (TYPE(obj2) == T_STRING) {
    02958         val = rb_reg_match(obj1, obj2);
    02959     }
    02960     else {
    02961         val = rb_funcall(obj2, idEqTilde, 1, obj1);
    02962     }
    02963
    02964 #line 2965 "vm.inc"
    02965   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    02966   PUSH(val);
    02967 #undef CURRENT_INSN_opt_regexpmatch2
    02968 #undef INSN_IS_SC
    02969 #undef INSN_LABEL
    02970 #undef LABEL_IS_SC
    02971   END_INSN(opt_regexpmatch2);}}}
    02972 INSN_ENTRY(opt_call_c_function){
    02973 {
    02974   rb_insn_func_t funcptr = (rb_insn_func_t)GET_OPERAND(1);
    02975
    02976   DEBUG_ENTER_INSN("opt_call_c_function");
    02977   ADD_PC(1+1);
    02978   PREFETCH(GET_PC());
    02979   #define CURRENT_INSN_opt_call_c_function 1
    02980   #define INSN_IS_SC()     0
    02981   #define INSN_LABEL(lab)  LABEL_opt_call_c_function_##lab
    02982   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    02983   USAGE_ANALYSIS_INSN(BIN(opt_call_c_function));
    02984   USAGE_ANALYSIS_OPERAND(BIN(opt_call_c_function), 0, funcptr);
    02985 {
    02986 #line 2121 "insns.def"
    02987     reg_cfp = (funcptr)(th, reg_cfp);
    02988
    02989     if (reg_cfp == 0) {
    02990         VALUE err = th->errinfo;
    02991         th->errinfo = Qnil;
    02992         THROW_EXCEPTION(err);
    02993     }
    02994
    02995     RESTORE_REGS();
    02996     NEXT_INSN();
    02997
    02998 #line 2999 "vm.inc"
    02999 #undef CURRENT_INSN_opt_call_c_function
    03000 #undef INSN_IS_SC
    03001 #undef INSN_LABEL
    03002 #undef LABEL_IS_SC
    03003   END_INSN(opt_call_c_function);}}}
    03004 INSN_ENTRY(bitblt){
    03005 {
    03006   VALUE ret;
    03007
    03008
    03009   DEBUG_ENTER_INSN("bitblt");
    03010   ADD_PC(1+0);
    03011   PREFETCH(GET_PC());
    03012   #define CURRENT_INSN_bitblt 1
    03013   #define INSN_IS_SC()     0
    03014   #define INSN_LABEL(lab)  LABEL_bitblt_##lab
    03015   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    03016   USAGE_ANALYSIS_INSN(BIN(bitblt));
    03017 {
    03018 #line 2144 "insns.def"
    03019     ret = rb_str_new2("a bit of bacon, lettuce and tomato");
    03020
    03021 #line 3022 "vm.inc"
    03022   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    03023   PUSH(ret);
    03024 #undef CURRENT_INSN_bitblt
    03025 #undef INSN_IS_SC
    03026 #undef INSN_LABEL
    03027 #undef LABEL_IS_SC
    03028   END_INSN(bitblt);}}}
    03029 INSN_ENTRY(answer){
    03030 {
    03031   VALUE ret;
    03032
    03033
    03034   DEBUG_ENTER_INSN("answer");
    03035   ADD_PC(1+0);
    03036   PREFETCH(GET_PC());
    03037   #define CURRENT_INSN_answer 1
    03038   #define INSN_IS_SC()     0
    03039   #define INSN_LABEL(lab)  LABEL_answer_##lab
    03040   #define LABEL_IS_SC(lab) LABEL_##lab##_##t
    03041   USAGE_ANALYSIS_INSN(BIN(answer));
    03042 {
    03043 #line 2158 "insns.def"
    03044     ret = INT2FIX(42);
    03045
    03046 #line 3047 "vm.inc"
    03047   CHECK_STACK_OVERFLOW(REG_CFP, 1);
    03048   PUSH(ret);
    03049 #undef CURRENT_INSN_answer
    03050 #undef INSN_IS_SC
    03051 #undef INSN_LABEL
    03052 #undef LABEL_IS_SC
    03053   END_INSN(answer);}}}
    03054
    03055