Changeset 39197 in webkit for trunk/JavaScriptCore/jit/JIT.cpp
- Timestamp:
- Dec 10, 2008, 8:35:13 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JIT.cpp
r39182 r39197 409 409 410 410 // check if any are immediates 411 __ orl_rr(X86::eax, X86::ecx); 412 __ orl_rr(X86::edx, X86::ecx); 413 emitJumpSlowCaseIfNotJSCell(X86::ecx, i); 411 move(X86::eax, X86::ebx); 412 or32(X86::ecx, X86::ebx); 413 or32(X86::edx, X86::ebx); 414 emitJumpSlowCaseIfNotJSCell(X86::ebx, i); 414 415 415 416 // check that all are object type - this is a bit of a bithack to avoid excess branching; 416 417 // we check that the sum of the three type codes from Structures is exactly 3 * ObjectType, 417 418 // this works because NumberType and StringType are smaller 418 __ movl_i32r(3 * ObjectType, X86::ecx); 419 __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::eax, X86::eax); 420 __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::edx, X86::edx); 421 __ subl_mr(FIELD_OFFSET(Structure, m_typeInfo.m_type), X86::eax, X86::ecx); 422 __ subl_mr(FIELD_OFFSET(Structure, m_typeInfo.m_type), X86::edx, X86::ecx); 423 emitGetVirtualRegister(instruction[i + 3].u.operand, X86::edx, i); // reload baseVal 424 __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::edx, X86::edx); 425 __ cmpl_rm(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_type), X86::edx); 426 427 m_slowCases.append(SlowCaseEntry(__ jne(), i)); 419 move(Imm32(3 * ObjectType), X86::ebx); 420 loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::eax); 421 loadPtr(Address(X86::ecx, FIELD_OFFSET(JSCell, m_structure)), X86::ecx); 422 loadPtr(Address(X86::edx, FIELD_OFFSET(JSCell, m_structure)), X86::edx); 423 sub32(Address(X86::eax, FIELD_OFFSET(Structure, m_typeInfo.m_type)), X86::ebx); 424 sub32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_type)), X86::ebx); 425 m_slowCases.append(SlowCaseEntry(jne32(Address(X86::edx, FIELD_OFFSET(Structure, m_typeInfo.m_type)), X86::ebx), i)); 428 426 429 427 // check that baseVal's flags include ImplementsHasInstance but not OverridesHasInstance 430 __ movl_mr(FIELD_OFFSET(Structure, m_typeInfo.m_flags), X86::edx, X86::ecx); 431 __ andl_i32r(ImplementsHasInstance | OverridesHasInstance, X86::ecx); 432 __ cmpl_i32r(ImplementsHasInstance, X86::ecx); 433 434 m_slowCases.append(SlowCaseEntry(__ jne(), i)); 428 load32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), X86::ecx); 429 and32(Imm32(ImplementsHasInstance | OverridesHasInstance), X86::ecx); 430 m_slowCases.append(SlowCaseEntry(jne32(X86::ecx, Imm32(ImplementsHasInstance)), i)); 435 431 436 432 emitGetVirtualRegister(instruction[i + 2].u.operand, X86::ecx, i); // reload value … … 438 434 439 435 // optimistically load true result 440 __ movl_i32r(asInteger(jsBoolean(true)), X86::eax);441 442 JmpDst loop = __ label();436 move(Imm32(asInteger(jsBoolean(true))), X86::eax); 437 438 Label loop(this); 443 439 444 440 // load value's prototype 445 __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::ecx, X86::ecx); 446 __ movl_mr(FIELD_OFFSET(Structure, m_prototype), X86::ecx, X86::ecx); 447 448 __ cmpl_rr(X86::ecx, X86::edx); 449 JmpSrc exit = __ je(); 450 451 __ cmpl_i32r(asInteger(jsNull()), X86::ecx); 452 JmpSrc goToLoop = __ jne(); 453 __ link(goToLoop, loop); 454 455 __ movl_i32r(asInteger(jsBoolean(false)), X86::eax); 456 457 __ link(exit, __ label()); 441 loadPtr(Address(X86::ecx, FIELD_OFFSET(JSCell, m_structure)), X86::ecx); 442 loadPtr(Address(X86::ecx, FIELD_OFFSET(Structure, m_prototype)), X86::ecx); 443 444 Jump exit = jePtr(X86::ecx, X86::edx); 445 446 jne32(X86::ecx, Imm32(asInteger(jsNull())), loop); 447 448 move(Imm32(asInteger(jsBoolean(false))), X86::eax); 449 450 exit.link(this); 458 451 459 452 emitPutVirtualRegister(instruction[i + 1].u.operand); … … 590 583 } 591 584 case op_new_array: { 592 __ leal_mr(sizeof(Register) * instruction[i + 2].u.operand, X86::edi, X86::edx); 593 emitPutCTIArg(X86::edx, 0); 585 emitPutCTIArgConstant(instruction[i + 2].u.operand, 0); 594 586 emitPutCTIArgConstant(instruction[i + 3].u.operand, 4); 595 587 emitCTICall(i, Interpreter::cti_op_new_array); … … 609 601 emitGetVirtualRegister(instruction[i + 1].u.operand, X86::eax, i); 610 602 611 JmpSrc isImmediate = emitJumpIfNotJSCell(X86::eax); 612 __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::eax, X86::ecx); 613 __ cmpl_i32m(ObjectType, FIELD_OFFSET(Structure, m_typeInfo) + FIELD_OFFSET(TypeInfo, m_type), X86::ecx); 614 JmpSrc isObject = __ je(); 615 616 __ link(isImmediate, __ label()); 617 emitGetVirtualRegister(instruction[i + 2].u.operand, X86::eax, i); 618 emitPutVirtualRegister(instruction[i + 1].u.operand); 619 __ link(isObject, __ label()); 603 emitJumpSlowCaseIfNotJSCell(X86::eax, i); 604 loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::ecx); 605 m_slowCases.append(SlowCaseEntry(jne32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo) + FIELD_OFFSET(TypeInfo, m_type)), Imm32(ObjectType)), i)); 620 606 621 607 i += OPCODE_LENGTH(op_construct_verify); … … 627 613 emitFastArithImmToInt(X86::edx); 628 614 emitJumpSlowCaseIfNotJSCell(X86::eax, i); 629 __ cmpl_i32m(reinterpret_cast<unsigned>(m_interpreter->m_jsArrayVptr), X86::eax); 630 m_slowCases.append(SlowCaseEntry(__ jne(), i)); 615 m_slowCases.append(SlowCaseEntry(jnePtr(Address(X86::eax), ImmPtr(m_interpreter->m_jsArrayVptr)), i)); 631 616 632 617 // This is an array; get the m_storage pointer into ecx, then check if the index is below the fast cutoff 633 __ movl_mr(FIELD_OFFSET(JSArray, m_storage), X86::eax, X86::ecx); 634 __ cmpl_rm(X86::edx, FIELD_OFFSET(JSArray, m_fastAccessCutoff), X86::eax); 635 m_slowCases.append(SlowCaseEntry(__ jbe(), i)); 618 loadPtr(Address(X86::eax, FIELD_OFFSET(JSArray, m_storage)), X86::ecx); 619 m_slowCases.append(SlowCaseEntry(jae32(X86::edx, Address(X86::eax, FIELD_OFFSET(JSArray, m_fastAccessCutoff))), i)); 636 620 637 621 // Get the value from the vector 638 __ movl_mr(FIELD_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*), X86::eax);622 loadPtr(BaseIndex(X86::ecx, X86::edx, ScalePtr, FIELD_OFFSET(ArrayStorage, m_vector[0])), X86::eax); 639 623 emitPutVirtualRegister(instruction[i + 1].u.operand); 640 624 i += OPCODE_LENGTH(op_get_by_val); … … 660 644 emitFastArithImmToInt(X86::edx); 661 645 emitJumpSlowCaseIfNotJSCell(X86::eax, i); 662 __ cmpl_i32m(reinterpret_cast<unsigned>(m_interpreter->m_jsArrayVptr), X86::eax); 663 m_slowCases.append(SlowCaseEntry(__ jne(), i)); 646 m_slowCases.append(SlowCaseEntry(jnePtr(Address(X86::eax), ImmPtr(m_interpreter->m_jsArrayVptr)), i)); 664 647 665 648 // This is an array; get the m_storage pointer into ecx, then check if the index is below the fast cutoff 666 __ movl_mr(FIELD_OFFSET(JSArray, m_storage), X86::eax, X86::ecx); 667 __ cmpl_rm(X86::edx, FIELD_OFFSET(JSArray, m_fastAccessCutoff), X86::eax); 668 JmpSrc inFastVector = __ ja(); 649 loadPtr(Address(X86::eax, FIELD_OFFSET(JSArray, m_storage)), X86::ecx); 650 Jump inFastVector = jb32(X86::edx, Address(X86::eax, FIELD_OFFSET(JSArray, m_fastAccessCutoff))); 669 651 // No; oh well, check if the access if within the vector - if so, we may still be okay. 670 __ cmpl_rm(X86::edx, FIELD_OFFSET(ArrayStorage, m_vectorLength), X86::ecx); 671 m_slowCases.append(SlowCaseEntry(__ jbe(), i)); 652 m_slowCases.append(SlowCaseEntry(jae32(X86::edx, Address(X86::ecx, FIELD_OFFSET(ArrayStorage, m_vectorLength))), i)); 672 653 673 654 // This is a write to the slow part of the vector; first, we have to check if this would be the first write to this location. 674 655 // FIXME: should be able to handle initial write to array; increment the the number of items in the array, and potentially update fast access cutoff. 675 __ cmpl_i8m(0, FIELD_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*)); 676 m_slowCases.append(SlowCaseEntry(__ je(), i)); 656 m_slowCases.append(SlowCaseEntry(jzPtr(BaseIndex(X86::ecx, X86::edx, ScalePtr, FIELD_OFFSET(ArrayStorage, m_vector[0]))), i)); 677 657 678 658 // All good - put the value into the array. 679 __ link(inFastVector, __ label());659 inFastVector.link(this); 680 660 emitGetVirtualRegister(instruction[i + 3].u.operand, X86::eax, i); 681 __ movl_rm(X86::eax, FIELD_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*));661 storePtr(X86::eax, BaseIndex(X86::ecx, X86::edx, ScalePtr, FIELD_OFFSET(ArrayStorage, m_vector[0]))); 682 662 i += OPCODE_LENGTH(op_put_by_val); 683 663 break; … … 690 670 emitGetVirtualRegister(instruction[i + 1].u.operand, X86::eax, i); 691 671 692 __ cmpl_i32r(asInteger(JSImmediate::zeroImmediate()), X86::eax); 693 JmpSrc isZero = __ je(); 694 __ testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax); 695 m_jmpTable.append(JmpTable(__ jne(), i + 2 + target)); 696 697 __ cmpl_i32r(asInteger(JSImmediate::trueImmediate()), X86::eax); 698 m_jmpTable.append(JmpTable(__ je(), i + 2 + target)); 699 __ cmpl_i32r(asInteger(JSImmediate::falseImmediate()), X86::eax); 700 m_slowCases.append(SlowCaseEntry(__ jne(), i)); 701 702 __ link(isZero, __ label()); 672 Jump isZero = je32(X86::eax, Imm32(asInteger(JSImmediate::zeroImmediate()))); 673 m_jmpTable.append(JmpTable(jnz32(X86::eax, Imm32(JSImmediate::TagBitTypeInteger)), i + 2 + target)); 674 675 m_jmpTable.append(JmpTable(je32(X86::eax, Imm32(asInteger(JSImmediate::trueImmediate()))), i + 2 + target)); 676 m_slowCases.append(SlowCaseEntry(jne32(X86::eax, Imm32(asInteger(JSImmediate::falseImmediate()))), i)); 677 678 isZero.link(this); 703 679 i += OPCODE_LENGTH(op_loop_if_true); 704 680 break; … … 730 706 case op_resolve_global: { 731 707 // Fast case 732 unsigned globalObject = asInteger(instruction[i + 2].u.jsCell);708 void* globalObject = instruction[i + 2].u.jsCell; 733 709 Identifier* ident = &(m_codeBlock->identifier(instruction[i + 3].u.operand)); 734 710 void* structureAddress = reinterpret_cast<void*>(instruction + i + 4); … … 736 712 737 713 // Check Structure of global object 738 __ movl_i32r(globalObject, X86::eax); 739 __ movl_mr(structureAddress, X86::edx); 740 __ cmpl_rm(X86::edx, FIELD_OFFSET(JSCell, m_structure), X86::eax); 741 JmpSrc noMatch = __ jne(); // Structures don't match 714 move(ImmPtr(globalObject), X86::eax); 715 loadPtr(structureAddress, X86::edx); 716 Jump noMatch = jnePtr(X86::edx, Address(X86::eax, FIELD_OFFSET(JSCell, m_structure))); // Structures don't match 742 717 743 718 // Load cached property 744 __ movl_mr(FIELD_OFFSET(JSGlobalObject, m_propertyStorage), X86::eax, X86::eax);745 __ movl_mr(offsetAddr, X86::edx);746 __ movl_mr(0, X86::eax, X86::edx, sizeof(JSValue*), X86::eax);747 emitPutVirtualRegister(instruction[i + 1].u.operand); 748 J mpSrc end = __ jmp();719 loadPtr(Address(X86::eax, FIELD_OFFSET(JSGlobalObject, m_propertyStorage)), X86::eax); 720 load32(offsetAddr, X86::edx); 721 loadPtr(BaseIndex(X86::eax, X86::edx, ScalePtr), X86::eax); 722 emitPutVirtualRegister(instruction[i + 1].u.operand); 723 Jump end = jump(); 749 724 750 725 // Slow case 751 __ link(noMatch, __ label());726 noMatch.link(this); 752 727 emitPutCTIArgConstant(globalObject, 0); 753 728 emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 4); … … 755 730 emitCTICall(i, Interpreter::cti_op_resolve_global); 756 731 emitPutVirtualRegister(instruction[i + 1].u.operand); 757 __ link(end, __ label());732 end.link(this); 758 733 i += OPCODE_LENGTH(op_resolve_global); 759 734 break; … … 764 739 emitGetVirtualRegister(srcDst, X86::eax, i); 765 740 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 766 __ subl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::eax); 767 m_slowCases.append(SlowCaseEntry(__ jo(), i)); 741 m_slowCases.append(SlowCaseEntry(joSub32(Imm32(getDeTaggedConstantImmediate(JSImmediate::oneImmediate())), X86::eax), i)); 768 742 emitPutVirtualRegister(srcDst); 769 743 i += OPCODE_LENGTH(op_pre_dec); … … 776 750 emitGetVirtualRegister(instruction[i + 1].u.operand, X86::edx, i); 777 751 emitJumpSlowCaseIfNotImmNum(X86::edx, i); 778 __ cmpl_i32r(asInteger(src2imm), X86::edx); 779 m_jmpTable.append(JmpTable(__ jge(), i + 3 + target)); 752 m_jmpTable.append(JmpTable(jge32(X86::edx, Imm32(asInteger(src2imm))), i + 3 + target)); 780 753 } else { 781 754 emitGetVirtualRegisters(instruction[i + 1].u.operand, X86::eax, instruction[i + 2].u.operand, X86::edx, i); 782 755 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 783 756 emitJumpSlowCaseIfNotImmNum(X86::edx, i); 784 __ cmpl_rr(X86::edx, X86::eax); 785 m_jmpTable.append(JmpTable(__ jge(), i + 3 + target)); 757 m_jmpTable.append(JmpTable(jge32(X86::eax, X86::edx), i + 3 + target)); 786 758 } 787 759 i += OPCODE_LENGTH(op_jnless); … … 790 762 case op_not: { 791 763 emitGetVirtualRegister(instruction[i + 2].u.operand, X86::eax, i); 792 __ xorl_i8r(JSImmediate::FullTagTypeBool, X86::eax); 793 __ testl_i32r(JSImmediate::FullTagTypeMask, X86::eax); // i8? 794 m_slowCases.append(SlowCaseEntry(__ jne(), i)); 795 __ xorl_i8r((JSImmediate::FullTagTypeBool | JSImmediate::ExtendedPayloadBitBoolValue), X86::eax); 764 xor32(Imm32(JSImmediate::FullTagTypeBool), X86::eax); 765 m_slowCases.append(SlowCaseEntry(jnz32(X86::eax, Imm32(JSImmediate::FullTagTypeMask)), i)); 766 xor32(Imm32(JSImmediate::FullTagTypeBool | JSImmediate::ExtendedPayloadBitBoolValue), X86::eax); 796 767 emitPutVirtualRegister(instruction[i + 1].u.operand); 797 768 i += OPCODE_LENGTH(op_not); … … 802 773 emitGetVirtualRegister(instruction[i + 1].u.operand, X86::eax, i); 803 774 804 __ cmpl_i32r(asInteger(JSImmediate::zeroImmediate()), X86::eax); 805 m_jmpTable.append(JmpTable(__ je(), i + 2 + target)); 806 __ testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax); 807 JmpSrc isNonZero = __ jne(); 808 809 __ cmpl_i32r(asInteger(JSImmediate::falseImmediate()), X86::eax); 810 m_jmpTable.append(JmpTable(__ je(), i + 2 + target)); 811 __ cmpl_i32r(asInteger(JSImmediate::trueImmediate()), X86::eax); 812 m_slowCases.append(SlowCaseEntry(__ jne(), i)); 813 814 __ link(isNonZero, __ label()); 775 m_jmpTable.append(JmpTable(je32(X86::eax, Imm32(asInteger(JSImmediate::zeroImmediate()))), i + 2 + target)); 776 Jump isNonZero = jnz32(X86::eax, Imm32(JSImmediate::TagBitTypeInteger)); 777 778 m_jmpTable.append(JmpTable(je32(X86::eax, Imm32(asInteger(JSImmediate::falseImmediate()))), i + 2 + target)); 779 m_slowCases.append(SlowCaseEntry(jne32(X86::eax, Imm32(asInteger(JSImmediate::trueImmediate()))), i)); 780 781 isNonZero.link(this); 815 782 i += OPCODE_LENGTH(op_jfalse); 816 783 break; … … 855 822 856 823 wasNotImmediate.link(this); 857 858 824 i += OPCODE_LENGTH(op_jneq_null); 859 825 break; … … 862 828 int srcDst = instruction[i + 2].u.operand; 863 829 emitGetVirtualRegister(srcDst, X86::eax, i); 864 __ movl_rr(X86::eax, X86::edx);830 move(X86::eax, X86::edx); 865 831 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 866 __ addl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::edx); 867 m_slowCases.append(SlowCaseEntry(__ jo(), i)); 832 m_slowCases.append(SlowCaseEntry(joAdd32(Imm32(getDeTaggedConstantImmediate(JSImmediate::oneImmediate())), X86::edx), i)); 868 833 emitPutVirtualRegister(srcDst, X86::edx); 869 834 emitPutVirtualRegister(instruction[i + 1].u.operand); … … 873 838 case op_unexpected_load: { 874 839 JSValue* v = m_codeBlock->unexpectedConstant(instruction[i + 2].u.operand); 875 __ movl_i32r(asInteger(v), X86::eax);840 move(ImmPtr(v), X86::eax); 876 841 emitPutVirtualRegister(instruction[i + 1].u.operand); 877 842 i += OPCODE_LENGTH(op_unexpected_load); … … 897 862 emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::edx, i); 898 863 emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, X86::ecx, i); 899 __ cmpl_rr(X86::edx, X86::eax); 900 __ sete_r(X86::eax); 901 __ movzbl_rr(X86::eax, X86::eax); 864 sete32(X86::edx, X86::eax); 902 865 emitTagAsBoolImmediate(X86::eax); 903 866 emitPutVirtualRegister(instruction[i + 1].u.operand); … … 924 887 emitGetVirtualRegister(src2, X86::eax, i); 925 888 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 926 __ andl_i32r(asInteger(value), X86::eax); // FIXME: make it more obvious this is relying on the format of JSImmediate889 and32(Imm32(asInteger(value)), X86::eax); // FIXME: make it more obvious this is relying on the format of JSImmediate 927 890 emitPutVirtualRegister(dst); 928 891 } else if (JSValue* value = getConstantImmediateNumericArg(src2)) { 929 892 emitGetVirtualRegister(src1, X86::eax, i); 930 893 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 931 __ andl_i32r(asInteger(value), X86::eax);894 and32(Imm32(asInteger(value)), X86::eax); 932 895 emitPutVirtualRegister(dst); 933 896 } else { 934 897 emitGetVirtualRegisters(src1, X86::eax, src2, X86::edx, i); 935 __ andl_rr(X86::edx, X86::eax);898 and32(X86::edx, X86::eax); 936 899 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 937 900 emitPutVirtualRegister(dst); … … 947 910 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 948 911 // Mask with 0x1f as per ecma-262 11.7.2 step 7. 949 __ sarl_i8r(JSImmediate::getTruncatedUInt32(value) & 0x1f, X86::eax);912 rshift32(Imm32(JSImmediate::getTruncatedUInt32(value) & 0x1f), X86::eax); 950 913 } else { 951 914 emitGetVirtualRegisters(src1, X86::eax, src2, X86::ecx, i); … … 963 926 emitGetVirtualRegister(instruction[i + 2].u.operand, X86::eax, i); 964 927 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 965 __ xorl_i8r(~JSImmediate::TagBitTypeInteger, X86::eax);928 xor32(Imm32(~JSImmediate::TagBitTypeInteger), X86::eax); 966 929 emitPutVirtualRegister(instruction[i + 1].u.operand); 967 930 i += OPCODE_LENGTH(op_bitnot); … … 994 957 __ idivl_r(X86::ecx); 995 958 emitFastArithReTagImmediate(X86::edx); 996 __ movl_rr(X86::edx, X86::eax);959 move(X86::edx, X86::eax); 997 960 emitPutVirtualRegister(instruction[i + 1].u.operand); 998 961 i += OPCODE_LENGTH(op_mod); … … 1003 966 emitGetVirtualRegister(instruction[i + 1].u.operand, X86::eax, i); 1004 967 1005 __ cmpl_i32r(asInteger(JSImmediate::zeroImmediate()), X86::eax); 1006 JmpSrc isZero = __ je(); 1007 __ testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax); 1008 m_jmpTable.append(JmpTable(__ jne(), i + 2 + target)); 1009 1010 __ cmpl_i32r(asInteger(JSImmediate::trueImmediate()), X86::eax); 1011 m_jmpTable.append(JmpTable(__ je(), i + 2 + target)); 1012 __ cmpl_i32r(asInteger(JSImmediate::falseImmediate()), X86::eax); 1013 m_slowCases.append(SlowCaseEntry(__ jne(), i)); 1014 1015 __ link(isZero, __ label()); 968 Jump isZero = je32(X86::eax, Imm32(asInteger(JSImmediate::zeroImmediate()))); 969 m_jmpTable.append(JmpTable(jnz32(X86::eax, Imm32(JSImmediate::TagBitTypeInteger)), i + 2 + target)); 970 971 m_jmpTable.append(JmpTable(je32(X86::eax, Imm32(asInteger(JSImmediate::trueImmediate()))), i + 2 + target)); 972 m_slowCases.append(SlowCaseEntry(jne32(X86::eax, Imm32(asInteger(JSImmediate::falseImmediate()))), i)); 973 974 isZero.link(this); 1016 975 i += OPCODE_LENGTH(op_jtrue); 1017 976 break; … … 1021 980 emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::edx, i); 1022 981 emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, X86::ecx, i); 1023 __ cmpl_rr(X86::eax, X86::edx); 1024 1025 __ setne_r(X86::eax); 1026 __ movzbl_rr(X86::eax, X86::eax); 982 setne32(X86::edx, X86::eax); 1027 983 emitTagAsBoolImmediate(X86::eax); 1028 984 … … 1035 991 int srcDst = instruction[i + 2].u.operand; 1036 992 emitGetVirtualRegister(srcDst, X86::eax, i); 1037 __ movl_rr(X86::eax, X86::edx);993 move(X86::eax, X86::edx); 1038 994 emitJumpSlowCaseIfNotImmNum(X86::eax, i); 1039 __ subl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::edx); 1040 m_slowCases.append(SlowCaseEntry(__ jo(), i)); 995 m_slowCases.append(SlowCaseEntry(joSub32(Imm32(getDeTaggedConstantImmediate(JSImmediate::oneImmediate())), X86::edx), i)); 1041 996 emitPutVirtualRegister(srcDst, X86::edx); 1042 997 emitPutVirtualRegister(instruction[i + 1].u.operand); … … 1048 1003 emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::edx, i); 1049 1004 emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, X86::ecx, i); 1050 __ xorl_rr(X86::edx, X86::eax);1005 xor32(X86::edx, X86::eax); 1051 1006 emitFastArithReTagImmediate(X86::eax); 1052 1007 emitPutVirtualRegister(instruction[i + 1].u.operand); … … 1065 1020 emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::edx, i); 1066 1021 emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, X86::ecx, i); 1067 __ orl_rr(X86::edx, X86::eax);1022 or32(X86::edx, X86::eax); 1068 1023 emitPutVirtualRegister(instruction[i + 1].u.operand); 1069 1024 i += OPCODE_LENGTH(op_bitor); … … 1092 1047 unsigned target = instruction[i + 3].u.operand; 1093 1048 emitCTICall(i, Interpreter::cti_op_next_pname); 1094 __ testl_rr(X86::eax, X86::eax); 1095 JmpSrc endOfIter = __ je(); 1096 emitPutVirtualRegister(instruction[i + 1].u.operand); 1097 m_jmpTable.append(JmpTable(__ jmp(), i + 3 + target)); 1098 __ link(endOfIter, __ label()); 1049 Jump endOfIter = jzPtr(X86::eax); 1050 emitPutVirtualRegister(instruction[i + 1].u.operand); 1051 m_jmpTable.append(JmpTable(jump(), i + 3 + target)); 1052 endOfIter.link(this); 1099 1053 i += OPCODE_LENGTH(op_next_pname); 1100 1054 break; … … 1132 1086 emitGetVirtualRegister(srcVReg, X86::eax, i); 1133 1087 1134 __ testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax); 1135 JmpSrc wasImmediate = __ jnz(); 1088 Jump wasImmediate = jnz32(X86::eax, Imm32(JSImmediate::TagBitTypeInteger)); 1136 1089 1137 1090 emitJumpSlowCaseIfNotJSCell(X86::eax, i, srcVReg); 1138 1139 __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::eax, X86::ecx); 1140 __ cmpl_i32m(NumberType, FIELD_OFFSET(Structure, m_typeInfo.m_type), X86::ecx); 1091 loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::ecx); 1092 m_slowCases.append(SlowCaseEntry(jne32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_type)), Imm32(NumberType)), i)); 1141 1093 1142 m_slowCases.append(SlowCaseEntry(__ jne(), i)); 1143 1144 __ link(wasImmediate, __ label()); 1094 wasImmediate.link(this); 1145 1095 1146 1096 emitPutVirtualRegister(instruction[i + 1].u.operand); … … 1176 1126 emitCTICall(i, Interpreter::cti_op_jmp_scopes); 1177 1127 unsigned target = instruction[i + 2].u.operand; 1178 m_jmpTable.append(JmpTable( __ jmp(), i + 2 + target));1128 m_jmpTable.append(JmpTable(jump(), i + 2 + target)); 1179 1129 i += OPCODE_LENGTH(op_jmp_scopes); 1180 1130 break; … … 1201 1151 emitPutCTIArgConstant(tableIndex, 4); 1202 1152 emitCTICall(i, Interpreter::cti_op_switch_imm); 1203 __ jmp_r(X86::eax);1153 jump(X86::eax); 1204 1154 i += OPCODE_LENGTH(op_switch_imm); 1205 1155 break; … … 1218 1168 emitPutCTIArgConstant(tableIndex, 4); 1219 1169 emitCTICall(i, Interpreter::cti_op_switch_char); 1220 __ jmp_r(X86::eax);1170 jump(X86::eax); 1221 1171 i += OPCODE_LENGTH(op_switch_char); 1222 1172 break; … … 1234 1184 emitPutCTIArgConstant(tableIndex, 4); 1235 1185 emitCTICall(i, Interpreter::cti_op_switch_string); 1236 __ jmp_r(X86::eax);1186 jump(X86::eax); 1237 1187 i += OPCODE_LENGTH(op_switch_string); 1238 1188 break; … … 1366 1316 1367 1317 emitJumpSlowCaseIfNotJSCell(X86::eax, i); 1368 __ movl_mr(FIELD_OFFSET(JSCell, m_structure), X86::eax, X86::edx); 1369 __ testl_i32m(NeedsThisConversion, FIELD_OFFSET(Structure, m_typeInfo.m_flags), X86::edx); 1370 m_slowCases.append(SlowCaseEntry(__ jnz(), i)); 1318 loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::edx); 1319 m_slowCases.append(SlowCaseEntry(jnz32(Address(X86::edx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(NeedsThisConversion)), i)); 1371 1320 1372 1321 i += OPCODE_LENGTH(op_convert_this); … … 1492 1441 break; 1493 1442 } 1443 case op_construct_verify: { 1444 __ link(iter->from, __ label()); 1445 __ link((++iter)->from, __ label()); 1446 emitGetVirtualRegister(instruction[i + 2].u.operand, X86::eax, i); 1447 emitPutVirtualRegister(instruction[i + 1].u.operand); 1448 1449 i += OPCODE_LENGTH(op_construct_verify); 1450 break; 1451 } 1494 1452 case op_get_by_val: { 1495 1453 // The slow case that handles accesses to arrays (below) may jump back up to here.
Note:
See TracChangeset
for help on using the changeset viewer.