github.com/gmemcc/yaegi@v0.12.1-0.20221128122509-aa99124c5d16/interp/op.go (about) 1 package interp 2 3 // Code generated by 'go run ../internal/cmd/genop/genop.go'. DO NOT EDIT. 4 5 import ( 6 "github.com/spf13/cast" 7 "go/constant" 8 "go/token" 9 "reflect" 10 ) 11 12 // Arithmetic operators 13 14 func add(n *node) { 15 next := getExec(n.tnext) 16 typ := n.typ.concrete().TypeOf() 17 isInterface := n.typ.TypeOf().Kind() == reflect.Interface 18 dest := genValueOutput(n, typ) 19 c0, c1 := n.child[0], n.child[1] 20 21 switch typ.Kind() { 22 case reflect.Interface, reflect.String: 23 v0 := genValue(c0) 24 v1 := genValue(c1) 25 n.exec = func(f *frame) bltn { 26 val0 := v0(f) 27 val1 := v1(f) 28 var value reflect.Value 29 if val0.Kind() == reflect.String || (val0.Kind() == reflect.Interface || val0.Kind() == reflect.Ptr) && val0.Elem().Kind() == reflect.String { 30 value = reflect.ValueOf(rconvToString(val0) + rconvToString(val1)) 31 } else { 32 val0 = rconvNumber(val0) 33 val1 = rconvNumber(val1) 34 typ0 := val0.Type() 35 typ1 := val1.Type() 36 if isNumber(typ0) && isNumber(typ1) { 37 switch { 38 case isUint(typ0): 39 switch { 40 case isUint(typ1): 41 value = reflect.ValueOf(val0.Uint() + val1.Uint()) 42 case isInt(typ1): 43 value = reflect.ValueOf(val0.Uint() + uint64(val1.Int())) 44 case isFloat(typ1): 45 value = reflect.ValueOf(val0.Uint() + uint64(val1.Float())) 46 } 47 case isInt(typ0): 48 switch { 49 case isUint(typ1): 50 value = reflect.ValueOf(val0.Int() + int64(val1.Uint())) 51 case isInt(typ1): 52 value = reflect.ValueOf(val0.Int() + val1.Int()) 53 case isFloat(typ1): 54 value = reflect.ValueOf(val0.Int() + int64(val1.Float())) 55 } 56 case isFloat(typ0): 57 switch { 58 case isUint(typ1): 59 value = reflect.ValueOf(val0.Float() + float64(val1.Uint())) 60 case isInt(typ1): 61 value = reflect.ValueOf(val0.Float() + float64(val1.Int())) 62 case isFloat(typ1): 63 value = reflect.ValueOf(val0.Float() + float64(val1.Float())) 64 } 65 } 66 } else { 67 panic(n.runErrorf("only numbers support + operator")) 68 } 69 } 70 v, _ := rconv(value, typ) 71 dest(f).Set(v) 72 return next 73 } 74 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 75 switch { 76 case isInterface: 77 v0 := genValueInt(c0) 78 v1 := genValueInt(c1) 79 n.exec = func(f *frame) bltn { 80 _, i := v0(f) 81 _, j := v1(f) 82 dest(f).Set(reflect.ValueOf(i + j).Convert(typ)) 83 return next 84 } 85 case c0.rval.IsValid(): 86 i := vInt(c0.rval) 87 v1 := genValueInt(c1) 88 n.exec = func(f *frame) bltn { 89 _, j := v1(f) 90 dest(f).SetInt(i + j) 91 return next 92 } 93 case c1.rval.IsValid(): 94 v0 := genValueInt(c0) 95 j := vInt(c1.rval) 96 n.exec = func(f *frame) bltn { 97 _, i := v0(f) 98 dest(f).SetInt(i + j) 99 return next 100 } 101 default: 102 v0 := genValueInt(c0) 103 v1 := genValueInt(c1) 104 n.exec = func(f *frame) bltn { 105 _, i := v0(f) 106 _, j := v1(f) 107 dest(f).SetInt(i + j) 108 return next 109 } 110 } 111 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 112 switch { 113 case isInterface: 114 v0 := genValueUint(c0) 115 v1 := genValueUint(c1) 116 n.exec = func(f *frame) bltn { 117 _, i := v0(f) 118 _, j := v1(f) 119 dest(f).Set(reflect.ValueOf(i + j).Convert(typ)) 120 return next 121 } 122 case c0.rval.IsValid(): 123 i := vUint(c0.rval) 124 v1 := genValueUint(c1) 125 n.exec = func(f *frame) bltn { 126 _, j := v1(f) 127 dest(f).SetUint(i + j) 128 return next 129 } 130 case c1.rval.IsValid(): 131 j := vUint(c1.rval) 132 v0 := genValueUint(c0) 133 n.exec = func(f *frame) bltn { 134 _, i := v0(f) 135 dest(f).SetUint(i + j) 136 return next 137 } 138 default: 139 v0 := genValueUint(c0) 140 v1 := genValueUint(c1) 141 n.exec = func(f *frame) bltn { 142 _, i := v0(f) 143 _, j := v1(f) 144 dest(f).SetUint(i + j) 145 return next 146 } 147 } 148 case reflect.Float32, reflect.Float64: 149 switch { 150 case isInterface: 151 v0 := genValueFloat(c0) 152 v1 := genValueFloat(c1) 153 n.exec = func(f *frame) bltn { 154 _, i := v0(f) 155 _, j := v1(f) 156 dest(f).Set(reflect.ValueOf(i + j).Convert(typ)) 157 return next 158 } 159 case c0.rval.IsValid(): 160 i := vFloat(c0.rval) 161 v1 := genValueFloat(c1) 162 n.exec = func(f *frame) bltn { 163 _, j := v1(f) 164 dest(f).SetFloat(i + j) 165 return next 166 } 167 case c1.rval.IsValid(): 168 j := vFloat(c1.rval) 169 v0 := genValueFloat(c0) 170 n.exec = func(f *frame) bltn { 171 _, i := v0(f) 172 dest(f).SetFloat(i + j) 173 return next 174 } 175 default: 176 v0 := genValueFloat(c0) 177 v1 := genValueFloat(c1) 178 n.exec = func(f *frame) bltn { 179 _, i := v0(f) 180 _, j := v1(f) 181 dest(f).SetFloat(i + j) 182 return next 183 } 184 } 185 case reflect.Complex64, reflect.Complex128: 186 switch { 187 case isInterface: 188 v0 := genComplex(c0) 189 v1 := genComplex(c1) 190 n.exec = func(f *frame) bltn { 191 dest(f).Set(reflect.ValueOf(v0(f) + v1(f)).Convert(typ)) 192 return next 193 } 194 case c0.rval.IsValid(): 195 r0 := vComplex(c0.rval) 196 v1 := genComplex(c1) 197 n.exec = func(f *frame) bltn { 198 dest(f).SetComplex(r0 + v1(f)) 199 return next 200 } 201 case c1.rval.IsValid(): 202 r1 := vComplex(c1.rval) 203 v0 := genComplex(c0) 204 n.exec = func(f *frame) bltn { 205 dest(f).SetComplex(v0(f) + r1) 206 return next 207 } 208 default: 209 v0 := genComplex(c0) 210 v1 := genComplex(c1) 211 n.exec = func(f *frame) bltn { 212 dest(f).SetComplex(v0(f) + v1(f)) 213 return next 214 } 215 } 216 } 217 } 218 219 func addConst(n *node) { 220 v0, v1 := n.child[0].rval, n.child[1].rval 221 isConst := (v0.IsValid() && isConstantValue(v0.Type())) && (v1.IsValid() && isConstantValue(v1.Type())) 222 t := n.typ.rtype 223 if isConst { 224 t = constVal 225 } 226 n.rval = reflect.New(t).Elem() 227 switch { 228 case isConst: 229 cv0 := vConstantValue(v0) 230 cv1 := vConstantValue(v1) 231 cv1 = rconvConst(cv1, cv0.Kind()) 232 v := constant.BinaryOp(cv0, token.ADD, cv1) 233 n.rval.Set(reflect.ValueOf(v)) 234 case isString(t): 235 n.rval.SetString(vString(v0) + vString(v1)) 236 case isComplex(t): 237 n.rval.SetComplex(vComplex(v0) + vComplex(v1)) 238 case isFloat(t): 239 n.rval.SetFloat(vFloat(v0) + vFloat(v1)) 240 case isUint(t): 241 n.rval.SetUint(vUint(v0) + vUint(v1)) 242 case isInt(t): 243 n.rval.SetInt(vInt(v0) + vInt(v1)) 244 } 245 } 246 247 func and(n *node) { 248 next := getExec(n.tnext) 249 typ := n.typ.concrete().TypeOf() 250 isInterface := n.typ.TypeOf().Kind() == reflect.Interface 251 dest := genValueOutput(n, typ) 252 c0, c1 := n.child[0], n.child[1] 253 254 switch typ.Kind() { 255 case reflect.Interface, reflect.String: 256 v0 := genValue(c0) 257 v1 := genValue(c1) 258 n.exec = func(f *frame) bltn { 259 val0 := v0(f) 260 val1 := v1(f) 261 var value reflect.Value 262 val0 = rconvNumber(val0) 263 val1 = rconvNumber(val1) 264 typ0 := val0.Type() 265 typ1 := val1.Type() 266 if isNumber(typ0) && isNumber(typ1) { 267 switch { 268 case isUint(typ0): 269 switch { 270 case isUint(typ1): 271 value = reflect.ValueOf(val0.Uint() & val1.Uint()) 272 case isInt(typ1): 273 value = reflect.ValueOf(val0.Uint() & uint64(val1.Int())) 274 case isFloat(typ1): 275 value = reflect.ValueOf(val0.Uint() & uint64(val1.Float())) 276 } 277 case isInt(typ0): 278 switch { 279 case isUint(typ1): 280 value = reflect.ValueOf(val0.Int() & int64(val1.Uint())) 281 case isInt(typ1): 282 value = reflect.ValueOf(val0.Int() & val1.Int()) 283 case isFloat(typ1): 284 value = reflect.ValueOf(val0.Int() & int64(val1.Float())) 285 } 286 case isFloat(typ0): 287 switch { 288 case isUint(typ1): 289 value = reflect.ValueOf(int64(val0.Float()) & int64(val1.Uint())) 290 case isInt(typ1): 291 value = reflect.ValueOf(int64(val0.Float()) & int64(val1.Int())) 292 case isFloat(typ1): 293 value = reflect.ValueOf(int64(val0.Float()) & int64(val1.Float())) 294 } 295 } 296 } else { 297 panic(n.runErrorf("only numbers support & operator")) 298 } 299 v, _ := rconv(value, typ) 300 dest(f).Set(v) 301 return next 302 } 303 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 304 switch { 305 case isInterface: 306 v0 := genValueInt(c0) 307 v1 := genValueInt(c1) 308 n.exec = func(f *frame) bltn { 309 _, i := v0(f) 310 _, j := v1(f) 311 dest(f).Set(reflect.ValueOf(i & j).Convert(typ)) 312 return next 313 } 314 case c0.rval.IsValid(): 315 i := vInt(c0.rval) 316 v1 := genValueInt(c1) 317 n.exec = func(f *frame) bltn { 318 _, j := v1(f) 319 dest(f).SetInt(i & j) 320 return next 321 } 322 case c1.rval.IsValid(): 323 v0 := genValueInt(c0) 324 j := vInt(c1.rval) 325 n.exec = func(f *frame) bltn { 326 _, i := v0(f) 327 dest(f).SetInt(i & j) 328 return next 329 } 330 default: 331 v0 := genValueInt(c0) 332 v1 := genValueInt(c1) 333 n.exec = func(f *frame) bltn { 334 _, i := v0(f) 335 _, j := v1(f) 336 dest(f).SetInt(i & j) 337 return next 338 } 339 } 340 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 341 switch { 342 case isInterface: 343 v0 := genValueUint(c0) 344 v1 := genValueUint(c1) 345 n.exec = func(f *frame) bltn { 346 _, i := v0(f) 347 _, j := v1(f) 348 dest(f).Set(reflect.ValueOf(i & j).Convert(typ)) 349 return next 350 } 351 case c0.rval.IsValid(): 352 i := vUint(c0.rval) 353 v1 := genValueUint(c1) 354 n.exec = func(f *frame) bltn { 355 _, j := v1(f) 356 dest(f).SetUint(i & j) 357 return next 358 } 359 case c1.rval.IsValid(): 360 j := vUint(c1.rval) 361 v0 := genValueUint(c0) 362 n.exec = func(f *frame) bltn { 363 _, i := v0(f) 364 dest(f).SetUint(i & j) 365 return next 366 } 367 default: 368 v0 := genValueUint(c0) 369 v1 := genValueUint(c1) 370 n.exec = func(f *frame) bltn { 371 _, i := v0(f) 372 _, j := v1(f) 373 dest(f).SetUint(i & j) 374 return next 375 } 376 } 377 } 378 } 379 380 func andConst(n *node) { 381 v0, v1 := n.child[0].rval, n.child[1].rval 382 isConst := (v0.IsValid() && isConstantValue(v0.Type())) && (v1.IsValid() && isConstantValue(v1.Type())) 383 t := n.typ.rtype 384 if isConst { 385 t = constVal 386 } 387 n.rval = reflect.New(t).Elem() 388 switch { 389 case isConst: 390 cv0 := rconvConstInt(vConstantValue(v0)) 391 cv1 := rconvConstInt(vConstantValue(v1)) 392 v := constant.BinaryOp(constant.ToInt(cv0), token.AND, constant.ToInt(cv1)) 393 n.rval.Set(reflect.ValueOf(v)) 394 case isUint(t): 395 n.rval.SetUint(vUint(v0) & vUint(v1)) 396 case isInt(t): 397 n.rval.SetInt(vInt(v0) & vInt(v1)) 398 } 399 } 400 401 func andNot(n *node) { 402 next := getExec(n.tnext) 403 typ := n.typ.concrete().TypeOf() 404 isInterface := n.typ.TypeOf().Kind() == reflect.Interface 405 dest := genValueOutput(n, typ) 406 c0, c1 := n.child[0], n.child[1] 407 408 switch typ.Kind() { 409 case reflect.Interface, reflect.String: 410 v0 := genValue(c0) 411 v1 := genValue(c1) 412 n.exec = func(f *frame) bltn { 413 val0 := v0(f) 414 val1 := v1(f) 415 var value reflect.Value 416 val0 = rconvNumber(val0) 417 val1 = rconvNumber(val1) 418 typ0 := val0.Type() 419 typ1 := val1.Type() 420 if isNumber(typ0) && isNumber(typ1) { 421 switch { 422 case isUint(typ0): 423 switch { 424 case isUint(typ1): 425 value = reflect.ValueOf(val0.Uint() &^ val1.Uint()) 426 case isInt(typ1): 427 value = reflect.ValueOf(val0.Uint() &^ uint64(val1.Int())) 428 case isFloat(typ1): 429 value = reflect.ValueOf(val0.Uint() &^ uint64(val1.Float())) 430 } 431 case isInt(typ0): 432 switch { 433 case isUint(typ1): 434 value = reflect.ValueOf(val0.Int() &^ int64(val1.Uint())) 435 case isInt(typ1): 436 value = reflect.ValueOf(val0.Int() &^ val1.Int()) 437 case isFloat(typ1): 438 value = reflect.ValueOf(val0.Int() &^ int64(val1.Float())) 439 } 440 case isFloat(typ0): 441 switch { 442 case isUint(typ1): 443 value = reflect.ValueOf(int64(val0.Float()) &^ int64(val1.Uint())) 444 case isInt(typ1): 445 value = reflect.ValueOf(int64(val0.Float()) &^ int64(val1.Int())) 446 case isFloat(typ1): 447 value = reflect.ValueOf(int64(val0.Float()) &^ int64(val1.Float())) 448 } 449 } 450 } else { 451 panic(n.runErrorf("only numbers support &^ operator")) 452 } 453 v, _ := rconv(value, typ) 454 dest(f).Set(v) 455 return next 456 } 457 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 458 switch { 459 case isInterface: 460 v0 := genValueInt(c0) 461 v1 := genValueInt(c1) 462 n.exec = func(f *frame) bltn { 463 _, i := v0(f) 464 _, j := v1(f) 465 dest(f).Set(reflect.ValueOf(i &^ j).Convert(typ)) 466 return next 467 } 468 case c0.rval.IsValid(): 469 i := vInt(c0.rval) 470 v1 := genValueInt(c1) 471 n.exec = func(f *frame) bltn { 472 _, j := v1(f) 473 dest(f).SetInt(i &^ j) 474 return next 475 } 476 case c1.rval.IsValid(): 477 v0 := genValueInt(c0) 478 j := vInt(c1.rval) 479 n.exec = func(f *frame) bltn { 480 _, i := v0(f) 481 dest(f).SetInt(i &^ j) 482 return next 483 } 484 default: 485 v0 := genValueInt(c0) 486 v1 := genValueInt(c1) 487 n.exec = func(f *frame) bltn { 488 _, i := v0(f) 489 _, j := v1(f) 490 dest(f).SetInt(i &^ j) 491 return next 492 } 493 } 494 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 495 switch { 496 case isInterface: 497 v0 := genValueUint(c0) 498 v1 := genValueUint(c1) 499 n.exec = func(f *frame) bltn { 500 _, i := v0(f) 501 _, j := v1(f) 502 dest(f).Set(reflect.ValueOf(i &^ j).Convert(typ)) 503 return next 504 } 505 case c0.rval.IsValid(): 506 i := vUint(c0.rval) 507 v1 := genValueUint(c1) 508 n.exec = func(f *frame) bltn { 509 _, j := v1(f) 510 dest(f).SetUint(i &^ j) 511 return next 512 } 513 case c1.rval.IsValid(): 514 j := vUint(c1.rval) 515 v0 := genValueUint(c0) 516 n.exec = func(f *frame) bltn { 517 _, i := v0(f) 518 dest(f).SetUint(i &^ j) 519 return next 520 } 521 default: 522 v0 := genValueUint(c0) 523 v1 := genValueUint(c1) 524 n.exec = func(f *frame) bltn { 525 _, i := v0(f) 526 _, j := v1(f) 527 dest(f).SetUint(i &^ j) 528 return next 529 } 530 } 531 } 532 } 533 534 func andNotConst(n *node) { 535 v0, v1 := n.child[0].rval, n.child[1].rval 536 isConst := (v0.IsValid() && isConstantValue(v0.Type())) && (v1.IsValid() && isConstantValue(v1.Type())) 537 t := n.typ.rtype 538 if isConst { 539 t = constVal 540 } 541 n.rval = reflect.New(t).Elem() 542 switch { 543 case isConst: 544 cv0 := rconvConstInt(vConstantValue(v0)) 545 cv1 := rconvConstInt(vConstantValue(v1)) 546 v := constant.BinaryOp(constant.ToInt(cv0), token.AND_NOT, constant.ToInt(cv1)) 547 n.rval.Set(reflect.ValueOf(v)) 548 case isUint(t): 549 n.rval.SetUint(vUint(v0) &^ vUint(v1)) 550 case isInt(t): 551 n.rval.SetInt(vInt(v0) &^ vInt(v1)) 552 } 553 } 554 555 func mul(n *node) { 556 next := getExec(n.tnext) 557 typ := n.typ.concrete().TypeOf() 558 isInterface := n.typ.TypeOf().Kind() == reflect.Interface 559 dest := genValueOutput(n, typ) 560 c0, c1 := n.child[0], n.child[1] 561 562 switch typ.Kind() { 563 case reflect.Interface, reflect.String: 564 v0 := genValue(c0) 565 v1 := genValue(c1) 566 n.exec = func(f *frame) bltn { 567 val0 := v0(f) 568 val1 := v1(f) 569 var value reflect.Value 570 val0 = rconvNumber(val0) 571 val1 = rconvNumber(val1) 572 typ0 := val0.Type() 573 typ1 := val1.Type() 574 if isNumber(typ0) && isNumber(typ1) { 575 switch { 576 case isUint(typ0): 577 switch { 578 case isUint(typ1): 579 value = reflect.ValueOf(val0.Uint() * val1.Uint()) 580 case isInt(typ1): 581 value = reflect.ValueOf(val0.Uint() * uint64(val1.Int())) 582 case isFloat(typ1): 583 value = reflect.ValueOf(val0.Uint() * uint64(val1.Float())) 584 } 585 case isInt(typ0): 586 switch { 587 case isUint(typ1): 588 value = reflect.ValueOf(val0.Int() * int64(val1.Uint())) 589 case isInt(typ1): 590 value = reflect.ValueOf(val0.Int() * val1.Int()) 591 case isFloat(typ1): 592 value = reflect.ValueOf(val0.Int() * int64(val1.Float())) 593 } 594 case isFloat(typ0): 595 switch { 596 case isUint(typ1): 597 value = reflect.ValueOf(val0.Float() * float64(val1.Uint())) 598 case isInt(typ1): 599 value = reflect.ValueOf(val0.Float() * float64(val1.Int())) 600 case isFloat(typ1): 601 value = reflect.ValueOf(val0.Float() * float64(val1.Float())) 602 } 603 } 604 } else { 605 panic(n.runErrorf("only numbers support * operator")) 606 } 607 v, _ := rconv(value, typ) 608 dest(f).Set(v) 609 return next 610 } 611 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 612 switch { 613 case isInterface: 614 v0 := genValueInt(c0) 615 v1 := genValueInt(c1) 616 n.exec = func(f *frame) bltn { 617 _, i := v0(f) 618 _, j := v1(f) 619 dest(f).Set(reflect.ValueOf(i * j).Convert(typ)) 620 return next 621 } 622 case c0.rval.IsValid(): 623 i := vInt(c0.rval) 624 v1 := genValueInt(c1) 625 n.exec = func(f *frame) bltn { 626 _, j := v1(f) 627 dest(f).SetInt(i * j) 628 return next 629 } 630 case c1.rval.IsValid(): 631 v0 := genValueInt(c0) 632 j := vInt(c1.rval) 633 n.exec = func(f *frame) bltn { 634 _, i := v0(f) 635 dest(f).SetInt(i * j) 636 return next 637 } 638 default: 639 v0 := genValueInt(c0) 640 v1 := genValueInt(c1) 641 n.exec = func(f *frame) bltn { 642 _, i := v0(f) 643 _, j := v1(f) 644 dest(f).SetInt(i * j) 645 return next 646 } 647 } 648 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 649 switch { 650 case isInterface: 651 v0 := genValueUint(c0) 652 v1 := genValueUint(c1) 653 n.exec = func(f *frame) bltn { 654 _, i := v0(f) 655 _, j := v1(f) 656 dest(f).Set(reflect.ValueOf(i * j).Convert(typ)) 657 return next 658 } 659 case c0.rval.IsValid(): 660 i := vUint(c0.rval) 661 v1 := genValueUint(c1) 662 n.exec = func(f *frame) bltn { 663 _, j := v1(f) 664 dest(f).SetUint(i * j) 665 return next 666 } 667 case c1.rval.IsValid(): 668 j := vUint(c1.rval) 669 v0 := genValueUint(c0) 670 n.exec = func(f *frame) bltn { 671 _, i := v0(f) 672 dest(f).SetUint(i * j) 673 return next 674 } 675 default: 676 v0 := genValueUint(c0) 677 v1 := genValueUint(c1) 678 n.exec = func(f *frame) bltn { 679 _, i := v0(f) 680 _, j := v1(f) 681 dest(f).SetUint(i * j) 682 return next 683 } 684 } 685 case reflect.Float32, reflect.Float64: 686 switch { 687 case isInterface: 688 v0 := genValueFloat(c0) 689 v1 := genValueFloat(c1) 690 n.exec = func(f *frame) bltn { 691 _, i := v0(f) 692 _, j := v1(f) 693 dest(f).Set(reflect.ValueOf(i * j).Convert(typ)) 694 return next 695 } 696 case c0.rval.IsValid(): 697 i := vFloat(c0.rval) 698 v1 := genValueFloat(c1) 699 n.exec = func(f *frame) bltn { 700 _, j := v1(f) 701 dest(f).SetFloat(i * j) 702 return next 703 } 704 case c1.rval.IsValid(): 705 j := vFloat(c1.rval) 706 v0 := genValueFloat(c0) 707 n.exec = func(f *frame) bltn { 708 _, i := v0(f) 709 dest(f).SetFloat(i * j) 710 return next 711 } 712 default: 713 v0 := genValueFloat(c0) 714 v1 := genValueFloat(c1) 715 n.exec = func(f *frame) bltn { 716 _, i := v0(f) 717 _, j := v1(f) 718 dest(f).SetFloat(i * j) 719 return next 720 } 721 } 722 case reflect.Complex64, reflect.Complex128: 723 switch { 724 case isInterface: 725 v0 := genComplex(c0) 726 v1 := genComplex(c1) 727 n.exec = func(f *frame) bltn { 728 dest(f).Set(reflect.ValueOf(v0(f) * v1(f)).Convert(typ)) 729 return next 730 } 731 case c0.rval.IsValid(): 732 r0 := vComplex(c0.rval) 733 v1 := genComplex(c1) 734 n.exec = func(f *frame) bltn { 735 dest(f).SetComplex(r0 * v1(f)) 736 return next 737 } 738 case c1.rval.IsValid(): 739 r1 := vComplex(c1.rval) 740 v0 := genComplex(c0) 741 n.exec = func(f *frame) bltn { 742 dest(f).SetComplex(v0(f) * r1) 743 return next 744 } 745 default: 746 v0 := genComplex(c0) 747 v1 := genComplex(c1) 748 n.exec = func(f *frame) bltn { 749 dest(f).SetComplex(v0(f) * v1(f)) 750 return next 751 } 752 } 753 } 754 } 755 756 func mulConst(n *node) { 757 v0, v1 := n.child[0].rval, n.child[1].rval 758 isConst := (v0.IsValid() && isConstantValue(v0.Type())) && (v1.IsValid() && isConstantValue(v1.Type())) 759 t := n.typ.rtype 760 if isConst { 761 t = constVal 762 } 763 n.rval = reflect.New(t).Elem() 764 switch { 765 case isConst: 766 cv0 := rconvConstNumber(vConstantValue(v0)) 767 cv1 := rconvConstNumber(vConstantValue(v1)) 768 v := constant.BinaryOp(cv0, token.MUL, cv1) 769 n.rval.Set(reflect.ValueOf(v)) 770 case isComplex(t): 771 n.rval.SetComplex(vComplex(v0) * vComplex(v1)) 772 case isFloat(t): 773 n.rval.SetFloat(vFloat(v0) * vFloat(v1)) 774 case isUint(t): 775 n.rval.SetUint(vUint(v0) * vUint(v1)) 776 case isInt(t): 777 n.rval.SetInt(vInt(v0) * vInt(v1)) 778 } 779 } 780 781 func or(n *node) { 782 next := getExec(n.tnext) 783 typ := n.typ.concrete().TypeOf() 784 isInterface := n.typ.TypeOf().Kind() == reflect.Interface 785 dest := genValueOutput(n, typ) 786 c0, c1 := n.child[0], n.child[1] 787 788 switch typ.Kind() { 789 case reflect.Interface, reflect.String: 790 v0 := genValue(c0) 791 v1 := genValue(c1) 792 n.exec = func(f *frame) bltn { 793 val0 := v0(f) 794 val1 := v1(f) 795 var value reflect.Value 796 val0 = rconvNumber(val0) 797 val1 = rconvNumber(val1) 798 typ0 := val0.Type() 799 typ1 := val1.Type() 800 if isNumber(typ0) && isNumber(typ1) { 801 switch { 802 case isUint(typ0): 803 switch { 804 case isUint(typ1): 805 value = reflect.ValueOf(val0.Uint() | val1.Uint()) 806 case isInt(typ1): 807 value = reflect.ValueOf(val0.Uint() | uint64(val1.Int())) 808 case isFloat(typ1): 809 value = reflect.ValueOf(val0.Uint() | uint64(val1.Float())) 810 } 811 case isInt(typ0): 812 switch { 813 case isUint(typ1): 814 value = reflect.ValueOf(val0.Int() | int64(val1.Uint())) 815 case isInt(typ1): 816 value = reflect.ValueOf(val0.Int() | val1.Int()) 817 case isFloat(typ1): 818 value = reflect.ValueOf(val0.Int() | int64(val1.Float())) 819 } 820 case isFloat(typ0): 821 switch { 822 case isUint(typ1): 823 value = reflect.ValueOf(int64(val0.Float()) | int64(val1.Uint())) 824 case isInt(typ1): 825 value = reflect.ValueOf(int64(val0.Float()) | int64(val1.Int())) 826 case isFloat(typ1): 827 value = reflect.ValueOf(int64(val0.Float()) | int64(val1.Float())) 828 } 829 } 830 } else { 831 panic(n.runErrorf("only numbers support | operator")) 832 } 833 v, _ := rconv(value, typ) 834 dest(f).Set(v) 835 return next 836 } 837 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 838 switch { 839 case isInterface: 840 v0 := genValueInt(c0) 841 v1 := genValueInt(c1) 842 n.exec = func(f *frame) bltn { 843 _, i := v0(f) 844 _, j := v1(f) 845 dest(f).Set(reflect.ValueOf(i | j).Convert(typ)) 846 return next 847 } 848 case c0.rval.IsValid(): 849 i := vInt(c0.rval) 850 v1 := genValueInt(c1) 851 n.exec = func(f *frame) bltn { 852 _, j := v1(f) 853 dest(f).SetInt(i | j) 854 return next 855 } 856 case c1.rval.IsValid(): 857 v0 := genValueInt(c0) 858 j := vInt(c1.rval) 859 n.exec = func(f *frame) bltn { 860 _, i := v0(f) 861 dest(f).SetInt(i | j) 862 return next 863 } 864 default: 865 v0 := genValueInt(c0) 866 v1 := genValueInt(c1) 867 n.exec = func(f *frame) bltn { 868 _, i := v0(f) 869 _, j := v1(f) 870 dest(f).SetInt(i | j) 871 return next 872 } 873 } 874 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 875 switch { 876 case isInterface: 877 v0 := genValueUint(c0) 878 v1 := genValueUint(c1) 879 n.exec = func(f *frame) bltn { 880 _, i := v0(f) 881 _, j := v1(f) 882 dest(f).Set(reflect.ValueOf(i | j).Convert(typ)) 883 return next 884 } 885 case c0.rval.IsValid(): 886 i := vUint(c0.rval) 887 v1 := genValueUint(c1) 888 n.exec = func(f *frame) bltn { 889 _, j := v1(f) 890 dest(f).SetUint(i | j) 891 return next 892 } 893 case c1.rval.IsValid(): 894 j := vUint(c1.rval) 895 v0 := genValueUint(c0) 896 n.exec = func(f *frame) bltn { 897 _, i := v0(f) 898 dest(f).SetUint(i | j) 899 return next 900 } 901 default: 902 v0 := genValueUint(c0) 903 v1 := genValueUint(c1) 904 n.exec = func(f *frame) bltn { 905 _, i := v0(f) 906 _, j := v1(f) 907 dest(f).SetUint(i | j) 908 return next 909 } 910 } 911 } 912 } 913 914 func orConst(n *node) { 915 v0, v1 := n.child[0].rval, n.child[1].rval 916 isConst := (v0.IsValid() && isConstantValue(v0.Type())) && (v1.IsValid() && isConstantValue(v1.Type())) 917 t := n.typ.rtype 918 if isConst { 919 t = constVal 920 } 921 n.rval = reflect.New(t).Elem() 922 switch { 923 case isConst: 924 cv0 := rconvConstInt(vConstantValue(v0)) 925 cv1 := rconvConstInt(vConstantValue(v1)) 926 v := constant.BinaryOp(constant.ToInt(cv0), token.OR, constant.ToInt(cv1)) 927 n.rval.Set(reflect.ValueOf(v)) 928 case isUint(t): 929 n.rval.SetUint(vUint(v0) | vUint(v1)) 930 case isInt(t): 931 n.rval.SetInt(vInt(v0) | vInt(v1)) 932 } 933 } 934 935 func quo(n *node) { 936 next := getExec(n.tnext) 937 typ := n.typ.concrete().TypeOf() 938 isInterface := n.typ.TypeOf().Kind() == reflect.Interface 939 dest := genValueOutput(n, typ) 940 c0, c1 := n.child[0], n.child[1] 941 942 switch typ.Kind() { 943 case reflect.Interface, reflect.String: 944 v0 := genValue(c0) 945 v1 := genValue(c1) 946 n.exec = func(f *frame) bltn { 947 val0 := v0(f) 948 val1 := v1(f) 949 var value reflect.Value 950 val0 = rconvNumber(val0) 951 val1 = rconvNumber(val1) 952 typ0 := val0.Type() 953 typ1 := val1.Type() 954 if isNumber(typ0) && isNumber(typ1) { 955 switch { 956 case isUint(typ0): 957 switch { 958 case isUint(typ1): 959 value = reflect.ValueOf(val0.Uint() / val1.Uint()) 960 case isInt(typ1): 961 value = reflect.ValueOf(val0.Uint() / uint64(val1.Int())) 962 case isFloat(typ1): 963 value = reflect.ValueOf(val0.Uint() / uint64(val1.Float())) 964 } 965 case isInt(typ0): 966 switch { 967 case isUint(typ1): 968 value = reflect.ValueOf(val0.Int() / int64(val1.Uint())) 969 case isInt(typ1): 970 value = reflect.ValueOf(val0.Int() / val1.Int()) 971 case isFloat(typ1): 972 value = reflect.ValueOf(val0.Int() / int64(val1.Float())) 973 } 974 case isFloat(typ0): 975 switch { 976 case isUint(typ1): 977 value = reflect.ValueOf(val0.Float() / float64(val1.Uint())) 978 case isInt(typ1): 979 value = reflect.ValueOf(val0.Float() / float64(val1.Int())) 980 case isFloat(typ1): 981 value = reflect.ValueOf(val0.Float() / float64(val1.Float())) 982 } 983 } 984 } else { 985 panic(n.runErrorf("only numbers support / operator")) 986 } 987 v, _ := rconv(value, typ) 988 dest(f).Set(v) 989 return next 990 } 991 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 992 switch { 993 case isInterface: 994 v0 := genValueInt(c0) 995 v1 := genValueInt(c1) 996 n.exec = func(f *frame) bltn { 997 _, i := v0(f) 998 _, j := v1(f) 999 dest(f).Set(reflect.ValueOf(i / j).Convert(typ)) 1000 return next 1001 } 1002 case c0.rval.IsValid(): 1003 i := vInt(c0.rval) 1004 v1 := genValueInt(c1) 1005 n.exec = func(f *frame) bltn { 1006 _, j := v1(f) 1007 dest(f).SetInt(i / j) 1008 return next 1009 } 1010 case c1.rval.IsValid(): 1011 v0 := genValueInt(c0) 1012 j := vInt(c1.rval) 1013 n.exec = func(f *frame) bltn { 1014 _, i := v0(f) 1015 dest(f).SetInt(i / j) 1016 return next 1017 } 1018 default: 1019 v0 := genValueInt(c0) 1020 v1 := genValueInt(c1) 1021 n.exec = func(f *frame) bltn { 1022 _, i := v0(f) 1023 _, j := v1(f) 1024 dest(f).SetInt(i / j) 1025 return next 1026 } 1027 } 1028 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 1029 switch { 1030 case isInterface: 1031 v0 := genValueUint(c0) 1032 v1 := genValueUint(c1) 1033 n.exec = func(f *frame) bltn { 1034 _, i := v0(f) 1035 _, j := v1(f) 1036 dest(f).Set(reflect.ValueOf(i / j).Convert(typ)) 1037 return next 1038 } 1039 case c0.rval.IsValid(): 1040 i := vUint(c0.rval) 1041 v1 := genValueUint(c1) 1042 n.exec = func(f *frame) bltn { 1043 _, j := v1(f) 1044 dest(f).SetUint(i / j) 1045 return next 1046 } 1047 case c1.rval.IsValid(): 1048 j := vUint(c1.rval) 1049 v0 := genValueUint(c0) 1050 n.exec = func(f *frame) bltn { 1051 _, i := v0(f) 1052 dest(f).SetUint(i / j) 1053 return next 1054 } 1055 default: 1056 v0 := genValueUint(c0) 1057 v1 := genValueUint(c1) 1058 n.exec = func(f *frame) bltn { 1059 _, i := v0(f) 1060 _, j := v1(f) 1061 dest(f).SetUint(i / j) 1062 return next 1063 } 1064 } 1065 case reflect.Float32, reflect.Float64: 1066 switch { 1067 case isInterface: 1068 v0 := genValueFloat(c0) 1069 v1 := genValueFloat(c1) 1070 n.exec = func(f *frame) bltn { 1071 _, i := v0(f) 1072 _, j := v1(f) 1073 dest(f).Set(reflect.ValueOf(i / j).Convert(typ)) 1074 return next 1075 } 1076 case c0.rval.IsValid(): 1077 i := vFloat(c0.rval) 1078 v1 := genValueFloat(c1) 1079 n.exec = func(f *frame) bltn { 1080 _, j := v1(f) 1081 dest(f).SetFloat(i / j) 1082 return next 1083 } 1084 case c1.rval.IsValid(): 1085 j := vFloat(c1.rval) 1086 v0 := genValueFloat(c0) 1087 n.exec = func(f *frame) bltn { 1088 _, i := v0(f) 1089 dest(f).SetFloat(i / j) 1090 return next 1091 } 1092 default: 1093 v0 := genValueFloat(c0) 1094 v1 := genValueFloat(c1) 1095 n.exec = func(f *frame) bltn { 1096 _, i := v0(f) 1097 _, j := v1(f) 1098 dest(f).SetFloat(i / j) 1099 return next 1100 } 1101 } 1102 case reflect.Complex64, reflect.Complex128: 1103 switch { 1104 case isInterface: 1105 v0 := genComplex(c0) 1106 v1 := genComplex(c1) 1107 n.exec = func(f *frame) bltn { 1108 dest(f).Set(reflect.ValueOf(v0(f) / v1(f)).Convert(typ)) 1109 return next 1110 } 1111 case c0.rval.IsValid(): 1112 r0 := vComplex(c0.rval) 1113 v1 := genComplex(c1) 1114 n.exec = func(f *frame) bltn { 1115 dest(f).SetComplex(r0 / v1(f)) 1116 return next 1117 } 1118 case c1.rval.IsValid(): 1119 r1 := vComplex(c1.rval) 1120 v0 := genComplex(c0) 1121 n.exec = func(f *frame) bltn { 1122 dest(f).SetComplex(v0(f) / r1) 1123 return next 1124 } 1125 default: 1126 v0 := genComplex(c0) 1127 v1 := genComplex(c1) 1128 n.exec = func(f *frame) bltn { 1129 dest(f).SetComplex(v0(f) / v1(f)) 1130 return next 1131 } 1132 } 1133 } 1134 } 1135 1136 func quoConst(n *node) { 1137 v0, v1 := n.child[0].rval, n.child[1].rval 1138 isConst := (v0.IsValid() && isConstantValue(v0.Type())) && (v1.IsValid() && isConstantValue(v1.Type())) 1139 t := n.typ.rtype 1140 if isConst { 1141 t = constVal 1142 } 1143 n.rval = reflect.New(t).Elem() 1144 switch { 1145 case isConst: 1146 var operator token.Token 1147 // When the result of the operation is expected to be an int (because both 1148 // operands are ints), we want to force the type of the whole expression to be an 1149 // int (and not a float), which is achieved by using the QUO_ASSIGN operator. 1150 if n.typ.untyped && isInt(n.typ.rtype) { 1151 operator = token.QUO_ASSIGN 1152 } else { 1153 operator = token.QUO 1154 } 1155 cv0 := rconvConstInt(vConstantValue(v0)) 1156 cv1 := rconvConstInt(vConstantValue(v1)) 1157 v := constant.BinaryOp(cv0, operator, cv1) 1158 n.rval.Set(reflect.ValueOf(v)) 1159 case isComplex(t): 1160 n.rval.SetComplex(vComplex(v0) / vComplex(v1)) 1161 case isFloat(t): 1162 n.rval.SetFloat(vFloat(v0) / vFloat(v1)) 1163 case isUint(t): 1164 n.rval.SetUint(vUint(v0) / vUint(v1)) 1165 case isInt(t): 1166 n.rval.SetInt(vInt(v0) / vInt(v1)) 1167 } 1168 } 1169 1170 func rem(n *node) { 1171 next := getExec(n.tnext) 1172 typ := n.typ.concrete().TypeOf() 1173 isInterface := n.typ.TypeOf().Kind() == reflect.Interface 1174 dest := genValueOutput(n, typ) 1175 c0, c1 := n.child[0], n.child[1] 1176 1177 switch typ.Kind() { 1178 case reflect.Interface, reflect.String: 1179 v0 := genValue(c0) 1180 v1 := genValue(c1) 1181 n.exec = func(f *frame) bltn { 1182 val0 := v0(f) 1183 val1 := v1(f) 1184 var value reflect.Value 1185 val0 = rconvNumber(val0) 1186 val1 = rconvNumber(val1) 1187 typ0 := val0.Type() 1188 typ1 := val1.Type() 1189 if isNumber(typ0) && isNumber(typ1) { 1190 switch { 1191 case isUint(typ0): 1192 switch { 1193 case isUint(typ1): 1194 value = reflect.ValueOf(val0.Uint() % val1.Uint()) 1195 case isInt(typ1): 1196 value = reflect.ValueOf(val0.Uint() % uint64(val1.Int())) 1197 case isFloat(typ1): 1198 value = reflect.ValueOf(val0.Uint() % uint64(val1.Float())) 1199 } 1200 case isInt(typ0): 1201 switch { 1202 case isUint(typ1): 1203 value = reflect.ValueOf(val0.Int() % int64(val1.Uint())) 1204 case isInt(typ1): 1205 value = reflect.ValueOf(val0.Int() % val1.Int()) 1206 case isFloat(typ1): 1207 value = reflect.ValueOf(val0.Int() % int64(val1.Float())) 1208 } 1209 case isFloat(typ0): 1210 switch { 1211 case isUint(typ1): 1212 value = reflect.ValueOf(int64(val0.Float()) % int64(val1.Uint())) 1213 case isInt(typ1): 1214 value = reflect.ValueOf(int64(val0.Float()) % int64(val1.Int())) 1215 case isFloat(typ1): 1216 value = reflect.ValueOf(int64(val0.Float()) % int64(val1.Float())) 1217 } 1218 } 1219 } else { 1220 panic(n.runErrorf("only numbers support % operator")) 1221 } 1222 v, _ := rconv(value, typ) 1223 dest(f).Set(v) 1224 return next 1225 } 1226 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 1227 switch { 1228 case isInterface: 1229 v0 := genValueInt(c0) 1230 v1 := genValueInt(c1) 1231 n.exec = func(f *frame) bltn { 1232 _, i := v0(f) 1233 _, j := v1(f) 1234 dest(f).Set(reflect.ValueOf(i % j).Convert(typ)) 1235 return next 1236 } 1237 case c0.rval.IsValid(): 1238 i := vInt(c0.rval) 1239 v1 := genValueInt(c1) 1240 n.exec = func(f *frame) bltn { 1241 _, j := v1(f) 1242 dest(f).SetInt(i % j) 1243 return next 1244 } 1245 case c1.rval.IsValid(): 1246 v0 := genValueInt(c0) 1247 j := vInt(c1.rval) 1248 n.exec = func(f *frame) bltn { 1249 _, i := v0(f) 1250 dest(f).SetInt(i % j) 1251 return next 1252 } 1253 default: 1254 v0 := genValueInt(c0) 1255 v1 := genValueInt(c1) 1256 n.exec = func(f *frame) bltn { 1257 _, i := v0(f) 1258 _, j := v1(f) 1259 dest(f).SetInt(i % j) 1260 return next 1261 } 1262 } 1263 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 1264 switch { 1265 case isInterface: 1266 v0 := genValueUint(c0) 1267 v1 := genValueUint(c1) 1268 n.exec = func(f *frame) bltn { 1269 _, i := v0(f) 1270 _, j := v1(f) 1271 dest(f).Set(reflect.ValueOf(i % j).Convert(typ)) 1272 return next 1273 } 1274 case c0.rval.IsValid(): 1275 i := vUint(c0.rval) 1276 v1 := genValueUint(c1) 1277 n.exec = func(f *frame) bltn { 1278 _, j := v1(f) 1279 dest(f).SetUint(i % j) 1280 return next 1281 } 1282 case c1.rval.IsValid(): 1283 j := vUint(c1.rval) 1284 v0 := genValueUint(c0) 1285 n.exec = func(f *frame) bltn { 1286 _, i := v0(f) 1287 dest(f).SetUint(i % j) 1288 return next 1289 } 1290 default: 1291 v0 := genValueUint(c0) 1292 v1 := genValueUint(c1) 1293 n.exec = func(f *frame) bltn { 1294 _, i := v0(f) 1295 _, j := v1(f) 1296 dest(f).SetUint(i % j) 1297 return next 1298 } 1299 } 1300 } 1301 } 1302 1303 func remConst(n *node) { 1304 v0, v1 := n.child[0].rval, n.child[1].rval 1305 isConst := (v0.IsValid() && isConstantValue(v0.Type())) && (v1.IsValid() && isConstantValue(v1.Type())) 1306 t := n.typ.rtype 1307 if isConst { 1308 t = constVal 1309 } 1310 n.rval = reflect.New(t).Elem() 1311 switch { 1312 case isConst: 1313 cv0 := rconvConstInt(vConstantValue(v0)) 1314 cv1 := rconvConstInt(vConstantValue(v1)) 1315 v := constant.BinaryOp(constant.ToInt(cv0), token.REM, constant.ToInt(cv1)) 1316 n.rval.Set(reflect.ValueOf(v)) 1317 case isUint(t): 1318 n.rval.SetUint(vUint(v0) % vUint(v1)) 1319 case isInt(t): 1320 n.rval.SetInt(vInt(v0) % vInt(v1)) 1321 } 1322 } 1323 1324 func shl(n *node) { 1325 next := getExec(n.tnext) 1326 typ := n.typ.concrete().TypeOf() 1327 isInterface := n.typ.TypeOf().Kind() == reflect.Interface 1328 dest := genValueOutput(n, typ) 1329 c0, c1 := n.child[0], n.child[1] 1330 1331 switch typ.Kind() { 1332 case reflect.Interface, reflect.String: 1333 v0 := genValue(c0) 1334 v1 := genValue(c1) 1335 n.exec = func(f *frame) bltn { 1336 val0 := v0(f) 1337 val1 := v1(f) 1338 var value reflect.Value 1339 val0 = rconvNumber(val0) 1340 val1 = rconvNumber(val1) 1341 typ0 := val0.Type() 1342 typ1 := val1.Type() 1343 if isNumber(typ0) && isNumber(typ1) { 1344 switch { 1345 case isUint(typ0): 1346 switch { 1347 case isUint(typ1): 1348 value = reflect.ValueOf(val0.Uint() << val1.Uint()) 1349 case isInt(typ1): 1350 value = reflect.ValueOf(val0.Uint() << uint64(val1.Int())) 1351 case isFloat(typ1): 1352 value = reflect.ValueOf(val0.Uint() << uint64(val1.Float())) 1353 } 1354 case isInt(typ0): 1355 switch { 1356 case isUint(typ1): 1357 value = reflect.ValueOf(val0.Int() << int64(val1.Uint())) 1358 case isInt(typ1): 1359 value = reflect.ValueOf(val0.Int() << val1.Int()) 1360 case isFloat(typ1): 1361 value = reflect.ValueOf(val0.Int() << int64(val1.Float())) 1362 } 1363 case isFloat(typ0): 1364 switch { 1365 case isUint(typ1): 1366 value = reflect.ValueOf(int64(val0.Float()) << int64(val1.Uint())) 1367 case isInt(typ1): 1368 value = reflect.ValueOf(int64(val0.Float()) << int64(val1.Int())) 1369 case isFloat(typ1): 1370 value = reflect.ValueOf(int64(val0.Float()) << int64(val1.Float())) 1371 } 1372 } 1373 } else { 1374 panic(n.runErrorf("only numbers support << operator")) 1375 } 1376 v, _ := rconv(value, typ) 1377 dest(f).Set(v) 1378 return next 1379 } 1380 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 1381 switch { 1382 case isInterface: 1383 v0 := genValueInt(c0) 1384 v1 := genValueUint(c1) 1385 n.exec = func(f *frame) bltn { 1386 _, i := v0(f) 1387 _, j := v1(f) 1388 dest(f).Set(reflect.ValueOf(i << j).Convert(typ)) 1389 return next 1390 } 1391 case c0.rval.IsValid(): 1392 i := vInt(c0.rval) 1393 v1 := genValueUint(c1) 1394 n.exec = func(f *frame) bltn { 1395 _, j := v1(f) 1396 dest(f).SetInt(i << j) 1397 return next 1398 } 1399 case c1.rval.IsValid(): 1400 v0 := genValueInt(c0) 1401 j := vUint(c1.rval) 1402 n.exec = func(f *frame) bltn { 1403 _, i := v0(f) 1404 dest(f).SetInt(i << j) 1405 return next 1406 } 1407 default: 1408 v0 := genValueInt(c0) 1409 v1 := genValueUint(c1) 1410 n.exec = func(f *frame) bltn { 1411 _, i := v0(f) 1412 _, j := v1(f) 1413 dest(f).SetInt(i << j) 1414 return next 1415 } 1416 } 1417 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 1418 switch { 1419 case isInterface: 1420 v0 := genValueUint(c0) 1421 v1 := genValueUint(c1) 1422 n.exec = func(f *frame) bltn { 1423 _, i := v0(f) 1424 _, j := v1(f) 1425 dest(f).Set(reflect.ValueOf(i << j).Convert(typ)) 1426 return next 1427 } 1428 case c0.rval.IsValid(): 1429 i := vUint(c0.rval) 1430 v1 := genValueUint(c1) 1431 n.exec = func(f *frame) bltn { 1432 _, j := v1(f) 1433 dest(f).SetUint(i << j) 1434 return next 1435 } 1436 case c1.rval.IsValid(): 1437 j := vUint(c1.rval) 1438 v0 := genValueUint(c0) 1439 n.exec = func(f *frame) bltn { 1440 _, i := v0(f) 1441 dest(f).SetUint(i << j) 1442 return next 1443 } 1444 default: 1445 v0 := genValueUint(c0) 1446 v1 := genValueUint(c1) 1447 n.exec = func(f *frame) bltn { 1448 _, i := v0(f) 1449 _, j := v1(f) 1450 dest(f).SetUint(i << j) 1451 return next 1452 } 1453 } 1454 } 1455 } 1456 1457 func shlConst(n *node) { 1458 v0, v1 := n.child[0].rval, n.child[1].rval 1459 isConst := (v0.IsValid() && isConstantValue(v0.Type())) 1460 t := n.typ.rtype 1461 if isConst { 1462 t = constVal 1463 } 1464 n.rval = reflect.New(t).Elem() 1465 switch { 1466 case isConst: 1467 v := constant.Shift(vConstantValue(v0), token.SHL, uint(vUint(v1))) 1468 n.rval.Set(reflect.ValueOf(v)) 1469 case isUint(t): 1470 n.rval.SetUint(vUint(v0) << vUint(v1)) 1471 case isInt(t): 1472 n.rval.SetInt(vInt(v0) << vUint(v1)) 1473 } 1474 } 1475 1476 func shr(n *node) { 1477 next := getExec(n.tnext) 1478 typ := n.typ.concrete().TypeOf() 1479 isInterface := n.typ.TypeOf().Kind() == reflect.Interface 1480 dest := genValueOutput(n, typ) 1481 c0, c1 := n.child[0], n.child[1] 1482 1483 switch typ.Kind() { 1484 case reflect.Interface, reflect.String: 1485 v0 := genValue(c0) 1486 v1 := genValue(c1) 1487 n.exec = func(f *frame) bltn { 1488 val0 := v0(f) 1489 val1 := v1(f) 1490 var value reflect.Value 1491 val0 = rconvNumber(val0) 1492 val1 = rconvNumber(val1) 1493 typ0 := val0.Type() 1494 typ1 := val1.Type() 1495 if isNumber(typ0) && isNumber(typ1) { 1496 switch { 1497 case isUint(typ0): 1498 switch { 1499 case isUint(typ1): 1500 value = reflect.ValueOf(val0.Uint() >> val1.Uint()) 1501 case isInt(typ1): 1502 value = reflect.ValueOf(val0.Uint() >> uint64(val1.Int())) 1503 case isFloat(typ1): 1504 value = reflect.ValueOf(val0.Uint() >> uint64(val1.Float())) 1505 } 1506 case isInt(typ0): 1507 switch { 1508 case isUint(typ1): 1509 value = reflect.ValueOf(val0.Int() >> int64(val1.Uint())) 1510 case isInt(typ1): 1511 value = reflect.ValueOf(val0.Int() >> val1.Int()) 1512 case isFloat(typ1): 1513 value = reflect.ValueOf(val0.Int() >> int64(val1.Float())) 1514 } 1515 case isFloat(typ0): 1516 switch { 1517 case isUint(typ1): 1518 value = reflect.ValueOf(int64(val0.Float()) >> int64(val1.Uint())) 1519 case isInt(typ1): 1520 value = reflect.ValueOf(int64(val0.Float()) >> int64(val1.Int())) 1521 case isFloat(typ1): 1522 value = reflect.ValueOf(int64(val0.Float()) >> int64(val1.Float())) 1523 } 1524 } 1525 } else { 1526 panic(n.runErrorf("only numbers support >> operator")) 1527 } 1528 v, _ := rconv(value, typ) 1529 dest(f).Set(v) 1530 return next 1531 } 1532 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 1533 switch { 1534 case isInterface: 1535 v0 := genValueInt(c0) 1536 v1 := genValueUint(c1) 1537 n.exec = func(f *frame) bltn { 1538 _, i := v0(f) 1539 _, j := v1(f) 1540 dest(f).Set(reflect.ValueOf(i >> j).Convert(typ)) 1541 return next 1542 } 1543 case c0.rval.IsValid(): 1544 i := vInt(c0.rval) 1545 v1 := genValueUint(c1) 1546 n.exec = func(f *frame) bltn { 1547 _, j := v1(f) 1548 dest(f).SetInt(i >> j) 1549 return next 1550 } 1551 case c1.rval.IsValid(): 1552 v0 := genValueInt(c0) 1553 j := vUint(c1.rval) 1554 n.exec = func(f *frame) bltn { 1555 _, i := v0(f) 1556 dest(f).SetInt(i >> j) 1557 return next 1558 } 1559 default: 1560 v0 := genValueInt(c0) 1561 v1 := genValueUint(c1) 1562 n.exec = func(f *frame) bltn { 1563 _, i := v0(f) 1564 _, j := v1(f) 1565 dest(f).SetInt(i >> j) 1566 return next 1567 } 1568 } 1569 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 1570 switch { 1571 case isInterface: 1572 v0 := genValueUint(c0) 1573 v1 := genValueUint(c1) 1574 n.exec = func(f *frame) bltn { 1575 _, i := v0(f) 1576 _, j := v1(f) 1577 dest(f).Set(reflect.ValueOf(i >> j).Convert(typ)) 1578 return next 1579 } 1580 case c0.rval.IsValid(): 1581 i := vUint(c0.rval) 1582 v1 := genValueUint(c1) 1583 n.exec = func(f *frame) bltn { 1584 _, j := v1(f) 1585 dest(f).SetUint(i >> j) 1586 return next 1587 } 1588 case c1.rval.IsValid(): 1589 j := vUint(c1.rval) 1590 v0 := genValueUint(c0) 1591 n.exec = func(f *frame) bltn { 1592 _, i := v0(f) 1593 dest(f).SetUint(i >> j) 1594 return next 1595 } 1596 default: 1597 v0 := genValueUint(c0) 1598 v1 := genValueUint(c1) 1599 n.exec = func(f *frame) bltn { 1600 _, i := v0(f) 1601 _, j := v1(f) 1602 dest(f).SetUint(i >> j) 1603 return next 1604 } 1605 } 1606 } 1607 } 1608 1609 func shrConst(n *node) { 1610 v0, v1 := n.child[0].rval, n.child[1].rval 1611 isConst := (v0.IsValid() && isConstantValue(v0.Type())) 1612 t := n.typ.rtype 1613 if isConst { 1614 t = constVal 1615 } 1616 n.rval = reflect.New(t).Elem() 1617 switch { 1618 case isConst: 1619 v := constant.Shift(vConstantValue(v0), token.SHR, uint(vUint(v1))) 1620 n.rval.Set(reflect.ValueOf(v)) 1621 case isUint(t): 1622 n.rval.SetUint(vUint(v0) >> vUint(v1)) 1623 case isInt(t): 1624 n.rval.SetInt(vInt(v0) >> vUint(v1)) 1625 } 1626 } 1627 1628 func sub(n *node) { 1629 next := getExec(n.tnext) 1630 typ := n.typ.concrete().TypeOf() 1631 isInterface := n.typ.TypeOf().Kind() == reflect.Interface 1632 dest := genValueOutput(n, typ) 1633 c0, c1 := n.child[0], n.child[1] 1634 1635 switch typ.Kind() { 1636 case reflect.Interface, reflect.String: 1637 v0 := genValue(c0) 1638 v1 := genValue(c1) 1639 n.exec = func(f *frame) bltn { 1640 val0 := v0(f) 1641 val1 := v1(f) 1642 var value reflect.Value 1643 val0 = rconvNumber(val0) 1644 val1 = rconvNumber(val1) 1645 typ0 := val0.Type() 1646 typ1 := val1.Type() 1647 if isNumber(typ0) && isNumber(typ1) { 1648 switch { 1649 case isUint(typ0): 1650 switch { 1651 case isUint(typ1): 1652 value = reflect.ValueOf(val0.Uint() - val1.Uint()) 1653 case isInt(typ1): 1654 value = reflect.ValueOf(val0.Uint() - uint64(val1.Int())) 1655 case isFloat(typ1): 1656 value = reflect.ValueOf(val0.Uint() - uint64(val1.Float())) 1657 } 1658 case isInt(typ0): 1659 switch { 1660 case isUint(typ1): 1661 value = reflect.ValueOf(val0.Int() - int64(val1.Uint())) 1662 case isInt(typ1): 1663 value = reflect.ValueOf(val0.Int() - val1.Int()) 1664 case isFloat(typ1): 1665 value = reflect.ValueOf(val0.Int() - int64(val1.Float())) 1666 } 1667 case isFloat(typ0): 1668 switch { 1669 case isUint(typ1): 1670 value = reflect.ValueOf(val0.Float() - float64(val1.Uint())) 1671 case isInt(typ1): 1672 value = reflect.ValueOf(val0.Float() - float64(val1.Int())) 1673 case isFloat(typ1): 1674 value = reflect.ValueOf(val0.Float() - float64(val1.Float())) 1675 } 1676 } 1677 } else { 1678 panic(n.runErrorf("only numbers support - operator")) 1679 } 1680 v, _ := rconv(value, typ) 1681 dest(f).Set(v) 1682 return next 1683 } 1684 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 1685 switch { 1686 case isInterface: 1687 v0 := genValueInt(c0) 1688 v1 := genValueInt(c1) 1689 n.exec = func(f *frame) bltn { 1690 _, i := v0(f) 1691 _, j := v1(f) 1692 dest(f).Set(reflect.ValueOf(i - j).Convert(typ)) 1693 return next 1694 } 1695 case c0.rval.IsValid(): 1696 i := vInt(c0.rval) 1697 v1 := genValueInt(c1) 1698 n.exec = func(f *frame) bltn { 1699 _, j := v1(f) 1700 dest(f).SetInt(i - j) 1701 return next 1702 } 1703 case c1.rval.IsValid(): 1704 v0 := genValueInt(c0) 1705 j := vInt(c1.rval) 1706 n.exec = func(f *frame) bltn { 1707 _, i := v0(f) 1708 dest(f).SetInt(i - j) 1709 return next 1710 } 1711 default: 1712 v0 := genValueInt(c0) 1713 v1 := genValueInt(c1) 1714 n.exec = func(f *frame) bltn { 1715 _, i := v0(f) 1716 _, j := v1(f) 1717 dest(f).SetInt(i - j) 1718 return next 1719 } 1720 } 1721 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 1722 switch { 1723 case isInterface: 1724 v0 := genValueUint(c0) 1725 v1 := genValueUint(c1) 1726 n.exec = func(f *frame) bltn { 1727 _, i := v0(f) 1728 _, j := v1(f) 1729 dest(f).Set(reflect.ValueOf(i - j).Convert(typ)) 1730 return next 1731 } 1732 case c0.rval.IsValid(): 1733 i := vUint(c0.rval) 1734 v1 := genValueUint(c1) 1735 n.exec = func(f *frame) bltn { 1736 _, j := v1(f) 1737 dest(f).SetUint(i - j) 1738 return next 1739 } 1740 case c1.rval.IsValid(): 1741 j := vUint(c1.rval) 1742 v0 := genValueUint(c0) 1743 n.exec = func(f *frame) bltn { 1744 _, i := v0(f) 1745 dest(f).SetUint(i - j) 1746 return next 1747 } 1748 default: 1749 v0 := genValueUint(c0) 1750 v1 := genValueUint(c1) 1751 n.exec = func(f *frame) bltn { 1752 _, i := v0(f) 1753 _, j := v1(f) 1754 dest(f).SetUint(i - j) 1755 return next 1756 } 1757 } 1758 case reflect.Float32, reflect.Float64: 1759 switch { 1760 case isInterface: 1761 v0 := genValueFloat(c0) 1762 v1 := genValueFloat(c1) 1763 n.exec = func(f *frame) bltn { 1764 _, i := v0(f) 1765 _, j := v1(f) 1766 dest(f).Set(reflect.ValueOf(i - j).Convert(typ)) 1767 return next 1768 } 1769 case c0.rval.IsValid(): 1770 i := vFloat(c0.rval) 1771 v1 := genValueFloat(c1) 1772 n.exec = func(f *frame) bltn { 1773 _, j := v1(f) 1774 dest(f).SetFloat(i - j) 1775 return next 1776 } 1777 case c1.rval.IsValid(): 1778 j := vFloat(c1.rval) 1779 v0 := genValueFloat(c0) 1780 n.exec = func(f *frame) bltn { 1781 _, i := v0(f) 1782 dest(f).SetFloat(i - j) 1783 return next 1784 } 1785 default: 1786 v0 := genValueFloat(c0) 1787 v1 := genValueFloat(c1) 1788 n.exec = func(f *frame) bltn { 1789 _, i := v0(f) 1790 _, j := v1(f) 1791 dest(f).SetFloat(i - j) 1792 return next 1793 } 1794 } 1795 case reflect.Complex64, reflect.Complex128: 1796 switch { 1797 case isInterface: 1798 v0 := genComplex(c0) 1799 v1 := genComplex(c1) 1800 n.exec = func(f *frame) bltn { 1801 dest(f).Set(reflect.ValueOf(v0(f) - v1(f)).Convert(typ)) 1802 return next 1803 } 1804 case c0.rval.IsValid(): 1805 r0 := vComplex(c0.rval) 1806 v1 := genComplex(c1) 1807 n.exec = func(f *frame) bltn { 1808 dest(f).SetComplex(r0 - v1(f)) 1809 return next 1810 } 1811 case c1.rval.IsValid(): 1812 r1 := vComplex(c1.rval) 1813 v0 := genComplex(c0) 1814 n.exec = func(f *frame) bltn { 1815 dest(f).SetComplex(v0(f) - r1) 1816 return next 1817 } 1818 default: 1819 v0 := genComplex(c0) 1820 v1 := genComplex(c1) 1821 n.exec = func(f *frame) bltn { 1822 dest(f).SetComplex(v0(f) - v1(f)) 1823 return next 1824 } 1825 } 1826 } 1827 } 1828 1829 func subConst(n *node) { 1830 v0, v1 := n.child[0].rval, n.child[1].rval 1831 isConst := (v0.IsValid() && isConstantValue(v0.Type())) && (v1.IsValid() && isConstantValue(v1.Type())) 1832 t := n.typ.rtype 1833 if isConst { 1834 t = constVal 1835 } 1836 n.rval = reflect.New(t).Elem() 1837 switch { 1838 case isConst: 1839 cv0 := rconvConstNumber(vConstantValue(v0)) 1840 cv1 := rconvConstNumber(vConstantValue(v1)) 1841 v := constant.BinaryOp(cv0, token.SUB, cv1) 1842 n.rval.Set(reflect.ValueOf(v)) 1843 case isComplex(t): 1844 n.rval.SetComplex(vComplex(v0) - vComplex(v1)) 1845 case isFloat(t): 1846 n.rval.SetFloat(vFloat(v0) - vFloat(v1)) 1847 case isUint(t): 1848 n.rval.SetUint(vUint(v0) - vUint(v1)) 1849 case isInt(t): 1850 n.rval.SetInt(vInt(v0) - vInt(v1)) 1851 } 1852 } 1853 1854 func xor(n *node) { 1855 next := getExec(n.tnext) 1856 typ := n.typ.concrete().TypeOf() 1857 isInterface := n.typ.TypeOf().Kind() == reflect.Interface 1858 dest := genValueOutput(n, typ) 1859 c0, c1 := n.child[0], n.child[1] 1860 1861 switch typ.Kind() { 1862 case reflect.Interface, reflect.String: 1863 v0 := genValue(c0) 1864 v1 := genValue(c1) 1865 n.exec = func(f *frame) bltn { 1866 val0 := v0(f) 1867 val1 := v1(f) 1868 var value reflect.Value 1869 val0 = rconvNumber(val0) 1870 val1 = rconvNumber(val1) 1871 typ0 := val0.Type() 1872 typ1 := val1.Type() 1873 if isNumber(typ0) && isNumber(typ1) { 1874 switch { 1875 case isUint(typ0): 1876 switch { 1877 case isUint(typ1): 1878 value = reflect.ValueOf(val0.Uint() ^ val1.Uint()) 1879 case isInt(typ1): 1880 value = reflect.ValueOf(val0.Uint() ^ uint64(val1.Int())) 1881 case isFloat(typ1): 1882 value = reflect.ValueOf(val0.Uint() ^ uint64(val1.Float())) 1883 } 1884 case isInt(typ0): 1885 switch { 1886 case isUint(typ1): 1887 value = reflect.ValueOf(val0.Int() ^ int64(val1.Uint())) 1888 case isInt(typ1): 1889 value = reflect.ValueOf(val0.Int() ^ val1.Int()) 1890 case isFloat(typ1): 1891 value = reflect.ValueOf(val0.Int() ^ int64(val1.Float())) 1892 } 1893 case isFloat(typ0): 1894 switch { 1895 case isUint(typ1): 1896 value = reflect.ValueOf(int64(val0.Float()) ^ int64(val1.Uint())) 1897 case isInt(typ1): 1898 value = reflect.ValueOf(int64(val0.Float()) ^ int64(val1.Int())) 1899 case isFloat(typ1): 1900 value = reflect.ValueOf(int64(val0.Float()) ^ int64(val1.Float())) 1901 } 1902 } 1903 } else { 1904 panic(n.runErrorf("only numbers support ^ operator")) 1905 } 1906 v, _ := rconv(value, typ) 1907 dest(f).Set(v) 1908 return next 1909 } 1910 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 1911 switch { 1912 case isInterface: 1913 v0 := genValueInt(c0) 1914 v1 := genValueInt(c1) 1915 n.exec = func(f *frame) bltn { 1916 _, i := v0(f) 1917 _, j := v1(f) 1918 dest(f).Set(reflect.ValueOf(i ^ j).Convert(typ)) 1919 return next 1920 } 1921 case c0.rval.IsValid(): 1922 i := vInt(c0.rval) 1923 v1 := genValueInt(c1) 1924 n.exec = func(f *frame) bltn { 1925 _, j := v1(f) 1926 dest(f).SetInt(i ^ j) 1927 return next 1928 } 1929 case c1.rval.IsValid(): 1930 v0 := genValueInt(c0) 1931 j := vInt(c1.rval) 1932 n.exec = func(f *frame) bltn { 1933 _, i := v0(f) 1934 dest(f).SetInt(i ^ j) 1935 return next 1936 } 1937 default: 1938 v0 := genValueInt(c0) 1939 v1 := genValueInt(c1) 1940 n.exec = func(f *frame) bltn { 1941 _, i := v0(f) 1942 _, j := v1(f) 1943 dest(f).SetInt(i ^ j) 1944 return next 1945 } 1946 } 1947 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 1948 switch { 1949 case isInterface: 1950 v0 := genValueUint(c0) 1951 v1 := genValueUint(c1) 1952 n.exec = func(f *frame) bltn { 1953 _, i := v0(f) 1954 _, j := v1(f) 1955 dest(f).Set(reflect.ValueOf(i ^ j).Convert(typ)) 1956 return next 1957 } 1958 case c0.rval.IsValid(): 1959 i := vUint(c0.rval) 1960 v1 := genValueUint(c1) 1961 n.exec = func(f *frame) bltn { 1962 _, j := v1(f) 1963 dest(f).SetUint(i ^ j) 1964 return next 1965 } 1966 case c1.rval.IsValid(): 1967 j := vUint(c1.rval) 1968 v0 := genValueUint(c0) 1969 n.exec = func(f *frame) bltn { 1970 _, i := v0(f) 1971 dest(f).SetUint(i ^ j) 1972 return next 1973 } 1974 default: 1975 v0 := genValueUint(c0) 1976 v1 := genValueUint(c1) 1977 n.exec = func(f *frame) bltn { 1978 _, i := v0(f) 1979 _, j := v1(f) 1980 dest(f).SetUint(i ^ j) 1981 return next 1982 } 1983 } 1984 } 1985 } 1986 1987 func xorConst(n *node) { 1988 v0, v1 := n.child[0].rval, n.child[1].rval 1989 isConst := (v0.IsValid() && isConstantValue(v0.Type())) && (v1.IsValid() && isConstantValue(v1.Type())) 1990 t := n.typ.rtype 1991 if isConst { 1992 t = constVal 1993 } 1994 n.rval = reflect.New(t).Elem() 1995 switch { 1996 case isConst: 1997 cv0 := rconvConstInt(vConstantValue(v0)) 1998 cv1 := rconvConstInt(vConstantValue(v1)) 1999 v := constant.BinaryOp(constant.ToInt(cv0), token.XOR, constant.ToInt(cv1)) 2000 n.rval.Set(reflect.ValueOf(v)) 2001 case isUint(t): 2002 n.rval.SetUint(vUint(v0) ^ vUint(v1)) 2003 case isInt(t): 2004 n.rval.SetInt(vInt(v0) ^ vInt(v1)) 2005 } 2006 } 2007 2008 // Assign operators 2009 2010 func addAssign(n *node) { 2011 next := getExec(n.tnext) 2012 typ := n.typ.TypeOf() 2013 c0, c1 := n.child[0], n.child[1] 2014 setMap := isMapEntry(c0) 2015 var mapValue, indexValue func(*frame) reflect.Value 2016 2017 if setMap { 2018 mapValue = genValue(c0.child[0]) 2019 indexValue = genValue(c0.child[1]) 2020 } 2021 2022 if c1.rval.IsValid() { 2023 switch typ.Kind() { 2024 case reflect.String: 2025 v0 := genValueString(c0) 2026 v1 := vString(c1.rval) 2027 n.exec = func(f *frame) bltn { 2028 v, s := v0(f) 2029 v.SetString(s + v1) 2030 if setMap { 2031 mapValue(f).SetMapIndex(indexValue(f), v) 2032 } 2033 return next 2034 } 2035 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2036 v0 := genValueInt(c0) 2037 j := vInt(c1.rval) 2038 n.exec = func(f *frame) bltn { 2039 v, i := v0(f) 2040 v.SetInt(i + j) 2041 if setMap { 2042 mapValue(f).SetMapIndex(indexValue(f), v) 2043 } 2044 return next 2045 } 2046 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2047 v0 := genValueUint(c0) 2048 j := vUint(c1.rval) 2049 n.exec = func(f *frame) bltn { 2050 v, i := v0(f) 2051 v.SetUint(i + j) 2052 if setMap { 2053 mapValue(f).SetMapIndex(indexValue(f), v) 2054 } 2055 return next 2056 } 2057 case reflect.Float32, reflect.Float64: 2058 v0 := genValueFloat(c0) 2059 j := vFloat(c1.rval) 2060 n.exec = func(f *frame) bltn { 2061 v, i := v0(f) 2062 v.SetFloat(i + j) 2063 if setMap { 2064 mapValue(f).SetMapIndex(indexValue(f), v) 2065 } 2066 return next 2067 } 2068 case reflect.Complex64, reflect.Complex128: 2069 v0 := genValue(c0) 2070 v1 := vComplex(c1.rval) 2071 n.exec = func(f *frame) bltn { 2072 v := v0(f) 2073 v.SetComplex(v.Complex() + v1) 2074 if setMap { 2075 mapValue(f).SetMapIndex(indexValue(f), v) 2076 } 2077 return next 2078 } 2079 } 2080 } else { 2081 switch typ.Kind() { 2082 case reflect.String: 2083 v0 := genValueString(c0) 2084 v1 := genValue(c1) 2085 n.exec = func(f *frame) bltn { 2086 v, s := v0(f) 2087 v.SetString(s + v1(f).String()) 2088 if setMap { 2089 mapValue(f).SetMapIndex(indexValue(f), v) 2090 } 2091 return next 2092 } 2093 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2094 v0 := genValueInt(c0) 2095 v1 := genValueInt(c1) 2096 n.exec = func(f *frame) bltn { 2097 v, i := v0(f) 2098 _, j := v1(f) 2099 v.SetInt(i + j) 2100 if setMap { 2101 mapValue(f).SetMapIndex(indexValue(f), v) 2102 } 2103 return next 2104 } 2105 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2106 v0 := genValueUint(c0) 2107 v1 := genValueUint(c1) 2108 n.exec = func(f *frame) bltn { 2109 v, i := v0(f) 2110 _, j := v1(f) 2111 v.SetUint(i + j) 2112 if setMap { 2113 mapValue(f).SetMapIndex(indexValue(f), v) 2114 } 2115 return next 2116 } 2117 case reflect.Float32, reflect.Float64: 2118 v0 := genValueFloat(c0) 2119 v1 := genValueFloat(c1) 2120 n.exec = func(f *frame) bltn { 2121 v, i := v0(f) 2122 _, j := v1(f) 2123 v.SetFloat(i + j) 2124 if setMap { 2125 mapValue(f).SetMapIndex(indexValue(f), v) 2126 } 2127 return next 2128 } 2129 case reflect.Complex64, reflect.Complex128: 2130 v0 := genValue(c0) 2131 v1 := genValue(c1) 2132 n.exec = func(f *frame) bltn { 2133 v := v0(f) 2134 v.SetComplex(v.Complex() + v1(f).Complex()) 2135 if setMap { 2136 mapValue(f).SetMapIndex(indexValue(f), v) 2137 } 2138 return next 2139 } 2140 } 2141 } 2142 } 2143 2144 func andAssign(n *node) { 2145 next := getExec(n.tnext) 2146 typ := n.typ.TypeOf() 2147 c0, c1 := n.child[0], n.child[1] 2148 setMap := isMapEntry(c0) 2149 var mapValue, indexValue func(*frame) reflect.Value 2150 2151 if setMap { 2152 mapValue = genValue(c0.child[0]) 2153 indexValue = genValue(c0.child[1]) 2154 } 2155 2156 if c1.rval.IsValid() { 2157 switch typ.Kind() { 2158 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2159 v0 := genValueInt(c0) 2160 j := vInt(c1.rval) 2161 n.exec = func(f *frame) bltn { 2162 v, i := v0(f) 2163 v.SetInt(i & j) 2164 if setMap { 2165 mapValue(f).SetMapIndex(indexValue(f), v) 2166 } 2167 return next 2168 } 2169 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2170 v0 := genValueUint(c0) 2171 j := vUint(c1.rval) 2172 n.exec = func(f *frame) bltn { 2173 v, i := v0(f) 2174 v.SetUint(i & j) 2175 if setMap { 2176 mapValue(f).SetMapIndex(indexValue(f), v) 2177 } 2178 return next 2179 } 2180 } 2181 } else { 2182 switch typ.Kind() { 2183 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2184 v0 := genValueInt(c0) 2185 v1 := genValueInt(c1) 2186 n.exec = func(f *frame) bltn { 2187 v, i := v0(f) 2188 _, j := v1(f) 2189 v.SetInt(i & j) 2190 if setMap { 2191 mapValue(f).SetMapIndex(indexValue(f), v) 2192 } 2193 return next 2194 } 2195 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2196 v0 := genValueUint(c0) 2197 v1 := genValueUint(c1) 2198 n.exec = func(f *frame) bltn { 2199 v, i := v0(f) 2200 _, j := v1(f) 2201 v.SetUint(i & j) 2202 if setMap { 2203 mapValue(f).SetMapIndex(indexValue(f), v) 2204 } 2205 return next 2206 } 2207 } 2208 } 2209 } 2210 2211 func andNotAssign(n *node) { 2212 next := getExec(n.tnext) 2213 typ := n.typ.TypeOf() 2214 c0, c1 := n.child[0], n.child[1] 2215 setMap := isMapEntry(c0) 2216 var mapValue, indexValue func(*frame) reflect.Value 2217 2218 if setMap { 2219 mapValue = genValue(c0.child[0]) 2220 indexValue = genValue(c0.child[1]) 2221 } 2222 2223 if c1.rval.IsValid() { 2224 switch typ.Kind() { 2225 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2226 v0 := genValueInt(c0) 2227 j := vInt(c1.rval) 2228 n.exec = func(f *frame) bltn { 2229 v, i := v0(f) 2230 v.SetInt(i &^ j) 2231 if setMap { 2232 mapValue(f).SetMapIndex(indexValue(f), v) 2233 } 2234 return next 2235 } 2236 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2237 v0 := genValueUint(c0) 2238 j := vUint(c1.rval) 2239 n.exec = func(f *frame) bltn { 2240 v, i := v0(f) 2241 v.SetUint(i &^ j) 2242 if setMap { 2243 mapValue(f).SetMapIndex(indexValue(f), v) 2244 } 2245 return next 2246 } 2247 } 2248 } else { 2249 switch typ.Kind() { 2250 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2251 v0 := genValueInt(c0) 2252 v1 := genValueInt(c1) 2253 n.exec = func(f *frame) bltn { 2254 v, i := v0(f) 2255 _, j := v1(f) 2256 v.SetInt(i &^ j) 2257 if setMap { 2258 mapValue(f).SetMapIndex(indexValue(f), v) 2259 } 2260 return next 2261 } 2262 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2263 v0 := genValueUint(c0) 2264 v1 := genValueUint(c1) 2265 n.exec = func(f *frame) bltn { 2266 v, i := v0(f) 2267 _, j := v1(f) 2268 v.SetUint(i &^ j) 2269 if setMap { 2270 mapValue(f).SetMapIndex(indexValue(f), v) 2271 } 2272 return next 2273 } 2274 } 2275 } 2276 } 2277 2278 func mulAssign(n *node) { 2279 next := getExec(n.tnext) 2280 typ := n.typ.TypeOf() 2281 c0, c1 := n.child[0], n.child[1] 2282 setMap := isMapEntry(c0) 2283 var mapValue, indexValue func(*frame) reflect.Value 2284 2285 if setMap { 2286 mapValue = genValue(c0.child[0]) 2287 indexValue = genValue(c0.child[1]) 2288 } 2289 2290 if c1.rval.IsValid() { 2291 switch typ.Kind() { 2292 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2293 v0 := genValueInt(c0) 2294 j := vInt(c1.rval) 2295 n.exec = func(f *frame) bltn { 2296 v, i := v0(f) 2297 v.SetInt(i * j) 2298 if setMap { 2299 mapValue(f).SetMapIndex(indexValue(f), v) 2300 } 2301 return next 2302 } 2303 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2304 v0 := genValueUint(c0) 2305 j := vUint(c1.rval) 2306 n.exec = func(f *frame) bltn { 2307 v, i := v0(f) 2308 v.SetUint(i * j) 2309 if setMap { 2310 mapValue(f).SetMapIndex(indexValue(f), v) 2311 } 2312 return next 2313 } 2314 case reflect.Float32, reflect.Float64: 2315 v0 := genValueFloat(c0) 2316 j := vFloat(c1.rval) 2317 n.exec = func(f *frame) bltn { 2318 v, i := v0(f) 2319 v.SetFloat(i * j) 2320 if setMap { 2321 mapValue(f).SetMapIndex(indexValue(f), v) 2322 } 2323 return next 2324 } 2325 case reflect.Complex64, reflect.Complex128: 2326 v0 := genValue(c0) 2327 v1 := vComplex(c1.rval) 2328 n.exec = func(f *frame) bltn { 2329 v := v0(f) 2330 v.SetComplex(v.Complex() * v1) 2331 if setMap { 2332 mapValue(f).SetMapIndex(indexValue(f), v) 2333 } 2334 return next 2335 } 2336 } 2337 } else { 2338 switch typ.Kind() { 2339 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2340 v0 := genValueInt(c0) 2341 v1 := genValueInt(c1) 2342 n.exec = func(f *frame) bltn { 2343 v, i := v0(f) 2344 _, j := v1(f) 2345 v.SetInt(i * j) 2346 if setMap { 2347 mapValue(f).SetMapIndex(indexValue(f), v) 2348 } 2349 return next 2350 } 2351 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2352 v0 := genValueUint(c0) 2353 v1 := genValueUint(c1) 2354 n.exec = func(f *frame) bltn { 2355 v, i := v0(f) 2356 _, j := v1(f) 2357 v.SetUint(i * j) 2358 if setMap { 2359 mapValue(f).SetMapIndex(indexValue(f), v) 2360 } 2361 return next 2362 } 2363 case reflect.Float32, reflect.Float64: 2364 v0 := genValueFloat(c0) 2365 v1 := genValueFloat(c1) 2366 n.exec = func(f *frame) bltn { 2367 v, i := v0(f) 2368 _, j := v1(f) 2369 v.SetFloat(i * j) 2370 if setMap { 2371 mapValue(f).SetMapIndex(indexValue(f), v) 2372 } 2373 return next 2374 } 2375 case reflect.Complex64, reflect.Complex128: 2376 v0 := genValue(c0) 2377 v1 := genValue(c1) 2378 n.exec = func(f *frame) bltn { 2379 v := v0(f) 2380 v.SetComplex(v.Complex() * v1(f).Complex()) 2381 if setMap { 2382 mapValue(f).SetMapIndex(indexValue(f), v) 2383 } 2384 return next 2385 } 2386 } 2387 } 2388 } 2389 2390 func orAssign(n *node) { 2391 next := getExec(n.tnext) 2392 typ := n.typ.TypeOf() 2393 c0, c1 := n.child[0], n.child[1] 2394 setMap := isMapEntry(c0) 2395 var mapValue, indexValue func(*frame) reflect.Value 2396 2397 if setMap { 2398 mapValue = genValue(c0.child[0]) 2399 indexValue = genValue(c0.child[1]) 2400 } 2401 2402 if c1.rval.IsValid() { 2403 switch typ.Kind() { 2404 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2405 v0 := genValueInt(c0) 2406 j := vInt(c1.rval) 2407 n.exec = func(f *frame) bltn { 2408 v, i := v0(f) 2409 v.SetInt(i | j) 2410 if setMap { 2411 mapValue(f).SetMapIndex(indexValue(f), v) 2412 } 2413 return next 2414 } 2415 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2416 v0 := genValueUint(c0) 2417 j := vUint(c1.rval) 2418 n.exec = func(f *frame) bltn { 2419 v, i := v0(f) 2420 v.SetUint(i | j) 2421 if setMap { 2422 mapValue(f).SetMapIndex(indexValue(f), v) 2423 } 2424 return next 2425 } 2426 } 2427 } else { 2428 switch typ.Kind() { 2429 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2430 v0 := genValueInt(c0) 2431 v1 := genValueInt(c1) 2432 n.exec = func(f *frame) bltn { 2433 v, i := v0(f) 2434 _, j := v1(f) 2435 v.SetInt(i | j) 2436 if setMap { 2437 mapValue(f).SetMapIndex(indexValue(f), v) 2438 } 2439 return next 2440 } 2441 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2442 v0 := genValueUint(c0) 2443 v1 := genValueUint(c1) 2444 n.exec = func(f *frame) bltn { 2445 v, i := v0(f) 2446 _, j := v1(f) 2447 v.SetUint(i | j) 2448 if setMap { 2449 mapValue(f).SetMapIndex(indexValue(f), v) 2450 } 2451 return next 2452 } 2453 } 2454 } 2455 } 2456 2457 func quoAssign(n *node) { 2458 next := getExec(n.tnext) 2459 typ := n.typ.TypeOf() 2460 c0, c1 := n.child[0], n.child[1] 2461 setMap := isMapEntry(c0) 2462 var mapValue, indexValue func(*frame) reflect.Value 2463 2464 if setMap { 2465 mapValue = genValue(c0.child[0]) 2466 indexValue = genValue(c0.child[1]) 2467 } 2468 2469 if c1.rval.IsValid() { 2470 switch typ.Kind() { 2471 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2472 v0 := genValueInt(c0) 2473 j := vInt(c1.rval) 2474 n.exec = func(f *frame) bltn { 2475 v, i := v0(f) 2476 v.SetInt(i / j) 2477 if setMap { 2478 mapValue(f).SetMapIndex(indexValue(f), v) 2479 } 2480 return next 2481 } 2482 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2483 v0 := genValueUint(c0) 2484 j := vUint(c1.rval) 2485 n.exec = func(f *frame) bltn { 2486 v, i := v0(f) 2487 v.SetUint(i / j) 2488 if setMap { 2489 mapValue(f).SetMapIndex(indexValue(f), v) 2490 } 2491 return next 2492 } 2493 case reflect.Float32, reflect.Float64: 2494 v0 := genValueFloat(c0) 2495 j := vFloat(c1.rval) 2496 n.exec = func(f *frame) bltn { 2497 v, i := v0(f) 2498 v.SetFloat(i / j) 2499 if setMap { 2500 mapValue(f).SetMapIndex(indexValue(f), v) 2501 } 2502 return next 2503 } 2504 case reflect.Complex64, reflect.Complex128: 2505 v0 := genValue(c0) 2506 v1 := vComplex(c1.rval) 2507 n.exec = func(f *frame) bltn { 2508 v := v0(f) 2509 v.SetComplex(v.Complex() / v1) 2510 if setMap { 2511 mapValue(f).SetMapIndex(indexValue(f), v) 2512 } 2513 return next 2514 } 2515 } 2516 } else { 2517 switch typ.Kind() { 2518 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2519 v0 := genValueInt(c0) 2520 v1 := genValueInt(c1) 2521 n.exec = func(f *frame) bltn { 2522 v, i := v0(f) 2523 _, j := v1(f) 2524 v.SetInt(i / j) 2525 if setMap { 2526 mapValue(f).SetMapIndex(indexValue(f), v) 2527 } 2528 return next 2529 } 2530 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2531 v0 := genValueUint(c0) 2532 v1 := genValueUint(c1) 2533 n.exec = func(f *frame) bltn { 2534 v, i := v0(f) 2535 _, j := v1(f) 2536 v.SetUint(i / j) 2537 if setMap { 2538 mapValue(f).SetMapIndex(indexValue(f), v) 2539 } 2540 return next 2541 } 2542 case reflect.Float32, reflect.Float64: 2543 v0 := genValueFloat(c0) 2544 v1 := genValueFloat(c1) 2545 n.exec = func(f *frame) bltn { 2546 v, i := v0(f) 2547 _, j := v1(f) 2548 v.SetFloat(i / j) 2549 if setMap { 2550 mapValue(f).SetMapIndex(indexValue(f), v) 2551 } 2552 return next 2553 } 2554 case reflect.Complex64, reflect.Complex128: 2555 v0 := genValue(c0) 2556 v1 := genValue(c1) 2557 n.exec = func(f *frame) bltn { 2558 v := v0(f) 2559 v.SetComplex(v.Complex() / v1(f).Complex()) 2560 if setMap { 2561 mapValue(f).SetMapIndex(indexValue(f), v) 2562 } 2563 return next 2564 } 2565 } 2566 } 2567 } 2568 2569 func remAssign(n *node) { 2570 next := getExec(n.tnext) 2571 typ := n.typ.TypeOf() 2572 c0, c1 := n.child[0], n.child[1] 2573 setMap := isMapEntry(c0) 2574 var mapValue, indexValue func(*frame) reflect.Value 2575 2576 if setMap { 2577 mapValue = genValue(c0.child[0]) 2578 indexValue = genValue(c0.child[1]) 2579 } 2580 2581 if c1.rval.IsValid() { 2582 switch typ.Kind() { 2583 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2584 v0 := genValueInt(c0) 2585 j := vInt(c1.rval) 2586 n.exec = func(f *frame) bltn { 2587 v, i := v0(f) 2588 v.SetInt(i % j) 2589 if setMap { 2590 mapValue(f).SetMapIndex(indexValue(f), v) 2591 } 2592 return next 2593 } 2594 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2595 v0 := genValueUint(c0) 2596 j := vUint(c1.rval) 2597 n.exec = func(f *frame) bltn { 2598 v, i := v0(f) 2599 v.SetUint(i % j) 2600 if setMap { 2601 mapValue(f).SetMapIndex(indexValue(f), v) 2602 } 2603 return next 2604 } 2605 } 2606 } else { 2607 switch typ.Kind() { 2608 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2609 v0 := genValueInt(c0) 2610 v1 := genValueInt(c1) 2611 n.exec = func(f *frame) bltn { 2612 v, i := v0(f) 2613 _, j := v1(f) 2614 v.SetInt(i % j) 2615 if setMap { 2616 mapValue(f).SetMapIndex(indexValue(f), v) 2617 } 2618 return next 2619 } 2620 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2621 v0 := genValueUint(c0) 2622 v1 := genValueUint(c1) 2623 n.exec = func(f *frame) bltn { 2624 v, i := v0(f) 2625 _, j := v1(f) 2626 v.SetUint(i % j) 2627 if setMap { 2628 mapValue(f).SetMapIndex(indexValue(f), v) 2629 } 2630 return next 2631 } 2632 } 2633 } 2634 } 2635 2636 func shlAssign(n *node) { 2637 next := getExec(n.tnext) 2638 typ := n.typ.TypeOf() 2639 c0, c1 := n.child[0], n.child[1] 2640 setMap := isMapEntry(c0) 2641 var mapValue, indexValue func(*frame) reflect.Value 2642 2643 if setMap { 2644 mapValue = genValue(c0.child[0]) 2645 indexValue = genValue(c0.child[1]) 2646 } 2647 2648 if c1.rval.IsValid() { 2649 switch typ.Kind() { 2650 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2651 v0 := genValueInt(c0) 2652 j := vUint(c1.rval) 2653 n.exec = func(f *frame) bltn { 2654 v, i := v0(f) 2655 v.SetInt(i << j) 2656 if setMap { 2657 mapValue(f).SetMapIndex(indexValue(f), v) 2658 } 2659 return next 2660 } 2661 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2662 v0 := genValueUint(c0) 2663 j := vUint(c1.rval) 2664 n.exec = func(f *frame) bltn { 2665 v, i := v0(f) 2666 v.SetUint(i << j) 2667 if setMap { 2668 mapValue(f).SetMapIndex(indexValue(f), v) 2669 } 2670 return next 2671 } 2672 } 2673 } else { 2674 switch typ.Kind() { 2675 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2676 v0 := genValueInt(c0) 2677 v1 := genValueUint(c1) 2678 n.exec = func(f *frame) bltn { 2679 v, i := v0(f) 2680 _, j := v1(f) 2681 v.SetInt(i << j) 2682 if setMap { 2683 mapValue(f).SetMapIndex(indexValue(f), v) 2684 } 2685 return next 2686 } 2687 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2688 v0 := genValueUint(c0) 2689 v1 := genValueUint(c1) 2690 n.exec = func(f *frame) bltn { 2691 v, i := v0(f) 2692 _, j := v1(f) 2693 v.SetUint(i << j) 2694 if setMap { 2695 mapValue(f).SetMapIndex(indexValue(f), v) 2696 } 2697 return next 2698 } 2699 } 2700 } 2701 } 2702 2703 func shrAssign(n *node) { 2704 next := getExec(n.tnext) 2705 typ := n.typ.TypeOf() 2706 c0, c1 := n.child[0], n.child[1] 2707 setMap := isMapEntry(c0) 2708 var mapValue, indexValue func(*frame) reflect.Value 2709 2710 if setMap { 2711 mapValue = genValue(c0.child[0]) 2712 indexValue = genValue(c0.child[1]) 2713 } 2714 2715 if c1.rval.IsValid() { 2716 switch typ.Kind() { 2717 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2718 v0 := genValueInt(c0) 2719 j := vUint(c1.rval) 2720 n.exec = func(f *frame) bltn { 2721 v, i := v0(f) 2722 v.SetInt(i >> j) 2723 if setMap { 2724 mapValue(f).SetMapIndex(indexValue(f), v) 2725 } 2726 return next 2727 } 2728 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2729 v0 := genValueUint(c0) 2730 j := vUint(c1.rval) 2731 n.exec = func(f *frame) bltn { 2732 v, i := v0(f) 2733 v.SetUint(i >> j) 2734 if setMap { 2735 mapValue(f).SetMapIndex(indexValue(f), v) 2736 } 2737 return next 2738 } 2739 } 2740 } else { 2741 switch typ.Kind() { 2742 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2743 v0 := genValueInt(c0) 2744 v1 := genValueUint(c1) 2745 n.exec = func(f *frame) bltn { 2746 v, i := v0(f) 2747 _, j := v1(f) 2748 v.SetInt(i >> j) 2749 if setMap { 2750 mapValue(f).SetMapIndex(indexValue(f), v) 2751 } 2752 return next 2753 } 2754 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2755 v0 := genValueUint(c0) 2756 v1 := genValueUint(c1) 2757 n.exec = func(f *frame) bltn { 2758 v, i := v0(f) 2759 _, j := v1(f) 2760 v.SetUint(i >> j) 2761 if setMap { 2762 mapValue(f).SetMapIndex(indexValue(f), v) 2763 } 2764 return next 2765 } 2766 } 2767 } 2768 } 2769 2770 func subAssign(n *node) { 2771 next := getExec(n.tnext) 2772 typ := n.typ.TypeOf() 2773 c0, c1 := n.child[0], n.child[1] 2774 setMap := isMapEntry(c0) 2775 var mapValue, indexValue func(*frame) reflect.Value 2776 2777 if setMap { 2778 mapValue = genValue(c0.child[0]) 2779 indexValue = genValue(c0.child[1]) 2780 } 2781 2782 if c1.rval.IsValid() { 2783 switch typ.Kind() { 2784 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2785 v0 := genValueInt(c0) 2786 j := vInt(c1.rval) 2787 n.exec = func(f *frame) bltn { 2788 v, i := v0(f) 2789 v.SetInt(i - j) 2790 if setMap { 2791 mapValue(f).SetMapIndex(indexValue(f), v) 2792 } 2793 return next 2794 } 2795 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2796 v0 := genValueUint(c0) 2797 j := vUint(c1.rval) 2798 n.exec = func(f *frame) bltn { 2799 v, i := v0(f) 2800 v.SetUint(i - j) 2801 if setMap { 2802 mapValue(f).SetMapIndex(indexValue(f), v) 2803 } 2804 return next 2805 } 2806 case reflect.Float32, reflect.Float64: 2807 v0 := genValueFloat(c0) 2808 j := vFloat(c1.rval) 2809 n.exec = func(f *frame) bltn { 2810 v, i := v0(f) 2811 v.SetFloat(i - j) 2812 if setMap { 2813 mapValue(f).SetMapIndex(indexValue(f), v) 2814 } 2815 return next 2816 } 2817 case reflect.Complex64, reflect.Complex128: 2818 v0 := genValue(c0) 2819 v1 := vComplex(c1.rval) 2820 n.exec = func(f *frame) bltn { 2821 v := v0(f) 2822 v.SetComplex(v.Complex() - v1) 2823 if setMap { 2824 mapValue(f).SetMapIndex(indexValue(f), v) 2825 } 2826 return next 2827 } 2828 } 2829 } else { 2830 switch typ.Kind() { 2831 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2832 v0 := genValueInt(c0) 2833 v1 := genValueInt(c1) 2834 n.exec = func(f *frame) bltn { 2835 v, i := v0(f) 2836 _, j := v1(f) 2837 v.SetInt(i - j) 2838 if setMap { 2839 mapValue(f).SetMapIndex(indexValue(f), v) 2840 } 2841 return next 2842 } 2843 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2844 v0 := genValueUint(c0) 2845 v1 := genValueUint(c1) 2846 n.exec = func(f *frame) bltn { 2847 v, i := v0(f) 2848 _, j := v1(f) 2849 v.SetUint(i - j) 2850 if setMap { 2851 mapValue(f).SetMapIndex(indexValue(f), v) 2852 } 2853 return next 2854 } 2855 case reflect.Float32, reflect.Float64: 2856 v0 := genValueFloat(c0) 2857 v1 := genValueFloat(c1) 2858 n.exec = func(f *frame) bltn { 2859 v, i := v0(f) 2860 _, j := v1(f) 2861 v.SetFloat(i - j) 2862 if setMap { 2863 mapValue(f).SetMapIndex(indexValue(f), v) 2864 } 2865 return next 2866 } 2867 case reflect.Complex64, reflect.Complex128: 2868 v0 := genValue(c0) 2869 v1 := genValue(c1) 2870 n.exec = func(f *frame) bltn { 2871 v := v0(f) 2872 v.SetComplex(v.Complex() - v1(f).Complex()) 2873 if setMap { 2874 mapValue(f).SetMapIndex(indexValue(f), v) 2875 } 2876 return next 2877 } 2878 } 2879 } 2880 } 2881 2882 func xorAssign(n *node) { 2883 next := getExec(n.tnext) 2884 typ := n.typ.TypeOf() 2885 c0, c1 := n.child[0], n.child[1] 2886 setMap := isMapEntry(c0) 2887 var mapValue, indexValue func(*frame) reflect.Value 2888 2889 if setMap { 2890 mapValue = genValue(c0.child[0]) 2891 indexValue = genValue(c0.child[1]) 2892 } 2893 2894 if c1.rval.IsValid() { 2895 switch typ.Kind() { 2896 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2897 v0 := genValueInt(c0) 2898 j := vInt(c1.rval) 2899 n.exec = func(f *frame) bltn { 2900 v, i := v0(f) 2901 v.SetInt(i ^ j) 2902 if setMap { 2903 mapValue(f).SetMapIndex(indexValue(f), v) 2904 } 2905 return next 2906 } 2907 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2908 v0 := genValueUint(c0) 2909 j := vUint(c1.rval) 2910 n.exec = func(f *frame) bltn { 2911 v, i := v0(f) 2912 v.SetUint(i ^ j) 2913 if setMap { 2914 mapValue(f).SetMapIndex(indexValue(f), v) 2915 } 2916 return next 2917 } 2918 } 2919 } else { 2920 switch typ.Kind() { 2921 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2922 v0 := genValueInt(c0) 2923 v1 := genValueInt(c1) 2924 n.exec = func(f *frame) bltn { 2925 v, i := v0(f) 2926 _, j := v1(f) 2927 v.SetInt(i ^ j) 2928 if setMap { 2929 mapValue(f).SetMapIndex(indexValue(f), v) 2930 } 2931 return next 2932 } 2933 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 2934 v0 := genValueUint(c0) 2935 v1 := genValueUint(c1) 2936 n.exec = func(f *frame) bltn { 2937 v, i := v0(f) 2938 _, j := v1(f) 2939 v.SetUint(i ^ j) 2940 if setMap { 2941 mapValue(f).SetMapIndex(indexValue(f), v) 2942 } 2943 return next 2944 } 2945 } 2946 } 2947 } 2948 2949 func dec(n *node) { 2950 next := getExec(n.tnext) 2951 typ := n.typ.TypeOf() 2952 c0 := n.child[0] 2953 setMap := isMapEntry(c0) 2954 var mapValue, indexValue func(*frame) reflect.Value 2955 2956 if setMap { 2957 mapValue = genValue(c0.child[0]) 2958 indexValue = genValue(c0.child[1]) 2959 } 2960 2961 switch typ.Kind() { 2962 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 2963 v0 := genValueInt(c0) 2964 n.exec = func(f *frame) bltn { 2965 v, i := v0(f) 2966 v.SetInt(i - 1) 2967 if setMap { 2968 mapValue(f).SetMapIndex(indexValue(f), v) 2969 } 2970 return next 2971 } 2972 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: 2973 v0 := genValueUint(c0) 2974 n.exec = func(f *frame) bltn { 2975 v, i := v0(f) 2976 v.SetUint(i - 1) 2977 if setMap { 2978 mapValue(f).SetMapIndex(indexValue(f), v) 2979 } 2980 return next 2981 } 2982 case reflect.Float32, reflect.Float64: 2983 v0 := genValueFloat(c0) 2984 n.exec = func(f *frame) bltn { 2985 v, i := v0(f) 2986 v.SetFloat(i - 1) 2987 if setMap { 2988 mapValue(f).SetMapIndex(indexValue(f), v) 2989 } 2990 return next 2991 } 2992 case reflect.Complex64, reflect.Complex128: 2993 v0 := genValue(c0) 2994 n.exec = func(f *frame) bltn { 2995 v := v0(f) 2996 v.SetComplex(v.Complex() - 1) 2997 if setMap { 2998 mapValue(f).SetMapIndex(indexValue(f), v) 2999 } 3000 return next 3001 } 3002 } 3003 } 3004 3005 func inc(n *node) { 3006 next := getExec(n.tnext) 3007 typ := n.typ.TypeOf() 3008 c0 := n.child[0] 3009 setMap := isMapEntry(c0) 3010 var mapValue, indexValue func(*frame) reflect.Value 3011 3012 if setMap { 3013 mapValue = genValue(c0.child[0]) 3014 indexValue = genValue(c0.child[1]) 3015 } 3016 3017 switch typ.Kind() { 3018 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 3019 v0 := genValueInt(c0) 3020 n.exec = func(f *frame) bltn { 3021 v, i := v0(f) 3022 v.SetInt(i + 1) 3023 if setMap { 3024 mapValue(f).SetMapIndex(indexValue(f), v) 3025 } 3026 return next 3027 } 3028 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: 3029 v0 := genValueUint(c0) 3030 n.exec = func(f *frame) bltn { 3031 v, i := v0(f) 3032 v.SetUint(i + 1) 3033 if setMap { 3034 mapValue(f).SetMapIndex(indexValue(f), v) 3035 } 3036 return next 3037 } 3038 case reflect.Float32, reflect.Float64: 3039 v0 := genValueFloat(c0) 3040 n.exec = func(f *frame) bltn { 3041 v, i := v0(f) 3042 v.SetFloat(i + 1) 3043 if setMap { 3044 mapValue(f).SetMapIndex(indexValue(f), v) 3045 } 3046 return next 3047 } 3048 case reflect.Complex64, reflect.Complex128: 3049 v0 := genValue(c0) 3050 n.exec = func(f *frame) bltn { 3051 v := v0(f) 3052 v.SetComplex(v.Complex() + 1) 3053 if setMap { 3054 mapValue(f).SetMapIndex(indexValue(f), v) 3055 } 3056 return next 3057 } 3058 } 3059 } 3060 3061 func bitNotConst(n *node) { 3062 v0 := n.child[0].rval 3063 isConst := v0.IsValid() && isConstantValue(v0.Type()) 3064 t := n.typ.rtype 3065 if isConst { 3066 t = constVal 3067 } 3068 n.rval = reflect.New(t).Elem() 3069 switch { 3070 case isConst: 3071 v := constant.UnaryOp(token.XOR, vConstantValue(v0), 0) 3072 n.rval.Set(reflect.ValueOf(v)) 3073 case isUint(t): 3074 n.rval.SetUint(^v0.Uint()) 3075 case isInt(t): 3076 n.rval.SetInt(^v0.Int()) 3077 } 3078 } 3079 3080 func negConst(n *node) { 3081 v0 := n.child[0].rval 3082 isConst := v0.IsValid() && isConstantValue(v0.Type()) 3083 t := n.typ.rtype 3084 if isConst { 3085 t = constVal 3086 } 3087 n.rval = reflect.New(t).Elem() 3088 switch { 3089 case isConst: 3090 v := constant.UnaryOp(token.SUB, vConstantValue(v0), 0) 3091 n.rval.Set(reflect.ValueOf(v)) 3092 case isUint(t): 3093 n.rval.SetUint(-v0.Uint()) 3094 case isInt(t): 3095 n.rval.SetInt(-v0.Int()) 3096 case isFloat(t): 3097 n.rval.SetFloat(-v0.Float()) 3098 case isComplex(t): 3099 n.rval.SetComplex(-v0.Complex()) 3100 } 3101 } 3102 3103 func notConst(n *node) { 3104 v0 := n.child[0].rval 3105 isConst := v0.IsValid() && isConstantValue(v0.Type()) 3106 t := n.typ.rtype 3107 if isConst { 3108 t = constVal 3109 } 3110 n.rval = reflect.New(t).Elem() 3111 if isConst { 3112 v := constant.UnaryOp(token.NOT, rconvConstBool(vConstantValue(v0)), 0) 3113 n.rval.Set(reflect.ValueOf(v)) 3114 } else { 3115 n.rval.SetBool(!v0.Bool()) 3116 } 3117 } 3118 3119 func posConst(n *node) { 3120 v0 := n.child[0].rval 3121 isConst := v0.IsValid() && isConstantValue(v0.Type()) 3122 t := n.typ.rtype 3123 if isConst { 3124 t = constVal 3125 } 3126 n.rval = reflect.New(t).Elem() 3127 switch { 3128 case isConst: 3129 v := constant.UnaryOp(token.ADD, vConstantValue(v0), 0) 3130 n.rval.Set(reflect.ValueOf(v)) 3131 case isUint(t): 3132 n.rval.SetUint(+v0.Uint()) 3133 case isInt(t): 3134 n.rval.SetInt(+v0.Int()) 3135 case isFloat(t): 3136 n.rval.SetFloat(+v0.Float()) 3137 case isComplex(t): 3138 n.rval.SetComplex(+v0.Complex()) 3139 } 3140 } 3141 3142 func equal(n *node) { 3143 tnext := getExec(n.tnext) 3144 dest := genValueOutput(n, reflect.TypeOf(true)) 3145 typ := n.typ.concrete().TypeOf() 3146 isInterface := n.typ.TypeOf().Kind() == reflect.Interface 3147 c0, c1 := n.child[0], n.child[1] 3148 t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf() 3149 3150 if c0.typ.cat == aliasT || c1.typ.cat == aliasT { 3151 switch { 3152 case isInterface: 3153 v0 := genValue(c0) 3154 v1 := genValue(c1) 3155 dest := genValue(n) 3156 n.exec = func(f *frame) bltn { 3157 i0 := v0(f).Interface() 3158 i1 := v1(f).Interface() 3159 dest(f).Set(reflect.ValueOf(i0 == i1).Convert(typ)) 3160 return tnext 3161 } 3162 case c0.rval.IsValid(): 3163 i0 := c0.rval.Interface() 3164 v1 := genValue(c1) 3165 if n.fnext != nil { 3166 fnext := getExec(n.fnext) 3167 n.exec = func(f *frame) bltn { 3168 i1 := v1(f).Interface() 3169 if i0 == i1 { 3170 dest(f).SetBool(true) 3171 return tnext 3172 } 3173 dest(f).SetBool(false) 3174 return fnext 3175 } 3176 } else { 3177 dest := genValue(n) 3178 n.exec = func(f *frame) bltn { 3179 i1 := v1(f).Interface() 3180 dest(f).SetBool(i0 == i1) 3181 return tnext 3182 } 3183 } 3184 case c1.rval.IsValid(): 3185 i1 := c1.rval.Interface() 3186 v0 := genValue(c0) 3187 if n.fnext != nil { 3188 fnext := getExec(n.fnext) 3189 n.exec = func(f *frame) bltn { 3190 i0 := v0(f).Interface() 3191 if i0 == i1 { 3192 dest(f).SetBool(true) 3193 return tnext 3194 } 3195 dest(f).SetBool(false) 3196 return fnext 3197 } 3198 } else { 3199 dest := genValue(n) 3200 n.exec = func(f *frame) bltn { 3201 i0 := v0(f).Interface() 3202 dest(f).SetBool(i0 == i1) 3203 return tnext 3204 } 3205 } 3206 default: 3207 v0 := genValue(c0) 3208 v1 := genValue(c1) 3209 if n.fnext != nil { 3210 fnext := getExec(n.fnext) 3211 n.exec = func(f *frame) bltn { 3212 i0 := v0(f).Interface() 3213 i1 := v1(f).Interface() 3214 if i0 == i1 { 3215 dest(f).SetBool(true) 3216 return tnext 3217 } 3218 dest(f).SetBool(false) 3219 return fnext 3220 } 3221 } else { 3222 dest := genValue(n) 3223 n.exec = func(f *frame) bltn { 3224 i0 := v0(f).Interface() 3225 i1 := v1(f).Interface() 3226 dest(f).SetBool(i0 == i1) 3227 return tnext 3228 } 3229 } 3230 } 3231 return 3232 } 3233 3234 // Do not attempt to optimize '==' or '!=' if an operand is an interface. 3235 // This will preserve proper dynamic type checking at runtime. For static types, 3236 // type checks are already performed, so bypass them if possible. 3237 if t0.Kind() == reflect.Interface || t1.Kind() == reflect.Interface { 3238 v0 := genValue(c0) 3239 v1 := genValue(c1) 3240 if n.fnext != nil { 3241 fnext := getExec(n.fnext) 3242 n.exec = func(f *frame) bltn { 3243 val0 := v0(f) 3244 val1 := v1(f) 3245 var err error 3246 var typ0 reflect.Type 3247 if val0.Kind() == reflect.Interface && val0.Elem().IsValid() { 3248 typ0 = val0.Elem().Type() 3249 } else { 3250 typ0 = val0.Type() 3251 } 3252 val1, err = rconv(val1, typ0) 3253 if err != nil { 3254 panic(err) 3255 } 3256 i0 := val0.Interface() 3257 i1 := val1.Interface() 3258 if i0 == i1 { 3259 dest(f).SetBool(true) 3260 return tnext 3261 } 3262 dest(f).SetBool(false) 3263 return fnext 3264 } 3265 } else { 3266 dest := genValue(n) 3267 n.exec = func(f *frame) bltn { 3268 i0 := v0(f).Interface() 3269 i1 := v1(f).Interface() 3270 x := i0 == i1 3271 dest(f).Set(reflect.ValueOf(x)) 3272 return tnext 3273 } 3274 } 3275 return 3276 } 3277 3278 switch { 3279 case isString(t0) || isString(t1): 3280 switch { 3281 case isInterface: 3282 v0 := genValueString(c0) 3283 v1 := genValueString(c1) 3284 n.exec = func(f *frame) bltn { 3285 _, s0 := v0(f) 3286 _, s1 := v1(f) 3287 dest(f).Set(reflect.ValueOf(s0 == s1).Convert(typ)) 3288 return tnext 3289 } 3290 case c0.rval.IsValid(): 3291 s0 := vString(c0.rval) 3292 c0Bool := c0.rval.Kind() == reflect.Bool 3293 v1 := genValueString(c1) 3294 if n.fnext != nil { 3295 fnext := getExec(n.fnext) 3296 n.exec = func(f *frame) bltn { 3297 _, s1 := v1(f) 3298 if s0 == s1 || c0Bool && cast.ToBool(s1) { 3299 dest(f).SetBool(true) 3300 return tnext 3301 } 3302 dest(f).SetBool(false) 3303 return fnext 3304 } 3305 } else { 3306 n.exec = func(f *frame) bltn { 3307 _, s1 := v1(f) 3308 dest(f).SetBool(s0 == s1) 3309 return tnext 3310 } 3311 } 3312 case c1.rval.IsValid(): 3313 s1 := vString(c1.rval) 3314 v0 := genValueString(c0) 3315 if n.fnext != nil { 3316 fnext := getExec(n.fnext) 3317 n.exec = func(f *frame) bltn { 3318 _, s0 := v0(f) 3319 if s0 == s1 { 3320 dest(f).SetBool(true) 3321 return tnext 3322 } 3323 dest(f).SetBool(false) 3324 return fnext 3325 } 3326 } else { 3327 n.exec = func(f *frame) bltn { 3328 _, s0 := v0(f) 3329 dest(f).SetBool(s0 == s1) 3330 return tnext 3331 } 3332 } 3333 default: 3334 v0 := genValueString(c0) 3335 v1 := genValueString(c1) 3336 if n.fnext != nil { 3337 fnext := getExec(n.fnext) 3338 n.exec = func(f *frame) bltn { 3339 _, s0 := v0(f) 3340 _, s1 := v1(f) 3341 if s0 == s1 { 3342 dest(f).SetBool(true) 3343 return tnext 3344 } 3345 dest(f).SetBool(false) 3346 return fnext 3347 } 3348 } else { 3349 n.exec = func(f *frame) bltn { 3350 _, s0 := v0(f) 3351 _, s1 := v1(f) 3352 dest(f).SetBool(s0 == s1) 3353 return tnext 3354 } 3355 } 3356 } 3357 case isFloat(t0) || isFloat(t1): 3358 switch { 3359 case isInterface: 3360 v0 := genValueFloat(c0) 3361 v1 := genValueFloat(c1) 3362 n.exec = func(f *frame) bltn { 3363 _, s0 := v0(f) 3364 _, s1 := v1(f) 3365 dest(f).Set(reflect.ValueOf(s0 == s1).Convert(typ)) 3366 return tnext 3367 } 3368 case c0.rval.IsValid(): 3369 s0 := vFloat(c0.rval) 3370 v1 := genValueFloat(c1) 3371 if n.fnext != nil { 3372 fnext := getExec(n.fnext) 3373 n.exec = func(f *frame) bltn { 3374 _, s1 := v1(f) 3375 if s0 == s1 { 3376 dest(f).SetBool(true) 3377 return tnext 3378 } 3379 dest(f).SetBool(false) 3380 return fnext 3381 } 3382 } else { 3383 n.exec = func(f *frame) bltn { 3384 _, s1 := v1(f) 3385 dest(f).SetBool(s0 == s1) 3386 return tnext 3387 } 3388 } 3389 case c1.rval.IsValid(): 3390 s1 := vFloat(c1.rval) 3391 v0 := genValueFloat(c0) 3392 if n.fnext != nil { 3393 fnext := getExec(n.fnext) 3394 n.exec = func(f *frame) bltn { 3395 _, s0 := v0(f) 3396 if s0 == s1 { 3397 dest(f).SetBool(true) 3398 return tnext 3399 } 3400 dest(f).SetBool(false) 3401 return fnext 3402 } 3403 } else { 3404 dest := genValue(n) 3405 n.exec = func(f *frame) bltn { 3406 _, s0 := v0(f) 3407 dest(f).SetBool(s0 == s1) 3408 return tnext 3409 } 3410 } 3411 default: 3412 v0 := genValueFloat(c0) 3413 v1 := genValueFloat(c1) 3414 if n.fnext != nil { 3415 fnext := getExec(n.fnext) 3416 n.exec = func(f *frame) bltn { 3417 _, s0 := v0(f) 3418 _, s1 := v1(f) 3419 if s0 == s1 { 3420 dest(f).SetBool(true) 3421 return tnext 3422 } 3423 dest(f).SetBool(false) 3424 return fnext 3425 } 3426 } else { 3427 dest := genValue(n) 3428 n.exec = func(f *frame) bltn { 3429 _, s0 := v0(f) 3430 _, s1 := v1(f) 3431 dest(f).SetBool(s0 == s1) 3432 return tnext 3433 } 3434 } 3435 } 3436 case isUint(t0) || isUint(t1): 3437 switch { 3438 case isInterface: 3439 v0 := genValueUint(c0) 3440 v1 := genValueUint(c1) 3441 n.exec = func(f *frame) bltn { 3442 _, s0 := v0(f) 3443 _, s1 := v1(f) 3444 dest(f).Set(reflect.ValueOf(s0 == s1).Convert(typ)) 3445 return tnext 3446 } 3447 case c0.rval.IsValid(): 3448 s0 := vUint(c0.rval) 3449 v1 := genValueUint(c1) 3450 if n.fnext != nil { 3451 fnext := getExec(n.fnext) 3452 n.exec = func(f *frame) bltn { 3453 _, s1 := v1(f) 3454 if s0 == s1 { 3455 dest(f).SetBool(true) 3456 return tnext 3457 } 3458 dest(f).SetBool(false) 3459 return fnext 3460 } 3461 } else { 3462 dest := genValue(n) 3463 n.exec = func(f *frame) bltn { 3464 _, s1 := v1(f) 3465 dest(f).SetBool(s0 == s1) 3466 return tnext 3467 } 3468 } 3469 case c1.rval.IsValid(): 3470 s1 := vUint(c1.rval) 3471 v0 := genValueUint(c0) 3472 if n.fnext != nil { 3473 fnext := getExec(n.fnext) 3474 n.exec = func(f *frame) bltn { 3475 _, s0 := v0(f) 3476 if s0 == s1 { 3477 dest(f).SetBool(true) 3478 return tnext 3479 } 3480 dest(f).SetBool(false) 3481 return fnext 3482 } 3483 } else { 3484 dest := genValue(n) 3485 n.exec = func(f *frame) bltn { 3486 _, s0 := v0(f) 3487 dest(f).SetBool(s0 == s1) 3488 return tnext 3489 } 3490 } 3491 default: 3492 v0 := genValueUint(c0) 3493 v1 := genValueUint(c1) 3494 if n.fnext != nil { 3495 fnext := getExec(n.fnext) 3496 n.exec = func(f *frame) bltn { 3497 _, s0 := v0(f) 3498 _, s1 := v1(f) 3499 if s0 == s1 { 3500 dest(f).SetBool(true) 3501 return tnext 3502 } 3503 dest(f).SetBool(false) 3504 return fnext 3505 } 3506 } else { 3507 dest := genValue(n) 3508 n.exec = func(f *frame) bltn { 3509 _, s0 := v0(f) 3510 _, s1 := v1(f) 3511 dest(f).SetBool(s0 == s1) 3512 return tnext 3513 } 3514 } 3515 } 3516 case isInt(t0) || isInt(t1): 3517 switch { 3518 case isInterface: 3519 v0 := genValueInt(c0) 3520 v1 := genValueInt(c1) 3521 n.exec = func(f *frame) bltn { 3522 _, s0 := v0(f) 3523 _, s1 := v1(f) 3524 dest(f).Set(reflect.ValueOf(s0 == s1).Convert(typ)) 3525 return tnext 3526 } 3527 case c0.rval.IsValid(): 3528 s0 := vInt(c0.rval) 3529 v1 := genValueInt(c1) 3530 if n.fnext != nil { 3531 fnext := getExec(n.fnext) 3532 n.exec = func(f *frame) bltn { 3533 _, s1 := v1(f) 3534 if s0 == s1 { 3535 dest(f).SetBool(true) 3536 return tnext 3537 } 3538 dest(f).SetBool(false) 3539 return fnext 3540 } 3541 } else { 3542 dest := genValue(n) 3543 n.exec = func(f *frame) bltn { 3544 _, s1 := v1(f) 3545 dest(f).SetBool(s0 == s1) 3546 return tnext 3547 } 3548 } 3549 case c1.rval.IsValid(): 3550 s1 := vInt(c1.rval) 3551 v0 := genValueInt(c0) 3552 if n.fnext != nil { 3553 fnext := getExec(n.fnext) 3554 n.exec = func(f *frame) bltn { 3555 _, s0 := v0(f) 3556 if s0 == s1 { 3557 dest(f).SetBool(true) 3558 return tnext 3559 } 3560 dest(f).SetBool(false) 3561 return fnext 3562 } 3563 } else { 3564 dest := genValue(n) 3565 n.exec = func(f *frame) bltn { 3566 _, s0 := v0(f) 3567 dest(f).SetBool(s0 == s1) 3568 return tnext 3569 } 3570 } 3571 default: 3572 v0 := genValueInt(c0) 3573 v1 := genValueInt(c1) 3574 if n.fnext != nil { 3575 fnext := getExec(n.fnext) 3576 n.exec = func(f *frame) bltn { 3577 _, s0 := v0(f) 3578 _, s1 := v1(f) 3579 if s0 == s1 { 3580 dest(f).SetBool(true) 3581 return tnext 3582 } 3583 dest(f).SetBool(false) 3584 return fnext 3585 } 3586 } else { 3587 dest := genValue(n) 3588 n.exec = func(f *frame) bltn { 3589 _, s0 := v0(f) 3590 _, s1 := v1(f) 3591 dest(f).SetBool(s0 == s1) 3592 return tnext 3593 } 3594 } 3595 } 3596 case isComplex(t0) || isComplex(t1): 3597 switch { 3598 case isInterface: 3599 v0 := genComplex(c0) 3600 v1 := genComplex(c1) 3601 n.exec = func(f *frame) bltn { 3602 s0 := v0(f) 3603 s1 := v1(f) 3604 dest(f).Set(reflect.ValueOf(s0 == s1).Convert(typ)) 3605 return tnext 3606 } 3607 case c0.rval.IsValid(): 3608 s0 := vComplex(c0.rval) 3609 v1 := genComplex(c1) 3610 if n.fnext != nil { 3611 fnext := getExec(n.fnext) 3612 n.exec = func(f *frame) bltn { 3613 s1 := v1(f) 3614 if s0 == s1 { 3615 dest(f).SetBool(true) 3616 return tnext 3617 } 3618 dest(f).SetBool(false) 3619 return fnext 3620 } 3621 } else { 3622 n.exec = func(f *frame) bltn { 3623 s1 := v1(f) 3624 dest(f).SetBool(s0 == s1) 3625 return tnext 3626 } 3627 } 3628 case c1.rval.IsValid(): 3629 s1 := vComplex(c1.rval) 3630 v0 := genComplex(c0) 3631 if n.fnext != nil { 3632 fnext := getExec(n.fnext) 3633 n.exec = func(f *frame) bltn { 3634 s0 := v0(f) 3635 if s0 == s1 { 3636 dest(f).SetBool(true) 3637 return tnext 3638 } 3639 dest(f).SetBool(false) 3640 return fnext 3641 } 3642 } else { 3643 dest := genValue(n) 3644 n.exec = func(f *frame) bltn { 3645 s0 := v0(f) 3646 dest(f).SetBool(s0 == s1) 3647 return tnext 3648 } 3649 } 3650 default: 3651 v0 := genComplex(c0) 3652 v1 := genComplex(c1) 3653 if n.fnext != nil { 3654 fnext := getExec(n.fnext) 3655 n.exec = func(f *frame) bltn { 3656 s0 := v0(f) 3657 s1 := v1(f) 3658 if s0 == s1 { 3659 dest(f).SetBool(true) 3660 return tnext 3661 } 3662 dest(f).SetBool(false) 3663 return fnext 3664 } 3665 } else { 3666 n.exec = func(f *frame) bltn { 3667 s0 := v0(f) 3668 s1 := v1(f) 3669 dest(f).SetBool(s0 == s1) 3670 return tnext 3671 } 3672 } 3673 } 3674 default: 3675 switch { 3676 case isInterface: 3677 v0 := genValue(c0) 3678 v1 := genValue(c1) 3679 n.exec = func(f *frame) bltn { 3680 i0 := v0(f).Interface() 3681 i1 := v1(f).Interface() 3682 dest(f).Set(reflect.ValueOf(i0 == i1).Convert(typ)) 3683 return tnext 3684 } 3685 case c0.rval.IsValid(): 3686 i0 := c0.rval.Interface() 3687 v1 := genValue(c1) 3688 if n.fnext != nil { 3689 fnext := getExec(n.fnext) 3690 n.exec = func(f *frame) bltn { 3691 i1 := v1(f).Interface() 3692 if i0 == i1 { 3693 dest(f).SetBool(true) 3694 return tnext 3695 } 3696 dest(f).SetBool(false) 3697 return fnext 3698 } 3699 } else { 3700 dest := genValue(n) 3701 n.exec = func(f *frame) bltn { 3702 i1 := v1(f).Interface() 3703 dest(f).SetBool(i0 == i1) 3704 return tnext 3705 } 3706 } 3707 case c1.rval.IsValid(): 3708 i1 := c1.rval.Interface() 3709 v0 := genValue(c0) 3710 if n.fnext != nil { 3711 fnext := getExec(n.fnext) 3712 n.exec = func(f *frame) bltn { 3713 i0 := v0(f).Interface() 3714 if i0 == i1 { 3715 dest(f).SetBool(true) 3716 return tnext 3717 } 3718 dest(f).SetBool(false) 3719 return fnext 3720 } 3721 } else { 3722 dest := genValue(n) 3723 n.exec = func(f *frame) bltn { 3724 i0 := v0(f).Interface() 3725 dest(f).SetBool(i0 == i1) 3726 return tnext 3727 } 3728 } 3729 default: 3730 v0 := genValue(c0) 3731 v1 := genValue(c1) 3732 if n.fnext != nil { 3733 fnext := getExec(n.fnext) 3734 n.exec = func(f *frame) bltn { 3735 i0 := v0(f).Interface() 3736 i1 := v1(f).Interface() 3737 if i0 == i1 { 3738 dest(f).SetBool(true) 3739 return tnext 3740 } 3741 dest(f).SetBool(false) 3742 return fnext 3743 } 3744 } else { 3745 dest := genValue(n) 3746 n.exec = func(f *frame) bltn { 3747 i0 := v0(f).Interface() 3748 i1 := v1(f).Interface() 3749 dest(f).SetBool(i0 == i1) 3750 return tnext 3751 } 3752 } 3753 } 3754 } 3755 } 3756 3757 func greater(n *node) { 3758 tnext := getExec(n.tnext) 3759 dest := genValueOutput(n, reflect.TypeOf(true)) 3760 typ := n.typ.concrete().TypeOf() 3761 isInterface := n.typ.TypeOf().Kind() == reflect.Interface 3762 c0, c1 := n.child[0], n.child[1] 3763 t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf() 3764 3765 switch { 3766 case isString(t0) || isString(t1): 3767 switch { 3768 case isInterface: 3769 v0 := genValueString(c0) 3770 v1 := genValueString(c1) 3771 n.exec = func(f *frame) bltn { 3772 _, s0 := v0(f) 3773 _, s1 := v1(f) 3774 dest(f).Set(reflect.ValueOf(s0 > s1).Convert(typ)) 3775 return tnext 3776 } 3777 case c0.rval.IsValid(): 3778 s0 := vString(c0.rval) 3779 v1 := genValueString(c1) 3780 if n.fnext != nil { 3781 fnext := getExec(n.fnext) 3782 n.exec = func(f *frame) bltn { 3783 _, s1 := v1(f) 3784 if s0 > s1 { 3785 dest(f).SetBool(true) 3786 return tnext 3787 } 3788 dest(f).SetBool(false) 3789 return fnext 3790 } 3791 } else { 3792 n.exec = func(f *frame) bltn { 3793 _, s1 := v1(f) 3794 dest(f).SetBool(s0 > s1) 3795 return tnext 3796 } 3797 } 3798 case c1.rval.IsValid(): 3799 s1 := vString(c1.rval) 3800 v0 := genValueString(c0) 3801 if n.fnext != nil { 3802 fnext := getExec(n.fnext) 3803 n.exec = func(f *frame) bltn { 3804 _, s0 := v0(f) 3805 if s0 > s1 { 3806 dest(f).SetBool(true) 3807 return tnext 3808 } 3809 dest(f).SetBool(false) 3810 return fnext 3811 } 3812 } else { 3813 n.exec = func(f *frame) bltn { 3814 _, s0 := v0(f) 3815 dest(f).SetBool(s0 > s1) 3816 return tnext 3817 } 3818 } 3819 default: 3820 v0 := genValueString(c0) 3821 v1 := genValueString(c1) 3822 if n.fnext != nil { 3823 fnext := getExec(n.fnext) 3824 n.exec = func(f *frame) bltn { 3825 _, s0 := v0(f) 3826 _, s1 := v1(f) 3827 if s0 > s1 { 3828 dest(f).SetBool(true) 3829 return tnext 3830 } 3831 dest(f).SetBool(false) 3832 return fnext 3833 } 3834 } else { 3835 n.exec = func(f *frame) bltn { 3836 _, s0 := v0(f) 3837 _, s1 := v1(f) 3838 dest(f).SetBool(s0 > s1) 3839 return tnext 3840 } 3841 } 3842 } 3843 case isFloat(t0) || isFloat(t1): 3844 switch { 3845 case isInterface: 3846 v0 := genValueFloat(c0) 3847 v1 := genValueFloat(c1) 3848 n.exec = func(f *frame) bltn { 3849 _, s0 := v0(f) 3850 _, s1 := v1(f) 3851 dest(f).Set(reflect.ValueOf(s0 > s1).Convert(typ)) 3852 return tnext 3853 } 3854 case c0.rval.IsValid(): 3855 s0 := vFloat(c0.rval) 3856 v1 := genValueFloat(c1) 3857 if n.fnext != nil { 3858 fnext := getExec(n.fnext) 3859 n.exec = func(f *frame) bltn { 3860 _, s1 := v1(f) 3861 if s0 > s1 { 3862 dest(f).SetBool(true) 3863 return tnext 3864 } 3865 dest(f).SetBool(false) 3866 return fnext 3867 } 3868 } else { 3869 n.exec = func(f *frame) bltn { 3870 _, s1 := v1(f) 3871 dest(f).SetBool(s0 > s1) 3872 return tnext 3873 } 3874 } 3875 case c1.rval.IsValid(): 3876 s1 := vFloat(c1.rval) 3877 v0 := genValueFloat(c0) 3878 if n.fnext != nil { 3879 fnext := getExec(n.fnext) 3880 n.exec = func(f *frame) bltn { 3881 _, s0 := v0(f) 3882 if s0 > s1 { 3883 dest(f).SetBool(true) 3884 return tnext 3885 } 3886 dest(f).SetBool(false) 3887 return fnext 3888 } 3889 } else { 3890 dest := genValue(n) 3891 n.exec = func(f *frame) bltn { 3892 _, s0 := v0(f) 3893 dest(f).SetBool(s0 > s1) 3894 return tnext 3895 } 3896 } 3897 default: 3898 v0 := genValueFloat(c0) 3899 v1 := genValueFloat(c1) 3900 if n.fnext != nil { 3901 fnext := getExec(n.fnext) 3902 n.exec = func(f *frame) bltn { 3903 _, s0 := v0(f) 3904 _, s1 := v1(f) 3905 if s0 > s1 { 3906 dest(f).SetBool(true) 3907 return tnext 3908 } 3909 dest(f).SetBool(false) 3910 return fnext 3911 } 3912 } else { 3913 dest := genValue(n) 3914 n.exec = func(f *frame) bltn { 3915 _, s0 := v0(f) 3916 _, s1 := v1(f) 3917 dest(f).SetBool(s0 > s1) 3918 return tnext 3919 } 3920 } 3921 } 3922 case isUint(t0) || isUint(t1): 3923 switch { 3924 case isInterface: 3925 v0 := genValueUint(c0) 3926 v1 := genValueUint(c1) 3927 n.exec = func(f *frame) bltn { 3928 _, s0 := v0(f) 3929 _, s1 := v1(f) 3930 dest(f).Set(reflect.ValueOf(s0 > s1).Convert(typ)) 3931 return tnext 3932 } 3933 case c0.rval.IsValid(): 3934 s0 := vUint(c0.rval) 3935 v1 := genValueUint(c1) 3936 if n.fnext != nil { 3937 fnext := getExec(n.fnext) 3938 n.exec = func(f *frame) bltn { 3939 _, s1 := v1(f) 3940 if s0 > s1 { 3941 dest(f).SetBool(true) 3942 return tnext 3943 } 3944 dest(f).SetBool(false) 3945 return fnext 3946 } 3947 } else { 3948 dest := genValue(n) 3949 n.exec = func(f *frame) bltn { 3950 _, s1 := v1(f) 3951 dest(f).SetBool(s0 > s1) 3952 return tnext 3953 } 3954 } 3955 case c1.rval.IsValid(): 3956 s1 := vUint(c1.rval) 3957 v0 := genValueUint(c0) 3958 if n.fnext != nil { 3959 fnext := getExec(n.fnext) 3960 n.exec = func(f *frame) bltn { 3961 _, s0 := v0(f) 3962 if s0 > s1 { 3963 dest(f).SetBool(true) 3964 return tnext 3965 } 3966 dest(f).SetBool(false) 3967 return fnext 3968 } 3969 } else { 3970 dest := genValue(n) 3971 n.exec = func(f *frame) bltn { 3972 _, s0 := v0(f) 3973 dest(f).SetBool(s0 > s1) 3974 return tnext 3975 } 3976 } 3977 default: 3978 v0 := genValueUint(c0) 3979 v1 := genValueUint(c1) 3980 if n.fnext != nil { 3981 fnext := getExec(n.fnext) 3982 n.exec = func(f *frame) bltn { 3983 _, s0 := v0(f) 3984 _, s1 := v1(f) 3985 if s0 > s1 { 3986 dest(f).SetBool(true) 3987 return tnext 3988 } 3989 dest(f).SetBool(false) 3990 return fnext 3991 } 3992 } else { 3993 dest := genValue(n) 3994 n.exec = func(f *frame) bltn { 3995 _, s0 := v0(f) 3996 _, s1 := v1(f) 3997 dest(f).SetBool(s0 > s1) 3998 return tnext 3999 } 4000 } 4001 } 4002 case isInt(t0) || isInt(t1): 4003 switch { 4004 case isInterface: 4005 v0 := genValueInt(c0) 4006 v1 := genValueInt(c1) 4007 n.exec = func(f *frame) bltn { 4008 _, s0 := v0(f) 4009 _, s1 := v1(f) 4010 dest(f).Set(reflect.ValueOf(s0 > s1).Convert(typ)) 4011 return tnext 4012 } 4013 case c0.rval.IsValid(): 4014 s0 := vInt(c0.rval) 4015 v1 := genValueInt(c1) 4016 if n.fnext != nil { 4017 fnext := getExec(n.fnext) 4018 n.exec = func(f *frame) bltn { 4019 _, s1 := v1(f) 4020 if s0 > s1 { 4021 dest(f).SetBool(true) 4022 return tnext 4023 } 4024 dest(f).SetBool(false) 4025 return fnext 4026 } 4027 } else { 4028 dest := genValue(n) 4029 n.exec = func(f *frame) bltn { 4030 _, s1 := v1(f) 4031 dest(f).SetBool(s0 > s1) 4032 return tnext 4033 } 4034 } 4035 case c1.rval.IsValid(): 4036 s1 := vInt(c1.rval) 4037 v0 := genValueInt(c0) 4038 if n.fnext != nil { 4039 fnext := getExec(n.fnext) 4040 n.exec = func(f *frame) bltn { 4041 _, s0 := v0(f) 4042 if s0 > s1 { 4043 dest(f).SetBool(true) 4044 return tnext 4045 } 4046 dest(f).SetBool(false) 4047 return fnext 4048 } 4049 } else { 4050 dest := genValue(n) 4051 n.exec = func(f *frame) bltn { 4052 _, s0 := v0(f) 4053 dest(f).SetBool(s0 > s1) 4054 return tnext 4055 } 4056 } 4057 default: 4058 v0 := genValueInt(c0) 4059 v1 := genValueInt(c1) 4060 if n.fnext != nil { 4061 fnext := getExec(n.fnext) 4062 n.exec = func(f *frame) bltn { 4063 _, s0 := v0(f) 4064 _, s1 := v1(f) 4065 if s0 > s1 { 4066 dest(f).SetBool(true) 4067 return tnext 4068 } 4069 dest(f).SetBool(false) 4070 return fnext 4071 } 4072 } else { 4073 dest := genValue(n) 4074 n.exec = func(f *frame) bltn { 4075 _, s0 := v0(f) 4076 _, s1 := v1(f) 4077 dest(f).SetBool(s0 > s1) 4078 return tnext 4079 } 4080 } 4081 } 4082 default: 4083 v0 := genValue(c0) 4084 v1 := genValue(c1) 4085 if n.fnext != nil { 4086 fnext := getExec(n.fnext) 4087 n.exec = func(f *frame) bltn { 4088 val0 := v0(f) 4089 val1 := v1(f) 4090 v, e := rcompare(val0, val1, ">") 4091 if e != nil { 4092 panic(n.runErrorf(e.Error())) 4093 } 4094 if v { 4095 dest(f).SetBool(true) 4096 return tnext 4097 } 4098 dest(f).SetBool(false) 4099 return fnext 4100 } 4101 } else { 4102 n.exec = func(f *frame) bltn { 4103 val0 := v0(f) 4104 val1 := v1(f) 4105 v, e := rcompare(val0, val1, ">") 4106 if e != nil { 4107 panic(n.runErrorf(e.Error())) 4108 } 4109 dest(f).SetBool(v) 4110 return tnext 4111 } 4112 } 4113 } 4114 } 4115 4116 func greaterEqual(n *node) { 4117 tnext := getExec(n.tnext) 4118 dest := genValueOutput(n, reflect.TypeOf(true)) 4119 typ := n.typ.concrete().TypeOf() 4120 isInterface := n.typ.TypeOf().Kind() == reflect.Interface 4121 c0, c1 := n.child[0], n.child[1] 4122 t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf() 4123 4124 switch { 4125 case isString(t0) || isString(t1): 4126 switch { 4127 case isInterface: 4128 v0 := genValueString(c0) 4129 v1 := genValueString(c1) 4130 n.exec = func(f *frame) bltn { 4131 _, s0 := v0(f) 4132 _, s1 := v1(f) 4133 dest(f).Set(reflect.ValueOf(s0 >= s1).Convert(typ)) 4134 return tnext 4135 } 4136 case c0.rval.IsValid(): 4137 s0 := vString(c0.rval) 4138 v1 := genValueString(c1) 4139 if n.fnext != nil { 4140 fnext := getExec(n.fnext) 4141 n.exec = func(f *frame) bltn { 4142 _, s1 := v1(f) 4143 if s0 >= s1 { 4144 dest(f).SetBool(true) 4145 return tnext 4146 } 4147 dest(f).SetBool(false) 4148 return fnext 4149 } 4150 } else { 4151 n.exec = func(f *frame) bltn { 4152 _, s1 := v1(f) 4153 dest(f).SetBool(s0 >= s1) 4154 return tnext 4155 } 4156 } 4157 case c1.rval.IsValid(): 4158 s1 := vString(c1.rval) 4159 v0 := genValueString(c0) 4160 if n.fnext != nil { 4161 fnext := getExec(n.fnext) 4162 n.exec = func(f *frame) bltn { 4163 _, s0 := v0(f) 4164 if s0 >= s1 { 4165 dest(f).SetBool(true) 4166 return tnext 4167 } 4168 dest(f).SetBool(false) 4169 return fnext 4170 } 4171 } else { 4172 n.exec = func(f *frame) bltn { 4173 _, s0 := v0(f) 4174 dest(f).SetBool(s0 >= s1) 4175 return tnext 4176 } 4177 } 4178 default: 4179 v0 := genValueString(c0) 4180 v1 := genValueString(c1) 4181 if n.fnext != nil { 4182 fnext := getExec(n.fnext) 4183 n.exec = func(f *frame) bltn { 4184 _, s0 := v0(f) 4185 _, s1 := v1(f) 4186 if s0 >= s1 { 4187 dest(f).SetBool(true) 4188 return tnext 4189 } 4190 dest(f).SetBool(false) 4191 return fnext 4192 } 4193 } else { 4194 n.exec = func(f *frame) bltn { 4195 _, s0 := v0(f) 4196 _, s1 := v1(f) 4197 dest(f).SetBool(s0 >= s1) 4198 return tnext 4199 } 4200 } 4201 } 4202 case isFloat(t0) || isFloat(t1): 4203 switch { 4204 case isInterface: 4205 v0 := genValueFloat(c0) 4206 v1 := genValueFloat(c1) 4207 n.exec = func(f *frame) bltn { 4208 _, s0 := v0(f) 4209 _, s1 := v1(f) 4210 dest(f).Set(reflect.ValueOf(s0 >= s1).Convert(typ)) 4211 return tnext 4212 } 4213 case c0.rval.IsValid(): 4214 s0 := vFloat(c0.rval) 4215 v1 := genValueFloat(c1) 4216 if n.fnext != nil { 4217 fnext := getExec(n.fnext) 4218 n.exec = func(f *frame) bltn { 4219 _, s1 := v1(f) 4220 if s0 >= s1 { 4221 dest(f).SetBool(true) 4222 return tnext 4223 } 4224 dest(f).SetBool(false) 4225 return fnext 4226 } 4227 } else { 4228 n.exec = func(f *frame) bltn { 4229 _, s1 := v1(f) 4230 dest(f).SetBool(s0 >= s1) 4231 return tnext 4232 } 4233 } 4234 case c1.rval.IsValid(): 4235 s1 := vFloat(c1.rval) 4236 v0 := genValueFloat(c0) 4237 if n.fnext != nil { 4238 fnext := getExec(n.fnext) 4239 n.exec = func(f *frame) bltn { 4240 _, s0 := v0(f) 4241 if s0 >= s1 { 4242 dest(f).SetBool(true) 4243 return tnext 4244 } 4245 dest(f).SetBool(false) 4246 return fnext 4247 } 4248 } else { 4249 dest := genValue(n) 4250 n.exec = func(f *frame) bltn { 4251 _, s0 := v0(f) 4252 dest(f).SetBool(s0 >= s1) 4253 return tnext 4254 } 4255 } 4256 default: 4257 v0 := genValueFloat(c0) 4258 v1 := genValueFloat(c1) 4259 if n.fnext != nil { 4260 fnext := getExec(n.fnext) 4261 n.exec = func(f *frame) bltn { 4262 _, s0 := v0(f) 4263 _, s1 := v1(f) 4264 if s0 >= s1 { 4265 dest(f).SetBool(true) 4266 return tnext 4267 } 4268 dest(f).SetBool(false) 4269 return fnext 4270 } 4271 } else { 4272 dest := genValue(n) 4273 n.exec = func(f *frame) bltn { 4274 _, s0 := v0(f) 4275 _, s1 := v1(f) 4276 dest(f).SetBool(s0 >= s1) 4277 return tnext 4278 } 4279 } 4280 } 4281 case isUint(t0) || isUint(t1): 4282 switch { 4283 case isInterface: 4284 v0 := genValueUint(c0) 4285 v1 := genValueUint(c1) 4286 n.exec = func(f *frame) bltn { 4287 _, s0 := v0(f) 4288 _, s1 := v1(f) 4289 dest(f).Set(reflect.ValueOf(s0 >= s1).Convert(typ)) 4290 return tnext 4291 } 4292 case c0.rval.IsValid(): 4293 s0 := vUint(c0.rval) 4294 v1 := genValueUint(c1) 4295 if n.fnext != nil { 4296 fnext := getExec(n.fnext) 4297 n.exec = func(f *frame) bltn { 4298 _, s1 := v1(f) 4299 if s0 >= s1 { 4300 dest(f).SetBool(true) 4301 return tnext 4302 } 4303 dest(f).SetBool(false) 4304 return fnext 4305 } 4306 } else { 4307 dest := genValue(n) 4308 n.exec = func(f *frame) bltn { 4309 _, s1 := v1(f) 4310 dest(f).SetBool(s0 >= s1) 4311 return tnext 4312 } 4313 } 4314 case c1.rval.IsValid(): 4315 s1 := vUint(c1.rval) 4316 v0 := genValueUint(c0) 4317 if n.fnext != nil { 4318 fnext := getExec(n.fnext) 4319 n.exec = func(f *frame) bltn { 4320 _, s0 := v0(f) 4321 if s0 >= s1 { 4322 dest(f).SetBool(true) 4323 return tnext 4324 } 4325 dest(f).SetBool(false) 4326 return fnext 4327 } 4328 } else { 4329 dest := genValue(n) 4330 n.exec = func(f *frame) bltn { 4331 _, s0 := v0(f) 4332 dest(f).SetBool(s0 >= s1) 4333 return tnext 4334 } 4335 } 4336 default: 4337 v0 := genValueUint(c0) 4338 v1 := genValueUint(c1) 4339 if n.fnext != nil { 4340 fnext := getExec(n.fnext) 4341 n.exec = func(f *frame) bltn { 4342 _, s0 := v0(f) 4343 _, s1 := v1(f) 4344 if s0 >= s1 { 4345 dest(f).SetBool(true) 4346 return tnext 4347 } 4348 dest(f).SetBool(false) 4349 return fnext 4350 } 4351 } else { 4352 dest := genValue(n) 4353 n.exec = func(f *frame) bltn { 4354 _, s0 := v0(f) 4355 _, s1 := v1(f) 4356 dest(f).SetBool(s0 >= s1) 4357 return tnext 4358 } 4359 } 4360 } 4361 case isInt(t0) || isInt(t1): 4362 switch { 4363 case isInterface: 4364 v0 := genValueInt(c0) 4365 v1 := genValueInt(c1) 4366 n.exec = func(f *frame) bltn { 4367 _, s0 := v0(f) 4368 _, s1 := v1(f) 4369 dest(f).Set(reflect.ValueOf(s0 >= s1).Convert(typ)) 4370 return tnext 4371 } 4372 case c0.rval.IsValid(): 4373 s0 := vInt(c0.rval) 4374 v1 := genValueInt(c1) 4375 if n.fnext != nil { 4376 fnext := getExec(n.fnext) 4377 n.exec = func(f *frame) bltn { 4378 _, s1 := v1(f) 4379 if s0 >= s1 { 4380 dest(f).SetBool(true) 4381 return tnext 4382 } 4383 dest(f).SetBool(false) 4384 return fnext 4385 } 4386 } else { 4387 dest := genValue(n) 4388 n.exec = func(f *frame) bltn { 4389 _, s1 := v1(f) 4390 dest(f).SetBool(s0 >= s1) 4391 return tnext 4392 } 4393 } 4394 case c1.rval.IsValid(): 4395 s1 := vInt(c1.rval) 4396 v0 := genValueInt(c0) 4397 if n.fnext != nil { 4398 fnext := getExec(n.fnext) 4399 n.exec = func(f *frame) bltn { 4400 _, s0 := v0(f) 4401 if s0 >= s1 { 4402 dest(f).SetBool(true) 4403 return tnext 4404 } 4405 dest(f).SetBool(false) 4406 return fnext 4407 } 4408 } else { 4409 dest := genValue(n) 4410 n.exec = func(f *frame) bltn { 4411 _, s0 := v0(f) 4412 dest(f).SetBool(s0 >= s1) 4413 return tnext 4414 } 4415 } 4416 default: 4417 v0 := genValueInt(c0) 4418 v1 := genValueInt(c1) 4419 if n.fnext != nil { 4420 fnext := getExec(n.fnext) 4421 n.exec = func(f *frame) bltn { 4422 _, s0 := v0(f) 4423 _, s1 := v1(f) 4424 if s0 >= s1 { 4425 dest(f).SetBool(true) 4426 return tnext 4427 } 4428 dest(f).SetBool(false) 4429 return fnext 4430 } 4431 } else { 4432 dest := genValue(n) 4433 n.exec = func(f *frame) bltn { 4434 _, s0 := v0(f) 4435 _, s1 := v1(f) 4436 dest(f).SetBool(s0 >= s1) 4437 return tnext 4438 } 4439 } 4440 } 4441 default: 4442 v0 := genValue(c0) 4443 v1 := genValue(c1) 4444 if n.fnext != nil { 4445 fnext := getExec(n.fnext) 4446 n.exec = func(f *frame) bltn { 4447 val0 := v0(f) 4448 val1 := v1(f) 4449 v, e := rcompare(val0, val1, ">=") 4450 if e != nil { 4451 panic(n.runErrorf(e.Error())) 4452 } 4453 if v { 4454 dest(f).SetBool(true) 4455 return tnext 4456 } 4457 dest(f).SetBool(false) 4458 return fnext 4459 } 4460 } else { 4461 n.exec = func(f *frame) bltn { 4462 val0 := v0(f) 4463 val1 := v1(f) 4464 v, e := rcompare(val0, val1, ">=") 4465 if e != nil { 4466 panic(n.runErrorf(e.Error())) 4467 } 4468 dest(f).SetBool(v) 4469 return tnext 4470 } 4471 } 4472 } 4473 } 4474 4475 func lower(n *node) { 4476 tnext := getExec(n.tnext) 4477 dest := genValueOutput(n, reflect.TypeOf(true)) 4478 typ := n.typ.concrete().TypeOf() 4479 isInterface := n.typ.TypeOf().Kind() == reflect.Interface 4480 c0, c1 := n.child[0], n.child[1] 4481 t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf() 4482 4483 switch { 4484 case isString(t0) || isString(t1): 4485 switch { 4486 case isInterface: 4487 v0 := genValueString(c0) 4488 v1 := genValueString(c1) 4489 n.exec = func(f *frame) bltn { 4490 _, s0 := v0(f) 4491 _, s1 := v1(f) 4492 dest(f).Set(reflect.ValueOf(s0 < s1).Convert(typ)) 4493 return tnext 4494 } 4495 case c0.rval.IsValid(): 4496 s0 := vString(c0.rval) 4497 v1 := genValueString(c1) 4498 if n.fnext != nil { 4499 fnext := getExec(n.fnext) 4500 n.exec = func(f *frame) bltn { 4501 _, s1 := v1(f) 4502 if s0 < s1 { 4503 dest(f).SetBool(true) 4504 return tnext 4505 } 4506 dest(f).SetBool(false) 4507 return fnext 4508 } 4509 } else { 4510 n.exec = func(f *frame) bltn { 4511 _, s1 := v1(f) 4512 dest(f).SetBool(s0 < s1) 4513 return tnext 4514 } 4515 } 4516 case c1.rval.IsValid(): 4517 s1 := vString(c1.rval) 4518 v0 := genValueString(c0) 4519 if n.fnext != nil { 4520 fnext := getExec(n.fnext) 4521 n.exec = func(f *frame) bltn { 4522 _, s0 := v0(f) 4523 if s0 < s1 { 4524 dest(f).SetBool(true) 4525 return tnext 4526 } 4527 dest(f).SetBool(false) 4528 return fnext 4529 } 4530 } else { 4531 n.exec = func(f *frame) bltn { 4532 _, s0 := v0(f) 4533 dest(f).SetBool(s0 < s1) 4534 return tnext 4535 } 4536 } 4537 default: 4538 v0 := genValueString(c0) 4539 v1 := genValueString(c1) 4540 if n.fnext != nil { 4541 fnext := getExec(n.fnext) 4542 n.exec = func(f *frame) bltn { 4543 _, s0 := v0(f) 4544 _, s1 := v1(f) 4545 if s0 < s1 { 4546 dest(f).SetBool(true) 4547 return tnext 4548 } 4549 dest(f).SetBool(false) 4550 return fnext 4551 } 4552 } else { 4553 n.exec = func(f *frame) bltn { 4554 _, s0 := v0(f) 4555 _, s1 := v1(f) 4556 dest(f).SetBool(s0 < s1) 4557 return tnext 4558 } 4559 } 4560 } 4561 case isFloat(t0) || isFloat(t1): 4562 switch { 4563 case isInterface: 4564 v0 := genValueFloat(c0) 4565 v1 := genValueFloat(c1) 4566 n.exec = func(f *frame) bltn { 4567 _, s0 := v0(f) 4568 _, s1 := v1(f) 4569 dest(f).Set(reflect.ValueOf(s0 < s1).Convert(typ)) 4570 return tnext 4571 } 4572 case c0.rval.IsValid(): 4573 s0 := vFloat(c0.rval) 4574 v1 := genValueFloat(c1) 4575 if n.fnext != nil { 4576 fnext := getExec(n.fnext) 4577 n.exec = func(f *frame) bltn { 4578 _, s1 := v1(f) 4579 if s0 < s1 { 4580 dest(f).SetBool(true) 4581 return tnext 4582 } 4583 dest(f).SetBool(false) 4584 return fnext 4585 } 4586 } else { 4587 n.exec = func(f *frame) bltn { 4588 _, s1 := v1(f) 4589 dest(f).SetBool(s0 < s1) 4590 return tnext 4591 } 4592 } 4593 case c1.rval.IsValid(): 4594 s1 := vFloat(c1.rval) 4595 v0 := genValueFloat(c0) 4596 if n.fnext != nil { 4597 fnext := getExec(n.fnext) 4598 n.exec = func(f *frame) bltn { 4599 _, s0 := v0(f) 4600 if s0 < s1 { 4601 dest(f).SetBool(true) 4602 return tnext 4603 } 4604 dest(f).SetBool(false) 4605 return fnext 4606 } 4607 } else { 4608 dest := genValue(n) 4609 n.exec = func(f *frame) bltn { 4610 _, s0 := v0(f) 4611 dest(f).SetBool(s0 < s1) 4612 return tnext 4613 } 4614 } 4615 default: 4616 v0 := genValueFloat(c0) 4617 v1 := genValueFloat(c1) 4618 if n.fnext != nil { 4619 fnext := getExec(n.fnext) 4620 n.exec = func(f *frame) bltn { 4621 _, s0 := v0(f) 4622 _, s1 := v1(f) 4623 if s0 < s1 { 4624 dest(f).SetBool(true) 4625 return tnext 4626 } 4627 dest(f).SetBool(false) 4628 return fnext 4629 } 4630 } else { 4631 dest := genValue(n) 4632 n.exec = func(f *frame) bltn { 4633 _, s0 := v0(f) 4634 _, s1 := v1(f) 4635 dest(f).SetBool(s0 < s1) 4636 return tnext 4637 } 4638 } 4639 } 4640 case isUint(t0) || isUint(t1): 4641 switch { 4642 case isInterface: 4643 v0 := genValueUint(c0) 4644 v1 := genValueUint(c1) 4645 n.exec = func(f *frame) bltn { 4646 _, s0 := v0(f) 4647 _, s1 := v1(f) 4648 dest(f).Set(reflect.ValueOf(s0 < s1).Convert(typ)) 4649 return tnext 4650 } 4651 case c0.rval.IsValid(): 4652 s0 := vUint(c0.rval) 4653 v1 := genValueUint(c1) 4654 if n.fnext != nil { 4655 fnext := getExec(n.fnext) 4656 n.exec = func(f *frame) bltn { 4657 _, s1 := v1(f) 4658 if s0 < s1 { 4659 dest(f).SetBool(true) 4660 return tnext 4661 } 4662 dest(f).SetBool(false) 4663 return fnext 4664 } 4665 } else { 4666 dest := genValue(n) 4667 n.exec = func(f *frame) bltn { 4668 _, s1 := v1(f) 4669 dest(f).SetBool(s0 < s1) 4670 return tnext 4671 } 4672 } 4673 case c1.rval.IsValid(): 4674 s1 := vUint(c1.rval) 4675 v0 := genValueUint(c0) 4676 if n.fnext != nil { 4677 fnext := getExec(n.fnext) 4678 n.exec = func(f *frame) bltn { 4679 _, s0 := v0(f) 4680 if s0 < s1 { 4681 dest(f).SetBool(true) 4682 return tnext 4683 } 4684 dest(f).SetBool(false) 4685 return fnext 4686 } 4687 } else { 4688 dest := genValue(n) 4689 n.exec = func(f *frame) bltn { 4690 _, s0 := v0(f) 4691 dest(f).SetBool(s0 < s1) 4692 return tnext 4693 } 4694 } 4695 default: 4696 v0 := genValueUint(c0) 4697 v1 := genValueUint(c1) 4698 if n.fnext != nil { 4699 fnext := getExec(n.fnext) 4700 n.exec = func(f *frame) bltn { 4701 _, s0 := v0(f) 4702 _, s1 := v1(f) 4703 if s0 < s1 { 4704 dest(f).SetBool(true) 4705 return tnext 4706 } 4707 dest(f).SetBool(false) 4708 return fnext 4709 } 4710 } else { 4711 dest := genValue(n) 4712 n.exec = func(f *frame) bltn { 4713 _, s0 := v0(f) 4714 _, s1 := v1(f) 4715 dest(f).SetBool(s0 < s1) 4716 return tnext 4717 } 4718 } 4719 } 4720 case isInt(t0) || isInt(t1): 4721 switch { 4722 case isInterface: 4723 v0 := genValueInt(c0) 4724 v1 := genValueInt(c1) 4725 n.exec = func(f *frame) bltn { 4726 _, s0 := v0(f) 4727 _, s1 := v1(f) 4728 dest(f).Set(reflect.ValueOf(s0 < s1).Convert(typ)) 4729 return tnext 4730 } 4731 case c0.rval.IsValid(): 4732 s0 := vInt(c0.rval) 4733 v1 := genValueInt(c1) 4734 if n.fnext != nil { 4735 fnext := getExec(n.fnext) 4736 n.exec = func(f *frame) bltn { 4737 _, s1 := v1(f) 4738 if s0 < s1 { 4739 dest(f).SetBool(true) 4740 return tnext 4741 } 4742 dest(f).SetBool(false) 4743 return fnext 4744 } 4745 } else { 4746 dest := genValue(n) 4747 n.exec = func(f *frame) bltn { 4748 _, s1 := v1(f) 4749 dest(f).SetBool(s0 < s1) 4750 return tnext 4751 } 4752 } 4753 case c1.rval.IsValid(): 4754 s1 := vInt(c1.rval) 4755 v0 := genValueInt(c0) 4756 if n.fnext != nil { 4757 fnext := getExec(n.fnext) 4758 n.exec = func(f *frame) bltn { 4759 _, s0 := v0(f) 4760 if s0 < s1 { 4761 dest(f).SetBool(true) 4762 return tnext 4763 } 4764 dest(f).SetBool(false) 4765 return fnext 4766 } 4767 } else { 4768 dest := genValue(n) 4769 n.exec = func(f *frame) bltn { 4770 _, s0 := v0(f) 4771 dest(f).SetBool(s0 < s1) 4772 return tnext 4773 } 4774 } 4775 default: 4776 v0 := genValueInt(c0) 4777 v1 := genValueInt(c1) 4778 if n.fnext != nil { 4779 fnext := getExec(n.fnext) 4780 n.exec = func(f *frame) bltn { 4781 _, s0 := v0(f) 4782 _, s1 := v1(f) 4783 if s0 < s1 { 4784 dest(f).SetBool(true) 4785 return tnext 4786 } 4787 dest(f).SetBool(false) 4788 return fnext 4789 } 4790 } else { 4791 dest := genValue(n) 4792 n.exec = func(f *frame) bltn { 4793 _, s0 := v0(f) 4794 _, s1 := v1(f) 4795 dest(f).SetBool(s0 < s1) 4796 return tnext 4797 } 4798 } 4799 } 4800 default: 4801 v0 := genValue(c0) 4802 v1 := genValue(c1) 4803 if n.fnext != nil { 4804 fnext := getExec(n.fnext) 4805 n.exec = func(f *frame) bltn { 4806 val0 := v0(f) 4807 val1 := v1(f) 4808 v, e := rcompare(val0, val1, "<") 4809 if e != nil { 4810 panic(n.runErrorf(e.Error())) 4811 } 4812 if v { 4813 dest(f).SetBool(true) 4814 return tnext 4815 } 4816 dest(f).SetBool(false) 4817 return fnext 4818 } 4819 } else { 4820 n.exec = func(f *frame) bltn { 4821 val0 := v0(f) 4822 val1 := v1(f) 4823 v, e := rcompare(val0, val1, "<") 4824 if e != nil { 4825 panic(n.runErrorf(e.Error())) 4826 } 4827 dest(f).SetBool(v) 4828 return tnext 4829 } 4830 } 4831 } 4832 } 4833 4834 func lowerEqual(n *node) { 4835 tnext := getExec(n.tnext) 4836 dest := genValueOutput(n, reflect.TypeOf(true)) 4837 typ := n.typ.concrete().TypeOf() 4838 isInterface := n.typ.TypeOf().Kind() == reflect.Interface 4839 c0, c1 := n.child[0], n.child[1] 4840 t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf() 4841 4842 switch { 4843 case isString(t0) || isString(t1): 4844 switch { 4845 case isInterface: 4846 v0 := genValueString(c0) 4847 v1 := genValueString(c1) 4848 n.exec = func(f *frame) bltn { 4849 _, s0 := v0(f) 4850 _, s1 := v1(f) 4851 dest(f).Set(reflect.ValueOf(s0 <= s1).Convert(typ)) 4852 return tnext 4853 } 4854 case c0.rval.IsValid(): 4855 s0 := vString(c0.rval) 4856 v1 := genValueString(c1) 4857 if n.fnext != nil { 4858 fnext := getExec(n.fnext) 4859 n.exec = func(f *frame) bltn { 4860 _, s1 := v1(f) 4861 if s0 <= s1 { 4862 dest(f).SetBool(true) 4863 return tnext 4864 } 4865 dest(f).SetBool(false) 4866 return fnext 4867 } 4868 } else { 4869 n.exec = func(f *frame) bltn { 4870 _, s1 := v1(f) 4871 dest(f).SetBool(s0 <= s1) 4872 return tnext 4873 } 4874 } 4875 case c1.rval.IsValid(): 4876 s1 := vString(c1.rval) 4877 v0 := genValueString(c0) 4878 if n.fnext != nil { 4879 fnext := getExec(n.fnext) 4880 n.exec = func(f *frame) bltn { 4881 _, s0 := v0(f) 4882 if s0 <= s1 { 4883 dest(f).SetBool(true) 4884 return tnext 4885 } 4886 dest(f).SetBool(false) 4887 return fnext 4888 } 4889 } else { 4890 n.exec = func(f *frame) bltn { 4891 _, s0 := v0(f) 4892 dest(f).SetBool(s0 <= s1) 4893 return tnext 4894 } 4895 } 4896 default: 4897 v0 := genValueString(c0) 4898 v1 := genValueString(c1) 4899 if n.fnext != nil { 4900 fnext := getExec(n.fnext) 4901 n.exec = func(f *frame) bltn { 4902 _, s0 := v0(f) 4903 _, s1 := v1(f) 4904 if s0 <= s1 { 4905 dest(f).SetBool(true) 4906 return tnext 4907 } 4908 dest(f).SetBool(false) 4909 return fnext 4910 } 4911 } else { 4912 n.exec = func(f *frame) bltn { 4913 _, s0 := v0(f) 4914 _, s1 := v1(f) 4915 dest(f).SetBool(s0 <= s1) 4916 return tnext 4917 } 4918 } 4919 } 4920 case isFloat(t0) || isFloat(t1): 4921 switch { 4922 case isInterface: 4923 v0 := genValueFloat(c0) 4924 v1 := genValueFloat(c1) 4925 n.exec = func(f *frame) bltn { 4926 _, s0 := v0(f) 4927 _, s1 := v1(f) 4928 dest(f).Set(reflect.ValueOf(s0 <= s1).Convert(typ)) 4929 return tnext 4930 } 4931 case c0.rval.IsValid(): 4932 s0 := vFloat(c0.rval) 4933 v1 := genValueFloat(c1) 4934 if n.fnext != nil { 4935 fnext := getExec(n.fnext) 4936 n.exec = func(f *frame) bltn { 4937 _, s1 := v1(f) 4938 if s0 <= s1 { 4939 dest(f).SetBool(true) 4940 return tnext 4941 } 4942 dest(f).SetBool(false) 4943 return fnext 4944 } 4945 } else { 4946 n.exec = func(f *frame) bltn { 4947 _, s1 := v1(f) 4948 dest(f).SetBool(s0 <= s1) 4949 return tnext 4950 } 4951 } 4952 case c1.rval.IsValid(): 4953 s1 := vFloat(c1.rval) 4954 v0 := genValueFloat(c0) 4955 if n.fnext != nil { 4956 fnext := getExec(n.fnext) 4957 n.exec = func(f *frame) bltn { 4958 _, s0 := v0(f) 4959 if s0 <= s1 { 4960 dest(f).SetBool(true) 4961 return tnext 4962 } 4963 dest(f).SetBool(false) 4964 return fnext 4965 } 4966 } else { 4967 dest := genValue(n) 4968 n.exec = func(f *frame) bltn { 4969 _, s0 := v0(f) 4970 dest(f).SetBool(s0 <= s1) 4971 return tnext 4972 } 4973 } 4974 default: 4975 v0 := genValueFloat(c0) 4976 v1 := genValueFloat(c1) 4977 if n.fnext != nil { 4978 fnext := getExec(n.fnext) 4979 n.exec = func(f *frame) bltn { 4980 _, s0 := v0(f) 4981 _, s1 := v1(f) 4982 if s0 <= s1 { 4983 dest(f).SetBool(true) 4984 return tnext 4985 } 4986 dest(f).SetBool(false) 4987 return fnext 4988 } 4989 } else { 4990 dest := genValue(n) 4991 n.exec = func(f *frame) bltn { 4992 _, s0 := v0(f) 4993 _, s1 := v1(f) 4994 dest(f).SetBool(s0 <= s1) 4995 return tnext 4996 } 4997 } 4998 } 4999 case isUint(t0) || isUint(t1): 5000 switch { 5001 case isInterface: 5002 v0 := genValueUint(c0) 5003 v1 := genValueUint(c1) 5004 n.exec = func(f *frame) bltn { 5005 _, s0 := v0(f) 5006 _, s1 := v1(f) 5007 dest(f).Set(reflect.ValueOf(s0 <= s1).Convert(typ)) 5008 return tnext 5009 } 5010 case c0.rval.IsValid(): 5011 s0 := vUint(c0.rval) 5012 v1 := genValueUint(c1) 5013 if n.fnext != nil { 5014 fnext := getExec(n.fnext) 5015 n.exec = func(f *frame) bltn { 5016 _, s1 := v1(f) 5017 if s0 <= s1 { 5018 dest(f).SetBool(true) 5019 return tnext 5020 } 5021 dest(f).SetBool(false) 5022 return fnext 5023 } 5024 } else { 5025 dest := genValue(n) 5026 n.exec = func(f *frame) bltn { 5027 _, s1 := v1(f) 5028 dest(f).SetBool(s0 <= s1) 5029 return tnext 5030 } 5031 } 5032 case c1.rval.IsValid(): 5033 s1 := vUint(c1.rval) 5034 v0 := genValueUint(c0) 5035 if n.fnext != nil { 5036 fnext := getExec(n.fnext) 5037 n.exec = func(f *frame) bltn { 5038 _, s0 := v0(f) 5039 if s0 <= s1 { 5040 dest(f).SetBool(true) 5041 return tnext 5042 } 5043 dest(f).SetBool(false) 5044 return fnext 5045 } 5046 } else { 5047 dest := genValue(n) 5048 n.exec = func(f *frame) bltn { 5049 _, s0 := v0(f) 5050 dest(f).SetBool(s0 <= s1) 5051 return tnext 5052 } 5053 } 5054 default: 5055 v0 := genValueUint(c0) 5056 v1 := genValueUint(c1) 5057 if n.fnext != nil { 5058 fnext := getExec(n.fnext) 5059 n.exec = func(f *frame) bltn { 5060 _, s0 := v0(f) 5061 _, s1 := v1(f) 5062 if s0 <= s1 { 5063 dest(f).SetBool(true) 5064 return tnext 5065 } 5066 dest(f).SetBool(false) 5067 return fnext 5068 } 5069 } else { 5070 dest := genValue(n) 5071 n.exec = func(f *frame) bltn { 5072 _, s0 := v0(f) 5073 _, s1 := v1(f) 5074 dest(f).SetBool(s0 <= s1) 5075 return tnext 5076 } 5077 } 5078 } 5079 case isInt(t0) || isInt(t1): 5080 switch { 5081 case isInterface: 5082 v0 := genValueInt(c0) 5083 v1 := genValueInt(c1) 5084 n.exec = func(f *frame) bltn { 5085 _, s0 := v0(f) 5086 _, s1 := v1(f) 5087 dest(f).Set(reflect.ValueOf(s0 <= s1).Convert(typ)) 5088 return tnext 5089 } 5090 case c0.rval.IsValid(): 5091 s0 := vInt(c0.rval) 5092 v1 := genValueInt(c1) 5093 if n.fnext != nil { 5094 fnext := getExec(n.fnext) 5095 n.exec = func(f *frame) bltn { 5096 _, s1 := v1(f) 5097 if s0 <= s1 { 5098 dest(f).SetBool(true) 5099 return tnext 5100 } 5101 dest(f).SetBool(false) 5102 return fnext 5103 } 5104 } else { 5105 dest := genValue(n) 5106 n.exec = func(f *frame) bltn { 5107 _, s1 := v1(f) 5108 dest(f).SetBool(s0 <= s1) 5109 return tnext 5110 } 5111 } 5112 case c1.rval.IsValid(): 5113 s1 := vInt(c1.rval) 5114 v0 := genValueInt(c0) 5115 if n.fnext != nil { 5116 fnext := getExec(n.fnext) 5117 n.exec = func(f *frame) bltn { 5118 _, s0 := v0(f) 5119 if s0 <= s1 { 5120 dest(f).SetBool(true) 5121 return tnext 5122 } 5123 dest(f).SetBool(false) 5124 return fnext 5125 } 5126 } else { 5127 dest := genValue(n) 5128 n.exec = func(f *frame) bltn { 5129 _, s0 := v0(f) 5130 dest(f).SetBool(s0 <= s1) 5131 return tnext 5132 } 5133 } 5134 default: 5135 v0 := genValueInt(c0) 5136 v1 := genValueInt(c1) 5137 if n.fnext != nil { 5138 fnext := getExec(n.fnext) 5139 n.exec = func(f *frame) bltn { 5140 _, s0 := v0(f) 5141 _, s1 := v1(f) 5142 if s0 <= s1 { 5143 dest(f).SetBool(true) 5144 return tnext 5145 } 5146 dest(f).SetBool(false) 5147 return fnext 5148 } 5149 } else { 5150 dest := genValue(n) 5151 n.exec = func(f *frame) bltn { 5152 _, s0 := v0(f) 5153 _, s1 := v1(f) 5154 dest(f).SetBool(s0 <= s1) 5155 return tnext 5156 } 5157 } 5158 } 5159 default: 5160 v0 := genValue(c0) 5161 v1 := genValue(c1) 5162 if n.fnext != nil { 5163 fnext := getExec(n.fnext) 5164 n.exec = func(f *frame) bltn { 5165 val0 := v0(f) 5166 val1 := v1(f) 5167 v, e := rcompare(val0, val1, "<=") 5168 if e != nil { 5169 panic(n.runErrorf(e.Error())) 5170 } 5171 if v { 5172 dest(f).SetBool(true) 5173 return tnext 5174 } 5175 dest(f).SetBool(false) 5176 return fnext 5177 } 5178 } else { 5179 n.exec = func(f *frame) bltn { 5180 val0 := v0(f) 5181 val1 := v1(f) 5182 v, e := rcompare(val0, val1, "<=") 5183 if e != nil { 5184 panic(n.runErrorf(e.Error())) 5185 } 5186 dest(f).SetBool(v) 5187 return tnext 5188 } 5189 } 5190 } 5191 } 5192 5193 func notEqual(n *node) { 5194 tnext := getExec(n.tnext) 5195 dest := genValueOutput(n, reflect.TypeOf(true)) 5196 typ := n.typ.concrete().TypeOf() 5197 isInterface := n.typ.TypeOf().Kind() == reflect.Interface 5198 c0, c1 := n.child[0], n.child[1] 5199 t0, t1 := c0.typ.TypeOf(), c1.typ.TypeOf() 5200 5201 if c0.typ.cat == aliasT || c1.typ.cat == aliasT { 5202 switch { 5203 case isInterface: 5204 v0 := genValue(c0) 5205 v1 := genValue(c1) 5206 dest := genValue(n) 5207 n.exec = func(f *frame) bltn { 5208 i0 := v0(f).Interface() 5209 i1 := v1(f).Interface() 5210 dest(f).Set(reflect.ValueOf(i0 != i1).Convert(typ)) 5211 return tnext 5212 } 5213 case c0.rval.IsValid(): 5214 i0 := c0.rval.Interface() 5215 v1 := genValue(c1) 5216 if n.fnext != nil { 5217 fnext := getExec(n.fnext) 5218 n.exec = func(f *frame) bltn { 5219 i1 := v1(f).Interface() 5220 if i0 != i1 { 5221 dest(f).SetBool(true) 5222 return tnext 5223 } 5224 dest(f).SetBool(false) 5225 return fnext 5226 } 5227 } else { 5228 dest := genValue(n) 5229 n.exec = func(f *frame) bltn { 5230 i1 := v1(f).Interface() 5231 dest(f).SetBool(i0 != i1) 5232 return tnext 5233 } 5234 } 5235 case c1.rval.IsValid(): 5236 i1 := c1.rval.Interface() 5237 v0 := genValue(c0) 5238 if n.fnext != nil { 5239 fnext := getExec(n.fnext) 5240 n.exec = func(f *frame) bltn { 5241 i0 := v0(f).Interface() 5242 if i0 != i1 { 5243 dest(f).SetBool(true) 5244 return tnext 5245 } 5246 dest(f).SetBool(false) 5247 return fnext 5248 } 5249 } else { 5250 dest := genValue(n) 5251 n.exec = func(f *frame) bltn { 5252 i0 := v0(f).Interface() 5253 dest(f).SetBool(i0 != i1) 5254 return tnext 5255 } 5256 } 5257 default: 5258 v0 := genValue(c0) 5259 v1 := genValue(c1) 5260 if n.fnext != nil { 5261 fnext := getExec(n.fnext) 5262 n.exec = func(f *frame) bltn { 5263 i0 := v0(f).Interface() 5264 i1 := v1(f).Interface() 5265 if i0 != i1 { 5266 dest(f).SetBool(true) 5267 return tnext 5268 } 5269 dest(f).SetBool(false) 5270 return fnext 5271 } 5272 } else { 5273 dest := genValue(n) 5274 n.exec = func(f *frame) bltn { 5275 i0 := v0(f).Interface() 5276 i1 := v1(f).Interface() 5277 dest(f).SetBool(i0 != i1) 5278 return tnext 5279 } 5280 } 5281 } 5282 return 5283 } 5284 5285 // Do not attempt to optimize '==' or '!=' if an operand is an interface. 5286 // This will preserve proper dynamic type checking at runtime. For static types, 5287 // type checks are already performed, so bypass them if possible. 5288 if t0.Kind() == reflect.Interface || t1.Kind() == reflect.Interface { 5289 v0 := genValue(c0) 5290 v1 := genValue(c1) 5291 if n.fnext != nil { 5292 fnext := getExec(n.fnext) 5293 n.exec = func(f *frame) bltn { 5294 val0 := v0(f) 5295 val1 := v1(f) 5296 var err error 5297 var typ0 reflect.Type 5298 if val0.Kind() == reflect.Interface && val0.Elem().IsValid() { 5299 typ0 = val0.Elem().Type() 5300 } else { 5301 typ0 = val0.Type() 5302 } 5303 val1, err = rconv(val1, typ0) 5304 if err != nil { 5305 panic(err) 5306 } 5307 i0 := val0.Interface() 5308 i1 := val1.Interface() 5309 if i0 != i1 { 5310 dest(f).SetBool(true) 5311 return tnext 5312 } 5313 dest(f).SetBool(false) 5314 return fnext 5315 } 5316 } else { 5317 dest := genValue(n) 5318 n.exec = func(f *frame) bltn { 5319 i0 := v0(f).Interface() 5320 i1 := v1(f).Interface() 5321 x := i0 != i1 5322 dest(f).Set(reflect.ValueOf(x)) 5323 return tnext 5324 } 5325 } 5326 return 5327 } 5328 5329 switch { 5330 case isString(t0) || isString(t1): 5331 switch { 5332 case isInterface: 5333 v0 := genValueString(c0) 5334 v1 := genValueString(c1) 5335 n.exec = func(f *frame) bltn { 5336 _, s0 := v0(f) 5337 _, s1 := v1(f) 5338 dest(f).Set(reflect.ValueOf(s0 != s1).Convert(typ)) 5339 return tnext 5340 } 5341 case c0.rval.IsValid(): 5342 s0 := vString(c0.rval) 5343 v1 := genValueString(c1) 5344 if n.fnext != nil { 5345 fnext := getExec(n.fnext) 5346 n.exec = func(f *frame) bltn { 5347 _, s1 := v1(f) 5348 if s0 != s1 { 5349 dest(f).SetBool(true) 5350 return tnext 5351 } 5352 dest(f).SetBool(false) 5353 return fnext 5354 } 5355 } else { 5356 n.exec = func(f *frame) bltn { 5357 _, s1 := v1(f) 5358 dest(f).SetBool(s0 != s1) 5359 return tnext 5360 } 5361 } 5362 case c1.rval.IsValid(): 5363 s1 := vString(c1.rval) 5364 v0 := genValueString(c0) 5365 if n.fnext != nil { 5366 fnext := getExec(n.fnext) 5367 n.exec = func(f *frame) bltn { 5368 _, s0 := v0(f) 5369 if s0 != s1 { 5370 dest(f).SetBool(true) 5371 return tnext 5372 } 5373 dest(f).SetBool(false) 5374 return fnext 5375 } 5376 } else { 5377 n.exec = func(f *frame) bltn { 5378 _, s0 := v0(f) 5379 dest(f).SetBool(s0 != s1) 5380 return tnext 5381 } 5382 } 5383 default: 5384 v0 := genValueString(c0) 5385 v1 := genValueString(c1) 5386 if n.fnext != nil { 5387 fnext := getExec(n.fnext) 5388 n.exec = func(f *frame) bltn { 5389 _, s0 := v0(f) 5390 _, s1 := v1(f) 5391 if s0 != s1 { 5392 dest(f).SetBool(true) 5393 return tnext 5394 } 5395 dest(f).SetBool(false) 5396 return fnext 5397 } 5398 } else { 5399 n.exec = func(f *frame) bltn { 5400 _, s0 := v0(f) 5401 _, s1 := v1(f) 5402 dest(f).SetBool(s0 != s1) 5403 return tnext 5404 } 5405 } 5406 } 5407 case isFloat(t0) || isFloat(t1): 5408 switch { 5409 case isInterface: 5410 v0 := genValueFloat(c0) 5411 v1 := genValueFloat(c1) 5412 n.exec = func(f *frame) bltn { 5413 _, s0 := v0(f) 5414 _, s1 := v1(f) 5415 dest(f).Set(reflect.ValueOf(s0 != s1).Convert(typ)) 5416 return tnext 5417 } 5418 case c0.rval.IsValid(): 5419 s0 := vFloat(c0.rval) 5420 v1 := genValueFloat(c1) 5421 if n.fnext != nil { 5422 fnext := getExec(n.fnext) 5423 n.exec = func(f *frame) bltn { 5424 _, s1 := v1(f) 5425 if s0 != s1 { 5426 dest(f).SetBool(true) 5427 return tnext 5428 } 5429 dest(f).SetBool(false) 5430 return fnext 5431 } 5432 } else { 5433 n.exec = func(f *frame) bltn { 5434 _, s1 := v1(f) 5435 dest(f).SetBool(s0 != s1) 5436 return tnext 5437 } 5438 } 5439 case c1.rval.IsValid(): 5440 s1 := vFloat(c1.rval) 5441 v0 := genValueFloat(c0) 5442 if n.fnext != nil { 5443 fnext := getExec(n.fnext) 5444 n.exec = func(f *frame) bltn { 5445 _, s0 := v0(f) 5446 if s0 != s1 { 5447 dest(f).SetBool(true) 5448 return tnext 5449 } 5450 dest(f).SetBool(false) 5451 return fnext 5452 } 5453 } else { 5454 dest := genValue(n) 5455 n.exec = func(f *frame) bltn { 5456 _, s0 := v0(f) 5457 dest(f).SetBool(s0 != s1) 5458 return tnext 5459 } 5460 } 5461 default: 5462 v0 := genValueFloat(c0) 5463 v1 := genValueFloat(c1) 5464 if n.fnext != nil { 5465 fnext := getExec(n.fnext) 5466 n.exec = func(f *frame) bltn { 5467 _, s0 := v0(f) 5468 _, s1 := v1(f) 5469 if s0 != s1 { 5470 dest(f).SetBool(true) 5471 return tnext 5472 } 5473 dest(f).SetBool(false) 5474 return fnext 5475 } 5476 } else { 5477 dest := genValue(n) 5478 n.exec = func(f *frame) bltn { 5479 _, s0 := v0(f) 5480 _, s1 := v1(f) 5481 dest(f).SetBool(s0 != s1) 5482 return tnext 5483 } 5484 } 5485 } 5486 case isUint(t0) || isUint(t1): 5487 switch { 5488 case isInterface: 5489 v0 := genValueUint(c0) 5490 v1 := genValueUint(c1) 5491 n.exec = func(f *frame) bltn { 5492 _, s0 := v0(f) 5493 _, s1 := v1(f) 5494 dest(f).Set(reflect.ValueOf(s0 != s1).Convert(typ)) 5495 return tnext 5496 } 5497 case c0.rval.IsValid(): 5498 s0 := vUint(c0.rval) 5499 v1 := genValueUint(c1) 5500 if n.fnext != nil { 5501 fnext := getExec(n.fnext) 5502 n.exec = func(f *frame) bltn { 5503 _, s1 := v1(f) 5504 if s0 != s1 { 5505 dest(f).SetBool(true) 5506 return tnext 5507 } 5508 dest(f).SetBool(false) 5509 return fnext 5510 } 5511 } else { 5512 dest := genValue(n) 5513 n.exec = func(f *frame) bltn { 5514 _, s1 := v1(f) 5515 dest(f).SetBool(s0 != s1) 5516 return tnext 5517 } 5518 } 5519 case c1.rval.IsValid(): 5520 s1 := vUint(c1.rval) 5521 v0 := genValueUint(c0) 5522 if n.fnext != nil { 5523 fnext := getExec(n.fnext) 5524 n.exec = func(f *frame) bltn { 5525 _, s0 := v0(f) 5526 if s0 != s1 { 5527 dest(f).SetBool(true) 5528 return tnext 5529 } 5530 dest(f).SetBool(false) 5531 return fnext 5532 } 5533 } else { 5534 dest := genValue(n) 5535 n.exec = func(f *frame) bltn { 5536 _, s0 := v0(f) 5537 dest(f).SetBool(s0 != s1) 5538 return tnext 5539 } 5540 } 5541 default: 5542 v0 := genValueUint(c0) 5543 v1 := genValueUint(c1) 5544 if n.fnext != nil { 5545 fnext := getExec(n.fnext) 5546 n.exec = func(f *frame) bltn { 5547 _, s0 := v0(f) 5548 _, s1 := v1(f) 5549 if s0 != s1 { 5550 dest(f).SetBool(true) 5551 return tnext 5552 } 5553 dest(f).SetBool(false) 5554 return fnext 5555 } 5556 } else { 5557 dest := genValue(n) 5558 n.exec = func(f *frame) bltn { 5559 _, s0 := v0(f) 5560 _, s1 := v1(f) 5561 dest(f).SetBool(s0 != s1) 5562 return tnext 5563 } 5564 } 5565 } 5566 case isInt(t0) || isInt(t1): 5567 switch { 5568 case isInterface: 5569 v0 := genValueInt(c0) 5570 v1 := genValueInt(c1) 5571 n.exec = func(f *frame) bltn { 5572 _, s0 := v0(f) 5573 _, s1 := v1(f) 5574 dest(f).Set(reflect.ValueOf(s0 != s1).Convert(typ)) 5575 return tnext 5576 } 5577 case c0.rval.IsValid(): 5578 s0 := vInt(c0.rval) 5579 v1 := genValueInt(c1) 5580 if n.fnext != nil { 5581 fnext := getExec(n.fnext) 5582 n.exec = func(f *frame) bltn { 5583 _, s1 := v1(f) 5584 if s0 != s1 { 5585 dest(f).SetBool(true) 5586 return tnext 5587 } 5588 dest(f).SetBool(false) 5589 return fnext 5590 } 5591 } else { 5592 dest := genValue(n) 5593 n.exec = func(f *frame) bltn { 5594 _, s1 := v1(f) 5595 dest(f).SetBool(s0 != s1) 5596 return tnext 5597 } 5598 } 5599 case c1.rval.IsValid(): 5600 s1 := vInt(c1.rval) 5601 v0 := genValueInt(c0) 5602 if n.fnext != nil { 5603 fnext := getExec(n.fnext) 5604 n.exec = func(f *frame) bltn { 5605 _, s0 := v0(f) 5606 if s0 != s1 { 5607 dest(f).SetBool(true) 5608 return tnext 5609 } 5610 dest(f).SetBool(false) 5611 return fnext 5612 } 5613 } else { 5614 dest := genValue(n) 5615 n.exec = func(f *frame) bltn { 5616 _, s0 := v0(f) 5617 dest(f).SetBool(s0 != s1) 5618 return tnext 5619 } 5620 } 5621 default: 5622 v0 := genValueInt(c0) 5623 v1 := genValueInt(c1) 5624 if n.fnext != nil { 5625 fnext := getExec(n.fnext) 5626 n.exec = func(f *frame) bltn { 5627 _, s0 := v0(f) 5628 _, s1 := v1(f) 5629 if s0 != s1 { 5630 dest(f).SetBool(true) 5631 return tnext 5632 } 5633 dest(f).SetBool(false) 5634 return fnext 5635 } 5636 } else { 5637 dest := genValue(n) 5638 n.exec = func(f *frame) bltn { 5639 _, s0 := v0(f) 5640 _, s1 := v1(f) 5641 dest(f).SetBool(s0 != s1) 5642 return tnext 5643 } 5644 } 5645 } 5646 case isComplex(t0) || isComplex(t1): 5647 switch { 5648 case isInterface: 5649 v0 := genComplex(c0) 5650 v1 := genComplex(c1) 5651 n.exec = func(f *frame) bltn { 5652 s0 := v0(f) 5653 s1 := v1(f) 5654 dest(f).Set(reflect.ValueOf(s0 != s1).Convert(typ)) 5655 return tnext 5656 } 5657 case c0.rval.IsValid(): 5658 s0 := vComplex(c0.rval) 5659 v1 := genComplex(c1) 5660 if n.fnext != nil { 5661 fnext := getExec(n.fnext) 5662 n.exec = func(f *frame) bltn { 5663 s1 := v1(f) 5664 if s0 != s1 { 5665 dest(f).SetBool(true) 5666 return tnext 5667 } 5668 dest(f).SetBool(false) 5669 return fnext 5670 } 5671 } else { 5672 n.exec = func(f *frame) bltn { 5673 s1 := v1(f) 5674 dest(f).SetBool(s0 != s1) 5675 return tnext 5676 } 5677 } 5678 case c1.rval.IsValid(): 5679 s1 := vComplex(c1.rval) 5680 v0 := genComplex(c0) 5681 if n.fnext != nil { 5682 fnext := getExec(n.fnext) 5683 n.exec = func(f *frame) bltn { 5684 s0 := v0(f) 5685 if s0 != s1 { 5686 dest(f).SetBool(true) 5687 return tnext 5688 } 5689 dest(f).SetBool(false) 5690 return fnext 5691 } 5692 } else { 5693 dest := genValue(n) 5694 n.exec = func(f *frame) bltn { 5695 s0 := v0(f) 5696 dest(f).SetBool(s0 != s1) 5697 return tnext 5698 } 5699 } 5700 default: 5701 v0 := genComplex(c0) 5702 v1 := genComplex(c1) 5703 if n.fnext != nil { 5704 fnext := getExec(n.fnext) 5705 n.exec = func(f *frame) bltn { 5706 s0 := v0(f) 5707 s1 := v1(f) 5708 if s0 != s1 { 5709 dest(f).SetBool(true) 5710 return tnext 5711 } 5712 dest(f).SetBool(false) 5713 return fnext 5714 } 5715 } else { 5716 n.exec = func(f *frame) bltn { 5717 s0 := v0(f) 5718 s1 := v1(f) 5719 dest(f).SetBool(s0 != s1) 5720 return tnext 5721 } 5722 } 5723 } 5724 default: 5725 switch { 5726 case isInterface: 5727 v0 := genValue(c0) 5728 v1 := genValue(c1) 5729 n.exec = func(f *frame) bltn { 5730 i0 := v0(f).Interface() 5731 i1 := v1(f).Interface() 5732 dest(f).Set(reflect.ValueOf(i0 != i1).Convert(typ)) 5733 return tnext 5734 } 5735 case c0.rval.IsValid(): 5736 i0 := c0.rval.Interface() 5737 v1 := genValue(c1) 5738 if n.fnext != nil { 5739 fnext := getExec(n.fnext) 5740 n.exec = func(f *frame) bltn { 5741 i1 := v1(f).Interface() 5742 if i0 != i1 { 5743 dest(f).SetBool(true) 5744 return tnext 5745 } 5746 dest(f).SetBool(false) 5747 return fnext 5748 } 5749 } else { 5750 dest := genValue(n) 5751 n.exec = func(f *frame) bltn { 5752 i1 := v1(f).Interface() 5753 dest(f).SetBool(i0 != i1) 5754 return tnext 5755 } 5756 } 5757 case c1.rval.IsValid(): 5758 i1 := c1.rval.Interface() 5759 v0 := genValue(c0) 5760 if n.fnext != nil { 5761 fnext := getExec(n.fnext) 5762 n.exec = func(f *frame) bltn { 5763 i0 := v0(f).Interface() 5764 if i0 != i1 { 5765 dest(f).SetBool(true) 5766 return tnext 5767 } 5768 dest(f).SetBool(false) 5769 return fnext 5770 } 5771 } else { 5772 dest := genValue(n) 5773 n.exec = func(f *frame) bltn { 5774 i0 := v0(f).Interface() 5775 dest(f).SetBool(i0 != i1) 5776 return tnext 5777 } 5778 } 5779 default: 5780 v0 := genValue(c0) 5781 v1 := genValue(c1) 5782 if n.fnext != nil { 5783 fnext := getExec(n.fnext) 5784 n.exec = func(f *frame) bltn { 5785 i0 := v0(f).Interface() 5786 i1 := v1(f).Interface() 5787 if i0 != i1 { 5788 dest(f).SetBool(true) 5789 return tnext 5790 } 5791 dest(f).SetBool(false) 5792 return fnext 5793 } 5794 } else { 5795 dest := genValue(n) 5796 n.exec = func(f *frame) bltn { 5797 i0 := v0(f).Interface() 5798 i1 := v1(f).Interface() 5799 dest(f).SetBool(i0 != i1) 5800 return tnext 5801 } 5802 } 5803 } 5804 } 5805 }