Changeset 179357 in webkit for trunk/Source/JavaScriptCore/jit/JITOperations.cpp
- Timestamp:
- Jan 29, 2015, 12:33:45 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/JITOperations.cpp
r178928 r179357 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 … … 777 777 } 778 778 779 static bool attemptToOptimizeClosureCall( 780 ExecState* execCallee, RegisterPreservationMode registers, JSCell* calleeAsFunctionCell, 781 CallLinkInfo& callLinkInfo) 782 { 783 if (!calleeAsFunctionCell) 784 return false; 785 786 JSFunction* callee = jsCast<JSFunction*>(calleeAsFunctionCell); 787 JSFunction* oldCallee = callLinkInfo.callee.get(); 788 789 if (!oldCallee || oldCallee->executable() != callee->executable()) 790 return false; 791 792 ASSERT(callee->executable()->hasJITCodeForCall()); 793 MacroAssemblerCodePtr codePtr = 794 callee->executable()->generatedJITCodeForCall()->addressForCall( 795 *execCallee->callerFrame()->codeBlock()->vm(), callee->executable(), 796 ArityCheckNotRequired, registers); 797 798 CodeBlock* codeBlock; 799 if (callee->executable()->isHostFunction()) 800 codeBlock = 0; 801 else { 802 codeBlock = jsCast<FunctionExecutable*>(callee->executable())->codeBlockForCall(); 803 if (execCallee->argumentCountIncludingThis() < static_cast<size_t>(codeBlock->numParameters()) || callLinkInfo.callType == CallLinkInfo::CallVarargs || callLinkInfo.callType == CallLinkInfo::ConstructVarargs) 804 return false; 805 } 806 807 linkClosureCall( 808 execCallee, callLinkInfo, codeBlock, callee->executable(), codePtr, registers); 809 810 return true; 811 } 812 813 char* JIT_OPERATION operationLinkClosureCall(ExecState* execCallee, CallLinkInfo* callLinkInfo) 779 char* JIT_OPERATION operationLinkPolymorphicCall(ExecState* execCallee, CallLinkInfo* callLinkInfo) 814 780 { 815 781 JSCell* calleeAsFunctionCell; 816 782 char* result = virtualForWithFunction(execCallee, CodeForCall, RegisterPreservationNotRequired, calleeAsFunctionCell); 817 783 818 if (!attemptToOptimizeClosureCall(execCallee, RegisterPreservationNotRequired, calleeAsFunctionCell, *callLinkInfo)) 819 linkSlowFor(execCallee, *callLinkInfo, CodeForCall, RegisterPreservationNotRequired); 784 linkPolymorphicCall(execCallee, *callLinkInfo, CallVariant(calleeAsFunctionCell), RegisterPreservationNotRequired); 820 785 821 786 return result; … … 832 797 } 833 798 834 char* JIT_OPERATION operationLink ClosureCallThatPreservesRegs(ExecState* execCallee, CallLinkInfo* callLinkInfo)799 char* JIT_OPERATION operationLinkPolymorphicCallThatPreservesRegs(ExecState* execCallee, CallLinkInfo* callLinkInfo) 835 800 { 836 801 JSCell* calleeAsFunctionCell; 837 802 char* result = virtualForWithFunction(execCallee, CodeForCall, MustPreserveRegisters, calleeAsFunctionCell); 838 803 839 if (!attemptToOptimizeClosureCall(execCallee, MustPreserveRegisters, calleeAsFunctionCell, *callLinkInfo)) 840 linkSlowFor(execCallee, *callLinkInfo, CodeForCall, MustPreserveRegisters); 804 linkPolymorphicCall(execCallee, *callLinkInfo, CallVariant(calleeAsFunctionCell), MustPreserveRegisters); 841 805 842 806 return result; … … 1034 998 1035 999 CodeBlock* codeBlock = exec->codeBlock(); 1000 if (codeBlock->jitType() != JITCode::BaselineJIT) { 1001 dataLog("Unexpected code block in Baseline->DFG tier-up: ", *codeBlock, "\n"); 1002 RELEASE_ASSERT_NOT_REACHED(); 1003 } 1036 1004 1037 1005 if (bytecodeIndex) {
Note:
See TracChangeset
for help on using the changeset viewer.