Changeset 44700 in webkit for trunk/JavaScriptCore
- Timestamp:
- Jun 15, 2009, 5:26:53 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r44693 r44700 1 2009-06-15 Gavin Barraclough <[email protected]> 2 3 Reviewed by Oliver Hunt. 4 5 Move repatching methods into a set of methods on a class. This will allow us to 6 coallesce memory reprotection calls. Really, we want this class to be called 7 PatchBuffer, we want the class PatchBuffer to be called LinkBuffer, we want both 8 to be memblers of MacroAssembler rather then AbstractMacroAssembler, we don't 9 want the CodeLocationFoo types anymore (they are now only really there to provide 10 type safety, and that is completely undermined by the way we use offsets). Then 11 the link & patch buffers should delegate the actual patching calls to the 12 architecture-specific layer of the MacroAssembler. Landing all these changes as a 13 sequence of patches. 14 15 No performance impact. 16 17 * assembler/AbstractMacroAssembler.h: 18 (JSC::AbstractMacroAssembler::CodeLocationCall::CodeLocationCall): 19 (JSC::AbstractMacroAssembler::CodeLocationNearCall::CodeLocationNearCall): 20 (JSC::AbstractMacroAssembler::CodeLocationNearCall::calleeReturnAddressValue): 21 (JSC::AbstractMacroAssembler::RepatchBuffer::RepatchBuffer): 22 (JSC::AbstractMacroAssembler::RepatchBuffer::relink): 23 (JSC::AbstractMacroAssembler::RepatchBuffer::repatch): 24 (JSC::AbstractMacroAssembler::RepatchBuffer::relinkCallerToTrampoline): 25 (JSC::AbstractMacroAssembler::RepatchBuffer::relinkCallerToFunction): 26 (JSC::AbstractMacroAssembler::RepatchBuffer::relinkNearCallerToTrampoline): 27 (JSC::AbstractMacroAssembler::RepatchBuffer::repatchLoadPtrToLEA): 28 * jit/JIT.cpp: 29 (JSC::ctiPatchNearCallByReturnAddress): 30 (JSC::ctiPatchCallByReturnAddress): 31 (JSC::JIT::unlinkCall): 32 (JSC::JIT::linkCall): 33 * jit/JITPropertyAccess.cpp: 34 (JSC::JIT::privateCompilePutByIdTransition): 35 (JSC::JIT::patchGetByIdSelf): 36 (JSC::JIT::patchMethodCallProto): 37 (JSC::JIT::patchPutByIdReplace): 38 (JSC::JIT::privateCompilePatchGetArrayLength): 39 (JSC::JIT::privateCompileGetByIdProto): 40 (JSC::JIT::privateCompileGetByIdSelfList): 41 (JSC::JIT::privateCompileGetByIdProtoList): 42 (JSC::JIT::privateCompileGetByIdChainList): 43 (JSC::JIT::privateCompileGetByIdChain): 44 1 45 2009-06-15 Gavin Barraclough <[email protected]> 2 46 -
trunk/JavaScriptCore/assembler/AbstractMacroAssembler.h
r44514 r44700 50 50 class Jump; 51 51 class PatchBuffer; 52 class RepatchBuffer; 52 53 class CodeLocationInstruction; 53 54 class CodeLocationLabel; … … 429 430 // instruction stream, without any semantic information. 430 431 class CodeLocationCommon { 432 friend class RepatchBuffer; 433 431 434 public: 432 435 CodeLocationCommon() … … 469 472 // An arbitrary instruction in the JIT code. 470 473 class CodeLocationInstruction : public CodeLocationCommon { 471 friend class CodeLocationCommon;472 474 public: 473 475 CodeLocationInstruction() … … 475 477 } 476 478 477 void repatchLoadPtrToLEA()478 {479 AssemblerType::repatchLoadPtrToLEA(this->dataLocation());480 }481 482 private:483 479 explicit CodeLocationInstruction(void* location) 484 480 : CodeLocationCommon(CodePtr(location)) … … 496 492 friend class CodeLocationNearCall; 497 493 friend class PatchBuffer; 494 friend class RepatchBuffer; 498 495 friend class ProcessorReturnAddress; 499 496 … … 542 539 } 543 540 544 void relink(CodeLocationLabel destination)545 {546 AssemblerType::relinkJump(this->dataLocation(), destination.dataLocation());547 }548 549 private:550 541 explicit CodeLocationJump(void* location) 551 542 : CodeLocationCommon(CodePtr(location)) … … 558 549 // A point in the JIT code at which there is a call instruction. 559 550 class CodeLocationCall : public CodeLocationCommon { 560 friend class CodeLocationCommon;561 friend class PatchBuffer;562 friend class ProcessorReturnAddress;563 551 public: 564 552 CodeLocationCall() … … 566 554 } 567 555 568 void relink(CodeLocationLabel destination) 569 { 570 #if PLATFORM(X86_64) 571 CodeLocationCommon::dataLabelPtrAtOffset(-REPTACH_OFFSET_CALL_R11).repatch(destination.executableAddress()); 572 #else 573 AssemblerType::relinkCall(this->dataLocation(), destination.executableAddress()); 574 #endif 575 } 576 577 void relink(FunctionPtr destination) 578 { 579 #if PLATFORM(X86_64) 580 CodeLocationCommon::dataLabelPtrAtOffset(-REPTACH_OFFSET_CALL_R11).repatch(destination.executableAddress()); 581 #else 582 AssemblerType::relinkCall(this->dataLocation(), destination.executableAddress()); 583 #endif 556 explicit CodeLocationCall(CodePtr location) 557 : CodeLocationCommon(location) 558 { 559 } 560 561 explicit CodeLocationCall(void* location) 562 : CodeLocationCommon(CodePtr(location)) 563 { 584 564 } 585 565 … … 591 571 } 592 572 593 private:594 explicit CodeLocationCall(CodePtr location)595 : CodeLocationCommon(location)596 {597 }598 599 explicit CodeLocationCall(void* location)600 : CodeLocationCommon(CodePtr(location))601 {602 }603 573 }; 604 574 … … 607 577 // A point in the JIT code at which there is a call instruction with near linkage. 608 578 class CodeLocationNearCall : public CodeLocationCommon { 609 friend class CodeLocationCommon;610 friend class PatchBuffer;611 friend class ProcessorReturnAddress;612 579 public: 613 580 CodeLocationNearCall() … … 615 582 } 616 583 617 void relink(CodePtr destination) 618 { 619 AssemblerType::relinkCall(this->dataLocation(), destination.executableAddress()); 620 } 621 622 void relink(CodeLocationLabel destination) 623 { 624 AssemblerType::relinkCall(this->dataLocation(), destination.executableAddress()); 625 } 626 627 void relink(FunctionPtr destination) 628 { 629 AssemblerType::relinkCall(this->dataLocation(), destination.executableAddress()); 584 explicit CodeLocationNearCall(CodePtr location) 585 : CodeLocationCommon(location) 586 { 587 } 588 589 explicit CodeLocationNearCall(void* location) 590 : CodeLocationCommon(CodePtr(location)) 591 { 630 592 } 631 593 … … 636 598 return this->executableAddress(); 637 599 } 638 639 private:640 explicit CodeLocationNearCall(CodePtr location)641 : CodeLocationCommon(location)642 {643 }644 645 explicit CodeLocationNearCall(void* location)646 : CodeLocationCommon(CodePtr(location))647 {648 }649 600 }; 650 601 … … 653 604 // A point in the JIT code at which there is an int32_t immediate that may be repatched. 654 605 class CodeLocationDataLabel32 : public CodeLocationCommon { 655 friend class CodeLocationCommon;656 friend class PatchBuffer;657 606 public: 658 607 CodeLocationDataLabel32() … … 660 609 } 661 610 662 void repatch(int32_t value)663 {664 AssemblerType::repatchInt32(this->dataLocation(), value);665 }666 667 private:668 611 explicit CodeLocationDataLabel32(void* location) 669 612 : CodeLocationCommon(CodePtr(location)) … … 676 619 // A point in the JIT code at which there is a void* immediate that may be repatched. 677 620 class CodeLocationDataLabelPtr : public CodeLocationCommon { 678 friend class CodeLocationCommon;679 friend class PatchBuffer;680 621 public: 681 622 CodeLocationDataLabelPtr() … … 683 624 } 684 625 685 void repatch(void* value)686 {687 AssemblerType::repatchPointer(this->dataLocation(), value);688 }689 690 private:691 626 explicit CodeLocationDataLabelPtr(void* location) 692 627 : CodeLocationCommon(CodePtr(location)) … … 699 634 // This class can be used to relink a call identified by its return address. 700 635 class ProcessorReturnAddress { 701 friend class CodeLocationCall;702 friend class CodeLocationNearCall;703 636 public: 704 637 ProcessorReturnAddress(void* location) … … 707 640 } 708 641 709 void relinkCallerToTrampoline(CodeLocationLabel label)710 {711 CodeLocationCall(CodePtr(m_location)).relink(label);712 }713 714 void relinkCallerToTrampoline(CodePtr newCalleeFunction)715 {716 relinkCallerToTrampoline(CodeLocationLabel(newCalleeFunction));717 }718 719 void relinkCallerToFunction(FunctionPtr function)720 {721 CodeLocationCall(CodePtr(m_location)).relink(function);722 }723 724 void relinkNearCallerToTrampoline(CodeLocationLabel label)725 {726 CodeLocationNearCall(CodePtr(m_location)).relink(label);727 }728 729 void relinkNearCallerToTrampoline(CodePtr newCalleeFunction)730 {731 relinkNearCallerToTrampoline(CodeLocationLabel(newCalleeFunction));732 }733 734 642 void* addressForLookup() 735 643 { … … 737 645 } 738 646 739 private:740 647 ReturnAddressPtr m_location; 741 648 }; … … 902 809 }; 903 810 811 class RepatchBuffer { 812 public: 813 RepatchBuffer() 814 { 815 } 816 817 void relink(CodeLocationJump jump, CodeLocationLabel destination) 818 { 819 AssemblerType::relinkJump(jump.dataLocation(), destination.dataLocation()); 820 } 821 822 void relink(CodeLocationCall call, CodeLocationLabel destination) 823 { 824 #if PLATFORM(X86_64) 825 repatch(call.dataLabelPtrAtOffset(-REPTACH_OFFSET_CALL_R11), destination.executableAddress()); 826 #else 827 AssemblerType::relinkCall(call.dataLocation(), destination.executableAddress()); 828 #endif 829 } 830 831 void relink(CodeLocationCall call, FunctionPtr destination) 832 { 833 #if PLATFORM(X86_64) 834 repatch(call.dataLabelPtrAtOffset(-REPTACH_OFFSET_CALL_R11), destination.executableAddress()); 835 #else 836 AssemblerType::relinkCall(call.dataLocation(), destination.executableAddress()); 837 #endif 838 } 839 840 void relink(CodeLocationNearCall nearCall, CodePtr destination) 841 { 842 AssemblerType::relinkCall(nearCall.dataLocation(), destination.executableAddress()); 843 } 844 845 void relink(CodeLocationNearCall nearCall, CodeLocationLabel destination) 846 { 847 AssemblerType::relinkCall(nearCall.dataLocation(), destination.executableAddress()); 848 } 849 850 void relink(CodeLocationNearCall nearCall, FunctionPtr destination) 851 { 852 AssemblerType::relinkCall(nearCall.dataLocation(), destination.executableAddress()); 853 } 854 855 void repatch(CodeLocationDataLabel32 dataLabel32, int32_t value) 856 { 857 AssemblerType::repatchInt32(dataLabel32.dataLocation(), value); 858 } 859 860 void repatch(CodeLocationDataLabelPtr dataLabelPtr, void* value) 861 { 862 AssemblerType::repatchPointer(dataLabelPtr.dataLocation(), value); 863 } 864 865 void relinkCallerToTrampoline(ProcessorReturnAddress returnAddress, CodeLocationLabel label) 866 { 867 relink(CodeLocationCall(CodePtr(returnAddress.m_location)), label); 868 } 869 870 void relinkCallerToTrampoline(ProcessorReturnAddress returnAddress, CodePtr newCalleeFunction) 871 { 872 relinkCallerToTrampoline(returnAddress, CodeLocationLabel(newCalleeFunction)); 873 } 874 875 void relinkCallerToFunction(ProcessorReturnAddress returnAddress, FunctionPtr function) 876 { 877 relink(CodeLocationCall(CodePtr(returnAddress.m_location)), function); 878 } 879 880 void relinkNearCallerToTrampoline(ProcessorReturnAddress returnAddress, CodeLocationLabel label) 881 { 882 relink(CodeLocationNearCall(CodePtr(returnAddress.m_location)), label); 883 } 884 885 void relinkNearCallerToTrampoline(ProcessorReturnAddress returnAddress, CodePtr newCalleeFunction) 886 { 887 relinkNearCallerToTrampoline(returnAddress, CodeLocationLabel(newCalleeFunction)); 888 } 889 890 void repatchLoadPtrToLEA(CodeLocationInstruction instruction) 891 { 892 AssemblerType::repatchLoadPtrToLEA(instruction.dataLocation()); 893 } 894 }; 895 904 896 905 897 // Section 5: Misc admin methods -
trunk/JavaScriptCore/jit/JIT.cpp
r44693 r44700 49 49 void ctiPatchNearCallByReturnAddress(MacroAssembler::ProcessorReturnAddress returnAddress, MacroAssemblerCodePtr newCalleeFunction) 50 50 { 51 returnAddress.relinkNearCallerToTrampoline(newCalleeFunction); 51 MacroAssembler::RepatchBuffer repatchBuffer; 52 repatchBuffer.relinkNearCallerToTrampoline(returnAddress, newCalleeFunction); 52 53 } 53 54 54 55 void ctiPatchCallByReturnAddress(MacroAssembler::ProcessorReturnAddress returnAddress, MacroAssemblerCodePtr newCalleeFunction) 55 56 { 56 returnAddress.relinkCallerToTrampoline(newCalleeFunction); 57 MacroAssembler::RepatchBuffer repatchBuffer; 58 repatchBuffer.relinkCallerToTrampoline(returnAddress, newCalleeFunction); 57 59 } 58 60 59 61 void ctiPatchCallByReturnAddress(MacroAssembler::ProcessorReturnAddress returnAddress, FunctionPtr newCalleeFunction) 60 62 { 61 returnAddress.relinkCallerToFunction(newCalleeFunction); 63 MacroAssembler::RepatchBuffer repatchBuffer; 64 repatchBuffer.relinkCallerToFunction(returnAddress, newCalleeFunction); 62 65 } 63 66 … … 903 906 // (and, if a new JSFunction happened to be constructed at the same location, we could get a false positive 904 907 // match). Reset the check so it no longer matches. 905 callLinkInfo->hotPathBegin.repatch(JSValue::encode(JSValue())); 908 RepatchBuffer repatchBuffer; 909 repatchBuffer.repatch(callLinkInfo->hotPathBegin, JSValue::encode(JSValue())); 906 910 } 907 911 908 912 void JIT::linkCall(JSFunction* callee, CodeBlock* calleeCodeBlock, JITCode& code, CallLinkInfo* callLinkInfo, int callerArgCount, JSGlobalData* globalData) 909 913 { 914 RepatchBuffer repatchBuffer; 915 910 916 // Currently we only link calls with the exact number of arguments. 911 917 // If this is a native call calleeCodeBlock is null so the number of parameters is unimportant … … 916 922 calleeCodeBlock->addCaller(callLinkInfo); 917 923 918 callLinkInfo->hotPathBegin.repatch(callee);919 callLinkInfo->hotPathOther.relink(code.addressForCall());924 repatchBuffer.repatch(callLinkInfo->hotPathBegin, callee); 925 repatchBuffer.relink(callLinkInfo->hotPathOther, code.addressForCall()); 920 926 } 921 927 922 928 // patch the call so we do not continue to try to link. 923 callLinkInfo->callReturnLocation.relink(globalData->jitStubs.ctiVirtualCall());929 repatchBuffer.relink(callLinkInfo->callReturnLocation, globalData->jitStubs.ctiVirtualCall()); 924 930 } 925 931 -
trunk/JavaScriptCore/jit/JITPropertyAccess.cpp
r44525 r44700 499 499 CodeLocationLabel entryLabel = patchBuffer.finalizeCodeAddendum(); 500 500 stubInfo->stubRoutine = entryLabel; 501 returnAddress.relinkCallerToTrampoline(entryLabel); 501 RepatchBuffer repatchBuffer; 502 repatchBuffer.relinkCallerToTrampoline(returnAddress, entryLabel); 502 503 } 503 504 504 505 void JIT::patchGetByIdSelf(StructureStubInfo* stubInfo, Structure* structure, size_t cachedOffset, ProcessorReturnAddress returnAddress) 505 506 { 507 RepatchBuffer repatchBuffer; 508 506 509 // We don't want to patch more than once - in future go to cti_op_get_by_id_generic. 507 510 // Should probably go to JITStubs::cti_op_get_by_id_fail, but that doesn't do anything interesting right now. 508 re turnAddress.relinkCallerToFunction(FunctionPtr(JITStubs::cti_op_get_by_id_self_fail));511 repatchBuffer.relinkCallerToFunction(returnAddress, FunctionPtr(JITStubs::cti_op_get_by_id_self_fail)); 509 512 510 513 int offset = sizeof(JSValue) * cachedOffset; … … 513 516 // and makes the subsequent load's offset automatically correct 514 517 if (structure->isUsingInlineStorage()) 515 stubInfo->hotPathBegin.instructionAtOffset(patchOffsetGetByIdExternalLoad).repatchLoadPtrToLEA();518 repatchBuffer.repatchLoadPtrToLEA(stubInfo->hotPathBegin.instructionAtOffset(patchOffsetGetByIdExternalLoad)); 516 519 517 520 // Patch the offset into the propoerty map to load from, then patch the Structure to look for. 518 stubInfo->hotPathBegin.dataLabelPtrAtOffset(patchOffsetGetByIdStructure).repatch(structure);519 stubInfo->hotPathBegin.dataLabel32AtOffset(patchOffsetGetByIdPropertyMapOffset).repatch(offset);521 repatchBuffer.repatch(stubInfo->hotPathBegin.dataLabelPtrAtOffset(patchOffsetGetByIdStructure), structure); 522 repatchBuffer.repatch(stubInfo->hotPathBegin.dataLabel32AtOffset(patchOffsetGetByIdPropertyMapOffset), offset); 520 523 } 521 524 522 525 void JIT::patchMethodCallProto(MethodCallLinkInfo& methodCallLinkInfo, JSFunction* callee, Structure* structure, JSObject* proto) 523 526 { 527 RepatchBuffer repatchBuffer; 528 524 529 ASSERT(!methodCallLinkInfo.cachedStructure); 525 530 methodCallLinkInfo.cachedStructure = structure; 526 531 structure->ref(); 527 532 528 methodCallLinkInfo.structureLabel.repatch(structure);529 methodCallLinkInfo.structureLabel.dataLabelPtrAtOffset(patchOffsetMethodCheckProtoObj).repatch(proto);530 methodCallLinkInfo.structureLabel.dataLabelPtrAtOffset(patchOffsetMethodCheckProtoStruct).repatch(proto->structure());531 methodCallLinkInfo.structureLabel.dataLabelPtrAtOffset(patchOffsetMethodCheckPutFunction).repatch(callee);533 repatchBuffer.repatch(methodCallLinkInfo.structureLabel, structure); 534 repatchBuffer.repatch(methodCallLinkInfo.structureLabel.dataLabelPtrAtOffset(patchOffsetMethodCheckProtoObj), proto); 535 repatchBuffer.repatch(methodCallLinkInfo.structureLabel.dataLabelPtrAtOffset(patchOffsetMethodCheckProtoStruct), proto->structure()); 536 repatchBuffer.repatch(methodCallLinkInfo.structureLabel.dataLabelPtrAtOffset(patchOffsetMethodCheckPutFunction), callee); 532 537 } 533 538 534 539 void JIT::patchPutByIdReplace(StructureStubInfo* stubInfo, Structure* structure, size_t cachedOffset, ProcessorReturnAddress returnAddress) 535 540 { 541 RepatchBuffer repatchBuffer; 542 536 543 // We don't want to patch more than once - in future go to cti_op_put_by_id_generic. 537 544 // Should probably go to JITStubs::cti_op_put_by_id_fail, but that doesn't do anything interesting right now. 538 re turnAddress.relinkCallerToFunction(FunctionPtr(JITStubs::cti_op_put_by_id_generic));545 repatchBuffer.relinkCallerToFunction(returnAddress, FunctionPtr(JITStubs::cti_op_put_by_id_generic)); 539 546 540 547 int offset = sizeof(JSValue) * cachedOffset; … … 543 550 // and makes the subsequent load's offset automatically correct 544 551 if (structure->isUsingInlineStorage()) 545 stubInfo->hotPathBegin.instructionAtOffset(patchOffsetPutByIdExternalLoad).repatchLoadPtrToLEA();552 repatchBuffer.repatchLoadPtrToLEA(stubInfo->hotPathBegin.instructionAtOffset(patchOffsetPutByIdExternalLoad)); 546 553 547 554 // Patch the offset into the propoerty map to load from, then patch the Structure to look for. 548 stubInfo->hotPathBegin.dataLabelPtrAtOffset(patchOffsetPutByIdStructure).repatch(structure);549 stubInfo->hotPathBegin.dataLabel32AtOffset(patchOffsetPutByIdPropertyMapOffset).repatch(offset);555 repatchBuffer.repatch(stubInfo->hotPathBegin.dataLabelPtrAtOffset(patchOffsetPutByIdStructure), structure); 556 repatchBuffer.repatch(stubInfo->hotPathBegin.dataLabel32AtOffset(patchOffsetPutByIdPropertyMapOffset), offset); 550 557 } 551 558 … … 553 560 { 554 561 StructureStubInfo* stubInfo = &m_codeBlock->getStubInfo(returnAddress.addressForLookup()); 555 556 // We don't want to patch more than once - in future go to cti_op_put_by_id_generic.557 returnAddress.relinkCallerToFunction(FunctionPtr(JITStubs::cti_op_get_by_id_array_fail));558 562 559 563 // Check eax is an array … … 585 589 // Finally patch the jump to slow case back in the hot path to jump here instead. 586 590 CodeLocationJump jumpLocation = stubInfo->hotPathBegin.jumpAtOffset(patchOffsetGetByIdBranchToSlowCase); 587 jumpLocation.relink(entryLabel); 591 RepatchBuffer repatchBuffer; 592 repatchBuffer.relink(jumpLocation, entryLabel); 593 594 // We don't want to patch more than once - in future go to cti_op_put_by_id_generic. 595 repatchBuffer.relinkCallerToFunction(returnAddress, FunctionPtr(JITStubs::cti_op_get_by_id_array_fail)); 588 596 } 589 597 590 598 void JIT::privateCompileGetByIdProto(StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, size_t cachedOffset, ProcessorReturnAddress returnAddress, CallFrame* callFrame) 591 599 { 592 // We don't want to patch more than once - in future go to cti_op_put_by_id_generic.593 returnAddress.relinkCallerToFunction(FunctionPtr(JITStubs::cti_op_get_by_id_proto_list));594 595 600 // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a Structure that is 596 601 // referencing the prototype object - let's speculatively load it's table nice and early!) … … 630 635 // Finally patch the jump to slow case back in the hot path to jump here instead. 631 636 CodeLocationJump jumpLocation = stubInfo->hotPathBegin.jumpAtOffset(patchOffsetGetByIdBranchToSlowCase); 632 jumpLocation.relink(entryLabel); 637 RepatchBuffer repatchBuffer; 638 repatchBuffer.relink(jumpLocation, entryLabel); 639 640 // We don't want to patch more than once - in future go to cti_op_put_by_id_generic. 641 repatchBuffer.relinkCallerToFunction(returnAddress, FunctionPtr(JITStubs::cti_op_get_by_id_proto_list)); 633 642 } 634 643 … … 658 667 // Finally patch the jump to slow case back in the hot path to jump here instead. 659 668 CodeLocationJump jumpLocation = stubInfo->hotPathBegin.jumpAtOffset(patchOffsetGetByIdBranchToSlowCase); 660 jumpLocation.relink(entryLabel); 669 RepatchBuffer repatchBuffer; 670 repatchBuffer.relink(jumpLocation, entryLabel); 661 671 } 662 672 … … 702 712 // Finally patch the jump to slow case back in the hot path to jump here instead. 703 713 CodeLocationJump jumpLocation = stubInfo->hotPathBegin.jumpAtOffset(patchOffsetGetByIdBranchToSlowCase); 704 jumpLocation.relink(entryLabel); 714 RepatchBuffer repatchBuffer; 715 repatchBuffer.relink(jumpLocation, entryLabel); 705 716 } 706 717 … … 755 766 // Finally patch the jump to slow case back in the hot path to jump here instead. 756 767 CodeLocationJump jumpLocation = stubInfo->hotPathBegin.jumpAtOffset(patchOffsetGetByIdBranchToSlowCase); 757 jumpLocation.relink(entryLabel); 768 RepatchBuffer repatchBuffer; 769 repatchBuffer.relink(jumpLocation, entryLabel); 758 770 } 759 771 760 772 void JIT::privateCompileGetByIdChain(StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, size_t cachedOffset, ProcessorReturnAddress returnAddress, CallFrame* callFrame) 761 773 { 762 // We don't want to patch more than once - in future go to cti_op_put_by_id_generic.763 returnAddress.relinkCallerToFunction(FunctionPtr(JITStubs::cti_op_get_by_id_proto_list));764 765 774 ASSERT(count); 766 775 … … 805 814 // Finally patch the jump to slow case back in the hot path to jump here instead. 806 815 CodeLocationJump jumpLocation = stubInfo->hotPathBegin.jumpAtOffset(patchOffsetGetByIdBranchToSlowCase); 807 jumpLocation.relink(entryLabel); 816 RepatchBuffer repatchBuffer; 817 repatchBuffer.relink(jumpLocation, entryLabel); 818 819 // We don't want to patch more than once - in future go to cti_op_put_by_id_generic. 820 repatchBuffer.relinkCallerToFunction(returnAddress, FunctionPtr(JITStubs::cti_op_get_by_id_proto_list)); 808 821 } 809 822
Note:
See TracChangeset
for help on using the changeset viewer.