Changeset 62612 in webkit
- Timestamp:
- Jul 6, 2010 6:35:56 PM (14 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r62551 r62612 1 2010-07-06 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 Make it possible to have both the JIT and Interpreter available in a single build 6 https://bugs.webkit.org/show_bug.cgi?id=41722 7 8 Separate the concept of !ENABLE(JIT) and ENABLE(INTERPRETER) and make it possible 9 to have both JIT and INTERPRETER enabled at the same time. This doesn't add 10 support for mix mode execution, but it does allow a single build to contain all 11 the code needed to use either the interpreter or the jit. 12 13 If both ENABLE(INTERPRETER) and ENABLE(JIT) are true then setting the environment 14 variable JSC_FORCE_INTERPRETER will force JSC to use the interpreter. 15 16 This patch basically consists of replacing !ENABLE(JIT) with ENABLE(INTERPRETER), 17 or converting #if ENABLE(JIT) ... #else ... into #if ENABLE(JIT) ... #endif 18 #if ENABLE(INTERPRETER), etc. There are also a few functions that need to be 19 renamed to resolve return type ambiguity. 20 21 * bytecode/CodeBlock.cpp: 22 (JSC::CodeBlock::~CodeBlock): 23 (JSC::CodeBlock::shrinkToFit): 24 * bytecode/CodeBlock.h: 25 * interpreter/CallFrame.h: 26 (JSC::ExecState::returnVPC): 27 * interpreter/Interpreter.cpp: 28 (JSC::Interpreter::unwindCallFrame): 29 (JSC::Interpreter::throwException): 30 (JSC::Interpreter::execute): 31 (JSC::Interpreter::executeCall): 32 (JSC::Interpreter::executeConstruct): 33 (JSC::Interpreter::prepareForRepeatCall): 34 (JSC::Interpreter::privateExecute): 35 (JSC::Interpreter::retrieveLastCaller): 36 * interpreter/Interpreter.h: 37 * runtime/ArrayPrototype.cpp: 38 (JSC::isNumericCompareFunction): 39 * runtime/Executable.cpp: 40 (JSC::EvalExecutable::generateJITCode): 41 (JSC::ProgramExecutable::generateJITCode): 42 (JSC::FunctionExecutable::generateJITCodeForCall): 43 (JSC::FunctionExecutable::generateJITCodeForConstruct): 44 (JSC::FunctionExecutable::reparseExceptionInfo): 45 (JSC::EvalExecutable::reparseExceptionInfo): 46 * runtime/JSFunction.cpp: 47 * runtime/JSGlobalData.cpp: 48 (JSC::JSGlobalData::JSGlobalData): 49 * runtime/JSGlobalData.h: 50 (JSC::JSGlobalData::canUseJIT): 51 * wtf/Platform.h: 52 1 53 2010-07-06 Darin Adler <darin@apple.com> 2 54 -
trunk/JavaScriptCore/bytecode/CodeBlock.cpp
r62551 r62612 1374 1374 CodeBlock::~CodeBlock() 1375 1375 { 1376 #if !ENABLE(JIT)1376 #if ENABLE(INTERPRETER) 1377 1377 for (size_t size = m_globalResolveInstructions.size(), i = 0; i < size; ++i) 1378 1378 derefStructures(&m_instructions[m_globalResolveInstructions[i]]); … … 1380 1380 for (size_t size = m_propertyAccessInstructions.size(), i = 0; i < size; ++i) 1381 1381 derefStructures(&m_instructions[m_propertyAccessInstructions[i]]); 1382 #else 1382 #endif 1383 #if ENABLE(JIT) 1383 1384 for (size_t size = m_globalResolveInfos.size(), i = 0; i < size; ++i) { 1384 1385 if (m_globalResolveInfos[i].structure) … … 1408 1409 #endif 1409 1410 1410 #endif // !ENABLE(JIT)1411 #endif // ENABLE(JIT) 1411 1412 1412 1413 #if DUMP_CODE_BLOCK_STATISTICS … … 1670 1671 #endif 1671 1672 1672 #if !ENABLE(JIT)1673 #if ENABLE(INTERPRETER) 1673 1674 bool CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset(unsigned bytecodeOffset) 1674 1675 { … … 1690 1691 return true; 1691 1692 } 1692 #else 1693 #endif 1694 #if ENABLE(JIT) 1693 1695 bool CodeBlock::hasGlobalResolveInfoAtBytecodeOffset(unsigned bytecodeOffset) 1694 1696 { … … 1716 1718 m_instructions.shrinkToFit(); 1717 1719 1718 #if !ENABLE(JIT)1720 #if ENABLE(INTERPRETER) 1719 1721 m_propertyAccessInstructions.shrinkToFit(); 1720 1722 m_globalResolveInstructions.shrinkToFit(); 1721 #else 1723 #endif 1724 #if ENABLE(JIT) 1722 1725 m_structureStubInfos.shrinkToFit(); 1723 1726 m_globalResolveInfos.shrinkToFit(); -
trunk/JavaScriptCore/bytecode/CodeBlock.h
r62551 r62612 359 359 360 360 bool functionRegisterForBytecodeOffset(unsigned bytecodeOffset, int& functionRegisterIndex); 361 #else 361 #endif 362 #if ENABLE(INTERPRETER) 362 363 unsigned bytecodeOffset(CallFrame*, Instruction* returnAddress) 363 364 { … … 417 418 unsigned lastJumpTarget() const { return m_jumpTargets.last(); } 418 419 419 #if !ENABLE(JIT)420 #if ENABLE(INTERPRETER) 420 421 void addPropertyAccessInstruction(unsigned propertyAccessInstruction) { m_propertyAccessInstructions.append(propertyAccessInstruction); } 421 422 void addGlobalResolveInstruction(unsigned globalResolveInstruction) { m_globalResolveInstructions.append(globalResolveInstruction); } 422 423 bool hasGlobalResolveInstructionAtBytecodeOffset(unsigned bytecodeOffset); 423 #else 424 #endif 425 #if ENABLE(JIT) 424 426 size_t numberOfStructureStubInfos() const { return m_structureStubInfos.size(); } 425 427 void addStructureStubInfo(const StructureStubInfo& stubInfo) { m_structureStubInfos.append(stubInfo); } … … 552 554 unsigned m_sourceOffset; 553 555 554 #if !ENABLE(JIT)556 #if ENABLE(INTERPRETER) 555 557 Vector<unsigned> m_propertyAccessInstructions; 556 558 Vector<unsigned> m_globalResolveInstructions; 557 #else 559 #endif 560 #if ENABLE(JIT) 558 561 Vector<StructureStubInfo> m_structureStubInfos; 559 562 Vector<GlobalResolveInfo> m_globalResolveInfos; -
trunk/JavaScriptCore/interpreter/CallFrame.h
r61553 r62612 107 107 #if ENABLE(JIT) 108 108 ReturnAddressPtr returnPC() const { return ReturnAddressPtr(this[RegisterFile::ReturnPC].vPC()); } 109 #else 110 Instruction* returnPC() const { return this[RegisterFile::ReturnPC].vPC(); } 109 #endif 110 #if ENABLE(INTERPRETER) 111 Instruction* returnVPC() const { return this[RegisterFile::ReturnPC].vPC(); } 111 112 #endif 112 113 -
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r62464 r62612 80 80 } 81 81 82 #if !ENABLE(JIT)82 #if ENABLE(INTERPRETER) 83 83 NEVER_INLINE bool Interpreter::resolve(CallFrame* callFrame, Instruction* vPC, JSValue& exceptionValue) 84 84 { … … 295 295 } 296 296 297 #endif // !ENABLE(JIT)297 #endif // ENABLE(INTERPRETER) 298 298 299 299 ALWAYS_INLINE CallFrame* Interpreter::slideRegisterWindowForCall(CodeBlock* newCodeBlock, RegisterFile* registerFile, CallFrame* callFrame, size_t registerOffset, int argc) … … 334 334 } 335 335 336 #if !ENABLE(JIT)336 #if ENABLE(INTERPRETER) 337 337 static NEVER_INLINE bool isInvalidParamForIn(CallFrame* callFrame, CodeBlock* codeBlock, const Instruction* vPC, JSValue value, JSValue& exceptionData) 338 338 { … … 548 548 549 549 codeBlock = callerFrame->codeBlock(); 550 bytecodeOffset = codeBlock->bytecodeOffset(callerFrame, callFrame->returnPC()); 550 #if ENABLE(JIT) 551 #if ENABLE(INTERPRETER) 552 if (callerFrame->globalData().canUseJIT()) 553 #endif 554 bytecodeOffset = codeBlock->bytecodeOffset(callerFrame, callFrame->returnPC()); 555 #if ENABLE(INTERPRETER) 556 else 557 bytecodeOffset = codeBlock->bytecodeOffset(callerFrame, callFrame->returnVPC()); 558 #endif 559 #else 560 bytecodeOffset = codeBlock->bytecodeOffset(callerFrame, callFrame->returnVPC()); 561 #endif 551 562 callFrame = callerFrame; 552 563 return true; … … 595 606 // we'll never reach the relevant op_profile_did_call. 596 607 if (Profiler* profiler = *Profiler::enabledProfilerReference()) { 597 #if !ENABLE(JIT) 598 // FIXME: Why 8? - work out what this magic value is, replace the constant with something more helpful. 599 if (isCallBytecode(codeBlock->instructions()[bytecodeOffset].u.opcode)) 600 profiler->didExecute(callFrame, callFrame->r(codeBlock->instructions()[bytecodeOffset + 1].u.operand).jsValue()); 601 else if (codeBlock->instructions().size() > (bytecodeOffset + 8) && codeBlock->instructions()[bytecodeOffset + 8].u.opcode == getOpcode(op_construct)) 602 profiler->didExecute(callFrame, callFrame->r(codeBlock->instructions()[bytecodeOffset + 9].u.operand).jsValue()); 603 #else 604 int functionRegisterIndex; 605 if (codeBlock->functionRegisterForBytecodeOffset(bytecodeOffset, functionRegisterIndex)) 606 profiler->didExecute(callFrame, callFrame->r(functionRegisterIndex).jsValue()); 608 #if ENABLE(INTERPRETER) 609 if (!callFrame->globalData().canUseJIT()) { 610 // FIXME: Why 8? - work out what this magic value is, replace the constant with something more helpful. 611 if (isCallBytecode(codeBlock->instructions()[bytecodeOffset].u.opcode)) 612 profiler->didExecute(callFrame, callFrame->r(codeBlock->instructions()[bytecodeOffset + 1].u.operand).jsValue()); 613 else if (codeBlock->instructions().size() > (bytecodeOffset + 8) && codeBlock->instructions()[bytecodeOffset + 8].u.opcode == getOpcode(op_construct)) 614 profiler->didExecute(callFrame, callFrame->r(codeBlock->instructions()[bytecodeOffset + 9].u.operand).jsValue()); 615 } 616 #if ENABLE(JIT) 617 else 618 #endif 619 #endif 620 #if ENABLE(JIT) 621 { 622 int functionRegisterIndex; 623 if (codeBlock->functionRegisterForBytecodeOffset(bytecodeOffset, functionRegisterIndex)) 624 profiler->didExecute(callFrame, callFrame->r(functionRegisterIndex).jsValue()); 625 } 607 626 #endif 608 627 } … … 677 696 SamplingTool::CallRecord callRecord(m_sampler.get()); 678 697 679 m_reentryDepth++; 698 m_reentryDepth++; 680 699 #if ENABLE(JIT) 681 result = program->jitCode(newCallFrame, scopeChain).execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception); 682 #else 683 result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); 684 #endif 700 #if ENABLE(INTERPRETER) 701 if (callFrame->globalData().canUseJIT()) 702 #endif 703 result = program->jitCode(newCallFrame, scopeChain).execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception); 704 #if ENABLE(INTERPRETER) 705 else 706 #endif 707 #endif 708 #if ENABLE(INTERPRETER) 709 result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); 710 #endif 711 685 712 m_reentryDepth--; 686 713 } … … 750 777 SamplingTool::CallRecord callRecord(m_sampler.get()); 751 778 752 m_reentryDepth++; 753 #if ENABLE(JIT) 754 result = callData.js.functionExecutable->jitCodeForCall(newCallFrame, callDataScopeChain).execute(&m_registerFile, newCallFrame, callDataScopeChain->globalData, exception); 755 #else 756 result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); 757 #endif 779 m_reentryDepth++; 780 #if ENABLE(JIT) 781 #if ENABLE(INTERPRETER) 782 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) 786 else 787 #endif 788 #endif 789 #if ENABLE(INTERPRETER) 790 result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); 791 #endif 758 792 m_reentryDepth--; 759 793 } … … 842 876 SamplingTool::CallRecord callRecord(m_sampler.get()); 843 877 844 m_reentryDepth++; 845 #if ENABLE(JIT) 846 result = constructData.js.functionExecutable->jitCodeForConstruct(newCallFrame, constructDataScopeChain).execute(&m_registerFile, newCallFrame, constructDataScopeChain->globalData, exception); 847 #else 848 result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); 849 #endif 878 m_reentryDepth++; 879 #if ENABLE(JIT) 880 #if ENABLE(INTERPRETER) 881 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) 885 else 886 #endif 887 #endif 888 #if ENABLE(INTERPRETER) 889 result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); 890 #endif 850 891 m_reentryDepth--; 851 892 } … … 923 964 } 924 965 // a 0 codeBlock indicates a built-in caller 925 newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), argc, function); 966 newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), argc, function); 926 967 #if ENABLE(JIT) 927 FunctionExecutable->jitCodeForCall(newCallFrame, scopeChain); 928 #endif 929 968 #if ENABLE(INTERPRETER) 969 if (callFrame->globalData().canUseJIT()) 970 #endif 971 FunctionExecutable->jitCodeForCall(newCallFrame, scopeChain); 972 #endif 930 973 CallFrameClosure result = { callFrame, newCallFrame, function, FunctionExecutable, scopeChain->globalData, oldEnd, scopeChain, codeBlock->m_numParameters, argc }; 931 974 return result; … … 943 986 SamplingTool::CallRecord callRecord(m_sampler.get()); 944 987 945 m_reentryDepth++; 988 m_reentryDepth++; 946 989 #if ENABLE(JIT) 947 result = closure.functionExecutable->generatedJITCodeForCall().execute(&m_registerFile, closure.newCallFrame, closure.globalData, exception); 948 #else 949 result = privateExecute(Normal, &m_registerFile, closure.newCallFrame, exception); 990 #if ENABLE(INTERPRETER) 991 if (closure.newCallFrame->globalData().canUseJIT()) 992 #endif 993 result = closure.functionExecutable->generatedJITCodeForCall().execute(&m_registerFile, closure.newCallFrame, closure.globalData, exception); 994 #if ENABLE(INTERPRETER) 995 else 996 #endif 997 #endif 998 #if ENABLE(INTERPRETER) 999 result = privateExecute(Normal, &m_registerFile, closure.newCallFrame, exception); 950 1000 #endif 951 1001 m_reentryDepth--; … … 1042 1092 1043 1093 m_reentryDepth++; 1094 1044 1095 #if ENABLE(JIT) 1045 result = eval->jitCode(newCallFrame, scopeChain).execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception); 1046 #else 1047 result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); 1096 #if ENABLE(INTERPRETER) 1097 if (callFrame->globalData().canUseJIT()) 1098 #endif 1099 result = eval->jitCode(newCallFrame, scopeChain).execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception); 1100 #if ENABLE(INTERPRETER) 1101 else 1102 #endif 1103 #endif 1104 #if ENABLE(INTERPRETER) 1105 result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); 1048 1106 #endif 1049 1107 m_reentryDepth--; … … 1085 1143 } 1086 1144 1087 #if !ENABLE(JIT)1145 #if ENABLE(INTERPRETER) 1088 1146 NEVER_INLINE ScopeChainNode* Interpreter::createExceptionScope(CallFrame* callFrame, const Instruction* vPC) 1089 1147 { … … 1321 1379 } 1322 1380 1323 #endif // !ENABLE(JIT)1381 #endif // ENABLE(INTERPRETER) 1324 1382 1325 1383 JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFile, CallFrame* callFrame, JSValue* exception) … … 1337 1395 return JSValue(); 1338 1396 } 1339 1397 1340 1398 #if ENABLE(JIT) 1399 #if ENABLE(INTERPRETER) 1341 1400 // Mixing Interpreter + JIT is not supported. 1342 ASSERT_NOT_REACHED(); 1343 #endif 1344 #if !!ENABLE(JIT) 1401 if (callFrame->globalData().canUseJIT()) 1402 #endif 1403 ASSERT_NOT_REACHED(); 1404 #endif 1405 1406 #if !ENABLE(INTERPRETER) 1345 1407 UNUSED_PARAM(registerFile); 1346 1408 UNUSED_PARAM(callFrame); … … 3705 3767 } 3706 3768 ASSERT(!asFunction(callFrame->callee())->isHostFunction()); 3707 uint32_t expectedParams = asFunction(callFrame->callee())->jsExecutable()->parameterCount();3708 uint32_t inplaceArgs = min(argCount, expectedParams);3709 uint32_t i = 0;3769 int32_t expectedParams = asFunction(callFrame->callee())->jsExecutable()->parameterCount(); 3770 int32_t inplaceArgs = min(static_cast<int32_t>(argCount), expectedParams); 3771 int32_t i = 0; 3710 3772 Register* argStore = callFrame->registers() + argsOffset; 3711 3773 … … 3714 3776 argStore[i] = callFrame->registers()[i - RegisterFile::CallFrameHeaderSize - expectedParams]; 3715 3777 // Then we copy any additional arguments that may be further up the stack ('-1' to account for 'this') 3716 for (; i < argCount; i++)3778 for (; i < static_cast<int32_t>(argCount); i++) 3717 3779 argStore[i] = callFrame->registers()[i - RegisterFile::CallFrameHeaderSize - expectedParams - argCount - 1]; 3718 3780 } else if (!arguments.isUndefinedOrNull()) { … … 3908 3970 JSValue returnValue = callFrame->r(result).jsValue(); 3909 3971 3910 vPC = callFrame->return PC();3972 vPC = callFrame->returnVPC(); 3911 3973 callFrame = callFrame->callerFrame(); 3912 3974 … … 3952 4014 returnValue = callFrame->r(vPC[2].u.operand).jsValue(); 3953 4015 3954 vPC = callFrame->return PC();4016 vPC = callFrame->returnVPC(); 3955 4017 callFrame = callFrame->callerFrame(); 3956 4018 … … 4137 4199 codeBlock = newCodeBlock; 4138 4200 vPC = newCodeBlock->instructions().begin(); 4139 4140 4201 #if ENABLE(OPCODE_STATS) 4141 4202 OpcodeStats::resetLastInstruction(); … … 4537 4598 #undef CHECK_FOR_EXCEPTION 4538 4599 #undef CHECK_FOR_TIMEOUT 4539 #endif // !ENABLE(JIT)4600 #endif // ENABLE(INTERPRETER) 4540 4601 } 4541 4602 … … 4593 4654 if (!callerCodeBlock) 4594 4655 return; 4595 4596 unsigned bytecodeOffset = callerCodeBlock->bytecodeOffset(callerFrame, callFrame->returnPC()); 4656 unsigned bytecodeOffset = 0; 4657 #if ENABLE(INTERPRETER) 4658 if (!callerFrame->globalData().canUseJIT()) 4659 bytecodeOffset = callerCodeBlock->bytecodeOffset(callerFrame, callFrame->returnVPC()); 4660 #if ENABLE(JIT) 4661 else 4662 bytecodeOffset = callerCodeBlock->bytecodeOffset(callerFrame, callFrame->returnPC()); 4663 #endif 4664 #else 4665 bytecodeOffset = callerCodeBlock->bytecodeOffset(callerFrame, callFrame->returnPC()); 4666 #endif 4597 4667 lineNumber = callerCodeBlock->lineNumberForBytecodeOffset(callerFrame, bytecodeOffset - 1); 4598 4668 sourceID = callerCodeBlock->ownerExecutable()->sourceID(); -
trunk/JavaScriptCore/interpreter/Interpreter.h
r60708 r62612 124 124 JSValue execute(EvalExecutable*, CallFrame*, JSObject* thisObject, int globalRegisterOffset, ScopeChainNode*, JSValue* exception); 125 125 126 #if !ENABLE(JIT)126 #if ENABLE(INTERPRETER) 127 127 NEVER_INLINE bool resolve(CallFrame*, Instruction*, JSValue& exceptionValue); 128 128 NEVER_INLINE bool resolveSkip(CallFrame*, Instruction*, JSValue& exceptionValue); … … 137 137 void tryCachePutByID(CallFrame*, CodeBlock*, Instruction*, JSValue baseValue, const PutPropertySlot&); 138 138 void uncachePutByID(CodeBlock*, Instruction* vPC); 139 #endif // !ENABLE(JIT)139 #endif // ENABLE(INTERPRETER) 140 140 141 141 NEVER_INLINE bool unwindCallFrame(CallFrame*&, JSValue, unsigned& bytecodeOffset, CodeBlock*&); -
trunk/JavaScriptCore/runtime/ArrayPrototype.cpp
r61588 r62612 77 77 // If the JIT is enabled then we need to preserve the invariant that every 78 78 // function with a CodeBlock also has JIT code. 79 callData.js.functionExecutable->jitCodeForCall(exec, callData.js.scopeChain); 80 CodeBlock* codeBlock = &callData.js.functionExecutable->generatedBytecodeForCall(); 79 CodeBlock* codeBlock = 0; 80 #if ENABLE(INTERPRETER) 81 if (!exec->globalData().canUseJIT()) 82 codeBlock = callData.js.functionExecutable->bytecodeForCall(exec, callData.js.scopeChain); 83 else 84 #endif 85 { 86 callData.js.functionExecutable->jitCodeForCall(exec, callData.js.scopeChain); 87 codeBlock = &callData.js.functionExecutable->generatedBytecodeForCall(); 88 } 81 89 #else 82 90 CodeBlock* codeBlock = callData.js.functionExecutable->bytecodeForCall(exec, callData.js.scopeChain); -
trunk/JavaScriptCore/runtime/Executable.cpp
r62551 r62612 178 178 void EvalExecutable::generateJITCode(ExecState* exec, ScopeChainNode* scopeChainNode) 179 179 { 180 #if ENABLE(INTERPRETER) 181 ASSERT(exec->globalData().canUseJIT()); 182 #endif 180 183 CodeBlock* codeBlock = &bytecode(exec, scopeChainNode); 181 184 m_jitCodeForCall = JIT::compile(scopeChainNode->globalData, codeBlock); … … 189 192 void ProgramExecutable::generateJITCode(ExecState* exec, ScopeChainNode* scopeChainNode) 190 193 { 194 #if ENABLE(INTERPRETER) 195 ASSERT(exec->globalData().canUseJIT()); 196 #endif 191 197 CodeBlock* codeBlock = &bytecode(exec, scopeChainNode); 192 198 m_jitCodeForCall = JIT::compile(scopeChainNode->globalData, codeBlock); … … 200 206 void FunctionExecutable::generateJITCodeForCall(ExecState* exec, ScopeChainNode* scopeChainNode) 201 207 { 208 #if ENABLE(INTERPRETER) 209 ASSERT(exec->globalData().canUseJIT()); 210 #endif 202 211 CodeBlock* codeBlock = bytecodeForCall(exec, scopeChainNode); 203 212 m_jitCodeForCall = JIT::compile(scopeChainNode->globalData, codeBlock, &m_jitCodeForCallWithArityCheck); … … 211 220 void FunctionExecutable::generateJITCodeForConstruct(ExecState* exec, ScopeChainNode* scopeChainNode) 212 221 { 222 #if ENABLE(INTERPRETER) 223 ASSERT(exec->globalData().canUseJIT()); 224 #endif 213 225 CodeBlock* codeBlock = bytecodeForConstruct(exec, scopeChainNode); 214 226 m_jitCodeForConstruct = JIT::compile(scopeChainNode->globalData, codeBlock, &m_jitCodeForConstructWithArityCheck); … … 252 264 253 265 #if ENABLE(JIT) 254 JITCode newJITCode = JIT::compile(globalData, newCodeBlock.get()); 255 ASSERT(codeBlock->m_isConstructor ? newJITCode.size() == generatedJITCodeForConstruct().size() : newJITCode.size() == generatedJITCodeForCall().size()); 266 #if ENABLE(INTERPRETER) 267 if (globalData->canUseJIT()) 268 #endif 269 { 270 JITCode newJITCode = JIT::compile(globalData, newCodeBlock.get()); 271 ASSERT(codeBlock->m_isConstructor ? newJITCode.size() == generatedJITCodeForConstruct().size() : newJITCode.size() == generatedJITCodeForCall().size()); 272 } 256 273 #endif 257 274 … … 279 296 280 297 #if ENABLE(JIT) 281 JITCode newJITCode = JIT::compile(globalData, newCodeBlock.get()); 282 ASSERT(newJITCode.size() == generatedJITCodeForCall().size()); 298 #if ENABLE(INTERPRETER) 299 if (globalData->canUseJIT()) 300 #endif 301 { 302 JITCode newJITCode = JIT::compile(globalData, newCodeBlock.get()); 303 ASSERT(newJITCode.size() == generatedJITCodeForCall().size()); 304 } 283 305 #endif 284 306 -
trunk/JavaScriptCore/runtime/JSFunction.cpp
r60762 r62612 43 43 44 44 namespace JSC { 45 45 #if ENABLE(JIT) 46 46 EncodedJSValue JSC_HOST_CALL callHostFunctionAsConstructor(ExecState* exec) 47 47 { … … 50 50 return throwVMError(exec, createNotAConstructorError(exec, exec->callee(), vPCIndex, codeBlock)); 51 51 } 52 #endif 52 53 53 54 ASSERT_CLASS_FITS_IN_CELL(JSFunction); -
trunk/JavaScriptCore/runtime/JSGlobalData.cpp
r61623 r62612 59 59 #if PLATFORM(MAC) 60 60 #include "ProfilerServer.h" 61 #include <CoreFoundation/CoreFoundation.h> 61 62 #endif 62 63 … … 157 158 startProfilerServerIfNeeded(); 158 159 #endif 160 #if ENABLE(JIT) && ENABLE(INTERPRETER) 161 #if PLATFORM(MAC) 162 CFStringRef canUseJITKey = CFStringCreateWithCString(0 , "JavaScriptCoreUseJIT", kCFStringEncodingMacRoman); 163 CFBooleanRef canUseJIT = (CFBooleanRef)CFPreferencesCopyAppValue(canUseJITKey, kCFPreferencesCurrentApplication); 164 m_canUseJIT = kCFBooleanTrue == canUseJIT; 165 CFRelease(canUseJIT); 166 CFRelease(canUseJITKey); 167 #elif OS(UNIX) 168 m_canUseJIT = !getenv("JSC_FORCE_INTERPRETER"); 169 #else 170 m_canUseJIT = true; 171 #endif 172 #endif 159 173 } 160 174 -
trunk/JavaScriptCore/runtime/JSGlobalData.h
r61732 r62612 168 168 #endif 169 169 170 #if ENABLE(JIT) 171 #if ENABLE(INTERPRETER) 172 bool canUseJIT() { return m_canUseJIT; } 173 #endif 174 #else 175 bool canUseJIT() { return false; } 176 #endif 170 177 Lexer* lexer; 171 178 Parser* parser; … … 234 241 static JSGlobalData*& sharedInstanceInternal(); 235 242 void createNativeThunk(); 243 #if ENABLE(JIT) && ENABLE(INTERPRETER) 244 bool m_canUseJIT; 245 #endif 236 246 }; 237 247 -
trunk/JavaScriptCore/wtf/Platform.h
r62544 r62612 973 973 #endif /* !defined(ENABLE_JIT) */ 974 974 975 #if !ENABLE(JIT) 976 #define ENABLE_INTERPRETER 1 977 #endif 978 979 #if !(ENABLE(JIT) || ENABLE(INTERPRETER)) 980 #error You have to have at least one execution model enabled to build JSC 981 #endif 982 975 983 /* CPU architecture specific optimizations */ 976 984 #if CPU(ARM_TRADITIONAL) … … 1013 1021 #endif 1014 1022 1015 #if COMPILER(GCC) && !ENABLE(JIT)1023 #if COMPILER(GCC) && ENABLE(INTERPRETER) 1016 1024 #define HAVE_COMPUTED_GOTO 1 1017 1025 #endif
Note: See TracChangeset
for help on using the changeset viewer.