1. 06 Mar, 2012 1 commit
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r109837. · cbcd594c
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/109837
      https://bugs.webkit.org/show_bug.cgi?id=80399
      
      breaks Mac Productions builds, too late to try and fix it
      tonight (Requested by eseidel on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-03-06
      
      Source/JavaScriptCore:
      
      * API/tests/JSNode.c:
      * API/tests/JSNodeList.c:
      * Configurations/Base.xcconfig:
      * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * assembler/MacroAssemblerCodeRef.h:
      * bytecompiler/BytecodeGenerator.h:
      * dfg/DFGOperations.cpp:
      * heap/GCAssertions.h:
      * heap/HandleHeap.h:
      * heap/HandleStack.h:
      * heap/MarkedSpace.h:
      * heap/PassWeak.h:
      * heap/Strong.h:
      * heap/Weak.h:
      * jit/HostCallReturnValue.cpp:
      * jit/JIT.cpp:
      * jit/JITStubs.cpp:
      * jit/ThunkGenerators.cpp:
      * parser/Lexer.cpp:
      * runtime/Completion.cpp:
      * runtime/Executable.cpp:
      * runtime/Identifier.h:
      * runtime/InitializeThreading.cpp:
      * runtime/JSDateMath.cpp:
      * runtime/JSGlobalObjectFunctions.cpp:
      * runtime/JSStringBuilder.h:
      * runtime/JSVariableObject.h:
      * runtime/NumberPrototype.cpp:
      * runtime/WriteBarrier.h:
      * tools/CodeProfile.cpp:
      * tools/TieredMMapArray.h:
      * yarr/YarrJIT.cpp:
      
      Tools:
      
      * Scripts/build-webkit:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@109888 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cbcd594c
  2. 05 Mar, 2012 1 commit
    • eric@webkit.org's avatar
      Source/JavaScriptCore: Update JavaScriptCore files to use fully-qualified WTF include paths · 37ac49ee
      eric@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=79960
      
      Reviewed by Adam Barth.
      
      This change does 5 small/related things:
       1. Updates JavaScriptCore.xcodeproj to install WTF headers into $BUILD/usr/local/include
          (WebCore, WebKit were already setup to look there, but JavaScriptCore.xcodeproj
          was not installing headers there.)
       2. Makes JavaScriptCore targets include $BUILD/usr/local/include in their
          header search path, as that's where the WTF headers will be installed.
       3. Similarly updates JavaScriptCore.vcproj/copy-files.cmd to copy WTF headers to PrivateHeaders/wtf/*
          in addition to the current behavior of flattening all headers to PrivateHeaders/*.h.
       4. Updates a bunch of JSC files to use #include <wtf/Foo.h> instead of #include "Foo.h"
          since soon the WTF headers will not be part of the JavaScriptCore Xcode project.
       5. Makes build-webkit build the WTF XCode project by default.
      
      * API/tests/JSNode.c:
      * API/tests/JSNodeList.c:
      * Configurations/Base.xcconfig:
      * assembler/MacroAssemblerCodeRef.h:
      * bytecompiler/BytecodeGenerator.h:
      * dfg/DFGOperations.cpp:
      * heap/GCAssertions.h:
      * heap/HandleHeap.h:
      * heap/HandleStack.h:
      * heap/MarkedSpace.h:
      * heap/PassWeak.h:
      * heap/Strong.h:
      * heap/Weak.h:
      * jit/HostCallReturnValue.cpp:
      * jit/JIT.cpp:
      * jit/JITStubs.cpp:
      * jit/ThunkGenerators.cpp:
      * parser/Lexer.cpp:
      * runtime/Completion.cpp:
      * runtime/Executable.cpp:
      * runtime/Identifier.h:
      * runtime/InitializeThreading.cpp:
      * runtime/JSDateMath.cpp:
      * runtime/JSGlobalObjectFunctions.cpp:
      * runtime/JSStringBuilder.h:
      * runtime/JSVariableObject.h:
      * runtime/NumberPrototype.cpp:
      * runtime/WriteBarrier.h:
      * tools/CodeProfile.cpp:
      * tools/TieredMMapArray.h:
      * yarr/YarrJIT.cpp:
      
      Tools: Update JavaScriptCore files to use fully-qualified WTF include path
      https://bugs.webkit.org/show_bug.cgi?id=79960
      
      Reviewed by Adam Barth.
      
      Build WTF/WTF.xcodeproj by default on Mac.
      
      * Scripts/build-webkit:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@109837 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      37ac49ee
  3. 29 Feb, 2012 1 commit
    • fpizlo@apple.com's avatar
      The JIT should not crash the entire process just because there is not · 0f25ee88
      fpizlo@apple.com authored
      enough executable memory, if the LLInt is enabled
      https://bugs.webkit.org/show_bug.cgi?id=79962
      <rdar://problem/10922215>
      
      Reviewed by Gavin Barraclough.
              
      Added the notion of JITCompilationEffort. If we're JIT'ing as a result of
      a tier-up, then we set it to JITCompilationCanFail. Otherwise it's
      JITCompilationMustSucceed. This preserves the old behavior of LLInt is
      disabled or if we're compiling something that can't be interpreted (like
      an OSR exit stub).
      
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * assembler/ARMAssembler.cpp:
      (JSC::ARMAssembler::executableCopy):
      * assembler/ARMAssembler.h:
      (ARMAssembler):
      * assembler/AssemblerBuffer.h:
      (JSC::AssemblerBuffer::executableCopy):
      * assembler/LinkBuffer.h:
      (JSC::LinkBuffer::LinkBuffer):
      (JSC::LinkBuffer::~LinkBuffer):
      (LinkBuffer):
      (JSC::LinkBuffer::didFailToAllocate):
      (JSC::LinkBuffer::isValid):
      (JSC::LinkBuffer::linkCode):
      (JSC::LinkBuffer::performFinalization):
      * assembler/MIPSAssembler.h:
      (JSC::MIPSAssembler::executableCopy):
      * assembler/SH4Assembler.h:
      (JSC::SH4Assembler::executableCopy):
      * assembler/X86Assembler.h:
      (JSC::X86Assembler::executableCopy):
      (JSC::X86Assembler::X86InstructionFormatter::executableCopy):
      * bytecode/CodeBlock.cpp:
      (JSC::ProgramCodeBlock::jitCompileImpl):
      (JSC::EvalCodeBlock::jitCompileImpl):
      (JSC::FunctionCodeBlock::jitCompileImpl):
      * bytecode/CodeBlock.h:
      (JSC::CodeBlock::jitCompile):
      (CodeBlock):
      (ProgramCodeBlock):
      (EvalCodeBlock):
      (FunctionCodeBlock):
      * dfg/DFGDriver.cpp:
      (JSC::DFG::compile):
      * dfg/DFGJITCompiler.cpp:
      (JSC::DFG::JITCompiler::compile):
      (JSC::DFG::JITCompiler::compileFunction):
      * dfg/DFGJITCompiler.h:
      (JITCompiler):
      * jit/ExecutableAllocator.cpp:
      (JSC::DemandExecutableAllocator::allocateNewSpace):
      (JSC::ExecutableAllocator::allocate):
      * jit/ExecutableAllocator.h:
      (ExecutableAllocator):
      * jit/ExecutableAllocatorFixedVMPool.cpp:
      (JSC::ExecutableAllocator::allocate):
      * jit/JIT.cpp:
      (JSC::JIT::privateCompile):
      * jit/JIT.h:
      (JSC::JIT::compile):
      (JIT):
      * jit/JITCompilationEffort.h: Added.
      (JSC):
      * jit/JITDriver.h:
      (JSC::jitCompileIfAppropriate):
      (JSC::jitCompileFunctionIfAppropriate):
      * llint/LLIntSlowPaths.cpp:
      (LLInt):
      (JSC::LLInt::jitCompileAndSetHeuristics):
      (JSC::LLInt::entryOSR):
      (JSC::LLInt::LLINT_SLOW_PATH_DECL):
      * runtime/Executable.cpp:
      (JSC::EvalExecutable::jitCompile):
      (JSC::ProgramExecutable::jitCompile):
      (JSC::FunctionExecutable::jitCompileForCall):
      (JSC::FunctionExecutable::jitCompileForConstruct):
      * runtime/Executable.h:
      (EvalExecutable):
      (ProgramExecutable):
      (FunctionExecutable):
      (JSC::FunctionExecutable::jitCompileFor):
      * runtime/ExecutionHarness.h:
      (JSC::prepareForExecution):
      (JSC::prepareFunctionForExecution):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@109307 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0f25ee88
  4. 26 Feb, 2012 1 commit
    • fpizlo@apple.com's avatar
      Getting the instruction stream for a code block should not require two loads · ebe232eb
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=79608
      
      Reviewed by Sam Weinig.
              
      Introduced the RefCountedArray class, which contains a single inline pointer
      to a ref-counted non-resizeable vector backing store. This satisfies the
      requirements of CodeBlock, which desires the ability to share instruction
      streams with other CodeBlocks. It also reduces the number of loads required
      for getting the instruction stream by one.
              
      This patch also gets rid of the bytecode discarding logic, since we don't
      use it anymore and it's unlikely to ever work right with DFG or LLInt. And
      I didn't feel like porting dead code to use RefCountedArray.
      
      * GNUmakefile.list.am:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * bytecode/CodeBlock.cpp:
      (JSC::instructionOffsetForNth):
      (JSC::CodeBlock::dump):
      (JSC::CodeBlock::CodeBlock):
      (JSC::CodeBlock::finalizeUnconditionally):
      (JSC::CodeBlock::handlerForBytecodeOffset):
      (JSC::CodeBlock::lineNumberForBytecodeOffset):
      (JSC::CodeBlock::expressionRangeForBytecodeOffset):
      (JSC::CodeBlock::shrinkToFit):
      * bytecode/CodeBlock.h:
      (CodeBlock):
      (JSC::CodeBlock::numberOfInstructions):
      (JSC::CodeBlock::instructions):
      (JSC::CodeBlock::instructionCount):
      (JSC::CodeBlock::valueProfileForBytecodeOffset):
      (JSC):
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::Label::setLocation):
      (JSC):
      (JSC::BytecodeGenerator::generate):
      (JSC::BytecodeGenerator::newLabel):
      * bytecompiler/BytecodeGenerator.h:
      (JSC):
      (BytecodeGenerator):
      (JSC::BytecodeGenerator::instructions):
      * bytecompiler/Label.h:
      (JSC::Label::Label):
      (Label):
      * dfg/DFGByteCodeCache.h:
      (JSC::DFG::ByteCodeCache::~ByteCodeCache):
      (JSC::DFG::ByteCodeCache::get):
      * jit/JITExceptions.cpp:
      (JSC::genericThrow):
      * llint/LowLevelInterpreter32_64.asm:
      * runtime/Executable.cpp:
      (JSC::EvalExecutable::compileInternal):
      (JSC::ProgramExecutable::compileInternal):
      (JSC::FunctionExecutable::codeBlockWithBytecodeFor):
      (JSC::FunctionExecutable::produceCodeBlockFor):
      * wtf/RefCountedArray.h: Added.
      (WTF):
      (RefCountedArray):
      (WTF::RefCountedArray::RefCountedArray):
      (WTF::RefCountedArray::operator=):
      (WTF::RefCountedArray::~RefCountedArray):
      (WTF::RefCountedArray::size):
      (WTF::RefCountedArray::data):
      (WTF::RefCountedArray::begin):
      (WTF::RefCountedArray::end):
      (WTF::RefCountedArray::at):
      (WTF::RefCountedArray::operator[]):
      (Header):
      (WTF::RefCountedArray::Header::size):
      (WTF::RefCountedArray::Header::payload):
      (WTF::RefCountedArray::Header::fromPayload):
      * wtf/Platform.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108943 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ebe232eb
  5. 21 Feb, 2012 2 commits
    • fpizlo@apple.com's avatar
      JSC should be a triple-tier VM · 7bbcaab7
      fpizlo@apple.com authored
      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:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7bbcaab7
    • aroben@apple.com's avatar
      Roll out r108309, r108323, and r108326 · e089d623
      aroben@apple.com authored
      They broke the 32-bit Lion build.
      
      Original bugs is <http://webkit.org/b/75812> <rdar://problem/10079694>.
      
      Source/JavaScriptCore:
      
      * 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:
      * bytecode/BytecodeConventions.h: Removed.
      * bytecode/CallLinkStatus.cpp:
      * bytecode/CallLinkStatus.h:
      * bytecode/CodeBlock.cpp:
      * bytecode/CodeBlock.h:
      * bytecode/GetByIdStatus.cpp:
      * bytecode/GetByIdStatus.h:
      * bytecode/Instruction.h:
      * bytecode/LLIntCallLinkInfo.h: Removed.
      * bytecode/MethodCallLinkStatus.cpp:
      * bytecode/Opcode.cpp:
      * bytecode/Opcode.h:
      * bytecode/PutByIdStatus.cpp:
      * bytecode/PutByIdStatus.h:
      * bytecompiler/BytecodeGenerator.cpp:
      * dfg/DFGByteCodeParser.cpp:
      * dfg/DFGCapabilities.h:
      * dfg/DFGOSRExitCompiler.cpp:
      * dfg/DFGOperations.cpp:
      * heap/Heap.h:
      * heap/MarkStack.cpp:
      * heap/MarkedAllocator.h:
      * heap/MarkedSpace.h:
      * interpreter/CallFrame.cpp:
      * interpreter/CallFrame.h:
      * interpreter/Interpreter.cpp:
      * interpreter/Interpreter.h:
      * interpreter/RegisterFile.h:
      * jit/ExecutableAllocator.h:
      * jit/HostCallReturnValue.cpp: Removed.
      * jit/HostCallReturnValue.h: Removed.
      * jit/JIT.cpp:
      * jit/JITCode.h:
      * jit/JITDriver.h:
      * jit/JITExceptions.cpp:
      * jit/JITInlineMethods.h:
      * jit/JITStubs.cpp:
      * jit/JITStubs.h:
      * jit/JSInterfaceJIT.h:
      * llint/LLIntCommon.h: Removed.
      * llint/LLIntData.cpp: Removed.
      * llint/LLIntData.h: Removed.
      * llint/LLIntEntrypoints.cpp: Removed.
      * llint/LLIntEntrypoints.h: Removed.
      * llint/LLIntExceptions.cpp: Removed.
      * llint/LLIntExceptions.h: Removed.
      * llint/LLIntOfflineAsmConfig.h: Removed.
      * llint/LLIntOffsetsExtractor.cpp: Removed.
      * llint/LLIntSlowPaths.cpp: Removed.
      * llint/LLIntSlowPaths.h: Removed.
      * llint/LLIntThunks.cpp: Removed.
      * llint/LLIntThunks.h: Removed.
      * llint/LowLevelInterpreter.asm: Removed.
      * llint/LowLevelInterpreter.cpp: Removed.
      * llint/LowLevelInterpreter.h: Removed.
      * offlineasm/armv7.rb: Removed.
      * offlineasm/asm.rb: Removed.
      * offlineasm/ast.rb: Removed.
      * offlineasm/backends.rb: Removed.
      * offlineasm/generate_offset_extractor.rb: Removed.
      * offlineasm/instructions.rb: Removed.
      * offlineasm/offset_extractor_constants.rb: Removed.
      * offlineasm/offsets.rb: Removed.
      * offlineasm/opt.rb: Removed.
      * offlineasm/parser.rb: Removed.
      * offlineasm/registers.rb: Removed.
      * offlineasm/self_hash.rb: Removed.
      * offlineasm/settings.rb: Removed.
      * offlineasm/transform.rb: Removed.
      * offlineasm/x86.rb: Removed.
      * runtime/CodeSpecializationKind.h: Removed.
      * runtime/CommonSlowPaths.h:
      * runtime/Executable.cpp:
      * runtime/Executable.h:
      * runtime/ExecutionHarness.h: Removed.
      * runtime/JSArray.h:
      * runtime/JSCell.h:
      * runtime/JSFunction.h:
      * runtime/JSGlobalData.cpp:
      * runtime/JSGlobalData.h:
      * runtime/JSGlobalObject.h:
      * runtime/JSObject.h:
      * runtime/JSPropertyNameIterator.h:
      * runtime/JSString.h:
      * runtime/JSTypeInfo.h:
      * runtime/JSValue.cpp:
      * runtime/JSValue.h:
      * runtime/JSVariableObject.h:
      * runtime/Options.cpp:
      * runtime/Options.h:
      * runtime/ScopeChain.h:
      * runtime/Structure.cpp:
      * runtime/Structure.h:
      * runtime/StructureChain.h:
      * wtf/InlineASM.h:
      * wtf/Platform.h:
      * wtf/SentinelLinkedList.h:
      * wtf/text/StringImpl.h:
      
      Source/WebCore:
      
      * CMakeLists.txt:
      
      Source/WebKit:
      
      * CMakeLists.txt:
      
      Tools:
      
      * DumpRenderTree/efl/CMakeLists.txt:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108358 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e089d623
  6. 20 Feb, 2012 1 commit
    • fpizlo@apple.com's avatar
      JSC should be a triple-tier VM · 091129f4
      fpizlo@apple.com authored
      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:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108309 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      091129f4
  7. 16 Feb, 2012 1 commit
    • fpizlo@apple.com's avatar
      ENABLE_INTERPRETER should be ENABLE_CLASSIC_INTERPRETER · 5b966d01
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=78791
      
      Rubber stamped by Oliver Hunt.
              
      Just a renaming, nothing more. Also renamed COMPUTED_GOTO_INTERPRETER to
      COMPUTED_GOTO_CLASSIC_INTERPRETER.
      
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::dump):
      (JSC::CodeBlock::stronglyVisitStrongReferences):
      (JSC):
      (JSC::CodeBlock::shrinkToFit):
      * bytecode/CodeBlock.h:
      (CodeBlock):
      * bytecode/Instruction.h:
      (JSC::Instruction::Instruction):
      * bytecode/Opcode.h:
      (JSC::padOpcodeName):
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::emitResolve):
      (JSC::BytecodeGenerator::emitResolveWithBase):
      (JSC::BytecodeGenerator::emitGetById):
      (JSC::BytecodeGenerator::emitPutById):
      (JSC::BytecodeGenerator::emitDirectPutById):
      * interpreter/AbstractPC.cpp:
      (JSC::AbstractPC::AbstractPC):
      * interpreter/AbstractPC.h:
      (AbstractPC):
      * interpreter/CallFrame.h:
      (ExecState):
      * interpreter/Interpreter.cpp:
      (JSC):
      (JSC::Interpreter::initialize):
      (JSC::Interpreter::isOpcode):
      (JSC::Interpreter::unwindCallFrame):
      (JSC::Interpreter::execute):
      (JSC::Interpreter::privateExecute):
      (JSC::Interpreter::retrieveLastCaller):
      * interpreter/Interpreter.h:
      (JSC::Interpreter::getOpcode):
      (JSC::Interpreter::getOpcodeID):
      (Interpreter):
      * jit/ExecutableAllocatorFixedVMPool.cpp:
      (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator):
      * runtime/Executable.cpp:
      (JSC::EvalExecutable::compileInternal):
      (JSC::ProgramExecutable::compileInternal):
      (JSC::FunctionExecutable::compileForCallInternal):
      (JSC::FunctionExecutable::compileForConstructInternal):
      * runtime/Executable.h:
      (NativeExecutable):
      * runtime/JSGlobalData.cpp:
      (JSC::JSGlobalData::JSGlobalData):
      (JSC::JSGlobalData::getHostFunction):
      * runtime/JSGlobalData.h:
      (JSGlobalData):
      * wtf/OSAllocatorPosix.cpp:
      (WTF::OSAllocator::reserveAndCommit):
      * wtf/Platform.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108020 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5b966d01
  8. 14 Feb, 2012 1 commit
  9. 08 Feb, 2012 2 commits
  10. 01 Feb, 2012 1 commit
    • oliver@apple.com's avatar
      Add support for inferred function names · f7190bf1
      oliver@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=77579
      
      Reviewed by Gavin Barraclough.
      
      Source/JavaScriptCore:
      
      Add new "inferred" names to function expressions, getters, and setters.
      This property is not exposed to JS, so is only visible in the debugger
      and profiler.
      
      * JavaScriptCore.exp:
      * bytecompiler/BytecodeGenerator.h:
      (JSC::BytecodeGenerator::makeFunction):
      * debugger/DebuggerCallFrame.cpp:
      (JSC::DebuggerCallFrame::calculatedFunctionName):
      * parser/ASTBuilder.h:
      (JSC::ASTBuilder::createAssignResolve):
      (JSC::ASTBuilder::createGetterOrSetterProperty):
      (JSC::ASTBuilder::createProperty):
      (JSC::ASTBuilder::makeAssignNode):
      * parser/Nodes.h:
      (JSC::FunctionBodyNode::setInferredName):
      (JSC::FunctionBodyNode::inferredName):
      (FunctionBodyNode):
      * profiler/Profiler.cpp:
      (JSC):
      (JSC::Profiler::createCallIdentifier):
      (JSC::createCallIdentifierFromFunctionImp):
      * runtime/Executable.cpp:
      (JSC::FunctionExecutable::FunctionExecutable):
      (JSC::FunctionExecutable::fromGlobalCode):
      * runtime/Executable.h:
      (JSC::FunctionExecutable::create):
      (JSC::FunctionExecutable::inferredName):
      (FunctionExecutable):
      * runtime/JSFunction.cpp:
      (JSC::JSFunction::calculatedDisplayName):
      (JSC):
      (JSC::getCalculatedDisplayName):
      * runtime/JSFunction.h:
      (JSC):
      
      LayoutTests:
      
      Update test case results.
      
      * fast/profiler/anonymous-event-handler-expected.txt:
      * fast/profiler/anonymous-function-called-from-different-contexts-expected.txt:
      * fast/profiler/anonymous-function-calls-built-in-functions-expected.txt:
      * fast/profiler/anonymous-function-calls-eval-expected.txt:
      * fast/profiler/built-in-function-calls-anonymous-expected.txt:
      * fast/profiler/inline-event-handler-expected.txt:
      * fast/profiler/many-calls-in-the-same-scope-expected.txt:
      * fast/profiler/multiple-and-different-scoped-anonymous-function-calls-expected.txt:
      * fast/profiler/multiple-and-different-scoped-function-calls-expected.txt:
      * fast/profiler/multiple-anonymous-functions-called-from-the-same-function-expected.txt:
      * fast/profiler/nested-anonymous-functon-expected.txt:
      * fast/profiler/start-and-stop-profiler-multiple-times-expected.txt:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f7190bf1
  11. 21 Jan, 2012 1 commit
    • fpizlo@apple.com's avatar
      JIT compilation should not require ExecState · 3ea918cf
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=76729
      <rdar://problem/10731545>
      
      Reviewed by Gavin Barraclough.
              
      Changed the relevant JIT driver functions to take JSGlobalData& instead of
      ExecState*, since really they just needed the global data.
      
      * dfg/DFGDriver.cpp:
      (JSC::DFG::compile):
      (JSC::DFG::tryCompile):
      (JSC::DFG::tryCompileFunction):
      * dfg/DFGDriver.h:
      (JSC::DFG::tryCompile):
      (JSC::DFG::tryCompileFunction):
      * jit/JITDriver.h:
      (JSC::jitCompileIfAppropriate):
      (JSC::jitCompileFunctionIfAppropriate):
      * runtime/Executable.cpp:
      (JSC::EvalExecutable::compileInternal):
      (JSC::ProgramExecutable::compileInternal):
      (JSC::FunctionExecutable::compileForCallInternal):
      (JSC::FunctionExecutable::compileForConstructInternal):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3ea918cf
  12. 11 Jan, 2012 1 commit
  13. 10 Jan, 2012 1 commit
    • fpizlo@apple.com's avatar
      CodeBlock::m_numParameters should be encapsulated · c4d5496c
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=75985
      <rdar://problem/10671020>
      
      Reviewed by Oliver Hunt.
              
      Encapsulated CodeBlock::m_numParameters and hooked argument profile creation
      into it.  This appears to be performance neutral.
      
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::CodeBlock):
      (JSC::CodeBlock::setNumParameters):
      (JSC::CodeBlock::addParameter):
      * bytecode/CodeBlock.h:
      (JSC::CodeBlock::numParameters):
      (JSC::CodeBlock::addressOfNumParameters):
      (JSC::CodeBlock::offsetOfNumParameters):
      (JSC::CodeBlock::numberOfArgumentValueProfiles):
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::BytecodeGenerator):
      (JSC::BytecodeGenerator::addParameter):
      (JSC::BytecodeGenerator::emitReturn):
      * dfg/DFGAbstractState.cpp:
      (JSC::DFG::AbstractState::AbstractState):
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::ByteCodeParser):
      (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
      * dfg/DFGGraph.cpp:
      (JSC::DFG::Graph::predictArgumentTypes):
      * dfg/DFGJITCompiler.cpp:
      (JSC::DFG::JITCompiler::compileFunction):
      * dfg/DFGOperations.cpp:
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
      * dfg/DFGSpeculativeJIT.h:
      (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::slideRegisterWindowForCall):
      (JSC::Interpreter::dumpRegisters):
      (JSC::Interpreter::execute):
      (JSC::Interpreter::prepareForRepeatCall):
      * jit/JIT.cpp:
      (JSC::JIT::privateCompile):
      * jit/JITStubs.cpp:
      (JSC::arityCheckFor):
      (JSC::lazyLinkFor):
      * runtime/Executable.cpp:
      (JSC::FunctionExecutable::compileForCallInternal):
      (JSC::FunctionExecutable::compileForConstructInternal):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104630 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c4d5496c
  14. 16 Dec, 2011 1 commit
    • mhahnenberg@apple.com's avatar
      De-virtualize destructors · c58d54d7
      mhahnenberg@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=74331
      
      Reviewed by Geoffrey Garen.
      
      .: 
      
      * Source/autotools/symbols.filter: Removed symbol no longer present.
      
      Source/JavaScriptCore: 
      
      This is a megapatch which frees us from the chains of virtual destructors.
      
      In order to remove the virtual destructors, which are the last of the virtual 
      functions, from the JSCell hierarchy, we need to add the ClassInfo pointer to 
      the cell rather than to the structure because in order to be able to lazily call 
      the static destroy() functions that will replace the virtual destructors, we 
      need to be able to access the ClassInfo without the danger of the object's 
      Structure being collected before the object itself.
      
      After adding the ClassInfo to the cell, we can then begin to remove our use 
      of vptrs for optimizations within the JIT and the GC.  When we have removed 
      all of the stored vptrs from JSGlobalData, we can then also remove all of 
      the related VPtrStealingHack code.
      
      The replacement for virtual destructors will be to add a static destroy function 
      pointer to the MethodTable stored in ClassInfo.  Any subclass of JSCell that has 
      a non-trivial destructor will require its own static destroy function to static 
      call its corresponding destructor, which will now be non-virtual.  In future 
      patches we will slowly move away from destructors altogether as we make more and 
      more objects backed by GC memory rather than malloc-ed memory.  The GC will now 
      call the static destroy method rather than the virtual destructor.
      
      As we go through the hierarchy and add static destroy functions to classes, 
      we will also add a new assert, ASSERT_HAS_TRIVIAL_DESTRUCTOR, to those classes 
      to which it applies.  The future goal is to eventually have every class have that assert.
      
      * API/JSCallbackConstructor.cpp:
      (JSC::JSCallbackConstructor::destroy): Add a destroy function to statically call 
      ~JSCallbackConstructor because it has some extra destruction logic.
      * API/JSCallbackConstructor.h:
      * API/JSCallbackFunction.cpp: Add trivial destructor assert for JSCallbackFunction.
      * API/JSCallbackObject.cpp: Add a destroy function to statically call ~JSCallbackObject 
      because it has a member OwnPtr that needs destruction.
      (JSC::::destroy):
      * API/JSCallbackObject.h:
      * JavaScriptCore.exp: Add/remove necessary symbols for JSC.
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Same for Windows symbols.
      * debugger/DebuggerActivation.cpp: DebuggerActivation, for some strange reason, didn't 
      have its own ClassInfo despite the fact that it overrides a number of MethodTable 
      methods.  Added the ClassInfo, along with an assertion that its destructor is trivial.
      * debugger/DebuggerActivation.h:
      * dfg/DFGOperations.cpp: Remove global data first argument to isJSArray, isJSByteArray, 
      isJSString, as it is no longer necessary.
      (JSC::DFG::putByVal):
      * dfg/DFGRepatch.cpp:  Ditto.  Also remove uses of jsArrayVPtr in favor of using the 
      JSArray ClassInfo pointer.
      (JSC::DFG::tryCacheGetByID):
      * dfg/DFGSpeculativeJIT.cpp:  Replace uses of the old vptrs with new ClassInfo 
      comparisons since we don't have vptrs anymore.
      (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality):
      (JSC::DFG::SpeculativeJIT::compilePeepHoleBranch):
      (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
      (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray):
      (JSC::DFG::SpeculativeJIT::compileGetTypedArrayLength):
      (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
      (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
      (JSC::DFG::SpeculativeJIT::compare):
      (JSC::DFG::SpeculativeJIT::compileStrictEq):
      (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
      * dfg/DFGSpeculativeJIT.h: Ditto.
      (JSC::DFG::SpeculativeJIT::emitAllocateJSFinalObject):
      * dfg/DFGSpeculativeJIT32_64.cpp: Ditto.
      (JSC::DFG::SpeculativeJIT::compileObjectEquality):
      (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
      (JSC::DFG::SpeculativeJIT::compileLogicalNot):
      (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch):
      (JSC::DFG::SpeculativeJIT::emitBranch):
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGSpeculativeJIT64.cpp: Ditto.
      (JSC::DFG::SpeculativeJIT::compileObjectEquality):
      (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
      (JSC::DFG::SpeculativeJIT::compileLogicalNot):
      (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch):
      (JSC::DFG::SpeculativeJIT::emitBranch):
      (JSC::DFG::SpeculativeJIT::compile):
      * heap/Heap.cpp: Remove all uses of vptrs in GC optimizations and replace them with 
      ClassInfo comparisons.
      (JSC::Heap::Heap):
      * heap/MarkStack.cpp: Ditto.
      (JSC::MarkStackThreadSharedData::markingThreadMain):
      (JSC::visitChildren):
      (JSC::SlotVisitor::drain):
      * heap/MarkStack.h: Ditto.
      (JSC::MarkStack::MarkStack):
      * heap/MarkedBlock.cpp: Ditto.
      (JSC::MarkedBlock::callDestructor):
      (JSC::MarkedBlock::specializedSweep):
      * heap/MarkedBlock.h: Ditto.
      * heap/SlotVisitor.h: Ditto.
      (JSC::SlotVisitor::SlotVisitor):
      * heap/VTableSpectrum.cpp: Now that we don't have vptrs, we can't count them.  
      We'll have to rename this class and make it use ClassInfo ptrs in a future patch.
      (JSC::VTableSpectrum::count):
      * interpreter/Interpreter.cpp: Remove all global data arguments from isJSArray, 
      etc. functions.
      (JSC::loadVarargs):
      (JSC::Interpreter::tryCacheGetByID):
      (JSC::Interpreter::privateExecute):
      * jit/JIT.h: Remove vptr argument from emitAllocateBasicJSObject 
      * jit/JITInlineMethods.h: Remove vptr planting, and add ClassInfo planting, 
      remove all vtable related code.
      (JSC::JIT::emitLoadCharacterString):
      (JSC::JIT::emitAllocateBasicJSObject):
      (JSC::JIT::emitAllocateJSFinalObject):
      (JSC::JIT::emitAllocateJSFunction):
      * jit/JITOpcodes.cpp: Replace vptr related branch code with corresponding ClassInfo.
      (JSC::JIT::privateCompileCTIMachineTrampolines):
      (JSC::JIT::emit_op_to_primitive):
      (JSC::JIT::emit_op_convert_this):
      * jit/JITOpcodes32_64.cpp: Ditto.
      (JSC::JIT::privateCompileCTIMachineTrampolines):
      (JSC::JIT::emit_op_to_primitive):
      (JSC::JIT::emitSlow_op_eq):
      (JSC::JIT::emitSlow_op_neq):
      (JSC::JIT::compileOpStrictEq):
      (JSC::JIT::emit_op_convert_this):
      * jit/JITPropertyAccess.cpp: Ditto.
      (JSC::JIT::stringGetByValStubGenerator):
      (JSC::JIT::emit_op_get_by_val):
      (JSC::JIT::emitSlow_op_get_by_val):
      (JSC::JIT::emit_op_put_by_val):
      (JSC::JIT::privateCompilePutByIdTransition):
      (JSC::JIT::privateCompilePatchGetArrayLength):
      * jit/JITPropertyAccess32_64.cpp: Ditto.
      (JSC::JIT::stringGetByValStubGenerator):
      (JSC::JIT::emit_op_get_by_val):
      (JSC::JIT::emitSlow_op_get_by_val):
      (JSC::JIT::emit_op_put_by_val):
      (JSC::JIT::privateCompilePatchGetArrayLength):
      * jit/JITStubs.cpp: Remove global data argument from isJSString, etc.
      (JSC::JITThunks::tryCacheGetByID):
      (JSC::DEFINE_STUB_FUNCTION):
      * jit/SpecializedThunkJIT.h: Replace vptr related stuff with ClassInfo stuff.
      (JSC::SpecializedThunkJIT::loadJSStringArgument):
      * runtime/ArrayConstructor.cpp: Add trivial destructor assert.
      * runtime/ArrayPrototype.cpp: Remove global data argument from isJSArray.
      (JSC::arrayProtoFuncToString):
      (JSC::arrayProtoFuncJoin):
      (JSC::arrayProtoFuncPop):
      (JSC::arrayProtoFuncPush):
      (JSC::arrayProtoFuncShift):
      (JSC::arrayProtoFuncSplice):
      (JSC::arrayProtoFuncUnShift):
      (JSC::arrayProtoFuncFilter):
      (JSC::arrayProtoFuncMap):
      (JSC::arrayProtoFuncEvery):
      (JSC::arrayProtoFuncForEach):
      (JSC::arrayProtoFuncSome):
      (JSC::arrayProtoFuncReduce):
      (JSC::arrayProtoFuncReduceRight):
      * runtime/BooleanConstructor.cpp: Add trivial destructor assert.
      * runtime/BooleanObject.cpp: Ditto.
      * runtime/BooleanPrototype.cpp: Ditto.
      * runtime/ClassInfo.h: Add destroy function pointer to MethodTable.
      * runtime/DateConstructor.cpp: Add trivial destructor assert.
      * runtime/DateInstance.cpp: Add destroy function for DateInstance because it has a RefPtr 
      that needs destruction.
      (JSC::DateInstance::destroy):
      * runtime/DateInstance.h:
      * runtime/Error.cpp: Ditto (because of UString member).
      (JSC::StrictModeTypeErrorFunction::destroy):
      * runtime/Error.h:
      * runtime/ErrorConstructor.cpp: Add trivial destructor assert.
      * runtime/ErrorInstance.cpp: Ditto.
      * runtime/ExceptionHelpers.cpp: Ditto.
      * runtime/Executable.cpp: Add destroy functions for ExecutableBase and subclasses.
      (JSC::ExecutableBase::destroy):
      (JSC::NativeExecutable::destroy):
      (JSC::ScriptExecutable::destroy):
      (JSC::EvalExecutable::destroy):
      (JSC::ProgramExecutable::destroy):
      (JSC::FunctionExecutable::destroy):
      * runtime/Executable.h:
      * runtime/FunctionConstructor.cpp: Add trivial destructor assert.
      * runtime/FunctionPrototype.cpp: Ditto. Also remove global data first arg from isJSArray.
      (JSC::functionProtoFuncApply):
      * runtime/GetterSetter.cpp: Ditto.
      * runtime/InitializeThreading.cpp: Remove call to JSGlobalData::storeVPtrs since it no 
      longer exists.
      (JSC::initializeThreadingOnce):
      * runtime/InternalFunction.cpp: Remove vtableAnchor function, add trivial destructor assert, 
      remove first arg from isJSString.
      (JSC::InternalFunction::displayName):
      * runtime/InternalFunction.h: Remove VPtrStealingHack.
      * runtime/JSAPIValueWrapper.cpp: Add trivial destructor assert.
      * runtime/JSArray.cpp: Add static destroy to call ~JSArray.  Replace vptr checks in 
      destructor with ClassInfo checks.
      (JSC::JSArray::~JSArray):
      (JSC::JSArray::destroy):
      * runtime/JSArray.h: Remove VPtrStealingHack.  Remove globalData argument from isJSArray 
      and change them to check the ClassInfo rather than the vptrs.
      (JSC::isJSArray):
      * runtime/JSBoundFunction.cpp: Add trival destructor assert. Remove first arg from isJSArray.
      (JSC::boundFunctionCall):
      (JSC::boundFunctionConstruct):
      * runtime/JSByteArray.cpp: Add static destroy function, replace vptr checks with ClassInfo checks.
      (JSC::JSByteArray::~JSByteArray):
      (JSC::JSByteArray::destroy):
      * runtime/JSByteArray.h: Remove VPtrStealingHack code.
      (JSC::isJSByteArray):
      * runtime/JSCell.cpp: Add trivial destructor assert.  Add static destroy function.
      (JSC::JSCell::destroy):
      * runtime/JSCell.h: Remove VPtrStealingHack code.  Add function for returning the offset 
      of the ClassInfo pointer in the object for use by the JIT.  Add the ClassInfo pointer to 
      the JSCell itself, and grab it from the Structure.  Remove the vptr and setVPtr functions, 
      as they are no longer used.  Add a validatedClassInfo function to JSCell for any clients 
      that want to verify, while in Debug mode, that the ClassInfo contained in the cell is the 
      same one as that contained in the Structure.  This isn't used too often, because most of 
      the places where we compare the ClassInfo to things can be called during destruction.  
      Since the Structure is unreliable during the phase when destructors are being called, 
      we can't call validatedClassInfo.
      (JSC::JSCell::classInfoOffset):
      (JSC::JSCell::structure):
      (JSC::JSCell::classInfo):
      * runtime/JSFunction.cpp: Remove VPtrStealingHack code.  Add static destroy, remove vtableAnchor, 
      remove first arg from call to isJSString.
      (JSC::JSFunction::destroy):
      (JSC::JSFunction::displayName):
      * runtime/JSFunction.h: 
      * runtime/JSGlobalData.cpp: Remove all VPtr stealing code and storage, including storeVPtrs, 
      as these vptrs are no longer needed in the codebase.
      * runtime/JSGlobalData.h:
      (JSC::TypedArrayDescriptor::TypedArrayDescriptor): Changed the TypedArrayDescriptor to use 
      ClassInfo rather than the vptr.
      * runtime/JSGlobalObject.cpp: Add static destroy function.
      (JSC::JSGlobalObject::destroy):
      * runtime/JSGlobalObject.h:
      * runtime/JSGlobalThis.cpp: Add trivial destructor assert.
      * runtime/JSNotAnObject.cpp: Ditto.
      * runtime/JSONObject.cpp: Ditto. Remove first arg from isJSArray calls.
      (JSC::Stringifier::Holder::appendNextProperty):
      (JSC::Walker::walk):
      * runtime/JSObject.cpp: 
      (JSC::JSFinalObject::destroy):
      (JSC::JSNonFinalObject::destroy):
      (JSC::JSObject::destroy):
      * runtime/JSObject.h: Add trivial destructor assert for JSObject, remove vtableAnchor 
      from JSNonFinalObject and JSFinalObject, add static destroy for JSFinalObject and 
      JSNonFinalObject, add isJSFinalObject utility function similar to isJSArray, remove all VPtrStealingHack code.
      (JSC::JSObject::finishCreation):
      (JSC::JSNonFinalObject::finishCreation):
      (JSC::JSFinalObject::finishCreation):
      (JSC::isJSFinalObject):
      * runtime/JSPropertyNameIterator.cpp: Add static destroy.
      (JSC::JSPropertyNameIterator::destroy):
      * runtime/JSPropertyNameIterator.h:
      * runtime/JSStaticScopeObject.cpp: Ditto.
      (JSC::JSStaticScopeObject::destroy):
      * runtime/JSStaticScopeObject.h: Ditto. 
      * runtime/JSString.cpp:
      (JSC::JSString::destroy):
      * runtime/JSString.h: Ditto. Remove VPtrStealingHack code. Also remove fixupVPtr code, 
      since we no longer need to fixup vptrs.
      (JSC::jsSingleCharacterString):
      (JSC::jsSingleCharacterSubstring):
      (JSC::jsNontrivialString):
      (JSC::jsString):
      (JSC::jsSubstring8):
      (JSC::jsSubstring):
      (JSC::jsOwnedString):
      (JSC::jsStringBuilder):
      (JSC::isJSString):
      * runtime/JSVariableObject.cpp: 
      (JSC::JSVariableObject::destroy):
      * runtime/JSVariableObject.h: Ditto.
      * runtime/JSWrapperObject.cpp:
      * runtime/JSWrapperObject.h: Add trivial destructor assert.
      * runtime/MathObject.cpp: Ditto.
      * runtime/NativeErrorConstructor.cpp: Ditto.
      * runtime/NumberConstructor.cpp: Ditto.
      * runtime/NumberObject.cpp: Ditto.
      * runtime/NumberPrototype.cpp: Ditto.
      * runtime/ObjectConstructor.cpp: Ditto.
      * runtime/ObjectPrototype.cpp: Ditto.
      * runtime/Operations.h: Remove calls to fixupVPtr, remove first arg to isJSString.
      (JSC::jsString):
      (JSC::jsLess):
      (JSC::jsLessEq):
      * runtime/RegExp.cpp: Add static destroy.
      (JSC::RegExp::destroy):
      * runtime/RegExp.h:
      * runtime/RegExpConstructor.cpp: Add static destroy for RegExpConstructor and RegExpMatchesArray.
      (JSC::RegExpConstructor::destroy):
      (JSC::RegExpMatchesArray::destroy):
      * runtime/RegExpConstructor.h:
      * runtime/RegExpMatchesArray.h:
      * runtime/RegExpObject.cpp: Add static destroy.
      (JSC::RegExpObject::destroy):
      * runtime/RegExpObject.h:
      * runtime/ScopeChain.cpp: Add trivial destructor assert.
      * runtime/ScopeChain.h:
      * runtime/StrictEvalActivation.cpp: Ditto.
      * runtime/StringConstructor.cpp:
      * runtime/StringObject.cpp: Ditto. Remove vtableAnchor.
      * runtime/StringObject.h:
      * runtime/StringPrototype.cpp: Ditto.
      * runtime/Structure.cpp: Add static destroy.
      (JSC::Structure::destroy):
      * runtime/Structure.h: Move JSCell::finishCreation and JSCell constructor into Structure.h 
      because they need to have the full Structure type to access the ClassInfo to store in the JSCell.
      (JSC::JSCell::setStructure):
      (JSC::JSCell::validatedClassInfo):
      (JSC::JSCell::JSCell):
      (JSC::JSCell::finishCreation):
      * runtime/StructureChain.cpp: Add static destroy.
      (JSC::StructureChain::destroy):
      * runtime/StructureChain.h:
      * wtf/Assertions.h: Add new assertion ASSERT_HAS_TRIVIAL_DESTRUCTOR, which uses clangs 
      ability to tell us when a class has a trivial destructor. We will use this assert 
      more in future patches as we move toward having all JSC objects backed by GC memory, 
      which means moving away from using destructors/finalizers.
      
      Source/JavaScriptGlue: 
      
      * UserObjectImp.cpp: Add static destroy function.
      (UserObjectImp::destroy):
      * UserObjectImp.h:
      
      Source/WebCore: 
      
      No new tests.
      
      Doing everything here that was done to the JSCell hierarchy in JavaScriptCore. 
      See the ChangeLog for this commit for a more in-depth description.
      
      * WebCore.exp.in: Add/remove symbols.
      * bindings/js/JSCanvasRenderingContext2DCustom.cpp: Remove first arg from isJSArray call.
      (WebCore::JSCanvasRenderingContext2D::setWebkitLineDash):
      * bindings/js/JSDOMBinding.cpp: Add trival destructor assert for DOMConstructorObject 
      and DOMConstructorWithDocument.
      * bindings/js/JSDOMGlobalObject.cpp: Add static destroy.  Add implementation for 
      scriptExecutionContext that dispatches to different functions in subclasses 
      depending on our current ClassInfo.  We do this so that we can get rid of the 
      virtual-ness of scriptExecutionContext, because any virtual functions will throw 
      off the layout of the object and we'll crash at runtime.
      (WebCore::JSDOMGlobalObject::destroy):
      (WebCore::JSDOMGlobalObject::scriptExecutionContext):
      * bindings/js/JSDOMGlobalObject.h:
      * bindings/js/JSDOMWindowBase.cpp: Add static destroy.
      (WebCore::JSDOMWindowBase::destroy):
      * bindings/js/JSDOMWindowBase.h: De-virtualize scriptExecutionContext.
      * bindings/js/JSDOMWindowShell.cpp: Add static destroy.
      (WebCore::JSDOMWindowShell::destroy):
      * bindings/js/JSDOMWindowShell.h:
      * bindings/js/JSDOMWrapper.cpp: Add trivial destructor assert.
      * bindings/js/JSDOMWrapper.h: Add a ClassInfo to JSDOMWrapper since it now overrides 
      a MethodTable function. Remove vtableAnchor virtual function.
      * bindings/js/JSImageConstructor.cpp: Add trivial destructor assert.
      * bindings/js/JSNodeCustom.cpp: Change implementation of pushEventHandlerScope so that 
      it dispatches to the correct function depending on the 
      identity of the class as specified by the ClassInfo.  
      See JSDOMGlobalObject::scriptExecutionContext for explanation.
      (WebCore::JSNode::pushEventHandlerScope):
      * bindings/js/JSWebSocketCustom.cpp: Remove first arg to isJSArray call.
      (WebCore::JSWebSocketConstructor::constructJSWebSocket):
      * bindings/js/JSWorkerContextBase.cpp: Add static destroy.
      (WebCore::JSWorkerContextBase::destroy):
      * bindings/js/JSWorkerContextBase.h: 
      * bindings/js/ScriptValue.cpp: Remove first arg to isJSArray call.
      (WebCore::jsToInspectorValue): 
      * bindings/js/SerializedScriptValue.cpp: Ditto.
      (WebCore::CloneSerializer::isArray):
      (WebCore::CloneSerializer::getSparseIndex):
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateHeader): Remove virtual-ness of any custom pushEventHandlerScope (see 
      JSNodeCustom::pushEventHandlerScope for explanation).  Remove virtual toBoolean 
      for anybody who masquerades as undefined, since our JSObject implementation handles 
      this based on the TypeInfo in the Structure. Add trivial destructor assert for any 
      class other than DOMWindow or WorkerContexts.
      (GenerateImplementation): Change ClassInfo definitions to use Base::s_info, since 
      typing the parent class more than once is duplication of information and increases 
      the likelihood of mistakes.  Pass ClassInfo to TypeArrayDescriptors instead of vptr. 
      (GenerateConstructorDefinition): Add trivial destructor assert for all generated constructors.
      * bridge/c/CRuntimeObject.cpp: Remove empty virtual destructor.
      * bridge/c/CRuntimeObject.h: 
      * bridge/jni/jsc/JavaRuntimeObject.cpp: Ditto.
      * bridge/jni/jsc/JavaRuntimeObject.h: 
      * bridge/objc/ObjCRuntimeObject.h: Ditto.
      * bridge/objc/ObjCRuntimeObject.mm:
      * bridge/objc/objc_runtime.h: Add static destroy for ObjcFallbackObjectImp. De-virtualize 
      toBoolean in the short term.  Need longer term fix.
      * bridge/objc/objc_runtime.mm:
      (JSC::Bindings::ObjcFallbackObjectImp::destroy):
      * bridge/qt/qt_runtime.cpp: Add static destroy to QtRuntimeMethod.
      (JSC::Bindings::QtRuntimeMethod::destroy):
      * bridge/qt/qt_runtime.h: De-virtualize ~QtRuntimeMethod.
      * bridge/runtime_array.cpp: De-virtualize destructor. Add static destroy.
      (JSC::RuntimeArray::destroy):
      * bridge/runtime_array.h:
      * bridge/runtime_method.cpp: Remove vtableAnchor. Add static destroy.
      (JSC::RuntimeMethod::destroy):
      * bridge/runtime_method.h:
      * bridge/runtime_object.cpp: Add static destroy.
      (JSC::Bindings::RuntimeObject::destroy):
      * bridge/runtime_object.h:
      
      Source/WebKit/mac: 
      
      * Plugins/Hosted/ProxyRuntimeObject.h: Remove empty virtual destructor.
      * Plugins/Hosted/ProxyRuntimeObject.mm:
      
      Source/WebKit2: 
      
      * WebProcess/Plugins/Netscape/JSNPMethod.cpp: Add trivial destructor assert.
      * WebProcess/Plugins/Netscape/JSNPObject.cpp: Add static destroy.
      (WebKit::JSNPObject::destroy):
      * WebProcess/Plugins/Netscape/JSNPObject.h:
      * win/WebKit2.def: Add/remove necessary symbols.
      * win/WebKit2CFLite.def: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103083 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c58d54d7
  15. 06 Dec, 2011 1 commit
    • barraclough@apple.com's avatar
      https://bugs.webkit.org/show_bug.cgi?id=68328 · 6d2ad995
      barraclough@apple.com authored
      The generator and intrinsic fields in HashTableValue/HashEntry and associated structures and methods are redundant
      
      Reviewed by Geoff Garen.
      
      ../JavaScriptCore: 
      
      Move the instrinsic enum out of the DFG, into runtime. Add entires for all host functions
      that have an intrinsic in the form of a generated thunk. Remove the thunk pointer from the
      hashtable, and make Intrinsic field no longer ifdef on JIT/DFG. In getHostFunction select
      a thunk genertaor to use based on the Intrinsic.
      
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * create_hash_table:
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::handleCall):
      (JSC::DFG::ByteCodeParser::handleIntrinsic):
      * dfg/DFGCapabilities.h:
      * dfg/DFGIntrinsic.h: Removed.
      * jit/JITStubs.cpp:
      (JSC::JITThunks::hostFunctionStub):
      * jit/JITStubs.h:
      * runtime/Executable.cpp:
      (JSC::ExecutableBase::intrinsic):
      (JSC::NativeExecutable::intrinsic):
      * runtime/Executable.h:
      (JSC::ExecutableBase::intrinsicFor):
      (JSC::NativeExecutable::create):
      (JSC::NativeExecutable::finishCreation):
      * runtime/Intrinsic.h: Copied from Source/JavaScriptCore/dfg/DFGIntrinsic.h.
      * runtime/JSGlobalData.cpp:
      (JSC::thunkGeneratorForIntrinsic):
      (JSC::JSGlobalData::getHostFunction):
      * runtime/JSGlobalData.h:
      * runtime/Lookup.cpp:
      (JSC::HashTable::createTable):
      (JSC::setUpStaticFunctionSlot):
      * runtime/Lookup.h:
      (JSC::HashEntry::initialize):
      (JSC::HashEntry::intrinsic):
      
      ../WebCore: 
      
      Intrinsic is no longer in the DFG namespace, is always in the
      hash table. Removed ThunkGenerator.
      
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateHashTable):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102167 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6d2ad995
  16. 18 Nov, 2011 1 commit
  17. 16 Nov, 2011 3 commits
    • fpizlo@apple.com's avatar
      Code block jettisoning should be part of the GC's transitive closure · 45928f82
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=72467
      
      Reviewed by Geoff Garen.
              
      Replaced JettisonedCodeBlocks with DFGCodeBlocks. The latter knows about all
      DFG code blocks (i.e. those that may be jettisoned, and may have inlined weak
      references) and helps track what state each of those code blocks is in during
      GC. The state consists of two flags; mayBeExecuting, which tells if the code block
      is live from call frames; and isJettisoned, which tells if the code block is
      not owned by any executable and thus should be deleted as soon as it is not
      mayBeExecuting.
              
      - Not executing, Not jettisoned: The code block may or may not be reachable from
        any executables, but it is owned by an executable, and hence should be
        kept alive if its executable is live and if all of its weak references are
        live. Otherwise it should be deleted during the current GC cycle, and its
        outgoing references should not be scanned.
                
      - Not executing but jettisoned: The code block should be deleted as soon as
        possible and none of its outgoing references should be scanned.
                
      - Executing but not jettisoned: The code block should be kept alive during this
        GC cycle, and all of its outgoing references (including the weak ones)
        should be scanned and marked strongly. The mayBeExecuting bit will be cleared at
        the end of the GC cycle.
                
      - Executing and jettisoned: The code block should be kept alive during this
        GC cycle, and all of its outgoing references (including the weak ones)
        should be scanned and marked strongly. However, on the next GC cycle, it
        will have its mayBeExecuting bit cleared and hence it will become a candidate
        for immediate deletion provided it is not executing again.
      
      This is performance-neutral.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * Target.pri:
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::~CodeBlock):
      * bytecode/CodeBlock.h:
      (JSC::CodeBlock::setJITCode):
      (JSC::CodeBlock::DFGData::DFGData):
      (JSC::DFGCodeBlocks::mark):
      * heap/ConservativeRoots.cpp:
      (JSC::ConservativeRoots::add):
      * heap/ConservativeRoots.h:
      * heap/DFGCodeBlocks.cpp: Added.
      (JSC::DFGCodeBlocks::DFGCodeBlocks):
      (JSC::DFGCodeBlocks::~DFGCodeBlocks):
      (JSC::DFGCodeBlocks::jettison):
      (JSC::DFGCodeBlocks::clearMarks):
      (JSC::DFGCodeBlocks::deleteUnmarkedJettisonedCodeBlocks):
      (JSC::DFGCodeBlocks::traceMarkedCodeBlocks):
      * heap/DFGCodeBlocks.h: Added.
      * heap/Heap.cpp:
      (JSC::Heap::jettisonDFGCodeBlock):
      (JSC::Heap::markRoots):
      (JSC::Heap::collect):
      * heap/Heap.h:
      * heap/JettisonedCodeBlocks.cpp: Removed.
      * heap/JettisonedCodeBlocks.h: Removed.
      * interpreter/RegisterFile.cpp:
      (JSC::RegisterFile::gatherConservativeRoots):
      * interpreter/RegisterFile.h:
      * runtime/Executable.cpp:
      (JSC::jettisonCodeBlock):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100556 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      45928f82
    • mhahnenberg@apple.com's avatar
      De-virtualize ScriptExecutable::unlinkCalls · 82e23bcd
      mhahnenberg@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=72546
      
      Reviewed by Geoffrey Garen.
      
      * runtime/Executable.cpp:
      (JSC::FunctionExecutable::~FunctionExecutable): Added an empty explicit virtual destructor to prevent a very odd compilation error
      due to the fact that the compiler was trying to generate the implicit inline destructor in every translation unit, some of which 
      didn't have complete type information on the things that needed to be destructed in the implicit destructor.
      * runtime/Executable.h:
      (JSC::EvalExecutable::createStructure): Used new type value from JSType
      (JSC::ProgramExecutable::createStructure): Ditto
      (JSC::FunctionExecutable::createStructure): Ditto
      (JSC::ScriptExecutable::unlinkCalls): Condition upon the type value, cast and call the corresponding unlinkCalls implementation.
      * runtime/JSType.h: Added new values for EvalExecutable, ProgramExecutable, and FunctionExecutable.  Remove explicit numbers, since 
      that just adds noise to patches and they currently have no significance.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100537 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      82e23bcd
    • mhahnenberg@apple.com's avatar
      De-virtualize ExecutableBase::clearCodeVirtual · d5399e46
      mhahnenberg@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=72337
      
      Reviewed by Darin Adler.
      
      Added static finalize functions to the subclasses of ExecutableBase that provide an implementation 
      of clearCodeVirtual, changed all of the clearCodeVirtual methods to non-virtual clearCode method,
      and had the finalize functions call the corresponding clearCode methods.
      
      * runtime/Executable.cpp:
      (JSC::ExecutableBase::clearCode):
      (JSC::NativeExecutable::finalize):
      (JSC::EvalExecutable::finalize):
      (JSC::EvalExecutable::clearCode):
      (JSC::ProgramExecutable::finalize):
      (JSC::ProgramExecutable::clearCode):
      (JSC::FunctionExecutable::discardCode):
      (JSC::FunctionExecutable::finalize):
      (JSC::FunctionExecutable::clearCode):
      * runtime/Executable.h:
      (JSC::ExecutableBase::finishCreation):
      (JSC::NativeExecutable::create):
      (JSC::EvalExecutable::create):
      (JSC::ProgramExecutable::create):
      (JSC::FunctionExecutable::create):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100493 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d5399e46
  18. 14 Nov, 2011 1 commit
    • ggaren@apple.com's avatar
      Standardized the JS calling convention · 539d1bba
      ggaren@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=72221
              
      Reviewed by Oliver Hunt.
      
      This patch standardizes the calling convention so that the caller always
      sets up the callee's CallFrame. Adjustments for call type, callee type,
      argument count, etc. now always take place after that initial setup.
              
      This is a step toward reversing the argument order, but also has these
      immediate benefits (measured on x64):
              
      (1) 1% benchmark speedup across the board.
              
      (2) 50% code size reduction in baseline JIT function calls.
              
      (3) 1.5x speedup for single-dispatch .apply forwarding.
              
      (4) 1.1x speedup for multi-dispatch .apply forwarding.
      
      This change affected the baseline JIT most, since the baseline JIT had
      lots of ad hoc calling conventions for different caller / callee types.
      
      * assembler/MacroAssemblerX86_64.h:
      (JSC::MacroAssemblerX86_64::branchPtr):
      (JSC::MacroAssemblerX86_64::branchAddPtr): Optimize compare to 0 into
      a test, like other assemblers do. (I added some compares to 0, and didn't
      want them to be slow.)
      
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::dump): Merged op_load_varargs into op_call_varargs so
      op_call_varargs could share code generation with other forms of op_call.
      This is also a small optimization, since op_*varargs no longer have to
      pass arguments to each other through the register file.
      
      (JSC::CallLinkInfo::unlink):
      * bytecode/CodeBlock.h: Added a new call type: CallVarargs. This allows
      us to link functions called through .apply syntax. We need to distinguish
      CallVarargs from Call because CallVarargs changes its argument count
      on each inovcation, so we must always link to the argument count checking
      version of the callee.
      
      * bytecode/Opcode.h:
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::emitCallVarargs):
      * bytecompiler/BytecodeGenerator.h: Merged op_load_varargs into op_call_varargs.
      
      * bytecompiler/NodesCodegen.cpp:
      (JSC::ApplyFunctionCallDotNode::emitBytecode): Ditto. Also, simplified
      some of this bytecode generation to remove redundant copies.
      
      * dfg/DFGJITCodeGenerator32_64.cpp:
      (JSC::DFG::JITCodeGenerator::emitCall):
      * dfg/DFGJITCodeGenerator64.cpp:
      (JSC::DFG::JITCodeGenerator::emitCall): Added a new call type: CallVarargs.
      DFG doesn't support this type, but its code needs to change slightly
      to accomodate a 3-state variable.
      
      Stopped passing the argument count in regT1 because this is non-standard.
      (The argument count goes in the CallFrame. This trades speed on the slow
      path for speed and code size on the fast path, and simplicity on all paths.
      A good trade, in my opinion.)
      
      * dfg/DFGJITCompiler.cpp:
      (JSC::DFG::JITCompiler::compileEntry):
      (JSC::DFG::JITCompiler::link):
      (JSC::DFG::JITCompiler::compile):
      (JSC::DFG::JITCompiler::compileFunction): Tweaked code to make CallFrame
      setup more obvious when single-stepping. Also, updated for argument count
      not being in regT1.
      
      * dfg/DFGJITCompiler.h:
      (JSC::DFG::JITCompiler::addJSCall):
      (JSC::DFG::JITCompiler::JSCallRecord::JSCallRecord): Added a new call
      type: CallVarargs.
      
      * dfg/DFGOperations.cpp: Do finish CallFrame setup in one place before
      doing anything else. Don't check for stack overflow because we have no callee
      registers, and our caller has already checked for its own registers.
      
      * dfg/DFGRepatch.cpp:
      (JSC::DFG::dfgLinkFor): We can link to our callee even if our argument
      count doesn't match -- we just need to link to the argument count checking
      version.
      
      * interpreter/CallFrameClosure.h:
      (JSC::CallFrameClosure::setArgument): BUG FIX: When supplying too many
      arguments from C++, we need to supply a full copy of the arguments prior
      to the subset copy that matches our callee's argument count. (That is what
      the standard calling convention would have produced in JS.) I would have
      split this into its own patch, but I couldn't find a way to get the JIT
      to fail a regression test in this area without my patch applied.
      
      * interpreter/Interpreter.cpp: Let the true code bomb begin!
      
      (JSC::eval): Fixed up this helper function to operate on eval()'s CallFrame,
      and not eval()'s caller frame. We no longer leave the CallFrame pointing
      to eval()'s caller during a call to eval(), since that is not standard.
      
      (JSC::loadVarargs): Factored out a shared helper function for use by JIT
      and interpreter because half the code means one quarter the bugs -- in my
      programming, at least.
      
      (JSC::Interpreter::execute): Removed a now-unused way to invoke eval.
              
      (JSC::Interpreter::privateExecute): Removed an invalid ASSERT following
      putDirect, because it got in the way of my testing. (When putting a
      function, the cached base of a PutPropertySlot can be 0 to signify "do
      not optimize".)
              
      op_call_eval: Updated for new, standard eval calling convention.
              
      op_load_varargs: Merged op_load_varargs into op_call_varargs.
      
      op_call_varags: Updated for new, standard eval calling convention. Don't
      check for stack overflow because the loadVarargs helper function already
      checked.
      
      * interpreter/Interpreter.h:
      (JSC::Interpreter::execute): Headers are fun and educational!
      
      * interpreter/RegisterFile.cpp:
      (JSC::RegisterFile::growSlowCase):
      * interpreter/RegisterFile.h:
      (JSC::RegisterFile::grow): Factored out the slow case into a slow
      case because it was cramping the style of my fast case.
      
      * jit/JIT.cpp:
      (JSC::JIT::privateCompile): Moved initialization of
      RegisterFile::CodeBlock to make it more obvious when debugging. Removed
      assumption that argument count is in regT1, as above. Removed call to
      restoreArgumentReference() because the JITStubCall abstraction does this for us.
      
      (JSC::JIT::linkFor): Link even if we miss on argument count, as above.
      
      * jit/JIT.h:
      * jit/JITCall32_64.cpp:
      (JSC::JIT::emitSlow_op_call):
      (JSC::JIT::emitSlow_op_call_eval):
      (JSC::JIT::emitSlow_op_call_varargs):
      (JSC::JIT::emitSlow_op_construct):
      (JSC::JIT::emit_op_call_eval):
      (JSC::JIT::emit_op_call_varargs): Share all function call code generation.
      Don't count call_eval when accounting for linkable function calls because
      eval doesn't link. (Its fast path is to perform the eval.)
      
      (JSC::JIT::compileLoadVarargs): Ported this inline copying optimization
      to our new calling convention. The key to this optimization is the
      observation that, in a function that declares no arguments, if any
      arguments are passed, they all end up right behind 'this'.
      
      (JSC::JIT::compileCallEval):
      (JSC::JIT::compileCallEvalSlowCase): Factored out eval for a little clarity.
      
      (JSC::JIT::compileOpCall):
      (JSC::JIT::compileOpCallSlowCase): If you are still with me, dear reader,
      this is the whole point of my patch. The caller now unconditionally moves
      the CallFrame forward and fills in the data it knows before taking any
      branches to deal with weird caller/callee pairs.
              
      This also means that there is almost no slow path for calls -- it all
      gets folded into the shared virtual call stub. The only things remaining
      in the slow path are the rare case counter and a call to the stub.
      
      * jit/JITOpcodes32_64.cpp:
      (JSC::JIT::privateCompileCTIMachineTrampolines):
      (JSC::JIT::privateCompileCTINativeCall): Updated for values being in
      different registers or in memory, based on our new standard calling
      convention.
              
      Added a shared path for calling out to CTI helper functions for non-JS
      calls.
      
      * jit/JITPropertyAccess32_64.cpp:
      (JSC::JIT::emit_op_method_check): method_check emits its own code and
      the following get_by_id's code, so it needs to add both when informing
      result chaining of its result. This is important because the standard
      calling convention can now take advantage of this chaining.
      
      * jit/JITCall.cpp:
      (JSC::JIT::compileLoadVarargs):
      (JSC::JIT::compileCallEval):
      (JSC::JIT::compileCallEvalSlowCase):
      (JSC::JIT::compileOpCall):
      (JSC::JIT::compileOpCallSlowCase):
      * jit/JITOpcodes.cpp:
      (JSC::JIT::privateCompileCTIMachineTrampolines):
      (JSC::JIT::emit_op_call_eval):
      (JSC::JIT::emit_op_call_varargs):
      (JSC::JIT::emitSlow_op_call):
      (JSC::JIT::emitSlow_op_call_eval):
      (JSC::JIT::emitSlow_op_call_varargs):
      (JSC::JIT::emitSlow_op_construct): Observe, as I write all of my code a
      second time, now with 64 bits.
      
      * jit/JITStubs.cpp:
      (JSC::throwExceptionFromOpCall):
      (JSC::jitCompileFor):
      (JSC::arityCheckFor):
      (JSC::lazyLinkFor): A lot of mechanical changes here for one purpose:
      Exceptions thrown in the middle of a function call now use a shared helper
      function (throwExceptionFromOpCall). This function understands that the
      CallFrame currently points to the callEE, and the exception must be
      thrown by the callER. (The old calling convention would often still have
      the CallFrame pointing at the callER at the point of an exception. That
      is not the way of our new, standard calling convention.)
      
      (JSC::op_call_eval): Finish standard CallFrame setup before calling 
      our eval helper function, which now depends on that setup.
      
      * runtime/Arguments.h:
      (JSC::Arguments::length): Renamed numProvidedArguments() to length()
      because that's what other objects call it, and the difference made our
      new loadVarargs helper function hard to read.
      
      * runtime/Executable.cpp:
      (JSC::FunctionExecutable::compileForCallInternal):
      (JSC::FunctionExecutable::compileForConstructInternal): Interpreter build
      fixes.
      
      * runtime/FunctionPrototype.cpp:
      (JSC::functionProtoFuncApply): Honor Arguments::MaxArguments even when
      the .apply call_varargs optimization fails. (This bug appears on layout
      tests when you disable the optimization.)
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      539d1bba
  19. 11 Nov, 2011 1 commit
    • mhahnenberg@apple.com's avatar
      Add jsCast to replace static_cast · 135f0517
      mhahnenberg@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=72071
      
      Reviewed by Geoffrey Garen.
      
      Source/JavaScriptCore: 
      
      Added new jsCast and changed all of the static_cast sites in functions that 
      are in the MethodTable to use jsCast instead.
      
      * API/JSCallbackFunction.cpp:
      (JSC::JSCallbackFunction::toStringCallback):
      (JSC::JSCallbackFunction::valueOfCallback):
      * API/JSCallbackObject.h:
      (JSC::JSCallbackObject::visitChildren):
      * API/JSCallbackObjectFunctions.h:
      (JSC::::className):
      (JSC::::getOwnPropertySlot):
      (JSC::::getOwnPropertyDescriptor):
      (JSC::::put):
      (JSC::::deleteProperty):
      (JSC::::deletePropertyByIndex):
      (JSC::::getConstructData):
      (JSC::::hasInstance):
      (JSC::::getCallData):
      (JSC::::getOwnPropertyNames):
      * debugger/DebuggerActivation.cpp:
      (JSC::DebuggerActivation::visitChildren):
      (JSC::DebuggerActivation::className):
      (JSC::DebuggerActivation::getOwnPropertySlot):
      (JSC::DebuggerActivation::put):
      (JSC::DebuggerActivation::putWithAttributes):
      (JSC::DebuggerActivation::deleteProperty):
      (JSC::DebuggerActivation::getOwnPropertyNames):
      (JSC::DebuggerActivation::getOwnPropertyDescriptor):
      (JSC::DebuggerActivation::defineGetter):
      (JSC::DebuggerActivation::defineSetter):
      * runtime/Arguments.cpp:
      (JSC::Arguments::visitChildren):
      (JSC::Arguments::getOwnPropertySlotByIndex):
      (JSC::Arguments::getOwnPropertySlot):
      (JSC::Arguments::getOwnPropertyDescriptor):
      (JSC::Arguments::getOwnPropertyNames):
      (JSC::Arguments::putByIndex):
      (JSC::Arguments::put):
      (JSC::Arguments::deletePropertyByIndex):
      (JSC::Arguments::deleteProperty):
      * runtime/ArrayConstructor.cpp:
      (JSC::ArrayConstructor::getOwnPropertySlot):
      (JSC::ArrayConstructor::getOwnPropertyDescriptor):
      * runtime/ArrayPrototype.cpp:
      (JSC::ArrayPrototype::getOwnPropertySlot):
      (JSC::ArrayPrototype::getOwnPropertyDescriptor):
      * runtime/BooleanPrototype.cpp:
      (JSC::BooleanPrototype::getOwnPropertySlot):
      (JSC::BooleanPrototype::getOwnPropertyDescriptor):
      * runtime/DateConstructor.cpp:
      (JSC::DateConstructor::getOwnPropertySlot):
      (JSC::DateConstructor::getOwnPropertyDescriptor):
      * runtime/DatePrototype.cpp:
      (JSC::DatePrototype::getOwnPropertySlot):
      (JSC::DatePrototype::getOwnPropertyDescriptor):
      * runtime/ErrorPrototype.cpp:
      (JSC::ErrorPrototype::getOwnPropertySlot):
      (JSC::ErrorPrototype::getOwnPropertyDescriptor):
      * runtime/Executable.cpp:
      (JSC::ExecutableBase::clearCode):
      (JSC::EvalExecutable::visitChildren):
      (JSC::ProgramExecutable::visitChildren):
      (JSC::FunctionExecutable::visitChildren):
      * runtime/GetterSetter.cpp:
      (JSC::GetterSetter::visitChildren):
      * runtime/JSActivation.cpp:
      (JSC::JSActivation::visitChildren):
      (JSC::JSActivation::getOwnPropertyNames):
      (JSC::JSActivation::getOwnPropertySlot):
      (JSC::JSActivation::put):
      (JSC::JSActivation::putWithAttributes):
      * runtime/JSArray.cpp:
      (JSC::JSArray::getOwnPropertySlotByIndex):
      (JSC::JSArray::getOwnPropertySlot):
      (JSC::JSArray::getOwnPropertyDescriptor):
      (JSC::JSArray::put):
      (JSC::JSArray::putByIndex):
      (JSC::JSArray::deleteProperty):
      (JSC::JSArray::deletePropertyByIndex):
      (JSC::JSArray::getOwnPropertyNames):
      (JSC::JSArray::visitChildren):
      * runtime/JSBoundFunction.cpp:
      (JSC::JSBoundFunction::hasInstance):
      (JSC::JSBoundFunction::visitChildren):
      * runtime/JSByteArray.cpp:
      (JSC::JSByteArray::getOwnPropertySlot):
      (JSC::JSByteArray::getOwnPropertyDescriptor):
      (JSC::JSByteArray::getOwnPropertySlotByIndex):
      (JSC::JSByteArray::put):
      (JSC::JSByteArray::putByIndex):
      (JSC::JSByteArray::getOwnPropertyNames):
      * runtime/JSCell.h:
      (JSC::JSCell::visitChildren):
      (JSC::jsCast):
      * runtime/JSFunction.cpp:
      (JSC::JSFunction::visitChildren):
      (JSC::JSFunction::getCallData):
      (JSC::JSFunction::getOwnPropertySlot):
      (JSC::JSFunction::getOwnPropertyDescriptor):
      (JSC::JSFunction::getOwnPropertyNames):
      (JSC::JSFunction::put):
      (JSC::JSFunction::deleteProperty):
      (JSC::JSFunction::getConstructData):
      * runtime/JSGlobalData.cpp:
      (JSC::StackPreservingRecompiler::operator()):
      * runtime/JSGlobalObject.cpp:
      (JSC::JSGlobalObject::put):
      (JSC::JSGlobalObject::putWithAttributes):
      (JSC::JSGlobalObject::defineGetter):
      (JSC::JSGlobalObject::defineSetter):
      (JSC::JSGlobalObject::visitChildren):
      (JSC::JSGlobalObject::getOwnPropertySlot):
      (JSC::JSGlobalObject::getOwnPropertyDescriptor):
      (JSC::JSGlobalObject::clearRareData):
      * runtime/JSGlobalThis.cpp:
      (JSC::JSGlobalThis::visitChildren):
      * runtime/JSONObject.cpp:
      (JSC::JSONObject::getOwnPropertySlot):
      (JSC::JSONObject::getOwnPropertyDescriptor):
      * runtime/JSObject.cpp:
      (JSC::JSObject::finalize):
      (JSC::JSObject::visitChildren):
      (JSC::JSObject::getOwnPropertySlotByIndex):
      (JSC::JSObject::put):
      (JSC::JSObject::putByIndex):
      (JSC::JSObject::deleteProperty):
      (JSC::JSObject::deletePropertyByIndex):
      * runtime/JSObject.h:
      (JSC::JSObject::getOwnPropertySlot):
      * runtime/JSPropertyNameIterator.cpp:
      (JSC::JSPropertyNameIterator::visitChildren):
      * runtime/JSStaticScopeObject.cpp:
      (JSC::JSStaticScopeObject::visitChildren):
      (JSC::JSStaticScopeObject::put):
      (JSC::JSStaticScopeObject::putWithAttributes):
      (JSC::JSStaticScopeObject::getOwnPropertySlot):
      * runtime/JSString.cpp:
      (JSC::JSString::visitChildren):
      (JSC::JSString::toThisObject):
      (JSC::JSString::getOwnPropertySlot):
      (JSC::JSString::getOwnPropertySlotByIndex):
      * runtime/JSVariableObject.cpp:
      (JSC::JSVariableObject::deleteProperty):
      (JSC::JSVariableObject::getOwnPropertyNames):
      * runtime/JSWrapperObject.cpp:
      (JSC::JSWrapperObject::visitChildren):
      * runtime/MathObject.cpp:
      (JSC::MathObject::getOwnPropertySlot):
      (JSC::MathObject::getOwnPropertyDescriptor):
      * runtime/NativeErrorConstructor.cpp:
      (JSC::NativeErrorConstructor::visitChildren):
      * runtime/NumberConstructor.cpp:
      (JSC::NumberConstructor::getOwnPropertySlot):
      (JSC::NumberConstructor::getOwnPropertyDescriptor):
      * runtime/NumberPrototype.cpp:
      (JSC::NumberPrototype::getOwnPropertySlot):
      (JSC::NumberPrototype::getOwnPropertyDescriptor):
      * runtime/ObjectConstructor.cpp:
      (JSC::ObjectConstructor::getOwnPropertySlot):
      (JSC::ObjectConstructor::getOwnPropertyDescriptor):
      * runtime/ObjectPrototype.cpp:
      (JSC::ObjectPrototype::put):
      (JSC::ObjectPrototype::getOwnPropertySlotByIndex):
      (JSC::ObjectPrototype::getOwnPropertySlot):
      (JSC::ObjectPrototype::getOwnPropertyDescriptor):
      * runtime/RegExpConstructor.cpp:
      (JSC::RegExpConstructor::getOwnPropertySlot):
      (JSC::RegExpConstructor::getOwnPropertyDescriptor):
      (JSC::RegExpConstructor::put):
      * runtime/RegExpMatchesArray.h:
      (JSC::RegExpMatchesArray::getOwnPropertySlot):
      (JSC::RegExpMatchesArray::getOwnPropertySlotByIndex):
      (JSC::RegExpMatchesArray::getOwnPropertyDescriptor):
      (JSC::RegExpMatchesArray::put):
      (JSC::RegExpMatchesArray::putByIndex):
      (JSC::RegExpMatchesArray::deleteProperty):
      (JSC::RegExpMatchesArray::deletePropertyByIndex):
      (JSC::RegExpMatchesArray::getOwnPropertyNames):
      * runtime/RegExpObject.cpp:
      (JSC::RegExpObject::visitChildren):
      (JSC::RegExpObject::getOwnPropertySlot):
      (JSC::RegExpObject::getOwnPropertyDescriptor):
      (JSC::RegExpObject::put):
      * runtime/RegExpPrototype.cpp:
      (JSC::RegExpPrototype::getOwnPropertySlot):
      (JSC::RegExpPrototype::getOwnPropertyDescriptor):
      * runtime/ScopeChain.cpp:
      (JSC::ScopeChainNode::visitChildren):
      * runtime/StringConstructor.cpp:
      (JSC::StringConstructor::getOwnPropertySlot):
      (JSC::StringConstructor::getOwnPropertyDescriptor):
      * runtime/StringObject.cpp:
      (JSC::StringObject::getOwnPropertySlot):
      (JSC::StringObject::getOwnPropertySlotByIndex):
      (JSC::StringObject::getOwnPropertyDescriptor):
      (JSC::StringObject::deleteProperty):
      (JSC::StringObject::getOwnPropertyNames):
      * runtime/StringPrototype.cpp:
      (JSC::StringPrototype::getOwnPropertySlot):
      (JSC::StringPrototype::getOwnPropertyDescriptor):
      * runtime/Structure.cpp:
      (JSC::Structure::visitChildren):
      * runtime/StructureChain.cpp:
      (JSC::StructureChain::visitChildren):
      
      Source/JavaScriptGlue: 
      
      Added new jsCast and changed all of the static_cast sites in functions that 
      are in the MethodTable to use jsCast instead.
      
      * UserObjectImp.cpp:
      (UserObjectImp::getCallData):
      (UserObjectImp::getOwnPropertyNames):
      (UserObjectImp::getOwnPropertySlot):
      (UserObjectImp::put):
      (UserObjectImp::visitChildren):
      
      Source/WebCore: 
      
      No new tests. 
      
      Added new jsCast and changed all of the static_cast sites in functions that 
      are in the MethodTable to use jsCast instead.
      
      * bindings/js/JSAttrCustom.cpp:
      (WebCore::JSAttr::visitChildren):
      * bindings/js/JSAudioContextCustom.cpp:
      (WebCore::JSAudioContext::visitChildren):
      * bindings/js/JSCSSRuleCustom.cpp:
      (WebCore::JSCSSRule::visitChildren):
      * bindings/js/JSCSSStyleDeclarationCustom.cpp:
      (WebCore::JSCSSStyleDeclaration::visitChildren):
      * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
      (WebCore::toHTMLCanvasStyle):
      * bindings/js/JSCanvasRenderingContextCustom.cpp:
      (WebCore::JSCanvasRenderingContext::visitChildren):
      * bindings/js/JSDOMGlobalObject.cpp:
      (WebCore::JSDOMGlobalObject::visitChildren):
      * bindings/js/JSDOMStringMapCustom.cpp:
      (WebCore::JSDOMStringMap::getOwnPropertyNames):
      (WebCore::JSDOMStringMap::deleteProperty):
      * bindings/js/JSDOMWindowBase.cpp:
      (WebCore::JSDOMWindowBase::toThisObject):
      * bindings/js/JSDOMWindowCustom.cpp:
      (WebCore::JSDOMWindow::visitChildren):
      (WebCore::JSDOMWindow::getOwnPropertySlot):
      (WebCore::JSDOMWindow::getOwnPropertyDescriptor):
      (WebCore::JSDOMWindow::put):
      (WebCore::JSDOMWindow::deleteProperty):
      (WebCore::JSDOMWindow::getPropertyNames):
      (WebCore::JSDOMWindow::getOwnPropertyNames):
      (WebCore::JSDOMWindow::defineGetter):
      (WebCore::JSDOMWindow::defineSetter):
      (WebCore::JSDOMWindow::defineOwnProperty):
      * bindings/js/JSDOMWindowShell.cpp:
      (WebCore::JSDOMWindowShell::className):
      (WebCore::JSDOMWindowShell::getOwnPropertySlot):
      (WebCore::JSDOMWindowShell::getOwnPropertyDescriptor):
      (WebCore::JSDOMWindowShell::put):
      (WebCore::JSDOMWindowShell::putWithAttributes):
      (WebCore::JSDOMWindowShell::defineOwnProperty):
      (WebCore::JSDOMWindowShell::deleteProperty):
      (WebCore::JSDOMWindowShell::getPropertyNames):
      (WebCore::JSDOMWindowShell::getOwnPropertyNames):
      (WebCore::JSDOMWindowShell::defineGetter):
      (WebCore::JSDOMWindowShell::defineSetter):
      * bindings/js/JSHTMLAppletElementCustom.cpp:
      (WebCore::JSHTMLAppletElement::getCallData):
      * bindings/js/JSHTMLEmbedElementCustom.cpp:
      (WebCore::JSHTMLEmbedElement::getCallData):
      * bindings/js/JSHTMLObjectElementCustom.cpp:
      (WebCore::JSHTMLObjectElement::getCallData):
      * bindings/js/JSHistoryCustom.cpp:
      (WebCore::JSHistory::deleteProperty):
      (WebCore::JSHistory::getOwnPropertyNames):
      * bindings/js/JSJavaScriptAudioNodeCustom.cpp:
      (WebCore::JSJavaScriptAudioNode::visitChildren):
      * bindings/js/JSLocationCustom.cpp:
      (WebCore::JSLocation::deleteProperty):
      (WebCore::JSLocation::getOwnPropertyNames):
      * bindings/js/JSMessageChannelCustom.cpp:
      (WebCore::JSMessageChannel::visitChildren):
      * bindings/js/JSMessagePortCustom.cpp:
      (WebCore::JSMessagePort::visitChildren):
      * bindings/js/JSNamedNodeMapCustom.cpp:
      (WebCore::JSNamedNodeMap::visitChildren):
      * bindings/js/JSNodeCustom.cpp:
      (WebCore::JSNode::visitChildren):
      * bindings/js/JSNodeFilterCustom.cpp:
      (WebCore::JSNodeFilter::visitChildren):
      * bindings/js/JSNodeIteratorCustom.cpp:
      (WebCore::JSNodeIterator::visitChildren):
      * bindings/js/JSSVGElementInstanceCustom.cpp:
      (WebCore::JSSVGElementInstance::visitChildren):
      * bindings/js/JSSharedWorkerCustom.cpp:
      (WebCore::JSSharedWorker::visitChildren):
      * bindings/js/JSStorageCustom.cpp:
      (WebCore::JSStorage::deleteProperty):
      (WebCore::JSStorage::getOwnPropertyNames):
      * bindings/js/JSStyleSheetCustom.cpp:
      (WebCore::JSStyleSheet::visitChildren):
      * bindings/js/JSTreeWalkerCustom.cpp:
      (WebCore::JSTreeWalker::visitChildren):
      * bindings/js/JSWebGLRenderingContextCustom.cpp:
      (WebCore::JSWebGLRenderingContext::visitChildren):
      * bindings/js/JSWorkerContextCustom.cpp:
      (WebCore::JSWorkerContext::visitChildren):
      * bindings/js/JSXMLHttpRequestCustom.cpp:
      (WebCore::JSXMLHttpRequest::visitChildren):
      * bindings/js/JSXPathResultCustom.cpp:
      (WebCore::JSXPathResult::visitChildren):
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateHeader):
      (GenerateImplementation):
      * bindings/scripts/test/JS/JSTestInterface.cpp:
      (WebCore::JSTestInterface::getOwnPropertySlot):
      (WebCore::JSTestInterface::getOwnPropertyDescriptor):
      * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
      (WebCore::JSTestMediaQueryListListenerPrototype::getOwnPropertySlot):
      (WebCore::JSTestMediaQueryListListenerPrototype::getOwnPropertyDescriptor):
      (WebCore::JSTestMediaQueryListListener::getOwnPropertySlot):
      (WebCore::JSTestMediaQueryListListener::getOwnPropertyDescriptor):
      * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
      (WebCore::JSTestNamedConstructor::getOwnPropertySlot):
      (WebCore::JSTestNamedConstructor::getOwnPropertyDescriptor):
      * bindings/scripts/test/JS/JSTestObj.cpp:
      (WebCore::JSTestObjPrototype::getOwnPropertySlot):
      (WebCore::JSTestObjPrototype::getOwnPropertyDescriptor):
      (WebCore::JSTestObj::getOwnPropertySlot):
      (WebCore::JSTestObj::getOwnPropertyDescriptor):
      (WebCore::JSTestObj::put):
      (WebCore::JSTestObj::visitChildren):
      * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
      (WebCore::JSTestSerializedScriptValueInterface::getOwnPropertySlot):
      (WebCore::JSTestSerializedScriptValueInterface::getOwnPropertyDescriptor):
      * bridge/objc/objc_runtime.mm:
      (JSC::Bindings::ObjcFallbackObjectImp::getCallData):
      (JSC::Bindings::ObjcFallbackObjectImp::defaultValue):
      * bridge/qt/qt_instance.cpp:
      (JSC::Bindings::QtRuntimeObject::visitChildren):
      * bridge/qt/qt_runtime.cpp:
      (JSC::Bindings::QtRuntimeMetaMethod::visitChildren):
      (JSC::Bindings::QtRuntimeMetaMethod::getOwnPropertySlot):
      (JSC::Bindings::QtRuntimeMetaMethod::getOwnPropertyDescriptor):
      (JSC::Bindings::QtRuntimeConnectionMethod::getOwnPropertySlot):
      (JSC::Bindings::QtRuntimeConnectionMethod::getOwnPropertyDescriptor):
      * bridge/runtime_array.cpp:
      (JSC::RuntimeArray::getOwnPropertyNames):
      (JSC::RuntimeArray::getOwnPropertySlot):
      (JSC::RuntimeArray::getOwnPropertyDescriptor):
      (JSC::RuntimeArray::getOwnPropertySlotByIndex):
      (JSC::RuntimeArray::put):
      (JSC::RuntimeArray::putByIndex):
      * bridge/runtime_method.cpp:
      (JSC::RuntimeMethod::getOwnPropertySlot):
      (JSC::RuntimeMethod::getOwnPropertyDescriptor):
      * bridge/runtime_object.cpp:
      (JSC::Bindings::RuntimeObject::getOwnPropertySlot):
      (JSC::Bindings::RuntimeObject::getOwnPropertyDescriptor):
      (JSC::Bindings::RuntimeObject::put):
      (JSC::Bindings::RuntimeObject::defaultValue):
      (JSC::Bindings::RuntimeObject::getCallData):
      (JSC::Bindings::RuntimeObject::getConstructData):
      (JSC::Bindings::RuntimeObject::getOwnPropertyNames):
      
      Source/WebKit2: 
      
      Added new jsCast and changed all of the static_cast sites in functions that 
      are in the MethodTable to use jsCast instead.
      
      * WebProcess/Plugins/Netscape/JSNPObject.cpp:
      (WebKit::JSNPObject::getCallData):
      (WebKit::JSNPObject::getConstructData):
      (WebKit::JSNPObject::getOwnPropertySlot):
      (WebKit::JSNPObject::getOwnPropertyDescriptor):
      (WebKit::JSNPObject::put):
      (WebKit::JSNPObject::deleteProperty):
      (WebKit::JSNPObject::deletePropertyByIndex):
      (WebKit::JSNPObject::getOwnPropertyNames):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100006 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      135f0517
  20. 10 Nov, 2011 1 commit
    • fpizlo@apple.com's avatar
      DFG should not reparse code that was just parsed · f5e1fe15
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=71977
      
      Reviewed by Geoff Garen.
              
      The instruction stream of a code block is now kept around until
      the next GC. When doing either an optimizing compilation of an
      executable, or inlining of an executable, we now try to find the
      already preexisting bytecode. If we find it, we don't have to parse.
      If we don't find it, we parse as before. Inlining takes the extra
      step of caching code blocks, so if the same executable gets inlined
      multiple times into the same caller, then we parse it at most once
      even if prior to inlining that executable did not have any code
      blocks with an instruction stream.
              
      Also fixed a silly bug where the strict mode for various operations
      was being determined by looking at the machine code block rather
      than the inlinee.
      
      To enable the delete-on-next-GC policy, I introduced the notion
      of an ultra weak finalizer, which anyone can register during
      tracing. This is thread-safe (for parallel GC) and
      stop-the-world-safe (so calls to free() are postponed until the
      world is resumed). This required reusing some facilities previously
      created for WeakReferenceHarvester, so I created a common utility
      class. I also retweaked the handling of WeakReferenceHarvesters,
      since they should be executed during stop-the-world since in the
      future we may want to allow them to call drain().
              
      2% win on SunSpider. 2% win on V8, when run in my harness. Neutral
      elsewhere.
      
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::CodeBlock):
      (JSC::CodeBlock::visitAggregate):
      (JSC::CodeBlock::copyPostParseDataFrom):
      (JSC::CodeBlock::copyPostParseDataFromAlternative):
      (JSC::CodeBlock::finalizeUnconditionally):
      * bytecode/CodeBlock.h:
      (JSC::CodeBlock::canProduceCopyWithBytecode):
      (JSC::CodeBlock::discardBytecodeLater):
      (JSC::CodeBlock::handleBytecodeDiscardingOpportunity):
      (JSC::GlobalCodeBlock::GlobalCodeBlock):
      (JSC::ProgramCodeBlock::ProgramCodeBlock):
      (JSC::EvalCodeBlock::EvalCodeBlock):
      (JSC::FunctionCodeBlock::FunctionCodeBlock):
      (JSC::BytecodeDestructionBlocker::BytecodeDestructionBlocker):
      (JSC::BytecodeDestructionBlocker::~BytecodeDestructionBlocker):
      * dfg/DFGAssemblyHelpers.h:
      (JSC::DFG::AssemblyHelpers::strictModeFor):
      * dfg/DFGByteCodeCache.h: Added.
      (JSC::DFG::CodeBlockKey::CodeBlockKey):
      (JSC::DFG::CodeBlockKey::operator==):
      (JSC::DFG::CodeBlockKey::hash):
      (JSC::DFG::CodeBlockKey::executable):
      (JSC::DFG::CodeBlockKey::kind):
      (JSC::DFG::CodeBlockKey::isHashTableDeletedValue):
      (JSC::DFG::CodeBlockKeyHash::hash):
      (JSC::DFG::CodeBlockKeyHash::equal):
      (JSC::DFG::ByteCodeCache::ByteCodeCache):
      (JSC::DFG::ByteCodeCache::~ByteCodeCache):
      (JSC::DFG::ByteCodeCache::get):
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::handleInlining):
      * dfg/DFGJITCodeGenerator32_64.cpp:
      (JSC::DFG::JITCodeGenerator::cachedPutById):
      * dfg/DFGJITCodeGenerator64.cpp:
      (JSC::DFG::JITCodeGenerator::cachedPutById):
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * heap/Heap.cpp:
      (JSC::Heap::finalizeUnconditionally):
      (JSC::Heap::markRoots):
      (JSC::Heap::collect):
      * heap/Heap.h:
      * heap/ListableHandler.h: Added.
      (JSC::ListableHandler::ListableHandler):
      (JSC::ListableHandler::~ListableHandler):
      (JSC::ListableHandler::List::List):
      (JSC::ListableHandler::List::addNotThreadSafe):
      (JSC::ListableHandler::List::addThreadSafe):
      (JSC::ListableHandler::List::hasNext):
      (JSC::ListableHandler::List::removeNext):
      * heap/MarkStack.cpp:
      (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData):
      (JSC::SlotVisitor::harvestWeakReferences):
      (JSC::SlotVisitor::finalizeUnconditionally):
      * heap/MarkStack.h:
      (JSC::MarkStack::addWeakReferenceHarvester):
      (JSC::MarkStack::addUnconditionalFinalizer):
      * heap/SlotVisitor.h:
      * heap/UnconditionalFinalizer.h: Added.
      (JSC::UnconditionalFinalizer::~UnconditionalFinalizer):
      * heap/WeakReferenceHarvester.h:
      (JSC::WeakReferenceHarvester::WeakReferenceHarvester):
      (JSC::WeakReferenceHarvester::~WeakReferenceHarvester):
      * runtime/Executable.cpp:
      (JSC::EvalExecutable::compileInternal):
      (JSC::ProgramExecutable::compileInternal):
      (JSC::FunctionExecutable::baselineCodeBlockFor):
      (JSC::FunctionExecutable::codeBlockWithBytecodeFor):
      (JSC::FunctionExecutable::produceCodeBlockFor):
      (JSC::FunctionExecutable::compileForCallInternal):
      (JSC::FunctionExecutable::compileForConstructInternal):
      * runtime/Executable.h:
      (JSC::FunctionExecutable::profiledCodeBlockFor):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@99898 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f5e1fe15
  21. 06 Nov, 2011 1 commit
    • fpizlo@apple.com's avatar
      JSC should be able to sample itself in a more flexible way than just sampling flags · 8ce62fd5
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=71522
      
      Source/JavaScriptCore: 
      
      Reviewed by Gavin Barraclough.
              
      Added a construct that looks like SamplingRegion samplingRegion("name").
      
      * JavaScriptCore.exp:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * bytecode/SamplingTool.cpp:
      (JSC::SamplingRegion::Locker::Locker):
      (JSC::SamplingRegion::Locker::~Locker):
      (JSC::SamplingRegion::sample):
      (JSC::SamplingRegion::dump):
      (JSC::SamplingRegion::dumpInternal):
      (JSC::SamplingThread::threadStartFunc):
      * bytecode/SamplingTool.h:
      (JSC::SamplingRegion::SamplingRegion):
      (JSC::SamplingRegion::~SamplingRegion):
      (JSC::SamplingRegion::exchangeCurrent):
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::generate):
      * dfg/DFGDriver.cpp:
      (JSC::DFG::compile):
      * heap/Heap.cpp:
      (JSC::Heap::markRoots):
      (JSC::Heap::collect):
      * heap/VTableSpectrum.cpp:
      (JSC::VTableSpectrum::countVPtr):
      (JSC::VTableSpectrum::dump):
      * heap/VTableSpectrum.h:
      * jsc.cpp:
      (main):
      (runWithScripts):
      * parser/Parser.h:
      (JSC::parse):
      * runtime/Executable.cpp:
      (JSC::EvalExecutable::compileInternal):
      (JSC::ProgramExecutable::compileInternal):
      (JSC::FunctionExecutable::compileForCallInternal):
      (JSC::FunctionExecutable::compileForConstructInternal):
      * wtf/Atomics.h:
      (WTF::weakCompareAndSwap):
      * wtf/Platform.h:
      * wtf/Spectrum.h: Added.
      (WTF::Spectrum::Spectrum):
      (WTF::Spectrum::add):
      (WTF::Spectrum::get):
      (WTF::Spectrum::begin):
      (WTF::Spectrum::end):
      (WTF::Spectrum::KeyAndCount::KeyAndCount):
      (WTF::Spectrum::KeyAndCount::operator<):
      (WTF::Spectrum::buildList):
      * wtf/wtf.pri:
      
      Source/JavaScriptGlue: 
      
      Reviewed by Gavin Barraclough.
              
      * ForwardingHeaders/wtf/Spectrum.h: Added.
      
      Source/WebCore: 
      
      Reviewed by Gavin Barraclough.
      
      No new tests, since no functionality changed.
      
      * ForwardingHeaders/wtf/Spectrum.h: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@99374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8ce62fd5
  22. 31 Oct, 2011 2 commits
    • mhahnenberg@apple.com's avatar
      Interpreter build fix · e13bbdd2
      mhahnenberg@apple.com authored
      Unreviewed build fix
      
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::privateExecute):
      * runtime/Executable.cpp:
      (JSC::FunctionExecutable::compileForCallInternal):
      (JSC::FunctionExecutable::compileForConstructInternal):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@98916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e13bbdd2
    • msaboff@apple.com's avatar
      Towards 8-bit Strings: Move Lexer and Parser Objects out of JSGlobalData · 2e5003e8
      msaboff@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=71138
      
      Restructure and movement of Lexer and Parser code.
      Moved Lexer and Parser objects out of JSGlobalData.
      Added a new ParserTokens class and instance to JSGlobalData that
      have JavaScript token related definitions.
      Replaced JSGlobalData arguments to Node classes with lineNumber,
      as that was the only use of the JSGlobalData.
      Combined JSParser and Parser classes into one class,
      eliminating JSParser.h and .cpp.
      Various supporting #include changes.
      
      These mostly mechanical changes are done in preparation to
      making the Lexer and Parser template classes.
      
      Reviewed by Darin Adler.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * JavaScriptCore.gypi:
      * JavaScriptCore.pro:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * bytecompiler/NodesCodegen.cpp:
      (JSC::ArrayNode::toArgumentList):
      (JSC::ApplyFunctionCallDotNode::emitBytecode):
      * parser/ASTBuilder.h:
      (JSC::ASTBuilder::ASTBuilder):
      (JSC::ASTBuilder::createSourceElements):
      (JSC::ASTBuilder::createCommaExpr):
      (JSC::ASTBuilder::createLogicalNot):
      (JSC::ASTBuilder::createUnaryPlus):
      (JSC::ASTBuilder::createVoid):
      (JSC::ASTBuilder::thisExpr):
      (JSC::ASTBuilder::createResolve):
      (JSC::ASTBuilder::createObjectLiteral):
      (JSC::ASTBuilder::createArray):
      (JSC::ASTBuilder::createNumberExpr):
      (JSC::ASTBuilder::createString):
      (JSC::ASTBuilder::createBoolean):
      (JSC::ASTBuilder::createNull):
      (JSC::ASTBuilder::createBracketAccess):
      (JSC::ASTBuilder::createDotAccess):
      (JSC::ASTBuilder::createRegExp):
      (JSC::ASTBuilder::createNewExpr):
      (JSC::ASTBuilder::createConditionalExpr):
      (JSC::ASTBuilder::createAssignResolve):
      (JSC::ASTBuilder::createFunctionExpr):
      (JSC::ASTBuilder::createFunctionBody):
      (JSC::ASTBuilder::createGetterOrSetterProperty):
      (JSC::ASTBuilder::createArguments):
      (JSC::ASTBuilder::createArgumentsList):
      (JSC::ASTBuilder::createPropertyList):
      (JSC::ASTBuilder::createElementList):
      (JSC::ASTBuilder::createFormalParameterList):
      (JSC::ASTBuilder::createClause):
      (JSC::ASTBuilder::createClauseList):
      (JSC::ASTBuilder::createFuncDeclStatement):
      (JSC::ASTBuilder::createBlockStatement):
      (JSC::ASTBuilder::createExprStatement):
      (JSC::ASTBuilder::createIfStatement):
      (JSC::ASTBuilder::createForLoop):
      (JSC::ASTBuilder::createForInLoop):
      (JSC::ASTBuilder::createEmptyStatement):
      (JSC::ASTBuilder::createVarStatement):
      (JSC::ASTBuilder::createReturnStatement):
      (JSC::ASTBuilder::createBreakStatement):
      (JSC::ASTBuilder::createContinueStatement):
      (JSC::ASTBuilder::createTryStatement):
      (JSC::ASTBuilder::createSwitchStatement):
      (JSC::ASTBuilder::createWhileStatement):
      (JSC::ASTBuilder::createDoWhileStatement):
      (JSC::ASTBuilder::createLabelStatement):
      (JSC::ASTBuilder::createWithStatement):
      (JSC::ASTBuilder::createThrowStatement):
      (JSC::ASTBuilder::createDebugger):
      (JSC::ASTBuilder::createConstStatement):
      (JSC::ASTBuilder::appendConstDecl):
      (JSC::ASTBuilder::combineCommaNodes):
      (JSC::ASTBuilder::appendBinaryOperation):
      (JSC::ASTBuilder::createAssignment):
      (JSC::ASTBuilder::createNumber):
      (JSC::ASTBuilder::makeTypeOfNode):
      (JSC::ASTBuilder::makeDeleteNode):
      (JSC::ASTBuilder::makeNegateNode):
      (JSC::ASTBuilder::makeBitwiseNotNode):
      (JSC::ASTBuilder::makeMultNode):
      (JSC::ASTBuilder::makeDivNode):
      (JSC::ASTBuilder::makeModNode):
      (JSC::ASTBuilder::makeAddNode):
      (JSC::ASTBuilder::makeSubNode):
      (JSC::ASTBuilder::makeLeftShiftNode):
      (JSC::ASTBuilder::makeRightShiftNode):
      (JSC::ASTBuilder::makeURightShiftNode):
      (JSC::ASTBuilder::makeBitOrNode):
      (JSC::ASTBuilder::makeBitAndNode):
      (JSC::ASTBuilder::makeBitXOrNode):
      (JSC::ASTBuilder::makeFunctionCallNode):
      (JSC::ASTBuilder::makeBinaryNode):
      (JSC::ASTBuilder::makeAssignNode):
      (JSC::ASTBuilder::makePrefixNode):
      (JSC::ASTBuilder::makePostfixNode):
      * parser/JSParser.cpp: Removed.
      * parser/JSParser.h: Removed.
      * parser/Lexer.cpp:
      (JSC::Keywords::Keywords):
      (JSC::Lexer::Lexer):
      (JSC::Lexer::~Lexer):
      (JSC::Lexer::setCode):
      (JSC::Lexer::parseIdentifier):
      * parser/Lexer.h:
      (JSC::Keywords::isKeyword):
      (JSC::Keywords::getKeyword):
      (JSC::Keywords::~Keywords):
      (JSC::Lexer::setIsReparsing):
      (JSC::Lexer::isReparsing):
      (JSC::Lexer::lineNumber):
      (JSC::Lexer::setLastLineNumber):
      (JSC::Lexer::lastLineNumber):
      (JSC::Lexer::prevTerminator):
      (JSC::Lexer::sawError):
      (JSC::Lexer::getErrorMessage):
      (JSC::Lexer::currentOffset):
      (JSC::Lexer::setOffset):
      (JSC::Lexer::setLineNumber):
      (JSC::Lexer::sourceProvider):
      (JSC::Lexer::isWhiteSpace):
      (JSC::Lexer::isLineTerminator):
      (JSC::Lexer::convertHex):
      (JSC::Lexer::convertUnicode):
      (JSC::Lexer::makeIdentifier):
      (JSC::Lexer::lexExpectIdentifier):
      * parser/NodeConstructors.h:
      (JSC::ParserArenaFreeable::operator new):
      (JSC::ParserArenaDeletable::operator new):
      (JSC::ParserArenaRefCounted::ParserArenaRefCounted):
      (JSC::Node::Node):
      (JSC::ExpressionNode::ExpressionNode):
      (JSC::StatementNode::StatementNode):
      (JSC::NullNode::NullNode):
      (JSC::BooleanNode::BooleanNode):
      (JSC::NumberNode::NumberNode):
      (JSC::StringNode::StringNode):
      (JSC::RegExpNode::RegExpNode):
      (JSC::ThisNode::ThisNode):
      (JSC::ResolveNode::ResolveNode):
      (JSC::ElementNode::ElementNode):
      (JSC::ArrayNode::ArrayNode):
      (JSC::PropertyNode::PropertyNode):
      (JSC::PropertyListNode::PropertyListNode):
      (JSC::ObjectLiteralNode::ObjectLiteralNode):
      (JSC::BracketAccessorNode::BracketAccessorNode):
      (JSC::DotAccessorNode::DotAccessorNode):
      (JSC::ArgumentListNode::ArgumentListNode):
      (JSC::ArgumentsNode::ArgumentsNode):
      (JSC::NewExprNode::NewExprNode):
      (JSC::EvalFunctionCallNode::EvalFunctionCallNode):
      (JSC::FunctionCallValueNode::FunctionCallValueNode):
      (JSC::FunctionCallResolveNode::FunctionCallResolveNode):
      (JSC::FunctionCallBracketNode::FunctionCallBracketNode):
      (JSC::FunctionCallDotNode::FunctionCallDotNode):
      (JSC::CallFunctionCallDotNode::CallFunctionCallDotNode):
      (JSC::ApplyFunctionCallDotNode::ApplyFunctionCallDotNode):
      (JSC::PrePostResolveNode::PrePostResolveNode):
      (JSC::PostfixResolveNode::PostfixResolveNode):
      (JSC::PostfixBracketNode::PostfixBracketNode):
      (JSC::PostfixDotNode::PostfixDotNode):
      (JSC::PostfixErrorNode::PostfixErrorNode):
      (JSC::DeleteResolveNode::DeleteResolveNode):
      (JSC::DeleteBracketNode::DeleteBracketNode):
      (JSC::DeleteDotNode::DeleteDotNode):
      (JSC::DeleteValueNode::DeleteValueNode):
      (JSC::VoidNode::VoidNode):
      (JSC::TypeOfResolveNode::TypeOfResolveNode):
      (JSC::TypeOfValueNode::TypeOfValueNode):
      (JSC::PrefixResolveNode::PrefixResolveNode):
      (JSC::PrefixBracketNode::PrefixBracketNode):
      (JSC::PrefixDotNode::PrefixDotNode):
      (JSC::PrefixErrorNode::PrefixErrorNode):
      (JSC::UnaryOpNode::UnaryOpNode):
      (JSC::UnaryPlusNode::UnaryPlusNode):
      (JSC::NegateNode::NegateNode):
      (JSC::BitwiseNotNode::BitwiseNotNode):
      (JSC::LogicalNotNode::LogicalNotNode):
      (JSC::BinaryOpNode::BinaryOpNode):
      (JSC::MultNode::MultNode):
      (JSC::DivNode::DivNode):
      (JSC::ModNode::ModNode):
      (JSC::AddNode::AddNode):
      (JSC::SubNode::SubNode):
      (JSC::LeftShiftNode::LeftShiftNode):
      (JSC::RightShiftNode::RightShiftNode):
      (JSC::UnsignedRightShiftNode::UnsignedRightShiftNode):
      (JSC::LessNode::LessNode):
      (JSC::GreaterNode::GreaterNode):
      (JSC::LessEqNode::LessEqNode):
      (JSC::GreaterEqNode::GreaterEqNode):
      (JSC::ThrowableBinaryOpNode::ThrowableBinaryOpNode):
      (JSC::InstanceOfNode::InstanceOfNode):
      (JSC::InNode::InNode):
      (JSC::EqualNode::EqualNode):
      (JSC::NotEqualNode::NotEqualNode):
      (JSC::StrictEqualNode::StrictEqualNode):
      (JSC::NotStrictEqualNode::NotStrictEqualNode):
      (JSC::BitAndNode::BitAndNode):
      (JSC::BitOrNode::BitOrNode):
      (JSC::BitXOrNode::BitXOrNode):
      (JSC::LogicalOpNode::LogicalOpNode):
      (JSC::ConditionalNode::ConditionalNode):
      (JSC::ReadModifyResolveNode::ReadModifyResolveNode):
      (JSC::AssignResolveNode::AssignResolveNode):
      (JSC::ReadModifyBracketNode::ReadModifyBracketNode):
      (JSC::AssignBracketNode::AssignBracketNode):
      (JSC::AssignDotNode::AssignDotNode):
      (JSC::ReadModifyDotNode::ReadModifyDotNode):
      (JSC::AssignErrorNode::AssignErrorNode):
      (JSC::CommaNode::CommaNode):
      (JSC::ConstStatementNode::ConstStatementNode):
      (JSC::SourceElements::SourceElements):
      (JSC::EmptyStatementNode::EmptyStatementNode):
      (JSC::DebuggerStatementNode::DebuggerStatementNode):
      (JSC::ExprStatementNode::ExprStatementNode):
      (JSC::VarStatementNode::VarStatementNode):
      (JSC::IfNode::IfNode):
      (JSC::IfElseNode::IfElseNode):
      (JSC::DoWhileNode::DoWhileNode):
      (JSC::WhileNode::WhileNode):
      (JSC::ForNode::ForNode):
      (JSC::ContinueNode::ContinueNode):
      (JSC::BreakNode::BreakNode):
      (JSC::ReturnNode::ReturnNode):
      (JSC::WithNode::WithNode):
      (JSC::LabelNode::LabelNode):
      (JSC::ThrowNode::ThrowNode):
      (JSC::TryNode::TryNode):
      (JSC::ParameterNode::ParameterNode):
      (JSC::FuncExprNode::FuncExprNode):
      (JSC::FuncDeclNode::FuncDeclNode):
      (JSC::CaseClauseNode::CaseClauseNode):
      (JSC::ClauseListNode::ClauseListNode):
      (JSC::CaseBlockNode::CaseBlockNode):
      (JSC::SwitchNode::SwitchNode):
      (JSC::ConstDeclNode::ConstDeclNode):
      (JSC::BlockNode::BlockNode):
      (JSC::ForInNode::ForInNode):
      * parser/NodeInfo.h:
      * parser/Nodes.cpp:
      (JSC::StatementNode::setLoc):
      (JSC::ScopeNode::ScopeNode):
      (JSC::ProgramNode::ProgramNode):
      (JSC::ProgramNode::create):
      (JSC::EvalNode::EvalNode):
      (JSC::EvalNode::create):
      (JSC::FunctionBodyNode::FunctionBodyNode):
      (JSC::FunctionBodyNode::create):
      * parser/Nodes.h:
      (JSC::Node::lineNo):
      * parser/Parser.cpp:
      (JSC::Parser::Parser):
      (JSC::Parser::~Parser):
      (JSC::Parser::parseInner):
      (JSC::Parser::allowAutomaticSemicolon):
      (JSC::Parser::parseSourceElements):
      (JSC::Parser::parseVarDeclaration):
      (JSC::Parser::parseConstDeclaration):
      (JSC::Parser::parseDoWhileStatement):
      (JSC::Parser::parseWhileStatement):
      (JSC::Parser::parseVarDeclarationList):
      (JSC::Parser::parseConstDeclarationList):
      (JSC::Parser::parseForStatement):
      (JSC::Parser::parseBreakStatement):
      (JSC::Parser::parseContinueStatement):
      (JSC::Parser::parseReturnStatement):
      (JSC::Parser::parseThrowStatement):
      (JSC::Parser::parseWithStatement):
      (JSC::Parser::parseSwitchStatement):
      (JSC::Parser::parseSwitchClauses):
      (JSC::Parser::parseSwitchDefaultClause):
      (JSC::Parser::parseTryStatement):
      (JSC::Parser::parseDebuggerStatement):
      (JSC::Parser::parseBlockStatement):
      (JSC::Parser::parseStatement):
      (JSC::Parser::parseFormalParameters):
      (JSC::Parser::parseFunctionBody):
      (JSC::Parser::parseFunctionInfo):
      (JSC::Parser::parseFunctionDeclaration):
      (JSC::LabelInfo::LabelInfo):
      (JSC::Parser::parseExpressionOrLabelStatement):
      (JSC::Parser::parseExpressionStatement):
      (JSC::Parser::parseIfStatement):
      (JSC::Parser::parseExpression):
      (JSC::Parser::parseAssignmentExpression):
      (JSC::Parser::parseConditionalExpression):
      (JSC::isUnaryOp):
      (JSC::Parser::isBinaryOperator):
      (JSC::Parser::parseBinaryExpression):
      (JSC::Parser::parseProperty):
      (JSC::Parser::parseObjectLiteral):
      (JSC::Parser::parseStrictObjectLiteral):
      (JSC::Parser::parseArrayLiteral):
      (JSC::Parser::parsePrimaryExpression):
      (JSC::Parser::parseArguments):
      (JSC::Parser::parseMemberExpression):
      (JSC::Parser::parseUnaryExpression):
      * parser/Parser.h:
      (JSC::isEvalNode):
      (JSC::EvalNode):
      (JSC::DepthManager::DepthManager):
      (JSC::DepthManager::~DepthManager):
      (JSC::ScopeLabelInfo::ScopeLabelInfo):
      (JSC::Scope::Scope):
      (JSC::Scope::startSwitch):
      (JSC::Scope::endSwitch):
      (JSC::Scope::startLoop):
      (JSC::Scope::endLoop):
      (JSC::Scope::inLoop):
      (JSC::Scope::breakIsValid):
      (JSC::Scope::continueIsValid):
      (JSC::Scope::pushLabel):
      (JSC::Scope::popLabel):
      (JSC::Scope::getLabel):
      (JSC::Scope::setIsFunction):
      (JSC::Scope::isFunction):
      (JSC::Scope::isFunctionBoundary):
      (JSC::Scope::declareVariable):
      (JSC::Scope::declareWrite):
      (JSC::Scope::preventNewDecls):
      (JSC::Scope::allowsNewDecls):
      (JSC::Scope::declareParameter):
      (JSC::Scope::useVariable):
      (JSC::Scope::setNeedsFullActivation):
      (JSC::Scope::collectFreeVariables):
      (JSC::Scope::getUncapturedWrittenVariables):
      (JSC::Scope::getCapturedVariables):
      (JSC::Scope::setStrictMode):
      (JSC::Scope::strictMode):
      (JSC::Scope::isValidStrictMode):
      (JSC::Scope::shadowsArguments):
      (JSC::Scope::copyCapturedVariablesToVector):
      (JSC::Scope::saveFunctionInfo):
      (JSC::Scope::restoreFunctionInfo):
      (JSC::ScopeRef::ScopeRef):
      (JSC::ScopeRef::operator->):
      (JSC::ScopeRef::index):
      (JSC::ScopeRef::hasContainingScope):
      (JSC::ScopeRef::containingScope):
      (JSC::Parser::AllowInOverride::AllowInOverride):
      (JSC::Parser::AllowInOverride::~AllowInOverride):
      (JSC::Parser::AutoPopScopeRef::AutoPopScopeRef):
      (JSC::Parser::AutoPopScopeRef::~AutoPopScopeRef):
      (JSC::Parser::AutoPopScopeRef::setPopped):
      (JSC::Parser::currentScope):
      (JSC::Parser::pushScope):
      (JSC::Parser::popScopeInternal):
      (JSC::Parser::popScope):
      (JSC::Parser::declareVariable):
      (JSC::Parser::declareWrite):
      (JSC::Parser::findCachedFunctionInfo):
      (JSC::Parser::isFunctionBodyNode):
      (JSC::Parser::next):
      (JSC::Parser::nextExpectIdentifier):
      (JSC::Parser::nextTokenIsColon):
      (JSC::Parser::consume):
      (JSC::Parser::getToken):
      (JSC::Parser::match):
      (JSC::Parser::tokenStart):
      (JSC::Parser::tokenLine):
      (JSC::Parser::tokenEnd):
      (JSC::Parser::getTokenName):
      (JSC::Parser::updateErrorMessageSpecialCase):
      (JSC::Parser::updateErrorMessage):
      (JSC::Parser::updateErrorWithNameAndMessage):
      (JSC::Parser::startLoop):
      (JSC::Parser::endLoop):
      (JSC::Parser::startSwitch):
      (JSC::Parser::endSwitch):
      (JSC::Parser::setStrictMode):
      (JSC::Parser::strictMode):
      (JSC::Parser::isValidStrictMode):
      (JSC::Parser::declareParameter):
      (JSC::Parser::breakIsValid):
      (JSC::Parser::continueIsValid):
      (JSC::Parser::pushLabel):
      (JSC::Parser::popLabel):
      (JSC::Parser::getLabel):
      (JSC::Parser::autoSemiColon):
      (JSC::Parser::canRecurse):
      (JSC::Parser::lastTokenEnd):
      (JSC::Parser::DepthManager::DepthManager):
      (JSC::Parser::DepthManager::~DepthManager):
      (JSC::Parser::parse):
      (JSC::parse):
      * parser/ParserTokens.h: Added.
      (JSC::JSTokenInfo::JSTokenInfo):
      * parser/SourceCode.h:
      (JSC::SourceCode::subExpression):
      * parser/SourceProviderCacheItem.h:
      * parser/SyntaxChecker.h:
      (JSC::SyntaxChecker::SyntaxChecker):
      (JSC::SyntaxChecker::makeFunctionCallNode):
      (JSC::SyntaxChecker::createCommaExpr):
      (JSC::SyntaxChecker::makeAssignNode):
      (JSC::SyntaxChecker::makePrefixNode):
      (JSC::SyntaxChecker::makePostfixNode):
      (JSC::SyntaxChecker::makeTypeOfNode):
      (JSC::SyntaxChecker::makeDeleteNode):
      (JSC::SyntaxChecker::makeNegateNode):
      (JSC::SyntaxChecker::makeBitwiseNotNode):
      (JSC::SyntaxChecker::createLogicalNot):
      (JSC::SyntaxChecker::createUnaryPlus):
      (JSC::SyntaxChecker::createVoid):
      (JSC::SyntaxChecker::thisExpr):
      (JSC::SyntaxChecker::createResolve):
      (JSC::SyntaxChecker::createObjectLiteral):
      (JSC::SyntaxChecker::createArray):
      (JSC::SyntaxChecker::createNumberExpr):
      (JSC::SyntaxChecker::createString):
      (JSC::SyntaxChecker::createBoolean):
      (JSC::SyntaxChecker::createNull):
      (JSC::SyntaxChecker::createBracketAccess):
      (JSC::SyntaxChecker::createDotAccess):
      (JSC::SyntaxChecker::createRegExp):
      (JSC::SyntaxChecker::createNewExpr):
      (JSC::SyntaxChecker::createConditionalExpr):
      (JSC::SyntaxChecker::createAssignResolve):
      (JSC::SyntaxChecker::createFunctionExpr):
      (JSC::SyntaxChecker::createFunctionBody):
      (JSC::SyntaxChecker::createArguments):
      (JSC::SyntaxChecker::createArgumentsList):
      (JSC::SyntaxChecker::createProperty):
      (JSC::SyntaxChecker::createPropertyList):
      (JSC::SyntaxChecker::createFuncDeclStatement):
      (JSC::SyntaxChecker::createBlockStatement):
      (JSC::SyntaxChecker::createExprStatement):
      (JSC::SyntaxChecker::createIfStatement):
      (JSC::SyntaxChecker::createForLoop):
      (JSC::SyntaxChecker::createForInLoop):
      (JSC::SyntaxChecker::createEmptyStatement):
      (JSC::SyntaxChecker::createVarStatement):
      (JSC::SyntaxChecker::createReturnStatement):
      (JSC::SyntaxChecker::createBreakStatement):
      (JSC::SyntaxChecker::createContinueStatement):
      (JSC::SyntaxChecker::createTryStatement):
      (JSC::SyntaxChecker::createSwitchStatement):
      (JSC::SyntaxChecker::createWhileStatement):
      (JSC::SyntaxChecker::createWithStatement):
      (JSC::SyntaxChecker::createDoWhileStatement):
      (JSC::SyntaxChecker::createLabelStatement):
      (JSC::SyntaxChecker::createThrowStatement):
      (JSC::SyntaxChecker::createDebugger):
      (JSC::SyntaxChecker::createConstStatement):
      (JSC::SyntaxChecker::appendConstDecl):
      (JSC::SyntaxChecker::createGetterOrSetterProperty):
      (JSC::SyntaxChecker::combineCommaNodes):
      (JSC::SyntaxChecker::operatorStackPop):
      * runtime/Executable.cpp:
      (JSC::EvalExecutable::compileInternal):
      (JSC::ProgramExecutable::checkSyntax):
      (JSC::ProgramExecutable::compileInternal):
      (JSC::FunctionExecutable::produceCodeBlockFor):
      (JSC::FunctionExecutable::fromGlobalCode):
      * runtime/JSGlobalData.cpp:
      (JSC::JSGlobalData::JSGlobalData):
      (JSC::JSGlobalData::~JSGlobalData):
      * runtime/JSGlobalData.h:
      * runtime/LiteralParser.cpp:
      (JSC::LiteralParser::tryJSONPParse):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@98887 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2e5003e8
  23. 21 Oct, 2011 2 commits
    • fpizlo@apple.com's avatar
      DFG should have inlining · d9ded3b5
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=69996
      
      Reviewed by Oliver Hunt.
              
      Implements inlining that's hooked into the bytecode parser. Only
      works for calls, for now, though nothing fundamentally prevents us
      from inlining constructor calls. 2% overall speed-up on all
      benchmarks. 7% speed-up on V8 (around 34% and 27% on deltablue and
      richards respectively), neutral on Kraken and SunSpider. 
              
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::visitAggregate):
      * bytecode/CodeBlock.h:
      (JSC::CodeBlock::baselineVersion):
      (JSC::CodeBlock::setInstructionCount):
      (JSC::CodeBlock::likelyToTakeSlowCase):
      (JSC::CodeBlock::couldTakeSlowCase):
      (JSC::CodeBlock::likelyToTakeSpecialFastCase):
      (JSC::CodeBlock::likelyToTakeDeepestSlowCase):
      (JSC::CodeBlock::likelyToTakeAnySlowCase):
      * bytecode/CodeOrigin.h:
      (JSC::CodeOrigin::inlineDepthForCallFrame):
      (JSC::CodeOrigin::inlineDepth):
      (JSC::CodeOrigin::operator==):
      (JSC::CodeOrigin::inlineStack):
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::generate):
      * dfg/DFGAbstractState.cpp:
      (JSC::DFG::AbstractState::beginBasicBlock):
      (JSC::DFG::AbstractState::execute):
      (JSC::DFG::AbstractState::mergeStateAtTail):
      * dfg/DFGBasicBlock.h:
      (JSC::DFG::BasicBlock::BasicBlock):
      (JSC::DFG::BasicBlock::ensureLocals):
      (JSC::DFG::UnlinkedBlock::UnlinkedBlock):
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::ByteCodeParser):
      (JSC::DFG::ByteCodeParser::getDirect):
      (JSC::DFG::ByteCodeParser::get):
      (JSC::DFG::ByteCodeParser::setDirect):
      (JSC::DFG::ByteCodeParser::set):
      (JSC::DFG::ByteCodeParser::getLocal):
      (JSC::DFG::ByteCodeParser::getArgument):
      (JSC::DFG::ByteCodeParser::flush):
      (JSC::DFG::ByteCodeParser::InlineStackEntry::~InlineStackEntry):
      (JSC::DFG::ByteCodeParser::InlineStackEntry::remapOperand):
      (JSC::DFG::ByteCodeParser::handleInlining):
      (JSC::DFG::ByteCodeParser::parseBlock):
      (JSC::DFG::ByteCodeParser::processPhiStack):
      (JSC::DFG::ByteCodeParser::linkBlock):
      (JSC::DFG::ByteCodeParser::linkBlocks):
      (JSC::DFG::ByteCodeParser::handleSuccessor):
      (JSC::DFG::ByteCodeParser::determineReachability):
      (JSC::DFG::ByteCodeParser::buildOperandMapsIfNecessary):
      (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
      (JSC::DFG::ByteCodeParser::parseCodeBlock):
      (JSC::DFG::ByteCodeParser::parse):
      * dfg/DFGCapabilities.cpp:
      (JSC::DFG::canHandleOpcodes):
      (JSC::DFG::canCompileOpcodes):
      (JSC::DFG::canInlineOpcodes):
      * dfg/DFGCapabilities.h:
      (JSC::DFG::mightCompileEval):
      (JSC::DFG::mightCompileProgram):
      (JSC::DFG::mightCompileFunctionForCall):
      (JSC::DFG::mightCompileFunctionForConstruct):
      (JSC::DFG::mightInlineFunctionForCall):
      (JSC::DFG::mightInlineFunctionForConstruct):
      (JSC::DFG::canInlineOpcode):
      (JSC::DFG::canInlineOpcodes):
      (JSC::DFG::canInlineFunctionForCall):
      (JSC::DFG::canInlineFunctionForConstruct):
      * dfg/DFGGraph.cpp:
      (JSC::DFG::printWhiteSpace):
      (JSC::DFG::Graph::dumpCodeOrigin):
      (JSC::DFG::Graph::dump):
      * dfg/DFGGraph.h:
      (JSC::DFG::GetBytecodeBeginForBlock::operator()):
      (JSC::DFG::Graph::blockIndexForBytecodeOffset):
      * dfg/DFGJITCompiler.cpp:
      (JSC::DFG::JITCompiler::decodedCodeMapFor):
      (JSC::DFG::JITCompiler::linkOSRExits):
      (JSC::DFG::JITCompiler::exitSpeculativeWithOSR):
      * dfg/DFGJITCompiler.h:
      (JSC::DFG::JITCompiler::debugCall):
      (JSC::DFG::JITCompiler::baselineCodeBlockFor):
      * dfg/DFGJITCompiler32_64.cpp:
      (JSC::DFG::JITCompiler::exitSpeculativeWithOSR):
      * dfg/DFGNode.h:
      (JSC::DFG::Node::hasVariableAccessData):
      (JSC::DFG::Node::shouldGenerate):
      * dfg/DFGOperands.h:
      (JSC::DFG::Operands::ensureLocals):
      (JSC::DFG::Operands::setLocal):
      (JSC::DFG::Operands::getLocal):
      * dfg/DFGPropagator.cpp:
      (JSC::DFG::Propagator::propagateNodePredictions):
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::OSRExit::OSRExit):
      (JSC::DFG::SpeculativeJIT::compile):
      (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
      * dfg/DFGSpeculativeJIT.h:
      (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
      * dfg/DFGSpeculativeJIT32_64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * interpreter/CallFrame.cpp:
      (JSC::CallFrame::trueCallerFrameSlow):
      * jit/JITCall.cpp:
      (JSC::JIT::compileOpCallSlowCase):
      * jit/JITStubs.cpp:
      (JSC::DEFINE_STUB_FUNCTION):
      * runtime/Executable.cpp:
      (JSC::FunctionExecutable::baselineCodeBlockFor):
      (JSC::FunctionExecutable::produceCodeBlockFor):
      (JSC::FunctionExecutable::compileForCallInternal):
      (JSC::FunctionExecutable::compileForConstructInternal):
      * runtime/Executable.h:
      (JSC::FunctionExecutable::profiledCodeBlockFor):
      (JSC::FunctionExecutable::parameterCount):
      * runtime/Heuristics.cpp:
      (JSC::Heuristics::initializeHeuristics):
      * runtime/Heuristics.h:
      * runtime/JSFunction.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@98179 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d9ded3b5
    • fpizlo@apple.com's avatar
      DFG should not try to predict argument types by looking at the values of · 43a2fe75
      fpizlo@apple.com authored
      argument registers at the time of compilation
      https://bugs.webkit.org/show_bug.cgi?id=70578
      
      Reviewed by Oliver Hunt.
      
      * bytecode/CodeBlock.cpp:
      * dfg/DFGDriver.cpp:
      (JSC::DFG::compile):
      (JSC::DFG::tryCompile):
      (JSC::DFG::tryCompileFunction):
      * dfg/DFGDriver.h:
      (JSC::DFG::tryCompileFunction):
      * dfg/DFGGraph.cpp:
      (JSC::DFG::Graph::predictArgumentTypes):
      * dfg/DFGGraph.h:
      * runtime/Executable.cpp:
      (JSC::FunctionExecutable::compileOptimizedForCall):
      (JSC::FunctionExecutable::compileOptimizedForConstruct):
      (JSC::FunctionExecutable::compileForCallInternal):
      (JSC::FunctionExecutable::compileForConstructInternal):
      * runtime/Executable.h:
      (JSC::FunctionExecutable::compileForCall):
      (JSC::FunctionExecutable::compileForConstruct):
      (JSC::FunctionExecutable::compileFor):
      (JSC::FunctionExecutable::compileOptimizedFor):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@98082 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      43a2fe75
  24. 17 Oct, 2011 1 commit
  25. 15 Oct, 2011 1 commit
    • fpizlo@apple.com's avatar
      FunctionExecutable should expose the ability to create unattached FunctionCodeBlocks · 67fa6e4e
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=70157
      
      Reviewed by Geoff Garen.
              
      Added FunctionExecutable::produceCodeBlockFor() and rewired compileForCallInternal()
      and compileForConstructInternal() to use this method. This required more cleanly
      exposing some of CodeBlock's tiering functionality and moving the CompilationKind
      enum to Executable.h, as this was the easiest way to make it available to the
      declarations/definitions of CodeBlock, FunctionExecutable, and BytecodeGenerator.
      
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::copyDataFrom):
      (JSC::CodeBlock::copyDataFromAlternative):
      * bytecode/CodeBlock.h:
      (JSC::CodeBlock::setAlternative):
      * bytecompiler/BytecodeGenerator.h:
      * runtime/Executable.cpp:
      (JSC::EvalExecutable::compileInternal):
      (JSC::ProgramExecutable::compileInternal):
      (JSC::FunctionExecutable::produceCodeBlockFor):
      (JSC::FunctionExecutable::compileForCallInternal):
      (JSC::FunctionExecutable::compileForConstructInternal):
      * runtime/Executable.h:
      (JSC::FunctionExecutable::codeBlockFor):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      67fa6e4e
  26. 05 Oct, 2011 1 commit
    • ggaren@apple.com's avatar
      Added a simpler mechanism for registering one-off finalizers · 75bf76c6
      ggaren@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=69466
      
      Reviewed by Oliver Hunt.
      
      * heap/Heap.cpp:
      (JSC::Heap::addFinalizer):
      (JSC::Heap::FinalizerOwner::finalize):
      * heap/Heap.h: New function for adding an arbitrary finalizer for an
      arbitrary cell without declaring any special classes or Handles yourself.
      
      * JavaScriptCore.exp: Fix build.
      
      * runtime/Executable.cpp:
      (JSC::ExecutableBase::clearCode):
      (JSC::ExecutableBase::clearCodeVirtual):
      (JSC::EvalExecutable::clearCodeVirtual):
      (JSC::ProgramExecutable::clearCodeVirtual):
      (JSC::FunctionExecutable::discardCode):
      (JSC::FunctionExecutable::clearCodeVirtual):
      * runtime/Executable.h:
      (JSC::ExecutableBase::finishCreation): Use the new mechanism for eager
      finalization of executables.
      
      * runtime/JSGlobalObject.cpp:
      (JSC::JSGlobalObject::clearRareData):
      * runtime/JSGlobalObject.h:
      (JSC::JSGlobalObject::createRareDataIfNeeded):
      (JSC::JSGlobalObject::registerWeakMap): Use the new mechanism for eager
      finalization of weak maps.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96760 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      75bf76c6
  27. 29 Sep, 2011 1 commit
    • mhahnenberg@apple.com's avatar
      De-virtualize JSCell::visitChildrenVirtual and remove all other visitChildrenVirtual methods · 8687da90
      mhahnenberg@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=68839
      
      Reviewed by Geoffrey Garen.
      
      Source/JavaScriptCore:
      
      Removed the remaining visitChildrenVirtual methods.  This patch completes the process of
      de-virtualizing visitChildren.
      
      * API/JSCallbackObject.h:
      * JavaScriptCore.exp:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
      * debugger/DebuggerActivation.cpp:
      * debugger/DebuggerActivation.h:
      * runtime/Arguments.cpp:
      * runtime/Arguments.h:
      * runtime/Executable.cpp:
      * runtime/Executable.h:
      * runtime/GetterSetter.cpp:
      * runtime/GetterSetter.h:
      * runtime/JSActivation.cpp:
      * runtime/JSActivation.h:
      * runtime/JSArray.cpp:
      * runtime/JSArray.h:
      * runtime/JSFunction.cpp:
      * runtime/JSFunction.h:
      * runtime/JSGlobalObject.cpp:
      * runtime/JSGlobalObject.h:
      * runtime/JSObject.cpp:
      * runtime/JSPropertyNameIterator.cpp:
      * runtime/JSPropertyNameIterator.h:
      * runtime/JSStaticScopeObject.cpp:
      * runtime/JSStaticScopeObject.h:
      * runtime/JSValue.h:
      * runtime/NativeErrorConstructor.cpp:
      * runtime/NativeErrorConstructor.h:
      * runtime/RegExpObject.cpp:
      * runtime/RegExpObject.h:
      * runtime/Structure.cpp:
      * runtime/Structure.h:
      * runtime/StructureChain.cpp:
      * runtime/StructureChain.h:
      
      Inlined the method table access and call to the visitChildren function (the only call sites
      to visitChildren are here).
      * heap/MarkStack.cpp:
      (JSC::SlotVisitor::visitChildren):
      
      Changed the field name for the visitChildren function pointer to visitChildren (from
      visitChildrenFunctionPtr) to make call sites less verbose.
      * runtime/ClassInfo.h:
      
      Discovered JSBoundFunction doesn't have its own ClassInfo (it used JSFunction's ClassInfo) but
      overrides visitChildren, so it needs to have its own ClassInfo.
      * runtime/JSBoundFunction.cpp:
      * runtime/JSBoundFunction.h:
      
      Had to move className up to make sure that the virtual destructor in JSObject wasn't
      the first non-inline virtual method in JSObject (as per the comment in the file).
      Also moved JSCell::visitChildrenVirtual into JSObject.h in order for it be inline-able
      to mitigate the cost of an extra method call.
      
      Also added a convenience accessor function methodTable() to JSCell to return the MethodTable to make
      call sites more concise.  Implementation is inline in JSObject.h.
      * runtime/JSObject.h:
      (JSC::JSCell::methodTable):
      * runtime/JSCell.h:
      
      Added an out of line virtual destructor to JSWrapperObject and ScopeChainNode to
      appease the vtable gods.  It refused to compile if there were no virtual methods in
      both of these classes due to the presence of a weak vtable pointer.
      * runtime/JSWrapperObject.cpp:
      (JSC::JSWrapperObject::~JSWrapperObject):
      * runtime/JSWrapperObject.h:
      * runtime/ScopeChain.cpp:
      (JSC::ScopeChainNode::~ScopeChainNode):
      * runtime/ScopeChain.h:
      
      Source/JavaScriptGlue:
      
      Removed the remaining visitChildrenVirtual methods.  This patch completes the process of
      de-virtualizing visitChildren.
      
      * UserObjectImp.cpp:
      * UserObjectImp.h:
      
      Source/WebCore:
      
      No new tests.
      
      Removed the remaining visitChildrenVirtual methods.  This patch completes the process of
      de-virtualizing visitChildren.
      
      * WebCore.exp.in:
      * bindings/js/JSAttrCustom.cpp:
      * bindings/js/JSAudioContextCustom.cpp:
      * bindings/js/JSCSSRuleCustom.cpp:
      * bindings/js/JSCSSStyleDeclarationCustom.cpp:
      * bindings/js/JSCanvasRenderingContextCustom.cpp:
      * bindings/js/JSDOMGlobalObject.cpp:
      (WebCore::JSDOMGlobalObject::~JSDOMGlobalObject):
      (WebCore::JSDOMGlobalObject::finishCreation):
      * bindings/js/JSDOMGlobalObject.h:
      * bindings/js/JSDOMWindowCustom.cpp:
      * bindings/js/JSDOMWindowShell.cpp:
      * bindings/js/JSDOMWindowShell.h:
      * bindings/js/JSJavaScriptAudioNodeCustom.cpp:
      * bindings/js/JSMessageChannelCustom.cpp:
      * bindings/js/JSMessagePortCustom.cpp:
      * bindings/js/JSNamedNodeMapCustom.cpp:
      * bindings/js/JSNodeCustom.cpp:
      * bindings/js/JSNodeFilterCustom.cpp:
      * bindings/js/JSNodeIteratorCustom.cpp:
      * bindings/js/JSSVGElementInstanceCustom.cpp:
      * bindings/js/JSSharedWorkerCustom.cpp:
      * bindings/js/JSStyleSheetCustom.cpp:
      * bindings/js/JSTreeWalkerCustom.cpp:
      * bindings/js/JSWebGLRenderingContextCustom.cpp:
      * bindings/js/JSWorkerContextCustom.cpp:
      * bindings/js/JSXMLHttpRequestCustom.cpp:
      * bindings/js/JSXPathResultCustom.cpp:
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateHeader):
      (GenerateImplementation):
      * bridge/qt/qt_instance.cpp:
      * bridge/qt/qt_runtime.cpp:
      * bridge/qt/qt_runtime.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96346 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8687da90
  28. 26 Sep, 2011 1 commit
    • mhahnenberg@apple.com's avatar
      Add custom vtable struct to ClassInfo struct · 3e084662
      mhahnenberg@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=68567
      
      Reviewed by Oliver Hunt.
      
      Source/JavaScriptCore:
      
      Declared/defined the MethodTable struct and added it to the ClassInfo struct.
      Also defined the CREATE_METHOD_TABLE macro to generate these method tables
      succinctly where they need to be defined.
      
      Also added to it the first function to use this macro, visitChildren.
      
      This is part of the process of getting rid of all C++ virtual methods in JSCell.
      Eventually all virtual functions in JSCell that can't easily be converted to
      non-virtual functions will be put into this custom vtable structure.
      * runtime/ClassInfo.h:
      
      Added the CREATE_METHOD_TABLE macro call as the last argument to each of the
      ClassInfo structs declared in these classes.  This saves us from having to visit
      each s_info definition in the future when we add more methods to the MethodTable.
      * API/JSCallbackConstructor.cpp:
      * API/JSCallbackFunction.cpp:
      * API/JSCallbackObject.cpp:
      * JavaScriptCore.exp:
      * runtime/Arguments.cpp:
      * runtime/ArrayConstructor.cpp:
      * runtime/ArrayPrototype.cpp:
      * runtime/BooleanObject.cpp:
      * runtime/BooleanPrototype.cpp:
      * runtime/DateConstructor.cpp:
      * runtime/DateInstance.cpp:
      * runtime/DatePrototype.cpp:
      * runtime/ErrorInstance.cpp:
      * runtime/ErrorPrototype.cpp:
      * runtime/ExceptionHelpers.cpp:
      * runtime/Executable.cpp:
      * runtime/GetterSetter.cpp:
      * runtime/InternalFunction.cpp:
      * runtime/JSAPIValueWrapper.cpp:
      * runtime/JSActivation.cpp:
      * runtime/JSArray.cpp:
      * runtime/JSByteArray.cpp:
      * runtime/JSFunction.cpp:
      * runtime/JSGlobalObject.cpp:
      * runtime/JSONObject.cpp:
      * runtime/JSObject.cpp:
      * runtime/JSPropertyNameIterator.cpp:
      * runtime/JSString.cpp:
      * runtime/MathObject.cpp:
      * runtime/NativeErrorConstructor.cpp:
      * runtime/NumberConstructor.cpp:
      * runtime/NumberObject.cpp:
      * runtime/NumberPrototype.cpp:
      * runtime/ObjectConstructor.cpp:
      * runtime/ObjectPrototype.cpp:
      * runtime/RegExp.cpp:
      * runtime/RegExpConstructor.cpp:
      * runtime/RegExpObject.cpp:
      * runtime/RegExpPrototype.cpp:
      * runtime/ScopeChain.cpp:
      * runtime/StringConstructor.cpp:
      * runtime/StringObject.cpp:
      * runtime/StringPrototype.cpp:
      * runtime/Structure.cpp:
      * runtime/StructureChain.cpp:
      
      Had to make visitChildren and visitChildrenVirtual protected instead of private
      because some of the subclasses of JSWrapperObject need access to JSWrapperObject's
      visitChildren function pointer in their vtable since they don't provide their own
      implementation. Same for RegExpObject.
      * runtime/JSWrapperObject.h:
      * runtime/RegExpObject.h:
      
      Source/JavaScriptGlue:
      
      Added CREATE_METHOD_TABLE macro to generate the custom vtable for the
      specified class in its ClassInfo.  Also added to it the first function to use
      this macro, visitChildren.  This is part of the process of getting rid of all
      C++ virtual methods in JSCell.  Eventually all virtual functions in JSCell
      that can't easily be converted to non-virtual functions will be put into
      this custom vtable structure.
      
      * UserObjectImp.cpp:
      
      Source/WebCore:
      
      No new tests.
      
      Added CREATE_METHOD_TABLE macro to generate the custom vtable for the
      specified class in its ClassInfo.  Also added to it the first function to use
      this macro, visitChildren.  This is part of the process of getting rid of all
      C++ virtual methods in JSCell.  Eventually all virtual functions in JSCell
      that can't easily be converted to non-virtual functions will be put into
      this custom vtable structure.
      
      * bindings/js/JSAudioConstructor.cpp:
      * bindings/js/JSDOMGlobalObject.cpp:
      * bindings/js/JSDOMWindowBase.cpp:
      * bindings/js/JSDOMWindowShell.cpp:
      * bindings/js/JSImageConstructor.cpp:
      * bindings/js/JSImageDataCustom.cpp:
      (WebCore::toJS):
      * bindings/js/JSOptionConstructor.cpp:
      * bindings/js/JSWorkerContextBase.cpp:
      
      Changed the bindings generator to add the call to the CREATE_METHOD_TABLE macro where
      necessary.
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateImplementation):
      (GenerateConstructorDefinition):
      * bindings/scripts/test/JS/JSTestInterface.cpp:
      * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
      * bindings/scripts/test/JS/JSTestObj.cpp:
      * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
      * bridge/c/CRuntimeObject.cpp:
      * bridge/c/c_instance.cpp:
      * bridge/jni/jsc/JavaInstanceJSC.cpp:
      * bridge/jni/jsc/JavaRuntimeObject.cpp:
      * bridge/objc/ObjCRuntimeObject.mm:
      * bridge/objc/objc_instance.mm:
      * bridge/objc/objc_runtime.mm:
      * bridge/qt/qt_instance.cpp:
      * bridge/qt/qt_pixmapruntime.cpp:
      * bridge/qt/qt_runtime.cpp:
      * bridge/runtime_array.cpp:
      * bridge/runtime_method.cpp:
      * bridge/runtime_object.cpp:
      
      Source/WebKit/mac:
      
      Added CREATE_METHOD_TABLE macro to generate the custom vtable for the
      specified class in its ClassInfo.  Also added to it the first function to use
      this macro, visitChildren.  This is part of the process of getting rid of all
      C++ virtual methods in JSCell.  Eventually all virtual functions in JSCell
      that can't easily be converted to non-virtual functions will be put into
      this custom vtable structure.
      
      * Plugins/Hosted/ProxyInstance.mm:
      * Plugins/Hosted/ProxyRuntimeObject.mm:
      
      Source/WebKit2:
      
      Added CREATE_METHOD_TABLE macro to generate the custom vtable for the
      specified class in its ClassInfo.  Also added to it the first function to use
      this macro, visitChildren.  This is part of the process of getting rid of all
      C++ virtual methods in JSCell.  Eventually all virtual functions in JSCell
      that can't easily be converted to non-virtual functions will be put into
      this custom vtable structure.
      
      * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
      * WebProcess/Plugins/Netscape/JSNPObject.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3e084662
  29. 23 Sep, 2011 1 commit
    • mhahnenberg@apple.com's avatar
      Add static version of JSCell::visitChildren · 982c9ea2
      mhahnenberg@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=68404
      
      Reviewed by Darin Adler.
      
      .: 
      
      In this patch we just extract the bodies of the virtual visitChildren methods
      throughout the JSCell inheritance hierarchy out into static methods, which are 
      now called from the virtual methods.  This is an intermediate step in trying to 
      move the virtual-ness of visitChildren into our own custom vtable stored in 
      ClassInfo.  We need to convert the methods to static methods in order to be 
      able to more easily store and refer to them in our custom vtable since normal 
      member methods store some implicit information in their types, making it 
      impossible to store them generically in ClassInfo.
      
      * Source/autotools/symbols.filter:
      
      Source/JavaScriptCore: 
      
      In this patch we just extract the bodies of the virtual visitChildren methods
      throughout the JSCell inheritance hierarchy out into static methods, which are 
      now called from the virtual methods.  This is an intermediate step in trying to 
      move the virtual-ness of visitChildren into our own custom vtable stored in 
      ClassInfo.  We need to convert the methods to static methods in order to be 
      able to more easily store and refer to them in our custom vtable since normal 
      member methods store some implicit information in their types, making it 
      impossible to store them generically in ClassInfo.
      
      * API/JSCallbackObject.h:
      (JSC::JSCallbackObject::visitChildrenVirtual):
      (JSC::JSCallbackObject::visitChildren):
      * JavaScriptCore.exp:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
      * debugger/DebuggerActivation.cpp:
      (JSC::DebuggerActivation::visitChildrenVirtual):
      (JSC::DebuggerActivation::visitChildren):
      * debugger/DebuggerActivation.h:
      * heap/MarkStack.cpp:
      (JSC::SlotVisitor::visitChildren):
      (JSC::SlotVisitor::drain):
      * runtime/Arguments.cpp:
      (JSC::Arguments::visitChildrenVirtual):
      (JSC::Arguments::visitChildren):
      * runtime/Arguments.h:
      * runtime/Executable.cpp:
      (JSC::EvalExecutable::visitChildrenVirtual):
      (JSC::EvalExecutable::visitChildren):
      (JSC::ProgramExecutable::visitChildrenVirtual):
      (JSC::ProgramExecutable::visitChildren):
      (JSC::FunctionExecutable::visitChildrenVirtual):
      (JSC::FunctionExecutable::visitChildren):
      * runtime/Executable.h:
      * runtime/GetterSetter.cpp:
      (JSC::GetterSetter::visitChildrenVirtual):
      (JSC::GetterSetter::visitChildren):
      * runtime/GetterSetter.h:
      * runtime/JSActivation.cpp:
      (JSC::JSActivation::visitChildrenVirtual):
      (JSC::JSActivation::visitChildren):
      * runtime/JSActivation.h:
      * runtime/JSArray.cpp:
      (JSC::JSArray::visitChildrenVirtual):
      (JSC::JSArray::visitChildren):
      * runtime/JSArray.h:
      * runtime/JSBoundFunction.cpp:
      (JSC::JSBoundFunction::visitChildrenVirtual):
      (JSC::JSBoundFunction::visitChildren):
      * runtime/JSBoundFunction.h:
      * runtime/JSCell.h:
      (JSC::JSCell::visitChildrenVirtual):
      (JSC::JSCell::visitChildren):
      * runtime/JSFunction.cpp:
      (JSC::JSFunction::visitChildrenVirtual):
      (JSC::JSFunction::visitChildren):
      * runtime/JSFunction.h:
      * runtime/JSGlobalObject.cpp:
      (JSC::JSGlobalObject::visitChildrenVirtual):
      (JSC::JSGlobalObject::visitChildren):
      * runtime/JSGlobalObject.h:
      * runtime/JSObject.cpp:
      (JSC::JSObject::visitChildrenVirtual):
      (JSC::JSObject::visitChildren):
      * runtime/JSObject.h:
      (JSC::JSObject::visitChildrenDirect):
      * runtime/JSPropertyNameIterator.cpp:
      (JSC::JSPropertyNameIterator::visitChildrenVirtual):
      (JSC::JSPropertyNameIterator::visitChildren):
      * runtime/JSPropertyNameIterator.h:
      * runtime/JSStaticScopeObject.cpp:
      (JSC::JSStaticScopeObject::visitChildrenVirtual):
      (JSC::JSStaticScopeObject::visitChildren):
      * runtime/JSStaticScopeObject.h:
      * runtime/JSWrapperObject.cpp:
      (JSC::JSWrapperObject::visitChildrenVirtual):
      (JSC::JSWrapperObject::visitChildren):
      * runtime/JSWrapperObject.h:
      * runtime/NativeErrorConstructor.cpp:
      (JSC::NativeErrorConstructor::visitChildrenVirtual):
      (JSC::NativeErrorConstructor::visitChildren):
      * runtime/NativeErrorConstructor.h:
      * runtime/RegExpObject.cpp:
      (JSC::RegExpObject::visitChildrenVirtual):
      (JSC::RegExpObject::visitChildren):
      * runtime/RegExpObject.h:
      * runtime/ScopeChain.cpp:
      (JSC::ScopeChainNode::visitChildrenVirtual):
      (JSC::ScopeChainNode::visitChildren):
      * runtime/ScopeChain.h:
      * runtime/Structure.cpp:
      (JSC::Structure::visitChildrenVirtual):
      (JSC::Structure::visitChildren):
      * runtime/Structure.h:
      * runtime/StructureChain.cpp:
      (JSC::StructureChain::visitChildrenVirtual):
      (JSC::StructureChain::visitChildren):
      * runtime/StructureChain.h:
      
      Source/JavaScriptGlue: 
      
      In this patch we just extract the bodies of the virtual visitChildren methods
      throughout the JSCell inheritance hierarchy out into static methods, which are 
      now called from the virtual methods.  This is an intermediate step in trying to 
      move the virtual-ness of visitChildren into our own custom vtable stored in 
      ClassInfo.  We need to convert the methods to static methods in order to be 
      able to more easily store and refer to them in our custom vtable since normal 
      member methods store some implicit information in their types, making it 
      impossible to store them generically in ClassInfo.
      
      * UserObjectImp.cpp:
      (UserObjectImp::visitChildrenVirtual):
      (UserObjectImp::visitChildren):
      * UserObjectImp.h:
      
      Source/WebCore: 
      
      No new tests.
      
      In this patch we just extract the bodies of the virtual visitChildren methods
      throughout the JSCell inheritance hierarchy out into static methods, which are 
      now called from the virtual methods.  This is an intermediate step in trying to 
      move the virtual-ness of visitChildren into our own custom vtable stored in 
      ClassInfo.  We need to convert the methods to static methods in order to be 
      able to more easily store and refer to them in our custom vtable since normal 
      member methods store some implicit information in their types, making it 
      impossible to store them generically in ClassInfo.
      
      * WebCore.exp.in:
      * bindings/js/JSAttrCustom.cpp:
      (WebCore::JSAttr::visitChildrenVirtual):
      (WebCore::JSAttr::visitChildren):
      * bindings/js/JSAudioContextCustom.cpp:
      (WebCore::JSAudioContext::visitChildrenVirtual):
      (WebCore::JSAudioContext::visitChildren):
      * bindings/js/JSCSSRuleCustom.cpp:
      (WebCore::JSCSSRule::visitChildrenVirtual):
      (WebCore::JSCSSRule::visitChildren):
      * bindings/js/JSCSSStyleDeclarationCustom.cpp:
      (WebCore::JSCSSStyleDeclaration::visitChildrenVirtual):
      (WebCore::JSCSSStyleDeclaration::visitChildren):
      * bindings/js/JSCanvasRenderingContextCustom.cpp:
      (WebCore::JSCanvasRenderingContext::visitChildrenVirtual):
      (WebCore::JSCanvasRenderingContext::visitChildren):
      * bindings/js/JSDOMGlobalObject.cpp:
      (WebCore::JSDOMGlobalObject::visitChildrenVirtual):
      (WebCore::JSDOMGlobalObject::visitChildren):
      * bindings/js/JSDOMGlobalObject.h:
      * bindings/js/JSDOMWindowCustom.cpp:
      (WebCore::JSDOMWindow::visitChildrenVirtual):
      (WebCore::JSDOMWindow::visitChildren):
      * bindings/js/JSDOMWindowShell.cpp:
      (WebCore::JSDOMWindowShell::visitChildrenVirtual):
      (WebCore::JSDOMWindowShell::visitChildren):
      * bindings/js/JSDOMWindowShell.h:
      * bindings/js/JSJavaScriptAudioNodeCustom.cpp:
      (WebCore::JSJavaScriptAudioNode::visitChildrenVirtual):
      (WebCore::JSJavaScriptAudioNode::visitChildren):
      * bindings/js/JSMessageChannelCustom.cpp:
      (WebCore::JSMessageChannel::visitChildrenVirtual):
      (WebCore::JSMessageChannel::visitChildren):
      * bindings/js/JSMessagePortCustom.cpp:
      (WebCore::JSMessagePort::visitChildrenVirtual):
      (WebCore::JSMessagePort::visitChildren):
      * bindings/js/JSNamedNodeMapCustom.cpp:
      (WebCore::JSNamedNodeMap::visitChildrenVirtual):
      (WebCore::JSNamedNodeMap::visitChildren):
      * bindings/js/JSNodeCustom.cpp:
      (WebCore::JSNode::visitChildrenVirtual):
      (WebCore::JSNode::visitChildren):
      * bindings/js/JSNodeFilterCustom.cpp:
      (WebCore::JSNodeFilter::visitChildrenVirtual):
      (WebCore::JSNodeFilter::visitChildren):
      * bindings/js/JSNodeIteratorCustom.cpp:
      (WebCore::JSNodeIterator::visitChildrenVirtual):
      (WebCore::JSNodeIterator::visitChildren):
      * bindings/js/JSSVGElementInstanceCustom.cpp:
      (WebCore::JSSVGElementInstance::visitChildrenVirtual):
      (WebCore::JSSVGElementInstance::visitChildren):
      * bindings/js/JSSharedWorkerCustom.cpp:
      (WebCore::JSSharedWorker::visitChildrenVirtual):
      (WebCore::JSSharedWorker::visitChildren):
      * bindings/js/JSStyleSheetCustom.cpp:
      (WebCore::JSStyleSheet::visitChildrenVirtual):
      (WebCore::JSStyleSheet::visitChildren):
      * bindings/js/JSTreeWalkerCustom.cpp:
      (WebCore::JSTreeWalker::visitChildrenVirtual):
      (WebCore::JSTreeWalker::visitChildren):
      * bindings/js/JSWebGLRenderingContextCustom.cpp:
      (WebCore::JSWebGLRenderingContext::visitChildrenVirtual):
      (WebCore::JSWebGLRenderingContext::visitChildren):
      * bindings/js/JSWorkerContextCustom.cpp:
      (WebCore::JSWorkerContext::visitChildrenVirtual):
      (WebCore::JSWorkerContext::visitChildren):
      * bindings/js/JSXMLHttpRequestCustom.cpp:
      (WebCore::JSXMLHttpRequest::visitChildrenVirtual):
      (WebCore::JSXMLHttpRequest::visitChildren):
      * bindings/js/JSXPathResultCustom.cpp:
      (WebCore::JSXPathResult::visitChildrenVirtual):
      (WebCore::JSXPathResult::visitChildren):
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateHeader):
      (GenerateImplementation):
      * bindings/scripts/test/JS/JSTestObj.cpp:
      (WebCore::JSTestObj::visitChildrenVirtual):
      (WebCore::JSTestObj::visitChildren):
      * bindings/scripts/test/JS/JSTestObj.h:
      * bridge/qt/qt_instance.cpp:
      (JSC::Bindings::QtRuntimeObject::visitChildrenVirtual):
      (JSC::Bindings::QtRuntimeObject::visitChildren):
      * bridge/qt/qt_runtime.cpp:
      (JSC::Bindings::QtRuntimeMetaMethod::visitChildrenVirtual):
      (JSC::Bindings::QtRuntimeMetaMethod::visitChildren):
      * bridge/qt/qt_runtime.h:
      * workers/WorkerContext.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95849 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      982c9ea2
  30. 22 Sep, 2011 2 commits
  31. 21 Sep, 2011 2 commits
    • fpizlo@apple.com's avatar
      DFG should support continuous optimization · 706f5f34
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=68329
      
      Reviewed by Geoffrey Garen.
              
      This adds the ability to reoptimize a code block if speculation
      failures happen frequently. 6% speed-up on Kraken, 1% slow-down
      on V8, neutral on SunSpider.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * JavaScriptCore.pro:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
      * JavaScriptCore.vcproj/WTF/WTF.vcproj:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::CodeBlock):
      (JSC::ProgramCodeBlock::jettison):
      (JSC::EvalCodeBlock::jettison):
      (JSC::FunctionCodeBlock::jettison):
      (JSC::CodeBlock::shouldOptimizeNow):
      (JSC::CodeBlock::dumpValueProfiles):
      * bytecode/CodeBlock.h:
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::getStrongPrediction):
      * dfg/DFGJITCompiler.cpp:
      (JSC::DFG::JITCompiler::exitSpeculativeWithOSR):
      (JSC::DFG::JITCompiler::compileEntry):
      (JSC::DFG::JITCompiler::compileBody):
      * dfg/DFGJITCompiler.h:
      (JSC::DFG::JITCompiler::noticeOSREntry):
      * dfg/DFGOSREntry.cpp:
      (JSC::DFG::prepareOSREntry):
      * dfg/DFGOSREntry.h:
      (JSC::DFG::getOSREntryDataBytecodeIndex):
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * heap/ConservativeRoots.cpp:
      (JSC::ConservativeRoots::ConservativeRoots):
      (JSC::ConservativeRoots::~ConservativeRoots):
      (JSC::DummyMarkHook::mark):
      (JSC::ConservativeRoots::genericAddPointer):
      (JSC::ConservativeRoots::genericAddSpan):
      (JSC::ConservativeRoots::add):
      * heap/ConservativeRoots.h:
      * heap/Heap.cpp:
      (JSC::Heap::addJettisonCodeBlock):
      (JSC::Heap::markRoots):
      * heap/Heap.h:
      * heap/JettisonedCodeBlocks.cpp: Added.
      (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks):
      (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks):
      (JSC::JettisonedCodeBlocks::addCodeBlock):
      (JSC::JettisonedCodeBlocks::clearMarks):
      (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks):
      (JSC::JettisonedCodeBlocks::traceCodeBlocks):
      * heap/JettisonedCodeBlocks.h: Added.
      (JSC::JettisonedCodeBlocks::mark):
      * interpreter/RegisterFile.cpp:
      (JSC::RegisterFile::gatherConservativeRoots):
      * interpreter/RegisterFile.h:
      * jit/JITStubs.cpp:
      (JSC::DEFINE_STUB_FUNCTION):
      * runtime/Executable.cpp:
      (JSC::jettisonCodeBlock):
      (JSC::EvalExecutable::jettisonOptimizedCode):
      (JSC::ProgramExecutable::jettisonOptimizedCode):
      (JSC::FunctionExecutable::jettisonOptimizedCodeForCall):
      (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct):
      * runtime/Executable.h:
      (JSC::FunctionExecutable::jettisonOptimizedCodeFor):
      * wtf/BitVector.h: Added.
      (WTF::BitVector::BitVector):
      (WTF::BitVector::~BitVector):
      (WTF::BitVector::operator=):
      (WTF::BitVector::size):
      (WTF::BitVector::ensureSize):
      (WTF::BitVector::resize):
      (WTF::BitVector::clearAll):
      (WTF::BitVector::get):
      (WTF::BitVector::set):
      (WTF::BitVector::clear):
      (WTF::BitVector::bitsInPointer):
      (WTF::BitVector::maxInlineBits):
      (WTF::BitVector::byteCount):
      (WTF::BitVector::makeInlineBits):
      (WTF::BitVector::OutOfLineBits::numBits):
      (WTF::BitVector::OutOfLineBits::numWords):
      (WTF::BitVector::OutOfLineBits::bits):
      (WTF::BitVector::OutOfLineBits::create):
      (WTF::BitVector::OutOfLineBits::destroy):
      (WTF::BitVector::OutOfLineBits::OutOfLineBits):
      (WTF::BitVector::isInline):
      (WTF::BitVector::outOfLineBits):
      (WTF::BitVector::resizeOutOfLine):
      (WTF::BitVector::bits):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      706f5f34
    • fpizlo@apple.com's avatar
      DFG does not support compiling functions as constructors · bb159ec2
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=68500
      
      Reviewed by Oliver Hunt.
              
      This adds support for compiling constructors to the DFG. It's a
      1% speed-up on V8, mostly due to a 6% speed-up on early-boyer.
      It's also a 13% win on access-binary-trees, but it's neutral in
      the SunSpider and Kraken averages.
      
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::parseBlock):
      * dfg/DFGCapabilities.h:
      (JSC::DFG::mightCompileFunctionForConstruct):
      (JSC::DFG::canCompileOpcode):
      * dfg/DFGNode.h:
      * dfg/DFGOperations.cpp:
      * dfg/DFGOperations.h:
      * dfg/DFGPropagator.cpp:
      (JSC::DFG::Propagator::propagateNodePredictions):
      (JSC::DFG::Propagator::performNodeCSE):
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * runtime/Executable.cpp:
      (JSC::FunctionExecutable::compileOptimizedForConstruct):
      (JSC::FunctionExecutable::compileForConstructInternal):
      * runtime/Executable.h:
      (JSC::FunctionExecutable::compileForConstruct):
      (JSC::FunctionExecutable::compileFor):
      (JSC::FunctionExecutable::compileOptimizedFor):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bb159ec2
  32. 16 Sep, 2011 1 commit
    • fpizlo@apple.com's avatar
      DFG JIT should inline Math.abs · 3c3e9651
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=68227
      
      Source/JavaScriptCore: 
      
      Reviewed by Oliver Hunt.
              
      This adds the ability to track intrinsic functions throughout the
      host function infrastructure, so that the DFG can easily query
      whether or not a call's target is intrinsic, and if so, which
      intrinsic it is.
              
      On top of this, it adds Math.abs intrinsics to DFG. Call(Math.abs)
      is transformed into ValueToNumber<-ArithAbs nodes. These nodes
      then get optimized using the usual tricks.
              
      Also had to make a completely unrelated change to
      DateInstanceCache.h in order to fix a preexisting alphabetical
      sorting problem in JSGlobalData.h
              
      This results in a big win in imaging-gaussian-blur: 61% faster
      than before. The net win on Kraken is around 13%.
      
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * create_hash_table:
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::parseBlock):
      * dfg/DFGGraph.h:
      (JSC::DFG::Graph::isFunctionConstant):
      (JSC::DFG::Graph::valueOfFunctionConstant):
      * dfg/DFGIntrinsic.h: Added.
      * dfg/DFGJITCodeGenerator.h:
      (JSC::DFG::JITCodeGenerator::isFunctionConstant):
      (JSC::DFG::JITCodeGenerator::valueOfFunctionConstant):
      * dfg/DFGJITCompiler.h:
      (JSC::DFG::JITCompiler::isFunctionConstant):
      (JSC::DFG::JITCompiler::valueOfFunctionConstant):
      * dfg/DFGNode.h:
      * dfg/DFGPropagator.cpp:
      (JSC::DFG::Propagator::propagateNode):
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * jit/JITStubs.cpp:
      (JSC::JITThunks::hostFunctionStub):
      * jit/JITStubs.h:
      * runtime/DateInstanceCache.h:
      * runtime/Executable.cpp:
      (JSC::ExecutableBase::intrinsic):
      (JSC::NativeExecutable::intrinsic):
      * runtime/Executable.h:
      (JSC::NativeExecutable::create):
      (JSC::NativeExecutable::finishCreation):
      * runtime/JSGlobalData.cpp:
      (JSC::JSGlobalData::getHostFunction):
      * runtime/JSGlobalData.h:
      * runtime/Lookup.cpp:
      (JSC::HashTable::createTable):
      (JSC::setUpStaticFunctionSlot):
      * runtime/Lookup.h:
      (JSC::HashEntry::initialize):
      (JSC::HashEntry::intrinsic):
      
      Source/WebCore: 
      
      Reviewed by Oliver Hunt.
      
      Added JavaScriptCore/dfg to include path path. Changed the bindings
      scripts to handle the presence of intrinsics.
      
      * CMakeLists.txt:
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateHashTable):
      
      Source/WebKit: 
      
      Reviewed by Oliver Hunt.
      
      Added JavaScriptCore/dfg to include path path.
      
      * CMakeLists.txt:
      
      Source/WebKit2: 
      
      Reviewed by Oliver Hunt.
      
      Added JavaScriptCore/dfg to include path path.
      
      * CMakeLists.txt:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95310 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3c3e9651