Changeset 179478 in webkit for trunk/Source/JavaScriptCore/jit/JITOperations.cpp
- Timestamp:
- Feb 2, 2015, 10:38:08 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/JITOperations.cpp
r179429 r179478 1 1 /* 2 * Copyright (C) 2013 , 2014Apple Inc. All rights reserved.2 * Copyright (C) 2013-2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 771 771 } 772 772 773 static bool attemptToOptimizeClosureCall( 774 ExecState* execCallee, RegisterPreservationMode registers, JSCell* calleeAsFunctionCell, 775 CallLinkInfo& callLinkInfo) 776 { 777 if (!calleeAsFunctionCell) 778 return false; 779 780 JSFunction* callee = jsCast<JSFunction*>(calleeAsFunctionCell); 781 JSFunction* oldCallee = callLinkInfo.callee.get(); 782 783 if (!oldCallee || oldCallee->executable() != callee->executable()) 784 return false; 785 786 ASSERT(callee->executable()->hasJITCodeForCall()); 787 MacroAssemblerCodePtr codePtr = 788 callee->executable()->generatedJITCodeForCall()->addressForCall( 789 *execCallee->callerFrame()->codeBlock()->vm(), callee->executable(), 790 ArityCheckNotRequired, registers); 791 792 CodeBlock* codeBlock; 793 if (callee->executable()->isHostFunction()) 794 codeBlock = 0; 795 else { 796 codeBlock = jsCast<FunctionExecutable*>(callee->executable())->codeBlockForCall(); 797 if (execCallee->argumentCountIncludingThis() < static_cast<size_t>(codeBlock->numParameters()) || callLinkInfo.callType == CallLinkInfo::CallVarargs || callLinkInfo.callType == CallLinkInfo::ConstructVarargs) 798 return false; 799 } 800 801 linkClosureCall( 802 execCallee, callLinkInfo, codeBlock, callee->executable(), codePtr, registers); 803 804 return true; 805 } 806 807 char* JIT_OPERATION operationLinkClosureCall(ExecState* execCallee, CallLinkInfo* callLinkInfo) 773 char* JIT_OPERATION operationLinkPolymorphicCall(ExecState* execCallee, CallLinkInfo* callLinkInfo) 808 774 { 809 775 JSCell* calleeAsFunctionCell; 810 776 char* result = virtualForWithFunction(execCallee, CodeForCall, RegisterPreservationNotRequired, calleeAsFunctionCell); 811 777 812 if (!attemptToOptimizeClosureCall(execCallee, RegisterPreservationNotRequired, calleeAsFunctionCell, *callLinkInfo)) 813 linkSlowFor(execCallee, *callLinkInfo, CodeForCall, RegisterPreservationNotRequired); 778 linkPolymorphicCall(execCallee, *callLinkInfo, CallVariant(calleeAsFunctionCell), RegisterPreservationNotRequired); 814 779 815 780 return result; … … 826 791 } 827 792 828 char* JIT_OPERATION operationLink ClosureCallThatPreservesRegs(ExecState* execCallee, CallLinkInfo* callLinkInfo)793 char* JIT_OPERATION operationLinkPolymorphicCallThatPreservesRegs(ExecState* execCallee, CallLinkInfo* callLinkInfo) 829 794 { 830 795 JSCell* calleeAsFunctionCell; 831 796 char* result = virtualForWithFunction(execCallee, CodeForCall, MustPreserveRegisters, calleeAsFunctionCell); 832 797 833 if (!attemptToOptimizeClosureCall(execCallee, MustPreserveRegisters, calleeAsFunctionCell, *callLinkInfo)) 834 linkSlowFor(execCallee, *callLinkInfo, CodeForCall, MustPreserveRegisters); 798 linkPolymorphicCall(execCallee, *callLinkInfo, CallVariant(calleeAsFunctionCell), MustPreserveRegisters); 835 799 836 800 return result; … … 1028 992 1029 993 CodeBlock* codeBlock = exec->codeBlock(); 994 if (codeBlock->jitType() != JITCode::BaselineJIT) { 995 dataLog("Unexpected code block in Baseline->DFG tier-up: ", *codeBlock, "\n"); 996 RELEASE_ASSERT_NOT_REACHED(); 997 } 1030 998 1031 999 if (bytecodeIndex) {
Note:
See TracChangeset
for help on using the changeset viewer.