1. 05 Nov, 2012 1 commit
    • fpizlo@apple.com's avatar
      Reduce the verbosity of referring to QNaN in JavaScriptCore · 3494d02f
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=101174
      
      Reviewed by Geoffrey Garen.
      
      Introduces a #define QNaN in JSValue.h, and replaces all previous uses of
      std::numeric_limits<double>::quiet_NaN() with QNaN.
      
      * API/JSValueRef.cpp:
      (JSValueMakeNumber):
      (JSValueToNumber):
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray):
      * jit/JITPropertyAccess.cpp:
      (JSC::JIT::emitFloatTypedArrayGetByVal):
      * runtime/CachedTranscendentalFunction.h:
      (JSC::CachedTranscendentalFunction::initialize):
      * runtime/DateConstructor.cpp:
      (JSC::constructDate):
      * runtime/DateInstanceCache.h:
      (JSC::DateInstanceData::DateInstanceData):
      (JSC::DateInstanceCache::reset):
      * runtime/ExceptionHelpers.cpp:
      (JSC::InterruptedExecutionError::defaultValue):
      (JSC::TerminatedExecutionError::defaultValue):
      * runtime/JSCell.h:
      (JSC::JSValue::getPrimitiveNumber):
      * runtime/JSDateMath.cpp:
      (JSC::parseDateFromNullTerminatedCharacters):
      * runtime/JSGlobalData.cpp:
      (JSC::JSGlobalData::JSGlobalData):
      (JSC::JSGlobalData::resetDateCache):
      * runtime/JSGlobalObjectFunctions.cpp:
      (JSC::parseInt):
      (JSC::jsStrDecimalLiteral):
      (JSC::toDouble):
      (JSC::jsToNumber):
      (JSC::parseFloat):
      * runtime/JSValue.cpp:
      (JSC::JSValue::toNumberSlowCase):
      * runtime/JSValue.h:
      (JSC):
      * runtime/JSValueInlineMethods.h:
      (JSC::jsNaN):
      * runtime/MathObject.cpp:
      (JSC::mathProtoFuncMax):
      (JSC::mathProtoFuncMin):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133493 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3494d02f
  2. 18 Oct, 2012 1 commit
    • yuqiang.xian@intel.com's avatar
      Refactor MacroAssembler interfaces to differentiate the pointer operands from... · 5b1cb734
      yuqiang.xian@intel.com authored
      Refactor MacroAssembler interfaces to differentiate the pointer operands from the 64-bit integer operands
      https://bugs.webkit.org/show_bug.cgi?id=99154
      
      Reviewed by Gavin Barraclough.
      
      In current JavaScriptCore implementation for JSVALUE64 platform (i.e.,
      the X64 platform), we assume that the JSValue size is same to the
      pointer size, and thus EncodedJSValue is simply type defined as a
      "void*". In the JIT compiler, we also take this assumption and invoke
      the same macro assembler interfaces for both JSValue and pointer
      operands. We need to differentiate the operations on pointers from the
      operations on JSValues, and let them invoking different macro
      assembler interfaces. For example, we now use the interface of
      "loadPtr" to load either a pointer or a JSValue, and we need to switch
      to using "loadPtr" to load a pointer and some new "load64" interface
      to load a JSValue. This would help us supporting other JSVALUE64
      platforms where pointer size is not necessarily 64-bits, for example
      x32 (bug #99153).
      
      The major modification I made is to introduce the "*64" interfaces in
      the MacroAssembler for those operations on JSValues, keep the "*Ptr"
      interfaces for those operations on real pointers, and go through all
      the JIT compiler code to correct the usage.
      
      This is the second part of the work, i.e, to correct the usage of the
      new MacroAssembler interfaces in the JIT compilers, which also means
      that now EncodedJSValue is defined as a 64-bit integer, and the "*64"
      interfaces are used for it.
      
      * assembler/MacroAssembler.h: JSValue immediates should be in Imm64 instead of ImmPtr.
      (MacroAssembler):
      (JSC::MacroAssembler::shouldBlind):
      * dfg/DFGAssemblyHelpers.cpp: Correct the JIT compilers usage of the new interfaces.
      (JSC::DFG::AssemblyHelpers::jitAssertIsInt32):
      (JSC::DFG::AssemblyHelpers::jitAssertIsJSInt32):
      (JSC::DFG::AssemblyHelpers::jitAssertIsJSNumber):
      (JSC::DFG::AssemblyHelpers::jitAssertIsJSDouble):
      (JSC::DFG::AssemblyHelpers::jitAssertIsCell):
      * dfg/DFGAssemblyHelpers.h:
      (JSC::DFG::AssemblyHelpers::emitPutToCallFrameHeader):
      (JSC::DFG::AssemblyHelpers::branchIfNotCell):
      (JSC::DFG::AssemblyHelpers::debugCall):
      (JSC::DFG::AssemblyHelpers::boxDouble):
      (JSC::DFG::AssemblyHelpers::unboxDouble):
      (JSC::DFG::AssemblyHelpers::emitExceptionCheck):
      * dfg/DFGCCallHelpers.h:
      (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
      (CCallHelpers):
      * dfg/DFGOSRExitCompiler64.cpp:
      (JSC::DFG::OSRExitCompiler::compileExit):
      * dfg/DFGRepatch.cpp:
      (JSC::DFG::generateProtoChainAccessStub):
      (JSC::DFG::tryCacheGetByID):
      (JSC::DFG::tryBuildGetByIDList):
      (JSC::DFG::emitPutReplaceStub):
      (JSC::DFG::emitPutTransitionStub):
      * dfg/DFGScratchRegisterAllocator.h:
      (JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
      (JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
      * dfg/DFGSilentRegisterSavePlan.h:
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
      (JSC::DFG::SpeculativeJIT::compileValueToInt32):
      (JSC::DFG::SpeculativeJIT::compileInt32ToDouble):
      (JSC::DFG::SpeculativeJIT::compileInstanceOfForObject):
      (JSC::DFG::SpeculativeJIT::compileInstanceOf):
      (JSC::DFG::SpeculativeJIT::compileStrictEqForConstant):
      (JSC::DFG::SpeculativeJIT::compileGetByValOnArguments):
      * dfg/DFGSpeculativeJIT.h:
      (SpeculativeJIT):
      (JSC::DFG::SpeculativeJIT::silentSavePlanForGPR):
      (JSC::DFG::SpeculativeJIT::silentSpill):
      (JSC::DFG::SpeculativeJIT::silentFill):
      (JSC::DFG::SpeculativeJIT::spill):
      (JSC::DFG::SpeculativeJIT::valueOfJSConstantAsImm64):
      (JSC::DFG::SpeculativeJIT::callOperation):
      (JSC::DFG::SpeculativeJIT::branch64):
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::fillInteger):
      (JSC::DFG::SpeculativeJIT::fillDouble):
      (JSC::DFG::SpeculativeJIT::fillJSValue):
      (JSC::DFG::SpeculativeJIT::nonSpeculativeValueToNumber):
      (JSC::DFG::SpeculativeJIT::nonSpeculativeValueToInt32):
      (JSC::DFG::SpeculativeJIT::nonSpeculativeUInt32ToNumber):
      (JSC::DFG::SpeculativeJIT::cachedGetById):
      (JSC::DFG::SpeculativeJIT::cachedPutById):
      (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
      (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
      (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch):
      (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompare):
      (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq):
      (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeStrictEq):
      (JSC::DFG::SpeculativeJIT::emitCall):
      (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
      (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
      (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
      (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
      (JSC::DFG::SpeculativeJIT::convertToDouble):
      (JSC::DFG::SpeculativeJIT::compileObjectEquality):
      (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
      (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
      (JSC::DFG::SpeculativeJIT::compileDoubleCompare):
      (JSC::DFG::SpeculativeJIT::compileNonStringCellOrOtherLogicalNot):
      (JSC::DFG::SpeculativeJIT::compileLogicalNot):
      (JSC::DFG::SpeculativeJIT::emitNonStringCellOrOtherBranch):
      (JSC::DFG::SpeculativeJIT::emitBranch):
      (JSC::DFG::SpeculativeJIT::compileContiguousGetByVal):
      (JSC::DFG::SpeculativeJIT::compileArrayStorageGetByVal):
      (JSC::DFG::SpeculativeJIT::compileContiguousPutByVal):
      (JSC::DFG::SpeculativeJIT::compileArrayStoragePutByVal):
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGThunks.cpp:
      (JSC::DFG::osrExitGenerationThunkGenerator):
      (JSC::DFG::throwExceptionFromCallSlowPathGenerator):
      (JSC::DFG::slowPathFor):
      (JSC::DFG::virtualForThunkGenerator):
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::dumpRegisters):
      * jit/JIT.cpp:
      (JSC::JIT::privateCompile):
      * jit/JIT.h:
      (JIT):
      * jit/JITArithmetic.cpp:
      (JSC::JIT::emit_op_negate):
      (JSC::JIT::emitSlow_op_negate):
      (JSC::JIT::emit_op_rshift):
      (JSC::JIT::emitSlow_op_urshift):
      (JSC::JIT::emit_compareAndJumpSlow):
      (JSC::JIT::emit_op_bitand):
      (JSC::JIT::compileBinaryArithOpSlowCase):
      (JSC::JIT::emit_op_div):
      * jit/JITCall.cpp:
      (JSC::JIT::compileLoadVarargs):
      (JSC::JIT::compileCallEval):
      (JSC::JIT::compileCallEvalSlowCase):
      (JSC::JIT::compileOpCall):
      * jit/JITInlineMethods.h: Have some clean-up work as well.
      (JSC):
      (JSC::JIT::emitPutCellToCallFrameHeader):
      (JSC::JIT::emitPutIntToCallFrameHeader):
      (JSC::JIT::emitPutToCallFrameHeader):
      (JSC::JIT::emitGetFromCallFrameHeader32):
      (JSC::JIT::emitGetFromCallFrameHeader64):
      (JSC::JIT::emitAllocateJSArray):
      (JSC::JIT::emitValueProfilingSite):
      (JSC::JIT::emitGetJITStubArg):
      (JSC::JIT::emitGetVirtualRegister):
      (JSC::JIT::emitPutVirtualRegister):
      (JSC::JIT::emitInitRegister):
      (JSC::JIT::emitJumpIfJSCell):
      (JSC::JIT::emitJumpIfBothJSCells):
      (JSC::JIT::emitJumpIfNotJSCell):
      (JSC::JIT::emitLoadInt32ToDouble):
      (JSC::JIT::emitJumpIfImmediateInteger):
      (JSC::JIT::emitJumpIfNotImmediateInteger):
      (JSC::JIT::emitJumpIfNotImmediateIntegers):
      (JSC::JIT::emitFastArithReTagImmediate):
      (JSC::JIT::emitFastArithIntToImmNoCheck):
      * jit/JITOpcodes.cpp:
      (JSC::JIT::privateCompileCTINativeCall):
      (JSC::JIT::emit_op_mov):
      (JSC::JIT::emit_op_instanceof):
      (JSC::JIT::emit_op_is_undefined):
      (JSC::JIT::emit_op_is_boolean):
      (JSC::JIT::emit_op_is_number):
      (JSC::JIT::emit_op_tear_off_activation):
      (JSC::JIT::emit_op_not):
      (JSC::JIT::emit_op_jfalse):
      (JSC::JIT::emit_op_jeq_null):
      (JSC::JIT::emit_op_jneq_null):
      (JSC::JIT::emit_op_jtrue):
      (JSC::JIT::emit_op_bitxor):
      (JSC::JIT::emit_op_bitor):
      (JSC::JIT::emit_op_get_pnames):
      (JSC::JIT::emit_op_next_pname):
      (JSC::JIT::compileOpStrictEq):
      (JSC::JIT::emit_op_catch):
      (JSC::JIT::emit_op_throw_reference_error):
      (JSC::JIT::emit_op_eq_null):
      (JSC::JIT::emit_op_neq_null):
      (JSC::JIT::emit_op_create_activation):
      (JSC::JIT::emit_op_create_arguments):
      (JSC::JIT::emit_op_init_lazy_reg):
      (JSC::JIT::emitSlow_op_convert_this):
      (JSC::JIT::emitSlow_op_not):
      (JSC::JIT::emit_op_get_argument_by_val):
      (JSC::JIT::emit_op_put_to_base):
      (JSC::JIT::emit_resolve_operations):
      * jit/JITPropertyAccess.cpp:
      (JSC::JIT::emit_op_get_by_val):
      (JSC::JIT::emitContiguousGetByVal):
      (JSC::JIT::emitArrayStorageGetByVal):
      (JSC::JIT::emitSlow_op_get_by_val):
      (JSC::JIT::compileGetDirectOffset):
      (JSC::JIT::emit_op_get_by_pname):
      (JSC::JIT::emitContiguousPutByVal):
      (JSC::JIT::emitArrayStoragePutByVal):
      (JSC::JIT::compileGetByIdHotPath):
      (JSC::JIT::emit_op_put_by_id):
      (JSC::JIT::compilePutDirectOffset):
      (JSC::JIT::emit_op_init_global_const):
      (JSC::JIT::emit_op_init_global_const_check):
      (JSC::JIT::emitIntTypedArrayGetByVal):
      (JSC::JIT::emitFloatTypedArrayGetByVal):
      (JSC::JIT::emitFloatTypedArrayPutByVal):
      * jit/JITStubCall.h:
      (JITStubCall):
      (JSC::JITStubCall::JITStubCall):
      (JSC::JITStubCall::addArgument):
      (JSC::JITStubCall::call):
      (JSC::JITStubCall::callWithValueProfiling):
      * jit/JSInterfaceJIT.h:
      (JSC::JSInterfaceJIT::emitJumpIfImmediateNumber):
      (JSC::JSInterfaceJIT::emitJumpIfNotImmediateNumber):
      (JSC::JSInterfaceJIT::emitLoadJSCell):
      (JSC::JSInterfaceJIT::emitLoadInt32):
      (JSC::JSInterfaceJIT::emitLoadDouble):
      * jit/SpecializedThunkJIT.h:
      (JSC::SpecializedThunkJIT::returnDouble):
      (JSC::SpecializedThunkJIT::tagReturnAsInt32):
      * runtime/JSValue.cpp:
      (JSC::JSValue::description):
      * runtime/JSValue.h: Define JSVALUE64 EncodedJSValue as int64_t, which is also unified with JSVALUE32_64.
      (JSC):
      * runtime/JSValueInlineMethods.h: New implementation of some JSValue methods to make them more conformant
      with the new rule that "JSValue is a 64-bit integer rather than a pointer" for JSVALUE64 platforms.
      (JSC):
      (JSC::JSValue::JSValue):
      (JSC::JSValue::operator bool):
      (JSC::JSValue::operator==):
      (JSC::JSValue::operator!=):
      (JSC::reinterpretDoubleToInt64):
      (JSC::reinterpretInt64ToDouble):
      (JSC::JSValue::asDouble):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131858 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5b1cb734
  3. 01 Sep, 2012 1 commit
    • commit-queue@webkit.org's avatar
      LLInt C loop backend. · e13567fb
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=91052.
      
      Patch by Mark Lam <mark.lam@apple.com> on 2012-09-01
      Reviewed by Filip Pizlo.
      
      Source/JavaScriptCore:
      
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::dump):
      (JSC::CodeBlock::bytecodeOffset):
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::execute):
      (JSC::Interpreter::executeCall):
      (JSC::Interpreter::executeConstruct):
      (JSC):
      * interpreter/Interpreter.h:
      * jit/JITStubs.h:
      (JITStackFrame):
      (JSC):
      * llint/LLIntCLoop.cpp: Added.
      (JSC):
      (LLInt):
      (JSC::LLInt::CLoop::initialize):
      (JSC::LLInt::CLoop::catchRoutineFor):
      (JSC::LLInt::CLoop::hostCodeEntryFor):
      (JSC::LLInt::CLoop::jsCodeEntryWithArityCheckFor):
      (JSC::LLInt::CLoop::jsCodeEntryFor):
      * llint/LLIntCLoop.h: Added.
      (JSC):
      (LLInt):
      (CLoop):
      * llint/LLIntData.cpp:
      (JSC::LLInt::initialize):
      * llint/LLIntData.h:
      (JSC):
      * llint/LLIntOfflineAsmConfig.h:
      * llint/LLIntOpcode.h:
      * llint/LLIntThunks.cpp:
      (LLInt):
      * llint/LowLevelInterpreter.asm:
      * llint/LowLevelInterpreter.cpp:
      (LLInt):
      (JSC::LLInt::Ints2Double):
      (JSC):
      (JSC::CLoop::execute):
      * llint/LowLevelInterpreter.h:
      (JSC):
      * llint/LowLevelInterpreter32_64.asm:
      * llint/LowLevelInterpreter64.asm:
      * offlineasm/asm.rb:
      * offlineasm/backends.rb:
      * offlineasm/cloop.rb: Added.
      * offlineasm/instructions.rb:
      * runtime/Executable.h:
      (ExecutableBase):
      (JSC::ExecutableBase::hostCodeEntryFor):
      (JSC::ExecutableBase::jsCodeEntryFor):
      (JSC::ExecutableBase::jsCodeWithArityCheckEntryFor):
      (JSC::ExecutableBase::catchRoutineFor):
      (NativeExecutable):
      * runtime/JSValue.h:
      (JSC):
      (LLInt):
      (JSValue):
      * runtime/JSValueInlineMethods.h:
      (JSC):
      (JSC::JSValue::JSValue):
      * runtime/Options.cpp:
      (JSC::Options::initialize):
      
      Source/WTF:
      
      Added configs for the llint C loop backend.
      
      * wtf/Platform.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e13567fb
  4. 31 Aug, 2012 1 commit
    • commit-queue@webkit.org's avatar
      Refactor LLInt and supporting code in preparation for the C Loop backend. · eebad5de
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=95531.
      
      Patch by Mark Lam <mark.lam@apple.com> on 2012-08-31
      Reviewed by Filip Pizlo.
      
      * bytecode/GetByIdStatus.cpp:
      (JSC::GetByIdStatus::computeFromLLInt):
      * bytecode/PutByIdStatus.cpp:
      (JSC::PutByIdStatus::computeFromLLInt):
      * jit/JITExceptions.cpp:
      (JSC::genericThrow): Use ExecutableBase::catchRoutineFor() to fetch
          fetch the catch routine for a thrown exception.  This will allow
          us to redefine that for the C loop later, and still keep this
          code readable.
      * llint/LLIntOfflineAsmConfig.h: Moved ASM macros to
          LowLevelInterpreter.cpp which is the only place they are used. This
          will make it more convenient to redefine them for the C loop later.
      * llint/LLIntSlowPaths.cpp:
      (JSC::LLInt::setUpCall): Use ExecutableBase's hostCodeEntry()
          jsCodeEntryFor(), and jsCodeWithArityCheckEntryFor() for computing
          the entry points to functions being called.
      * llint/LLIntSlowPaths.h:
      (SlowPathReturnType):
      (JSC::LLInt::encodeResult):
      (LLInt):
      (JSC::LLInt::decodeResult): Added.  Needed by LLInt C Loop later.
      * llint/LowLevelInterpreter.asm:
      * llint/LowLevelInterpreter.cpp:
      * llint/LowLevelInterpreter32_64.asm:
      * llint/LowLevelInterpreter64.asm:
      * offlineasm/asm.rb: Disambiguate between opcodes and other labels.
      * offlineasm/config.rb:
      * runtime/Executable.h:
      (JSC::ExecutableBase::hostCodeEntryFor): Added.
      (ExecutableBase):
      (JSC::ExecutableBase::jsCodeEntryFor): Added.
      (JSC::ExecutableBase::jsCodeWithArityCheckEntryFor): Added.
      (JSC::ExecutableBase::catchRoutineFor): Added.
      * runtime/JSValueInlineMethods.h:
      (JSC):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127333 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      eebad5de
  5. 01 Feb, 2012 1 commit
    • fpizlo@apple.com's avatar
      DFG should fold double-to-int conversions · 0c31ace9
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=77532
      
      Reviewed by Oliver Hunt.
              
      Performance neutral on major benchmarks. But it makes calling V8's
      Math.random() 4x faster.
      
      * bytecode/CodeBlock.cpp:
      (JSC):
      (JSC::CodeBlock::addOrFindConstant):
      * bytecode/CodeBlock.h:
      (JSC::CodeBlock::addConstant):
      (CodeBlock):
      * dfg/DFGAbstractState.cpp:
      (JSC::DFG::AbstractState::execute):
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::toInt32):
      (ByteCodeParser):
      (JSC::DFG::ByteCodeParser::getJSConstantForValue):
      (JSC::DFG::ByteCodeParser::isInt32Constant):
      * dfg/DFGGraph.h:
      (JSC::DFG::Graph::addShouldSpeculateInteger):
      (Graph):
      (JSC::DFG::Graph::addImmediateShouldSpeculateInteger):
      * dfg/DFGPropagator.cpp:
      (JSC::DFG::Propagator::propagateNodePredictions):
      (JSC::DFG::Propagator::doRoundOfDoubleVoting):
      (JSC::DFG::Propagator::fixupNode):
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::compileAdd):
      (DFG):
      (JSC::DFG::SpeculativeJIT::compileArithSub):
      * dfg/DFGSpeculativeJIT.h:
      (JSC::DFG::SpeculativeJIT::valueOfNumberConstantAsInt32):
      (SpeculativeJIT):
      * dfg/DFGSpeculativeJIT32_64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * runtime/JSValueInlineMethods.h:
      (JSC::JSValue::asDouble):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106502 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0c31ace9
  6. 27 Oct, 2011 1 commit
    • haraken@chromium.org's avatar
      Generate WebKitCSSMatrix constructor for JSC by [Constructor] IDL · 105c0681
      haraken@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=70215
      
      Reviewed by Adam Barth.
      
      Source/JavaScriptCore:
      
      Added a method that judges if a given JSValue is empty.
      
      Tests: transforms/svg-vs-css.xhtml
             transforms/cssmatrix-2d-interface.xhtml
             transforms/cssmatrix-3d-interface.xhtml
      
      * runtime/JSValue.h:
      * runtime/JSValueInlineMethods.h:
      (JSC::JSValue::isEmpty):
      
      Source/WebCore:
      
      This patch implements [Optional=CallWithNullValue] IDL for JSC.
      While a parameter specified as [Optional=CallWithDefaultValue] is
      handled as a string "undefined", a parameter specified as
      [Optional=CallWithNullValue] is handled as a null string.
      (Note: not a string "null", but a null string).
      
      c.f. [Optional=CallWithNullValue] is implemented in V8 in bug 67458.
      
      Tests: fast/dom/global-constructors.html
             transforms/svg-vs-css.xhtml
             transforms/cssmatrix-2d-interface.xhtml
             transforms/cssmatrix-3d-interface.xhtml
      
      * GNUmakefile.list.am: Removed JSWebKitCSSMatrixCustom.cpp.
      * UseJSC.cmake: Ditto.
      * WebCore.gypi: Ditto.
      * WebCore.pro: Ditto.
      * WebCore.xcodeproj/project.pbxproj: Ditto.
      * bindings/js/JSBindingsAllInOne.cpp: Ditto.
      * bindings/js/JSDOMBinding.h: MAYBE_MISSING_PARAMETER(exec, index, policy) returns the index-th parameter, if the parameter exists. It returns an undefined value, if the index-th parameter is missing and the policy is MissingIsUndefined. It returns an empty value, otherwise (i.e. if the index-th parameter is missing and the policy is MissingIsEmpty).
      * bindings/js/JSWebKitCSSMatrixCustom.cpp: Removed.
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateParametersCheck): Supported [Optional=CallWithNullValue].
      (GenerateConstructorDefinition): Supported [Optional=CallWithNullValue].
      * css/WebKitCSSMatrix.idl: Removed [JSCustomConstructor].
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@98679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      105c0681
  7. 05 Oct, 2011 1 commit
  8. 04 Oct, 2011 1 commit
    • ggaren@apple.com's avatar
      Some JSValue cleanup · 7831f0c3
      ggaren@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=69320
      
      ../JavaScriptCore: 
      
      Reviewed by Darin Adler.
              
      No measurable performance change.
      
      Removed some JSValue::get* functions. get* used to be an optimization
      when every value operation was a virtual function call: get* would combine
      two virtual calls into one. Now, with non-virtual, inlined functions, get*
      isn't faster, and may be slightly slower.
      
      Merged getBoolean(bool&) and getBoolean() into asBoolean().
      
      Merged uncheckedGetNumber(), getJSNumber() and getNumber() into
      asNumber().
      
      * runtime/JSValue.h:
      * runtime/JSValueInlineMethods.h:
      (JSC::JSValue::asNumber):
      (JSC::JSValue::asBoolean): As promised!
      
      * runtime/NumberPrototype.cpp:
      (JSC::toThisNumber):
      (JSC::numberProtoFuncToExponential):
      (JSC::numberProtoFuncToFixed):
      (JSC::numberProtoFuncToPrecision):
      (JSC::numberProtoFuncToString):
      (JSC::numberProtoFuncToLocaleString):
      (JSC::numberProtoFuncValueOf): Removed a bunch of uses of getJSNumber()
      by switching to toThisNumber().
      
      * API/JSCallbackObjectFunctions.h:
      (JSC::::toNumber):
      * dfg/DFGGraph.h:
      (JSC::DFG::Graph::valueOfNumberConstant):
      (JSC::DFG::Graph::valueOfBooleanConstant):
      * dfg/DFGOperations.cpp:
      (JSC::DFG::putByVal):
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::privateExecute):
      * jit/JITStubs.cpp:
      (JSC::DEFINE_STUB_FUNCTION):
      * runtime/DateInstance.h:
      (JSC::DateInstance::internalNumber):
      * runtime/FunctionPrototype.cpp:
      (JSC::functionProtoFuncBind):
      * runtime/JSArray.cpp:
      (JSC::compareNumbersForQSort): Replaced getNumber() => isNumber() / asNumber().
      getBoolean() => isBoolean() / asBoolean(), uncheckedGetNumber() => asNumber().
      
      * runtime/JSCell.cpp:
      * runtime/JSCell.h: Nixed getJSNumber().
      
      * runtime/JSGlobalObjectFunctions.cpp:
      (JSC::globalFuncParseInt):
      * runtime/JSONObject.cpp:
      (JSC::gap):
      (JSC::Stringifier::Stringifier):
      (JSC::Stringifier::appendStringifiedValue):
      * runtime/NumberObject.cpp:
      * runtime/NumberObject.h:
      (JSC::NumberObject::createStructure):
      * runtime/Operations.h:
      (JSC::JSValue::equalSlowCaseInline):
      (JSC::JSValue::strictEqual):
      (JSC::jsLess):
      (JSC::jsLessEq):
      (JSC::jsAdd): Replaced getNumber() => isNumber() / asNumber().
      getBoolean() => isBoolean() / asBoolean(), uncheckedGetNumber() => asNumber().
      
      ../WebCore: 
      
      Reviewed by Darin Adler.
      
      * bindings/js/JSDOMBinding.cpp:
      (WebCore::valueToDate):
      * bindings/js/JSErrorHandler.cpp:
      (WebCore::JSErrorHandler::handleEvent):
      * bindings/js/JSEventListener.cpp:
      (WebCore::JSEventListener::handleEvent):
      * bindings/js/JSSQLTransactionCustom.cpp:
      (WebCore::JSSQLTransaction::executeSql):
      * bindings/js/JSSQLTransactionSyncCustom.cpp:
      (WebCore::JSSQLTransactionSync::executeSql):
      * bindings/js/ScriptValue.cpp:
      (WebCore::jsToInspectorValue):
      * bindings/js/SerializedScriptValue.cpp:
      (WebCore::CloneSerializer::dumpIfTerminal):
      * bindings/objc/WebScriptObject.mm:
      (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
      * bridge/jni/jsc/JNIUtilityPrivate.cpp:
      (JSC::Bindings::convertValueToJValue): Updated for JSC changes.
      
      ../WebKit/mac: 
      
      Reviewed by Darin Adler.
      
      * WebView/WebView.mm:
      (aeDescFromJSValue): Updated for JSC changes.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96673 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7831f0c3
  9. 29 Jul, 2011 1 commit
    • fpizlo@apple.com's avatar
      JSC GC zombie support no longer works, and is likely no longer needed. · 2f1f3943
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=65404
      
      Reviewed by Darin Adler.
      
      This removes zombies, because they no longer work, are not tested, are
      probably not needed, and are getting in the way of GC optimization
      work.
      
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * heap/Handle.h:
      (JSC::HandleConverter::operator->):
      (JSC::HandleConverter::operator*):
      * heap/HandleHeap.cpp:
      (JSC::HandleHeap::isValidWeakNode):
      * heap/Heap.cpp:
      (JSC::Heap::destroy):
      (JSC::Heap::collect):
      * heap/MarkedBlock.cpp:
      (JSC::MarkedBlock::sweep):
      * heap/MarkedBlock.h:
      (JSC::MarkedBlock::clearMarks):
      * interpreter/Register.h:
      (JSC::Register::Register):
      (JSC::Register::operator=):
      * runtime/ArgList.h:
      (JSC::MarkedArgumentBuffer::append):
      (JSC::ArgList::ArgList):
      * runtime/JSCell.cpp:
      (JSC::isZombie):
      * runtime/JSCell.h:
      * runtime/JSGlobalData.cpp:
      (JSC::JSGlobalData::JSGlobalData):
      (JSC::JSGlobalData::clearBuiltinStructures):
      * runtime/JSGlobalData.h:
      * runtime/JSValue.h:
      * runtime/JSValueInlineMethods.h:
      (JSC::JSValue::JSValue):
      * runtime/JSZombie.cpp: Removed.
      * runtime/JSZombie.h: Removed.
      * runtime/WriteBarrier.h:
      (JSC::WriteBarrierBase::setEarlyValue):
      (JSC::WriteBarrierBase::operator*):
      (JSC::WriteBarrierBase::setWithoutWriteBarrier):
      * wtf/Platform.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@92046 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2f1f3943
  10. 10 Jun, 2011 1 commit
    • barraclough@apple.com's avatar
      https://bugs.webkit.org/show_bug.cgi?id=16777 · f1fa579d
      barraclough@apple.com authored
      Eliminate JSC::NaN and JSC::Inf
      
      Reviewed by Sam Weinig.
      
      There's no good reason for -K-J-S- JSC to have its own NAN and infinity constants.
      The ones in std::numeric_limits are perfectly good.
      Remove JSC::Inf, JSC::NaN, switch some cases of (isnan || isinf) to !isfinite.
      
      Source/JavaScriptCore: 
      
      * API/JSCallbackObjectFunctions.h:
      (JSC::::toNumber):
      * API/JSValueRef.cpp:
      (JSValueMakeNumber):
      (JSValueToNumber):
      * JavaScriptCore.exp:
      * runtime/CachedTranscendentalFunction.h:
      (JSC::CachedTranscendentalFunction::initialize):
      * runtime/DateConstructor.cpp:
      (JSC::constructDate):
      * runtime/DateInstanceCache.h:
      (JSC::DateInstanceData::DateInstanceData):
      (JSC::DateInstanceCache::reset):
      * runtime/JSCell.cpp:
      * runtime/JSCell.h:
      (JSC::JSCell::JSValue::getPrimitiveNumber):
      (JSC::JSCell::JSValue::toNumber):
      * runtime/JSGlobalData.cpp:
      (JSC::JSGlobalData::JSGlobalData):
      (JSC::JSGlobalData::resetDateCache):
      * runtime/JSGlobalObject.cpp:
      (JSC::JSGlobalObject::reset):
      * runtime/JSGlobalObjectFunctions.cpp:
      (JSC::globalFuncParseInt):
      (JSC::globalFuncIsFinite):
      * runtime/JSNotAnObject.cpp:
      (JSC::JSNotAnObject::toNumber):
      * runtime/JSValue.cpp:
      * runtime/JSValue.h:
      * runtime/JSValueInlineMethods.h:
      (JSC::jsNaN):
      * runtime/MathObject.cpp:
      (JSC::mathProtoFuncMax):
      (JSC::mathProtoFuncMin):
      * runtime/NumberConstructor.cpp:
      (JSC::numberConstructorNegInfinity):
      (JSC::numberConstructorPosInfinity):
      * runtime/NumberPrototype.cpp:
      (JSC::numberProtoFuncToExponential):
      (JSC::numberProtoFuncToFixed):
      (JSC::numberProtoFuncToPrecision):
      (JSC::numberProtoFuncToString):
      * runtime/UString.cpp:
      * wtf/DecimalNumber.h:
      (WTF::DecimalNumber::DecimalNumber):
      * wtf/dtoa.cpp:
      (WTF::dtoa):
      
      Source/WebCore: 
      
      * bindings/js/JSDataViewCustom.cpp:
      (WebCore::getDataViewMember):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@88587 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f1fa579d
  11. 11 Apr, 2011 2 commits
    • barraclough@apple.com's avatar
      Bug 58263 - Use EncodedValueDescriptor on both JSVALUE32_64, JSVALUE64 · 560dde7c
      barraclough@apple.com authored
      Reviewed by Sam Weinig.
      
      The JSJITInterface already uses EncodedValueDescriptor to access the tag/payload
      separately on JSVALUE64, even though EncodedValueDescriptor is not used in
      JSVALUE64's implementation of JSValue. Remove the separate definition for m_ptr
      on X86_64. Using the union allows us to remove a layer of makeImmediate()/
      immedaiteValue() methods.
      
      * dfg/DFGNonSpeculativeJIT.cpp:
      (JSC::DFG::NonSpeculativeJIT::compile):
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * jit/JITInlineMethods.h:
      (JSC::JIT::emitTagAsBoolImmediate):
      * jit/JITOpcodes.cpp:
      (JSC::JIT::emit_op_not):
      (JSC::JIT::emit_op_jeq_null):
      (JSC::JIT::emit_op_jneq_null):
      (JSC::JIT::emit_op_get_pnames):
      (JSC::JIT::emit_op_eq_null):
      (JSC::JIT::emit_op_neq_null):
      (JSC::JIT::emitSlow_op_not):
      * runtime/JSCell.h:
      * runtime/JSValue.h:
      * runtime/JSValueInlineMethods.h:
      (JSC::JSValue::encode):
      (JSC::JSValue::decode):
      (JSC::JSValue::operator==):
      (JSC::JSValue::operator!=):
      (JSC::JSValue::JSValue):
      (JSC::JSValue::operator bool):
      (JSC::JSValue::asInt32):
      (JSC::JSValue::isUndefinedOrNull):
      (JSC::JSValue::isBoolean):
      (JSC::JSValue::isCell):
      (JSC::JSValue::isInt32):
      (JSC::JSValue::asDouble):
      (JSC::JSValue::isNumber):
      (JSC::JSValue::asCell):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      560dde7c
    • barraclough@apple.com's avatar
      Bug 58198 - Clean up JSValue implementation for JSVALUE64 · c6441e68
      barraclough@apple.com authored
      Reviewed by Sam Weinig.
      
      Source/JavaScriptCore: 
      
      Remove JSNumberCell, JSImmediate, unify some methods between JSVALUE32_64/JSVALUE64
      
      JSNumberCell.h largely just contained the constructors for JSValue on JSVALUE64,
      which should not have been here.  JSImmediate mostly contained uncalled methods,
      along with the internal implementation of the JSValue constructors split unnecessarily
      across a number of layers of function calls. These could largely be merged back
      together. Many methods and constructors from JSVALUE32_64 and JSVALUE64 can by unified.
      
      The .cpp files were empty.
      
      Moving all these methods into JSValue.h seems to be a repro measurable regression, so
      I have kept these methods in a separate JSValueInlineMethods.h. Adding the 64-bit tag
      values as static const members of JSValue also measures as a repro regression, so I
      have made these #defines.
      
      * Android.mk:
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * JavaScriptCore.exp:
      * JavaScriptCore.gypi:
      * JavaScriptCore.pro:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
      * JavaScriptCore.xcodeproj/project.pbxproj:
          - Removed JSImmediate.h, JSNumberCell.h.
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::emitLoad):
          - Removed class JSImmediate.
      * dfg/DFGNonSpeculativeJIT.cpp:
      (JSC::DFG::NonSpeculativeJIT::compile):
          - Removed class JSImmediate.
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
          - Removed class JSImmediate.
      * jit/JITArithmetic.cpp:
      (JSC::JIT::compileBinaryArithOpSlowCase):
          - Removed class JSImmediate.
      * jit/JITInlineMethods.h:
      (JSC::JIT::emitJumpIfJSCell):
      (JSC::JIT::emitJumpIfNotJSCell):
      (JSC::JIT::emitJumpIfImmediateInteger):
      (JSC::JIT::emitJumpIfNotImmediateInteger):
      (JSC::JIT::emitFastArithDeTagImmediate):
      (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
      (JSC::JIT::emitFastArithReTagImmediate):
      (JSC::JIT::emitTagAsBoolImmediate):
          - Removed class JSImmediate.
      * jit/JITOpcodes.cpp:
      (JSC::JIT::emit_op_not):
      (JSC::JIT::emit_op_jeq_null):
      (JSC::JIT::emit_op_jneq_null):
      (JSC::JIT::emit_op_get_pnames):
      (JSC::JIT::emit_op_eq_null):
      (JSC::JIT::emit_op_neq_null):
      (JSC::JIT::emitSlow_op_not):
          - Removed class JSImmediate.
      * jit/JSInterfaceJIT.h:
          - Removed class JSImmediate.
      * runtime/JSCell.h:
          - Removed JSImmediate.h, JSNumberCell.h.
      * runtime/JSImmediate.cpp: Removed.
      * runtime/JSImmediate.h: Removed.
      * runtime/JSNumberCell.cpp: Removed.
      * runtime/JSNumberCell.h: Removed.
          - Removed.
      * runtime/JSObject.h:
          - Removed JSImmediate.h, JSNumberCell.h.
      * runtime/JSString.h:
          - Removed JSImmediate.h, JSNumberCell.h.
      * runtime/JSValue.h:
          - Added tags for JSVALUE64, moved out some JSVALUE32_64 methods, unified with JSVALUE64.
      * runtime/JSValueInlineMethods.h: Added.
      (JSC::JSValue::toInt32):
      (JSC::JSValue::toUInt32):
      (JSC::JSValue::isUInt32):
      (JSC::JSValue::asUInt32):
      (JSC::JSValue::uncheckedGetNumber):
      (JSC::JSValue::toJSNumber):
      (JSC::jsNaN):
      (JSC::JSValue::getNumber):
      (JSC::JSValue::getBoolean):
      (JSC::JSValue::JSValue):
      (JSC::JSValue::encode):
      (JSC::JSValue::decode):
      (JSC::JSValue::operator bool):
      (JSC::JSValue::operator==):
      (JSC::JSValue::operator!=):
      (JSC::JSValue::isUndefined):
      (JSC::JSValue::isNull):
      (JSC::JSValue::isUndefinedOrNull):
      (JSC::JSValue::isCell):
      (JSC::JSValue::isInt32):
      (JSC::JSValue::isDouble):
      (JSC::JSValue::isTrue):
      (JSC::JSValue::isFalse):
      (JSC::JSValue::tag):
      (JSC::JSValue::payload):
      (JSC::JSValue::asInt32):
      (JSC::JSValue::asDouble):
      (JSC::JSValue::asCell):
      (JSC::JSValue::isNumber):
      (JSC::JSValue::isBoolean):
      (JSC::JSValue::makeImmediate):
      (JSC::JSValue::immediateValue):
      (JSC::reinterpretDoubleToIntptr):
      (JSC::reinterpretIntptrToDouble):
          - Methods moved here from JSImmediate.h/JSNumberCell.h/JSValue.h.
      * runtime/Operations.h:
          - Removed JSImmediate.h, JSNumberCell.h.
      * wtf/StdLibExtras.h:
          - Export bitwise_cast.
      
      Source/WebCore: 
      
      JSNumberCell.h has been deprecated.
      
      * ForwardingHeaders/runtime/JSNumberCell.h: Removed.
      * bindings/scripts/CodeGeneratorJS.pm:
      * bridge/c/c_instance.cpp:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c6441e68