Changeset 34065 in webkit for trunk/JavaScriptCore/VM/Machine.cpp
- Timestamp:
- May 23, 2008, 1:56:21 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/Machine.cpp
r34037 r34065 438 438 } 439 439 440 static NEVER_INLINE JSValue* callEval(ExecState* exec, JSObject* thisObj, ScopeChainNode* scopeChain, RegisterFile* registerFile, Register* r, int argv, int argc, JSValue*& exceptionValue) 441 { 440 442 #if JAVASCRIPT_PROFILING 441 static NEVER_INLINE JSValue* callEval(ExecState* exec, JSObject* evalFunction, JSObject* thisObj, ScopeChainNode* scopeChain, RegisterFile* registerFile, Register* r, int argv, int argc, JSValue*& exceptionValue) 442 { 443 Profiler::profiler()->willExecute(exec, evalFunction); 444 #else 445 static NEVER_INLINE JSValue* callEval(ExecState* exec, JSObject* thisObj, ScopeChainNode* scopeChain, RegisterFile* registerFile, Register* r, int argv, int argc, JSValue*& exceptionValue) 446 { 443 Profiler** profiler = Profiler::enabledProfilerReference(); 444 JSObject* evalFunction = scopeChain->globalObject()->evalFunction(); 445 if (*profiler) 446 (*profiler)->willExecute(exec, evalFunction); 447 447 #endif 448 448 … … 472 472 JSValue* result = machine().execute(evalNode.get(), exec, thisObj, registerFile, r - (*registerFile->basePointer()) + argv + argc, scopeChain, &exceptionValue); 473 473 474 Profiler::profiler()->didExecute(exec, evalFunction); 474 if ((*profiler)) 475 (*profiler)->didExecute(exec, evalFunction); 475 476 476 477 return result; … … 608 609 609 610 #if JAVASCRIPT_PROFILING 610 Profiler::profiler()->didExecute(exec, callFrame[Callee].u.jsObject); 611 if (Profiler* profiler = *Profiler::enabledProfilerReference()) 612 profiler->didExecute(exec, callFrame[Callee].u.jsObject); 611 613 #endif 612 614 return true; … … 658 660 } 659 661 660 #if JAVASCRIPT_PROFILING661 Profiler::profiler()->willExecute(exec, programNode->sourceURL(), programNode->lineNo());662 #endif663 664 662 RegisterFile* registerFile = registerFileStack->pushGlobalRegisterFile(); 665 663 ASSERT(registerFile->numGlobalSlots()); … … 674 672 if (codeBlock->needsFullScopeChain) 675 673 scopeChain = scopeChain->copy(); 676 674 675 #if JAVASCRIPT_PROFILING 676 Profiler** profiler = Profiler::enabledProfilerReference(); 677 if (*profiler) 678 (*profiler)->willExecute(exec, programNode->sourceURL(), programNode->lineNo()); 679 #endif 680 677 681 ExecState newExec(exec, this, registerFile, scopeChain, -1); 678 682 … … 684 688 685 689 #if JAVASCRIPT_PROFILING 686 Profiler::profiler()->didExecute(exec, programNode->sourceURL(), programNode->lineNo()); 690 if (*profiler) 691 (*profiler)->didExecute(exec, programNode->sourceURL(), programNode->lineNo()); 687 692 #endif 688 693 … … 696 701 return 0; 697 702 } 698 699 #if JAVASCRIPT_PROFILING700 Profiler::profiler()->willExecute(exec, function);701 #endif702 703 703 704 RegisterFile* registerFile = registerFileStack->current(); … … 738 739 739 740 ExecState newExec(exec, this, registerFile, scopeChain, callFrameOffset); 741 742 #if JAVASCRIPT_PROFILING 743 Profiler** profiler = Profiler::enabledProfilerReference(); 744 if (*profiler) 745 (*profiler)->willExecute(exec, function); 746 #endif 740 747 741 748 m_reentryDepth++; … … 743 750 m_reentryDepth--; 744 751 752 #if JAVASCRIPT_PROFILING 753 if (*profiler) 754 (*profiler)->didExecute(exec, function); 755 #endif 745 756 registerFile->shrink(oldSize); 746 757 return result; … … 753 764 return 0; 754 765 } 755 756 #if JAVASCRIPT_PROFILING757 Profiler::profiler()->willExecute(exec, evalNode->sourceURL(), evalNode->lineNo());758 #endif759 766 760 767 EvalCodeBlock* codeBlock = &evalNode->code(scopeChain); … … 798 805 scopeChain = scopeChain->copy(); 799 806 807 #if JAVASCRIPT_PROFILING 808 Profiler** profiler = Profiler::enabledProfilerReference(); 809 if (*profiler) 810 (*profiler)->willExecute(exec, evalNode->sourceURL(), evalNode->lineNo()); 811 #endif 812 800 813 ExecState newExec(exec, this, registerFile, scopeChain, -1); 801 814 … … 807 820 808 821 #if JAVASCRIPT_PROFILING 809 Profiler::profiler()->didExecute(exec, evalNode->sourceURL(), evalNode->lineNo()); 822 if (*profiler) 823 (*profiler)->didExecute(exec, evalNode->sourceURL(), evalNode->lineNo()); 810 824 #endif 811 825 … … 880 894 JSValue* exceptionValue = 0; 881 895 Instruction* handlerVPC = 0; 882 896 883 897 Register** registerBase = registerFile->basePointer(); 884 898 Instruction* vPC = codeBlock->instructions.begin(); 885 899 JSValue** k = codeBlock->jsValues.data(); 900 #if JAVASCRIPT_PROFILING 901 Profiler** enabledProfilerReference = Profiler::enabledProfilerReference(); 902 903 #if HAVE(COMPUTED_GOTO) 904 // Yet another hack around GCC's various foibles, in this case fetching the 905 // profiler reference results in a regression. Removing this indirection 906 // results in a 0.8% regression. 907 goto *(&&profilerFetchHack); 908 profilerFetchHack: 909 #endif 910 911 #endif 886 912 887 913 registerFile->setSafeForReentry(false); … … 1856 1882 1857 1883 registerFile->setSafeForReentry(true); 1858 #if JAVASCRIPT_PROFILING 1859 JSValue* result = callEval(exec, static_cast<JSObject*>(funcVal), thisObject, scopeChain, registerFile, r, argv, argc, exceptionValue); 1860 #else 1884 1861 1885 JSValue* result = callEval(exec, thisObject, scopeChain, registerFile, r, argv, argc, exceptionValue); 1862 #endif 1886 1863 1887 registerFile->setSafeForReentry(false); 1864 1888 r = (*registerBase) + registerOffset; … … 1901 1925 if (callType == CallTypeJS) { 1902 1926 #if JAVASCRIPT_PROFILING 1903 Profiler::profiler()->willExecute(exec, static_cast<JSObject*>(v)); 1927 if (*enabledProfilerReference) 1928 (*enabledProfilerReference)->willExecute(exec, static_cast<JSObject*>(v)); 1904 1929 #endif 1905 1930 int registerOffset = r - (*registerBase); … … 1929 1954 if (callType == CallTypeNative) { 1930 1955 #if JAVASCRIPT_PROFILING 1931 Profiler::profiler()->willExecute(exec, static_cast<JSObject*>(v)); 1956 if (*enabledProfilerReference) 1957 (*enabledProfilerReference)->willExecute(exec, static_cast<JSObject*>(v)); 1932 1958 #endif 1933 1959 int registerOffset = r - (*registerBase); … … 1946 1972 1947 1973 #if JAVASCRIPT_PROFILING 1948 Profiler::profiler()->didExecute(exec, static_cast<JSObject*>(v)); 1974 if (*enabledProfilerReference) 1975 (*enabledProfilerReference)->didExecute(exec, static_cast<JSObject*>(v)); 1949 1976 #endif 1950 1977 VM_CHECK_EXCEPTION(); … … 1995 2022 1996 2023 #if JAVASCRIPT_PROFILING 1997 Profiler::profiler()->didExecute(exec, callFrame[Callee].u.jsObject); 2024 if (*enabledProfilerReference) 2025 (*enabledProfilerReference)->didExecute(exec, callFrame[Callee].u.jsObject); 1998 2026 #endif 1999 2027 NEXT_OPCODE; … … 2015 2043 if (constructType == ConstructTypeJS) { 2016 2044 #if JAVASCRIPT_PROFILING 2017 Profiler::profiler()->willExecute(exec, constructor); 2045 if (*enabledProfilerReference) 2046 (*enabledProfilerReference)->willExecute(exec, constructor); 2018 2047 #endif 2019 2048 int registerOffset = r - (*registerBase); … … 2051 2080 if (constructType == ConstructTypeNative) { 2052 2081 #if JAVASCRIPT_PROFILING 2053 Profiler::profiler()->willExecute(exec, constructor); 2082 if (*enabledProfilerReference) 2083 (*enabledProfilerReference)->willExecute(exec, constructor); 2054 2084 #endif 2055 2085 int registerOffset = r - (*registerBase); … … 2065 2095 2066 2096 #if JAVASCRIPT_PROFILING 2067 Profiler::profiler()->didExecute(exec, constructor); 2097 if (*enabledProfilerReference) 2098 (*enabledProfilerReference)->didExecute(exec, constructor); 2068 2099 #endif 2069 2100 ++vPC;
Note:
See TracChangeset
for help on using the changeset viewer.