Changeset 43409 in webkit for trunk/JavaScriptCore/jit/JIT.cpp
- Timestamp:
- May 8, 2009, 1:51:53 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JIT.cpp
r43401 r43409 94 94 { 95 95 Jump skipTimeout = branchSub32(NonZero, Imm32(1), timeoutCheckRegister); 96 emitCTICall(JITStubs::cti_timeout_check); 97 move(regT0, timeoutCheckRegister); 96 JITStubCall(this, JITStubs::cti_timeout_check).call(timeoutCheckRegister); 98 97 skipTimeout.link(this); 99 98 … … 108 107 #define DEFINE_BINARY_OP(name) \ 109 108 case name: { \ 110 emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 1, regT2); \111 emitPutJITStubArgFromVirtualRegister(currentInstruction[3].u.operand, 2, regT2); \112 emitCTICall(JITStubs::cti_##name); \113 emitPutVirtualRegister(currentInstruction[1].u.operand); \109 JITStubCall stubCall(this, JITStubs::cti_##name); \ 110 stubCall.addArgument(currentInstruction[2].u.operand, regT2); \ 111 stubCall.addArgument(currentInstruction[3].u.operand, regT2); \ 112 stubCall.call(currentInstruction[1].u.operand); \ 114 113 NEXT_OPCODE(name); \ 115 114 } … … 117 116 #define DEFINE_UNARY_OP(name) \ 118 117 case name: { \ 119 emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 1, regT2); \120 emitCTICall(JITStubs::cti_##name); \121 emitPutVirtualRegister(currentInstruction[1].u.operand); \118 JITStubCall stubCall(this, JITStubs::cti_##name); \ 119 stubCall.addArgument(currentInstruction[2].u.operand, regT2); \ 120 stubCall.call(currentInstruction[1].u.operand); \ 122 121 NEXT_OPCODE(name); \ 123 122 } … … 191 190 case op_end: { 192 191 if (m_codeBlock->needsFullScopeChain()) 193 emitCTICall(JITStubs::cti_op_end);192 JITStubCall(this, JITStubs::cti_op_end).call(); 194 193 ASSERT(returnValueRegister != callFrameRegister); 195 194 emitGetVirtualRegister(currentInstruction[1].u.operand, returnValueRegister); … … 271 270 } 272 271 case op_new_object: { 273 emitCTICall(JITStubs::cti_op_new_object); 274 emitPutVirtualRegister(currentInstruction[1].u.operand); 272 JITStubCall(this, JITStubs::cti_op_new_object).call(currentInstruction[1].u.operand); 275 273 NEXT_OPCODE(op_new_object); 276 274 } … … 335 333 } 336 334 case op_del_by_id: { 337 emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 1, regT2); 338 Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand)); 339 emitPutJITStubArgConstant(ident, 2); 340 emitCTICall(JITStubs::cti_op_del_by_id); 341 emitPutVirtualRegister(currentInstruction[1].u.operand); 335 JITStubCall stubCall(this, JITStubs::cti_op_del_by_id); 336 stubCall.addArgument(currentInstruction[2].u.operand, regT2); 337 stubCall.addArgument(ImmPtr(&m_codeBlock->identifier(currentInstruction[3].u.operand))); 338 stubCall.call(currentInstruction[1].u.operand); 342 339 NEXT_OPCODE(op_del_by_id); 343 340 } … … 347 344 } 348 345 case op_new_func: { 349 FuncDeclNode* func = m_codeBlock->function(currentInstruction[2].u.operand); 350 emitPutJITStubArgConstant(func, 1); 351 emitCTICall(JITStubs::cti_op_new_func); 352 emitPutVirtualRegister(currentInstruction[1].u.operand); 346 JITStubCall stubCall(this, JITStubs::cti_op_new_func); 347 stubCall.addArgument(ImmPtr(m_codeBlock->function(currentInstruction[2].u.operand))); 348 stubCall.call(currentInstruction[1].u.operand); 353 349 NEXT_OPCODE(op_new_func); 354 350 } … … 362 358 } 363 359 case op_load_varargs: { 364 emitPutJITStubArgConstant(currentInstruction[2].u.operand, 1);365 emitCTICall(JITStubs::cti_op_load_varargs);366 emitPutVirtualRegister(currentInstruction[1].u.operand);360 JITStubCall stubCall(this, JITStubs::cti_op_load_varargs); 361 stubCall.addArgument(Imm32(currentInstruction[2].u.operand)); 362 stubCall.call(currentInstruction[1].u.operand); 367 363 NEXT_OPCODE(op_load_varargs); 368 364 } … … 414 410 } 415 411 case op_tear_off_activation: { 416 emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, regT2); 417 emitCTICall(JITStubs::cti_op_tear_off_activation); 412 JITStubCall stubCall(this, JITStubs::cti_op_tear_off_activation); 413 stubCall.addArgument(currentInstruction[1].u.operand, regT2); 414 stubCall.call(); 418 415 NEXT_OPCODE(op_tear_off_activation); 419 416 } 420 417 case op_tear_off_arguments: { 421 emitCTICall(JITStubs::cti_op_tear_off_arguments);418 JITStubCall(this, JITStubs::cti_op_tear_off_arguments).call(); 422 419 NEXT_OPCODE(op_tear_off_arguments); 423 420 } … … 425 422 // We could JIT generate the deref, only calling out to C when the refcount hits zero. 426 423 if (m_codeBlock->needsFullScopeChain()) 427 emitCTICall(JITStubs::cti_op_ret_scopeChain);424 JITStubCall(this, JITStubs::cti_op_ret_scopeChain).call(); 428 425 429 426 ASSERT(callFrameRegister != regT1); … … 447 444 } 448 445 case op_new_array: { 449 emitPutJITStubArgConstant(currentInstruction[2].u.operand, 1);450 emitPutJITStubArgConstant(currentInstruction[3].u.operand, 2);451 emitCTICall(JITStubs::cti_op_new_array);452 emitPutVirtualRegister(currentInstruction[1].u.operand);446 JITStubCall stubCall(this, JITStubs::cti_op_new_array); 447 stubCall.addArgument(Imm32(currentInstruction[2].u.operand)); 448 stubCall.addArgument(Imm32(currentInstruction[3].u.operand)); 449 stubCall.call(currentInstruction[1].u.operand); 453 450 NEXT_OPCODE(op_new_array); 454 451 } 455 452 case op_resolve: { 456 Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand)); 457 emitPutJITStubArgConstant(ident, 1); 458 emitCTICall(JITStubs::cti_op_resolve); 459 emitPutVirtualRegister(currentInstruction[1].u.operand); 453 JITStubCall stubCall(this, JITStubs::cti_op_resolve); 454 stubCall.addArgument(ImmPtr(&m_codeBlock->identifier(currentInstruction[2].u.operand))); 455 stubCall.call(currentInstruction[1].u.operand); 460 456 NEXT_OPCODE(op_resolve); 461 457 } … … 485 481 } 486 482 case op_strcat: { 487 emitPutJITStubArgConstant(currentInstruction[2].u.operand, 1); 488 emitPutJITStubArgConstant(currentInstruction[3].u.operand, 2); 489 emitCTICall(JITStubs::cti_op_strcat); 490 emitPutVirtualRegister(currentInstruction[1].u.operand); 491 483 JITStubCall stubCall(this, JITStubs::cti_op_strcat); 484 stubCall.addArgument(Imm32(currentInstruction[2].u.operand)); 485 stubCall.addArgument(Imm32(currentInstruction[3].u.operand)); 486 stubCall.call(currentInstruction[1].u.operand); 492 487 NEXT_OPCODE(op_strcat); 493 488 } … … 519 514 } 520 515 case op_resolve_func: { 521 Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand)); 522 emitPutJITStubArgConstant(ident, 1); 523 emitCTICall(JITStubs::cti_op_resolve_func); 524 emitPutVirtualRegister(currentInstruction[2].u.operand, regT1); 525 emitPutVirtualRegister(currentInstruction[1].u.operand); 516 JITStubCall stubCall(this, JITStubs::cti_op_resolve_func); 517 stubCall.addArgument(ImmPtr(&m_codeBlock->identifier(currentInstruction[3].u.operand))); 518 stubCall.call(currentInstruction[1].u.operand, currentInstruction[2].u.operand); 526 519 NEXT_OPCODE(op_resolve_func); 527 520 } … … 574 567 }; 575 568 case op_resolve_base: { 576 Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand)); 577 emitPutJITStubArgConstant(ident, 1); 578 emitCTICall(JITStubs::cti_op_resolve_base); 579 emitPutVirtualRegister(currentInstruction[1].u.operand); 569 JITStubCall stubCall(this, JITStubs::cti_op_resolve_base); 570 stubCall.addArgument(ImmPtr(&m_codeBlock->identifier(currentInstruction[2].u.operand))); 571 stubCall.call(currentInstruction[1].u.operand); 580 572 NEXT_OPCODE(op_resolve_base); 581 573 } 582 574 case op_resolve_skip: { 583 Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand)); 584 emitPutJITStubArgConstant(ident, 1); 585 emitPutJITStubArgConstant(currentInstruction[3].u.operand + m_codeBlock->needsFullScopeChain(), 2); 586 emitCTICall(JITStubs::cti_op_resolve_skip); 587 emitPutVirtualRegister(currentInstruction[1].u.operand); 575 JITStubCall stubCall(this, JITStubs::cti_op_resolve_skip); 576 stubCall.addArgument(ImmPtr(&m_codeBlock->identifier(currentInstruction[2].u.operand))); 577 stubCall.addArgument(Imm32(currentInstruction[3].u.operand + m_codeBlock->needsFullScopeChain())); 578 stubCall.call(currentInstruction[1].u.operand); 588 579 NEXT_OPCODE(op_resolve_skip); 589 580 } … … 591 582 // Fast case 592 583 void* globalObject = currentInstruction[2].u.jsCell; 593 Identifier* ident = & (m_codeBlock->identifier(currentInstruction[3].u.operand));584 Identifier* ident = &m_codeBlock->identifier(currentInstruction[3].u.operand); 594 585 595 586 unsigned currentIndex = globalResolveInfoIndex++; … … 611 602 // Slow case 612 603 noMatch.link(this); 613 emitPutJITStubArgConstant(globalObject, 1);614 emitPutJITStubArgConstant(ident, 2);615 emitPutJITStubArgConstant(currentIndex, 3);616 emitCTICall(JITStubs::cti_op_resolve_global);617 emitPutVirtualRegister(currentInstruction[1].u.operand);604 JITStubCall stubCall(this, JITStubs::cti_op_resolve_global); 605 stubCall.addArgument(ImmPtr(globalObject)); 606 stubCall.addArgument(ImmPtr(ident)); 607 stubCall.addArgument(Imm32(currentIndex)); 608 stubCall.call(currentInstruction[1].u.operand); 618 609 end.link(this); 619 610 NEXT_OPCODE(op_resolve_global); … … 768 759 } 769 760 case op_resolve_with_base: { 770 Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand)); 771 emitPutJITStubArgConstant(ident, 1); 772 emitCTICall(JITStubs::cti_op_resolve_with_base); 773 emitPutVirtualRegister(currentInstruction[2].u.operand, regT1); 774 emitPutVirtualRegister(currentInstruction[1].u.operand); 761 JITStubCall stubCall(this, JITStubs::cti_op_resolve_with_base); 762 stubCall.addArgument(ImmPtr(&m_codeBlock->identifier(currentInstruction[3].u.operand))); 763 stubCall.call(currentInstruction[1].u.operand, currentInstruction[2].u.operand); 775 764 NEXT_OPCODE(op_resolve_with_base); 776 765 } 777 766 case op_new_func_exp: { 778 FuncExprNode* func = m_codeBlock->functionExpression(currentInstruction[2].u.operand); 779 emitPutJITStubArgConstant(func, 1); 780 emitCTICall(JITStubs::cti_op_new_func_exp); 781 emitPutVirtualRegister(currentInstruction[1].u.operand); 767 JITStubCall stubCall(this, JITStubs::cti_op_new_func_exp); 768 stubCall.addArgument(ImmPtr(m_codeBlock->functionExpression(currentInstruction[2].u.operand))); 769 stubCall.call(currentInstruction[1].u.operand); 782 770 NEXT_OPCODE(op_new_func_exp); 783 771 } … … 823 811 } 824 812 case op_new_regexp: { 825 RegExp* regExp = m_codeBlock->regexp(currentInstruction[2].u.operand); 826 emitPutJITStubArgConstant(regExp, 1); 827 emitCTICall(JITStubs::cti_op_new_regexp); 828 emitPutVirtualRegister(currentInstruction[1].u.operand); 813 JITStubCall stubCall(this, JITStubs::cti_op_new_regexp); 814 stubCall.addArgument(ImmPtr(m_codeBlock->regexp(currentInstruction[2].u.operand))); 815 stubCall.call(currentInstruction[1].u.operand); 829 816 NEXT_OPCODE(op_new_regexp); 830 817 } … … 837 824 } 838 825 case op_throw: { 839 emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, regT2); 840 emitCTICall(JITStubs::cti_op_throw); 826 JITStubCall stubCall(this, JITStubs::cti_op_throw); 827 stubCall.addArgument(currentInstruction[1].u.operand, regT2); 828 stubCall.call(); 841 829 ASSERT(regT0 == returnValueRegister); 842 830 #if PLATFORM(X86_64) … … 860 848 } 861 849 case op_next_pname: { 862 emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 1, regT2);863 unsigned target = currentInstruction[3].u.operand;864 emitCTICall(JITStubs::cti_op_next_pname);850 JITStubCall stubCall(this, JITStubs::cti_op_next_pname); 851 stubCall.addArgument(currentInstruction[2].u.operand, regT2); 852 stubCall.call(); 865 853 Jump endOfIter = branchTestPtr(Zero, regT0); 866 854 emitPutVirtualRegister(currentInstruction[1].u.operand); 867 addJump(jump(), target+ 3);855 addJump(jump(), currentInstruction[3].u.operand + 3); 868 856 endOfIter.link(this); 869 857 NEXT_OPCODE(op_next_pname); 870 858 } 871 859 case op_push_scope: { 872 emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, regT2);873 emitCTICall(JITStubs::cti_op_push_scope);874 emitPutVirtualRegister(currentInstruction[1].u.operand);860 JITStubCall stubCall(this, JITStubs::cti_op_push_scope); 861 stubCall.addArgument(currentInstruction[1].u.operand, regT2); 862 stubCall.call(currentInstruction[1].u.operand); 875 863 NEXT_OPCODE(op_push_scope); 876 864 } 877 865 case op_pop_scope: { 878 emitCTICall(JITStubs::cti_op_pop_scope);866 JITStubCall(this, JITStubs::cti_op_pop_scope).call(); 879 867 NEXT_OPCODE(op_pop_scope); 880 868 } … … 903 891 } 904 892 case op_push_new_scope: { 905 Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand)); 906 emitPutJITStubArgConstant(ident, 1); 907 emitPutJITStubArgFromVirtualRegister(currentInstruction[3].u.operand, 2, regT2); 908 emitCTICall(JITStubs::cti_op_push_new_scope); 909 emitPutVirtualRegister(currentInstruction[1].u.operand); 893 JITStubCall stubCall(this, JITStubs::cti_op_push_new_scope); 894 stubCall.addArgument(ImmPtr(&m_codeBlock->identifier(currentInstruction[2].u.operand))); 895 stubCall.addArgument(currentInstruction[3].u.operand, regT2); 896 stubCall.call(currentInstruction[1].u.operand); 910 897 NEXT_OPCODE(op_push_new_scope); 911 898 } … … 916 903 } 917 904 case op_jmp_scopes: { 918 unsigned count = currentInstruction[1].u.operand; 919 emitPutJITStubArgConstant(count, 1); 920 emitCTICall(JITStubs::cti_op_jmp_scopes); 921 unsigned target = currentInstruction[2].u.operand; 922 addJump(jump(), target + 2); 923 RECORD_JUMP_TARGET(target + 2); 905 JITStubCall stubCall(this, JITStubs::cti_op_jmp_scopes); 906 stubCall.addArgument(Imm32(currentInstruction[1].u.operand)); 907 stubCall.call(); 908 addJump(jump(), currentInstruction[2].u.operand + 2); 909 RECORD_JUMP_TARGET(currentInstruction[2].u.operand + 2); 924 910 NEXT_OPCODE(op_jmp_scopes); 925 911 } 926 912 case op_put_by_index: { 927 emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, regT2); 928 emitPutJITStubArgConstant(currentInstruction[2].u.operand, 2); 929 emitPutJITStubArgFromVirtualRegister(currentInstruction[3].u.operand, 3, regT2); 930 emitCTICall(JITStubs::cti_op_put_by_index); 913 JITStubCall stubCall(this, JITStubs::cti_op_put_by_index); 914 stubCall.addArgument(currentInstruction[1].u.operand, regT2); 915 stubCall.addArgument(Imm32(currentInstruction[2].u.operand)); 916 stubCall.addArgument(currentInstruction[3].u.operand, regT2); 917 stubCall.call(); 931 918 NEXT_OPCODE(op_put_by_index); 932 919 } … … 941 928 jumpTable->ctiOffsets.grow(jumpTable->branchOffsets.size()); 942 929 943 emitPutJITStubArgFromVirtualRegister(scrutinee, 1, regT2); 944 emitPutJITStubArgConstant(tableIndex, 2); 945 emitCTICall(JITStubs::cti_op_switch_imm); 930 JITStubCall stubCall(this, JITStubs::cti_op_switch_imm); 931 stubCall.addArgument(scrutinee, regT2); 932 stubCall.addArgument(Imm32(tableIndex)); 933 stubCall.call(); 946 934 jump(regT0); 947 935 NEXT_OPCODE(op_switch_imm); … … 957 945 jumpTable->ctiOffsets.grow(jumpTable->branchOffsets.size()); 958 946 959 emitPutJITStubArgFromVirtualRegister(scrutinee, 1, regT2); 960 emitPutJITStubArgConstant(tableIndex, 2); 961 emitCTICall(JITStubs::cti_op_switch_char); 947 JITStubCall stubCall(this, JITStubs::cti_op_switch_char); 948 stubCall.addArgument(scrutinee, regT2); 949 stubCall.addArgument(Imm32(tableIndex)); 950 stubCall.call(); 962 951 jump(regT0); 963 952 NEXT_OPCODE(op_switch_char); … … 972 961 m_switches.append(SwitchRecord(jumpTable, m_bytecodeIndex, defaultOffset)); 973 962 974 emitPutJITStubArgFromVirtualRegister(scrutinee, 1, regT2); 975 emitPutJITStubArgConstant(tableIndex, 2); 976 emitCTICall(JITStubs::cti_op_switch_string); 963 JITStubCall stubCall(this, JITStubs::cti_op_switch_string); 964 stubCall.addArgument(scrutinee, regT2); 965 stubCall.addArgument(Imm32(tableIndex)); 966 stubCall.call(); 977 967 jump(regT0); 978 968 NEXT_OPCODE(op_switch_string); 979 969 } 980 970 case op_put_getter: { 981 emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, regT2);982 Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand));983 emitPutJITStubArgConstant(ident, 2);984 emitPutJITStubArgFromVirtualRegister(currentInstruction[3].u.operand, 3, regT2);985 emitCTICall(JITStubs::cti_op_put_getter);971 JITStubCall stubCall(this, JITStubs::cti_op_put_getter); 972 stubCall.addArgument(currentInstruction[1].u.operand, regT2); 973 stubCall.addArgument(ImmPtr(&m_codeBlock->identifier(currentInstruction[2].u.operand))); 974 stubCall.addArgument(currentInstruction[3].u.operand, regT2); 975 stubCall.call(); 986 976 NEXT_OPCODE(op_put_getter); 987 977 } 988 978 case op_put_setter: { 989 emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, regT2);990 Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand));991 emitPutJITStubArgConstant(ident, 2);992 emitPutJITStubArgFromVirtualRegister(currentInstruction[3].u.operand, 3, regT2);993 emitCTICall(JITStubs::cti_op_put_setter);979 JITStubCall stubCall(this, JITStubs::cti_op_put_setter); 980 stubCall.addArgument(currentInstruction[1].u.operand, regT2); 981 stubCall.addArgument(ImmPtr(&m_codeBlock->identifier(currentInstruction[2].u.operand))); 982 stubCall.addArgument(currentInstruction[3].u.operand, regT2); 983 stubCall.call(); 994 984 NEXT_OPCODE(op_put_setter); 995 985 } 996 986 case op_new_error: { 997 JSValue message = m_codeBlock->unexpectedConstant(currentInstruction[3].u.operand); 998 emitPutJITStubArgConstant(currentInstruction[2].u.operand, 1); 999 emitPutJITStubArgConstant(JSValue::encode(message), 2); 1000 emitPutJITStubArgConstant(m_bytecodeIndex, 3); 1001 emitCTICall(JITStubs::cti_op_new_error); 1002 emitPutVirtualRegister(currentInstruction[1].u.operand); 987 JITStubCall stubCall(this, JITStubs::cti_op_new_error); 988 stubCall.addArgument(Imm32(currentInstruction[2].u.operand)); 989 stubCall.addArgument(ImmPtr(JSValue::encode(m_codeBlock->unexpectedConstant(currentInstruction[3].u.operand)))); 990 stubCall.addArgument(Imm32(m_bytecodeIndex)); 991 stubCall.call(currentInstruction[1].u.operand); 1003 992 NEXT_OPCODE(op_new_error); 1004 993 } 1005 994 case op_debug: { 1006 emitPutJITStubArgConstant(currentInstruction[1].u.operand, 1); 1007 emitPutJITStubArgConstant(currentInstruction[2].u.operand, 2); 1008 emitPutJITStubArgConstant(currentInstruction[3].u.operand, 3); 1009 emitCTICall(JITStubs::cti_op_debug); 995 JITStubCall stubCall(this, JITStubs::cti_op_debug); 996 stubCall.addArgument(Imm32(currentInstruction[1].u.operand)); 997 stubCall.addArgument(Imm32(currentInstruction[2].u.operand)); 998 stubCall.addArgument(Imm32(currentInstruction[3].u.operand)); 999 stubCall.call(); 1010 1000 NEXT_OPCODE(op_debug); 1011 1001 } … … 1076 1066 emitInitRegister(j); 1077 1067 1078 emitCTICall(JITStubs::cti_op_push_activation); 1079 emitPutVirtualRegister(currentInstruction[1].u.operand); 1080 1068 JITStubCall(this, JITStubs::cti_op_push_activation).call(currentInstruction[1].u.operand); 1081 1069 NEXT_OPCODE(op_enter_with_activation); 1082 1070 } 1083 1071 case op_create_arguments: { 1084 1072 if (m_codeBlock->m_numParameters == 1) 1085 emitCTICall(JITStubs::cti_op_create_arguments_no_params);1073 JITStubCall(this, JITStubs::cti_op_create_arguments_no_params).call(); 1086 1074 else 1087 emitCTICall(JITStubs::cti_op_create_arguments);1075 JITStubCall(this, JITStubs::cti_op_create_arguments).call(); 1088 1076 NEXT_OPCODE(op_create_arguments); 1089 1077 } … … 1100 1088 emitGetCTIParam(FIELD_OFFSET(JITStackFrame, enabledProfilerReference) / sizeof (void*), regT0); 1101 1089 Jump noProfiler = branchTestPtr(Zero, Address(regT0)); 1102 emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, regT0); 1103 emitCTICall(JITStubs::cti_op_profile_will_call); 1090 1091 JITStubCall stubCall(this, JITStubs::cti_op_profile_will_call); 1092 stubCall.addArgument(currentInstruction[1].u.operand, regT0); 1093 stubCall.call(); 1104 1094 noProfiler.link(this); 1105 1095 … … 1109 1099 emitGetCTIParam(FIELD_OFFSET(JITStackFrame, enabledProfilerReference) / sizeof (void*), regT0); 1110 1100 Jump noProfiler = branchTestPtr(Zero, Address(regT0)); 1111 emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, regT0); 1112 emitCTICall(JITStubs::cti_op_profile_did_call); 1101 1102 JITStubCall stubCall(this, JITStubs::cti_op_profile_did_call); 1103 stubCall.addArgument(currentInstruction[1].u.operand, regT0); 1104 stubCall.call(); 1113 1105 noProfiler.link(this); 1114 1106 … … 1134 1126 1135 1127 #ifndef NDEBUG 1136 // reset this, in order to guard it's use with asserts1128 // Reset this, in order to guard its use with ASSERTs. 1137 1129 m_bytecodeIndex = (unsigned)-1; 1138 1130 #endif … … 1168 1160 linkSlowCase(iter); 1169 1161 linkSlowCase(iter); 1170 emitPutJITStubArg(regT0, 1);1171 emitCTICall(JITStubs::cti_op_convert_this);1172 emitPutVirtualRegister(currentInstruction[1].u.operand);1162 JITStubCall stubCall(this, JITStubs::cti_op_convert_this); 1163 stubCall.addArgument(regT0); 1164 stubCall.call(currentInstruction[1].u.operand); 1173 1165 NEXT_OPCODE(op_convert_this); 1174 1166 } … … 1188 1180 linkSlowCase(iter); 1189 1181 1190 emitPutJITStubArg(regT0, 1);1191 emitCTICall(JITStubs::cti_op_to_primitive);1192 emitPutVirtualRegister(currentInstruction[1].u.operand);1182 JITStubCall stubCall(this, JITStubs::cti_op_to_primitive); 1183 stubCall.addArgument(regT0); 1184 stubCall.call(currentInstruction[1].u.operand); 1193 1185 1194 1186 NEXT_OPCODE(op_to_primitive); … … 1202 1194 linkSlowCase(iter); 1203 1195 emitFastArithIntToImmNoCheck(regT1, regT1); 1196 1204 1197 notImm.link(this); 1205 emitPutJITStubArg(regT0, 1);1206 emitPutJITStubArg(regT1, 2);1207 emitCTICall(JITStubs::cti_op_get_by_val);1208 emitPutVirtualRegister(currentInstruction[1].u.operand);1198 JITStubCall stubCall(this, JITStubs::cti_op_get_by_val); 1199 stubCall.addArgument(regT0); 1200 stubCall.addArgument(regT1); 1201 stubCall.call(currentInstruction[1].u.operand); 1209 1202 emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_get_by_val)); 1210 1203 … … 1241 1234 if (isOperandConstantImmediateInt(op2)) { 1242 1235 linkSlowCase(iter); 1243 emitPutJITStubArg(regT0, 1); 1244 emitPutJITStubArgFromVirtualRegister(op2, 2, regT2); 1245 emitCTICall(JITStubs::cti_op_loop_if_less); 1236 JITStubCall stubCall(this, JITStubs::cti_op_loop_if_less); 1237 stubCall.addArgument(regT0); 1238 stubCall.addArgument(op2, regT2); 1239 stubCall.call(); 1246 1240 emitJumpSlowToHot(branchTest32(NonZero, regT0), target + 3); 1247 1241 } else if (isOperandConstantImmediateInt(op1)) { 1248 1242 linkSlowCase(iter); 1249 emitPutJITStubArgFromVirtualRegister(op1, 1, regT1); 1250 emitPutJITStubArg(regT0, 2); 1251 emitCTICall(JITStubs::cti_op_loop_if_less); 1243 JITStubCall stubCall(this, JITStubs::cti_op_loop_if_less); 1244 stubCall.addArgument(op1, regT1); 1245 stubCall.addArgument(regT0); 1246 stubCall.call(); 1252 1247 emitJumpSlowToHot(branchTest32(NonZero, regT0), target + 3); 1253 1248 } else { 1254 1249 linkSlowCase(iter); 1255 1250 linkSlowCase(iter); 1256 emitPutJITStubArg(regT0, 1); 1257 emitPutJITStubArg(regT1, 2); 1258 emitCTICall(JITStubs::cti_op_loop_if_less); 1251 JITStubCall stubCall(this, JITStubs::cti_op_loop_if_less); 1252 stubCall.addArgument(regT0); 1253 stubCall.addArgument(regT1); 1254 stubCall.call(); 1259 1255 emitJumpSlowToHot(branchTest32(NonZero, regT0), target + 3); 1260 1256 } … … 1274 1270 if (isOperandConstantImmediateInt(op2)) { 1275 1271 linkSlowCase(iter); 1276 emitPutJITStubArg(regT0, 1); 1277 emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 2, regT2); 1278 emitCTICall(JITStubs::cti_op_loop_if_lesseq); 1272 JITStubCall stubCall(this, JITStubs::cti_op_loop_if_lesseq); 1273 stubCall.addArgument(regT0); 1274 stubCall.addArgument(currentInstruction[2].u.operand, regT2); 1275 stubCall.call(); 1279 1276 emitJumpSlowToHot(branchTest32(NonZero, regT0), target + 3); 1280 1277 } else { 1281 1278 linkSlowCase(iter); 1282 1279 linkSlowCase(iter); 1283 emitPutJITStubArg(regT0, 1); 1284 emitPutJITStubArg(regT1, 2); 1285 emitCTICall(JITStubs::cti_op_loop_if_lesseq); 1280 JITStubCall stubCall(this, JITStubs::cti_op_loop_if_lesseq); 1281 stubCall.addArgument(regT0); 1282 stubCall.addArgument(regT1); 1283 stubCall.call(); 1286 1284 emitJumpSlowToHot(branchTest32(NonZero, regT0), target + 3); 1287 1285 } … … 1298 1296 linkSlowCase(iter); 1299 1297 emitFastArithIntToImmNoCheck(regT1, regT1); 1300 notImm.link(this); 1301 emitGetVirtualRegister(currentInstruction[3].u.operand, regT2); 1302 emitPutJITStubArg(regT0, 1); 1303 emitPutJITStubArg(regT1, 2); 1304 emitPutJITStubArg(regT2, 3); 1305 emitCTICall(JITStubs::cti_op_put_by_val); 1306 emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_put_by_val)); 1298 1299 notImm.link(this); { 1300 JITStubCall stubCall(this, JITStubs::cti_op_put_by_val); 1301 stubCall.addArgument(regT0); 1302 stubCall.addArgument(regT1); 1303 stubCall.addArgument(currentInstruction[3].u.operand, regT2); 1304 stubCall.call(); 1305 emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_put_by_val)); 1306 } 1307 1307 1308 1308 // slow cases for immediate int accesses to arrays 1309 1309 linkSlowCase(iter); 1310 linkSlowCase(iter); 1311 emitGetVirtualRegister(currentInstruction[3].u.operand, regT2);1312 emitPutJITStubArg(regT0, 1);1313 emitPutJITStubArg(regT1, 2);1314 emitPutJITStubArg(regT2, 3);1315 emitCTICall(JITStubs::cti_op_put_by_val_array);1316 1310 linkSlowCase(iter); { 1311 JITStubCall stubCall(this, JITStubs::cti_op_put_by_val_array); 1312 stubCall.addArgument(regT0); 1313 stubCall.addArgument(regT1); 1314 stubCall.addArgument(currentInstruction[3].u.operand, regT2); 1315 stubCall.call(); 1316 } 1317 1317 NEXT_OPCODE(op_put_by_val); 1318 1318 } 1319 1319 case op_loop_if_true: { 1320 1320 linkSlowCase(iter); 1321 emitPutJITStubArg(regT0, 1);1322 emitCTICall(JITStubs::cti_op_jtrue);1323 unsigned target = currentInstruction[2].u.operand;1324 emitJumpSlowToHot(branchTest32(NonZero, regT0), target+ 2);1321 JITStubCall stubCall(this, JITStubs::cti_op_jtrue); 1322 stubCall.addArgument(regT0); 1323 stubCall.call(); 1324 emitJumpSlowToHot(branchTest32(NonZero, regT0), currentInstruction[2].u.operand + 2); 1325 1325 NEXT_OPCODE(op_loop_if_true); 1326 1326 } … … 1340 1340 linkSlowCase(iter); 1341 1341 xorPtr(Imm32(static_cast<int32_t>(JSImmediate::FullTagTypeBool)), regT0); 1342 emitPutJITStubArg(regT0, 1);1343 emitCTICall(JITStubs::cti_op_not);1344 emitPutVirtualRegister(currentInstruction[1].u.operand);1342 JITStubCall stubCall(this, JITStubs::cti_op_not); 1343 stubCall.addArgument(regT0); 1344 stubCall.call(currentInstruction[1].u.operand); 1345 1345 NEXT_OPCODE(op_not); 1346 1346 } 1347 1347 case op_jfalse: { 1348 1348 linkSlowCase(iter); 1349 emitPutJITStubArg(regT0, 1);1350 emitCTICall(JITStubs::cti_op_jtrue);1351 unsigned target = currentInstruction[2].u.operand;1352 emitJumpSlowToHot(branchTest32(Zero, regT0), target+ 2); // inverted!1349 JITStubCall stubCall(this, JITStubs::cti_op_jtrue); 1350 stubCall.addArgument(regT0); 1351 stubCall.call(); 1352 emitJumpSlowToHot(branchTest32(Zero, regT0), currentInstruction[2].u.operand + 2); // inverted! 1353 1353 NEXT_OPCODE(op_jfalse); 1354 1354 } … … 1359 1359 case op_bitnot: { 1360 1360 linkSlowCase(iter); 1361 emitPutJITStubArg(regT0, 1);1362 emitCTICall(JITStubs::cti_op_bitnot);1363 emitPutVirtualRegister(currentInstruction[1].u.operand);1361 JITStubCall stubCall(this, JITStubs::cti_op_bitnot); 1362 stubCall.addArgument(regT0); 1363 stubCall.call(currentInstruction[1].u.operand); 1364 1364 NEXT_OPCODE(op_bitnot); 1365 1365 } … … 1370 1370 case op_jtrue: { 1371 1371 linkSlowCase(iter); 1372 emitPutJITStubArg(regT0, 1);1373 emitCTICall(JITStubs::cti_op_jtrue);1374 unsigned target = currentInstruction[2].u.operand;1375 emitJumpSlowToHot(branchTest32(NonZero, regT0), target+ 2);1372 JITStubCall stubCall(this, JITStubs::cti_op_jtrue); 1373 stubCall.addArgument(regT0); 1374 stubCall.call(); 1375 emitJumpSlowToHot(branchTest32(NonZero, regT0), currentInstruction[2].u.operand + 2); 1376 1376 NEXT_OPCODE(op_jtrue); 1377 1377 } … … 1382 1382 case op_bitxor: { 1383 1383 linkSlowCase(iter); 1384 emitPutJITStubArg(regT0, 1);1385 emitPutJITStubArg(regT1, 2);1386 emitCTICall(JITStubs::cti_op_bitxor);1387 emitPutVirtualRegister(currentInstruction[1].u.operand);1384 JITStubCall stubCall(this, JITStubs::cti_op_bitxor); 1385 stubCall.addArgument(regT0); 1386 stubCall.addArgument(regT1); 1387 stubCall.call(currentInstruction[1].u.operand); 1388 1388 NEXT_OPCODE(op_bitxor); 1389 1389 } 1390 1390 case op_bitor: { 1391 1391 linkSlowCase(iter); 1392 emitPutJITStubArg(regT0, 1);1393 emitPutJITStubArg(regT1, 2);1394 emitCTICall(JITStubs::cti_op_bitor);1395 emitPutVirtualRegister(currentInstruction[1].u.operand);1392 JITStubCall stubCall(this, JITStubs::cti_op_bitor); 1393 stubCall.addArgument(regT0); 1394 stubCall.addArgument(regT1); 1395 stubCall.call(currentInstruction[1].u.operand); 1396 1396 NEXT_OPCODE(op_bitor); 1397 1397 } 1398 1398 case op_eq: { 1399 1399 linkSlowCase(iter); 1400 emitPutJITStubArg(regT0, 1);1401 emitPutJITStubArg(regT1, 2);1402 emitCTICall(JITStubs::cti_op_eq);1403 emitPutVirtualRegister(currentInstruction[1].u.operand);1400 JITStubCall stubCall(this, JITStubs::cti_op_eq); 1401 stubCall.addArgument(regT0); 1402 stubCall.addArgument(regT1); 1403 stubCall.call(currentInstruction[1].u.operand); 1404 1404 NEXT_OPCODE(op_eq); 1405 1405 } 1406 1406 case op_neq: { 1407 1407 linkSlowCase(iter); 1408 emitPutJITStubArg(regT0, 1);1409 emitPutJITStubArg(regT1, 2);1410 emitCTICall(JITStubs::cti_op_neq);1411 emitPutVirtualRegister(currentInstruction[1].u.operand);1408 JITStubCall stubCall(this, JITStubs::cti_op_neq); 1409 stubCall.addArgument(regT0); 1410 stubCall.addArgument(regT1); 1411 stubCall.call(currentInstruction[1].u.operand); 1412 1412 NEXT_OPCODE(op_neq); 1413 1413 } … … 1415 1415 linkSlowCase(iter); 1416 1416 linkSlowCase(iter); 1417 emitPutJITStubArg(regT0, 1);1418 emitPutJITStubArg(regT1, 2);1419 emitCTICall(JITStubs::cti_op_stricteq);1420 emitPutVirtualRegister(currentInstruction[1].u.operand);1417 JITStubCall stubCall(this, JITStubs::cti_op_stricteq); 1418 stubCall.addArgument(regT0); 1419 stubCall.addArgument(regT1); 1420 stubCall.call(currentInstruction[1].u.operand); 1421 1421 NEXT_OPCODE(op_stricteq); 1422 1422 } … … 1424 1424 linkSlowCase(iter); 1425 1425 linkSlowCase(iter); 1426 emitPutJITStubArg(regT0, 1);1427 emitPutJITStubArg(regT1, 2);1428 emitCTICall(JITStubs::cti_op_nstricteq);1429 emitPutVirtualRegister(currentInstruction[1].u.operand);1426 JITStubCall stubCall(this, JITStubs::cti_op_nstricteq); 1427 stubCall.addArgument(regT0); 1428 stubCall.addArgument(regT1); 1429 stubCall.call(currentInstruction[1].u.operand); 1430 1430 NEXT_OPCODE(op_nstricteq); 1431 1431 } … … 1434 1434 linkSlowCase(iter); 1435 1435 linkSlowCase(iter); 1436 emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 1, regT2);1437 emitPutJITStubArgFromVirtualRegister(currentInstruction[3].u.operand, 2, regT2);1438 emitPutJITStubArgFromVirtualRegister(currentInstruction[4].u.operand, 3, regT2);1439 emitCTICall(JITStubs::cti_op_instanceof);1440 emitPutVirtualRegister(currentInstruction[1].u.operand);1436 JITStubCall stubCall(this, JITStubs::cti_op_instanceof); 1437 stubCall.addArgument(currentInstruction[2].u.operand, regT2); 1438 stubCall.addArgument(currentInstruction[3].u.operand, regT2); 1439 stubCall.addArgument(currentInstruction[4].u.operand, regT2); 1440 stubCall.call(currentInstruction[1].u.operand); 1441 1441 NEXT_OPCODE(op_instanceof); 1442 1442 } … … 1470 1470 linkSlowCase(iter); 1471 1471 1472 emitPutJITStubArg(regT0, 1); 1473 emitCTICall(JITStubs::cti_op_to_jsnumber); 1474 1475 emitPutVirtualRegister(currentInstruction[1].u.operand); 1472 JITStubCall stubCall(this, JITStubs::cti_op_to_jsnumber); 1473 stubCall.addArgument(regT0); 1474 stubCall.call(currentInstruction[1].u.operand); 1476 1475 NEXT_OPCODE(op_to_jsnumber); 1477 1476 } … … 1493 1492 1494 1493 #ifndef NDEBUG 1495 // reset this, in order to guard it's use with asserts1494 // Reset this, in order to guard its use with ASSERTs. 1496 1495 m_bytecodeIndex = (unsigned)-1; 1497 1496 #endif … … 1528 1527 if (m_codeBlock->codeType() == FunctionCode) { 1529 1528 slowRegisterFileCheck.link(this); 1530 m_bytecodeIndex = 0; // emitCTICall will add to the map, but doesn't actually need this...1531 emitCTICall(JITStubs::cti_register_file_check);1529 m_bytecodeIndex = 0; 1530 JITStubCall(this, JITStubs::cti_register_file_check).call(); 1532 1531 #ifndef NDEBUG 1533 // reset this, in order to guard it's use with asserts 1534 m_bytecodeIndex = (unsigned)-1; 1532 m_bytecodeIndex = (unsigned)-1; // Reset this, in order to guard its use with ASSERTs. 1535 1533 #endif 1536 1534 jump(afterRegisterFileCheck);
Note:
See TracChangeset
for help on using the changeset viewer.