diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-24 16:36:50 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-24 16:36:50 +0100 |
commit | ad0d549d4cc13433f77c1ac8f0ab379c83d93f28 (patch) | |
tree | b34b0daceb7c8e7fdde4b4ec43650ab7caadb0a9 /Source/JavaScriptCore/bytecode/CallLinkStatus.cpp | |
parent | 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (diff) | |
download | qtwebkit-ad0d549d4cc13433f77c1ac8f0ab379c83d93f28.tar.gz |
Imported WebKit commit bb52bf3c0119e8a128cd93afe5572413a8617de9 (http://svn.webkit.org/repository/webkit/trunk@108790)
Diffstat (limited to 'Source/JavaScriptCore/bytecode/CallLinkStatus.cpp')
-rw-r--r-- | Source/JavaScriptCore/bytecode/CallLinkStatus.cpp | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp b/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp index f3fd5bb27..7f9e9ee8a 100644 --- a/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp +++ b/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp @@ -27,17 +27,40 @@ #include "CallLinkStatus.h" #include "CodeBlock.h" +#include "LLIntCallLinkInfo.h" namespace JSC { +CallLinkStatus CallLinkStatus::computeFromLLInt(CodeBlock* profiledBlock, unsigned bytecodeIndex) +{ + UNUSED_PARAM(profiledBlock); + UNUSED_PARAM(bytecodeIndex); +#if ENABLE(LLINT) + Instruction* instruction = profiledBlock->instructions().begin() + bytecodeIndex; + LLIntCallLinkInfo* callLinkInfo = instruction[4].u.callLinkInfo; + + return CallLinkStatus(callLinkInfo->lastSeenCallee.get(), false); +#else + return CallLinkStatus(0, false); +#endif +} + CallLinkStatus CallLinkStatus::computeFor(CodeBlock* profiledBlock, unsigned bytecodeIndex) { UNUSED_PARAM(profiledBlock); UNUSED_PARAM(bytecodeIndex); #if ENABLE(JIT) && ENABLE(VALUE_PROFILER) - return CallLinkStatus( - profiledBlock->getCallLinkInfo(bytecodeIndex).lastSeenCallee.get(), - profiledBlock->couldTakeSlowCase(bytecodeIndex)); + if (!profiledBlock->numberOfCallLinkInfos()) + return computeFromLLInt(profiledBlock, bytecodeIndex); + + if (profiledBlock->couldTakeSlowCase(bytecodeIndex)) + return CallLinkStatus(0, true); + + JSFunction* target = profiledBlock->getCallLinkInfo(bytecodeIndex).lastSeenCallee.get(); + if (!target) + return computeFromLLInt(profiledBlock, bytecodeIndex); + + return CallLinkStatus(target, false); #else return CallLinkStatus(0, false); #endif |