Changeset 59339 in webkit for trunk/JavaScriptCore/interpreter
- Timestamp:
- May 12, 2010, 9:01:56 PM (15 years ago)
- Location:
- trunk/JavaScriptCore/interpreter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r59064 r59339 708 708 } 709 709 710 JSValue Interpreter::execute (FunctionExecutable* functionExecutable, CallFrame* callFrame, JSFunction* function, JSObject* thisObj, const ArgList& args, ScopeChainNode* scopeChain, JSValue* exception)710 JSValue Interpreter::executeCall(FunctionExecutable* functionExecutable, CallFrame* callFrame, JSFunction* function, JSObject* thisObj, const ArgList& args, ScopeChainNode* scopeChain, JSValue* exception) 711 711 { 712 712 ASSERT(!scopeChain->globalData->exception); … … 736 736 newCallFrame->r(++dst) = *it; 737 737 738 CodeBlock* codeBlock = &functionExecutable->bytecode (callFrame, scopeChain);738 CodeBlock* codeBlock = &functionExecutable->bytecodeForCall(callFrame, scopeChain); 739 739 newCallFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc); 740 740 if (UNLIKELY(!newCallFrame)) { … … 756 756 m_reentryDepth++; 757 757 #if ENABLE(JIT) 758 result = functionExecutable->jitCode(newCallFrame, scopeChain).execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception); 758 result = functionExecutable->jitCodeForCall(newCallFrame, scopeChain).execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception); 759 #else 760 result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); 761 #endif 762 m_reentryDepth--; 763 } 764 765 if (*profiler) 766 (*profiler)->didExecute(callFrame, function); 767 768 m_registerFile.shrink(oldEnd); 769 return result; 770 } 771 772 JSValue Interpreter::executeConstruct(FunctionExecutable* functionExecutable, CallFrame* callFrame, JSFunction* function, JSObject* thisObj, const ArgList& args, ScopeChainNode* scopeChain, JSValue* exception) 773 { 774 ASSERT(!scopeChain->globalData->exception); 775 776 if (m_reentryDepth >= MaxSmallThreadReentryDepth) { 777 if (m_reentryDepth >= callFrame->globalData().maxReentryDepth) { 778 *exception = createStackOverflowError(callFrame); 779 return jsNull(); 780 } 781 } 782 783 Register* oldEnd = m_registerFile.end(); 784 int argc = 1 + args.size(); // implicit "this" parameter 785 786 if (!m_registerFile.grow(oldEnd + argc)) { 787 *exception = createStackOverflowError(callFrame); 788 return jsNull(); 789 } 790 791 DynamicGlobalObjectScope globalObjectScope(callFrame, scopeChain->globalObject); 792 793 CallFrame* newCallFrame = CallFrame::create(oldEnd); 794 size_t dst = 0; 795 newCallFrame->r(0) = JSValue(thisObj); 796 ArgList::const_iterator end = args.end(); 797 for (ArgList::const_iterator it = args.begin(); it != end; ++it) 798 newCallFrame->r(++dst) = *it; 799 800 CodeBlock* codeBlock = &functionExecutable->bytecodeForConstruct(callFrame, scopeChain); 801 newCallFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc); 802 if (UNLIKELY(!newCallFrame)) { 803 *exception = createStackOverflowError(callFrame); 804 m_registerFile.shrink(oldEnd); 805 return jsNull(); 806 } 807 // a 0 codeBlock indicates a built-in caller 808 newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), 0, argc, function); 809 810 Profiler** profiler = Profiler::enabledProfilerReference(); 811 if (*profiler) 812 (*profiler)->willExecute(callFrame, function); 813 814 JSValue result; 815 { 816 SamplingTool::CallRecord callRecord(m_sampler.get()); 817 818 m_reentryDepth++; 819 #if ENABLE(JIT) 820 result = functionExecutable->jitCodeForConstruct(newCallFrame, scopeChain).execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception); 759 821 #else 760 822 result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); … … 794 856 newCallFrame->r(++dst) = jsUndefined(); 795 857 796 CodeBlock* codeBlock = &FunctionExecutable->bytecode (callFrame, scopeChain);858 CodeBlock* codeBlock = &FunctionExecutable->bytecodeForCall(callFrame, scopeChain); 797 859 newCallFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc); 798 860 if (UNLIKELY(!newCallFrame)) { … … 804 866 newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), 0, argc, function); 805 867 #if ENABLE(JIT) 806 FunctionExecutable->jitCode (newCallFrame, scopeChain);868 FunctionExecutable->jitCodeForCall(newCallFrame, scopeChain); 807 869 #endif 808 870 … … 824 886 m_reentryDepth++; 825 887 #if ENABLE(JIT) 826 result = closure.functionExecutable->generatedJITCode ().execute(&m_registerFile, closure.newCallFrame, closure.globalData, exception);888 result = closure.functionExecutable->generatedJITCodeForCall().execute(&m_registerFile, closure.newCallFrame, closure.globalData, exception); 827 889 #else 828 890 result = privateExecute(Normal, &m_registerFile, closure.newCallFrame, exception); … … 3508 3570 if (callType == CallTypeJS) { 3509 3571 ScopeChainNode* callDataScopeChain = callData.js.scopeChain; 3510 CodeBlock* newCodeBlock = &callData.js.functionExecutable->bytecode (callFrame, callDataScopeChain);3572 CodeBlock* newCodeBlock = &callData.js.functionExecutable->bytecodeForCall(callFrame, callDataScopeChain); 3511 3573 3512 3574 CallFrame* previousCallFrame = callFrame; … … 3662 3724 if (callType == CallTypeJS) { 3663 3725 ScopeChainNode* callDataScopeChain = callData.js.scopeChain; 3664 CodeBlock* newCodeBlock = &callData.js.functionExecutable->bytecode (callFrame, callDataScopeChain);3726 CodeBlock* newCodeBlock = &callData.js.functionExecutable->bytecodeForCall(callFrame, callDataScopeChain); 3665 3727 3666 3728 CallFrame* previousCallFrame = callFrame; … … 3910 3972 if (constructType == ConstructTypeJS) { 3911 3973 ScopeChainNode* callDataScopeChain = constructData.js.scopeChain; 3912 CodeBlock* newCodeBlock = &constructData.js.functionExecutable->bytecode (callFrame, callDataScopeChain);3974 CodeBlock* newCodeBlock = &constructData.js.functionExecutable->bytecodeForConstruct(callFrame, callDataScopeChain); 3913 3975 3914 3976 Structure* structure; -
trunk/JavaScriptCore/interpreter/Interpreter.h
r58986 r59339 97 97 98 98 JSValue execute(ProgramExecutable*, CallFrame*, ScopeChainNode*, JSObject* thisObj, JSValue* exception); 99 JSValue execute(FunctionExecutable*, CallFrame*, JSFunction*, JSObject* thisObj, const ArgList& args, ScopeChainNode*, JSValue* exception); 99 JSValue executeCall(FunctionExecutable*, CallFrame*, JSFunction*, JSObject* thisObj, const ArgList& args, ScopeChainNode*, JSValue* exception); 100 JSValue executeConstruct(FunctionExecutable*, CallFrame*, JSFunction*, JSObject* thisObj, const ArgList& args, ScopeChainNode*, JSValue* exception); 100 101 JSValue execute(EvalExecutable* evalNode, CallFrame* exec, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue* exception); 101 102
Note:
See TracChangeset
for help on using the changeset viewer.