haikuwebkit/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h

182 lines
4.1 KiB
C
Raw Permalink Normal View History

JSC should be a triple-tier VM https://bugs.webkit.org/show_bug.cgi?id=75812 <rdar://problem/10079694> Source/JavaScriptCore: Reviewed by Gavin Barraclough. Implemented an interpreter that uses the JIT's calling convention. This interpreter is called LLInt, or the Low Level Interpreter. JSC will now will start by executing code in LLInt and will only tier up to the old JIT after the code is proven hot. LLInt is written in a modified form of our macro assembly. This new macro assembly is compiled by an offline assembler (see offlineasm), which implements many modern conveniences such as a Turing-complete CPS-based macro language and direct access to relevant C++ type information (basically offsets of fields and sizes of structs/classes). Code executing in LLInt appears to the rest of the JSC world "as if" it were executing in the old JIT. Hence, things like exception handling and cross-execution-engine calls just work and require pretty much no additional overhead. This interpreter is 2-2.5x faster than our old interpreter on SunSpider, V8, and Kraken. With triple-tiering turned on, we're neutral on SunSpider, V8, and Kraken, but appear to get a double-digit improvement on real-world websites due to a huge reduction in the amount of JIT'ing. * CMakeLists.txt: * GNUmakefile.am: * GNUmakefile.list.am: * JavaScriptCore.pri: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * assembler/LinkBuffer.h: * assembler/MacroAssemblerCodeRef.h: (MacroAssemblerCodePtr): (JSC::MacroAssemblerCodePtr::createFromExecutableAddress): * bytecode/BytecodeConventions.h: Added. * bytecode/CallLinkStatus.cpp: (JSC::CallLinkStatus::computeFromLLInt): (JSC): (JSC::CallLinkStatus::computeFor): * bytecode/CallLinkStatus.h: (JSC::CallLinkStatus::isSet): (JSC::CallLinkStatus::operator!): (CallLinkStatus): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::CodeBlock): (JSC::CodeBlock::~CodeBlock): (JSC::CodeBlock::finalizeUnconditionally): (JSC::CodeBlock::stronglyVisitStrongReferences): (JSC): (JSC::CodeBlock::unlinkCalls): (JSC::CodeBlock::unlinkIncomingCalls): (JSC::CodeBlock::bytecodeOffset): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::ProgramCodeBlock::jitCompileImpl): (JSC::EvalCodeBlock::jitCompileImpl): (JSC::FunctionCodeBlock::jitCompileImpl): * bytecode/CodeBlock.h: (JSC): (CodeBlock): (JSC::CodeBlock::baselineVersion): (JSC::CodeBlock::linkIncomingCall): (JSC::CodeBlock::bytecodeOffset): (JSC::CodeBlock::jitCompile): (JSC::CodeBlock::hasOptimizedReplacement): (JSC::CodeBlock::addPropertyAccessInstruction): (JSC::CodeBlock::addGlobalResolveInstruction): (JSC::CodeBlock::addLLIntCallLinkInfo): (JSC::CodeBlock::addGlobalResolveInfo): (JSC::CodeBlock::numberOfMethodCallLinkInfos): (JSC::CodeBlock::valueProfilePredictionForBytecodeOffset): (JSC::CodeBlock::likelyToTakeSlowCase): (JSC::CodeBlock::couldTakeSlowCase): (JSC::CodeBlock::likelyToTakeSpecialFastCase): (JSC::CodeBlock::likelyToTakeDeepestSlowCase): (JSC::CodeBlock::likelyToTakeAnySlowCase): (JSC::CodeBlock::addFrequentExitSite): (JSC::CodeBlock::dontJITAnytimeSoon): (JSC::CodeBlock::jitAfterWarmUp): (JSC::CodeBlock::jitSoon): (JSC::CodeBlock::llintExecuteCounter): (ProgramCodeBlock): (EvalCodeBlock): (FunctionCodeBlock): * bytecode/GetByIdStatus.cpp: (JSC::GetByIdStatus::computeFromLLInt): (JSC): (JSC::GetByIdStatus::computeFor): * bytecode/GetByIdStatus.h: (JSC::GetByIdStatus::GetByIdStatus): (JSC::GetByIdStatus::wasSeenInJIT): (GetByIdStatus): * bytecode/Instruction.h: (JSC): (JSC::Instruction::Instruction): (Instruction): * bytecode/LLIntCallLinkInfo.h: Added. (JSC): (JSC::LLIntCallLinkInfo::LLIntCallLinkInfo): (LLIntCallLinkInfo): (JSC::LLIntCallLinkInfo::~LLIntCallLinkInfo): (JSC::LLIntCallLinkInfo::isLinked): (JSC::LLIntCallLinkInfo::unlink): * bytecode/MethodCallLinkStatus.cpp: (JSC::MethodCallLinkStatus::computeFor): * bytecode/Opcode.cpp: (JSC): * bytecode/Opcode.h: (JSC): (JSC::padOpcodeName): * bytecode/PutByIdStatus.cpp: (JSC::PutByIdStatus::computeFromLLInt): (JSC): (JSC::PutByIdStatus::computeFor): * bytecode/PutByIdStatus.h: (PutByIdStatus): * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitResolve): (JSC::BytecodeGenerator::emitResolveWithBase): (JSC::BytecodeGenerator::emitGetById): (JSC::BytecodeGenerator::emitPutById): (JSC::BytecodeGenerator::emitDirectPutById): (JSC::BytecodeGenerator::emitCall): (JSC::BytecodeGenerator::emitConstruct): (JSC::BytecodeGenerator::emitCatch): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): (JSC::DFG::ByteCodeParser::handleInlining): (JSC::DFG::ByteCodeParser::parseBlock): * dfg/DFGCapabilities.h: (JSC::DFG::canCompileOpcode): * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGOperations.cpp: * heap/Heap.h: (JSC): (JSC::Heap::firstAllocatorWithoutDestructors): (Heap): * heap/MarkStack.cpp: (JSC::visitChildren): * heap/MarkedAllocator.h: (JSC): (MarkedAllocator): * heap/MarkedSpace.h: (JSC): (MarkedSpace): (JSC::MarkedSpace::firstAllocator): * interpreter/CallFrame.cpp: (JSC): (JSC::CallFrame::bytecodeOffsetForNonDFGCode): (JSC::CallFrame::setBytecodeOffsetForNonDFGCode): (JSC::CallFrame::currentVPC): (JSC::CallFrame::setCurrentVPC): (JSC::CallFrame::trueCallerFrame): * interpreter/CallFrame.h: (JSC::ExecState::hasReturnPC): (JSC::ExecState::clearReturnPC): (ExecState): (JSC::ExecState::bytecodeOffsetForNonDFGCode): (JSC::ExecState::currentVPC): (JSC::ExecState::setCurrentVPC): * interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): (JSC::Interpreter::~Interpreter): (JSC): (JSC::Interpreter::initialize): (JSC::Interpreter::isOpcode): (JSC::Interpreter::unwindCallFrame): (JSC::getCallerInfo): (JSC::Interpreter::privateExecute): (JSC::Interpreter::retrieveLastCaller): * interpreter/Interpreter.h: (JSC): (Interpreter): (JSC::Interpreter::getOpcode): (JSC::Interpreter::getOpcodeID): (JSC::Interpreter::classicEnabled): * interpreter/RegisterFile.h: (JSC): (RegisterFile): * jit/ExecutableAllocator.h: (JSC): * jit/HostCallReturnValue.cpp: Added. (JSC): (JSC::getHostCallReturnValueWithExecState): * jit/HostCallReturnValue.h: Added. (JSC): (JSC::initializeHostCallReturnValue): * jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile): * jit/JITCode.h: (JSC::JITCode::isOptimizingJIT): (JITCode): (JSC::JITCode::isBaselineCode): (JSC::JITCode::JITCode): * jit/JITDriver.h: (JSC::jitCompileIfAppropriate): (JSC::jitCompileFunctionIfAppropriate): * jit/JITExceptions.cpp: (JSC::jitThrow): * jit/JITInlineMethods.h: (JSC::JIT::updateTopCallFrame): * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): (JSC): * jit/JITStubs.h: (JSC): * jit/JSInterfaceJIT.h: * llint: Added. * llint/LLIntCommon.h: Added. * llint/LLIntData.cpp: Added. (LLInt): (JSC::LLInt::Data::Data): (JSC::LLInt::Data::performAssertions): (JSC::LLInt::Data::~Data): * llint/LLIntData.h: Added. (JSC): (LLInt): (Data): (JSC::LLInt::Data::exceptionInstructions): (JSC::LLInt::Data::opcodeMap): (JSC::LLInt::Data::performAssertions): * llint/LLIntEntrypoints.cpp: Added. (LLInt): (JSC::LLInt::getFunctionEntrypoint): (JSC::LLInt::getEvalEntrypoint): (JSC::LLInt::getProgramEntrypoint): * llint/LLIntEntrypoints.h: Added. (JSC): (LLInt): (JSC::LLInt::getEntrypoint): * llint/LLIntExceptions.cpp: Added. (LLInt): (JSC::LLInt::interpreterThrowInCaller): (JSC::LLInt::returnToThrowForThrownException): (JSC::LLInt::returnToThrow): (JSC::LLInt::callToThrow): * llint/LLIntExceptions.h: Added. (JSC): (LLInt): * llint/LLIntOfflineAsmConfig.h: Added. * llint/LLIntOffsetsExtractor.cpp: Added. (JSC): (LLIntOffsetsExtractor): (JSC::LLIntOffsetsExtractor::dummy): (main): * llint/LLIntSlowPaths.cpp: Added. (LLInt): (JSC::LLInt::llint_trace_operand): (JSC::LLInt::llint_trace_value): (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::traceFunctionPrologue): (JSC::LLInt::shouldJIT): (JSC::LLInt::entryOSR): (JSC::LLInt::resolveGlobal): (JSC::LLInt::getByVal): (JSC::LLInt::handleHostCall): (JSC::LLInt::setUpCall): (JSC::LLInt::genericCall): * llint/LLIntSlowPaths.h: Added. (JSC): (LLInt): * llint/LLIntThunks.cpp: Added. (LLInt): (JSC::LLInt::generateThunkWithJumpTo): (JSC::LLInt::functionForCallEntryThunkGenerator): (JSC::LLInt::functionForConstructEntryThunkGenerator): (JSC::LLInt::functionForCallArityCheckThunkGenerator): (JSC::LLInt::functionForConstructArityCheckThunkGenerator): (JSC::LLInt::evalEntryThunkGenerator): (JSC::LLInt::programEntryThunkGenerator): * llint/LLIntThunks.h: Added. (JSC): (LLInt): * llint/LowLevelInterpreter.asm: Added. * llint/LowLevelInterpreter.cpp: Added. * llint/LowLevelInterpreter.h: Added. * offlineasm: Added. * offlineasm/armv7.rb: Added. * offlineasm/asm.rb: Added. * offlineasm/ast.rb: Added. * offlineasm/backends.rb: Added. * offlineasm/generate_offset_extractor.rb: Added. * offlineasm/instructions.rb: Added. * offlineasm/offset_extractor_constants.rb: Added. * offlineasm/offsets.rb: Added. * offlineasm/opt.rb: Added. * offlineasm/parser.rb: Added. * offlineasm/registers.rb: Added. * offlineasm/self_hash.rb: Added. * offlineasm/settings.rb: Added. * offlineasm/transform.rb: Added. * offlineasm/x86.rb: Added. * runtime/CodeSpecializationKind.h: Added. (JSC): * runtime/CommonSlowPaths.h: (JSC::CommonSlowPaths::arityCheckFor): (CommonSlowPaths): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC): (JSC::EvalExecutable::jitCompile): (JSC::samplingDescription): (JSC::EvalExecutable::compileInternal): (JSC::ProgramExecutable::jitCompile): (JSC::ProgramExecutable::compileInternal): (JSC::FunctionExecutable::baselineCodeBlockFor): (JSC::FunctionExecutable::jitCompileForCall): (JSC::FunctionExecutable::jitCompileForConstruct): (JSC::FunctionExecutable::compileForCallInternal): (JSC::FunctionExecutable::compileForConstructInternal): * runtime/Executable.h: (JSC): (EvalExecutable): (ProgramExecutable): (FunctionExecutable): (JSC::FunctionExecutable::jitCompileFor): * runtime/ExecutionHarness.h: Added. (JSC): (JSC::prepareForExecution): (JSC::prepareFunctionForExecution): * runtime/JSArray.h: (JSC): (JSArray): * runtime/JSCell.h: (JSC): (JSCell): * runtime/JSFunction.h: (JSC): (JSFunction): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): * runtime/JSGlobalData.h: (JSC): (JSGlobalData): * runtime/JSGlobalObject.h: (JSC): (JSGlobalObject): * runtime/JSObject.h: (JSC): (JSObject): (JSFinalObject): * runtime/JSPropertyNameIterator.h: (JSC): (JSPropertyNameIterator): * runtime/JSString.h: (JSC): (JSString): * runtime/JSTypeInfo.h: (JSC): (TypeInfo): * runtime/JSValue.cpp: (JSC::JSValue::description): * runtime/JSValue.h: (LLInt): (JSValue): * runtime/JSVariableObject.h: (JSC): (JSVariableObject): * runtime/Options.cpp: (Options): (JSC::Options::initializeOptions): * runtime/Options.h: (Options): * runtime/ScopeChain.h: (JSC): (ScopeChainNode): * runtime/Structure.cpp: (JSC::Structure::addPropertyTransition): * runtime/Structure.h: (JSC): (Structure): * runtime/StructureChain.h: (JSC): (StructureChain): * wtf/InlineASM.h: * wtf/Platform.h: * wtf/SentinelLinkedList.h: (SentinelLinkedList): (WTF::SentinelLinkedList::isEmpty): * wtf/text/StringImpl.h: (JSC): (StringImpl): Source/WebCore: Reviewed by Gavin Barraclough. No new tests, because there is no change in behavior. * CMakeLists.txt: Source/WebKit: Reviewed by Gavin Barraclough. Changed EFL's build system to include a new directory in JavaScriptCore. * CMakeLists.txt: Tools: Reviewed by Gavin Barraclough. Changed EFL's build system to include a new directory in JavaScriptCore. * DumpRenderTree/efl/CMakeLists.txt: Canonical link: https://commits.webkit.org/96248@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@108444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-22 05:23:19 +00:00
/*
* Copyright (C) 2012-2019 Apple Inc. All rights reserved.
JSC should be a triple-tier VM https://bugs.webkit.org/show_bug.cgi?id=75812 <rdar://problem/10079694> Source/JavaScriptCore: Reviewed by Gavin Barraclough. Implemented an interpreter that uses the JIT's calling convention. This interpreter is called LLInt, or the Low Level Interpreter. JSC will now will start by executing code in LLInt and will only tier up to the old JIT after the code is proven hot. LLInt is written in a modified form of our macro assembly. This new macro assembly is compiled by an offline assembler (see offlineasm), which implements many modern conveniences such as a Turing-complete CPS-based macro language and direct access to relevant C++ type information (basically offsets of fields and sizes of structs/classes). Code executing in LLInt appears to the rest of the JSC world "as if" it were executing in the old JIT. Hence, things like exception handling and cross-execution-engine calls just work and require pretty much no additional overhead. This interpreter is 2-2.5x faster than our old interpreter on SunSpider, V8, and Kraken. With triple-tiering turned on, we're neutral on SunSpider, V8, and Kraken, but appear to get a double-digit improvement on real-world websites due to a huge reduction in the amount of JIT'ing. * CMakeLists.txt: * GNUmakefile.am: * GNUmakefile.list.am: * JavaScriptCore.pri: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * assembler/LinkBuffer.h: * assembler/MacroAssemblerCodeRef.h: (MacroAssemblerCodePtr): (JSC::MacroAssemblerCodePtr::createFromExecutableAddress): * bytecode/BytecodeConventions.h: Added. * bytecode/CallLinkStatus.cpp: (JSC::CallLinkStatus::computeFromLLInt): (JSC): (JSC::CallLinkStatus::computeFor): * bytecode/CallLinkStatus.h: (JSC::CallLinkStatus::isSet): (JSC::CallLinkStatus::operator!): (CallLinkStatus): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::CodeBlock): (JSC::CodeBlock::~CodeBlock): (JSC::CodeBlock::finalizeUnconditionally): (JSC::CodeBlock::stronglyVisitStrongReferences): (JSC): (JSC::CodeBlock::unlinkCalls): (JSC::CodeBlock::unlinkIncomingCalls): (JSC::CodeBlock::bytecodeOffset): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::ProgramCodeBlock::jitCompileImpl): (JSC::EvalCodeBlock::jitCompileImpl): (JSC::FunctionCodeBlock::jitCompileImpl): * bytecode/CodeBlock.h: (JSC): (CodeBlock): (JSC::CodeBlock::baselineVersion): (JSC::CodeBlock::linkIncomingCall): (JSC::CodeBlock::bytecodeOffset): (JSC::CodeBlock::jitCompile): (JSC::CodeBlock::hasOptimizedReplacement): (JSC::CodeBlock::addPropertyAccessInstruction): (JSC::CodeBlock::addGlobalResolveInstruction): (JSC::CodeBlock::addLLIntCallLinkInfo): (JSC::CodeBlock::addGlobalResolveInfo): (JSC::CodeBlock::numberOfMethodCallLinkInfos): (JSC::CodeBlock::valueProfilePredictionForBytecodeOffset): (JSC::CodeBlock::likelyToTakeSlowCase): (JSC::CodeBlock::couldTakeSlowCase): (JSC::CodeBlock::likelyToTakeSpecialFastCase): (JSC::CodeBlock::likelyToTakeDeepestSlowCase): (JSC::CodeBlock::likelyToTakeAnySlowCase): (JSC::CodeBlock::addFrequentExitSite): (JSC::CodeBlock::dontJITAnytimeSoon): (JSC::CodeBlock::jitAfterWarmUp): (JSC::CodeBlock::jitSoon): (JSC::CodeBlock::llintExecuteCounter): (ProgramCodeBlock): (EvalCodeBlock): (FunctionCodeBlock): * bytecode/GetByIdStatus.cpp: (JSC::GetByIdStatus::computeFromLLInt): (JSC): (JSC::GetByIdStatus::computeFor): * bytecode/GetByIdStatus.h: (JSC::GetByIdStatus::GetByIdStatus): (JSC::GetByIdStatus::wasSeenInJIT): (GetByIdStatus): * bytecode/Instruction.h: (JSC): (JSC::Instruction::Instruction): (Instruction): * bytecode/LLIntCallLinkInfo.h: Added. (JSC): (JSC::LLIntCallLinkInfo::LLIntCallLinkInfo): (LLIntCallLinkInfo): (JSC::LLIntCallLinkInfo::~LLIntCallLinkInfo): (JSC::LLIntCallLinkInfo::isLinked): (JSC::LLIntCallLinkInfo::unlink): * bytecode/MethodCallLinkStatus.cpp: (JSC::MethodCallLinkStatus::computeFor): * bytecode/Opcode.cpp: (JSC): * bytecode/Opcode.h: (JSC): (JSC::padOpcodeName): * bytecode/PutByIdStatus.cpp: (JSC::PutByIdStatus::computeFromLLInt): (JSC): (JSC::PutByIdStatus::computeFor): * bytecode/PutByIdStatus.h: (PutByIdStatus): * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitResolve): (JSC::BytecodeGenerator::emitResolveWithBase): (JSC::BytecodeGenerator::emitGetById): (JSC::BytecodeGenerator::emitPutById): (JSC::BytecodeGenerator::emitDirectPutById): (JSC::BytecodeGenerator::emitCall): (JSC::BytecodeGenerator::emitConstruct): (JSC::BytecodeGenerator::emitCatch): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): (JSC::DFG::ByteCodeParser::handleInlining): (JSC::DFG::ByteCodeParser::parseBlock): * dfg/DFGCapabilities.h: (JSC::DFG::canCompileOpcode): * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGOperations.cpp: * heap/Heap.h: (JSC): (JSC::Heap::firstAllocatorWithoutDestructors): (Heap): * heap/MarkStack.cpp: (JSC::visitChildren): * heap/MarkedAllocator.h: (JSC): (MarkedAllocator): * heap/MarkedSpace.h: (JSC): (MarkedSpace): (JSC::MarkedSpace::firstAllocator): * interpreter/CallFrame.cpp: (JSC): (JSC::CallFrame::bytecodeOffsetForNonDFGCode): (JSC::CallFrame::setBytecodeOffsetForNonDFGCode): (JSC::CallFrame::currentVPC): (JSC::CallFrame::setCurrentVPC): (JSC::CallFrame::trueCallerFrame): * interpreter/CallFrame.h: (JSC::ExecState::hasReturnPC): (JSC::ExecState::clearReturnPC): (ExecState): (JSC::ExecState::bytecodeOffsetForNonDFGCode): (JSC::ExecState::currentVPC): (JSC::ExecState::setCurrentVPC): * interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): (JSC::Interpreter::~Interpreter): (JSC): (JSC::Interpreter::initialize): (JSC::Interpreter::isOpcode): (JSC::Interpreter::unwindCallFrame): (JSC::getCallerInfo): (JSC::Interpreter::privateExecute): (JSC::Interpreter::retrieveLastCaller): * interpreter/Interpreter.h: (JSC): (Interpreter): (JSC::Interpreter::getOpcode): (JSC::Interpreter::getOpcodeID): (JSC::Interpreter::classicEnabled): * interpreter/RegisterFile.h: (JSC): (RegisterFile): * jit/ExecutableAllocator.h: (JSC): * jit/HostCallReturnValue.cpp: Added. (JSC): (JSC::getHostCallReturnValueWithExecState): * jit/HostCallReturnValue.h: Added. (JSC): (JSC::initializeHostCallReturnValue): * jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile): * jit/JITCode.h: (JSC::JITCode::isOptimizingJIT): (JITCode): (JSC::JITCode::isBaselineCode): (JSC::JITCode::JITCode): * jit/JITDriver.h: (JSC::jitCompileIfAppropriate): (JSC::jitCompileFunctionIfAppropriate): * jit/JITExceptions.cpp: (JSC::jitThrow): * jit/JITInlineMethods.h: (JSC::JIT::updateTopCallFrame): * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): (JSC): * jit/JITStubs.h: (JSC): * jit/JSInterfaceJIT.h: * llint: Added. * llint/LLIntCommon.h: Added. * llint/LLIntData.cpp: Added. (LLInt): (JSC::LLInt::Data::Data): (JSC::LLInt::Data::performAssertions): (JSC::LLInt::Data::~Data): * llint/LLIntData.h: Added. (JSC): (LLInt): (Data): (JSC::LLInt::Data::exceptionInstructions): (JSC::LLInt::Data::opcodeMap): (JSC::LLInt::Data::performAssertions): * llint/LLIntEntrypoints.cpp: Added. (LLInt): (JSC::LLInt::getFunctionEntrypoint): (JSC::LLInt::getEvalEntrypoint): (JSC::LLInt::getProgramEntrypoint): * llint/LLIntEntrypoints.h: Added. (JSC): (LLInt): (JSC::LLInt::getEntrypoint): * llint/LLIntExceptions.cpp: Added. (LLInt): (JSC::LLInt::interpreterThrowInCaller): (JSC::LLInt::returnToThrowForThrownException): (JSC::LLInt::returnToThrow): (JSC::LLInt::callToThrow): * llint/LLIntExceptions.h: Added. (JSC): (LLInt): * llint/LLIntOfflineAsmConfig.h: Added. * llint/LLIntOffsetsExtractor.cpp: Added. (JSC): (LLIntOffsetsExtractor): (JSC::LLIntOffsetsExtractor::dummy): (main): * llint/LLIntSlowPaths.cpp: Added. (LLInt): (JSC::LLInt::llint_trace_operand): (JSC::LLInt::llint_trace_value): (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::traceFunctionPrologue): (JSC::LLInt::shouldJIT): (JSC::LLInt::entryOSR): (JSC::LLInt::resolveGlobal): (JSC::LLInt::getByVal): (JSC::LLInt::handleHostCall): (JSC::LLInt::setUpCall): (JSC::LLInt::genericCall): * llint/LLIntSlowPaths.h: Added. (JSC): (LLInt): * llint/LLIntThunks.cpp: Added. (LLInt): (JSC::LLInt::generateThunkWithJumpTo): (JSC::LLInt::functionForCallEntryThunkGenerator): (JSC::LLInt::functionForConstructEntryThunkGenerator): (JSC::LLInt::functionForCallArityCheckThunkGenerator): (JSC::LLInt::functionForConstructArityCheckThunkGenerator): (JSC::LLInt::evalEntryThunkGenerator): (JSC::LLInt::programEntryThunkGenerator): * llint/LLIntThunks.h: Added. (JSC): (LLInt): * llint/LowLevelInterpreter.asm: Added. * llint/LowLevelInterpreter.cpp: Added. * llint/LowLevelInterpreter.h: Added. * offlineasm: Added. * offlineasm/armv7.rb: Added. * offlineasm/asm.rb: Added. * offlineasm/ast.rb: Added. * offlineasm/backends.rb: Added. * offlineasm/generate_offset_extractor.rb: Added. * offlineasm/instructions.rb: Added. * offlineasm/offset_extractor_constants.rb: Added. * offlineasm/offsets.rb: Added. * offlineasm/opt.rb: Added. * offlineasm/parser.rb: Added. * offlineasm/registers.rb: Added. * offlineasm/self_hash.rb: Added. * offlineasm/settings.rb: Added. * offlineasm/transform.rb: Added. * offlineasm/x86.rb: Added. * runtime/CodeSpecializationKind.h: Added. (JSC): * runtime/CommonSlowPaths.h: (JSC::CommonSlowPaths::arityCheckFor): (CommonSlowPaths): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC): (JSC::EvalExecutable::jitCompile): (JSC::samplingDescription): (JSC::EvalExecutable::compileInternal): (JSC::ProgramExecutable::jitCompile): (JSC::ProgramExecutable::compileInternal): (JSC::FunctionExecutable::baselineCodeBlockFor): (JSC::FunctionExecutable::jitCompileForCall): (JSC::FunctionExecutable::jitCompileForConstruct): (JSC::FunctionExecutable::compileForCallInternal): (JSC::FunctionExecutable::compileForConstructInternal): * runtime/Executable.h: (JSC): (EvalExecutable): (ProgramExecutable): (FunctionExecutable): (JSC::FunctionExecutable::jitCompileFor): * runtime/ExecutionHarness.h: Added. (JSC): (JSC::prepareForExecution): (JSC::prepareFunctionForExecution): * runtime/JSArray.h: (JSC): (JSArray): * runtime/JSCell.h: (JSC): (JSCell): * runtime/JSFunction.h: (JSC): (JSFunction): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): * runtime/JSGlobalData.h: (JSC): (JSGlobalData): * runtime/JSGlobalObject.h: (JSC): (JSGlobalObject): * runtime/JSObject.h: (JSC): (JSObject): (JSFinalObject): * runtime/JSPropertyNameIterator.h: (JSC): (JSPropertyNameIterator): * runtime/JSString.h: (JSC): (JSString): * runtime/JSTypeInfo.h: (JSC): (TypeInfo): * runtime/JSValue.cpp: (JSC::JSValue::description): * runtime/JSValue.h: (LLInt): (JSValue): * runtime/JSVariableObject.h: (JSC): (JSVariableObject): * runtime/Options.cpp: (Options): (JSC::Options::initializeOptions): * runtime/Options.h: (Options): * runtime/ScopeChain.h: (JSC): (ScopeChainNode): * runtime/Structure.cpp: (JSC::Structure::addPropertyTransition): * runtime/Structure.h: (JSC): (Structure): * runtime/StructureChain.h: (JSC): (StructureChain): * wtf/InlineASM.h: * wtf/Platform.h: * wtf/SentinelLinkedList.h: (SentinelLinkedList): (WTF::SentinelLinkedList::isEmpty): * wtf/text/StringImpl.h: (JSC): (StringImpl): Source/WebCore: Reviewed by Gavin Barraclough. No new tests, because there is no change in behavior. * CMakeLists.txt: Source/WebKit: Reviewed by Gavin Barraclough. Changed EFL's build system to include a new directory in JavaScriptCore. * CMakeLists.txt: Tools: Reviewed by Gavin Barraclough. Changed EFL's build system to include a new directory in JavaScriptCore. * DumpRenderTree/efl/CMakeLists.txt: Canonical link: https://commits.webkit.org/96248@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@108444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-22 05:23:19 +00:00
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
JSC should be a triple-tier VM https://bugs.webkit.org/show_bug.cgi?id=75812 <rdar://problem/10079694> Source/JavaScriptCore: Reviewed by Gavin Barraclough. Implemented an interpreter that uses the JIT's calling convention. This interpreter is called LLInt, or the Low Level Interpreter. JSC will now will start by executing code in LLInt and will only tier up to the old JIT after the code is proven hot. LLInt is written in a modified form of our macro assembly. This new macro assembly is compiled by an offline assembler (see offlineasm), which implements many modern conveniences such as a Turing-complete CPS-based macro language and direct access to relevant C++ type information (basically offsets of fields and sizes of structs/classes). Code executing in LLInt appears to the rest of the JSC world "as if" it were executing in the old JIT. Hence, things like exception handling and cross-execution-engine calls just work and require pretty much no additional overhead. This interpreter is 2-2.5x faster than our old interpreter on SunSpider, V8, and Kraken. With triple-tiering turned on, we're neutral on SunSpider, V8, and Kraken, but appear to get a double-digit improvement on real-world websites due to a huge reduction in the amount of JIT'ing. * CMakeLists.txt: * GNUmakefile.am: * GNUmakefile.list.am: * JavaScriptCore.pri: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * assembler/LinkBuffer.h: * assembler/MacroAssemblerCodeRef.h: (MacroAssemblerCodePtr): (JSC::MacroAssemblerCodePtr::createFromExecutableAddress): * bytecode/BytecodeConventions.h: Added. * bytecode/CallLinkStatus.cpp: (JSC::CallLinkStatus::computeFromLLInt): (JSC): (JSC::CallLinkStatus::computeFor): * bytecode/CallLinkStatus.h: (JSC::CallLinkStatus::isSet): (JSC::CallLinkStatus::operator!): (CallLinkStatus): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::CodeBlock): (JSC::CodeBlock::~CodeBlock): (JSC::CodeBlock::finalizeUnconditionally): (JSC::CodeBlock::stronglyVisitStrongReferences): (JSC): (JSC::CodeBlock::unlinkCalls): (JSC::CodeBlock::unlinkIncomingCalls): (JSC::CodeBlock::bytecodeOffset): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::ProgramCodeBlock::jitCompileImpl): (JSC::EvalCodeBlock::jitCompileImpl): (JSC::FunctionCodeBlock::jitCompileImpl): * bytecode/CodeBlock.h: (JSC): (CodeBlock): (JSC::CodeBlock::baselineVersion): (JSC::CodeBlock::linkIncomingCall): (JSC::CodeBlock::bytecodeOffset): (JSC::CodeBlock::jitCompile): (JSC::CodeBlock::hasOptimizedReplacement): (JSC::CodeBlock::addPropertyAccessInstruction): (JSC::CodeBlock::addGlobalResolveInstruction): (JSC::CodeBlock::addLLIntCallLinkInfo): (JSC::CodeBlock::addGlobalResolveInfo): (JSC::CodeBlock::numberOfMethodCallLinkInfos): (JSC::CodeBlock::valueProfilePredictionForBytecodeOffset): (JSC::CodeBlock::likelyToTakeSlowCase): (JSC::CodeBlock::couldTakeSlowCase): (JSC::CodeBlock::likelyToTakeSpecialFastCase): (JSC::CodeBlock::likelyToTakeDeepestSlowCase): (JSC::CodeBlock::likelyToTakeAnySlowCase): (JSC::CodeBlock::addFrequentExitSite): (JSC::CodeBlock::dontJITAnytimeSoon): (JSC::CodeBlock::jitAfterWarmUp): (JSC::CodeBlock::jitSoon): (JSC::CodeBlock::llintExecuteCounter): (ProgramCodeBlock): (EvalCodeBlock): (FunctionCodeBlock): * bytecode/GetByIdStatus.cpp: (JSC::GetByIdStatus::computeFromLLInt): (JSC): (JSC::GetByIdStatus::computeFor): * bytecode/GetByIdStatus.h: (JSC::GetByIdStatus::GetByIdStatus): (JSC::GetByIdStatus::wasSeenInJIT): (GetByIdStatus): * bytecode/Instruction.h: (JSC): (JSC::Instruction::Instruction): (Instruction): * bytecode/LLIntCallLinkInfo.h: Added. (JSC): (JSC::LLIntCallLinkInfo::LLIntCallLinkInfo): (LLIntCallLinkInfo): (JSC::LLIntCallLinkInfo::~LLIntCallLinkInfo): (JSC::LLIntCallLinkInfo::isLinked): (JSC::LLIntCallLinkInfo::unlink): * bytecode/MethodCallLinkStatus.cpp: (JSC::MethodCallLinkStatus::computeFor): * bytecode/Opcode.cpp: (JSC): * bytecode/Opcode.h: (JSC): (JSC::padOpcodeName): * bytecode/PutByIdStatus.cpp: (JSC::PutByIdStatus::computeFromLLInt): (JSC): (JSC::PutByIdStatus::computeFor): * bytecode/PutByIdStatus.h: (PutByIdStatus): * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitResolve): (JSC::BytecodeGenerator::emitResolveWithBase): (JSC::BytecodeGenerator::emitGetById): (JSC::BytecodeGenerator::emitPutById): (JSC::BytecodeGenerator::emitDirectPutById): (JSC::BytecodeGenerator::emitCall): (JSC::BytecodeGenerator::emitConstruct): (JSC::BytecodeGenerator::emitCatch): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): (JSC::DFG::ByteCodeParser::handleInlining): (JSC::DFG::ByteCodeParser::parseBlock): * dfg/DFGCapabilities.h: (JSC::DFG::canCompileOpcode): * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGOperations.cpp: * heap/Heap.h: (JSC): (JSC::Heap::firstAllocatorWithoutDestructors): (Heap): * heap/MarkStack.cpp: (JSC::visitChildren): * heap/MarkedAllocator.h: (JSC): (MarkedAllocator): * heap/MarkedSpace.h: (JSC): (MarkedSpace): (JSC::MarkedSpace::firstAllocator): * interpreter/CallFrame.cpp: (JSC): (JSC::CallFrame::bytecodeOffsetForNonDFGCode): (JSC::CallFrame::setBytecodeOffsetForNonDFGCode): (JSC::CallFrame::currentVPC): (JSC::CallFrame::setCurrentVPC): (JSC::CallFrame::trueCallerFrame): * interpreter/CallFrame.h: (JSC::ExecState::hasReturnPC): (JSC::ExecState::clearReturnPC): (ExecState): (JSC::ExecState::bytecodeOffsetForNonDFGCode): (JSC::ExecState::currentVPC): (JSC::ExecState::setCurrentVPC): * interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): (JSC::Interpreter::~Interpreter): (JSC): (JSC::Interpreter::initialize): (JSC::Interpreter::isOpcode): (JSC::Interpreter::unwindCallFrame): (JSC::getCallerInfo): (JSC::Interpreter::privateExecute): (JSC::Interpreter::retrieveLastCaller): * interpreter/Interpreter.h: (JSC): (Interpreter): (JSC::Interpreter::getOpcode): (JSC::Interpreter::getOpcodeID): (JSC::Interpreter::classicEnabled): * interpreter/RegisterFile.h: (JSC): (RegisterFile): * jit/ExecutableAllocator.h: (JSC): * jit/HostCallReturnValue.cpp: Added. (JSC): (JSC::getHostCallReturnValueWithExecState): * jit/HostCallReturnValue.h: Added. (JSC): (JSC::initializeHostCallReturnValue): * jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile): * jit/JITCode.h: (JSC::JITCode::isOptimizingJIT): (JITCode): (JSC::JITCode::isBaselineCode): (JSC::JITCode::JITCode): * jit/JITDriver.h: (JSC::jitCompileIfAppropriate): (JSC::jitCompileFunctionIfAppropriate): * jit/JITExceptions.cpp: (JSC::jitThrow): * jit/JITInlineMethods.h: (JSC::JIT::updateTopCallFrame): * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): (JSC): * jit/JITStubs.h: (JSC): * jit/JSInterfaceJIT.h: * llint: Added. * llint/LLIntCommon.h: Added. * llint/LLIntData.cpp: Added. (LLInt): (JSC::LLInt::Data::Data): (JSC::LLInt::Data::performAssertions): (JSC::LLInt::Data::~Data): * llint/LLIntData.h: Added. (JSC): (LLInt): (Data): (JSC::LLInt::Data::exceptionInstructions): (JSC::LLInt::Data::opcodeMap): (JSC::LLInt::Data::performAssertions): * llint/LLIntEntrypoints.cpp: Added. (LLInt): (JSC::LLInt::getFunctionEntrypoint): (JSC::LLInt::getEvalEntrypoint): (JSC::LLInt::getProgramEntrypoint): * llint/LLIntEntrypoints.h: Added. (JSC): (LLInt): (JSC::LLInt::getEntrypoint): * llint/LLIntExceptions.cpp: Added. (LLInt): (JSC::LLInt::interpreterThrowInCaller): (JSC::LLInt::returnToThrowForThrownException): (JSC::LLInt::returnToThrow): (JSC::LLInt::callToThrow): * llint/LLIntExceptions.h: Added. (JSC): (LLInt): * llint/LLIntOfflineAsmConfig.h: Added. * llint/LLIntOffsetsExtractor.cpp: Added. (JSC): (LLIntOffsetsExtractor): (JSC::LLIntOffsetsExtractor::dummy): (main): * llint/LLIntSlowPaths.cpp: Added. (LLInt): (JSC::LLInt::llint_trace_operand): (JSC::LLInt::llint_trace_value): (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::traceFunctionPrologue): (JSC::LLInt::shouldJIT): (JSC::LLInt::entryOSR): (JSC::LLInt::resolveGlobal): (JSC::LLInt::getByVal): (JSC::LLInt::handleHostCall): (JSC::LLInt::setUpCall): (JSC::LLInt::genericCall): * llint/LLIntSlowPaths.h: Added. (JSC): (LLInt): * llint/LLIntThunks.cpp: Added. (LLInt): (JSC::LLInt::generateThunkWithJumpTo): (JSC::LLInt::functionForCallEntryThunkGenerator): (JSC::LLInt::functionForConstructEntryThunkGenerator): (JSC::LLInt::functionForCallArityCheckThunkGenerator): (JSC::LLInt::functionForConstructArityCheckThunkGenerator): (JSC::LLInt::evalEntryThunkGenerator): (JSC::LLInt::programEntryThunkGenerator): * llint/LLIntThunks.h: Added. (JSC): (LLInt): * llint/LowLevelInterpreter.asm: Added. * llint/LowLevelInterpreter.cpp: Added. * llint/LowLevelInterpreter.h: Added. * offlineasm: Added. * offlineasm/armv7.rb: Added. * offlineasm/asm.rb: Added. * offlineasm/ast.rb: Added. * offlineasm/backends.rb: Added. * offlineasm/generate_offset_extractor.rb: Added. * offlineasm/instructions.rb: Added. * offlineasm/offset_extractor_constants.rb: Added. * offlineasm/offsets.rb: Added. * offlineasm/opt.rb: Added. * offlineasm/parser.rb: Added. * offlineasm/registers.rb: Added. * offlineasm/self_hash.rb: Added. * offlineasm/settings.rb: Added. * offlineasm/transform.rb: Added. * offlineasm/x86.rb: Added. * runtime/CodeSpecializationKind.h: Added. (JSC): * runtime/CommonSlowPaths.h: (JSC::CommonSlowPaths::arityCheckFor): (CommonSlowPaths): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC): (JSC::EvalExecutable::jitCompile): (JSC::samplingDescription): (JSC::EvalExecutable::compileInternal): (JSC::ProgramExecutable::jitCompile): (JSC::ProgramExecutable::compileInternal): (JSC::FunctionExecutable::baselineCodeBlockFor): (JSC::FunctionExecutable::jitCompileForCall): (JSC::FunctionExecutable::jitCompileForConstruct): (JSC::FunctionExecutable::compileForCallInternal): (JSC::FunctionExecutable::compileForConstructInternal): * runtime/Executable.h: (JSC): (EvalExecutable): (ProgramExecutable): (FunctionExecutable): (JSC::FunctionExecutable::jitCompileFor): * runtime/ExecutionHarness.h: Added. (JSC): (JSC::prepareForExecution): (JSC::prepareFunctionForExecution): * runtime/JSArray.h: (JSC): (JSArray): * runtime/JSCell.h: (JSC): (JSCell): * runtime/JSFunction.h: (JSC): (JSFunction): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): * runtime/JSGlobalData.h: (JSC): (JSGlobalData): * runtime/JSGlobalObject.h: (JSC): (JSGlobalObject): * runtime/JSObject.h: (JSC): (JSObject): (JSFinalObject): * runtime/JSPropertyNameIterator.h: (JSC): (JSPropertyNameIterator): * runtime/JSString.h: (JSC): (JSString): * runtime/JSTypeInfo.h: (JSC): (TypeInfo): * runtime/JSValue.cpp: (JSC::JSValue::description): * runtime/JSValue.h: (LLInt): (JSValue): * runtime/JSVariableObject.h: (JSC): (JSVariableObject): * runtime/Options.cpp: (Options): (JSC::Options::initializeOptions): * runtime/Options.h: (Options): * runtime/ScopeChain.h: (JSC): (ScopeChainNode): * runtime/Structure.cpp: (JSC::Structure::addPropertyTransition): * runtime/Structure.h: (JSC): (Structure): * runtime/StructureChain.h: (JSC): (StructureChain): * wtf/InlineASM.h: * wtf/Platform.h: * wtf/SentinelLinkedList.h: (SentinelLinkedList): (WTF::SentinelLinkedList::isEmpty): * wtf/text/StringImpl.h: (JSC): (StringImpl): Source/WebCore: Reviewed by Gavin Barraclough. No new tests, because there is no change in behavior. * CMakeLists.txt: Source/WebKit: Reviewed by Gavin Barraclough. Changed EFL's build system to include a new directory in JavaScriptCore. * CMakeLists.txt: Tools: Reviewed by Gavin Barraclough. Changed EFL's build system to include a new directory in JavaScriptCore. * DumpRenderTree/efl/CMakeLists.txt: Canonical link: https://commits.webkit.org/96248@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@108444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-22 05:23:19 +00:00
#include "LLIntCommon.h"
#include <wtf/Assertions.h>
#include <wtf/Gigacage.h>
LLInt C loop backend. https://bugs.webkit.org/show_bug.cgi?id=91052. Patch by Mark Lam <mark.lam@apple.com> on 2012-09-01 Reviewed by Filip Pizlo. Source/JavaScriptCore: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::bytecodeOffset): * interpreter/Interpreter.cpp: (JSC::Interpreter::execute): (JSC::Interpreter::executeCall): (JSC::Interpreter::executeConstruct): (JSC): * interpreter/Interpreter.h: * jit/JITStubs.h: (JITStackFrame): (JSC): * llint/LLIntCLoop.cpp: Added. (JSC): (LLInt): (JSC::LLInt::CLoop::initialize): (JSC::LLInt::CLoop::catchRoutineFor): (JSC::LLInt::CLoop::hostCodeEntryFor): (JSC::LLInt::CLoop::jsCodeEntryWithArityCheckFor): (JSC::LLInt::CLoop::jsCodeEntryFor): * llint/LLIntCLoop.h: Added. (JSC): (LLInt): (CLoop): * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC): * llint/LLIntOfflineAsmConfig.h: * llint/LLIntOpcode.h: * llint/LLIntThunks.cpp: (LLInt): * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter.cpp: (LLInt): (JSC::LLInt::Ints2Double): (JSC): (JSC::CLoop::execute): * llint/LowLevelInterpreter.h: (JSC): * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * offlineasm/asm.rb: * offlineasm/backends.rb: * offlineasm/cloop.rb: Added. * offlineasm/instructions.rb: * runtime/Executable.h: (ExecutableBase): (JSC::ExecutableBase::hostCodeEntryFor): (JSC::ExecutableBase::jsCodeEntryFor): (JSC::ExecutableBase::jsCodeWithArityCheckEntryFor): (JSC::ExecutableBase::catchRoutineFor): (NativeExecutable): * runtime/JSValue.h: (JSC): (LLInt): (JSValue): * runtime/JSValueInlineMethods.h: (JSC): (JSC::JSValue::JSValue): * runtime/Options.cpp: (JSC::Options::initialize): Source/WTF: Added configs for the llint C loop backend. * wtf/Platform.h: Canonical link: https://commits.webkit.org/113532@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-01 17:36:51 +00:00
[JSC] Enable LLInt ASM interpreter on X64 and ARM64 in non JIT configuration https://bugs.webkit.org/show_bug.cgi?id=189778 Reviewed by Keith Miller. .: ENABLE_SAMPLING_PROFILER does not depend on ENABLE_JIT now since it can be used with LLInt ASM interpreter. * Source/cmake/WebKitFeatures.cmake: Source/JavaScriptCore: LLInt ASM interpreter is 2x and 15% faster than CLoop interpreter on Linux and macOS respectively. We would like to enable it for non JIT configurations in X86_64 and ARM64. This patch enables LLInt for non JIT builds in X86_64 and ARM64 architectures. Previously, we switch LLInt ASM interpreter and CLoop by using ENABLE(JIT) configuration. But it is wrong in the new scenario since we have a build configuration that uses LLInt ASM interpreter and JIT is disabled. We introduce ENABLE(C_LOOP) option, which represents that we use CLoop. And we replace ENABLE(JIT) with ENABLE(C_LOOP) if the previous ENABLE(JIT) is essentially just related to LLInt ASM interpreter and not related to JIT. We also replace some ENABLE(JIT) configurations with ENABLE(ASSEMBLER). ENABLE(ASSEMBLER) is now enabled even if we disable JIT since MacroAssembler has machine register information that is used in LLInt ASM interpreter. * API/tests/PingPongStackOverflowTest.cpp: (testPingPongStackOverflow): * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MaxFrameExtentForSlowPathCall.h: * bytecode/CallReturnOffsetToBytecodeOffset.h: Removed. It is no longer used. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::finishCreation): * bytecode/CodeBlock.h: (JSC::CodeBlock::calleeSaveRegisters const): (JSC::CodeBlock::numberOfLLIntBaselineCalleeSaveRegisters): (JSC::CodeBlock::llintBaselineCalleeSaveSpaceAsVirtualRegisters): (JSC::CodeBlock::calleeSaveSpaceAsVirtualRegisters): * bytecode/Opcode.h: (JSC::padOpcodeName): * heap/Heap.cpp: (JSC::Heap::gatherJSStackRoots): (JSC::Heap::stopThePeriphery): * interpreter/CLoopStack.cpp: * interpreter/CLoopStack.h: * interpreter/CLoopStackInlines.h: * interpreter/EntryFrame.h: * interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): (JSC::UnwindFunctor::copyCalleeSavesToEntryFrameCalleeSavesBuffer const): * interpreter/Interpreter.h: * interpreter/StackVisitor.cpp: (JSC::StackVisitor::Frame::calleeSaveRegisters): * interpreter/VMEntryRecord.h: * jit/ExecutableAllocator.h: * jit/FPRInfo.h: (WTF::printInternal): * jit/GPRInfo.cpp: * jit/GPRInfo.h: (WTF::printInternal): * jit/HostCallReturnValue.cpp: (JSC::getHostCallReturnValueWithExecState): Moved. They are used in LLInt ASM interpreter too. * jit/HostCallReturnValue.h: * jit/JITOperations.cpp: (JSC::getHostCallReturnValueWithExecState): Deleted. * jit/JITOperationsMSVC64.cpp: * jit/Reg.cpp: * jit/Reg.h: * jit/RegisterAtOffset.cpp: * jit/RegisterAtOffset.h: * jit/RegisterAtOffsetList.cpp: * jit/RegisterAtOffsetList.h: * jit/RegisterMap.h: * jit/RegisterSet.cpp: * jit/RegisterSet.h: * jit/TempRegisterSet.cpp: * jit/TempRegisterSet.h: * llint/LLIntCLoop.cpp: * llint/LLIntCLoop.h: * llint/LLIntData.cpp: (JSC::LLInt::initialize): (JSC::LLInt::Data::performAssertions): * llint/LLIntData.h: * llint/LLIntOfflineAsmConfig.h: * llint/LLIntOpcode.h: * llint/LLIntPCRanges.h: * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): * llint/LLIntSlowPaths.h: * llint/LLIntThunks.cpp: * llint/LowLevelInterpreter.cpp: * llint/LowLevelInterpreter.h: * runtime/JSCJSValue.h: * runtime/MachineContext.h: * runtime/SamplingProfiler.cpp: (JSC::SamplingProfiler::processUnverifiedStackTraces): Enable SamplingProfiler for LLInt ASM interpreter with non JIT configuration. * runtime/TestRunnerUtils.cpp: (JSC::optimizeNextInvocation): * runtime/VM.cpp: (JSC::VM::VM): (JSC::VM::getHostFunction): (JSC::VM::updateSoftReservedZoneSize): (JSC::sanitizeStackForVM): (JSC::VM::committedStackByteCount): * runtime/VM.h: * runtime/VMInlines.h: (JSC::VM::ensureStackCapacityFor): (JSC::VM::isSafeToRecurseSoft const): Source/WTF: This patch adds ENABLE(C_LOOP) which indicates we use CLoop as the interpreter. Previously, we used !ENABLE(JIT) for this configuration. But now, we have a build configuration that has LLInt ASM interpreter (not CLoop) and !ENABLE(JIT). We enable LLInt ASM interpreter for non JIT environment in X86_64 and ARM64 architectures. And we enable ENABLE(ASSEMBLER) for non JIT environment since it offers machine register information which is used for LLInt and SamplingProfiler. * wtf/Platform.h: Canonical link: https://commits.webkit.org/204834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236381 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-09-22 05:26:44 +00:00
#if ENABLE(C_LOOP)
[JSC] Implement op_wide16 / op_wide32 and introduce 16bit version bytecode https://bugs.webkit.org/show_bug.cgi?id=197979 Reviewed by Filip Pizlo. JSTests: * stress/16bit-code.js: Added. (shouldBe): * stress/32bit-code.js: Added. (shouldBe): Source/JavaScriptCore: This patch introduces 16bit bytecode size. Previously, we had two versions of bytecodes, 8bit and 32bit. However, in Gmail, we found that a lot of bytecodes get 32bit because they do not fit in 8bit. 8bit is very small and large function easily emits a lot of 32bit bytecodes because of large VirtualRegister number etc. But they almost always fit in 16bit. If we can have 16bit version of bytecode, we can make most of the current 32bit bytecodes 16bit and save memory. We rename rename op_wide to op_wide32 and introduce op_wide16. The mechanism is similar to old op_wide. When we get op_wide16, the following bytecode data is 16bit, and we execute 16bit version of bytecode in LLInt. We also disable this op_wide16 feature in Windows CLoop, which is used in AppleWin port. When the code size of CLoop::execute increases, MSVC starts generating CLoop::execute function with very large stack allocation requirement. Even before introducing this 16bit bytecode, CLoop::execute in AppleWin takes almost 100KB stack height. After introducing this, it becomes 160KB. While the semantics of the function is correctly compiled, such a large stack allocation is not essentially necessary, and this leads to stack overflow errors quite easily, and tests fail with AppleWin port because it starts throwing stack overflow range error in various places. In this patch, for now, we just disable op_wide16 feature for AppleWin so that CLoop::execute takes 100KB stack allocation because this patch is not focusing on fixing AppleWin's CLoop issue. We introduce a new backend type for LLInt, "C_LOOP_WIN". "C_LOOP_WIN" do not generate wide16 version of code to reduce the code size of CLoop::execute. In the future, we should investigate whether this MSVC issue is fixed in Visual Studio 2019. Or we should consider always enabling ASM LLInt for Windows. This patch improves Gmail by 7MB at least. * CMakeLists.txt: * bytecode/BytecodeConventions.h: * bytecode/BytecodeDumper.cpp: (JSC::BytecodeDumper<Block>::dumpBlock): * bytecode/BytecodeList.rb: * bytecode/BytecodeRewriter.h: (JSC::BytecodeRewriter::Fragment::align): * bytecode/BytecodeUseDef.h: (JSC::computeUsesForBytecodeOffset): (JSC::computeDefsForBytecodeOffset): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::finishCreation): * bytecode/CodeBlock.h: (JSC::CodeBlock::metadataTable const): * bytecode/Fits.h: * bytecode/Instruction.h: (JSC::Instruction::opcodeID const): (JSC::Instruction::isWide16 const): (JSC::Instruction::isWide32 const): (JSC::Instruction::hasMetadata const): (JSC::Instruction::sizeShiftAmount const): (JSC::Instruction::size const): (JSC::Instruction::wide16 const): (JSC::Instruction::wide32 const): (JSC::Instruction::isWide const): Deleted. (JSC::Instruction::wide const): Deleted. * bytecode/InstructionStream.h: (JSC::InstructionStreamWriter::write): * bytecode/Opcode.h: * bytecode/OpcodeSize.h: * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::alignWideOpcode16): (JSC::BytecodeGenerator::alignWideOpcode32): (JSC::BytecodeGenerator::emitGetByVal): Previously, we always emit 32bit op_get_by_val for bytecodes in `for-in` context because its operand can be replaced to the other VirtualRegister later. But if we know that replacing VirtualRegister can fit in 8bit / 16bit a-priori, we should not emit 32bit version. We expose OpXXX::checkWithoutMetadataID to check whether we could potentially compact the bytecode for the given operands. (JSC::BytecodeGenerator::emitYieldPoint): (JSC::StructureForInContext::finalize): (JSC::BytecodeGenerator::alignWideOpcode): Deleted. * bytecompiler/BytecodeGenerator.h: (JSC::BytecodeGenerator::write): * dfg/DFGCapabilities.cpp: (JSC::DFG::capabilityLevel): * generator/Argument.rb: * generator/DSL.rb: * generator/Metadata.rb: * generator/Opcode.rb: A little bit weird but checkImpl's argument must be reference. We are relying on that BoundLabel is once modified in this check phase, and the modified BoundLabel will be used when emitting the code. If checkImpl copies the passed BoundLabel, this modification will be discarded in this checkImpl function and make the code generation broken. * generator/Section.rb: * jit/JITExceptions.cpp: (JSC::genericUnwind): * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC::LLInt::opcodeMapWide16): (JSC::LLInt::opcodeMapWide32): (JSC::LLInt::getOpcodeWide16): (JSC::LLInt::getOpcodeWide32): (JSC::LLInt::getWide16CodePtr): (JSC::LLInt::getWide32CodePtr): (JSC::LLInt::opcodeMapWide): Deleted. (JSC::LLInt::getOpcodeWide): Deleted. (JSC::LLInt::getWideCodePtr): Deleted. * llint/LLIntOfflineAsmConfig.h: * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): * llint/LLIntSlowPaths.h: * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter.cpp: (JSC::CLoop::execute): * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * offlineasm/arm.rb: * offlineasm/arm64.rb: * offlineasm/asm.rb: * offlineasm/backends.rb: * offlineasm/cloop.rb: * offlineasm/instructions.rb: * offlineasm/mips.rb: * offlineasm/x86.rb: Load operation with sign extension should also have the extended size information. For example, loadbs should be converted to loadbsi for 32bit sign extension (and loadbsq for 64bit sign extension). And use loadbsq / loadhsq for loading VirtualRegister information in LowLevelInterpreter64 since they will be used for pointer arithmetic and they are using machine register width. * parser/ResultType.h: (JSC::OperandTypes::OperandTypes): (JSC::OperandTypes::first const): (JSC::OperandTypes::second const): (JSC::OperandTypes::bits): (JSC::OperandTypes::fromBits): (): Deleted. (JSC::OperandTypes::toInt): Deleted. (JSC::OperandTypes::fromInt): Deleted. We reduce sizeof(OperandTypes) from unsigned to uint16_t, which guarantees that OperandTypes always fit in 16bit bytecode. Canonical link: https://commits.webkit.org/212412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-05-30 21:40:35 +00:00
#if !OS(WINDOWS)
LLInt C loop backend. https://bugs.webkit.org/show_bug.cgi?id=91052. Patch by Mark Lam <mark.lam@apple.com> on 2012-09-01 Reviewed by Filip Pizlo. Source/JavaScriptCore: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::bytecodeOffset): * interpreter/Interpreter.cpp: (JSC::Interpreter::execute): (JSC::Interpreter::executeCall): (JSC::Interpreter::executeConstruct): (JSC): * interpreter/Interpreter.h: * jit/JITStubs.h: (JITStackFrame): (JSC): * llint/LLIntCLoop.cpp: Added. (JSC): (LLInt): (JSC::LLInt::CLoop::initialize): (JSC::LLInt::CLoop::catchRoutineFor): (JSC::LLInt::CLoop::hostCodeEntryFor): (JSC::LLInt::CLoop::jsCodeEntryWithArityCheckFor): (JSC::LLInt::CLoop::jsCodeEntryFor): * llint/LLIntCLoop.h: Added. (JSC): (LLInt): (CLoop): * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC): * llint/LLIntOfflineAsmConfig.h: * llint/LLIntOpcode.h: * llint/LLIntThunks.cpp: (LLInt): * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter.cpp: (LLInt): (JSC::LLInt::Ints2Double): (JSC): (JSC::CLoop::execute): * llint/LowLevelInterpreter.h: (JSC): * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * offlineasm/asm.rb: * offlineasm/backends.rb: * offlineasm/cloop.rb: Added. * offlineasm/instructions.rb: * runtime/Executable.h: (ExecutableBase): (JSC::ExecutableBase::hostCodeEntryFor): (JSC::ExecutableBase::jsCodeEntryFor): (JSC::ExecutableBase::jsCodeWithArityCheckEntryFor): (JSC::ExecutableBase::catchRoutineFor): (NativeExecutable): * runtime/JSValue.h: (JSC): (LLInt): (JSValue): * runtime/JSValueInlineMethods.h: (JSC): (JSC::JSValue::JSValue): * runtime/Options.cpp: (JSC::Options::initialize): Source/WTF: Added configs for the llint C loop backend. * wtf/Platform.h: Canonical link: https://commits.webkit.org/113532@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-01 17:36:51 +00:00
#define OFFLINE_ASM_C_LOOP 1
[JSC] Implement op_wide16 / op_wide32 and introduce 16bit version bytecode https://bugs.webkit.org/show_bug.cgi?id=197979 Reviewed by Filip Pizlo. JSTests: * stress/16bit-code.js: Added. (shouldBe): * stress/32bit-code.js: Added. (shouldBe): Source/JavaScriptCore: This patch introduces 16bit bytecode size. Previously, we had two versions of bytecodes, 8bit and 32bit. However, in Gmail, we found that a lot of bytecodes get 32bit because they do not fit in 8bit. 8bit is very small and large function easily emits a lot of 32bit bytecodes because of large VirtualRegister number etc. But they almost always fit in 16bit. If we can have 16bit version of bytecode, we can make most of the current 32bit bytecodes 16bit and save memory. We rename rename op_wide to op_wide32 and introduce op_wide16. The mechanism is similar to old op_wide. When we get op_wide16, the following bytecode data is 16bit, and we execute 16bit version of bytecode in LLInt. We also disable this op_wide16 feature in Windows CLoop, which is used in AppleWin port. When the code size of CLoop::execute increases, MSVC starts generating CLoop::execute function with very large stack allocation requirement. Even before introducing this 16bit bytecode, CLoop::execute in AppleWin takes almost 100KB stack height. After introducing this, it becomes 160KB. While the semantics of the function is correctly compiled, such a large stack allocation is not essentially necessary, and this leads to stack overflow errors quite easily, and tests fail with AppleWin port because it starts throwing stack overflow range error in various places. In this patch, for now, we just disable op_wide16 feature for AppleWin so that CLoop::execute takes 100KB stack allocation because this patch is not focusing on fixing AppleWin's CLoop issue. We introduce a new backend type for LLInt, "C_LOOP_WIN". "C_LOOP_WIN" do not generate wide16 version of code to reduce the code size of CLoop::execute. In the future, we should investigate whether this MSVC issue is fixed in Visual Studio 2019. Or we should consider always enabling ASM LLInt for Windows. This patch improves Gmail by 7MB at least. * CMakeLists.txt: * bytecode/BytecodeConventions.h: * bytecode/BytecodeDumper.cpp: (JSC::BytecodeDumper<Block>::dumpBlock): * bytecode/BytecodeList.rb: * bytecode/BytecodeRewriter.h: (JSC::BytecodeRewriter::Fragment::align): * bytecode/BytecodeUseDef.h: (JSC::computeUsesForBytecodeOffset): (JSC::computeDefsForBytecodeOffset): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::finishCreation): * bytecode/CodeBlock.h: (JSC::CodeBlock::metadataTable const): * bytecode/Fits.h: * bytecode/Instruction.h: (JSC::Instruction::opcodeID const): (JSC::Instruction::isWide16 const): (JSC::Instruction::isWide32 const): (JSC::Instruction::hasMetadata const): (JSC::Instruction::sizeShiftAmount const): (JSC::Instruction::size const): (JSC::Instruction::wide16 const): (JSC::Instruction::wide32 const): (JSC::Instruction::isWide const): Deleted. (JSC::Instruction::wide const): Deleted. * bytecode/InstructionStream.h: (JSC::InstructionStreamWriter::write): * bytecode/Opcode.h: * bytecode/OpcodeSize.h: * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::alignWideOpcode16): (JSC::BytecodeGenerator::alignWideOpcode32): (JSC::BytecodeGenerator::emitGetByVal): Previously, we always emit 32bit op_get_by_val for bytecodes in `for-in` context because its operand can be replaced to the other VirtualRegister later. But if we know that replacing VirtualRegister can fit in 8bit / 16bit a-priori, we should not emit 32bit version. We expose OpXXX::checkWithoutMetadataID to check whether we could potentially compact the bytecode for the given operands. (JSC::BytecodeGenerator::emitYieldPoint): (JSC::StructureForInContext::finalize): (JSC::BytecodeGenerator::alignWideOpcode): Deleted. * bytecompiler/BytecodeGenerator.h: (JSC::BytecodeGenerator::write): * dfg/DFGCapabilities.cpp: (JSC::DFG::capabilityLevel): * generator/Argument.rb: * generator/DSL.rb: * generator/Metadata.rb: * generator/Opcode.rb: A little bit weird but checkImpl's argument must be reference. We are relying on that BoundLabel is once modified in this check phase, and the modified BoundLabel will be used when emitting the code. If checkImpl copies the passed BoundLabel, this modification will be discarded in this checkImpl function and make the code generation broken. * generator/Section.rb: * jit/JITExceptions.cpp: (JSC::genericUnwind): * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC::LLInt::opcodeMapWide16): (JSC::LLInt::opcodeMapWide32): (JSC::LLInt::getOpcodeWide16): (JSC::LLInt::getOpcodeWide32): (JSC::LLInt::getWide16CodePtr): (JSC::LLInt::getWide32CodePtr): (JSC::LLInt::opcodeMapWide): Deleted. (JSC::LLInt::getOpcodeWide): Deleted. (JSC::LLInt::getWideCodePtr): Deleted. * llint/LLIntOfflineAsmConfig.h: * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): * llint/LLIntSlowPaths.h: * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter.cpp: (JSC::CLoop::execute): * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * offlineasm/arm.rb: * offlineasm/arm64.rb: * offlineasm/asm.rb: * offlineasm/backends.rb: * offlineasm/cloop.rb: * offlineasm/instructions.rb: * offlineasm/mips.rb: * offlineasm/x86.rb: Load operation with sign extension should also have the extended size information. For example, loadbs should be converted to loadbsi for 32bit sign extension (and loadbsq for 64bit sign extension). And use loadbsq / loadhsq for loading VirtualRegister information in LowLevelInterpreter64 since they will be used for pointer arithmetic and they are using machine register width. * parser/ResultType.h: (JSC::OperandTypes::OperandTypes): (JSC::OperandTypes::first const): (JSC::OperandTypes::second const): (JSC::OperandTypes::bits): (JSC::OperandTypes::fromBits): (): Deleted. (JSC::OperandTypes::toInt): Deleted. (JSC::OperandTypes::fromInt): Deleted. We reduce sizeof(OperandTypes) from unsigned to uint16_t, which guarantees that OperandTypes always fit in 16bit bytecode. Canonical link: https://commits.webkit.org/212412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-05-30 21:40:35 +00:00
#define OFFLINE_ASM_C_LOOP_WIN 0
#else
#define OFFLINE_ASM_C_LOOP 0
#define OFFLINE_ASM_C_LOOP_WIN 1
#endif
LLInt C loop backend. https://bugs.webkit.org/show_bug.cgi?id=91052. Patch by Mark Lam <mark.lam@apple.com> on 2012-09-01 Reviewed by Filip Pizlo. Source/JavaScriptCore: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::bytecodeOffset): * interpreter/Interpreter.cpp: (JSC::Interpreter::execute): (JSC::Interpreter::executeCall): (JSC::Interpreter::executeConstruct): (JSC): * interpreter/Interpreter.h: * jit/JITStubs.h: (JITStackFrame): (JSC): * llint/LLIntCLoop.cpp: Added. (JSC): (LLInt): (JSC::LLInt::CLoop::initialize): (JSC::LLInt::CLoop::catchRoutineFor): (JSC::LLInt::CLoop::hostCodeEntryFor): (JSC::LLInt::CLoop::jsCodeEntryWithArityCheckFor): (JSC::LLInt::CLoop::jsCodeEntryFor): * llint/LLIntCLoop.h: Added. (JSC): (LLInt): (CLoop): * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC): * llint/LLIntOfflineAsmConfig.h: * llint/LLIntOpcode.h: * llint/LLIntThunks.cpp: (LLInt): * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter.cpp: (LLInt): (JSC::LLInt::Ints2Double): (JSC): (JSC::CLoop::execute): * llint/LowLevelInterpreter.h: (JSC): * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * offlineasm/asm.rb: * offlineasm/backends.rb: * offlineasm/cloop.rb: Added. * offlineasm/instructions.rb: * runtime/Executable.h: (ExecutableBase): (JSC::ExecutableBase::hostCodeEntryFor): (JSC::ExecutableBase::jsCodeEntryFor): (JSC::ExecutableBase::jsCodeWithArityCheckEntryFor): (JSC::ExecutableBase::catchRoutineFor): (NativeExecutable): * runtime/JSValue.h: (JSC): (LLInt): (JSValue): * runtime/JSValueInlineMethods.h: (JSC): (JSC::JSValue::JSValue): * runtime/Options.cpp: (JSC::Options::initialize): Source/WTF: Added configs for the llint C loop backend. * wtf/Platform.h: Canonical link: https://commits.webkit.org/113532@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-01 17:36:51 +00:00
#define OFFLINE_ASM_X86 0
#define OFFLINE_ASM_X86_WIN 0
LLInt C loop backend. https://bugs.webkit.org/show_bug.cgi?id=91052. Patch by Mark Lam <mark.lam@apple.com> on 2012-09-01 Reviewed by Filip Pizlo. Source/JavaScriptCore: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::bytecodeOffset): * interpreter/Interpreter.cpp: (JSC::Interpreter::execute): (JSC::Interpreter::executeCall): (JSC::Interpreter::executeConstruct): (JSC): * interpreter/Interpreter.h: * jit/JITStubs.h: (JITStackFrame): (JSC): * llint/LLIntCLoop.cpp: Added. (JSC): (LLInt): (JSC::LLInt::CLoop::initialize): (JSC::LLInt::CLoop::catchRoutineFor): (JSC::LLInt::CLoop::hostCodeEntryFor): (JSC::LLInt::CLoop::jsCodeEntryWithArityCheckFor): (JSC::LLInt::CLoop::jsCodeEntryFor): * llint/LLIntCLoop.h: Added. (JSC): (LLInt): (CLoop): * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC): * llint/LLIntOfflineAsmConfig.h: * llint/LLIntOpcode.h: * llint/LLIntThunks.cpp: (LLInt): * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter.cpp: (LLInt): (JSC::LLInt::Ints2Double): (JSC): (JSC::CLoop::execute): * llint/LowLevelInterpreter.h: (JSC): * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * offlineasm/asm.rb: * offlineasm/backends.rb: * offlineasm/cloop.rb: Added. * offlineasm/instructions.rb: * runtime/Executable.h: (ExecutableBase): (JSC::ExecutableBase::hostCodeEntryFor): (JSC::ExecutableBase::jsCodeEntryFor): (JSC::ExecutableBase::jsCodeWithArityCheckEntryFor): (JSC::ExecutableBase::catchRoutineFor): (NativeExecutable): * runtime/JSValue.h: (JSC): (LLInt): (JSValue): * runtime/JSValueInlineMethods.h: (JSC): (JSC::JSValue::JSValue): * runtime/Options.cpp: (JSC::Options::initialize): Source/WTF: Added configs for the llint C loop backend. * wtf/Platform.h: Canonical link: https://commits.webkit.org/113532@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-01 17:36:51 +00:00
#define OFFLINE_ASM_ARMv7 0
#define OFFLINE_ASM_ARM64 0
#define OFFLINE_ASM_ARM64E 0
LLInt C loop backend. https://bugs.webkit.org/show_bug.cgi?id=91052. Patch by Mark Lam <mark.lam@apple.com> on 2012-09-01 Reviewed by Filip Pizlo. Source/JavaScriptCore: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::bytecodeOffset): * interpreter/Interpreter.cpp: (JSC::Interpreter::execute): (JSC::Interpreter::executeCall): (JSC::Interpreter::executeConstruct): (JSC): * interpreter/Interpreter.h: * jit/JITStubs.h: (JITStackFrame): (JSC): * llint/LLIntCLoop.cpp: Added. (JSC): (LLInt): (JSC::LLInt::CLoop::initialize): (JSC::LLInt::CLoop::catchRoutineFor): (JSC::LLInt::CLoop::hostCodeEntryFor): (JSC::LLInt::CLoop::jsCodeEntryWithArityCheckFor): (JSC::LLInt::CLoop::jsCodeEntryFor): * llint/LLIntCLoop.h: Added. (JSC): (LLInt): (CLoop): * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC): * llint/LLIntOfflineAsmConfig.h: * llint/LLIntOpcode.h: * llint/LLIntThunks.cpp: (LLInt): * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter.cpp: (LLInt): (JSC::LLInt::Ints2Double): (JSC): (JSC::CLoop::execute): * llint/LowLevelInterpreter.h: (JSC): * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * offlineasm/asm.rb: * offlineasm/backends.rb: * offlineasm/cloop.rb: Added. * offlineasm/instructions.rb: * runtime/Executable.h: (ExecutableBase): (JSC::ExecutableBase::hostCodeEntryFor): (JSC::ExecutableBase::jsCodeEntryFor): (JSC::ExecutableBase::jsCodeWithArityCheckEntryFor): (JSC::ExecutableBase::catchRoutineFor): (NativeExecutable): * runtime/JSValue.h: (JSC): (LLInt): (JSValue): * runtime/JSValueInlineMethods.h: (JSC): (JSC::JSValue::JSValue): * runtime/Options.cpp: (JSC::Options::initialize): Source/WTF: Added configs for the llint C loop backend. * wtf/Platform.h: Canonical link: https://commits.webkit.org/113532@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-01 17:36:51 +00:00
#define OFFLINE_ASM_X86_64 0
[Win64] ASM LLINT is not enabled. https://bugs.webkit.org/show_bug.cgi?id=130638 Source/JavaScriptCore: This patch adds a new LLINT assembler backend for Win64, and implements it. It makes adjustments to follow the Win64 ABI spec. where it's found to be needed. Also, LLINT and JIT is enabled for Win64. Patch by peavo@outlook.com <peavo@outlook.com> on 2014-06-25 Reviewed by Mark Lam. * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Added JITStubsMSVC64.asm. * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: Ditto. * JavaScriptCore/JavaScriptCore.vcxproj/jsc/jscCommon.props: Increased stack size to avoid stack overflow in tests. * JavaScriptCore.vcxproj/LLInt/LLIntAssembly/build-LLIntAssembly.sh: Generate assembler source file for Win64. * assembler/MacroAssemblerX86_64.h: (JSC::MacroAssemblerX86_64::call): Follow Win64 ABI spec. * jit/JITStubsMSVC64.asm: Added. * jit/Repatch.cpp: (JSC::emitPutTransitionStub): Compile fix. * jit/ThunkGenerators.cpp: (JSC::nativeForGenerator): Follow Win64 ABI spec. * llint/LLIntData.cpp: (JSC::LLInt::Data::performAssertions): Ditto. * llint/LLIntOfflineAsmConfig.h: Enable new llint backend for Win64. * llint/LowLevelInterpreter.asm: Implement new Win64 backend, and follow Win64 ABI spec. * llint/LowLevelInterpreter64.asm: Ditto. * offlineasm/asm.rb: Compile fix. * offlineasm/backends.rb: Add new llint backend for Win64. * offlineasm/settings.rb: Compile fix. * offlineasm/x86.rb: Implement new llint Win64 backend. Source/WTF: Patch by peavo@outlook.com <peavo@outlook.com> on 2014-06-25 Reviewed by Mark Lam. * wtf/Platform.h: Enable LLINT and JIT for Win64. Canonical link: https://commits.webkit.org/152278@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-06-25 16:37:19 +00:00
#define OFFLINE_ASM_X86_64_WIN 0
Fix the build of a universal binary with ARMv7k of JavaScriptCore. https://bugs.webkit.org/show_bug.cgi?id=145143 Reviewed by Geoffrey Garen. The offlineasm works in 3 phases: Phase 1: Parse the llint asm files for config options and desired offsets. Let's say the offlineasm discovers C unique options and O unique offsets. The offlineasm will then generate a LLIntDesiredOffsets.h file with C x C build configurations, each with a set of O offsets. Each of these build configurations is given a unique configuration index number. Phase 2: Compile the LLIntDesiredOffsets.h file into a JSCLLIntOffsetsExtractor binary. If we're building a fat binary with 2 configurations: armv7, and armv7k, then the fat binary will contain 2 blobs of offsets, one for each of these build configurations. Phase 3: Parse the llint asm files and emit asm code using the offsets that are extracted from the JSCLLIntOffsetsExtractor binary for the corresponding configuration index number. In the pre-existing code, there are no "if ARMv7k" statements in the llint asm source. As a result, OFFLINE_ASM_ARMv7k is not one of the config options in the set of C unique options. For armv7k builds, OFFLINE_ASM_ARMv7 is also true. As a result, for an armv7k target, we will end up building armv7 source. In general, this is fine except: 1. armv7k has different alignment requirements from armv7. Hence, their offset values (in JSCLLIntOffsetsExtractor) will be different. 2. The offlineasm was never told that it needed to make a different configuration for armv7k builds. Hence, the armv7k build of LLIntDesiredOffsets.h will build the armv7 configuration, and consequently, the armv7k blob of offsets in JSCLLIntOffsetsExtractor will have the same configuration index number as the armv7 blob of offsets. In phase 3, when the offlineasm parses the JSCLLIntOffsetsExtractor fat binary looking for the armv7 build's configuration index number, it discovers the armv7k blob which has the same configuration number. As a result, it erroneously thinks the armv7k offsets are appropriate for emitting armv7 code. Needless to say, armv7 code using armv7k offsets will lead to incorrect behavior and all round badness. The fix is to add a simple "if ARMv7k" statement to the llint asm files. While the if statement has no body, it does make the offlineasm aware of the need for ARMv7k as a configuration option. As a result, it will generate an armv7k variant configuration in the LLIntDesiredOffsets.h file with its own unique configuration index number. With that, the JSCLLIntOffsetsExtractor fat binary will no longer have duplicate configuration index numbers for the armv7 and armv7k blobs of offsets, and the issue is resolved. * llint/LLIntOfflineAsmConfig.h: * llint/LowLevelInterpreter.asm: Canonical link: https://commits.webkit.org/163177@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184581 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-19 19:31:57 +00:00
#define OFFLINE_ASM_ARMv7k 0
#define OFFLINE_ASM_ARMv7s 0
#define OFFLINE_ASM_MIPS 0
LLInt C loop backend. https://bugs.webkit.org/show_bug.cgi?id=91052. Patch by Mark Lam <mark.lam@apple.com> on 2012-09-01 Reviewed by Filip Pizlo. Source/JavaScriptCore: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::bytecodeOffset): * interpreter/Interpreter.cpp: (JSC::Interpreter::execute): (JSC::Interpreter::executeCall): (JSC::Interpreter::executeConstruct): (JSC): * interpreter/Interpreter.h: * jit/JITStubs.h: (JITStackFrame): (JSC): * llint/LLIntCLoop.cpp: Added. (JSC): (LLInt): (JSC::LLInt::CLoop::initialize): (JSC::LLInt::CLoop::catchRoutineFor): (JSC::LLInt::CLoop::hostCodeEntryFor): (JSC::LLInt::CLoop::jsCodeEntryWithArityCheckFor): (JSC::LLInt::CLoop::jsCodeEntryFor): * llint/LLIntCLoop.h: Added. (JSC): (LLInt): (CLoop): * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC): * llint/LLIntOfflineAsmConfig.h: * llint/LLIntOpcode.h: * llint/LLIntThunks.cpp: (LLInt): * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter.cpp: (LLInt): (JSC::LLInt::Ints2Double): (JSC): (JSC::CLoop::execute): * llint/LowLevelInterpreter.h: (JSC): * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * offlineasm/asm.rb: * offlineasm/backends.rb: * offlineasm/cloop.rb: Added. * offlineasm/instructions.rb: * runtime/Executable.h: (ExecutableBase): (JSC::ExecutableBase::hostCodeEntryFor): (JSC::ExecutableBase::jsCodeEntryFor): (JSC::ExecutableBase::jsCodeWithArityCheckEntryFor): (JSC::ExecutableBase::catchRoutineFor): (NativeExecutable): * runtime/JSValue.h: (JSC): (LLInt): (JSValue): * runtime/JSValueInlineMethods.h: (JSC): (JSC::JSValue::JSValue): * runtime/Options.cpp: (JSC::Options::initialize): Source/WTF: Added configs for the llint C loop backend. * wtf/Platform.h: Canonical link: https://commits.webkit.org/113532@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-01 17:36:51 +00:00
[JSC] Enable LLInt ASM interpreter on X64 and ARM64 in non JIT configuration https://bugs.webkit.org/show_bug.cgi?id=189778 Reviewed by Keith Miller. .: ENABLE_SAMPLING_PROFILER does not depend on ENABLE_JIT now since it can be used with LLInt ASM interpreter. * Source/cmake/WebKitFeatures.cmake: Source/JavaScriptCore: LLInt ASM interpreter is 2x and 15% faster than CLoop interpreter on Linux and macOS respectively. We would like to enable it for non JIT configurations in X86_64 and ARM64. This patch enables LLInt for non JIT builds in X86_64 and ARM64 architectures. Previously, we switch LLInt ASM interpreter and CLoop by using ENABLE(JIT) configuration. But it is wrong in the new scenario since we have a build configuration that uses LLInt ASM interpreter and JIT is disabled. We introduce ENABLE(C_LOOP) option, which represents that we use CLoop. And we replace ENABLE(JIT) with ENABLE(C_LOOP) if the previous ENABLE(JIT) is essentially just related to LLInt ASM interpreter and not related to JIT. We also replace some ENABLE(JIT) configurations with ENABLE(ASSEMBLER). ENABLE(ASSEMBLER) is now enabled even if we disable JIT since MacroAssembler has machine register information that is used in LLInt ASM interpreter. * API/tests/PingPongStackOverflowTest.cpp: (testPingPongStackOverflow): * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MaxFrameExtentForSlowPathCall.h: * bytecode/CallReturnOffsetToBytecodeOffset.h: Removed. It is no longer used. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::finishCreation): * bytecode/CodeBlock.h: (JSC::CodeBlock::calleeSaveRegisters const): (JSC::CodeBlock::numberOfLLIntBaselineCalleeSaveRegisters): (JSC::CodeBlock::llintBaselineCalleeSaveSpaceAsVirtualRegisters): (JSC::CodeBlock::calleeSaveSpaceAsVirtualRegisters): * bytecode/Opcode.h: (JSC::padOpcodeName): * heap/Heap.cpp: (JSC::Heap::gatherJSStackRoots): (JSC::Heap::stopThePeriphery): * interpreter/CLoopStack.cpp: * interpreter/CLoopStack.h: * interpreter/CLoopStackInlines.h: * interpreter/EntryFrame.h: * interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): (JSC::UnwindFunctor::copyCalleeSavesToEntryFrameCalleeSavesBuffer const): * interpreter/Interpreter.h: * interpreter/StackVisitor.cpp: (JSC::StackVisitor::Frame::calleeSaveRegisters): * interpreter/VMEntryRecord.h: * jit/ExecutableAllocator.h: * jit/FPRInfo.h: (WTF::printInternal): * jit/GPRInfo.cpp: * jit/GPRInfo.h: (WTF::printInternal): * jit/HostCallReturnValue.cpp: (JSC::getHostCallReturnValueWithExecState): Moved. They are used in LLInt ASM interpreter too. * jit/HostCallReturnValue.h: * jit/JITOperations.cpp: (JSC::getHostCallReturnValueWithExecState): Deleted. * jit/JITOperationsMSVC64.cpp: * jit/Reg.cpp: * jit/Reg.h: * jit/RegisterAtOffset.cpp: * jit/RegisterAtOffset.h: * jit/RegisterAtOffsetList.cpp: * jit/RegisterAtOffsetList.h: * jit/RegisterMap.h: * jit/RegisterSet.cpp: * jit/RegisterSet.h: * jit/TempRegisterSet.cpp: * jit/TempRegisterSet.h: * llint/LLIntCLoop.cpp: * llint/LLIntCLoop.h: * llint/LLIntData.cpp: (JSC::LLInt::initialize): (JSC::LLInt::Data::performAssertions): * llint/LLIntData.h: * llint/LLIntOfflineAsmConfig.h: * llint/LLIntOpcode.h: * llint/LLIntPCRanges.h: * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): * llint/LLIntSlowPaths.h: * llint/LLIntThunks.cpp: * llint/LowLevelInterpreter.cpp: * llint/LowLevelInterpreter.h: * runtime/JSCJSValue.h: * runtime/MachineContext.h: * runtime/SamplingProfiler.cpp: (JSC::SamplingProfiler::processUnverifiedStackTraces): Enable SamplingProfiler for LLInt ASM interpreter with non JIT configuration. * runtime/TestRunnerUtils.cpp: (JSC::optimizeNextInvocation): * runtime/VM.cpp: (JSC::VM::VM): (JSC::VM::getHostFunction): (JSC::VM::updateSoftReservedZoneSize): (JSC::sanitizeStackForVM): (JSC::VM::committedStackByteCount): * runtime/VM.h: * runtime/VMInlines.h: (JSC::VM::ensureStackCapacityFor): (JSC::VM::isSafeToRecurseSoft const): Source/WTF: This patch adds ENABLE(C_LOOP) which indicates we use CLoop as the interpreter. Previously, we used !ENABLE(JIT) for this configuration. But now, we have a build configuration that has LLInt ASM interpreter (not CLoop) and !ENABLE(JIT). We enable LLInt ASM interpreter for non JIT environment in X86_64 and ARM64 architectures. And we enable ENABLE(ASSEMBLER) for non JIT environment since it offers machine register information which is used for LLInt and SamplingProfiler. * wtf/Platform.h: Canonical link: https://commits.webkit.org/204834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236381 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-09-22 05:26:44 +00:00
#else // ENABLE(C_LOOP)
LLInt C loop backend. https://bugs.webkit.org/show_bug.cgi?id=91052. Patch by Mark Lam <mark.lam@apple.com> on 2012-09-01 Reviewed by Filip Pizlo. Source/JavaScriptCore: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::bytecodeOffset): * interpreter/Interpreter.cpp: (JSC::Interpreter::execute): (JSC::Interpreter::executeCall): (JSC::Interpreter::executeConstruct): (JSC): * interpreter/Interpreter.h: * jit/JITStubs.h: (JITStackFrame): (JSC): * llint/LLIntCLoop.cpp: Added. (JSC): (LLInt): (JSC::LLInt::CLoop::initialize): (JSC::LLInt::CLoop::catchRoutineFor): (JSC::LLInt::CLoop::hostCodeEntryFor): (JSC::LLInt::CLoop::jsCodeEntryWithArityCheckFor): (JSC::LLInt::CLoop::jsCodeEntryFor): * llint/LLIntCLoop.h: Added. (JSC): (LLInt): (CLoop): * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC): * llint/LLIntOfflineAsmConfig.h: * llint/LLIntOpcode.h: * llint/LLIntThunks.cpp: (LLInt): * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter.cpp: (LLInt): (JSC::LLInt::Ints2Double): (JSC): (JSC::CLoop::execute): * llint/LowLevelInterpreter.h: (JSC): * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * offlineasm/asm.rb: * offlineasm/backends.rb: * offlineasm/cloop.rb: Added. * offlineasm/instructions.rb: * runtime/Executable.h: (ExecutableBase): (JSC::ExecutableBase::hostCodeEntryFor): (JSC::ExecutableBase::jsCodeEntryFor): (JSC::ExecutableBase::jsCodeWithArityCheckEntryFor): (JSC::ExecutableBase::catchRoutineFor): (NativeExecutable): * runtime/JSValue.h: (JSC): (LLInt): (JSValue): * runtime/JSValueInlineMethods.h: (JSC): (JSC::JSValue::JSValue): * runtime/Options.cpp: (JSC::Options::initialize): Source/WTF: Added configs for the llint C loop backend. * wtf/Platform.h: Canonical link: https://commits.webkit.org/113532@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-01 17:36:51 +00:00
#define OFFLINE_ASM_C_LOOP 0
[JSC] Implement op_wide16 / op_wide32 and introduce 16bit version bytecode https://bugs.webkit.org/show_bug.cgi?id=197979 Reviewed by Filip Pizlo. JSTests: * stress/16bit-code.js: Added. (shouldBe): * stress/32bit-code.js: Added. (shouldBe): Source/JavaScriptCore: This patch introduces 16bit bytecode size. Previously, we had two versions of bytecodes, 8bit and 32bit. However, in Gmail, we found that a lot of bytecodes get 32bit because they do not fit in 8bit. 8bit is very small and large function easily emits a lot of 32bit bytecodes because of large VirtualRegister number etc. But they almost always fit in 16bit. If we can have 16bit version of bytecode, we can make most of the current 32bit bytecodes 16bit and save memory. We rename rename op_wide to op_wide32 and introduce op_wide16. The mechanism is similar to old op_wide. When we get op_wide16, the following bytecode data is 16bit, and we execute 16bit version of bytecode in LLInt. We also disable this op_wide16 feature in Windows CLoop, which is used in AppleWin port. When the code size of CLoop::execute increases, MSVC starts generating CLoop::execute function with very large stack allocation requirement. Even before introducing this 16bit bytecode, CLoop::execute in AppleWin takes almost 100KB stack height. After introducing this, it becomes 160KB. While the semantics of the function is correctly compiled, such a large stack allocation is not essentially necessary, and this leads to stack overflow errors quite easily, and tests fail with AppleWin port because it starts throwing stack overflow range error in various places. In this patch, for now, we just disable op_wide16 feature for AppleWin so that CLoop::execute takes 100KB stack allocation because this patch is not focusing on fixing AppleWin's CLoop issue. We introduce a new backend type for LLInt, "C_LOOP_WIN". "C_LOOP_WIN" do not generate wide16 version of code to reduce the code size of CLoop::execute. In the future, we should investigate whether this MSVC issue is fixed in Visual Studio 2019. Or we should consider always enabling ASM LLInt for Windows. This patch improves Gmail by 7MB at least. * CMakeLists.txt: * bytecode/BytecodeConventions.h: * bytecode/BytecodeDumper.cpp: (JSC::BytecodeDumper<Block>::dumpBlock): * bytecode/BytecodeList.rb: * bytecode/BytecodeRewriter.h: (JSC::BytecodeRewriter::Fragment::align): * bytecode/BytecodeUseDef.h: (JSC::computeUsesForBytecodeOffset): (JSC::computeDefsForBytecodeOffset): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::finishCreation): * bytecode/CodeBlock.h: (JSC::CodeBlock::metadataTable const): * bytecode/Fits.h: * bytecode/Instruction.h: (JSC::Instruction::opcodeID const): (JSC::Instruction::isWide16 const): (JSC::Instruction::isWide32 const): (JSC::Instruction::hasMetadata const): (JSC::Instruction::sizeShiftAmount const): (JSC::Instruction::size const): (JSC::Instruction::wide16 const): (JSC::Instruction::wide32 const): (JSC::Instruction::isWide const): Deleted. (JSC::Instruction::wide const): Deleted. * bytecode/InstructionStream.h: (JSC::InstructionStreamWriter::write): * bytecode/Opcode.h: * bytecode/OpcodeSize.h: * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::alignWideOpcode16): (JSC::BytecodeGenerator::alignWideOpcode32): (JSC::BytecodeGenerator::emitGetByVal): Previously, we always emit 32bit op_get_by_val for bytecodes in `for-in` context because its operand can be replaced to the other VirtualRegister later. But if we know that replacing VirtualRegister can fit in 8bit / 16bit a-priori, we should not emit 32bit version. We expose OpXXX::checkWithoutMetadataID to check whether we could potentially compact the bytecode for the given operands. (JSC::BytecodeGenerator::emitYieldPoint): (JSC::StructureForInContext::finalize): (JSC::BytecodeGenerator::alignWideOpcode): Deleted. * bytecompiler/BytecodeGenerator.h: (JSC::BytecodeGenerator::write): * dfg/DFGCapabilities.cpp: (JSC::DFG::capabilityLevel): * generator/Argument.rb: * generator/DSL.rb: * generator/Metadata.rb: * generator/Opcode.rb: A little bit weird but checkImpl's argument must be reference. We are relying on that BoundLabel is once modified in this check phase, and the modified BoundLabel will be used when emitting the code. If checkImpl copies the passed BoundLabel, this modification will be discarded in this checkImpl function and make the code generation broken. * generator/Section.rb: * jit/JITExceptions.cpp: (JSC::genericUnwind): * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC::LLInt::opcodeMapWide16): (JSC::LLInt::opcodeMapWide32): (JSC::LLInt::getOpcodeWide16): (JSC::LLInt::getOpcodeWide32): (JSC::LLInt::getWide16CodePtr): (JSC::LLInt::getWide32CodePtr): (JSC::LLInt::opcodeMapWide): Deleted. (JSC::LLInt::getOpcodeWide): Deleted. (JSC::LLInt::getWideCodePtr): Deleted. * llint/LLIntOfflineAsmConfig.h: * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): * llint/LLIntSlowPaths.h: * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter.cpp: (JSC::CLoop::execute): * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * offlineasm/arm.rb: * offlineasm/arm64.rb: * offlineasm/asm.rb: * offlineasm/backends.rb: * offlineasm/cloop.rb: * offlineasm/instructions.rb: * offlineasm/mips.rb: * offlineasm/x86.rb: Load operation with sign extension should also have the extended size information. For example, loadbs should be converted to loadbsi for 32bit sign extension (and loadbsq for 64bit sign extension). And use loadbsq / loadhsq for loading VirtualRegister information in LowLevelInterpreter64 since they will be used for pointer arithmetic and they are using machine register width. * parser/ResultType.h: (JSC::OperandTypes::OperandTypes): (JSC::OperandTypes::first const): (JSC::OperandTypes::second const): (JSC::OperandTypes::bits): (JSC::OperandTypes::fromBits): (): Deleted. (JSC::OperandTypes::toInt): Deleted. (JSC::OperandTypes::fromInt): Deleted. We reduce sizeof(OperandTypes) from unsigned to uint16_t, which guarantees that OperandTypes always fit in 16bit bytecode. Canonical link: https://commits.webkit.org/212412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-05-30 21:40:35 +00:00
#define OFFLINE_ASM_C_LOOP_WIN 0
LLInt C loop backend. https://bugs.webkit.org/show_bug.cgi?id=91052. Patch by Mark Lam <mark.lam@apple.com> on 2012-09-01 Reviewed by Filip Pizlo. Source/JavaScriptCore: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::bytecodeOffset): * interpreter/Interpreter.cpp: (JSC::Interpreter::execute): (JSC::Interpreter::executeCall): (JSC::Interpreter::executeConstruct): (JSC): * interpreter/Interpreter.h: * jit/JITStubs.h: (JITStackFrame): (JSC): * llint/LLIntCLoop.cpp: Added. (JSC): (LLInt): (JSC::LLInt::CLoop::initialize): (JSC::LLInt::CLoop::catchRoutineFor): (JSC::LLInt::CLoop::hostCodeEntryFor): (JSC::LLInt::CLoop::jsCodeEntryWithArityCheckFor): (JSC::LLInt::CLoop::jsCodeEntryFor): * llint/LLIntCLoop.h: Added. (JSC): (LLInt): (CLoop): * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC): * llint/LLIntOfflineAsmConfig.h: * llint/LLIntOpcode.h: * llint/LLIntThunks.cpp: (LLInt): * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter.cpp: (LLInt): (JSC::LLInt::Ints2Double): (JSC): (JSC::CLoop::execute): * llint/LowLevelInterpreter.h: (JSC): * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * offlineasm/asm.rb: * offlineasm/backends.rb: * offlineasm/cloop.rb: Added. * offlineasm/instructions.rb: * runtime/Executable.h: (ExecutableBase): (JSC::ExecutableBase::hostCodeEntryFor): (JSC::ExecutableBase::jsCodeEntryFor): (JSC::ExecutableBase::jsCodeWithArityCheckEntryFor): (JSC::ExecutableBase::catchRoutineFor): (NativeExecutable): * runtime/JSValue.h: (JSC): (LLInt): (JSValue): * runtime/JSValueInlineMethods.h: (JSC): (JSC::JSValue::JSValue): * runtime/Options.cpp: (JSC::Options::initialize): Source/WTF: Added configs for the llint C loop backend. * wtf/Platform.h: Canonical link: https://commits.webkit.org/113532@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-01 17:36:51 +00:00
#if CPU(X86) && !COMPILER(MSVC)
JSC should be a triple-tier VM https://bugs.webkit.org/show_bug.cgi?id=75812 <rdar://problem/10079694> Source/JavaScriptCore: Reviewed by Gavin Barraclough. Implemented an interpreter that uses the JIT's calling convention. This interpreter is called LLInt, or the Low Level Interpreter. JSC will now will start by executing code in LLInt and will only tier up to the old JIT after the code is proven hot. LLInt is written in a modified form of our macro assembly. This new macro assembly is compiled by an offline assembler (see offlineasm), which implements many modern conveniences such as a Turing-complete CPS-based macro language and direct access to relevant C++ type information (basically offsets of fields and sizes of structs/classes). Code executing in LLInt appears to the rest of the JSC world "as if" it were executing in the old JIT. Hence, things like exception handling and cross-execution-engine calls just work and require pretty much no additional overhead. This interpreter is 2-2.5x faster than our old interpreter on SunSpider, V8, and Kraken. With triple-tiering turned on, we're neutral on SunSpider, V8, and Kraken, but appear to get a double-digit improvement on real-world websites due to a huge reduction in the amount of JIT'ing. * CMakeLists.txt: * GNUmakefile.am: * GNUmakefile.list.am: * JavaScriptCore.pri: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * assembler/LinkBuffer.h: * assembler/MacroAssemblerCodeRef.h: (MacroAssemblerCodePtr): (JSC::MacroAssemblerCodePtr::createFromExecutableAddress): * bytecode/BytecodeConventions.h: Added. * bytecode/CallLinkStatus.cpp: (JSC::CallLinkStatus::computeFromLLInt): (JSC): (JSC::CallLinkStatus::computeFor): * bytecode/CallLinkStatus.h: (JSC::CallLinkStatus::isSet): (JSC::CallLinkStatus::operator!): (CallLinkStatus): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::CodeBlock): (JSC::CodeBlock::~CodeBlock): (JSC::CodeBlock::finalizeUnconditionally): (JSC::CodeBlock::stronglyVisitStrongReferences): (JSC): (JSC::CodeBlock::unlinkCalls): (JSC::CodeBlock::unlinkIncomingCalls): (JSC::CodeBlock::bytecodeOffset): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::ProgramCodeBlock::jitCompileImpl): (JSC::EvalCodeBlock::jitCompileImpl): (JSC::FunctionCodeBlock::jitCompileImpl): * bytecode/CodeBlock.h: (JSC): (CodeBlock): (JSC::CodeBlock::baselineVersion): (JSC::CodeBlock::linkIncomingCall): (JSC::CodeBlock::bytecodeOffset): (JSC::CodeBlock::jitCompile): (JSC::CodeBlock::hasOptimizedReplacement): (JSC::CodeBlock::addPropertyAccessInstruction): (JSC::CodeBlock::addGlobalResolveInstruction): (JSC::CodeBlock::addLLIntCallLinkInfo): (JSC::CodeBlock::addGlobalResolveInfo): (JSC::CodeBlock::numberOfMethodCallLinkInfos): (JSC::CodeBlock::valueProfilePredictionForBytecodeOffset): (JSC::CodeBlock::likelyToTakeSlowCase): (JSC::CodeBlock::couldTakeSlowCase): (JSC::CodeBlock::likelyToTakeSpecialFastCase): (JSC::CodeBlock::likelyToTakeDeepestSlowCase): (JSC::CodeBlock::likelyToTakeAnySlowCase): (JSC::CodeBlock::addFrequentExitSite): (JSC::CodeBlock::dontJITAnytimeSoon): (JSC::CodeBlock::jitAfterWarmUp): (JSC::CodeBlock::jitSoon): (JSC::CodeBlock::llintExecuteCounter): (ProgramCodeBlock): (EvalCodeBlock): (FunctionCodeBlock): * bytecode/GetByIdStatus.cpp: (JSC::GetByIdStatus::computeFromLLInt): (JSC): (JSC::GetByIdStatus::computeFor): * bytecode/GetByIdStatus.h: (JSC::GetByIdStatus::GetByIdStatus): (JSC::GetByIdStatus::wasSeenInJIT): (GetByIdStatus): * bytecode/Instruction.h: (JSC): (JSC::Instruction::Instruction): (Instruction): * bytecode/LLIntCallLinkInfo.h: Added. (JSC): (JSC::LLIntCallLinkInfo::LLIntCallLinkInfo): (LLIntCallLinkInfo): (JSC::LLIntCallLinkInfo::~LLIntCallLinkInfo): (JSC::LLIntCallLinkInfo::isLinked): (JSC::LLIntCallLinkInfo::unlink): * bytecode/MethodCallLinkStatus.cpp: (JSC::MethodCallLinkStatus::computeFor): * bytecode/Opcode.cpp: (JSC): * bytecode/Opcode.h: (JSC): (JSC::padOpcodeName): * bytecode/PutByIdStatus.cpp: (JSC::PutByIdStatus::computeFromLLInt): (JSC): (JSC::PutByIdStatus::computeFor): * bytecode/PutByIdStatus.h: (PutByIdStatus): * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitResolve): (JSC::BytecodeGenerator::emitResolveWithBase): (JSC::BytecodeGenerator::emitGetById): (JSC::BytecodeGenerator::emitPutById): (JSC::BytecodeGenerator::emitDirectPutById): (JSC::BytecodeGenerator::emitCall): (JSC::BytecodeGenerator::emitConstruct): (JSC::BytecodeGenerator::emitCatch): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): (JSC::DFG::ByteCodeParser::handleInlining): (JSC::DFG::ByteCodeParser::parseBlock): * dfg/DFGCapabilities.h: (JSC::DFG::canCompileOpcode): * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGOperations.cpp: * heap/Heap.h: (JSC): (JSC::Heap::firstAllocatorWithoutDestructors): (Heap): * heap/MarkStack.cpp: (JSC::visitChildren): * heap/MarkedAllocator.h: (JSC): (MarkedAllocator): * heap/MarkedSpace.h: (JSC): (MarkedSpace): (JSC::MarkedSpace::firstAllocator): * interpreter/CallFrame.cpp: (JSC): (JSC::CallFrame::bytecodeOffsetForNonDFGCode): (JSC::CallFrame::setBytecodeOffsetForNonDFGCode): (JSC::CallFrame::currentVPC): (JSC::CallFrame::setCurrentVPC): (JSC::CallFrame::trueCallerFrame): * interpreter/CallFrame.h: (JSC::ExecState::hasReturnPC): (JSC::ExecState::clearReturnPC): (ExecState): (JSC::ExecState::bytecodeOffsetForNonDFGCode): (JSC::ExecState::currentVPC): (JSC::ExecState::setCurrentVPC): * interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): (JSC::Interpreter::~Interpreter): (JSC): (JSC::Interpreter::initialize): (JSC::Interpreter::isOpcode): (JSC::Interpreter::unwindCallFrame): (JSC::getCallerInfo): (JSC::Interpreter::privateExecute): (JSC::Interpreter::retrieveLastCaller): * interpreter/Interpreter.h: (JSC): (Interpreter): (JSC::Interpreter::getOpcode): (JSC::Interpreter::getOpcodeID): (JSC::Interpreter::classicEnabled): * interpreter/RegisterFile.h: (JSC): (RegisterFile): * jit/ExecutableAllocator.h: (JSC): * jit/HostCallReturnValue.cpp: Added. (JSC): (JSC::getHostCallReturnValueWithExecState): * jit/HostCallReturnValue.h: Added. (JSC): (JSC::initializeHostCallReturnValue): * jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile): * jit/JITCode.h: (JSC::JITCode::isOptimizingJIT): (JITCode): (JSC::JITCode::isBaselineCode): (JSC::JITCode::JITCode): * jit/JITDriver.h: (JSC::jitCompileIfAppropriate): (JSC::jitCompileFunctionIfAppropriate): * jit/JITExceptions.cpp: (JSC::jitThrow): * jit/JITInlineMethods.h: (JSC::JIT::updateTopCallFrame): * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): (JSC): * jit/JITStubs.h: (JSC): * jit/JSInterfaceJIT.h: * llint: Added. * llint/LLIntCommon.h: Added. * llint/LLIntData.cpp: Added. (LLInt): (JSC::LLInt::Data::Data): (JSC::LLInt::Data::performAssertions): (JSC::LLInt::Data::~Data): * llint/LLIntData.h: Added. (JSC): (LLInt): (Data): (JSC::LLInt::Data::exceptionInstructions): (JSC::LLInt::Data::opcodeMap): (JSC::LLInt::Data::performAssertions): * llint/LLIntEntrypoints.cpp: Added. (LLInt): (JSC::LLInt::getFunctionEntrypoint): (JSC::LLInt::getEvalEntrypoint): (JSC::LLInt::getProgramEntrypoint): * llint/LLIntEntrypoints.h: Added. (JSC): (LLInt): (JSC::LLInt::getEntrypoint): * llint/LLIntExceptions.cpp: Added. (LLInt): (JSC::LLInt::interpreterThrowInCaller): (JSC::LLInt::returnToThrowForThrownException): (JSC::LLInt::returnToThrow): (JSC::LLInt::callToThrow): * llint/LLIntExceptions.h: Added. (JSC): (LLInt): * llint/LLIntOfflineAsmConfig.h: Added. * llint/LLIntOffsetsExtractor.cpp: Added. (JSC): (LLIntOffsetsExtractor): (JSC::LLIntOffsetsExtractor::dummy): (main): * llint/LLIntSlowPaths.cpp: Added. (LLInt): (JSC::LLInt::llint_trace_operand): (JSC::LLInt::llint_trace_value): (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::traceFunctionPrologue): (JSC::LLInt::shouldJIT): (JSC::LLInt::entryOSR): (JSC::LLInt::resolveGlobal): (JSC::LLInt::getByVal): (JSC::LLInt::handleHostCall): (JSC::LLInt::setUpCall): (JSC::LLInt::genericCall): * llint/LLIntSlowPaths.h: Added. (JSC): (LLInt): * llint/LLIntThunks.cpp: Added. (LLInt): (JSC::LLInt::generateThunkWithJumpTo): (JSC::LLInt::functionForCallEntryThunkGenerator): (JSC::LLInt::functionForConstructEntryThunkGenerator): (JSC::LLInt::functionForCallArityCheckThunkGenerator): (JSC::LLInt::functionForConstructArityCheckThunkGenerator): (JSC::LLInt::evalEntryThunkGenerator): (JSC::LLInt::programEntryThunkGenerator): * llint/LLIntThunks.h: Added. (JSC): (LLInt): * llint/LowLevelInterpreter.asm: Added. * llint/LowLevelInterpreter.cpp: Added. * llint/LowLevelInterpreter.h: Added. * offlineasm: Added. * offlineasm/armv7.rb: Added. * offlineasm/asm.rb: Added. * offlineasm/ast.rb: Added. * offlineasm/backends.rb: Added. * offlineasm/generate_offset_extractor.rb: Added. * offlineasm/instructions.rb: Added. * offlineasm/offset_extractor_constants.rb: Added. * offlineasm/offsets.rb: Added. * offlineasm/opt.rb: Added. * offlineasm/parser.rb: Added. * offlineasm/registers.rb: Added. * offlineasm/self_hash.rb: Added. * offlineasm/settings.rb: Added. * offlineasm/transform.rb: Added. * offlineasm/x86.rb: Added. * runtime/CodeSpecializationKind.h: Added. (JSC): * runtime/CommonSlowPaths.h: (JSC::CommonSlowPaths::arityCheckFor): (CommonSlowPaths): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC): (JSC::EvalExecutable::jitCompile): (JSC::samplingDescription): (JSC::EvalExecutable::compileInternal): (JSC::ProgramExecutable::jitCompile): (JSC::ProgramExecutable::compileInternal): (JSC::FunctionExecutable::baselineCodeBlockFor): (JSC::FunctionExecutable::jitCompileForCall): (JSC::FunctionExecutable::jitCompileForConstruct): (JSC::FunctionExecutable::compileForCallInternal): (JSC::FunctionExecutable::compileForConstructInternal): * runtime/Executable.h: (JSC): (EvalExecutable): (ProgramExecutable): (FunctionExecutable): (JSC::FunctionExecutable::jitCompileFor): * runtime/ExecutionHarness.h: Added. (JSC): (JSC::prepareForExecution): (JSC::prepareFunctionForExecution): * runtime/JSArray.h: (JSC): (JSArray): * runtime/JSCell.h: (JSC): (JSCell): * runtime/JSFunction.h: (JSC): (JSFunction): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): * runtime/JSGlobalData.h: (JSC): (JSGlobalData): * runtime/JSGlobalObject.h: (JSC): (JSGlobalObject): * runtime/JSObject.h: (JSC): (JSObject): (JSFinalObject): * runtime/JSPropertyNameIterator.h: (JSC): (JSPropertyNameIterator): * runtime/JSString.h: (JSC): (JSString): * runtime/JSTypeInfo.h: (JSC): (TypeInfo): * runtime/JSValue.cpp: (JSC::JSValue::description): * runtime/JSValue.h: (LLInt): (JSValue): * runtime/JSVariableObject.h: (JSC): (JSVariableObject): * runtime/Options.cpp: (Options): (JSC::Options::initializeOptions): * runtime/Options.h: (Options): * runtime/ScopeChain.h: (JSC): (ScopeChainNode): * runtime/Structure.cpp: (JSC::Structure::addPropertyTransition): * runtime/Structure.h: (JSC): (Structure): * runtime/StructureChain.h: (JSC): (StructureChain): * wtf/InlineASM.h: * wtf/Platform.h: * wtf/SentinelLinkedList.h: (SentinelLinkedList): (WTF::SentinelLinkedList::isEmpty): * wtf/text/StringImpl.h: (JSC): (StringImpl): Source/WebCore: Reviewed by Gavin Barraclough. No new tests, because there is no change in behavior. * CMakeLists.txt: Source/WebKit: Reviewed by Gavin Barraclough. Changed EFL's build system to include a new directory in JavaScriptCore. * CMakeLists.txt: Tools: Reviewed by Gavin Barraclough. Changed EFL's build system to include a new directory in JavaScriptCore. * DumpRenderTree/efl/CMakeLists.txt: Canonical link: https://commits.webkit.org/96248@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@108444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-22 05:23:19 +00:00
#define OFFLINE_ASM_X86 1
#else
#define OFFLINE_ASM_X86 0
#endif
#if CPU(X86) && COMPILER(MSVC)
#define OFFLINE_ASM_X86_WIN 1
#else
#define OFFLINE_ASM_X86_WIN 0
#endif
Fix the build of a universal binary with ARMv7k of JavaScriptCore. https://bugs.webkit.org/show_bug.cgi?id=145143 Reviewed by Geoffrey Garen. The offlineasm works in 3 phases: Phase 1: Parse the llint asm files for config options and desired offsets. Let's say the offlineasm discovers C unique options and O unique offsets. The offlineasm will then generate a LLIntDesiredOffsets.h file with C x C build configurations, each with a set of O offsets. Each of these build configurations is given a unique configuration index number. Phase 2: Compile the LLIntDesiredOffsets.h file into a JSCLLIntOffsetsExtractor binary. If we're building a fat binary with 2 configurations: armv7, and armv7k, then the fat binary will contain 2 blobs of offsets, one for each of these build configurations. Phase 3: Parse the llint asm files and emit asm code using the offsets that are extracted from the JSCLLIntOffsetsExtractor binary for the corresponding configuration index number. In the pre-existing code, there are no "if ARMv7k" statements in the llint asm source. As a result, OFFLINE_ASM_ARMv7k is not one of the config options in the set of C unique options. For armv7k builds, OFFLINE_ASM_ARMv7 is also true. As a result, for an armv7k target, we will end up building armv7 source. In general, this is fine except: 1. armv7k has different alignment requirements from armv7. Hence, their offset values (in JSCLLIntOffsetsExtractor) will be different. 2. The offlineasm was never told that it needed to make a different configuration for armv7k builds. Hence, the armv7k build of LLIntDesiredOffsets.h will build the armv7 configuration, and consequently, the armv7k blob of offsets in JSCLLIntOffsetsExtractor will have the same configuration index number as the armv7 blob of offsets. In phase 3, when the offlineasm parses the JSCLLIntOffsetsExtractor fat binary looking for the armv7 build's configuration index number, it discovers the armv7k blob which has the same configuration number. As a result, it erroneously thinks the armv7k offsets are appropriate for emitting armv7 code. Needless to say, armv7 code using armv7k offsets will lead to incorrect behavior and all round badness. The fix is to add a simple "if ARMv7k" statement to the llint asm files. While the if statement has no body, it does make the offlineasm aware of the need for ARMv7k as a configuration option. As a result, it will generate an armv7k variant configuration in the LLIntDesiredOffsets.h file with its own unique configuration index number. With that, the JSCLLIntOffsetsExtractor fat binary will no longer have duplicate configuration index numbers for the armv7 and armv7k blobs of offsets, and the issue is resolved. * llint/LLIntOfflineAsmConfig.h: * llint/LowLevelInterpreter.asm: Canonical link: https://commits.webkit.org/163177@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184581 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-19 19:31:57 +00:00
#ifdef __ARM_ARCH_7K__
#define OFFLINE_ASM_ARMv7k 1
#else
#define OFFLINE_ASM_ARMv7k 0
#endif
#ifdef __ARM_ARCH_7S__
#define OFFLINE_ASM_ARMv7s 1
#else
#define OFFLINE_ASM_ARMv7s 0
#endif
JSC should be a triple-tier VM https://bugs.webkit.org/show_bug.cgi?id=75812 <rdar://problem/10079694> Source/JavaScriptCore: Reviewed by Gavin Barraclough. Implemented an interpreter that uses the JIT's calling convention. This interpreter is called LLInt, or the Low Level Interpreter. JSC will now will start by executing code in LLInt and will only tier up to the old JIT after the code is proven hot. LLInt is written in a modified form of our macro assembly. This new macro assembly is compiled by an offline assembler (see offlineasm), which implements many modern conveniences such as a Turing-complete CPS-based macro language and direct access to relevant C++ type information (basically offsets of fields and sizes of structs/classes). Code executing in LLInt appears to the rest of the JSC world "as if" it were executing in the old JIT. Hence, things like exception handling and cross-execution-engine calls just work and require pretty much no additional overhead. This interpreter is 2-2.5x faster than our old interpreter on SunSpider, V8, and Kraken. With triple-tiering turned on, we're neutral on SunSpider, V8, and Kraken, but appear to get a double-digit improvement on real-world websites due to a huge reduction in the amount of JIT'ing. * CMakeLists.txt: * GNUmakefile.am: * GNUmakefile.list.am: * JavaScriptCore.pri: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * assembler/LinkBuffer.h: * assembler/MacroAssemblerCodeRef.h: (MacroAssemblerCodePtr): (JSC::MacroAssemblerCodePtr::createFromExecutableAddress): * bytecode/BytecodeConventions.h: Added. * bytecode/CallLinkStatus.cpp: (JSC::CallLinkStatus::computeFromLLInt): (JSC): (JSC::CallLinkStatus::computeFor): * bytecode/CallLinkStatus.h: (JSC::CallLinkStatus::isSet): (JSC::CallLinkStatus::operator!): (CallLinkStatus): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::CodeBlock): (JSC::CodeBlock::~CodeBlock): (JSC::CodeBlock::finalizeUnconditionally): (JSC::CodeBlock::stronglyVisitStrongReferences): (JSC): (JSC::CodeBlock::unlinkCalls): (JSC::CodeBlock::unlinkIncomingCalls): (JSC::CodeBlock::bytecodeOffset): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::ProgramCodeBlock::jitCompileImpl): (JSC::EvalCodeBlock::jitCompileImpl): (JSC::FunctionCodeBlock::jitCompileImpl): * bytecode/CodeBlock.h: (JSC): (CodeBlock): (JSC::CodeBlock::baselineVersion): (JSC::CodeBlock::linkIncomingCall): (JSC::CodeBlock::bytecodeOffset): (JSC::CodeBlock::jitCompile): (JSC::CodeBlock::hasOptimizedReplacement): (JSC::CodeBlock::addPropertyAccessInstruction): (JSC::CodeBlock::addGlobalResolveInstruction): (JSC::CodeBlock::addLLIntCallLinkInfo): (JSC::CodeBlock::addGlobalResolveInfo): (JSC::CodeBlock::numberOfMethodCallLinkInfos): (JSC::CodeBlock::valueProfilePredictionForBytecodeOffset): (JSC::CodeBlock::likelyToTakeSlowCase): (JSC::CodeBlock::couldTakeSlowCase): (JSC::CodeBlock::likelyToTakeSpecialFastCase): (JSC::CodeBlock::likelyToTakeDeepestSlowCase): (JSC::CodeBlock::likelyToTakeAnySlowCase): (JSC::CodeBlock::addFrequentExitSite): (JSC::CodeBlock::dontJITAnytimeSoon): (JSC::CodeBlock::jitAfterWarmUp): (JSC::CodeBlock::jitSoon): (JSC::CodeBlock::llintExecuteCounter): (ProgramCodeBlock): (EvalCodeBlock): (FunctionCodeBlock): * bytecode/GetByIdStatus.cpp: (JSC::GetByIdStatus::computeFromLLInt): (JSC): (JSC::GetByIdStatus::computeFor): * bytecode/GetByIdStatus.h: (JSC::GetByIdStatus::GetByIdStatus): (JSC::GetByIdStatus::wasSeenInJIT): (GetByIdStatus): * bytecode/Instruction.h: (JSC): (JSC::Instruction::Instruction): (Instruction): * bytecode/LLIntCallLinkInfo.h: Added. (JSC): (JSC::LLIntCallLinkInfo::LLIntCallLinkInfo): (LLIntCallLinkInfo): (JSC::LLIntCallLinkInfo::~LLIntCallLinkInfo): (JSC::LLIntCallLinkInfo::isLinked): (JSC::LLIntCallLinkInfo::unlink): * bytecode/MethodCallLinkStatus.cpp: (JSC::MethodCallLinkStatus::computeFor): * bytecode/Opcode.cpp: (JSC): * bytecode/Opcode.h: (JSC): (JSC::padOpcodeName): * bytecode/PutByIdStatus.cpp: (JSC::PutByIdStatus::computeFromLLInt): (JSC): (JSC::PutByIdStatus::computeFor): * bytecode/PutByIdStatus.h: (PutByIdStatus): * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitResolve): (JSC::BytecodeGenerator::emitResolveWithBase): (JSC::BytecodeGenerator::emitGetById): (JSC::BytecodeGenerator::emitPutById): (JSC::BytecodeGenerator::emitDirectPutById): (JSC::BytecodeGenerator::emitCall): (JSC::BytecodeGenerator::emitConstruct): (JSC::BytecodeGenerator::emitCatch): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): (JSC::DFG::ByteCodeParser::handleInlining): (JSC::DFG::ByteCodeParser::parseBlock): * dfg/DFGCapabilities.h: (JSC::DFG::canCompileOpcode): * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGOperations.cpp: * heap/Heap.h: (JSC): (JSC::Heap::firstAllocatorWithoutDestructors): (Heap): * heap/MarkStack.cpp: (JSC::visitChildren): * heap/MarkedAllocator.h: (JSC): (MarkedAllocator): * heap/MarkedSpace.h: (JSC): (MarkedSpace): (JSC::MarkedSpace::firstAllocator): * interpreter/CallFrame.cpp: (JSC): (JSC::CallFrame::bytecodeOffsetForNonDFGCode): (JSC::CallFrame::setBytecodeOffsetForNonDFGCode): (JSC::CallFrame::currentVPC): (JSC::CallFrame::setCurrentVPC): (JSC::CallFrame::trueCallerFrame): * interpreter/CallFrame.h: (JSC::ExecState::hasReturnPC): (JSC::ExecState::clearReturnPC): (ExecState): (JSC::ExecState::bytecodeOffsetForNonDFGCode): (JSC::ExecState::currentVPC): (JSC::ExecState::setCurrentVPC): * interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): (JSC::Interpreter::~Interpreter): (JSC): (JSC::Interpreter::initialize): (JSC::Interpreter::isOpcode): (JSC::Interpreter::unwindCallFrame): (JSC::getCallerInfo): (JSC::Interpreter::privateExecute): (JSC::Interpreter::retrieveLastCaller): * interpreter/Interpreter.h: (JSC): (Interpreter): (JSC::Interpreter::getOpcode): (JSC::Interpreter::getOpcodeID): (JSC::Interpreter::classicEnabled): * interpreter/RegisterFile.h: (JSC): (RegisterFile): * jit/ExecutableAllocator.h: (JSC): * jit/HostCallReturnValue.cpp: Added. (JSC): (JSC::getHostCallReturnValueWithExecState): * jit/HostCallReturnValue.h: Added. (JSC): (JSC::initializeHostCallReturnValue): * jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile): * jit/JITCode.h: (JSC::JITCode::isOptimizingJIT): (JITCode): (JSC::JITCode::isBaselineCode): (JSC::JITCode::JITCode): * jit/JITDriver.h: (JSC::jitCompileIfAppropriate): (JSC::jitCompileFunctionIfAppropriate): * jit/JITExceptions.cpp: (JSC::jitThrow): * jit/JITInlineMethods.h: (JSC::JIT::updateTopCallFrame): * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): (JSC): * jit/JITStubs.h: (JSC): * jit/JSInterfaceJIT.h: * llint: Added. * llint/LLIntCommon.h: Added. * llint/LLIntData.cpp: Added. (LLInt): (JSC::LLInt::Data::Data): (JSC::LLInt::Data::performAssertions): (JSC::LLInt::Data::~Data): * llint/LLIntData.h: Added. (JSC): (LLInt): (Data): (JSC::LLInt::Data::exceptionInstructions): (JSC::LLInt::Data::opcodeMap): (JSC::LLInt::Data::performAssertions): * llint/LLIntEntrypoints.cpp: Added. (LLInt): (JSC::LLInt::getFunctionEntrypoint): (JSC::LLInt::getEvalEntrypoint): (JSC::LLInt::getProgramEntrypoint): * llint/LLIntEntrypoints.h: Added. (JSC): (LLInt): (JSC::LLInt::getEntrypoint): * llint/LLIntExceptions.cpp: Added. (LLInt): (JSC::LLInt::interpreterThrowInCaller): (JSC::LLInt::returnToThrowForThrownException): (JSC::LLInt::returnToThrow): (JSC::LLInt::callToThrow): * llint/LLIntExceptions.h: Added. (JSC): (LLInt): * llint/LLIntOfflineAsmConfig.h: Added. * llint/LLIntOffsetsExtractor.cpp: Added. (JSC): (LLIntOffsetsExtractor): (JSC::LLIntOffsetsExtractor::dummy): (main): * llint/LLIntSlowPaths.cpp: Added. (LLInt): (JSC::LLInt::llint_trace_operand): (JSC::LLInt::llint_trace_value): (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::traceFunctionPrologue): (JSC::LLInt::shouldJIT): (JSC::LLInt::entryOSR): (JSC::LLInt::resolveGlobal): (JSC::LLInt::getByVal): (JSC::LLInt::handleHostCall): (JSC::LLInt::setUpCall): (JSC::LLInt::genericCall): * llint/LLIntSlowPaths.h: Added. (JSC): (LLInt): * llint/LLIntThunks.cpp: Added. (LLInt): (JSC::LLInt::generateThunkWithJumpTo): (JSC::LLInt::functionForCallEntryThunkGenerator): (JSC::LLInt::functionForConstructEntryThunkGenerator): (JSC::LLInt::functionForCallArityCheckThunkGenerator): (JSC::LLInt::functionForConstructArityCheckThunkGenerator): (JSC::LLInt::evalEntryThunkGenerator): (JSC::LLInt::programEntryThunkGenerator): * llint/LLIntThunks.h: Added. (JSC): (LLInt): * llint/LowLevelInterpreter.asm: Added. * llint/LowLevelInterpreter.cpp: Added. * llint/LowLevelInterpreter.h: Added. * offlineasm: Added. * offlineasm/armv7.rb: Added. * offlineasm/asm.rb: Added. * offlineasm/ast.rb: Added. * offlineasm/backends.rb: Added. * offlineasm/generate_offset_extractor.rb: Added. * offlineasm/instructions.rb: Added. * offlineasm/offset_extractor_constants.rb: Added. * offlineasm/offsets.rb: Added. * offlineasm/opt.rb: Added. * offlineasm/parser.rb: Added. * offlineasm/registers.rb: Added. * offlineasm/self_hash.rb: Added. * offlineasm/settings.rb: Added. * offlineasm/transform.rb: Added. * offlineasm/x86.rb: Added. * runtime/CodeSpecializationKind.h: Added. (JSC): * runtime/CommonSlowPaths.h: (JSC::CommonSlowPaths::arityCheckFor): (CommonSlowPaths): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC): (JSC::EvalExecutable::jitCompile): (JSC::samplingDescription): (JSC::EvalExecutable::compileInternal): (JSC::ProgramExecutable::jitCompile): (JSC::ProgramExecutable::compileInternal): (JSC::FunctionExecutable::baselineCodeBlockFor): (JSC::FunctionExecutable::jitCompileForCall): (JSC::FunctionExecutable::jitCompileForConstruct): (JSC::FunctionExecutable::compileForCallInternal): (JSC::FunctionExecutable::compileForConstructInternal): * runtime/Executable.h: (JSC): (EvalExecutable): (ProgramExecutable): (FunctionExecutable): (JSC::FunctionExecutable::jitCompileFor): * runtime/ExecutionHarness.h: Added. (JSC): (JSC::prepareForExecution): (JSC::prepareFunctionForExecution): * runtime/JSArray.h: (JSC): (JSArray): * runtime/JSCell.h: (JSC): (JSCell): * runtime/JSFunction.h: (JSC): (JSFunction): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): * runtime/JSGlobalData.h: (JSC): (JSGlobalData): * runtime/JSGlobalObject.h: (JSC): (JSGlobalObject): * runtime/JSObject.h: (JSC): (JSObject): (JSFinalObject): * runtime/JSPropertyNameIterator.h: (JSC): (JSPropertyNameIterator): * runtime/JSString.h: (JSC): (JSString): * runtime/JSTypeInfo.h: (JSC): (TypeInfo): * runtime/JSValue.cpp: (JSC::JSValue::description): * runtime/JSValue.h: (LLInt): (JSValue): * runtime/JSVariableObject.h: (JSC): (JSVariableObject): * runtime/Options.cpp: (Options): (JSC::Options::initializeOptions): * runtime/Options.h: (Options): * runtime/ScopeChain.h: (JSC): (ScopeChainNode): * runtime/Structure.cpp: (JSC::Structure::addPropertyTransition): * runtime/Structure.h: (JSC): (Structure): * runtime/StructureChain.h: (JSC): (StructureChain): * wtf/InlineASM.h: * wtf/Platform.h: * wtf/SentinelLinkedList.h: (SentinelLinkedList): (WTF::SentinelLinkedList::isEmpty): * wtf/text/StringImpl.h: (JSC): (StringImpl): Source/WebCore: Reviewed by Gavin Barraclough. No new tests, because there is no change in behavior. * CMakeLists.txt: Source/WebKit: Reviewed by Gavin Barraclough. Changed EFL's build system to include a new directory in JavaScriptCore. * CMakeLists.txt: Tools: Reviewed by Gavin Barraclough. Changed EFL's build system to include a new directory in JavaScriptCore. * DumpRenderTree/efl/CMakeLists.txt: Canonical link: https://commits.webkit.org/96248@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@108444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-22 05:23:19 +00:00
#if CPU(ARM_THUMB2)
#define OFFLINE_ASM_ARMv7 1
#else
#define OFFLINE_ASM_ARMv7 0
#endif
#if CPU(X86_64) && !COMPILER(MSVC)
#define OFFLINE_ASM_X86_64 1
#else
#define OFFLINE_ASM_X86_64 0
#endif
#if CPU(X86_64) && COMPILER(MSVC)
[Win64] ASM LLINT is not enabled. https://bugs.webkit.org/show_bug.cgi?id=130638 Source/JavaScriptCore: This patch adds a new LLINT assembler backend for Win64, and implements it. It makes adjustments to follow the Win64 ABI spec. where it's found to be needed. Also, LLINT and JIT is enabled for Win64. Patch by peavo@outlook.com <peavo@outlook.com> on 2014-06-25 Reviewed by Mark Lam. * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Added JITStubsMSVC64.asm. * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: Ditto. * JavaScriptCore/JavaScriptCore.vcxproj/jsc/jscCommon.props: Increased stack size to avoid stack overflow in tests. * JavaScriptCore.vcxproj/LLInt/LLIntAssembly/build-LLIntAssembly.sh: Generate assembler source file for Win64. * assembler/MacroAssemblerX86_64.h: (JSC::MacroAssemblerX86_64::call): Follow Win64 ABI spec. * jit/JITStubsMSVC64.asm: Added. * jit/Repatch.cpp: (JSC::emitPutTransitionStub): Compile fix. * jit/ThunkGenerators.cpp: (JSC::nativeForGenerator): Follow Win64 ABI spec. * llint/LLIntData.cpp: (JSC::LLInt::Data::performAssertions): Ditto. * llint/LLIntOfflineAsmConfig.h: Enable new llint backend for Win64. * llint/LowLevelInterpreter.asm: Implement new Win64 backend, and follow Win64 ABI spec. * llint/LowLevelInterpreter64.asm: Ditto. * offlineasm/asm.rb: Compile fix. * offlineasm/backends.rb: Add new llint backend for Win64. * offlineasm/settings.rb: Compile fix. * offlineasm/x86.rb: Implement new llint Win64 backend. Source/WTF: Patch by peavo@outlook.com <peavo@outlook.com> on 2014-06-25 Reviewed by Mark Lam. * wtf/Platform.h: Enable LLINT and JIT for Win64. Canonical link: https://commits.webkit.org/152278@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-06-25 16:37:19 +00:00
#define OFFLINE_ASM_X86_64_WIN 1
#else
#define OFFLINE_ASM_X86_64_WIN 0
#endif
#if CPU(MIPS)
#define OFFLINE_ASM_MIPS 1
#else
#define OFFLINE_ASM_MIPS 0
#endif
[iOS] Upstream JavaScriptCore support for ARM64 https://bugs.webkit.org/show_bug.cgi?id=122762 Source/JavaScriptCore: Reviewed by Oliver Hunt and Filip Pizlo. * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/JavaScriptCore.xcconfig: * Configurations/ToolExecutable.xcconfig: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/ARM64Assembler.h: Added. * assembler/AbstractMacroAssembler.h: (JSC::isARM64): (JSC::AbstractMacroAssembler::Label::Label): (JSC::AbstractMacroAssembler::Jump::Jump): (JSC::AbstractMacroAssembler::Jump::link): (JSC::AbstractMacroAssembler::Jump::linkTo): (JSC::AbstractMacroAssembler::CachedTempRegister::CachedTempRegister): (JSC::AbstractMacroAssembler::CachedTempRegister::registerIDInvalidate): (JSC::AbstractMacroAssembler::CachedTempRegister::registerIDNoInvalidate): (JSC::AbstractMacroAssembler::CachedTempRegister::value): (JSC::AbstractMacroAssembler::CachedTempRegister::setValue): (JSC::AbstractMacroAssembler::CachedTempRegister::invalidate): (JSC::AbstractMacroAssembler::invalidateAllTempRegisters): (JSC::AbstractMacroAssembler::isTempRegisterValid): (JSC::AbstractMacroAssembler::clearTempRegisterValid): (JSC::AbstractMacroAssembler::setTempRegisterValid): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): (JSC::LinkBuffer::linkCode): * assembler/LinkBuffer.h: * assembler/MacroAssembler.h: (JSC::MacroAssembler::isPtrAlignedAddressOffset): (JSC::MacroAssembler::pushToSave): (JSC::MacroAssembler::popToRestore): (JSC::MacroAssembler::patchableBranchTest32): * assembler/MacroAssemblerARM64.h: Added. * assembler/MacroAssemblerARMv7.h: * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGOSRExitCompiler32_64.cpp: (JSC::DFG::OSRExitCompiler::compileExit): * dfg/DFGOSRExitCompiler64.cpp: (JSC::DFG::OSRExitCompiler::compileExit): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileArithDiv): (JSC::DFG::SpeculativeJIT::compileArithMod): * disassembler/ARM64/A64DOpcode.cpp: Added. * disassembler/ARM64/A64DOpcode.h: Added. * disassembler/ARM64Disassembler.cpp: Added. * heap/MachineStackMarker.cpp: (JSC::getPlatformThreadRegisters): (JSC::otherThreadStackPointer): * heap/Region.h: * jit/AssemblyHelpers.h: (JSC::AssemblyHelpers::debugCall): * jit/CCallHelpers.h: * jit/ExecutableAllocator.h: * jit/FPRInfo.h: (JSC::FPRInfo::toRegister): (JSC::FPRInfo::toIndex): (JSC::FPRInfo::debugName): * jit/GPRInfo.h: (JSC::GPRInfo::toRegister): (JSC::GPRInfo::toIndex): (JSC::GPRInfo::debugName): * jit/JITInlines.h: (JSC::JIT::restoreArgumentReferenceForTrampoline): * jit/JITOperationWrappers.h: * jit/JITOperations.cpp: * jit/JITStubs.cpp: (JSC::performPlatformSpecificJITAssertions): (JSC::tryCachePutByID): * jit/JITStubs.h: (JSC::JITStackFrame::returnAddressSlot): * jit/JITStubsARM64.h: Added. * jit/JSInterfaceJIT.h: * jit/Repatch.cpp: (JSC::emitRestoreScratch): (JSC::generateProtoChainAccessStub): (JSC::tryCacheGetByID): (JSC::emitPutReplaceStub): (JSC::tryCachePutByID): (JSC::tryRepatchIn): * jit/ScratchRegisterAllocator.h: (JSC::ScratchRegisterAllocator::preserveReusedRegistersByPushing): (JSC::ScratchRegisterAllocator::restoreReusedRegistersByPopping): * jit/ThunkGenerators.cpp: (JSC::nativeForGenerator): (JSC::floorThunkGenerator): (JSC::ceilThunkGenerator): * jsc.cpp: (main): * llint/LLIntOfflineAsmConfig.h: * llint/LLIntSlowPaths.cpp: (JSC::LLInt::handleHostCall): * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter64.asm: * offlineasm/arm.rb: * offlineasm/arm64.rb: Added. * offlineasm/backends.rb: * offlineasm/instructions.rb: * offlineasm/risc.rb: * offlineasm/transform.rb: * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::alignCallFrameSizeInBytes): (JSC::Yarr::YarrGenerator::initCallFrame): (JSC::Yarr::YarrGenerator::removeCallFrame): (JSC::Yarr::YarrGenerator::generateEnter): * yarr/YarrJIT.h: Source/WTF: Reviewed by Oliver Hunt. * Configurations/Base.xcconfig: * wtf/Atomics.h: (WTF::weakCompareAndSwap): (WTF::armV7_dmb): * wtf/FastMalloc.cpp: * wtf/Platform.h: * wtf/dtoa.cpp: * wtf/dtoa/utils.h: * wtf/text/ASCIIFastPath.h: (WTF::copyLCharsFromUCharSource): * wtf/text/StringImpl.h: Canonical link: https://commits.webkit.org/140939@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157474 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-15 22:16:39 +00:00
#if CPU(ARM64)
#define OFFLINE_ASM_ARM64 1
#else
#define OFFLINE_ASM_ARM64 0
#endif
#if CPU(ARM64E)
#define OFFLINE_ASM_ARM64E 1
#undef OFFLINE_ASM_ARM64
#define OFFLINE_ASM_ARM64 0 // Pretend that ARM64 and ARM64E are mutually exclusive to please the offlineasm.
#else
#define OFFLINE_ASM_ARM64E 0
#endif
#if CPU(MIPS)
#ifdef WTF_MIPS_PIC
#define S(x) #x
#define SX(x) S(x)
#define OFFLINE_ASM_CPLOAD(reg) \
".set noreorder\n" \
".cpload " SX(reg) "\n" \
".set reorder\n"
#else
#define OFFLINE_ASM_CPLOAD(reg)
#endif
#endif
[JSC] Enable LLInt ASM interpreter on X64 and ARM64 in non JIT configuration https://bugs.webkit.org/show_bug.cgi?id=189778 Reviewed by Keith Miller. .: ENABLE_SAMPLING_PROFILER does not depend on ENABLE_JIT now since it can be used with LLInt ASM interpreter. * Source/cmake/WebKitFeatures.cmake: Source/JavaScriptCore: LLInt ASM interpreter is 2x and 15% faster than CLoop interpreter on Linux and macOS respectively. We would like to enable it for non JIT configurations in X86_64 and ARM64. This patch enables LLInt for non JIT builds in X86_64 and ARM64 architectures. Previously, we switch LLInt ASM interpreter and CLoop by using ENABLE(JIT) configuration. But it is wrong in the new scenario since we have a build configuration that uses LLInt ASM interpreter and JIT is disabled. We introduce ENABLE(C_LOOP) option, which represents that we use CLoop. And we replace ENABLE(JIT) with ENABLE(C_LOOP) if the previous ENABLE(JIT) is essentially just related to LLInt ASM interpreter and not related to JIT. We also replace some ENABLE(JIT) configurations with ENABLE(ASSEMBLER). ENABLE(ASSEMBLER) is now enabled even if we disable JIT since MacroAssembler has machine register information that is used in LLInt ASM interpreter. * API/tests/PingPongStackOverflowTest.cpp: (testPingPongStackOverflow): * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MaxFrameExtentForSlowPathCall.h: * bytecode/CallReturnOffsetToBytecodeOffset.h: Removed. It is no longer used. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::finishCreation): * bytecode/CodeBlock.h: (JSC::CodeBlock::calleeSaveRegisters const): (JSC::CodeBlock::numberOfLLIntBaselineCalleeSaveRegisters): (JSC::CodeBlock::llintBaselineCalleeSaveSpaceAsVirtualRegisters): (JSC::CodeBlock::calleeSaveSpaceAsVirtualRegisters): * bytecode/Opcode.h: (JSC::padOpcodeName): * heap/Heap.cpp: (JSC::Heap::gatherJSStackRoots): (JSC::Heap::stopThePeriphery): * interpreter/CLoopStack.cpp: * interpreter/CLoopStack.h: * interpreter/CLoopStackInlines.h: * interpreter/EntryFrame.h: * interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): (JSC::UnwindFunctor::copyCalleeSavesToEntryFrameCalleeSavesBuffer const): * interpreter/Interpreter.h: * interpreter/StackVisitor.cpp: (JSC::StackVisitor::Frame::calleeSaveRegisters): * interpreter/VMEntryRecord.h: * jit/ExecutableAllocator.h: * jit/FPRInfo.h: (WTF::printInternal): * jit/GPRInfo.cpp: * jit/GPRInfo.h: (WTF::printInternal): * jit/HostCallReturnValue.cpp: (JSC::getHostCallReturnValueWithExecState): Moved. They are used in LLInt ASM interpreter too. * jit/HostCallReturnValue.h: * jit/JITOperations.cpp: (JSC::getHostCallReturnValueWithExecState): Deleted. * jit/JITOperationsMSVC64.cpp: * jit/Reg.cpp: * jit/Reg.h: * jit/RegisterAtOffset.cpp: * jit/RegisterAtOffset.h: * jit/RegisterAtOffsetList.cpp: * jit/RegisterAtOffsetList.h: * jit/RegisterMap.h: * jit/RegisterSet.cpp: * jit/RegisterSet.h: * jit/TempRegisterSet.cpp: * jit/TempRegisterSet.h: * llint/LLIntCLoop.cpp: * llint/LLIntCLoop.h: * llint/LLIntData.cpp: (JSC::LLInt::initialize): (JSC::LLInt::Data::performAssertions): * llint/LLIntData.h: * llint/LLIntOfflineAsmConfig.h: * llint/LLIntOpcode.h: * llint/LLIntPCRanges.h: * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): * llint/LLIntSlowPaths.h: * llint/LLIntThunks.cpp: * llint/LowLevelInterpreter.cpp: * llint/LowLevelInterpreter.h: * runtime/JSCJSValue.h: * runtime/MachineContext.h: * runtime/SamplingProfiler.cpp: (JSC::SamplingProfiler::processUnverifiedStackTraces): Enable SamplingProfiler for LLInt ASM interpreter with non JIT configuration. * runtime/TestRunnerUtils.cpp: (JSC::optimizeNextInvocation): * runtime/VM.cpp: (JSC::VM::VM): (JSC::VM::getHostFunction): (JSC::VM::updateSoftReservedZoneSize): (JSC::sanitizeStackForVM): (JSC::VM::committedStackByteCount): * runtime/VM.h: * runtime/VMInlines.h: (JSC::VM::ensureStackCapacityFor): (JSC::VM::isSafeToRecurseSoft const): Source/WTF: This patch adds ENABLE(C_LOOP) which indicates we use CLoop as the interpreter. Previously, we used !ENABLE(JIT) for this configuration. But now, we have a build configuration that has LLInt ASM interpreter (not CLoop) and !ENABLE(JIT). We enable LLInt ASM interpreter for non JIT environment in X86_64 and ARM64 architectures. And we enable ENABLE(ASSEMBLER) for non JIT environment since it offers machine register information which is used for LLInt and SamplingProfiler. * wtf/Platform.h: Canonical link: https://commits.webkit.org/204834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236381 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-09-22 05:26:44 +00:00
#endif // ENABLE(C_LOOP)
#if USE(JSVALUE64)
#define OFFLINE_ASM_JSVALUE64 1
#else
#define OFFLINE_ASM_JSVALUE64 0
#endif
Support an inlined representation in JSValue of small BigInts ("BigInt32") https://bugs.webkit.org/show_bug.cgi?id=206182 Reviewed by Yusuke Suzuki. JSTests: I improved several of the tests to give more informative error messages in the process of fixing them. More interestingly I had to modify "missing-exception-check-in-string-compare" because it relied on "s1 == s1" resolving ropes, and we now just return true. * stress/big-int-division.js: (testDiv): * stress/big-int-left-shift-wrapped-value.js: (assert.sameValue): * stress/big-int-logical-not.js: (assert): * stress/big-int-mod-jit.js: * stress/big-int-right-shift-general.js: (testRightShift): * stress/big-int-type-of-proven-type.js: (assert): * stress/compare-strict-eq-on-various-types.js: (testAllTypesCall): * stress/ftl-string-strict-equality.js: * stress/missing-exception-check-in-string-compare.js: Source/JavaScriptCore: This patch attempts to optimize the performance of BigInts, when they are small (32 bit or less). It works by inlining them into JSValue on 64-bit platforms, avoiding the allocation of a JSBigInt. The bit pattern we use is 0000:XXXX:XXXX:0012 This representation works because of the following things: - It cannot be confused with a Double or Integer thanks to the top bits - It cannot be confused with a pointer to a Cell, thanks to bit 1 which is set to true - It cannot be confused with a pointer to wasm thanks to bit 0 which is set to false - It cannot be confused with true/false because bit 2 is set to false - It cannot be confused for null/undefined because bit 4 is set to true This entire change is gated by USE(BIGINT32), to make it easier to disable if it turns out to have bugs. It should also make it much easier to verify if a given bug comes from it or from something else. Note that in this patch we create BigInt32s when parsing small BigInt constants, and most operations (e.g. Add or BitOr) produce a BigInt32 if both of their operands are BigInt32, but we don't produce a BigInt32 from for example the substraction/division of two large heap-allocated JSBigInts, even if the result fits in 32-bits. As a result, small BigInts can now either be heap-allocated or inlined in the JSValue. This patch includes a significant refactor of various slow paths, which are now grouped together in Operations.h Because this increased the size of Operations.h significantly, I split the parts of Operations.h which are only used by the GC into Scribble.h, to avoid bloating compile times. In the DFG and FTL we now have 3 UseKinds for BigInts: HeapBigIntUse, BigInt32Use and AnyBigIntUse. The latter is useful when we know that we are receiving BigInts, but speculation indicates a mix of heap-allocated and small (inlined) big-ints. Unfortunately, a naive implementation of this patch significantly regresses the performance of StrictEq (and its variants), as it is no longer true that a cell and a non-cell cannot be equal. Before this patch, the code was jumping to a slow path if either: - at least one operand is a double - or both operands are cells Now, it also needs to jump to the slow path if at least one is a cell. To recover this performance cost, I significantly rewrote this code, from if (left is Cell && right is Cell) { if (left == right) return true; goto slowPath; } if (! left is Int32) { if (left is Number) goto slowPath } if (! right is Int32) { if (right is Number) goto slowPath } return left == right To the following: if (left is Double || right is Double) goto slowPath if (left == right) return true; if (left is Cell || right is Cell) goto slowPath return false; I believe this to be faster than just replacing (left is Cell && right is Cell) by an ||, because I found a bit-trick to check (left is Double || right is Double) which should help reduce the pressure on the branch predictor. Early JetStream2 tests appear to confirm that this patch is roughly neutral while it was a 0.5% regression before I used this trick, but the numbers are still too noisy, I plan to do more measurements before landing this patch. I don't yet have performance numbers for this patch on a BigInt benchmark, I will get such numbers before trying to land it, but I'd like some review in the meantime. * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/X86Assembler.h: (JSC::X86Assembler::X86InstructionFormatter::SingleInstructionBufferWriter::memoryModRM): * bytecode/ArithProfile.cpp: (JSC::ArithProfile<BitfieldType>::emitObserveResult): (JSC::ArithProfile<BitfieldType>::shouldEmitSetBigInt32 const): (JSC::ArithProfile<BitfieldType>::shouldEmitSetHeapBigInt const): (JSC::ArithProfile<BitfieldType>::emitSetHeapBigInt const): (JSC::ArithProfile<BitfieldType>::emitSetBigInt32 const): (WTF::printInternal): * bytecode/ArithProfile.h: (JSC::ObservedResults::didObserveNonInt32): (JSC::ObservedResults::didObserveBigInt): (JSC::ObservedResults::didObserveHeapBigInt): (JSC::ObservedResults::didObserveBigInt32): (JSC::ArithProfile::didObserveHeapBigInt const): (JSC::ArithProfile::didObserveBigInt32 const): (JSC::ArithProfile::setObservedHeapBigInt): (JSC::ArithProfile::setObservedBigInt32): (JSC::ArithProfile::observeResult): * bytecode/BytecodeList.rb: * bytecode/BytecodeLivenessAnalysisInlines.h: * bytecode/BytecodeUseDef.cpp: (JSC::computeUsesForBytecodeIndexImpl): (JSC::computeDefsForBytecodeIndexImpl): * bytecode/CodeBlock.cpp: * bytecode/DataFormat.h: * bytecode/MethodOfGettingAValueProfile.cpp: (JSC::MethodOfGettingAValueProfile::emitReportValue const): * bytecode/MethodOfGettingAValueProfile.h: * bytecode/SpeculatedType.cpp: (JSC::dumpSpeculation): (JSC::speculationFromClassInfo): (JSC::speculationFromStructure): (JSC::speculationFromValue): (JSC::speculationFromJSType): (JSC::leastUpperBoundOfStrictlyEquivalentSpeculations): * bytecode/SpeculatedType.h: (JSC::isBigInt32Speculation): (JSC::isHeapBigIntSpeculation): (JSC::isBigIntSpeculation): * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitEqualityOpImpl): (JSC::BytecodeGenerator::addBigIntConstant): * bytecompiler/BytecodeGenerator.h: * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::isToThisAnIdentity): (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::parseBlock): * dfg/DFGCapabilities.cpp: (JSC::DFG::capabilityLevel): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGConstantFoldingPhase.cpp: (JSC::DFG::ConstantFoldingPhase::foldConstants): * dfg/DFGDoesGC.cpp: (JSC::DFG::doesGC): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): (JSC::DFG::FixupPhase::fixupToThis): (JSC::DFG::FixupPhase::fixupToNumeric): (JSC::DFG::FixupPhase::observeUseKindOnNode): (JSC::DFG::FixupPhase::fixupCompareStrictEqAndSameValue): * dfg/DFGMayExit.cpp: * dfg/DFGNode.h: (JSC::DFG::Node::shouldSpeculateBigInt32): (JSC::DFG::Node::shouldSpeculateHeapBigInt): * dfg/DFGNodeType.h: * dfg/DFGOSRExit.cpp: (JSC::DFG::OSRExit::compileExit): * dfg/DFGOSRExit.h: * dfg/DFGOperations.cpp: * dfg/DFGOperations.h: * dfg/DFGPredictionPropagationPhase.cpp: * dfg/DFGSafeToExecute.h: (JSC::DFG::SafeToExecuteEdge::operator()): (JSC::DFG::safeToExecute): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compilePeepHoleBranch): (JSC::DFG::SpeculativeJIT::compileValueBitNot): (JSC::DFG::SpeculativeJIT::emitUntypedOrAnyBigIntBitOp): (JSC::DFG::SpeculativeJIT::compileValueBitwiseOp): (JSC::DFG::SpeculativeJIT::emitUntypedOrBigIntRightShiftBitOp): (JSC::DFG::SpeculativeJIT::compileValueLShiftOp): (JSC::DFG::SpeculativeJIT::compileValueBitRShift): (JSC::DFG::SpeculativeJIT::compileShiftOp): (JSC::DFG::SpeculativeJIT::compileValueAdd): (JSC::DFG::SpeculativeJIT::compileValueSub): (JSC::DFG::SpeculativeJIT::compileIncOrDec): (JSC::DFG::SpeculativeJIT::compileValueNegate): (JSC::DFG::SpeculativeJIT::compileValueMul): (JSC::DFG::SpeculativeJIT::compileValueDiv): (JSC::DFG::SpeculativeJIT::compileValueMod): (JSC::DFG::SpeculativeJIT::compileValuePow): (JSC::DFG::SpeculativeJIT::compare): (JSC::DFG::SpeculativeJIT::compileStrictEq): (JSC::DFG::SpeculativeJIT::speculateHeapBigInt): (JSC::DFG::SpeculativeJIT::speculate): (JSC::DFG::SpeculativeJIT::compileToNumeric): (JSC::DFG::SpeculativeJIT::compileHeapBigIntEquality): * dfg/DFGSpeculativeJIT.h: (JSC::DFG::SpeculateBigInt32Operand::SpeculateBigInt32Operand): (JSC::DFG::SpeculateBigInt32Operand::~SpeculateBigInt32Operand): (JSC::DFG::SpeculateBigInt32Operand::edge const): (JSC::DFG::SpeculateBigInt32Operand::node const): (JSC::DFG::SpeculateBigInt32Operand::gpr): (JSC::DFG::SpeculateBigInt32Operand::use): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::fillJSValue): (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq): (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeStrictEq): (JSC::DFG::SpeculativeJIT::fillSpeculateInt32Internal): (JSC::DFG::SpeculativeJIT::fillSpeculateCell): (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): (JSC::DFG::SpeculativeJIT::speculateBigInt32): (JSC::DFG::SpeculativeJIT::speculateAnyBigInt): (JSC::DFG::SpeculativeJIT::fillSpeculateBigInt32): (JSC::DFG::SpeculativeJIT::compileBigInt32Compare): (JSC::DFG::SpeculativeJIT::compilePeepHoleBigInt32Branch): (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGStrengthReductionPhase.cpp: (JSC::DFG::StrengthReductionPhase::handleNode): * dfg/DFGUseKind.cpp: (WTF::printInternal): * dfg/DFGUseKind.h: (JSC::DFG::typeFilterFor): (JSC::DFG::isCell): * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLCommonValues.cpp: (JSC::FTL::CommonValues::initializeConstants): * ftl/FTLCommonValues.h: * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileNode): (JSC::FTL::DFG::LowerDFGToB3::compileValueAdd): (JSC::FTL::DFG::LowerDFGToB3::compileValueSub): (JSC::FTL::DFG::LowerDFGToB3::compileValueMul): (JSC::FTL::DFG::LowerDFGToB3::compileBinaryMathIC): (JSC::FTL::DFG::LowerDFGToB3::compileValueDiv): (JSC::FTL::DFG::LowerDFGToB3::compileValueMod): (JSC::FTL::DFG::LowerDFGToB3::compileValuePow): (JSC::FTL::DFG::LowerDFGToB3::compileValueBitNot): (JSC::FTL::DFG::LowerDFGToB3::compileValueBitAnd): (JSC::FTL::DFG::LowerDFGToB3::compileValueBitOr): (JSC::FTL::DFG::LowerDFGToB3::compileValueBitXor): (JSC::FTL::DFG::LowerDFGToB3::compileValueBitRShift): (JSC::FTL::DFG::LowerDFGToB3::compileArithBitRShift): (JSC::FTL::DFG::LowerDFGToB3::compileArithBitLShift): (JSC::FTL::DFG::LowerDFGToB3::compileValueBitLShift): (JSC::FTL::DFG::LowerDFGToB3::compileBitURShift): (JSC::FTL::DFG::LowerDFGToB3::compileToNumeric): (JSC::FTL::DFG::LowerDFGToB3::compileCompareEq): (JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq): (JSC::FTL::DFG::LowerDFGToB3::compileIsBigInt): (JSC::FTL::DFG::LowerDFGToB3::emitBinarySnippet): (JSC::FTL::DFG::LowerDFGToB3::emitBinaryBitOpSnippet): (JSC::FTL::DFG::LowerDFGToB3::boolify): (JSC::FTL::DFG::LowerDFGToB3::buildTypeOf): (JSC::FTL::DFG::LowerDFGToB3::lowHeapBigInt): (JSC::FTL::DFG::LowerDFGToB3::lowBigInt32): (JSC::FTL::DFG::LowerDFGToB3::isBigInt32): (JSC::FTL::DFG::LowerDFGToB3::isNotBigInt32): (JSC::FTL::DFG::LowerDFGToB3::unboxBigInt32): (JSC::FTL::DFG::LowerDFGToB3::boxBigInt32): (JSC::FTL::DFG::LowerDFGToB3::isNotAnyBigInt): (JSC::FTL::DFG::LowerDFGToB3::speculate): (JSC::FTL::DFG::LowerDFGToB3::isNotHeapBigIntUnknownWhetherCell): (JSC::FTL::DFG::LowerDFGToB3::isNotHeapBigInt): (JSC::FTL::DFG::LowerDFGToB3::isHeapBigInt): (JSC::FTL::DFG::LowerDFGToB3::speculateHeapBigInt): (JSC::FTL::DFG::LowerDFGToB3::speculateHeapBigIntUnknownWhetherCell): (JSC::FTL::DFG::LowerDFGToB3::speculateBigInt32): (JSC::FTL::DFG::LowerDFGToB3::speculateAnyBigInt): * ftl/FTLOSRExitCompiler.cpp: (JSC::FTL::compileStub): * heap/HeapSnapshotBuilder.cpp: (JSC::HeapSnapshotBuilder::json): * heap/MarkedBlockInlines.h: * heap/PreciseAllocation.cpp: * inspector/agents/InspectorHeapAgent.cpp: (Inspector::InspectorHeapAgent::getPreview): * interpreter/Interpreter.cpp: (JSC::sizeOfVarargs): * jit/AssemblyHelpers.cpp: (JSC::AssemblyHelpers::emitConvertValueToBoolean): (JSC::AssemblyHelpers::branchIfValue): * jit/AssemblyHelpers.h: (JSC::AssemblyHelpers::branchIfBigInt32): (JSC::AssemblyHelpers::branchIfBigInt32KnownNotNumber): (JSC::AssemblyHelpers::branchIfNotBigInt32KnownNotNumber): (JSC::AssemblyHelpers::branchIfHeapBigInt): (JSC::AssemblyHelpers::branchIfNotHeapBigInt): (JSC::AssemblyHelpers::unboxBigInt32): (JSC::AssemblyHelpers::boxBigInt32): (JSC::AssemblyHelpers::emitTypeOf): * jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): * jit/JIT.h: * jit/JITArithmetic.cpp: (JSC::JIT::emit_op_negate): (JSC::JIT::emitSlow_op_negate): * jit/JITOpcodes.cpp: (JSC::JIT::emit_op_is_big_int): (JSC::JIT::compileOpStrictEq): (JSC::JIT::compileOpStrictEqJump): (JSC::JIT::emit_op_to_numeric): * jit/JITOpcodes32_64.cpp: (JSC::JIT::emit_op_is_big_int): (JSC::JIT::emit_op_to_numeric): * jit/JITOperations.cpp: * jit/JITOperations.h: * llint/LLIntOfflineAsmConfig.h: * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter64.asm: * parser/ParserArena.cpp: (JSC::IdentifierArena::makeBigIntDecimalIdentifier): * runtime/ArrayPrototype.cpp: * runtime/BigIntConstructor.cpp: (JSC::toBigInt): (JSC::callBigIntConstructor): * runtime/BigIntObject.cpp: (JSC::BigIntObject::create): (JSC::BigIntObject::finishCreation): * runtime/BigIntObject.h: * runtime/BigIntPrototype.cpp: (JSC::toThisBigIntValue): (JSC::bigIntProtoFuncToStringImpl): * runtime/CommonSlowPaths.cpp: (JSC::SLOW_PATH_DECL): (JSC::updateArithProfileForUnaryArithOp): (JSC::updateArithProfileForBinaryArithOp): * runtime/JSBigInt.cpp: (JSC::JSBigInt::createStructure): (JSC::JSBigInt::parseInt): (JSC::JSBigInt::stringToBigInt): (JSC::JSBigInt::inc): (JSC::JSBigInt::dec): (JSC::JSBigInt::bitwiseAnd): (JSC::JSBigInt::toStringGeneric): (JSC::JSBigInt::equalsToNumber): (JSC::JSBigInt::equalsToInt32): * runtime/JSBigInt.h: (JSC::asHeapBigInt): * runtime/JSCJSValue.cpp: (JSC::JSValue::toNumberSlowCase const): (JSC::JSValue::toObjectSlowCase const): (JSC::JSValue::toThisSlowCase const): (JSC::JSValue::synthesizePrototype const): (JSC::JSValue::dumpInContextAssumingStructure const): (JSC::JSValue::dumpForBacktrace const): (JSC::JSValue::toStringSlowCase const): * runtime/JSCJSValue.h: * runtime/JSCJSValueInlines.h: (JSC::JSValue::JSValue): (JSC::JSValue::asHeapBigInt const): (JSC::JSValue::isBigInt const): (JSC::JSValue::isHeapBigInt const): (JSC::JSValue::isBigInt32 const): (JSC::JSValue::bigInt32AsInt32 const): (JSC::JSValue::isPrimitive const): (JSC::JSValue::getPrimitiveNumber): (JSC::JSValue::toNumeric const): (JSC::JSValue::toBigIntOrInt32 const): (JSC::JSValue::equalSlowCaseInline): (JSC::JSValue::strictEqualForCells): (JSC::JSValue::strictEqual): (JSC::JSValue::pureStrictEqual): (JSC::JSValue::pureToBoolean const): * runtime/JSCell.cpp: (JSC::JSCell::put): (JSC::JSCell::putByIndex): (JSC::JSCell::toPrimitive const): (JSC::JSCell::getPrimitiveNumber const): (JSC::JSCell::toNumber const): (JSC::JSCell::toObjectSlow const): * runtime/JSCell.h: * runtime/JSCellInlines.h: (JSC::JSCell::isHeapBigInt const): (JSC::JSCell::toBoolean const): (JSC::JSCell::pureToBoolean const): * runtime/JSString.h: (JSC::JSValue::toBoolean const): * runtime/JSType.cpp: (WTF::printInternal): * runtime/JSType.h: * runtime/JSTypeInfo.h: * runtime/ObjectInitializationScope.cpp: * runtime/Operations.cpp: (JSC::jsAddSlowCase): (JSC::jsIsObjectTypeOrNull): * runtime/Operations.h: (JSC::compareBigIntToOtherPrimitive): (JSC::bigIntCompare): (JSC::jsLess): (JSC::jsLessEq): (JSC::arithmeticBinaryOp): (JSC::jsSub): (JSC::jsMul): (JSC::jsDiv): (JSC::jsRemainder): (JSC::jsPow): (JSC::jsInc): (JSC::jsDec): (JSC::jsBitwiseNot): (JSC::shift): (JSC::jsLShift): (JSC::jsRShift): (JSC::bitwiseBinaryOp): (JSC::jsBitwiseAnd): (JSC::jsBitwiseOr): (JSC::jsBitwiseXor): * runtime/Scribble.h: Copied from Source/JavaScriptCore/runtime/BigIntObject.h. (JSC::scribbleFreeCells): (JSC::isScribbledValue): (JSC::scribble): * runtime/StructureInlines.h: (JSC::prototypeForLookupPrimitiveImpl): Source/WTF: Add a USE(BIGINT32) flag. * wtf/PlatformUse.h: Canonical link: https://commits.webkit.org/223591@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260331 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-19 02:20:59 +00:00
#if USE(BIGINT32)
#define OFFLINE_ASM_BIGINT32 1
#else
#define OFFLINE_ASM_BIGINT32 0
#endif
Support arm64 CPUs with a 32-bit address space https://bugs.webkit.org/show_bug.cgi?id=190273 Reviewed by Michael Saboff. Source/JavaScriptCore: This patch adds support for arm64_32 in the LLInt. In order to make this work we needed to add a new type that reflects the size of a cpu register. This type is called CPURegister or UCPURegister for the unsigned version. Most places that used void* or intptr_t to refer to a register have been changed to use this new type. * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/ARM64Assembler.h: (JSC::isInt): (JSC::is4ByteAligned): (JSC::PairPostIndex::PairPostIndex): (JSC::PairPreIndex::PairPreIndex): (JSC::ARM64Assembler::readPointer): (JSC::ARM64Assembler::readCallTarget): (JSC::ARM64Assembler::computeJumpType): (JSC::ARM64Assembler::linkCompareAndBranch): (JSC::ARM64Assembler::linkConditionalBranch): (JSC::ARM64Assembler::linkTestAndBranch): (JSC::ARM64Assembler::loadRegisterLiteral): (JSC::ARM64Assembler::loadStoreRegisterPairPostIndex): (JSC::ARM64Assembler::loadStoreRegisterPairPreIndex): (JSC::ARM64Assembler::loadStoreRegisterPairOffset): (JSC::ARM64Assembler::loadStoreRegisterPairNonTemporal): (JSC::isInt7): Deleted. (JSC::isInt11): Deleted. * assembler/CPU.h: (JSC::isAddress64Bit): (JSC::isAddress32Bit): * assembler/MacroAssembler.h: (JSC::MacroAssembler::shouldBlind): * assembler/MacroAssemblerARM64.cpp: (JSC::MacroAssemblerARM64::collectCPUFeatures): * assembler/MacroAssemblerARM64.h: (JSC::MacroAssemblerARM64::load): (JSC::MacroAssemblerARM64::store): (JSC::MacroAssemblerARM64::isInIntRange): Deleted. * assembler/Printer.h: * assembler/ProbeContext.h: (JSC::Probe::CPUState::gpr): (JSC::Probe::CPUState::spr): (JSC::Probe::Context::gpr): (JSC::Probe::Context::spr): * b3/B3ConstPtrValue.h: * b3/B3StackmapSpecial.cpp: (JSC::B3::StackmapSpecial::isArgValidForRep): * b3/air/AirArg.h: (JSC::B3::Air::Arg::stackSlot const): (JSC::B3::Air::Arg::special const): * b3/air/testair.cpp: * b3/testb3.cpp: (JSC::B3::testStoreConstantPtr): (JSC::B3::testInterpreter): (JSC::B3::testAddShl32): (JSC::B3::testLoadBaseIndexShift32): * bindings/ScriptFunctionCall.cpp: (Deprecated::ScriptCallArgumentHandler::appendArgument): * bindings/ScriptFunctionCall.h: * bytecode/CodeBlock.cpp: (JSC::roundCalleeSaveSpaceAsVirtualRegisters): * dfg/DFGOSRExit.cpp: (JSC::DFG::restoreCalleeSavesFor): (JSC::DFG::saveCalleeSavesFor): (JSC::DFG::restoreCalleeSavesFromVMEntryFrameCalleeSavesBuffer): (JSC::DFG::copyCalleeSavesToVMEntryFrameCalleeSavesBuffer): * dfg/DFGOSRExitCompilerCommon.cpp: (JSC::DFG::reifyInlinedCallFrames): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * disassembler/UDis86Disassembler.cpp: (JSC::tryToDisassembleWithUDis86): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileWeakMapGet): * heap/MachineStackMarker.cpp: (JSC::copyMemory): * interpreter/CallFrame.h: (JSC::ExecState::returnPC const): (JSC::ExecState::hasReturnPC const): (JSC::ExecState::clearReturnPC): (JSC::ExecState::returnPCOffset): (JSC::ExecState::isGlobalExec const): (JSC::ExecState::setReturnPC): * interpreter/CalleeBits.h: (JSC::CalleeBits::boxWasm): (JSC::CalleeBits::isWasm const): (JSC::CalleeBits::asWasmCallee const): * interpreter/Interpreter.cpp: (JSC::UnwindFunctor::copyCalleeSavesToEntryFrameCalleeSavesBuffer const): * interpreter/VMEntryRecord.h: * jit/AssemblyHelpers.h: (JSC::AssemblyHelpers::clearStackFrame): * jit/RegisterAtOffset.h: (JSC::RegisterAtOffset::offsetAsIndex const): * jit/RegisterAtOffsetList.cpp: (JSC::RegisterAtOffsetList::RegisterAtOffsetList): * llint/LLIntData.cpp: (JSC::LLInt::Data::performAssertions): * llint/LLIntOfflineAsmConfig.h: * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter64.asm: * offlineasm/arm64.rb: * offlineasm/asm.rb: * offlineasm/ast.rb: * offlineasm/backends.rb: * offlineasm/parser.rb: * offlineasm/x86.rb: * runtime/BasicBlockLocation.cpp: (JSC::BasicBlockLocation::dumpData const): (JSC::BasicBlockLocation::emitExecuteCode const): * runtime/BasicBlockLocation.h: * runtime/HasOwnPropertyCache.h: * runtime/JSBigInt.cpp: (JSC::JSBigInt::inplaceMultiplyAdd): (JSC::JSBigInt::digitDiv): * runtime/JSBigInt.h: * runtime/JSObject.h: * runtime/Options.cpp: (JSC::jitEnabledByDefault): * runtime/Options.h: * runtime/RegExp.cpp: (JSC::RegExp::printTraceData): * runtime/SamplingProfiler.cpp: (JSC::CFrameWalker::walk): * runtime/SlowPathReturnType.h: (JSC::encodeResult): (JSC::decodeResult): * tools/SigillCrashAnalyzer.cpp: (JSC::SigillCrashAnalyzer::dumpCodeBlock): Source/WebCore: Fix missing namespace annotation. * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation): Source/WTF: Use WTF_CPU_ADDRESS64/32 to decide if the system is running on arm64_32. * wtf/MathExtras.h: (getLSBSet): * wtf/Platform.h: Canonical link: https://commits.webkit.org/205545@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237173 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-16 07:19:13 +00:00
#if CPU(ADDRESS64)
#define OFFLINE_ASM_ADDRESS64 1
#else
#define OFFLINE_ASM_ADDRESS64 0
#endif
PerformanceTests: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * JetStream2/wasm/HashSet.cpp: * StitchMarker/wtf/Assertions.h: * StitchMarker/wtf/DateMath.cpp: (WTF::initializeDates): * StitchMarker/wtf/HashTable.h: * StitchMarker/wtf/Hasher.h: (WTF::StringHasher::addCharacters): * StitchMarker/wtf/NeverDestroyed.h: (WTF::LazyNeverDestroyed::construct): * StitchMarker/wtf/StackBounds.h: (WTF::StackBounds::checkConsistency const): * StitchMarker/wtf/ValueCheck.h: * StitchMarker/wtf/Vector.h: (WTF::minCapacity>::checkConsistency): * StitchMarker/wtf/text/AtomicStringImpl.cpp: * StitchMarker/wtf/text/AtomicStringImpl.h: * StitchMarker/wtf/text/StringCommon.h: (WTF::hasPrefixWithLettersIgnoringASCIICaseCommon): * StitchMarker/wtf/text/StringImpl.h: * StitchMarker/wtf/text/SymbolImpl.h: * StitchMarker/wtf/text/UniquedStringImpl.h: Source/JavaScriptCore: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * API/tests/testapi.c: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::replaceWithLoad): (JSC::ARM64Assembler::replaceWithAddressComputation): * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::LocalWriter::LocalWriter): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): * assembler/ProbeStack.cpp: (JSC::Probe::Stack::Stack): * assembler/ProbeStack.h: * b3/B3FoldPathConstants.cpp: * b3/B3LowerToAir.cpp: * b3/B3MemoryValue.cpp: (JSC::B3::MemoryValue::MemoryValue): * b3/B3Opcode.cpp: * b3/B3Type.h: * b3/B3TypeMap.h: * b3/B3Width.h: * b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp: (JSC::B3::Air::GenerateAndAllocateRegisters::prepareForGeneration): (JSC::B3::Air::GenerateAndAllocateRegisters::generate): * b3/air/AirAllocateRegistersAndStackAndGenerateCode.h: * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirArg.cpp: * b3/air/AirArg.h: * b3/air/AirCode.h: * b3/air/AirEmitShuffle.cpp: (JSC::B3::Air::emitShuffle): * builtins/BuiltinExecutables.cpp: (JSC::BuiltinExecutables::createExecutable): * bytecode/AccessCase.cpp: * bytecode/AccessCase.h: * bytecode/CallVariant.cpp: (JSC::variantListWithVariant): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::ensureCatchLivenessIsComputedForBytecodeIndex): * bytecode/CodeBlockHash.cpp: (JSC::CodeBlockHash::dump const): * bytecode/StructureStubInfo.cpp: * bytecode/StructureStubInfo.h: * bytecompiler/NodesCodegen.cpp: (JSC::FunctionCallResolveNode::emitBytecode): * bytecompiler/RegisterID.h: (JSC::RegisterID::RegisterID): (JSC::RegisterID::setIndex): * debugger/Debugger.cpp: (JSC::Debugger::removeBreakpoint): * debugger/DebuggerEvalEnabler.h: (JSC::DebuggerEvalEnabler::DebuggerEvalEnabler): (JSC::DebuggerEvalEnabler::~DebuggerEvalEnabler): * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::observeTransitions): * dfg/DFGAbstractValue.cpp: * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::merge): (JSC::DFG::AbstractValue::checkConsistency const): (JSC::DFG::AbstractValue::assertIsRegistered const): * dfg/DFGArithMode.h: (JSC::DFG::doesOverflow): * dfg/DFGBasicBlock.cpp: (JSC::DFG::BasicBlock::BasicBlock): * dfg/DFGBasicBlock.h: (JSC::DFG::BasicBlock::didLink): * dfg/DFGCFAPhase.cpp: (JSC::DFG::CFAPhase::performBlockCFA): * dfg/DFGCommon.h: (JSC::DFG::validationEnabled): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::finalizeCatchEntrypoints): * dfg/DFGDesiredWatchpoints.h: * dfg/DFGDoesGC.cpp: (JSC::DFG::doesGC): * dfg/DFGEdge.h: (JSC::DFG::Edge::makeWord): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::finalizeOSREntrypoints): * dfg/DFGObjectAllocationSinkingPhase.cpp: * dfg/DFGSSAConversionPhase.cpp: (JSC::DFG::SSAConversionPhase::run): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::assertClear): * dfg/DFGSlowPathGenerator.h: (JSC::DFG::SlowPathGenerator::generate): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileCurrentBlock): (JSC::DFG::SpeculativeJIT::emitBinarySwitchStringRecurse): (JSC::DFG::SpeculativeJIT::emitAllocateButterfly): (JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize): (JSC::DFG::SpeculativeJIT::compileMakeRope): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::fillSpeculateCell): * dfg/DFGStructureAbstractValue.cpp: * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::assertIsRegistered const): * dfg/DFGVarargsForwardingPhase.cpp: * dfg/DFGVirtualRegisterAllocationPhase.cpp: (JSC::DFG::VirtualRegisterAllocationPhase::run): * ftl/FTLLink.cpp: (JSC::FTL::link): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::callPreflight): (JSC::FTL::DFG::LowerDFGToB3::callCheck): (JSC::FTL::DFG::LowerDFGToB3::crash): * ftl/FTLOperations.cpp: (JSC::FTL::operationMaterializeObjectInOSR): * heap/BlockDirectory.cpp: (JSC::BlockDirectory::assertNoUnswept): * heap/GCSegmentedArray.h: (JSC::GCArraySegment::GCArraySegment): * heap/GCSegmentedArrayInlines.h: (JSC::GCSegmentedArray<T>::clear): (JSC::GCSegmentedArray<T>::expand): (JSC::GCSegmentedArray<T>::validatePrevious): * heap/HandleSet.cpp: * heap/HandleSet.h: * heap/Heap.cpp: (JSC::Heap::updateAllocationLimits): * heap/Heap.h: * heap/MarkedBlock.cpp: * heap/MarkedBlock.h: (JSC::MarkedBlock::assertValidCell const): (JSC::MarkedBlock::assertMarksNotStale): * heap/MarkedSpace.cpp: (JSC::MarkedSpace::beginMarking): (JSC::MarkedSpace::endMarking): (JSC::MarkedSpace::assertNoUnswept): * heap/PreciseAllocation.cpp: * heap/PreciseAllocation.h: (JSC::PreciseAllocation::assertValidCell const): * heap/SlotVisitor.cpp: (JSC::SlotVisitor::SlotVisitor): (JSC::SlotVisitor::appendJSCellOrAuxiliary): * heap/SlotVisitor.h: * inspector/InspectorProtocolTypes.h: (Inspector::Protocol::BindingTraits<JSON::ArrayOf<T>>::assertValueHasExpectedType): * inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py: (CppProtocolTypesImplementationGenerator._generate_assertion_for_object_declaration): (CppProtocolTypesImplementationGenerator): (CppProtocolTypesImplementationGenerator._generate_assertion_for_enum): * inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result: * interpreter/FrameTracers.h: (JSC::JITOperationPrologueCallFrameTracer::JITOperationPrologueCallFrameTracer): * interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): * interpreter/Interpreter.h: * jit/AssemblyHelpers.cpp: (JSC::AssemblyHelpers::emitStoreStructureWithTypeInfo): * jit/AssemblyHelpers.h: (JSC::AssemblyHelpers::prepareCallOperation): * jit/BinarySwitch.cpp: (JSC::BinarySwitch::BinarySwitch): * jit/CCallHelpers.h: (JSC::CCallHelpers::setupStubArgs): * jit/CallFrameShuffler.cpp: (JSC::CallFrameShuffler::emitDeltaCheck): (JSC::CallFrameShuffler::prepareAny): * jit/JIT.cpp: (JSC::JIT::assertStackPointerOffset): (JSC::JIT::compileWithoutLinking): * jit/JITOpcodes.cpp: (JSC::JIT::emitSlow_op_loop_hint): * jit/JITPropertyAccess.cpp: (JSC::JIT::emit_op_get_from_scope): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::emit_op_get_from_scope): * jit/Repatch.cpp: (JSC::linkPolymorphicCall): * jit/ThunkGenerators.cpp: (JSC::emitPointerValidation): * llint/LLIntData.cpp: (JSC::LLInt::Data::performAssertions): * llint/LLIntOfflineAsmConfig.h: * parser/Lexer.cpp: * parser/Lexer.h: (JSC::isSafeBuiltinIdentifier): (JSC::Lexer<T>::lexExpectIdentifier): * runtime/ArgList.h: (JSC::MarkedArgumentBuffer::setNeedsOverflowCheck): (JSC::MarkedArgumentBuffer::clearNeedsOverflowCheck): * runtime/Butterfly.h: (JSC::ContiguousData::ContiguousData): (JSC::ContiguousData::Data::Data): * runtime/HashMapImpl.h: (JSC::HashMapImpl::checkConsistency const): (JSC::HashMapImpl::assertBufferIsEmpty const): * runtime/JSCellInlines.h: (JSC::JSCell::methodTable const): * runtime/JSFunction.cpp: * runtime/JSFunction.h: (JSC::JSFunction::assertTypeInfoFlagInvariants): * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): * runtime/JSGlobalObject.h: * runtime/JSObject.cpp: (JSC::JSObject::visitChildren): (JSC::JSFinalObject::visitChildren): * runtime/JSObjectInlines.h: (JSC::JSObject::validatePutOwnDataProperty): * runtime/JSSegmentedVariableObject.h: (JSC::JSSegmentedVariableObject::assertVariableIsInThisObject): * runtime/LiteralParser.cpp: (JSC::LiteralParser<CharType>::Lexer::lex): * runtime/LiteralParser.h: * runtime/Operations.h: (JSC::scribbleFreeCells): * runtime/OptionsList.h: * runtime/VM.cpp: (JSC::VM::computeCanUseJIT): * runtime/VM.h: (JSC::VM::canUseJIT): * runtime/VarOffset.h: (JSC::VarOffset::checkSanity const): * runtime/WeakMapImpl.h: (JSC::WeakMapImpl::checkConsistency const): (JSC::WeakMapImpl::assertBufferIsEmpty const): * wasm/WasmAirIRGenerator.cpp: (JSC::Wasm::AirIRGenerator::validateInst): * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::parseAndCompile): * wasm/WasmFunctionParser.h: (JSC::Wasm::FunctionParser::validationFail const): * wasm/WasmLLIntGenerator.cpp: (JSC::Wasm::LLIntGenerator::checkConsistency): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::tryRemoveContextAndCancelIfLast): * wasm/WasmSectionParser.h: * wasm/WasmSections.h: * wasm/WasmSignatureInlines.h: (JSC::Wasm::SignatureInformation::get): * wasm/WasmWorklist.cpp: (JSC::Wasm::Worklist::enqueue): * wasm/js/JSToWasm.cpp: (JSC::Wasm::createJSToWasmWrapper): * wasm/js/WebAssemblyFunction.cpp: (JSC::WebAssemblyFunction::previousInstanceOffset const): Source/WebCore: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * Modules/fetch/FetchBodySource.cpp: (WebCore::FetchBodySource::close): * Modules/fetch/FetchBodySource.h: * Modules/webdatabase/DatabaseDetails.h: (WebCore::DatabaseDetails::DatabaseDetails): (WebCore::DatabaseDetails::operator=): * Modules/webdatabase/DatabaseTask.cpp: (WebCore::DatabaseTask::performTask): * Modules/webdatabase/DatabaseTask.h: * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::terminationRequested const): * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h: (WebCore::WHLSL::AST::TypeAnnotation::TypeAnnotation): * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp: (WebCore::WHLSL::findHighZombies): * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp: (WebCore::WHLSL::matches): * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp: (WebCore::WHLSL::checkLiteralTypes): * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: (WebCore::WHLSL::FindAllTypes::appendNamedType): * bindings/js/JSCallbackData.h: * bindings/js/JSLazyEventListener.cpp: * bindings/js/JSLazyEventListener.h: * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::compileRuleList): * css/CSSCalculationValue.cpp: (WebCore::CSSCalcOperationNode::primitiveType const): * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSPrimitiveValue.cpp: * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText const): * css/CSSStyleSheet.cpp: * dom/ActiveDOMObject.cpp: (WebCore::ActiveDOMObject::suspendIfNeeded): (WebCore::ActiveDOMObject::assertSuspendIfNeededWasCalled const): * dom/ActiveDOMObject.h: * dom/ContainerNode.cpp: * dom/ContainerNodeAlgorithms.cpp: * dom/ContainerNodeAlgorithms.h: * dom/CustomElementReactionQueue.cpp: * dom/CustomElementReactionQueue.h: (WebCore::CustomElementReactionDisallowedScope::CustomElementReactionDisallowedScope): (WebCore::CustomElementReactionDisallowedScope::~CustomElementReactionDisallowedScope): * dom/Document.cpp: (WebCore::Document::hitTest): * dom/Document.h: (WebCore::Document::decrementReferencingNodeCount): * dom/Element.cpp: (WebCore::Element::addShadowRoot): (WebCore::Element::getURLAttribute const): (WebCore::Element::getNonEmptyURLAttribute const): * dom/Element.h: * dom/ElementAndTextDescendantIterator.h: (WebCore::ElementAndTextDescendantIterator::ElementAndTextDescendantIterator): (WebCore::ElementAndTextDescendantIterator::dropAssertions): (WebCore::ElementAndTextDescendantIterator::popAncestorSiblingStack): (WebCore::ElementAndTextDescendantIterator::traverseNextSibling): (WebCore::ElementAndTextDescendantIterator::traversePreviousSibling): * dom/ElementDescendantIterator.h: (WebCore::ElementDescendantIterator::ElementDescendantIterator): (WebCore::ElementDescendantIterator::dropAssertions): (WebCore::ElementDescendantIterator::operator++): (WebCore::ElementDescendantIterator::operator--): (WebCore::ElementDescendantConstIterator::ElementDescendantConstIterator): (WebCore::ElementDescendantConstIterator::dropAssertions): (WebCore::ElementDescendantConstIterator::operator++): * dom/ElementIterator.h: (WebCore::ElementIterator<ElementType>::ElementIterator): (WebCore::ElementIterator<ElementType>::traverseNext): (WebCore::ElementIterator<ElementType>::traversePrevious): (WebCore::ElementIterator<ElementType>::traverseNextSibling): (WebCore::ElementIterator<ElementType>::traversePreviousSibling): (WebCore::ElementIterator<ElementType>::traverseNextSkippingChildren): (WebCore::ElementIterator<ElementType>::dropAssertions): (WebCore::ElementIterator<ElementType>::traverseAncestor): (WebCore::ElementConstIterator<ElementType>::ElementConstIterator): (WebCore::ElementConstIterator<ElementType>::traverseNext): (WebCore::ElementConstIterator<ElementType>::traversePrevious): (WebCore::ElementConstIterator<ElementType>::traverseNextSibling): (WebCore::ElementConstIterator<ElementType>::traversePreviousSibling): (WebCore::ElementConstIterator<ElementType>::traverseNextSkippingChildren): (WebCore::ElementConstIterator<ElementType>::traverseAncestor): (WebCore::ElementConstIterator<ElementType>::dropAssertions): * dom/EventContext.cpp: * dom/EventContext.h: * dom/EventListener.h: * dom/EventPath.cpp: * dom/EventSender.h: * dom/EventTarget.cpp: (WebCore::EventTarget::addEventListener): (WebCore::EventTarget::setAttributeEventListener): (WebCore::EventTarget::innerInvokeEventListeners): * dom/Node.cpp: (WebCore::Node::~Node): (WebCore::Node::moveNodeToNewDocument): (WebCore::Node::removedLastRef): * dom/Node.h: (WebCore::Node::deref const): * dom/ScriptDisallowedScope.h: (WebCore::ScriptDisallowedScope::InMainThread::isEventDispatchAllowedInSubtree): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::~ScriptExecutionContext): * dom/ScriptExecutionContext.h: * dom/SelectorQuery.cpp: (WebCore::SelectorDataList::execute const): * dom/SlotAssignment.cpp: (WebCore::SlotAssignment::addSlotElementByName): (WebCore::SlotAssignment::removeSlotElementByName): (WebCore::SlotAssignment::resolveSlotsAfterSlotMutation): (WebCore::SlotAssignment::findFirstSlotElement): * dom/SlotAssignment.h: * dom/TreeScopeOrderedMap.cpp: (WebCore::TreeScopeOrderedMap::add): (WebCore::TreeScopeOrderedMap::get const): * dom/TreeScopeOrderedMap.h: * fileapi/Blob.cpp: * fileapi/Blob.h: * history/BackForwardCache.cpp: (WebCore::BackForwardCache::removeAllItemsForPage): * history/BackForwardCache.h: * html/CanvasBase.cpp: (WebCore::CanvasBase::notifyObserversCanvasDestroyed): * html/CanvasBase.h: * html/HTMLCollection.h: (WebCore::CollectionNamedElementCache::didPopulate): * html/HTMLSelectElement.cpp: (WebCore:: const): * html/HTMLTableRowsCollection.cpp: (WebCore::assertRowIsInTable): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::indexForPosition const): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::~CanvasRenderingContext2DBase): * html/parser/HTMLParserScheduler.cpp: (WebCore::HTMLParserScheduler::HTMLParserScheduler): (WebCore::HTMLParserScheduler::suspend): (WebCore::HTMLParserScheduler::resume): * html/parser/HTMLParserScheduler.h: * html/parser/HTMLToken.h: (WebCore::HTMLToken::beginStartTag): (WebCore::HTMLToken::beginEndTag): (WebCore::HTMLToken::endAttribute): * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::HTMLTreeBuilder): (WebCore::HTMLTreeBuilder::constructTree): * html/parser/HTMLTreeBuilder.h: (WebCore::HTMLTreeBuilder::~HTMLTreeBuilder): * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::geometryForBox const): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition): * layout/blockformatting/BlockFormattingContext.h: * layout/displaytree/DisplayBox.cpp: (WebCore::Display::Box::Box): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::setTopLeft): (WebCore::Display::Box::setTop): (WebCore::Display::Box::setLeft): (WebCore::Display::Box::setContentBoxHeight): (WebCore::Display::Box::setContentBoxWidth): (WebCore::Display::Box::setHorizontalMargin): (WebCore::Display::Box::setVerticalMargin): (WebCore::Display::Box::setHorizontalComputedMargin): (WebCore::Display::Box::setBorder): (WebCore::Display::Box::setPadding): * layout/displaytree/DisplayInlineRect.h: (WebCore::Display::InlineRect::InlineRect): (WebCore::Display::InlineRect::setTopLeft): (WebCore::Display::InlineRect::setTop): (WebCore::Display::InlineRect::setBottom): (WebCore::Display::InlineRect::setLeft): (WebCore::Display::InlineRect::setWidth): (WebCore::Display::InlineRect::setHeight): * layout/displaytree/DisplayLineBox.h: (WebCore::Display::LineBox::LineBox): (WebCore::Display::LineBox::setBaselineOffsetIfGreater): (WebCore::Display::LineBox::resetBaseline): (WebCore::Display::LineBox::Baseline::Baseline): (WebCore::Display::LineBox::Baseline::setAscent): (WebCore::Display::LineBox::Baseline::setDescent): (WebCore::Display::LineBox::Baseline::reset): * layout/displaytree/DisplayRect.h: (WebCore::Display::Rect::Rect): (WebCore::Display::Rect::setTopLeft): (WebCore::Display::Rect::setTop): (WebCore::Display::Rect::setLeft): (WebCore::Display::Rect::setWidth): (WebCore::Display::Rect::setHeight): (WebCore::Display::Rect::setSize): (WebCore::Display::Rect::clone const): * layout/floats/FloatingContext.cpp: * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::CollapsibleContent::collapse): * layout/tableformatting/TableGrid.cpp: (WebCore::Layout::TableGrid::Column::setWidthConstraints): (WebCore::Layout::TableGrid::Column::setLogicalWidth): (WebCore::Layout::TableGrid::Column::setLogicalLeft): * layout/tableformatting/TableGrid.h: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::continueAfterContentPolicy): (WebCore::DocumentLoader::attachToFrame): (WebCore::DocumentLoader::detachFromFrame): (WebCore::DocumentLoader::addSubresourceLoader): * loader/DocumentLoader.h: * loader/ImageLoader.cpp: * loader/cache/CachedResource.h: * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::lruListFor): (WebCore::MemoryCache::removeFromLRUList): * page/FrameView.cpp: (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): * page/FrameViewLayoutContext.cpp: * page/FrameViewLayoutContext.h: * page/Page.cpp: * page/Page.h: * page/ViewportConfiguration.cpp: * page/ViewportConfiguration.h: * page/mac/EventHandlerMac.mm: (WebCore::CurrentEventScope::CurrentEventScope): * platform/DateComponents.cpp: (WebCore::DateComponents::toStringForTime const): * platform/ScrollableArea.cpp: * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::combineIntoOneSegment const): * platform/SharedBuffer.h: * platform/Supplementable.h: * platform/Timer.cpp: (WebCore::TimerBase::checkHeapIndex const): (WebCore::TimerBase::updateHeapIfNeeded): * platform/graphics/BitmapImage.cpp: * platform/graphics/BitmapImage.h: * platform/graphics/Image.h: * platform/graphics/ShadowBlur.cpp: (WebCore::ScratchBuffer::ScratchBuffer): (WebCore::ScratchBuffer::getScratchBuffer): (WebCore::ScratchBuffer::scheduleScratchBufferPurge): * platform/graphics/ca/win/CACFLayerTreeHost.cpp: (WebCore::CACFLayerTreeHost::setWindow): * platform/graphics/ca/win/CACFLayerTreeHost.h: * platform/graphics/cg/ImageBufferDataCG.cpp: (WebCore::ImageBufferData::putData): * platform/graphics/cocoa/FontCacheCoreText.cpp: * platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp: (gstAllocatorFastMallocFree): * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp: (Nicosia::PaintingContextCairo::ForPainting::ForPainting): * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp: (Nicosia::BackingStoreTextureMapperImpl::createTile): * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp: (Nicosia::ContentLayerTextureMapperImpl::~ContentLayerTextureMapperImpl): * platform/graphics/win/GradientDirect2D.cpp: (WebCore::Gradient::fill): * platform/graphics/win/ImageBufferDataDirect2D.cpp: (WebCore::ImageBufferData::putData): * platform/graphics/win/PathDirect2D.cpp: (WebCore::Path::appendGeometry): (WebCore::Path::Path): (WebCore::Path::operator=): (WebCore::Path::strokeContains const): (WebCore::Path::transform): * platform/graphics/win/PlatformContextDirect2D.cpp: (WebCore::PlatformContextDirect2D::setTags): * platform/mediastream/MediaStreamTrackPrivate.h: * platform/mediastream/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::~RealtimeOutgoingAudioSource): * platform/mediastream/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::~RealtimeOutgoingVideoSource): * platform/network/HTTPParsers.cpp: (WebCore::isCrossOriginSafeHeader): * platform/sql/SQLiteDatabase.cpp: * platform/sql/SQLiteDatabase.h: * platform/sql/SQLiteStatement.cpp: (WebCore::SQLiteStatement::SQLiteStatement): (WebCore::SQLiteStatement::prepare): (WebCore::SQLiteStatement::finalize): * platform/sql/SQLiteStatement.h: * platform/win/COMPtr.h: * rendering/ComplexLineLayout.cpp: (WebCore::ComplexLineLayout::removeInlineBox const): * rendering/FloatingObjects.cpp: (WebCore::FloatingObject::FloatingObject): (WebCore::FloatingObjects::addPlacedObject): (WebCore::FloatingObjects::removePlacedObject): * rendering/FloatingObjects.h: * rendering/GridTrackSizingAlgorithm.cpp: * rendering/GridTrackSizingAlgorithm.h: * rendering/LayoutDisallowedScope.cpp: * rendering/LayoutDisallowedScope.h: * rendering/RenderBlock.cpp: * rendering/RenderBlock.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutBlockChild): (WebCore::RenderBlockFlow::removeFloatingObject): (WebCore::RenderBlockFlow::ensureLineBoxes): * rendering/RenderBoxModelObject.cpp: * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::RenderDeprecatedFlexibleBox::layoutBlock): * rendering/RenderElement.cpp: * rendering/RenderGeometryMap.cpp: (WebCore::RenderGeometryMap::mapToContainer const): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::placeItemsOnGrid const): (WebCore::RenderGrid::baselinePosition const): * rendering/RenderInline.cpp: (WebCore::RenderInline::willBeDestroyed): * rendering/RenderLayer.cpp: (WebCore::ClipRectsCache::ClipRectsCache): (WebCore::RenderLayer::RenderLayer): (WebCore::RenderLayer::paintList): (WebCore::RenderLayer::hitTestLayer): (WebCore::RenderLayer::updateClipRects): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::traverseVisibleNonCompositedDescendantLayers): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): (WebCore::RenderLayerCompositor::addDescendantsToOverlapMapRecursive const): (WebCore::RenderLayerCompositor::recursiveRepaintLayer): (WebCore::RenderLayerCompositor::layerHas3DContent const): * rendering/RenderLayoutState.cpp: (WebCore::RenderLayoutState::RenderLayoutState): (WebCore::RenderLayoutState::computeOffsets): (WebCore::RenderLayoutState::addLayoutDelta): * rendering/RenderLayoutState.h: (WebCore::RenderLayoutState::RenderLayoutState): * rendering/RenderObject.cpp: (WebCore::RenderObject::RenderObject): (WebCore::RenderObject::~RenderObject): (WebCore::RenderObject::clearNeedsLayout): * rendering/RenderObject.h: * rendering/RenderQuote.cpp: (WebCore::quotesForLanguage): * rendering/RenderTableCell.h: * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::computeOverflowFromCells): * rendering/RenderTextLineBoxes.cpp: (WebCore::RenderTextLineBoxes::checkConsistency const): * rendering/RenderTextLineBoxes.h: * rendering/line/BreakingContext.h: (WebCore::tryHyphenating): * rendering/style/GridArea.h: (WebCore::GridSpan::GridSpan): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::~RenderStyle): * rendering/style/RenderStyle.h: * rendering/updating/RenderTreeBuilderRuby.cpp: (WebCore::RenderTreeBuilder::Ruby::detach): * rendering/updating/RenderTreePosition.cpp: (WebCore::RenderTreePosition::computeNextSibling): * rendering/updating/RenderTreePosition.h: * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::Placeholder::Placeholder): (WebCore::SVGToOTFFontConverter::Placeholder::populate): (WebCore::SVGToOTFFontConverter::appendCFFTable): (WebCore::SVGToOTFFontConverter::firstGlyph const): (WebCore::SVGToOTFFontConverter::appendKERNTable): * svg/SVGTransformDistance.cpp: (WebCore::SVGTransformDistance::SVGTransformDistance): (WebCore::SVGTransformDistance::scaledDistance const): (WebCore::SVGTransformDistance::addSVGTransforms): (WebCore::SVGTransformDistance::addToSVGTransform const): (WebCore::SVGTransformDistance::distance const): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::nativeImage): * testing/InternalSettings.cpp: * workers/service/ServiceWorkerJob.h: * worklets/PaintWorkletGlobalScope.h: (WebCore::PaintWorkletGlobalScope::~PaintWorkletGlobalScope): * xml/XPathStep.cpp: Source/WebKit: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::invalidateAndCancel): * NetworkProcess/NetworkSession.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::setCapacity): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (toNSURLSessionResponseDisposition): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * Platform/IPC/Connection.cpp: (IPC::Connection::waitForMessage): * Platform/IPC/MessageReceiver.h: (IPC::MessageReceiver::willBeAddedToMessageReceiverMap): (IPC::MessageReceiver::willBeRemovedFromMessageReceiverMap): * Platform/IPC/cocoa/ConnectionCocoa.mm: (IPC::readFromMachPort): * Platform/mac/MachUtilities.cpp: (setMachExceptionPort): * Shared/API/APIClient.h: (API::Client::Client): * Shared/API/Cocoa/WKRemoteObjectCoder.mm: * Shared/Cocoa/ArgumentCodersCocoa.h: * Shared/SharedStringHashTableReadOnly.cpp: * UIProcess/BackingStore.cpp: (WebKit::BackingStore::incorporateUpdate): * UIProcess/GenericCallback.h: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): * UIProcess/PageLoadState.h: (WebKit::PageLoadState::Transaction::Token::Token): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::~WebPageProxy): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResponse): * WebProcess/Network/WebResourceLoader.h: * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::NetscapePluginStream): (WebKit::NetscapePluginStream::notifyAndDestroyStream): * WebProcess/Plugins/Netscape/NetscapePluginStream.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::runModal): * WebProcess/WebProcess.cpp: (WebKit::checkDocumentsCaptureStateConsistency): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::updateProcessName): Source/WebKitLegacy: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * Storage/StorageAreaImpl.cpp: (WebKit::StorageAreaImpl::StorageAreaImpl): (WebKit::StorageAreaImpl::close): * Storage/StorageAreaImpl.h: Source/WebKitLegacy/mac: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * History/WebHistory.mm: (-[WebHistoryPrivate removeItemForURLString:]): * WebView/WebFrame.mm: Source/WebKitLegacy/win: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * WebKitQuartzCoreAdditions/CAD3DRenderer.cpp: (WKQCA::CAD3DRenderer::swapChain): (WKQCA::CAD3DRenderer::initialize): * WebKitQuartzCoreAdditions/CAD3DRenderer.h: * WebView.cpp: (WebView::Release): * WebView.h: Source/WTF: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. This patch did the following changes: 1. Replaced ASSERT_DISABLED with ASSERT_ENABLED. This change does away with the need for the double negative !ASSERT_DISABLED test that is commonly used all over the code, thereby improving code readability. In Assertions.h, there is also BACKTRACE_DISABLED, ASSERT_MSG_DISABLED, ASSERT_ARG_DISABLED, FATAL_DISABLED, ERROR_DISABLED, LOG_DISABLED, and RELEASE_LOG_DISABLED. We should replace those with ..._ENABLED equivalents as well. We'll do that in another patch. For now, they are left as is to minimize the size of this patch. See https://bugs.webkit.org/show_bug.cgi?id=205780. 2. Fixed some code was guarded with "#ifndef NDEBUG" that should actually be guarded by "#if ASSERT_ENABLED" instead. 3. In cases where the change is minimal, we move some code around so that we can test for "#if ASSERT_ENABLED" instead of "#if !ASSERT_ENABLED". * wtf/Assertions.h: * wtf/AutomaticThread.cpp: (WTF::AutomaticThread::start): * wtf/BitVector.h: * wtf/BlockObjCExceptions.mm: (ReportBlockedObjCException): * wtf/BloomFilter.h: * wtf/CallbackAggregator.h: (WTF::CallbackAggregator::CallbackAggregator): * wtf/CheckedArithmetic.h: (WTF::observesOverflow<AssertNoOverflow>): * wtf/CheckedBoolean.h: (CheckedBoolean::CheckedBoolean): (CheckedBoolean::operator bool): * wtf/CompletionHandler.h: (WTF::CompletionHandler<Out): * wtf/DateMath.cpp: (WTF::initializeDates): * wtf/Gigacage.cpp: (Gigacage::tryAllocateZeroedVirtualPages): * wtf/HashTable.h: (WTF::KeyTraits>::checkKey): (WTF::KeyTraits>::checkTableConsistencyExceptSize const): * wtf/LoggerHelper.h: * wtf/NaturalLoops.h: (WTF::NaturalLoops::headerOf const): * wtf/NeverDestroyed.h: (WTF::LazyNeverDestroyed::construct): * wtf/OptionSet.h: (WTF::OptionSet::OptionSet): * wtf/Platform.h: * wtf/PtrTag.h: * wtf/RefCounted.h: (WTF::RefCountedBase::disableThreadingChecks): (WTF::RefCountedBase::enableThreadingChecksGlobally): (WTF::RefCountedBase::RefCountedBase): (WTF::RefCountedBase::applyRefDerefThreadingCheck const): * wtf/SingleRootGraph.h: (WTF::SingleRootGraph::assertIsConsistent const): * wtf/SizeLimits.cpp: * wtf/StackBounds.h: (WTF::StackBounds::checkConsistency const): * wtf/URLParser.cpp: (WTF::URLParser::URLParser): (WTF::URLParser::domainToASCII): * wtf/ValueCheck.h: * wtf/Vector.h: (WTF::Malloc>::checkConsistency): * wtf/WeakHashSet.h: * wtf/WeakPtr.h: (WTF::WeakPtrImpl::WeakPtrImpl): (WTF::WeakPtrFactory::WeakPtrFactory): * wtf/text/AtomStringImpl.cpp: * wtf/text/AtomStringImpl.h: * wtf/text/StringBuilder.cpp: (WTF::StringBuilder::reifyString const): * wtf/text/StringBuilder.h: * wtf/text/StringCommon.h: (WTF::hasPrefixWithLettersIgnoringASCIICaseCommon): * wtf/text/StringHasher.h: (WTF::StringHasher::addCharacters): * wtf/text/StringImpl.h: * wtf/text/SymbolImpl.h: * wtf/text/UniquedStringImpl.h: Tools: Remove WebsiteDataStore::setServiceWorkerRegistrationDirectory https://bugs.webkit.org/show_bug.cgi?id=205754 Patch by Alex Christensen <achristensen@webkit.org> on 2020-01-06 Reviewed by Youenn Fablet. * TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm: * WebKitTestRunner/TestController.cpp: (WTR::TestController::websiteDataStore): (WTR::TestController::platformAdjustContext): * WebKitTestRunner/cocoa/TestControllerCocoa.mm: (WTR::initializeWebViewConfiguration): Canonical link: https://commits.webkit.org/218957@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-06 22:24:50 +00:00
#if ASSERT_ENABLED
JSC should be a triple-tier VM https://bugs.webkit.org/show_bug.cgi?id=75812 <rdar://problem/10079694> Source/JavaScriptCore: Reviewed by Gavin Barraclough. Implemented an interpreter that uses the JIT's calling convention. This interpreter is called LLInt, or the Low Level Interpreter. JSC will now will start by executing code in LLInt and will only tier up to the old JIT after the code is proven hot. LLInt is written in a modified form of our macro assembly. This new macro assembly is compiled by an offline assembler (see offlineasm), which implements many modern conveniences such as a Turing-complete CPS-based macro language and direct access to relevant C++ type information (basically offsets of fields and sizes of structs/classes). Code executing in LLInt appears to the rest of the JSC world "as if" it were executing in the old JIT. Hence, things like exception handling and cross-execution-engine calls just work and require pretty much no additional overhead. This interpreter is 2-2.5x faster than our old interpreter on SunSpider, V8, and Kraken. With triple-tiering turned on, we're neutral on SunSpider, V8, and Kraken, but appear to get a double-digit improvement on real-world websites due to a huge reduction in the amount of JIT'ing. * CMakeLists.txt: * GNUmakefile.am: * GNUmakefile.list.am: * JavaScriptCore.pri: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * assembler/LinkBuffer.h: * assembler/MacroAssemblerCodeRef.h: (MacroAssemblerCodePtr): (JSC::MacroAssemblerCodePtr::createFromExecutableAddress): * bytecode/BytecodeConventions.h: Added. * bytecode/CallLinkStatus.cpp: (JSC::CallLinkStatus::computeFromLLInt): (JSC): (JSC::CallLinkStatus::computeFor): * bytecode/CallLinkStatus.h: (JSC::CallLinkStatus::isSet): (JSC::CallLinkStatus::operator!): (CallLinkStatus): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::CodeBlock): (JSC::CodeBlock::~CodeBlock): (JSC::CodeBlock::finalizeUnconditionally): (JSC::CodeBlock::stronglyVisitStrongReferences): (JSC): (JSC::CodeBlock::unlinkCalls): (JSC::CodeBlock::unlinkIncomingCalls): (JSC::CodeBlock::bytecodeOffset): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::ProgramCodeBlock::jitCompileImpl): (JSC::EvalCodeBlock::jitCompileImpl): (JSC::FunctionCodeBlock::jitCompileImpl): * bytecode/CodeBlock.h: (JSC): (CodeBlock): (JSC::CodeBlock::baselineVersion): (JSC::CodeBlock::linkIncomingCall): (JSC::CodeBlock::bytecodeOffset): (JSC::CodeBlock::jitCompile): (JSC::CodeBlock::hasOptimizedReplacement): (JSC::CodeBlock::addPropertyAccessInstruction): (JSC::CodeBlock::addGlobalResolveInstruction): (JSC::CodeBlock::addLLIntCallLinkInfo): (JSC::CodeBlock::addGlobalResolveInfo): (JSC::CodeBlock::numberOfMethodCallLinkInfos): (JSC::CodeBlock::valueProfilePredictionForBytecodeOffset): (JSC::CodeBlock::likelyToTakeSlowCase): (JSC::CodeBlock::couldTakeSlowCase): (JSC::CodeBlock::likelyToTakeSpecialFastCase): (JSC::CodeBlock::likelyToTakeDeepestSlowCase): (JSC::CodeBlock::likelyToTakeAnySlowCase): (JSC::CodeBlock::addFrequentExitSite): (JSC::CodeBlock::dontJITAnytimeSoon): (JSC::CodeBlock::jitAfterWarmUp): (JSC::CodeBlock::jitSoon): (JSC::CodeBlock::llintExecuteCounter): (ProgramCodeBlock): (EvalCodeBlock): (FunctionCodeBlock): * bytecode/GetByIdStatus.cpp: (JSC::GetByIdStatus::computeFromLLInt): (JSC): (JSC::GetByIdStatus::computeFor): * bytecode/GetByIdStatus.h: (JSC::GetByIdStatus::GetByIdStatus): (JSC::GetByIdStatus::wasSeenInJIT): (GetByIdStatus): * bytecode/Instruction.h: (JSC): (JSC::Instruction::Instruction): (Instruction): * bytecode/LLIntCallLinkInfo.h: Added. (JSC): (JSC::LLIntCallLinkInfo::LLIntCallLinkInfo): (LLIntCallLinkInfo): (JSC::LLIntCallLinkInfo::~LLIntCallLinkInfo): (JSC::LLIntCallLinkInfo::isLinked): (JSC::LLIntCallLinkInfo::unlink): * bytecode/MethodCallLinkStatus.cpp: (JSC::MethodCallLinkStatus::computeFor): * bytecode/Opcode.cpp: (JSC): * bytecode/Opcode.h: (JSC): (JSC::padOpcodeName): * bytecode/PutByIdStatus.cpp: (JSC::PutByIdStatus::computeFromLLInt): (JSC): (JSC::PutByIdStatus::computeFor): * bytecode/PutByIdStatus.h: (PutByIdStatus): * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitResolve): (JSC::BytecodeGenerator::emitResolveWithBase): (JSC::BytecodeGenerator::emitGetById): (JSC::BytecodeGenerator::emitPutById): (JSC::BytecodeGenerator::emitDirectPutById): (JSC::BytecodeGenerator::emitCall): (JSC::BytecodeGenerator::emitConstruct): (JSC::BytecodeGenerator::emitCatch): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): (JSC::DFG::ByteCodeParser::handleInlining): (JSC::DFG::ByteCodeParser::parseBlock): * dfg/DFGCapabilities.h: (JSC::DFG::canCompileOpcode): * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGOperations.cpp: * heap/Heap.h: (JSC): (JSC::Heap::firstAllocatorWithoutDestructors): (Heap): * heap/MarkStack.cpp: (JSC::visitChildren): * heap/MarkedAllocator.h: (JSC): (MarkedAllocator): * heap/MarkedSpace.h: (JSC): (MarkedSpace): (JSC::MarkedSpace::firstAllocator): * interpreter/CallFrame.cpp: (JSC): (JSC::CallFrame::bytecodeOffsetForNonDFGCode): (JSC::CallFrame::setBytecodeOffsetForNonDFGCode): (JSC::CallFrame::currentVPC): (JSC::CallFrame::setCurrentVPC): (JSC::CallFrame::trueCallerFrame): * interpreter/CallFrame.h: (JSC::ExecState::hasReturnPC): (JSC::ExecState::clearReturnPC): (ExecState): (JSC::ExecState::bytecodeOffsetForNonDFGCode): (JSC::ExecState::currentVPC): (JSC::ExecState::setCurrentVPC): * interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): (JSC::Interpreter::~Interpreter): (JSC): (JSC::Interpreter::initialize): (JSC::Interpreter::isOpcode): (JSC::Interpreter::unwindCallFrame): (JSC::getCallerInfo): (JSC::Interpreter::privateExecute): (JSC::Interpreter::retrieveLastCaller): * interpreter/Interpreter.h: (JSC): (Interpreter): (JSC::Interpreter::getOpcode): (JSC::Interpreter::getOpcodeID): (JSC::Interpreter::classicEnabled): * interpreter/RegisterFile.h: (JSC): (RegisterFile): * jit/ExecutableAllocator.h: (JSC): * jit/HostCallReturnValue.cpp: Added. (JSC): (JSC::getHostCallReturnValueWithExecState): * jit/HostCallReturnValue.h: Added. (JSC): (JSC::initializeHostCallReturnValue): * jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile): * jit/JITCode.h: (JSC::JITCode::isOptimizingJIT): (JITCode): (JSC::JITCode::isBaselineCode): (JSC::JITCode::JITCode): * jit/JITDriver.h: (JSC::jitCompileIfAppropriate): (JSC::jitCompileFunctionIfAppropriate): * jit/JITExceptions.cpp: (JSC::jitThrow): * jit/JITInlineMethods.h: (JSC::JIT::updateTopCallFrame): * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): (JSC): * jit/JITStubs.h: (JSC): * jit/JSInterfaceJIT.h: * llint: Added. * llint/LLIntCommon.h: Added. * llint/LLIntData.cpp: Added. (LLInt): (JSC::LLInt::Data::Data): (JSC::LLInt::Data::performAssertions): (JSC::LLInt::Data::~Data): * llint/LLIntData.h: Added. (JSC): (LLInt): (Data): (JSC::LLInt::Data::exceptionInstructions): (JSC::LLInt::Data::opcodeMap): (JSC::LLInt::Data::performAssertions): * llint/LLIntEntrypoints.cpp: Added. (LLInt): (JSC::LLInt::getFunctionEntrypoint): (JSC::LLInt::getEvalEntrypoint): (JSC::LLInt::getProgramEntrypoint): * llint/LLIntEntrypoints.h: Added. (JSC): (LLInt): (JSC::LLInt::getEntrypoint): * llint/LLIntExceptions.cpp: Added. (LLInt): (JSC::LLInt::interpreterThrowInCaller): (JSC::LLInt::returnToThrowForThrownException): (JSC::LLInt::returnToThrow): (JSC::LLInt::callToThrow): * llint/LLIntExceptions.h: Added. (JSC): (LLInt): * llint/LLIntOfflineAsmConfig.h: Added. * llint/LLIntOffsetsExtractor.cpp: Added. (JSC): (LLIntOffsetsExtractor): (JSC::LLIntOffsetsExtractor::dummy): (main): * llint/LLIntSlowPaths.cpp: Added. (LLInt): (JSC::LLInt::llint_trace_operand): (JSC::LLInt::llint_trace_value): (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::traceFunctionPrologue): (JSC::LLInt::shouldJIT): (JSC::LLInt::entryOSR): (JSC::LLInt::resolveGlobal): (JSC::LLInt::getByVal): (JSC::LLInt::handleHostCall): (JSC::LLInt::setUpCall): (JSC::LLInt::genericCall): * llint/LLIntSlowPaths.h: Added. (JSC): (LLInt): * llint/LLIntThunks.cpp: Added. (LLInt): (JSC::LLInt::generateThunkWithJumpTo): (JSC::LLInt::functionForCallEntryThunkGenerator): (JSC::LLInt::functionForConstructEntryThunkGenerator): (JSC::LLInt::functionForCallArityCheckThunkGenerator): (JSC::LLInt::functionForConstructArityCheckThunkGenerator): (JSC::LLInt::evalEntryThunkGenerator): (JSC::LLInt::programEntryThunkGenerator): * llint/LLIntThunks.h: Added. (JSC): (LLInt): * llint/LowLevelInterpreter.asm: Added. * llint/LowLevelInterpreter.cpp: Added. * llint/LowLevelInterpreter.h: Added. * offlineasm: Added. * offlineasm/armv7.rb: Added. * offlineasm/asm.rb: Added. * offlineasm/ast.rb: Added. * offlineasm/backends.rb: Added. * offlineasm/generate_offset_extractor.rb: Added. * offlineasm/instructions.rb: Added. * offlineasm/offset_extractor_constants.rb: Added. * offlineasm/offsets.rb: Added. * offlineasm/opt.rb: Added. * offlineasm/parser.rb: Added. * offlineasm/registers.rb: Added. * offlineasm/self_hash.rb: Added. * offlineasm/settings.rb: Added. * offlineasm/transform.rb: Added. * offlineasm/x86.rb: Added. * runtime/CodeSpecializationKind.h: Added. (JSC): * runtime/CommonSlowPaths.h: (JSC::CommonSlowPaths::arityCheckFor): (CommonSlowPaths): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC): (JSC::EvalExecutable::jitCompile): (JSC::samplingDescription): (JSC::EvalExecutable::compileInternal): (JSC::ProgramExecutable::jitCompile): (JSC::ProgramExecutable::compileInternal): (JSC::FunctionExecutable::baselineCodeBlockFor): (JSC::FunctionExecutable::jitCompileForCall): (JSC::FunctionExecutable::jitCompileForConstruct): (JSC::FunctionExecutable::compileForCallInternal): (JSC::FunctionExecutable::compileForConstructInternal): * runtime/Executable.h: (JSC): (EvalExecutable): (ProgramExecutable): (FunctionExecutable): (JSC::FunctionExecutable::jitCompileFor): * runtime/ExecutionHarness.h: Added. (JSC): (JSC::prepareForExecution): (JSC::prepareFunctionForExecution): * runtime/JSArray.h: (JSC): (JSArray): * runtime/JSCell.h: (JSC): (JSCell): * runtime/JSFunction.h: (JSC): (JSFunction): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): * runtime/JSGlobalData.h: (JSC): (JSGlobalData): * runtime/JSGlobalObject.h: (JSC): (JSGlobalObject): * runtime/JSObject.h: (JSC): (JSObject): (JSFinalObject): * runtime/JSPropertyNameIterator.h: (JSC): (JSPropertyNameIterator): * runtime/JSString.h: (JSC): (JSString): * runtime/JSTypeInfo.h: (JSC): (TypeInfo): * runtime/JSValue.cpp: (JSC::JSValue::description): * runtime/JSValue.h: (LLInt): (JSValue): * runtime/JSVariableObject.h: (JSC): (JSVariableObject): * runtime/Options.cpp: (Options): (JSC::Options::initializeOptions): * runtime/Options.h: (Options): * runtime/ScopeChain.h: (JSC): (ScopeChainNode): * runtime/Structure.cpp: (JSC::Structure::addPropertyTransition): * runtime/Structure.h: (JSC): (Structure): * runtime/StructureChain.h: (JSC): (StructureChain): * wtf/InlineASM.h: * wtf/Platform.h: * wtf/SentinelLinkedList.h: (SentinelLinkedList): (WTF::SentinelLinkedList::isEmpty): * wtf/text/StringImpl.h: (JSC): (StringImpl): Source/WebCore: Reviewed by Gavin Barraclough. No new tests, because there is no change in behavior. * CMakeLists.txt: Source/WebKit: Reviewed by Gavin Barraclough. Changed EFL's build system to include a new directory in JavaScriptCore. * CMakeLists.txt: Tools: Reviewed by Gavin Barraclough. Changed EFL's build system to include a new directory in JavaScriptCore. * DumpRenderTree/efl/CMakeLists.txt: Canonical link: https://commits.webkit.org/96248@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@108444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-22 05:23:19 +00:00
#define OFFLINE_ASM_ASSERT_ENABLED 1
#else
#define OFFLINE_ASM_ASSERT_ENABLED 0
#endif
2018-07-09 21:55:48 +00:00
#if LLINT_TRACING
#define OFFLINE_ASM_TRACING 1
JSC should be a triple-tier VM https://bugs.webkit.org/show_bug.cgi?id=75812 <rdar://problem/10079694> Source/JavaScriptCore: Reviewed by Gavin Barraclough. Implemented an interpreter that uses the JIT's calling convention. This interpreter is called LLInt, or the Low Level Interpreter. JSC will now will start by executing code in LLInt and will only tier up to the old JIT after the code is proven hot. LLInt is written in a modified form of our macro assembly. This new macro assembly is compiled by an offline assembler (see offlineasm), which implements many modern conveniences such as a Turing-complete CPS-based macro language and direct access to relevant C++ type information (basically offsets of fields and sizes of structs/classes). Code executing in LLInt appears to the rest of the JSC world "as if" it were executing in the old JIT. Hence, things like exception handling and cross-execution-engine calls just work and require pretty much no additional overhead. This interpreter is 2-2.5x faster than our old interpreter on SunSpider, V8, and Kraken. With triple-tiering turned on, we're neutral on SunSpider, V8, and Kraken, but appear to get a double-digit improvement on real-world websites due to a huge reduction in the amount of JIT'ing. * CMakeLists.txt: * GNUmakefile.am: * GNUmakefile.list.am: * JavaScriptCore.pri: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * assembler/LinkBuffer.h: * assembler/MacroAssemblerCodeRef.h: (MacroAssemblerCodePtr): (JSC::MacroAssemblerCodePtr::createFromExecutableAddress): * bytecode/BytecodeConventions.h: Added. * bytecode/CallLinkStatus.cpp: (JSC::CallLinkStatus::computeFromLLInt): (JSC): (JSC::CallLinkStatus::computeFor): * bytecode/CallLinkStatus.h: (JSC::CallLinkStatus::isSet): (JSC::CallLinkStatus::operator!): (CallLinkStatus): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::CodeBlock): (JSC::CodeBlock::~CodeBlock): (JSC::CodeBlock::finalizeUnconditionally): (JSC::CodeBlock::stronglyVisitStrongReferences): (JSC): (JSC::CodeBlock::unlinkCalls): (JSC::CodeBlock::unlinkIncomingCalls): (JSC::CodeBlock::bytecodeOffset): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::ProgramCodeBlock::jitCompileImpl): (JSC::EvalCodeBlock::jitCompileImpl): (JSC::FunctionCodeBlock::jitCompileImpl): * bytecode/CodeBlock.h: (JSC): (CodeBlock): (JSC::CodeBlock::baselineVersion): (JSC::CodeBlock::linkIncomingCall): (JSC::CodeBlock::bytecodeOffset): (JSC::CodeBlock::jitCompile): (JSC::CodeBlock::hasOptimizedReplacement): (JSC::CodeBlock::addPropertyAccessInstruction): (JSC::CodeBlock::addGlobalResolveInstruction): (JSC::CodeBlock::addLLIntCallLinkInfo): (JSC::CodeBlock::addGlobalResolveInfo): (JSC::CodeBlock::numberOfMethodCallLinkInfos): (JSC::CodeBlock::valueProfilePredictionForBytecodeOffset): (JSC::CodeBlock::likelyToTakeSlowCase): (JSC::CodeBlock::couldTakeSlowCase): (JSC::CodeBlock::likelyToTakeSpecialFastCase): (JSC::CodeBlock::likelyToTakeDeepestSlowCase): (JSC::CodeBlock::likelyToTakeAnySlowCase): (JSC::CodeBlock::addFrequentExitSite): (JSC::CodeBlock::dontJITAnytimeSoon): (JSC::CodeBlock::jitAfterWarmUp): (JSC::CodeBlock::jitSoon): (JSC::CodeBlock::llintExecuteCounter): (ProgramCodeBlock): (EvalCodeBlock): (FunctionCodeBlock): * bytecode/GetByIdStatus.cpp: (JSC::GetByIdStatus::computeFromLLInt): (JSC): (JSC::GetByIdStatus::computeFor): * bytecode/GetByIdStatus.h: (JSC::GetByIdStatus::GetByIdStatus): (JSC::GetByIdStatus::wasSeenInJIT): (GetByIdStatus): * bytecode/Instruction.h: (JSC): (JSC::Instruction::Instruction): (Instruction): * bytecode/LLIntCallLinkInfo.h: Added. (JSC): (JSC::LLIntCallLinkInfo::LLIntCallLinkInfo): (LLIntCallLinkInfo): (JSC::LLIntCallLinkInfo::~LLIntCallLinkInfo): (JSC::LLIntCallLinkInfo::isLinked): (JSC::LLIntCallLinkInfo::unlink): * bytecode/MethodCallLinkStatus.cpp: (JSC::MethodCallLinkStatus::computeFor): * bytecode/Opcode.cpp: (JSC): * bytecode/Opcode.h: (JSC): (JSC::padOpcodeName): * bytecode/PutByIdStatus.cpp: (JSC::PutByIdStatus::computeFromLLInt): (JSC): (JSC::PutByIdStatus::computeFor): * bytecode/PutByIdStatus.h: (PutByIdStatus): * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitResolve): (JSC::BytecodeGenerator::emitResolveWithBase): (JSC::BytecodeGenerator::emitGetById): (JSC::BytecodeGenerator::emitPutById): (JSC::BytecodeGenerator::emitDirectPutById): (JSC::BytecodeGenerator::emitCall): (JSC::BytecodeGenerator::emitConstruct): (JSC::BytecodeGenerator::emitCatch): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): (JSC::DFG::ByteCodeParser::handleInlining): (JSC::DFG::ByteCodeParser::parseBlock): * dfg/DFGCapabilities.h: (JSC::DFG::canCompileOpcode): * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGOperations.cpp: * heap/Heap.h: (JSC): (JSC::Heap::firstAllocatorWithoutDestructors): (Heap): * heap/MarkStack.cpp: (JSC::visitChildren): * heap/MarkedAllocator.h: (JSC): (MarkedAllocator): * heap/MarkedSpace.h: (JSC): (MarkedSpace): (JSC::MarkedSpace::firstAllocator): * interpreter/CallFrame.cpp: (JSC): (JSC::CallFrame::bytecodeOffsetForNonDFGCode): (JSC::CallFrame::setBytecodeOffsetForNonDFGCode): (JSC::CallFrame::currentVPC): (JSC::CallFrame::setCurrentVPC): (JSC::CallFrame::trueCallerFrame): * interpreter/CallFrame.h: (JSC::ExecState::hasReturnPC): (JSC::ExecState::clearReturnPC): (ExecState): (JSC::ExecState::bytecodeOffsetForNonDFGCode): (JSC::ExecState::currentVPC): (JSC::ExecState::setCurrentVPC): * interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): (JSC::Interpreter::~Interpreter): (JSC): (JSC::Interpreter::initialize): (JSC::Interpreter::isOpcode): (JSC::Interpreter::unwindCallFrame): (JSC::getCallerInfo): (JSC::Interpreter::privateExecute): (JSC::Interpreter::retrieveLastCaller): * interpreter/Interpreter.h: (JSC): (Interpreter): (JSC::Interpreter::getOpcode): (JSC::Interpreter::getOpcodeID): (JSC::Interpreter::classicEnabled): * interpreter/RegisterFile.h: (JSC): (RegisterFile): * jit/ExecutableAllocator.h: (JSC): * jit/HostCallReturnValue.cpp: Added. (JSC): (JSC::getHostCallReturnValueWithExecState): * jit/HostCallReturnValue.h: Added. (JSC): (JSC::initializeHostCallReturnValue): * jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile): * jit/JITCode.h: (JSC::JITCode::isOptimizingJIT): (JITCode): (JSC::JITCode::isBaselineCode): (JSC::JITCode::JITCode): * jit/JITDriver.h: (JSC::jitCompileIfAppropriate): (JSC::jitCompileFunctionIfAppropriate): * jit/JITExceptions.cpp: (JSC::jitThrow): * jit/JITInlineMethods.h: (JSC::JIT::updateTopCallFrame): * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): (JSC): * jit/JITStubs.h: (JSC): * jit/JSInterfaceJIT.h: * llint: Added. * llint/LLIntCommon.h: Added. * llint/LLIntData.cpp: Added. (LLInt): (JSC::LLInt::Data::Data): (JSC::LLInt::Data::performAssertions): (JSC::LLInt::Data::~Data): * llint/LLIntData.h: Added. (JSC): (LLInt): (Data): (JSC::LLInt::Data::exceptionInstructions): (JSC::LLInt::Data::opcodeMap): (JSC::LLInt::Data::performAssertions): * llint/LLIntEntrypoints.cpp: Added. (LLInt): (JSC::LLInt::getFunctionEntrypoint): (JSC::LLInt::getEvalEntrypoint): (JSC::LLInt::getProgramEntrypoint): * llint/LLIntEntrypoints.h: Added. (JSC): (LLInt): (JSC::LLInt::getEntrypoint): * llint/LLIntExceptions.cpp: Added. (LLInt): (JSC::LLInt::interpreterThrowInCaller): (JSC::LLInt::returnToThrowForThrownException): (JSC::LLInt::returnToThrow): (JSC::LLInt::callToThrow): * llint/LLIntExceptions.h: Added. (JSC): (LLInt): * llint/LLIntOfflineAsmConfig.h: Added. * llint/LLIntOffsetsExtractor.cpp: Added. (JSC): (LLIntOffsetsExtractor): (JSC::LLIntOffsetsExtractor::dummy): (main): * llint/LLIntSlowPaths.cpp: Added. (LLInt): (JSC::LLInt::llint_trace_operand): (JSC::LLInt::llint_trace_value): (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::traceFunctionPrologue): (JSC::LLInt::shouldJIT): (JSC::LLInt::entryOSR): (JSC::LLInt::resolveGlobal): (JSC::LLInt::getByVal): (JSC::LLInt::handleHostCall): (JSC::LLInt::setUpCall): (JSC::LLInt::genericCall): * llint/LLIntSlowPaths.h: Added. (JSC): (LLInt): * llint/LLIntThunks.cpp: Added. (LLInt): (JSC::LLInt::generateThunkWithJumpTo): (JSC::LLInt::functionForCallEntryThunkGenerator): (JSC::LLInt::functionForConstructEntryThunkGenerator): (JSC::LLInt::functionForCallArityCheckThunkGenerator): (JSC::LLInt::functionForConstructArityCheckThunkGenerator): (JSC::LLInt::evalEntryThunkGenerator): (JSC::LLInt::programEntryThunkGenerator): * llint/LLIntThunks.h: Added. (JSC): (LLInt): * llint/LowLevelInterpreter.asm: Added. * llint/LowLevelInterpreter.cpp: Added. * llint/LowLevelInterpreter.h: Added. * offlineasm: Added. * offlineasm/armv7.rb: Added. * offlineasm/asm.rb: Added. * offlineasm/ast.rb: Added. * offlineasm/backends.rb: Added. * offlineasm/generate_offset_extractor.rb: Added. * offlineasm/instructions.rb: Added. * offlineasm/offset_extractor_constants.rb: Added. * offlineasm/offsets.rb: Added. * offlineasm/opt.rb: Added. * offlineasm/parser.rb: Added. * offlineasm/registers.rb: Added. * offlineasm/self_hash.rb: Added. * offlineasm/settings.rb: Added. * offlineasm/transform.rb: Added. * offlineasm/x86.rb: Added. * runtime/CodeSpecializationKind.h: Added. (JSC): * runtime/CommonSlowPaths.h: (JSC::CommonSlowPaths::arityCheckFor): (CommonSlowPaths): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC): (JSC::EvalExecutable::jitCompile): (JSC::samplingDescription): (JSC::EvalExecutable::compileInternal): (JSC::ProgramExecutable::jitCompile): (JSC::ProgramExecutable::compileInternal): (JSC::FunctionExecutable::baselineCodeBlockFor): (JSC::FunctionExecutable::jitCompileForCall): (JSC::FunctionExecutable::jitCompileForConstruct): (JSC::FunctionExecutable::compileForCallInternal): (JSC::FunctionExecutable::compileForConstructInternal): * runtime/Executable.h: (JSC): (EvalExecutable): (ProgramExecutable): (FunctionExecutable): (JSC::FunctionExecutable::jitCompileFor): * runtime/ExecutionHarness.h: Added. (JSC): (JSC::prepareForExecution): (JSC::prepareFunctionForExecution): * runtime/JSArray.h: (JSC): (JSArray): * runtime/JSCell.h: (JSC): (JSCell): * runtime/JSFunction.h: (JSC): (JSFunction): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): * runtime/JSGlobalData.h: (JSC): (JSGlobalData): * runtime/JSGlobalObject.h: (JSC): (JSGlobalObject): * runtime/JSObject.h: (JSC): (JSObject): (JSFinalObject): * runtime/JSPropertyNameIterator.h: (JSC): (JSPropertyNameIterator): * runtime/JSString.h: (JSC): (JSString): * runtime/JSTypeInfo.h: (JSC): (TypeInfo): * runtime/JSValue.cpp: (JSC::JSValue::description): * runtime/JSValue.h: (LLInt): (JSValue): * runtime/JSVariableObject.h: (JSC): (JSVariableObject): * runtime/Options.cpp: (Options): (JSC::Options::initializeOptions): * runtime/Options.h: (Options): * runtime/ScopeChain.h: (JSC): (ScopeChainNode): * runtime/Structure.cpp: (JSC::Structure::addPropertyTransition): * runtime/Structure.h: (JSC): (Structure): * runtime/StructureChain.h: (JSC): (StructureChain): * wtf/InlineASM.h: * wtf/Platform.h: * wtf/SentinelLinkedList.h: (SentinelLinkedList): (WTF::SentinelLinkedList::isEmpty): * wtf/text/StringImpl.h: (JSC): (StringImpl): Source/WebCore: Reviewed by Gavin Barraclough. No new tests, because there is no change in behavior. * CMakeLists.txt: Source/WebKit: Reviewed by Gavin Barraclough. Changed EFL's build system to include a new directory in JavaScriptCore. * CMakeLists.txt: Tools: Reviewed by Gavin Barraclough. Changed EFL's build system to include a new directory in JavaScriptCore. * DumpRenderTree/efl/CMakeLists.txt: Canonical link: https://commits.webkit.org/96248@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@108444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-22 05:23:19 +00:00
#else
2018-07-09 21:55:48 +00:00
#define OFFLINE_ASM_TRACING 0
JSC should be a triple-tier VM https://bugs.webkit.org/show_bug.cgi?id=75812 <rdar://problem/10079694> Source/JavaScriptCore: Reviewed by Gavin Barraclough. Implemented an interpreter that uses the JIT's calling convention. This interpreter is called LLInt, or the Low Level Interpreter. JSC will now will start by executing code in LLInt and will only tier up to the old JIT after the code is proven hot. LLInt is written in a modified form of our macro assembly. This new macro assembly is compiled by an offline assembler (see offlineasm), which implements many modern conveniences such as a Turing-complete CPS-based macro language and direct access to relevant C++ type information (basically offsets of fields and sizes of structs/classes). Code executing in LLInt appears to the rest of the JSC world "as if" it were executing in the old JIT. Hence, things like exception handling and cross-execution-engine calls just work and require pretty much no additional overhead. This interpreter is 2-2.5x faster than our old interpreter on SunSpider, V8, and Kraken. With triple-tiering turned on, we're neutral on SunSpider, V8, and Kraken, but appear to get a double-digit improvement on real-world websites due to a huge reduction in the amount of JIT'ing. * CMakeLists.txt: * GNUmakefile.am: * GNUmakefile.list.am: * JavaScriptCore.pri: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * assembler/LinkBuffer.h: * assembler/MacroAssemblerCodeRef.h: (MacroAssemblerCodePtr): (JSC::MacroAssemblerCodePtr::createFromExecutableAddress): * bytecode/BytecodeConventions.h: Added. * bytecode/CallLinkStatus.cpp: (JSC::CallLinkStatus::computeFromLLInt): (JSC): (JSC::CallLinkStatus::computeFor): * bytecode/CallLinkStatus.h: (JSC::CallLinkStatus::isSet): (JSC::CallLinkStatus::operator!): (CallLinkStatus): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::CodeBlock): (JSC::CodeBlock::~CodeBlock): (JSC::CodeBlock::finalizeUnconditionally): (JSC::CodeBlock::stronglyVisitStrongReferences): (JSC): (JSC::CodeBlock::unlinkCalls): (JSC::CodeBlock::unlinkIncomingCalls): (JSC::CodeBlock::bytecodeOffset): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::ProgramCodeBlock::jitCompileImpl): (JSC::EvalCodeBlock::jitCompileImpl): (JSC::FunctionCodeBlock::jitCompileImpl): * bytecode/CodeBlock.h: (JSC): (CodeBlock): (JSC::CodeBlock::baselineVersion): (JSC::CodeBlock::linkIncomingCall): (JSC::CodeBlock::bytecodeOffset): (JSC::CodeBlock::jitCompile): (JSC::CodeBlock::hasOptimizedReplacement): (JSC::CodeBlock::addPropertyAccessInstruction): (JSC::CodeBlock::addGlobalResolveInstruction): (JSC::CodeBlock::addLLIntCallLinkInfo): (JSC::CodeBlock::addGlobalResolveInfo): (JSC::CodeBlock::numberOfMethodCallLinkInfos): (JSC::CodeBlock::valueProfilePredictionForBytecodeOffset): (JSC::CodeBlock::likelyToTakeSlowCase): (JSC::CodeBlock::couldTakeSlowCase): (JSC::CodeBlock::likelyToTakeSpecialFastCase): (JSC::CodeBlock::likelyToTakeDeepestSlowCase): (JSC::CodeBlock::likelyToTakeAnySlowCase): (JSC::CodeBlock::addFrequentExitSite): (JSC::CodeBlock::dontJITAnytimeSoon): (JSC::CodeBlock::jitAfterWarmUp): (JSC::CodeBlock::jitSoon): (JSC::CodeBlock::llintExecuteCounter): (ProgramCodeBlock): (EvalCodeBlock): (FunctionCodeBlock): * bytecode/GetByIdStatus.cpp: (JSC::GetByIdStatus::computeFromLLInt): (JSC): (JSC::GetByIdStatus::computeFor): * bytecode/GetByIdStatus.h: (JSC::GetByIdStatus::GetByIdStatus): (JSC::GetByIdStatus::wasSeenInJIT): (GetByIdStatus): * bytecode/Instruction.h: (JSC): (JSC::Instruction::Instruction): (Instruction): * bytecode/LLIntCallLinkInfo.h: Added. (JSC): (JSC::LLIntCallLinkInfo::LLIntCallLinkInfo): (LLIntCallLinkInfo): (JSC::LLIntCallLinkInfo::~LLIntCallLinkInfo): (JSC::LLIntCallLinkInfo::isLinked): (JSC::LLIntCallLinkInfo::unlink): * bytecode/MethodCallLinkStatus.cpp: (JSC::MethodCallLinkStatus::computeFor): * bytecode/Opcode.cpp: (JSC): * bytecode/Opcode.h: (JSC): (JSC::padOpcodeName): * bytecode/PutByIdStatus.cpp: (JSC::PutByIdStatus::computeFromLLInt): (JSC): (JSC::PutByIdStatus::computeFor): * bytecode/PutByIdStatus.h: (PutByIdStatus): * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitResolve): (JSC::BytecodeGenerator::emitResolveWithBase): (JSC::BytecodeGenerator::emitGetById): (JSC::BytecodeGenerator::emitPutById): (JSC::BytecodeGenerator::emitDirectPutById): (JSC::BytecodeGenerator::emitCall): (JSC::BytecodeGenerator::emitConstruct): (JSC::BytecodeGenerator::emitCatch): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): (JSC::DFG::ByteCodeParser::handleInlining): (JSC::DFG::ByteCodeParser::parseBlock): * dfg/DFGCapabilities.h: (JSC::DFG::canCompileOpcode): * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGOperations.cpp: * heap/Heap.h: (JSC): (JSC::Heap::firstAllocatorWithoutDestructors): (Heap): * heap/MarkStack.cpp: (JSC::visitChildren): * heap/MarkedAllocator.h: (JSC): (MarkedAllocator): * heap/MarkedSpace.h: (JSC): (MarkedSpace): (JSC::MarkedSpace::firstAllocator): * interpreter/CallFrame.cpp: (JSC): (JSC::CallFrame::bytecodeOffsetForNonDFGCode): (JSC::CallFrame::setBytecodeOffsetForNonDFGCode): (JSC::CallFrame::currentVPC): (JSC::CallFrame::setCurrentVPC): (JSC::CallFrame::trueCallerFrame): * interpreter/CallFrame.h: (JSC::ExecState::hasReturnPC): (JSC::ExecState::clearReturnPC): (ExecState): (JSC::ExecState::bytecodeOffsetForNonDFGCode): (JSC::ExecState::currentVPC): (JSC::ExecState::setCurrentVPC): * interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): (JSC::Interpreter::~Interpreter): (JSC): (JSC::Interpreter::initialize): (JSC::Interpreter::isOpcode): (JSC::Interpreter::unwindCallFrame): (JSC::getCallerInfo): (JSC::Interpreter::privateExecute): (JSC::Interpreter::retrieveLastCaller): * interpreter/Interpreter.h: (JSC): (Interpreter): (JSC::Interpreter::getOpcode): (JSC::Interpreter::getOpcodeID): (JSC::Interpreter::classicEnabled): * interpreter/RegisterFile.h: (JSC): (RegisterFile): * jit/ExecutableAllocator.h: (JSC): * jit/HostCallReturnValue.cpp: Added. (JSC): (JSC::getHostCallReturnValueWithExecState): * jit/HostCallReturnValue.h: Added. (JSC): (JSC::initializeHostCallReturnValue): * jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile): * jit/JITCode.h: (JSC::JITCode::isOptimizingJIT): (JITCode): (JSC::JITCode::isBaselineCode): (JSC::JITCode::JITCode): * jit/JITDriver.h: (JSC::jitCompileIfAppropriate): (JSC::jitCompileFunctionIfAppropriate): * jit/JITExceptions.cpp: (JSC::jitThrow): * jit/JITInlineMethods.h: (JSC::JIT::updateTopCallFrame): * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): (JSC): * jit/JITStubs.h: (JSC): * jit/JSInterfaceJIT.h: * llint: Added. * llint/LLIntCommon.h: Added. * llint/LLIntData.cpp: Added. (LLInt): (JSC::LLInt::Data::Data): (JSC::LLInt::Data::performAssertions): (JSC::LLInt::Data::~Data): * llint/LLIntData.h: Added. (JSC): (LLInt): (Data): (JSC::LLInt::Data::exceptionInstructions): (JSC::LLInt::Data::opcodeMap): (JSC::LLInt::Data::performAssertions): * llint/LLIntEntrypoints.cpp: Added. (LLInt): (JSC::LLInt::getFunctionEntrypoint): (JSC::LLInt::getEvalEntrypoint): (JSC::LLInt::getProgramEntrypoint): * llint/LLIntEntrypoints.h: Added. (JSC): (LLInt): (JSC::LLInt::getEntrypoint): * llint/LLIntExceptions.cpp: Added. (LLInt): (JSC::LLInt::interpreterThrowInCaller): (JSC::LLInt::returnToThrowForThrownException): (JSC::LLInt::returnToThrow): (JSC::LLInt::callToThrow): * llint/LLIntExceptions.h: Added. (JSC): (LLInt): * llint/LLIntOfflineAsmConfig.h: Added. * llint/LLIntOffsetsExtractor.cpp: Added. (JSC): (LLIntOffsetsExtractor): (JSC::LLIntOffsetsExtractor::dummy): (main): * llint/LLIntSlowPaths.cpp: Added. (LLInt): (JSC::LLInt::llint_trace_operand): (JSC::LLInt::llint_trace_value): (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::traceFunctionPrologue): (JSC::LLInt::shouldJIT): (JSC::LLInt::entryOSR): (JSC::LLInt::resolveGlobal): (JSC::LLInt::getByVal): (JSC::LLInt::handleHostCall): (JSC::LLInt::setUpCall): (JSC::LLInt::genericCall): * llint/LLIntSlowPaths.h: Added. (JSC): (LLInt): * llint/LLIntThunks.cpp: Added. (LLInt): (JSC::LLInt::generateThunkWithJumpTo): (JSC::LLInt::functionForCallEntryThunkGenerator): (JSC::LLInt::functionForConstructEntryThunkGenerator): (JSC::LLInt::functionForCallArityCheckThunkGenerator): (JSC::LLInt::functionForConstructArityCheckThunkGenerator): (JSC::LLInt::evalEntryThunkGenerator): (JSC::LLInt::programEntryThunkGenerator): * llint/LLIntThunks.h: Added. (JSC): (LLInt): * llint/LowLevelInterpreter.asm: Added. * llint/LowLevelInterpreter.cpp: Added. * llint/LowLevelInterpreter.h: Added. * offlineasm: Added. * offlineasm/armv7.rb: Added. * offlineasm/asm.rb: Added. * offlineasm/ast.rb: Added. * offlineasm/backends.rb: Added. * offlineasm/generate_offset_extractor.rb: Added. * offlineasm/instructions.rb: Added. * offlineasm/offset_extractor_constants.rb: Added. * offlineasm/offsets.rb: Added. * offlineasm/opt.rb: Added. * offlineasm/parser.rb: Added. * offlineasm/registers.rb: Added. * offlineasm/self_hash.rb: Added. * offlineasm/settings.rb: Added. * offlineasm/transform.rb: Added. * offlineasm/x86.rb: Added. * runtime/CodeSpecializationKind.h: Added. (JSC): * runtime/CommonSlowPaths.h: (JSC::CommonSlowPaths::arityCheckFor): (CommonSlowPaths): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC): (JSC::EvalExecutable::jitCompile): (JSC::samplingDescription): (JSC::EvalExecutable::compileInternal): (JSC::ProgramExecutable::jitCompile): (JSC::ProgramExecutable::compileInternal): (JSC::FunctionExecutable::baselineCodeBlockFor): (JSC::FunctionExecutable::jitCompileForCall): (JSC::FunctionExecutable::jitCompileForConstruct): (JSC::FunctionExecutable::compileForCallInternal): (JSC::FunctionExecutable::compileForConstructInternal): * runtime/Executable.h: (JSC): (EvalExecutable): (ProgramExecutable): (FunctionExecutable): (JSC::FunctionExecutable::jitCompileFor): * runtime/ExecutionHarness.h: Added. (JSC): (JSC::prepareForExecution): (JSC::prepareFunctionForExecution): * runtime/JSArray.h: (JSC): (JSArray): * runtime/JSCell.h: (JSC): (JSCell): * runtime/JSFunction.h: (JSC): (JSFunction): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): * runtime/JSGlobalData.h: (JSC): (JSGlobalData): * runtime/JSGlobalObject.h: (JSC): (JSGlobalObject): * runtime/JSObject.h: (JSC): (JSObject): (JSFinalObject): * runtime/JSPropertyNameIterator.h: (JSC): (JSPropertyNameIterator): * runtime/JSString.h: (JSC): (JSString): * runtime/JSTypeInfo.h: (JSC): (TypeInfo): * runtime/JSValue.cpp: (JSC::JSValue::description): * runtime/JSValue.h: (LLInt): (JSValue): * runtime/JSVariableObject.h: (JSC): (JSVariableObject): * runtime/Options.cpp: (Options): (JSC::Options::initializeOptions): * runtime/Options.h: (Options): * runtime/ScopeChain.h: (JSC): (ScopeChainNode): * runtime/Structure.cpp: (JSC::Structure::addPropertyTransition): * runtime/Structure.h: (JSC): (Structure): * runtime/StructureChain.h: (JSC): (StructureChain): * wtf/InlineASM.h: * wtf/Platform.h: * wtf/SentinelLinkedList.h: (SentinelLinkedList): (WTF::SentinelLinkedList::isEmpty): * wtf/text/StringImpl.h: (JSC): (StringImpl): Source/WebCore: Reviewed by Gavin Barraclough. No new tests, because there is no change in behavior. * CMakeLists.txt: Source/WebKit: Reviewed by Gavin Barraclough. Changed EFL's build system to include a new directory in JavaScriptCore. * CMakeLists.txt: Tools: Reviewed by Gavin Barraclough. Changed EFL's build system to include a new directory in JavaScriptCore. * DumpRenderTree/efl/CMakeLists.txt: Canonical link: https://commits.webkit.org/96248@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@108444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-22 05:23:19 +00:00
#endif
#define OFFLINE_ASM_GIGACAGE_ENABLED GIGACAGE_ENABLED
[WebAssembly] Create a Wasm interpreter https://bugs.webkit.org/show_bug.cgi?id=194257 <rdar://problem/44186794> Reviewed by Saam Barati. Source/JavaScriptCore: Add an interpreter tier to WebAssembly which reuses the LLInt infrastructure. The interpreter currently tiers up straight to OMG and can OSR enter at the prologue and from loops. The initial implementation of the interpreter is very naive, but despite the lack of optimizations it still shows a 2x improvement on the WebAssembly subtests in JetStream2 and 2x improvement on the PSPDFKit benchmark. It reduces "compilation" times by ~3x and it's neutral on throughput. The interpreter follows the same calling conventions as the BBQ/OMG, this means that: - We have to allocate locals for all argument registers and write all arguments registers to the stack in the prologue. - Calls have to allocate space for at least as many arguments as the number of argument registers. Before each call, all argument registers must be loaded from the stack, and after we return from the call, all registers must be stored back to the stack, in case they contain return values. We carefully layout the stack so that the arguments that would already have to be passed in the stack end up in the right place. The stack layout for calls is: [ gprs ][ fprs ][ optional stack arguments ][ callee frame ] ^ sp - The return opcode has to load all registers from the stack, since they might need to contain results of the function. - The calling convention requires that the callee should store itself in the callee slot of the call frame, which is impossible in the interpreter, since the code we execute is the same for all callees. In order to work around that, we generate an entry thunk to the wasm interpreter for each function. All this thunk does is store the callee in the call frame and tail call the interpreter. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * bytecode/BytecodeDumper.cpp: (JSC::BytecodeDumper<Block>::constantName const): (JSC::BytecodeDumper<Block>::dumpValue): (JSC::BytecodeDumper<Block>::dumpBytecode): (JSC::CodeBlockBytecodeDumper<Block>::vm const): (JSC::CodeBlockBytecodeDumper<Block>::identifier const): (JSC::CodeBlockBytecodeDumper<Block>::dumpIdentifiers): (JSC::CodeBlockBytecodeDumper<Block>::dumpConstants): (JSC::CodeBlockBytecodeDumper<Block>::dumpExceptionHandlers): (JSC::CodeBlockBytecodeDumper<Block>::dumpSwitchJumpTables): (JSC::CodeBlockBytecodeDumper<Block>::dumpStringSwitchJumpTables): (JSC::CodeBlockBytecodeDumper<Block>::dumpBlock): * bytecode/BytecodeDumper.h: (JSC::BytecodeDumper::dumpValue): (JSC::BytecodeDumper::BytecodeDumper): * bytecode/BytecodeGeneratorification.cpp: (JSC::performGeneratorification): * bytecode/BytecodeList.rb: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dumpBytecode): * bytecode/Fits.h: * bytecode/Instruction.h: (JSC::BaseInstruction::BaseInstruction): (JSC::BaseInstruction::Impl::opcodeID const): (JSC::BaseInstruction::opcodeID const): (JSC::BaseInstruction::name const): (JSC::BaseInstruction::isWide16 const): (JSC::BaseInstruction::isWide32 const): (JSC::BaseInstruction::hasMetadata const): (JSC::BaseInstruction::sizeShiftAmount const): (JSC::BaseInstruction::size const): (JSC::BaseInstruction::is const): (JSC::BaseInstruction::as const): (JSC::BaseInstruction::cast): (JSC::BaseInstruction::cast const): (JSC::BaseInstruction::wide16 const): (JSC::BaseInstruction::wide32 const): * bytecode/InstructionStream.h: (JSC::InstructionStream::iterator::operator+=): (JSC::InstructionStream::iterator::operator++): (JSC::InstructionStreamWriter::iterator::operator+=): (JSC::InstructionStreamWriter::iterator::operator++): * bytecode/Opcode.cpp: * bytecode/Opcode.h: * bytecode/PreciseJumpTargetsInlines.h: * bytecode/UnlinkedCodeBlock.h: * bytecode/VirtualRegister.cpp: (JSC::VirtualRegister::VirtualRegister): * bytecode/VirtualRegister.h: * bytecompiler/BytecodeGenerator.cpp: (JSC::GenericLabel<JSGeneratorTraits>::setLocation): (JSC::BytecodeGenerator::BytecodeGenerator): * bytecompiler/BytecodeGenerator.h: * bytecompiler/BytecodeGeneratorBase.h: Added. * bytecompiler/BytecodeGeneratorBaseInlines.h: Added. (JSC::shrinkToFit): (JSC::BytecodeGeneratorBase<Traits>::BytecodeGeneratorBase): (JSC::BytecodeGeneratorBase<Traits>::newLabel): (JSC::BytecodeGeneratorBase<Traits>::newEmittedLabel): (JSC::BytecodeGeneratorBase<Traits>::reclaimFreeRegisters): (JSC::BytecodeGeneratorBase<Traits>::emitLabel): (JSC::BytecodeGeneratorBase<Traits>::recordOpcode): (JSC::BytecodeGeneratorBase<Traits>::alignWideOpcode16): (JSC::BytecodeGeneratorBase<Traits>::alignWideOpcode32): (JSC::BytecodeGeneratorBase<Traits>::write): (JSC::BytecodeGeneratorBase<Traits>::newRegister): (JSC::BytecodeGeneratorBase<Traits>::newTemporary): (JSC::BytecodeGeneratorBase<Traits>::addVar): (JSC::BytecodeGeneratorBase<Traits>::allocateCalleeSaveSpace): * bytecompiler/Label.h: (JSC::GenericBoundLabel::GenericBoundLabel): (JSC::GenericBoundLabel::target): (JSC::GenericBoundLabel::saveTarget): (JSC::GenericBoundLabel::commitTarget): * dfg/DFGByteCodeParser.cpp: * dfg/DFGCapabilities.cpp: (JSC::DFG::capabilityLevel): * dfg/DFGOperations.cpp: * generator/Argument.rb: * generator/DSL.rb: * generator/GeneratedFile.rb: * generator/Opcode.rb: * generator/Options.rb: * generator/Section.rb: * generator/Wasm.rb: Added. * interpreter/Register.h: * interpreter/RegisterInlines.h: (JSC::Register::operator=): * jit/JITArithmetic.cpp: * jit/JITOpcodes.cpp: * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC::LLInt::wasmExceptionInstructions): * llint/LLIntOfflineAsmConfig.h: * llint/LLIntOffsetsExtractor.cpp: * llint/LLIntSlowPaths.cpp: * llint/LLIntThunks.cpp: (JSC::LLInt::generateThunkWithJumpTo): (JSC::LLInt::wasmFunctionEntryThunk): * llint/LLIntThunks.h: * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * llint/WebAssembly.asm: Added. * offlineasm/arm64.rb: * offlineasm/instructions.rb: * offlineasm/parser.rb: * offlineasm/registers.rb: * offlineasm/transform.rb: * offlineasm/x86.rb: * parser/Nodes.h: * runtime/Error.cpp: (JSC::FindFirstCallerFrameWithCodeblockFunctor::operator() const): * runtime/ErrorInstance.cpp: (JSC::ErrorInstance::finishCreation): * runtime/Options.cpp: (JSC::overrideDefaults): * runtime/OptionsList.h: * runtime/SamplingProfiler.cpp: (JSC::FrameWalker::recordJITFrame): (JSC::FrameWalker::resetAtMachineFrame): * wasm/WasmAirIRGenerator.cpp: (JSC::Wasm::AirIRGenerator::isControlTypeIf): (JSC::Wasm::AirIRGenerator::emitLoopTierUpCheck): * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::B3IRGenerator::isControlTypeIf): * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::prepareImpl): (JSC::Wasm::BBQPlan::work): (JSC::Wasm::BBQPlan::compileFunction): (JSC::Wasm::BBQPlan::didCompleteCompilation): (JSC::Wasm::BBQPlan::initializeCallees): * wasm/WasmBBQPlan.h: * wasm/WasmBBQPlanInlines.h: Removed. * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): (JSC::Wasm::Callee::dump const): (JSC::Wasm::JITCallee::JITCallee): (JSC::Wasm::LLIntCallee::setEntrypoint): (JSC::Wasm::LLIntCallee::entrypoint const): (JSC::Wasm::LLIntCallee::calleeSaveRegisters): (JSC::Wasm:: const): * wasm/WasmCallee.h: (JSC::Wasm::Callee::setOSREntryCallee): (JSC::Wasm::JITCallee::wasmToWasmCallsites): (JSC::Wasm::JITCallee:: const): * wasm/WasmCallingConvention.h: * wasm/WasmCodeBlock.cpp: (JSC::Wasm::CodeBlock::CodeBlock): * wasm/WasmCodeBlock.h: (JSC::Wasm::CodeBlock::wasmEntrypointCalleeFromFunctionIndexSpace): (JSC::Wasm::CodeBlock::wasmBBQCalleeFromFunctionIndexSpace): (JSC::Wasm::CodeBlock::wasmToWasmExitStub): * wasm/WasmCompilationMode.cpp: (JSC::Wasm::makeString): * wasm/WasmCompilationMode.h: * wasm/WasmEmbedder.h: * wasm/WasmEntryPlan.cpp: Added. (JSC::Wasm::EntryPlan::EntryPlan): (JSC::Wasm::EntryPlan::stateString): (JSC::Wasm::EntryPlan::moveToState): (JSC::Wasm::EntryPlan::didReceiveFunctionData): (JSC::Wasm::EntryPlan::parseAndValidateModule): (JSC::Wasm::EntryPlan::prepare): (JSC::Wasm::EntryPlan::ThreadCountHolder::ThreadCountHolder): (JSC::Wasm::EntryPlan::ThreadCountHolder::~ThreadCountHolder): (JSC::Wasm::EntryPlan::complete): (JSC::Wasm::EntryPlan::compileFunctions): (JSC::Wasm::EntryPlan::work): * wasm/WasmEntryPlan.h: Copied from Source/JavaScriptCore/wasm/WasmBBQPlan.h. (JSC::Wasm::EntryPlan::parseAndValidateModule): (JSC::Wasm::EntryPlan::exports const): (JSC::Wasm::EntryPlan::internalFunctionCount const): (JSC::Wasm::EntryPlan::takeModuleInformation): (JSC::Wasm::EntryPlan::takeWasmToWasmExitStubs): (JSC::Wasm::EntryPlan::takeWasmToWasmCallsites): (JSC::Wasm::EntryPlan::hasBeenPrepared const): (JSC::Wasm::EntryPlan::tryReserveCapacity): * wasm/WasmFunctionCodeBlock.cpp: Added. (JSC::Wasm::FunctionCodeBlock::setInstructions): (JSC::Wasm::FunctionCodeBlock::dumpBytecode): (JSC::Wasm::FunctionCodeBlock::addOutOfLineJumpTarget): (JSC::Wasm::FunctionCodeBlock::outOfLineJumpOffset): (JSC::Wasm::FunctionCodeBlock::outOfLineJumpTarget): (JSC::Wasm::FunctionCodeBlock::addSignature): (JSC::Wasm::FunctionCodeBlock::signature const): (JSC::Wasm::FunctionCodeBlock::addJumpTable): (JSC::Wasm::FunctionCodeBlock::jumpTable const const): (JSC::Wasm::FunctionCodeBlock::numberOfJumpTables const): * wasm/WasmFunctionCodeBlock.h: Added. (JSC::Wasm::FunctionCodeBlock::FunctionCodeBlock): (JSC::Wasm::FunctionCodeBlock::getConstant const): (JSC::Wasm::FunctionCodeBlock::functionIndex const): (JSC::Wasm::FunctionCodeBlock::addJumpTarget): (JSC::Wasm::FunctionCodeBlock::numberOfJumpTargets): (JSC::Wasm::FunctionCodeBlock::lastJumpTarget): (JSC::Wasm::FunctionCodeBlock::outOfLineJumpOffset): (JSC::Wasm::FunctionCodeBlock::bytecodeOffset): (JSC::Wasm::FunctionCodeBlock::tierUpCounter): * wasm/WasmFunctionParser.h: (JSC::Wasm::FunctionParser<Context>::parseExpression): (JSC::Wasm::FunctionParser<Context>::parseUnreachableExpression): * wasm/WasmInstance.h: * wasm/WasmLLIntGenerator.cpp: Added. (JSC::Wasm::LLIntGenerator::ControlType::ControlType): (JSC::Wasm::LLIntGenerator::ControlType::loop): (JSC::Wasm::LLIntGenerator::ControlType::topLevel): (JSC::Wasm::LLIntGenerator::ControlType::block): (JSC::Wasm::LLIntGenerator::ControlType::if_): (JSC::Wasm::LLIntGenerator::ControlType::targetLabelForBranch const): (JSC::Wasm::LLIntGenerator::fail const): (JSC::Wasm::LLIntGenerator::unifyValuesWithBlock): (JSC::Wasm::LLIntGenerator::emptyExpression): (JSC::Wasm::LLIntGenerator::createStack): (JSC::Wasm::LLIntGenerator::isControlTypeIf): (JSC::Wasm::LLIntGenerator::addEndToUnreachable): (JSC::Wasm::LLIntGenerator::setParser): (JSC::Wasm::LLIntGenerator::dump): (JSC::Wasm::LLIntGenerator::virtualRegisterForLocal): (JSC::Wasm::LLIntGenerator::tmpsForSignature): (JSC::Wasm::LLIntGenerator::jsNullConstant): (JSC::Wasm::LLIntGenerator::isConstant): (JSC::Wasm::parseAndCompileBytecode): (JSC::Wasm::LLIntGenerator::LLIntGenerator): (JSC::Wasm::LLIntGenerator::finalize): (JSC::Wasm::LLIntGenerator::callInformationFor): (JSC::Wasm::LLIntGenerator::addArguments): (JSC::Wasm::LLIntGenerator::addLocal): (JSC::Wasm::LLIntGenerator::addConstant): (JSC::Wasm::LLIntGenerator::getLocal): (JSC::Wasm::LLIntGenerator::setLocal): (JSC::Wasm::LLIntGenerator::getGlobal): (JSC::Wasm::LLIntGenerator::setGlobal): (JSC::Wasm::LLIntGenerator::addLoop): (JSC::Wasm::LLIntGenerator::addTopLevel): (JSC::Wasm::LLIntGenerator::addBlock): (JSC::Wasm::LLIntGenerator::addIf): (JSC::Wasm::LLIntGenerator::addElse): (JSC::Wasm::LLIntGenerator::addElseToUnreachable): (JSC::Wasm::LLIntGenerator::addReturn): (JSC::Wasm::LLIntGenerator::addBranch): (JSC::Wasm::LLIntGenerator::addSwitch): (JSC::Wasm::LLIntGenerator::endBlock): (JSC::Wasm::LLIntGenerator::addCall): (JSC::Wasm::LLIntGenerator::addCallIndirect): (JSC::Wasm::LLIntGenerator::addRefIsNull): (JSC::Wasm::LLIntGenerator::addRefFunc): (JSC::Wasm::LLIntGenerator::addTableGet): (JSC::Wasm::LLIntGenerator::addTableSet): (JSC::Wasm::LLIntGenerator::addTableSize): (JSC::Wasm::LLIntGenerator::addTableGrow): (JSC::Wasm::LLIntGenerator::addTableFill): (JSC::Wasm::LLIntGenerator::addUnreachable): (JSC::Wasm::LLIntGenerator::addCurrentMemory): (JSC::Wasm::LLIntGenerator::addGrowMemory): (JSC::Wasm::LLIntGenerator::addSelect): (JSC::Wasm::LLIntGenerator::load): (JSC::Wasm::LLIntGenerator::store): (JSC::GenericLabel<Wasm::GeneratorTraits>::setLocation): * wasm/WasmLLIntGenerator.h: Copied from Source/JavaScriptCore/wasm/WasmCompilationMode.h. * wasm/WasmLLIntPlan.cpp: Added. (JSC::Wasm::LLIntPlan::prepareImpl): (JSC::Wasm::LLIntPlan::compileFunction): (JSC::Wasm::LLIntPlan::didCompleteCompilation): (JSC::Wasm::LLIntPlan::initializeCallees): * wasm/WasmLLIntPlan.h: Copied from Source/JavaScriptCore/wasm/WasmOMGForOSREntryPlan.h. * wasm/WasmLLIntTierUpCounter.cpp: Copied from Source/JavaScriptCore/wasm/WasmCompilationMode.cpp. (JSC::Wasm::LLIntTierUpCounter::addOSREntryDataForLoop): (JSC::Wasm::LLIntTierUpCounter::osrEntryDataForLoop const const): * wasm/WasmLLIntTierUpCounter.h: Copied from Source/JavaScriptCore/wasm/WasmOMGForOSREntryPlan.h. (JSC::Wasm::LLIntTierUpCounter::LLIntTierUpCounter): (JSC::Wasm::LLIntTierUpCounter::optimizeAfterWarmUp): (JSC::Wasm::LLIntTierUpCounter::checkIfOptimizationThresholdReached): (JSC::Wasm::LLIntTierUpCounter::optimizeSoon): * wasm/WasmMemoryInformation.cpp: (JSC::Wasm::PinnedRegisterInfo::get): * wasm/WasmModule.cpp: (JSC::Wasm::makeValidationResult): (JSC::Wasm::makeValidationCallback): (JSC::Wasm::Module::validateSync): (JSC::Wasm::Module::validateAsync): * wasm/WasmOMGForOSREntryPlan.cpp: (JSC::Wasm::OMGForOSREntryPlan::OMGForOSREntryPlan): (JSC::Wasm::OMGForOSREntryPlan::work): * wasm/WasmOMGForOSREntryPlan.h: * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmSlowPaths.cpp: Added. (JSC::LLInt::jitCompileAndSetHeuristics): (JSC::LLInt::WASM_SLOW_PATH_DECL): (JSC::LLInt::doWasmCall): (JSC::LLInt::doWasmCallIndirect): (JSC::LLInt::slow_path_wasm_throw_exception): (JSC::LLInt::slow_path_wasm_popcount): (JSC::LLInt::slow_path_wasm_popcountll): * wasm/WasmSlowPaths.h: Added. * wasm/WasmTable.cpp: (JSC::Wasm::FuncRefTable::function const): (JSC::Wasm::FuncRefTable::instance const): * wasm/WasmTable.h: * wasm/WasmTierUpCount.h: * wasm/WasmValidate.cpp: (JSC::Wasm::Validate::isControlTypeIf): * wasm/js/JSToWasm.cpp: (JSC::Wasm::createJSToWasmWrapper): * wasm/js/JSToWasm.h: * wasm/js/WebAssemblyFunction.cpp: (JSC::WebAssemblyFunction::calleeSaves const): Tools: Add a mode that runs WebAssembly tests without the LLInt (i.e. only Air) and update the no-air mode to also disable the LLInt tier. * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/217068@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251886 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-31 22:32:52 +00:00
#if ENABLE(WEBASSEMBLY)
#define OFFLINE_ASM_WEBASSEMBLY 1
#else
#define OFFLINE_ASM_WEBASSEMBLY 0
#endif
[JSC] Allow to build WebAssembly without B3 https://bugs.webkit.org/show_bug.cgi?id=220365 Patch by Xan Lopez <xan@igalia.com> on 2021-01-23 Reviewed by Yusuke Suzuki. .: Make the WebAssembly feature depend on Baseline JIT, not B3 JIT. Also add a WEBASSEMBLY_B3JIT feature to enable or disable the B3 tier in WebAssembly. * Source/cmake/WebKitFeatures.cmake: disable on 32bit. Source/JavaScriptCore: Make all the B3 related code in WebAssembly a compile-time option. When disabled WebAssembly will only use its LLInt tier. * llint/LLIntOfflineAsmConfig.h: define WEBASSEMBLY_B3JIT for the offline assembler. * llint/WebAssembly.asm: guard B3 code inside WEBASSEMBLY_B3JTI ifdefs. * wasm/WasmAirIRGenerator.cpp: ditto. * wasm/WasmAirIRGenerator.h: ditto. * wasm/WasmB3IRGenerator.cpp: ditto. * wasm/WasmB3IRGenerator.h: ditto. * wasm/WasmBBQPlan.cpp: ditto. * wasm/WasmBBQPlan.h: ditto. * wasm/WasmCallee.h: ditto. * wasm/WasmCodeBlock.cpp: (JSC::Wasm::CodeBlock::CodeBlock): ditto. * wasm/WasmCodeBlock.h: (JSC::Wasm::CodeBlock::wasmEntrypointCalleeFromFunctionIndexSpace): ditto. * wasm/WasmLLIntGenerator.h: ditto. * wasm/WasmLLIntPlan.cpp: ditto. * wasm/WasmOMGForOSREntryPlan.cpp: ditto. * wasm/WasmOMGForOSREntryPlan.h: ditto. * wasm/WasmOMGPlan.cpp: ditto. * wasm/WasmOMGPlan.h: ditto. * wasm/WasmOSREntryData.h: ditto. * wasm/WasmOperations.cpp: ditto. * wasm/WasmOperations.h: ditto. * wasm/WasmPlan.cpp: ditto. * wasm/WasmPlan.h: ditto. * wasm/WasmSlowPaths.cpp: ditto. * wasm/WasmSlowPaths.h: ditto. * wasm/WasmThunks.cpp: ditto. * wasm/WasmThunks.h: ditto. * wasm/WasmTierUpCount.cpp: ditto. * wasm/WasmTierUpCount.h: ditto. * wasm/generateWasmOpsHeader.py: ditto. Source/WTF: * wtf/PlatformEnable.h: Disable WebAssembly on 32bit platforms, enable WebAssembly B3JIT on PLATFORM(COCOA). Tools: * Scripts/webkitperl/FeatureList.pm: add WebAssembly B3 JIT option. Canonical link: https://commits.webkit.org/233281@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271775 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-23 12:32:22 +00:00
#if ENABLE(WEBASSEMBLY_B3JIT)
#define OFFLINE_ASM_WEBASSEMBLY_B3JIT 1
#else
#define OFFLINE_ASM_WEBASSEMBLY_B3JIT 0
#endif
[WebAssembly] Create a Wasm interpreter https://bugs.webkit.org/show_bug.cgi?id=194257 <rdar://problem/44186794> Reviewed by Saam Barati. Source/JavaScriptCore: Add an interpreter tier to WebAssembly which reuses the LLInt infrastructure. The interpreter currently tiers up straight to OMG and can OSR enter at the prologue and from loops. The initial implementation of the interpreter is very naive, but despite the lack of optimizations it still shows a 2x improvement on the WebAssembly subtests in JetStream2 and 2x improvement on the PSPDFKit benchmark. It reduces "compilation" times by ~3x and it's neutral on throughput. The interpreter follows the same calling conventions as the BBQ/OMG, this means that: - We have to allocate locals for all argument registers and write all arguments registers to the stack in the prologue. - Calls have to allocate space for at least as many arguments as the number of argument registers. Before each call, all argument registers must be loaded from the stack, and after we return from the call, all registers must be stored back to the stack, in case they contain return values. We carefully layout the stack so that the arguments that would already have to be passed in the stack end up in the right place. The stack layout for calls is: [ gprs ][ fprs ][ optional stack arguments ][ callee frame ] ^ sp - The return opcode has to load all registers from the stack, since they might need to contain results of the function. - The calling convention requires that the callee should store itself in the callee slot of the call frame, which is impossible in the interpreter, since the code we execute is the same for all callees. In order to work around that, we generate an entry thunk to the wasm interpreter for each function. All this thunk does is store the callee in the call frame and tail call the interpreter. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * bytecode/BytecodeDumper.cpp: (JSC::BytecodeDumper<Block>::constantName const): (JSC::BytecodeDumper<Block>::dumpValue): (JSC::BytecodeDumper<Block>::dumpBytecode): (JSC::CodeBlockBytecodeDumper<Block>::vm const): (JSC::CodeBlockBytecodeDumper<Block>::identifier const): (JSC::CodeBlockBytecodeDumper<Block>::dumpIdentifiers): (JSC::CodeBlockBytecodeDumper<Block>::dumpConstants): (JSC::CodeBlockBytecodeDumper<Block>::dumpExceptionHandlers): (JSC::CodeBlockBytecodeDumper<Block>::dumpSwitchJumpTables): (JSC::CodeBlockBytecodeDumper<Block>::dumpStringSwitchJumpTables): (JSC::CodeBlockBytecodeDumper<Block>::dumpBlock): * bytecode/BytecodeDumper.h: (JSC::BytecodeDumper::dumpValue): (JSC::BytecodeDumper::BytecodeDumper): * bytecode/BytecodeGeneratorification.cpp: (JSC::performGeneratorification): * bytecode/BytecodeList.rb: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dumpBytecode): * bytecode/Fits.h: * bytecode/Instruction.h: (JSC::BaseInstruction::BaseInstruction): (JSC::BaseInstruction::Impl::opcodeID const): (JSC::BaseInstruction::opcodeID const): (JSC::BaseInstruction::name const): (JSC::BaseInstruction::isWide16 const): (JSC::BaseInstruction::isWide32 const): (JSC::BaseInstruction::hasMetadata const): (JSC::BaseInstruction::sizeShiftAmount const): (JSC::BaseInstruction::size const): (JSC::BaseInstruction::is const): (JSC::BaseInstruction::as const): (JSC::BaseInstruction::cast): (JSC::BaseInstruction::cast const): (JSC::BaseInstruction::wide16 const): (JSC::BaseInstruction::wide32 const): * bytecode/InstructionStream.h: (JSC::InstructionStream::iterator::operator+=): (JSC::InstructionStream::iterator::operator++): (JSC::InstructionStreamWriter::iterator::operator+=): (JSC::InstructionStreamWriter::iterator::operator++): * bytecode/Opcode.cpp: * bytecode/Opcode.h: * bytecode/PreciseJumpTargetsInlines.h: * bytecode/UnlinkedCodeBlock.h: * bytecode/VirtualRegister.cpp: (JSC::VirtualRegister::VirtualRegister): * bytecode/VirtualRegister.h: * bytecompiler/BytecodeGenerator.cpp: (JSC::GenericLabel<JSGeneratorTraits>::setLocation): (JSC::BytecodeGenerator::BytecodeGenerator): * bytecompiler/BytecodeGenerator.h: * bytecompiler/BytecodeGeneratorBase.h: Added. * bytecompiler/BytecodeGeneratorBaseInlines.h: Added. (JSC::shrinkToFit): (JSC::BytecodeGeneratorBase<Traits>::BytecodeGeneratorBase): (JSC::BytecodeGeneratorBase<Traits>::newLabel): (JSC::BytecodeGeneratorBase<Traits>::newEmittedLabel): (JSC::BytecodeGeneratorBase<Traits>::reclaimFreeRegisters): (JSC::BytecodeGeneratorBase<Traits>::emitLabel): (JSC::BytecodeGeneratorBase<Traits>::recordOpcode): (JSC::BytecodeGeneratorBase<Traits>::alignWideOpcode16): (JSC::BytecodeGeneratorBase<Traits>::alignWideOpcode32): (JSC::BytecodeGeneratorBase<Traits>::write): (JSC::BytecodeGeneratorBase<Traits>::newRegister): (JSC::BytecodeGeneratorBase<Traits>::newTemporary): (JSC::BytecodeGeneratorBase<Traits>::addVar): (JSC::BytecodeGeneratorBase<Traits>::allocateCalleeSaveSpace): * bytecompiler/Label.h: (JSC::GenericBoundLabel::GenericBoundLabel): (JSC::GenericBoundLabel::target): (JSC::GenericBoundLabel::saveTarget): (JSC::GenericBoundLabel::commitTarget): * dfg/DFGByteCodeParser.cpp: * dfg/DFGCapabilities.cpp: (JSC::DFG::capabilityLevel): * dfg/DFGOperations.cpp: * generator/Argument.rb: * generator/DSL.rb: * generator/GeneratedFile.rb: * generator/Opcode.rb: * generator/Options.rb: * generator/Section.rb: * generator/Wasm.rb: Added. * interpreter/Register.h: * interpreter/RegisterInlines.h: (JSC::Register::operator=): * jit/JITArithmetic.cpp: * jit/JITOpcodes.cpp: * llint/LLIntData.cpp: (JSC::LLInt::initialize): * llint/LLIntData.h: (JSC::LLInt::wasmExceptionInstructions): * llint/LLIntOfflineAsmConfig.h: * llint/LLIntOffsetsExtractor.cpp: * llint/LLIntSlowPaths.cpp: * llint/LLIntThunks.cpp: (JSC::LLInt::generateThunkWithJumpTo): (JSC::LLInt::wasmFunctionEntryThunk): * llint/LLIntThunks.h: * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * llint/WebAssembly.asm: Added. * offlineasm/arm64.rb: * offlineasm/instructions.rb: * offlineasm/parser.rb: * offlineasm/registers.rb: * offlineasm/transform.rb: * offlineasm/x86.rb: * parser/Nodes.h: * runtime/Error.cpp: (JSC::FindFirstCallerFrameWithCodeblockFunctor::operator() const): * runtime/ErrorInstance.cpp: (JSC::ErrorInstance::finishCreation): * runtime/Options.cpp: (JSC::overrideDefaults): * runtime/OptionsList.h: * runtime/SamplingProfiler.cpp: (JSC::FrameWalker::recordJITFrame): (JSC::FrameWalker::resetAtMachineFrame): * wasm/WasmAirIRGenerator.cpp: (JSC::Wasm::AirIRGenerator::isControlTypeIf): (JSC::Wasm::AirIRGenerator::emitLoopTierUpCheck): * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::B3IRGenerator::isControlTypeIf): * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::prepareImpl): (JSC::Wasm::BBQPlan::work): (JSC::Wasm::BBQPlan::compileFunction): (JSC::Wasm::BBQPlan::didCompleteCompilation): (JSC::Wasm::BBQPlan::initializeCallees): * wasm/WasmBBQPlan.h: * wasm/WasmBBQPlanInlines.h: Removed. * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): (JSC::Wasm::Callee::dump const): (JSC::Wasm::JITCallee::JITCallee): (JSC::Wasm::LLIntCallee::setEntrypoint): (JSC::Wasm::LLIntCallee::entrypoint const): (JSC::Wasm::LLIntCallee::calleeSaveRegisters): (JSC::Wasm:: const): * wasm/WasmCallee.h: (JSC::Wasm::Callee::setOSREntryCallee): (JSC::Wasm::JITCallee::wasmToWasmCallsites): (JSC::Wasm::JITCallee:: const): * wasm/WasmCallingConvention.h: * wasm/WasmCodeBlock.cpp: (JSC::Wasm::CodeBlock::CodeBlock): * wasm/WasmCodeBlock.h: (JSC::Wasm::CodeBlock::wasmEntrypointCalleeFromFunctionIndexSpace): (JSC::Wasm::CodeBlock::wasmBBQCalleeFromFunctionIndexSpace): (JSC::Wasm::CodeBlock::wasmToWasmExitStub): * wasm/WasmCompilationMode.cpp: (JSC::Wasm::makeString): * wasm/WasmCompilationMode.h: * wasm/WasmEmbedder.h: * wasm/WasmEntryPlan.cpp: Added. (JSC::Wasm::EntryPlan::EntryPlan): (JSC::Wasm::EntryPlan::stateString): (JSC::Wasm::EntryPlan::moveToState): (JSC::Wasm::EntryPlan::didReceiveFunctionData): (JSC::Wasm::EntryPlan::parseAndValidateModule): (JSC::Wasm::EntryPlan::prepare): (JSC::Wasm::EntryPlan::ThreadCountHolder::ThreadCountHolder): (JSC::Wasm::EntryPlan::ThreadCountHolder::~ThreadCountHolder): (JSC::Wasm::EntryPlan::complete): (JSC::Wasm::EntryPlan::compileFunctions): (JSC::Wasm::EntryPlan::work): * wasm/WasmEntryPlan.h: Copied from Source/JavaScriptCore/wasm/WasmBBQPlan.h. (JSC::Wasm::EntryPlan::parseAndValidateModule): (JSC::Wasm::EntryPlan::exports const): (JSC::Wasm::EntryPlan::internalFunctionCount const): (JSC::Wasm::EntryPlan::takeModuleInformation): (JSC::Wasm::EntryPlan::takeWasmToWasmExitStubs): (JSC::Wasm::EntryPlan::takeWasmToWasmCallsites): (JSC::Wasm::EntryPlan::hasBeenPrepared const): (JSC::Wasm::EntryPlan::tryReserveCapacity): * wasm/WasmFunctionCodeBlock.cpp: Added. (JSC::Wasm::FunctionCodeBlock::setInstructions): (JSC::Wasm::FunctionCodeBlock::dumpBytecode): (JSC::Wasm::FunctionCodeBlock::addOutOfLineJumpTarget): (JSC::Wasm::FunctionCodeBlock::outOfLineJumpOffset): (JSC::Wasm::FunctionCodeBlock::outOfLineJumpTarget): (JSC::Wasm::FunctionCodeBlock::addSignature): (JSC::Wasm::FunctionCodeBlock::signature const): (JSC::Wasm::FunctionCodeBlock::addJumpTable): (JSC::Wasm::FunctionCodeBlock::jumpTable const const): (JSC::Wasm::FunctionCodeBlock::numberOfJumpTables const): * wasm/WasmFunctionCodeBlock.h: Added. (JSC::Wasm::FunctionCodeBlock::FunctionCodeBlock): (JSC::Wasm::FunctionCodeBlock::getConstant const): (JSC::Wasm::FunctionCodeBlock::functionIndex const): (JSC::Wasm::FunctionCodeBlock::addJumpTarget): (JSC::Wasm::FunctionCodeBlock::numberOfJumpTargets): (JSC::Wasm::FunctionCodeBlock::lastJumpTarget): (JSC::Wasm::FunctionCodeBlock::outOfLineJumpOffset): (JSC::Wasm::FunctionCodeBlock::bytecodeOffset): (JSC::Wasm::FunctionCodeBlock::tierUpCounter): * wasm/WasmFunctionParser.h: (JSC::Wasm::FunctionParser<Context>::parseExpression): (JSC::Wasm::FunctionParser<Context>::parseUnreachableExpression): * wasm/WasmInstance.h: * wasm/WasmLLIntGenerator.cpp: Added. (JSC::Wasm::LLIntGenerator::ControlType::ControlType): (JSC::Wasm::LLIntGenerator::ControlType::loop): (JSC::Wasm::LLIntGenerator::ControlType::topLevel): (JSC::Wasm::LLIntGenerator::ControlType::block): (JSC::Wasm::LLIntGenerator::ControlType::if_): (JSC::Wasm::LLIntGenerator::ControlType::targetLabelForBranch const): (JSC::Wasm::LLIntGenerator::fail const): (JSC::Wasm::LLIntGenerator::unifyValuesWithBlock): (JSC::Wasm::LLIntGenerator::emptyExpression): (JSC::Wasm::LLIntGenerator::createStack): (JSC::Wasm::LLIntGenerator::isControlTypeIf): (JSC::Wasm::LLIntGenerator::addEndToUnreachable): (JSC::Wasm::LLIntGenerator::setParser): (JSC::Wasm::LLIntGenerator::dump): (JSC::Wasm::LLIntGenerator::virtualRegisterForLocal): (JSC::Wasm::LLIntGenerator::tmpsForSignature): (JSC::Wasm::LLIntGenerator::jsNullConstant): (JSC::Wasm::LLIntGenerator::isConstant): (JSC::Wasm::parseAndCompileBytecode): (JSC::Wasm::LLIntGenerator::LLIntGenerator): (JSC::Wasm::LLIntGenerator::finalize): (JSC::Wasm::LLIntGenerator::callInformationFor): (JSC::Wasm::LLIntGenerator::addArguments): (JSC::Wasm::LLIntGenerator::addLocal): (JSC::Wasm::LLIntGenerator::addConstant): (JSC::Wasm::LLIntGenerator::getLocal): (JSC::Wasm::LLIntGenerator::setLocal): (JSC::Wasm::LLIntGenerator::getGlobal): (JSC::Wasm::LLIntGenerator::setGlobal): (JSC::Wasm::LLIntGenerator::addLoop): (JSC::Wasm::LLIntGenerator::addTopLevel): (JSC::Wasm::LLIntGenerator::addBlock): (JSC::Wasm::LLIntGenerator::addIf): (JSC::Wasm::LLIntGenerator::addElse): (JSC::Wasm::LLIntGenerator::addElseToUnreachable): (JSC::Wasm::LLIntGenerator::addReturn): (JSC::Wasm::LLIntGenerator::addBranch): (JSC::Wasm::LLIntGenerator::addSwitch): (JSC::Wasm::LLIntGenerator::endBlock): (JSC::Wasm::LLIntGenerator::addCall): (JSC::Wasm::LLIntGenerator::addCallIndirect): (JSC::Wasm::LLIntGenerator::addRefIsNull): (JSC::Wasm::LLIntGenerator::addRefFunc): (JSC::Wasm::LLIntGenerator::addTableGet): (JSC::Wasm::LLIntGenerator::addTableSet): (JSC::Wasm::LLIntGenerator::addTableSize): (JSC::Wasm::LLIntGenerator::addTableGrow): (JSC::Wasm::LLIntGenerator::addTableFill): (JSC::Wasm::LLIntGenerator::addUnreachable): (JSC::Wasm::LLIntGenerator::addCurrentMemory): (JSC::Wasm::LLIntGenerator::addGrowMemory): (JSC::Wasm::LLIntGenerator::addSelect): (JSC::Wasm::LLIntGenerator::load): (JSC::Wasm::LLIntGenerator::store): (JSC::GenericLabel<Wasm::GeneratorTraits>::setLocation): * wasm/WasmLLIntGenerator.h: Copied from Source/JavaScriptCore/wasm/WasmCompilationMode.h. * wasm/WasmLLIntPlan.cpp: Added. (JSC::Wasm::LLIntPlan::prepareImpl): (JSC::Wasm::LLIntPlan::compileFunction): (JSC::Wasm::LLIntPlan::didCompleteCompilation): (JSC::Wasm::LLIntPlan::initializeCallees): * wasm/WasmLLIntPlan.h: Copied from Source/JavaScriptCore/wasm/WasmOMGForOSREntryPlan.h. * wasm/WasmLLIntTierUpCounter.cpp: Copied from Source/JavaScriptCore/wasm/WasmCompilationMode.cpp. (JSC::Wasm::LLIntTierUpCounter::addOSREntryDataForLoop): (JSC::Wasm::LLIntTierUpCounter::osrEntryDataForLoop const const): * wasm/WasmLLIntTierUpCounter.h: Copied from Source/JavaScriptCore/wasm/WasmOMGForOSREntryPlan.h. (JSC::Wasm::LLIntTierUpCounter::LLIntTierUpCounter): (JSC::Wasm::LLIntTierUpCounter::optimizeAfterWarmUp): (JSC::Wasm::LLIntTierUpCounter::checkIfOptimizationThresholdReached): (JSC::Wasm::LLIntTierUpCounter::optimizeSoon): * wasm/WasmMemoryInformation.cpp: (JSC::Wasm::PinnedRegisterInfo::get): * wasm/WasmModule.cpp: (JSC::Wasm::makeValidationResult): (JSC::Wasm::makeValidationCallback): (JSC::Wasm::Module::validateSync): (JSC::Wasm::Module::validateAsync): * wasm/WasmOMGForOSREntryPlan.cpp: (JSC::Wasm::OMGForOSREntryPlan::OMGForOSREntryPlan): (JSC::Wasm::OMGForOSREntryPlan::work): * wasm/WasmOMGForOSREntryPlan.h: * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmSlowPaths.cpp: Added. (JSC::LLInt::jitCompileAndSetHeuristics): (JSC::LLInt::WASM_SLOW_PATH_DECL): (JSC::LLInt::doWasmCall): (JSC::LLInt::doWasmCallIndirect): (JSC::LLInt::slow_path_wasm_throw_exception): (JSC::LLInt::slow_path_wasm_popcount): (JSC::LLInt::slow_path_wasm_popcountll): * wasm/WasmSlowPaths.h: Added. * wasm/WasmTable.cpp: (JSC::Wasm::FuncRefTable::function const): (JSC::Wasm::FuncRefTable::instance const): * wasm/WasmTable.h: * wasm/WasmTierUpCount.h: * wasm/WasmValidate.cpp: (JSC::Wasm::Validate::isControlTypeIf): * wasm/js/JSToWasm.cpp: (JSC::Wasm::createJSToWasmWrapper): * wasm/js/JSToWasm.h: * wasm/js/WebAssemblyFunction.cpp: (JSC::WebAssemblyFunction::calleeSaves const): Tools: Add a mode that runs WebAssembly tests without the LLInt (i.e. only Air) and update the no-air mode to also disable the LLInt tier. * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/217068@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251886 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-31 22:32:52 +00:00
#if HAVE(FAST_TLS)
#define OFFLINE_ASM_HAVE_FAST_TLS 1
#else
#define OFFLINE_ASM_HAVE_FAST_TLS 0
#endif