Changeset 179392 in webkit for trunk/Source/JavaScriptCore/jit/JITOperations.cpp
- Timestamp:
- Jan 29, 2015, 8:28:36 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/JITOperations.cpp
r179357 r179392 1 1 /* 2 * Copyright (C) 2013 -2015Apple Inc. All rights reserved.2 * Copyright (C) 2013, 2014 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 char* JIT_OPERATION operationLinkPolymorphicCall(ExecState* execCallee, CallLinkInfo* callLinkInfo) 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) 780 814 { 781 815 JSCell* calleeAsFunctionCell; 782 816 char* result = virtualForWithFunction(execCallee, CodeForCall, RegisterPreservationNotRequired, calleeAsFunctionCell); 783 817 784 linkPolymorphicCall(execCallee, *callLinkInfo, CallVariant(calleeAsFunctionCell), RegisterPreservationNotRequired); 818 if (!attemptToOptimizeClosureCall(execCallee, RegisterPreservationNotRequired, calleeAsFunctionCell, *callLinkInfo)) 819 linkSlowFor(execCallee, *callLinkInfo, CodeForCall, RegisterPreservationNotRequired); 785 820 786 821 return result; … … 797 832 } 798 833 799 char* JIT_OPERATION operationLink PolymorphicCallThatPreservesRegs(ExecState* execCallee, CallLinkInfo* callLinkInfo)834 char* JIT_OPERATION operationLinkClosureCallThatPreservesRegs(ExecState* execCallee, CallLinkInfo* callLinkInfo) 800 835 { 801 836 JSCell* calleeAsFunctionCell; 802 837 char* result = virtualForWithFunction(execCallee, CodeForCall, MustPreserveRegisters, calleeAsFunctionCell); 803 838 804 linkPolymorphicCall(execCallee, *callLinkInfo, CallVariant(calleeAsFunctionCell), MustPreserveRegisters); 839 if (!attemptToOptimizeClosureCall(execCallee, MustPreserveRegisters, calleeAsFunctionCell, *callLinkInfo)) 840 linkSlowFor(execCallee, *callLinkInfo, CodeForCall, MustPreserveRegisters); 805 841 806 842 return result; … … 998 1034 999 1035 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 }1004 1036 1005 1037 if (bytecodeIndex) {
Note:
See TracChangeset
for help on using the changeset viewer.