Changeset 63267 in webkit for trunk/JavaScriptCore/interpreter
- Timestamp:
- Jul 13, 2010, 5:27:13 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r63056 r63267 548 548 549 549 codeBlock = callerFrame->codeBlock(); 550 #if ENABLE(JIT) 551 #if ENABLE(INTERPRETER) 550 #if ENABLE(JIT) && ENABLE(INTERPRETER) 552 551 if (callerFrame->globalData().canUseJIT()) 553 #endif554 552 bytecodeOffset = codeBlock->bytecodeOffset(callerFrame, callFrame->returnPC()); 555 #if ENABLE(INTERPRETER)556 553 else 557 554 bytecodeOffset = codeBlock->bytecodeOffset(callerFrame, callFrame->returnVPC()); 558 #endif 555 #elif ENABLE(JIT) 556 bytecodeOffset = codeBlock->bytecodeOffset(callerFrame, callFrame->returnPC()); 559 557 #else 560 558 bytecodeOffset = codeBlock->bytecodeOffset(callerFrame, callFrame->returnVPC()); 561 559 #endif 560 562 561 callFrame = callerFrame; 563 562 return true; … … 661 660 } 662 661 663 CodeBlock* codeBlock = &program->bytecode(callFrame, scopeChain);664 if ( !codeBlock) {665 *exception = createStackOverflowError(callFrame);662 JSObject* error = program->compile(callFrame, scopeChain); 663 if (error) { 664 *exception = error; 666 665 return jsNull(); 667 666 } 667 CodeBlock* codeBlock = &program->generatedBytecode(); 668 668 669 669 Register* oldEnd = m_registerFile.end(); … … 698 698 m_reentryDepth++; 699 699 #if ENABLE(JIT) 700 #if ENABLE(INTERPRETER)701 700 if (callFrame->globalData().canUseJIT()) 702 #endif 703 result = program->jitCode(newCallFrame, scopeChain).execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception); 704 #if ENABLE(INTERPRETER) 701 result = program->generatedJITCode().execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception); 705 702 else 706 703 #endif 707 #endif708 #if ENABLE(INTERPRETER)709 704 result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); 710 #endif711 705 712 706 m_reentryDepth--; … … 753 747 if (callType == CallTypeJS) { 754 748 ScopeChainNode* callDataScopeChain = callData.js.scopeChain; 755 CodeBlock* newCodeBlock = callData.js.functionExecutable->bytecodeForCall(callFrame, callDataScopeChain); 756 757 if (newCodeBlock) 758 newCallFrame = slideRegisterWindowForCall(newCodeBlock, &m_registerFile, newCallFrame, registerOffset, argCount); 759 else 760 newCallFrame = 0; 749 750 JSObject* compileError = callData.js.functionExecutable->compileForCall(callFrame, callDataScopeChain); 751 if (UNLIKELY(!!compileError)) { 752 *exception = compileError; 753 m_registerFile.shrink(oldEnd); 754 return jsNull(); 755 } 756 757 CodeBlock* newCodeBlock = &callData.js.functionExecutable->generatedBytecodeForCall(); 758 newCallFrame = slideRegisterWindowForCall(newCodeBlock, &m_registerFile, newCallFrame, registerOffset, argCount); 761 759 if (UNLIKELY(!newCallFrame)) { 762 760 *exception = createStackOverflowError(callFrame); … … 779 777 m_reentryDepth++; 780 778 #if ENABLE(JIT) 781 #if ENABLE(INTERPRETER)782 779 if (callFrame->globalData().canUseJIT()) 783 #endif 784 result = callData.js.functionExecutable->jitCodeForCall(newCallFrame, callDataScopeChain).execute(&m_registerFile, newCallFrame, callDataScopeChain->globalData, exception); 785 #if ENABLE(INTERPRETER) 780 result = callData.js.functionExecutable->generatedJITCodeForCall().execute(&m_registerFile, newCallFrame, callDataScopeChain->globalData, exception); 786 781 else 787 782 #endif 788 #endif789 #if ENABLE(INTERPRETER)790 783 result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); 791 #endif792 784 m_reentryDepth--; 793 785 } … … 852 844 if (constructType == ConstructTypeJS) { 853 845 ScopeChainNode* constructDataScopeChain = constructData.js.scopeChain; 854 CodeBlock* newCodeBlock = constructData.js.functionExecutable->bytecodeForConstruct(callFrame, constructDataScopeChain); 855 if (newCodeBlock) 856 newCallFrame = slideRegisterWindowForCall(newCodeBlock, &m_registerFile, newCallFrame, registerOffset, argCount); 857 else 858 newCallFrame = 0; 859 846 847 JSObject* compileError = constructData.js.functionExecutable->compileForConstruct(callFrame, constructDataScopeChain); 848 if (UNLIKELY(!!compileError)) { 849 *exception = compileError; 850 m_registerFile.shrink(oldEnd); 851 return 0; 852 } 853 854 CodeBlock* newCodeBlock = &constructData.js.functionExecutable->generatedBytecodeForConstruct(); 855 newCallFrame = slideRegisterWindowForCall(newCodeBlock, &m_registerFile, newCallFrame, registerOffset, argCount); 860 856 if (UNLIKELY(!newCallFrame)) { 861 857 *exception = createStackOverflowError(callFrame); … … 878 874 m_reentryDepth++; 879 875 #if ENABLE(JIT) 880 #if ENABLE(INTERPRETER)881 876 if (callFrame->globalData().canUseJIT()) 882 #endif 883 result = constructData.js.functionExecutable->jitCodeForConstruct(newCallFrame, constructDataScopeChain).execute(&m_registerFile, newCallFrame, constructDataScopeChain->globalData, exception); 884 #if ENABLE(INTERPRETER) 877 result = constructData.js.functionExecutable->generatedJITCodeForConstruct().execute(&m_registerFile, newCallFrame, constructDataScopeChain->globalData, exception); 885 878 else 886 879 #endif 887 #endif888 #if ENABLE(INTERPRETER)889 880 result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); 890 #endif891 881 m_reentryDepth--; 892 882 } … … 953 943 newCallFrame->r(++dst) = jsUndefined(); 954 944 955 CodeBlock* codeBlock = FunctionExecutable->bytecodeForCall(callFrame, scopeChain); 956 if (codeBlock) 957 newCallFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc); 958 else 959 newCallFrame = 0; 945 JSObject* error = FunctionExecutable->compileForCall(callFrame, scopeChain); 946 if (error) { 947 *exception = error; 948 m_registerFile.shrink(oldEnd); 949 return CallFrameClosure(); 950 } 951 CodeBlock* codeBlock = &FunctionExecutable->generatedBytecodeForCall(); 952 953 newCallFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc); 960 954 if (UNLIKELY(!newCallFrame)) { 961 955 *exception = createStackOverflowError(callFrame); … … 965 959 // a 0 codeBlock indicates a built-in caller 966 960 newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), argc, function); 967 #if ENABLE(JIT)968 #if ENABLE(INTERPRETER)969 if (callFrame->globalData().canUseJIT())970 #endif971 FunctionExecutable->jitCodeForCall(newCallFrame, scopeChain);972 #endif973 961 CallFrameClosure result = { callFrame, newCallFrame, function, FunctionExecutable, scopeChain->globalData, oldEnd, scopeChain, codeBlock->m_numParameters, argc }; 974 962 return result; … … 1014 1002 JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue* exception) 1015 1003 { 1016 return execute(eval, callFrame, thisObj, m_registerFile.size() + eval->bytecode(callFrame, scopeChain).m_numParameters + RegisterFile::CallFrameHeaderSize, scopeChain, exception); 1004 JSObject* compileError = eval->compile(callFrame, scopeChain); 1005 if (UNLIKELY(!!compileError)) { 1006 *exception = compileError; 1007 return jsNull(); 1008 } 1009 return execute(eval, callFrame, thisObj, m_registerFile.size() + eval->generatedBytecode().m_numParameters + RegisterFile::CallFrameHeaderSize, scopeChain, exception); 1017 1010 } 1018 1011 … … 1030 1023 DynamicGlobalObjectScope globalObjectScope(callFrame, scopeChain->globalObject); 1031 1024 1032 EvalCodeBlock* codeBlock = &eval->bytecode(callFrame, scopeChain);1033 if ( !codeBlock) {1034 *exception = c reateStackOverflowError(callFrame);1025 JSObject* compileError = eval->compile(callFrame, scopeChain); 1026 if (UNLIKELY(!!compileError)) { 1027 *exception = compileError; 1035 1028 return jsNull(); 1036 1029 } 1030 EvalCodeBlock* codeBlock = &eval->generatedBytecode(); 1037 1031 1038 1032 JSVariableObject* variableObject; … … 1097 1091 if (callFrame->globalData().canUseJIT()) 1098 1092 #endif 1099 result = eval-> jitCode(newCallFrame, scopeChain).execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception);1093 result = eval->generatedJITCode().execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception); 1100 1094 #if ENABLE(INTERPRETER) 1101 1095 else … … 3713 3707 if (callType == CallTypeJS) { 3714 3708 ScopeChainNode* callDataScopeChain = callData.js.scopeChain; 3715 CodeBlock* newCodeBlock = callData.js.functionExecutable->bytecodeForCall(callFrame, callDataScopeChain); 3709 3710 JSObject* error = callData.js.functionExecutable->compileForCall(callFrame, callDataScopeChain); 3711 if (UNLIKELY(!!error)) { 3712 exceptionValue = error; 3713 goto vm_throw; 3714 } 3716 3715 3717 3716 CallFrame* previousCallFrame = callFrame; 3718 if (newCodeBlock) 3719 callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount); 3720 else 3721 callFrame = 0; 3717 CodeBlock* newCodeBlock = &callData.js.functionExecutable->generatedBytecodeForCall(); 3718 callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount); 3722 3719 if (UNLIKELY(!callFrame)) { 3723 3720 callFrame = previousCallFrame; … … 3871 3868 if (callType == CallTypeJS) { 3872 3869 ScopeChainNode* callDataScopeChain = callData.js.scopeChain; 3873 CodeBlock* newCodeBlock = callData.js.functionExecutable->bytecodeForCall(callFrame, callDataScopeChain); 3874 3870 3871 JSObject* error = callData.js.functionExecutable->compileForCall(callFrame, callDataScopeChain); 3872 if (UNLIKELY(!!error)) { 3873 exceptionValue = error; 3874 goto vm_throw; 3875 } 3876 3875 3877 CallFrame* previousCallFrame = callFrame; 3876 if (newCodeBlock) 3877 callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount); 3878 else 3879 callFrame = 0; 3878 CodeBlock* newCodeBlock = &callData.js.functionExecutable->generatedBytecodeForCall(); 3879 callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount); 3880 3880 if (UNLIKELY(!callFrame)) { 3881 3881 callFrame = previousCallFrame; … … 3883 3883 goto vm_throw; 3884 3884 } 3885 3885 3886 3886 callFrame->init(newCodeBlock, vPC + OPCODE_LENGTH(op_call_varargs), callDataScopeChain, previousCallFrame, argCount, asFunction(v)); 3887 3887 codeBlock = newCodeBlock; … … 4196 4196 if (constructType == ConstructTypeJS) { 4197 4197 ScopeChainNode* callDataScopeChain = constructData.js.scopeChain; 4198 CodeBlock* newCodeBlock = constructData.js.functionExecutable->bytecodeForConstruct(callFrame, callDataScopeChain); 4198 4199 JSObject* error = constructData.js.functionExecutable->compileForConstruct(callFrame, callDataScopeChain); 4200 if (UNLIKELY(!!error)) { 4201 exceptionValue = error; 4202 goto vm_throw; 4203 } 4199 4204 4200 4205 CallFrame* previousCallFrame = callFrame; 4201 4202 if (newCodeBlock) 4203 callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount); 4204 else 4205 callFrame = 0; 4206 4206 CodeBlock* newCodeBlock = &constructData.js.functionExecutable->generatedBytecodeForConstruct(); 4207 callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount); 4207 4208 if (UNLIKELY(!callFrame)) { 4208 4209 callFrame = previousCallFrame;
Note:
See TracChangeset
for help on using the changeset viewer.