1. 14 Mar, 2013 1 commit
    • fpizlo@apple.com's avatar
      JSObject fast by-string access optimizations should work even on the prototype... · 10c38d3c
      fpizlo@apple.com authored
      JSObject fast by-string access optimizations should work even on the prototype chain, and even when the result is undefined
      https://bugs.webkit.org/show_bug.cgi?id=112233
      
      Source/JavaScriptCore: 
      
      Reviewed by Oliver Hunt.
              
      Extended the existing fast access path for String keys to work over the entire prototype chain,
      not just the self access case. This will fail as soon as it sees an object that intercepts
      getOwnPropertySlot, so this patch also ensures that ObjectPrototype does not fall into that
      category. This is accomplished by making ObjectPrototype eagerly reify all of its properties.
      This is safe for ObjectPrototype because it's so common and we expect all of its properties to
      be reified for any interesting programs anyway. A new idiom for adding native functions to
      prototypes is introduced, which ought to work well for any other prototypes that we wish to do
      this conversion for.
              
      This is a >60% speed-up in the case that you frequently do by-string lookups that "miss", i.e.
      they don't turn up anything.
      
      * CMakeLists.txt:
      * DerivedSources.make:
      * DerivedSources.pri:
      * GNUmakefile.list.am:
      * dfg/DFGOperations.cpp:
      * interpreter/CallFrame.h:
      (JSC::ExecState::objectConstructorTable):
      * jit/JITStubs.cpp:
      (JSC::getByVal):
      * llint/LLIntSlowPaths.cpp:
      (JSC::LLInt::getByVal):
      * runtime/CommonIdentifiers.h:
      * runtime/JSCell.cpp:
      (JSC::JSCell::getByStringSlow):
      (JSC):
      * runtime/JSCell.h:
      (JSCell):
      * runtime/JSCellInlines.h:
      (JSC):
      (JSC::JSCell::getByStringAndKey):
      (JSC::JSCell::getByString):
      * runtime/JSGlobalData.cpp:
      (JSC):
      (JSC::JSGlobalData::JSGlobalData):
      (JSC::JSGlobalData::~JSGlobalData):
      * runtime/JSGlobalData.h:
      (JSGlobalData):
      * runtime/JSObject.cpp:
      (JSC::JSObject::putDirectNativeFunction):
      (JSC):
      * runtime/JSObject.h:
      (JSObject):
      (JSC):
      * runtime/Lookup.cpp:
      (JSC::setUpStaticFunctionSlot):
      * runtime/ObjectPrototype.cpp:
      (JSC):
      (JSC::ObjectPrototype::finishCreation):
      (JSC::ObjectPrototype::create):
      * runtime/ObjectPrototype.h:
      (ObjectPrototype):
      * runtime/PropertyMapHashTable.h:
      (JSC::PropertyTable::findWithString):
      * runtime/Structure.h:
      (Structure):
      * runtime/StructureInlines.h:
      (JSC::Structure::get):
      (JSC):
      
      LayoutTests: 
      
      Reviewed by Oliver Hunt.
      
      * fast/js/regress/script-tests/string-lookup-hit-identifier.js: Added.
      (result):
      * fast/js/regress/script-tests/string-lookup-hit.js: Added.
      (result):
      * fast/js/regress/script-tests/string-lookup-miss.js: Added.
      (result):
      * fast/js/regress/string-lookup-hit-expected.txt: Added.
      * fast/js/regress/string-lookup-hit-identifier-expected.txt: Added.
      * fast/js/regress/string-lookup-hit-identifier.html: Added.
      * fast/js/regress/string-lookup-hit.html: Added.
      * fast/js/regress/string-lookup-miss-expected.txt: Added.
      * fast/js/regress/string-lookup-miss.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145838 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      10c38d3c
  2. 11 Dec, 2012 1 commit
    • fpizlo@apple.com's avatar
      Profiler should show bytecode dumps as they would have been visible to the... · 77ef0e33
      fpizlo@apple.com authored
      Profiler should show bytecode dumps as they would have been visible to the JITs, including the profiling data that the JITs would see
      https://bugs.webkit.org/show_bug.cgi?id=104647
      
      Reviewed by Oliver Hunt.
      
      Source/JavaScriptCore: 
      
      Adds more profiling data to bytecode dumps, and adds the ability to do a secondary
      bytecode dump for each JIT compilation of a code block. This is relevant because both
      the bytecodes, and the profiling data, may change after some number of executions.
              
      Also fixes some random dumping code to use PrintStream& rather than
      static const char[thingy].
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * Target.pri:
      * bytecode/ArrayProfile.cpp:
      (JSC::dumpArrayModes):
      (JSC::ArrayProfile::briefDescription):
      * bytecode/ArrayProfile.h:
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::printGetByIdOp):
      (JSC::CodeBlock::printGetByIdCacheStatus):
      (JSC::CodeBlock::printCallOp):
      (JSC::CodeBlock::dumpValueProfiling):
      (JSC::CodeBlock::dumpArrayProfiling):
      (JSC::CodeBlock::dumpBytecode):
      * bytecode/CodeBlock.h:
      * bytecode/ValueProfile.h:
      (JSC::ValueProfileBase::briefDescription):
      * dfg/DFGAbstractValue.h:
      (JSC::DFG::AbstractValue::dump):
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::parseCodeBlock):
      * jit/JIT.cpp:
      (JSC::JIT::privateCompile):
      * profiler/ProfilerBytecodeSequence.cpp: Added.
      (JSC::Profiler::BytecodeSequence::BytecodeSequence):
      (JSC::Profiler::BytecodeSequence::~BytecodeSequence):
      (JSC::Profiler::BytecodeSequence::indexForBytecodeIndex):
      (JSC::Profiler::BytecodeSequence::forBytecodeIndex):
      (JSC::Profiler::BytecodeSequence::addSequenceProperties):
      * profiler/ProfilerBytecodeSequence.h: Added.
      (JSC::Profiler::BytecodeSequence::size):
      (JSC::Profiler::BytecodeSequence::at):
      * profiler/ProfilerBytecodes.cpp:
      (JSC::Profiler::Bytecodes::Bytecodes):
      (JSC::Profiler::Bytecodes::toJS):
      * profiler/ProfilerBytecodes.h:
      (JSC::Profiler::Bytecodes::instructionCount):
      * profiler/ProfilerCompilation.cpp:
      (JSC::Profiler::Compilation::addProfiledBytecodes):
      (JSC::Profiler::Compilation::toJS):
      * profiler/ProfilerCompilation.h:
      (JSC::Profiler::Compilation::profiledBytecodesSize):
      (JSC::Profiler::Compilation::profiledBytecodesAt):
      * profiler/ProfilerDatabase.cpp:
      (JSC::Profiler::Database::ensureBytecodesFor):
      * profiler/ProfilerDatabase.h:
      * profiler/ProfilerProfiledBytecodes.cpp: Added.
      (JSC::Profiler::ProfiledBytecodes::ProfiledBytecodes):
      (JSC::Profiler::ProfiledBytecodes::~ProfiledBytecodes):
      (JSC::Profiler::ProfiledBytecodes::toJS):
      * profiler/ProfilerProfiledBytecodes.h: Added.
      (JSC::Profiler::ProfiledBytecodes::bytecodes):
      * runtime/CommonIdentifiers.h:
      
      Tools: 
      
      Added a "profiling" (or "p") command to show the profiling data that the JITs saw
      for each JIT compilation of a code block.
              
      Also added instruction counts in the "full" display and made the "full" display the
      default thing you see.
      
      * Scripts/display-profiler-output:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@137379 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      77ef0e33
  3. 10 Dec, 2012 2 commits
    • fpizlo@apple.com's avatar
      JSC profiling and debug dump code should use inferred names when possible · 1a6da216
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=104519
      
      Reviewed by Oliver Hunt.
      
      Source/JavaScriptCore: 
      
      This does as advertised: the profiler now knows the inferred name of all code blocks,
      and all uses of CodeBlock::dump() dump it along with the hash.
              
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::inferredName):
      (JSC::CodeBlock::dumpAssumingJITType):
      * bytecode/CodeBlock.h:
      * profiler/ProfilerBytecodes.cpp:
      (JSC::Profiler::Bytecodes::Bytecodes):
      (JSC::Profiler::Bytecodes::toJS):
      * profiler/ProfilerBytecodes.h:
      (JSC::Profiler::Bytecodes::inferredName):
      * profiler/ProfilerDatabase.cpp:
      (JSC::Profiler::Database::addBytecodes):
      (JSC::Profiler::Database::ensureBytecodesFor):
      * profiler/ProfilerDatabase.h:
      * runtime/CommonIdentifiers.h:
      
      Tools: 
      
      The format I'm using for referring to a code block is now name#hash. For example,
      v8-crypto has something called bnpSquareTo#B5QFbU. The profiler allows you to use
      either the hash, the inferred name, or the combined hash and full name when referring
      to blocks.
      
      * Scripts/display-profiler-output:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@137179 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1a6da216
    • fpizlo@apple.com's avatar
      Profiler should say things about OSR exits · d2deec81
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=104497
      
      Reviewed by Oliver Hunt.
      
      Source/JavaScriptCore: 
      
      This adds support for profiling OSR exits. For each exit that is taken, the profiler
      records the machine code address that the exit occurred on, the exit kind, the origin
      stack, and the number of times that it happened.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * Target.pri:
      * assembler/AbstractMacroAssembler.h:
      (Jump):
      (JSC::AbstractMacroAssembler::Jump::label):
      * bytecode/CodeBlock.h:
      (JSC::CodeBlock::saveCompilation):
      (CodeBlock):
      (JSC::CodeBlock::compilation):
      (DFGData):
      * bytecode/DFGExitProfile.h:
      (DFG):
      * bytecode/ExitKind.cpp: Added.
      (JSC):
      (JSC::exitKindToString):
      (JSC::exitKindIsCountable):
      (WTF):
      (WTF::printInternal):
      * bytecode/ExitKind.h: Added.
      (JSC):
      (WTF):
      * dfg/DFGGraph.h:
      (Graph):
      * dfg/DFGJITCompiler.cpp:
      (JSC::DFG::JITCompiler::linkOSRExits):
      (JSC::DFG::JITCompiler::link):
      (JSC::DFG::JITCompiler::compile):
      (JSC::DFG::JITCompiler::compileFunction):
      * dfg/DFGJITCompiler.h:
      (JITCompiler):
      * dfg/DFGOSRExitCompiler.cpp:
      * jit/JIT.cpp:
      (JSC::JIT::JIT):
      (JSC::JIT::privateCompile):
      * jit/JIT.h:
      (JIT):
      * jit/JumpReplacementWatchpoint.h:
      (JSC::JumpReplacementWatchpoint::sourceLabel):
      (JumpReplacementWatchpoint):
      * profiler/ProfilerCompilation.cpp:
      (JSC::Profiler::Compilation::addOSRExitSite):
      (Profiler):
      (JSC::Profiler::Compilation::addOSRExit):
      (JSC::Profiler::Compilation::toJS):
      * profiler/ProfilerCompilation.h:
      (Compilation):
      * profiler/ProfilerDatabase.cpp:
      (JSC::Profiler::Database::newCompilation):
      * profiler/ProfilerDatabase.h:
      (Database):
      * profiler/ProfilerOSRExit.cpp: Added.
      (Profiler):
      (JSC::Profiler::OSRExit::OSRExit):
      (JSC::Profiler::OSRExit::~OSRExit):
      (JSC::Profiler::OSRExit::toJS):
      * profiler/ProfilerOSRExit.h: Added.
      (Profiler):
      (OSRExit):
      (JSC::Profiler::OSRExit::id):
      (JSC::Profiler::OSRExit::origin):
      (JSC::Profiler::OSRExit::exitKind):
      (JSC::Profiler::OSRExit::isWatchpoint):
      (JSC::Profiler::OSRExit::counterAddress):
      (JSC::Profiler::OSRExit::count):
      * profiler/ProfilerOSRExitSite.cpp: Added.
      (Profiler):
      (JSC::Profiler::OSRExitSite::toJS):
      * profiler/ProfilerOSRExitSite.h: Added.
      (Profiler):
      (OSRExitSite):
      (JSC::Profiler::OSRExitSite::OSRExitSite):
      (JSC::Profiler::OSRExitSite::codeAddress):
      * runtime/CommonIdentifiers.h:
      
      Tools: 
      
      Adds support for displaying OSR exit information for full summary (just displays the
      counts and the number of recompilations), bytecode display (says which bytecodes
      exited), and DFG display (annotates disassembly with taken OSR exits and their
      counts).
      
      * Scripts/display-profiler-output:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@137175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d2deec81
  4. 05 Dec, 2012 1 commit
    • fpizlo@apple.com's avatar
      JSC profiler should not count executions of op_call_put_result because doing so changes DFG codegen · bb1c9483
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=104102
      
      Reviewed by Oliver Hunt.
      
      Source/JavaScriptCore: 
      
      This removes op_call_put_result from profiling, since profiling it has an effect on
      codegen. This fix enables all of SunSpider, V8, and Kraken to be profiled with the
      new profiler.
              
      To make this all fit together, the profiler now also reports in its output the exact
      bytecode opcode name for each instruction (in addition to the stringified dump of that
      bytecode), so that tools that grok the output can take note of op_call_put_result and
      work around the fact that it has no counts.
      
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::parseBlock):
      (JSC::DFG::ByteCodeParser::parseCodeBlock):
      * dfg/DFGDriver.cpp:
      (JSC::DFG::compile):
      * jit/JIT.cpp:
      (JSC::JIT::privateCompileMainPass):
      * profiler/ProfilerBytecode.cpp:
      (JSC::Profiler::Bytecode::toJS):
      * profiler/ProfilerBytecode.h:
      (JSC::Profiler::Bytecode::Bytecode):
      (JSC::Profiler::Bytecode::opcodeID):
      (Bytecode):
      * profiler/ProfilerDatabase.cpp:
      (JSC::Profiler::Database::ensureBytecodesFor):
      * runtime/CommonIdentifiers.h:
      
      Tools: 
      
      Modify the profiler to not output counts for op_call_put_result, since there
      won't be any. Also fix a few weird bugs, like providing better error reporting
      when you type something incorrectly and not reporting counts for slow paths
      in the old JIT since those counts are actually not what you think they are
      (we don't actually count slow path executions separately).
      
      * Scripts/display-profiler-output:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136720 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bb1c9483
  5. 04 Dec, 2012 2 commits
    • fpizlo@apple.com's avatar
      display-profiler-output should be able to show source code · d0f5c88c
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=104073
      
      Reviewed by Oliver Hunt.
      
      Source/JavaScriptCore: 
      
      Modify the profiler database to store source code. For functions, we store the
      function including the function signature.
      
      * bytecode/CodeBlock.h:
      (JSC::CodeBlock::unlinkedCodeBlock):
      (CodeBlock):
      * profiler/ProfilerBytecodes.cpp:
      (JSC::Profiler::Bytecodes::Bytecodes):
      (JSC::Profiler::Bytecodes::toJS):
      * profiler/ProfilerBytecodes.h:
      (Bytecodes):
      (JSC::Profiler::Bytecodes::sourceCode):
      * profiler/ProfilerDatabase.cpp:
      (JSC::Profiler::Database::addBytecodes):
      (JSC::Profiler::Database::ensureBytecodesFor):
      * profiler/ProfilerDatabase.h:
      (Database):
      * runtime/CommonIdentifiers.h:
      * runtime/Executable.h:
      (FunctionExecutable):
      (JSC::FunctionExecutable::unlinkedExecutable):
      
      Tools: 
      
      Display source code in the summary, using a one-line shortening.
      
      * Scripts/display-profiler-output:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136606 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d0f5c88c
    • fpizlo@apple.com's avatar
      JSC should be able to report profiling data associated with the IR dumps and disassembly · 4a81fa41
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=102999
      
      Reviewed by Gavin Barraclough.
      
      Source/JavaScriptCore: 
      
      Added a new profiler to JSC. It's simply called "Profiler" in anticipation of it
      ultimately replacing the previous profiling infrastructure. This profiler counts the
      number of times that a bytecode executes in various engines, and will record both the
      counts and all disassembly and bytecode dumps, into a database that can be at any
      time turned into either a JS object using any global object or global data of your
      choice, or can be turned into a JSON string, or saved to a file.
              
      Currently the only use of this is the new '-p <file>' flag to the jsc command-line.
              
      The profiler is always compiled in and normally incurs no execution time cost, but is
      only activated when you create a Profiler::Database and install it in
      JSGlobalData::m_perBytecodeProfiler. From that point on, all code blocks will be
      compiled along with disassembly and bytecode dumps stored into the Profiler::Database,
      and all code blocks will have execution counts, which are also stored in the database.
      The database will continue to keep information about code blocks alive even after they
      are otherwise GC'd.
              
      This currently still has some glitches, like the fact that it only counts executions
      in the JITs. Doing execution counting in the LLInt might require a bit of a rethink
      about how the counting is expressed - currently it is implicit in bytecode, so there
      is no easy way to "turn it on" in the LLInt. Also, right now there is no information
      recorded about OSR exits or out-of-line stubs. But, even so, it's quite cool, and
      gives you a peek into what JSC is doing that would otherwise not be possible.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * Target.pri:
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::~CodeBlock):
      * bytecode/CodeBlock.h:
      (CodeBlock):
      (JSC::CodeBlock::baselineVersion):
      * bytecode/CodeOrigin.cpp:
      (JSC::InlineCallFrame::baselineCodeBlock):
      (JSC):
      * bytecode/CodeOrigin.h:
      (InlineCallFrame):
      * dfg/DFGAbstractState.cpp:
      (JSC::DFG::AbstractState::execute):
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::parseBlock):
      * dfg/DFGDisassembler.cpp:
      (JSC::DFG::Disassembler::dump):
      (DFG):
      (JSC::DFG::Disassembler::reportToProfiler):
      (JSC::DFG::Disassembler::dumpHeader):
      (JSC::DFG::Disassembler::append):
      (JSC::DFG::Disassembler::createDumpList):
      * dfg/DFGDisassembler.h:
      (Disassembler):
      (JSC::DFG::Disassembler::DumpedOp::DumpedOp):
      (DumpedOp):
      * dfg/DFGGraph.cpp:
      (JSC::DFG::Graph::Graph):
      (JSC::DFG::Graph::dumpCodeOrigin):
      (JSC::DFG::Graph::dump):
      * dfg/DFGGraph.h:
      (Graph):
      * dfg/DFGJITCompiler.cpp:
      (JSC::DFG::JITCompiler::JITCompiler):
      (JSC::DFG::JITCompiler::compile):
      (JSC::DFG::JITCompiler::compileFunction):
      * dfg/DFGNode.h:
      (Node):
      (JSC::DFG::Node::hasExecutionCounter):
      (JSC::DFG::Node::executionCounter):
      * dfg/DFGNodeType.h:
      (DFG):
      * dfg/DFGPredictionPropagationPhase.cpp:
      (JSC::DFG::PredictionPropagationPhase::propagate):
      * dfg/DFGSpeculativeJIT32_64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * jit/JIT.cpp:
      (JSC::JIT::JIT):
      (JSC::JIT::privateCompileMainPass):
      (JSC::JIT::privateCompile):
      * jit/JIT.h:
      (JIT):
      * jit/JITDisassembler.cpp:
      (JSC::JITDisassembler::dump):
      (JSC::JITDisassembler::reportToProfiler):
      (JSC):
      (JSC::JITDisassembler::dumpHeader):
      (JSC::JITDisassembler::firstSlowLabel):
      (JSC::JITDisassembler::dumpVectorForInstructions):
      (JSC::JITDisassembler::dumpForInstructions):
      (JSC::JITDisassembler::reportInstructions):
      * jit/JITDisassembler.h:
      (JITDisassembler):
      (DumpedOp):
      * jsc.cpp:
      (CommandLine::CommandLine):
      (CommandLine):
      (printUsageStatement):
      (CommandLine::parseArguments):
      (jscmain):
      * profiler/ProfilerBytecode.cpp: Added.
      (Profiler):
      (JSC::Profiler::Bytecode::toJS):
      * profiler/ProfilerBytecode.h: Added.
      (Profiler):
      (Bytecode):
      (JSC::Profiler::Bytecode::Bytecode):
      (JSC::Profiler::Bytecode::bytecodeIndex):
      (JSC::Profiler::Bytecode::description):
      (JSC::Profiler::getBytecodeIndexForBytecode):
      * profiler/ProfilerBytecodes.cpp: Added.
      (Profiler):
      (JSC::Profiler::Bytecodes::Bytecodes):
      (JSC::Profiler::Bytecodes::~Bytecodes):
      (JSC::Profiler::Bytecodes::indexForBytecodeIndex):
      (JSC::Profiler::Bytecodes::forBytecodeIndex):
      (JSC::Profiler::Bytecodes::dump):
      (JSC::Profiler::Bytecodes::toJS):
      * profiler/ProfilerBytecodes.h: Added.
      (Profiler):
      (Bytecodes):
      (JSC::Profiler::Bytecodes::append):
      (JSC::Profiler::Bytecodes::id):
      (JSC::Profiler::Bytecodes::hash):
      (JSC::Profiler::Bytecodes::size):
      (JSC::Profiler::Bytecodes::at):
      * profiler/ProfilerCompilation.cpp: Added.
      (Profiler):
      (JSC::Profiler::Compilation::Compilation):
      (JSC::Profiler::Compilation::~Compilation):
      (JSC::Profiler::Compilation::addDescription):
      (JSC::Profiler::Compilation::executionCounterFor):
      (JSC::Profiler::Compilation::toJS):
      * profiler/ProfilerCompilation.h: Added.
      (Profiler):
      (Compilation):
      (JSC::Profiler::Compilation::bytecodes):
      (JSC::Profiler::Compilation::kind):
      * profiler/ProfilerCompilationKind.cpp: Added.
      (WTF):
      (WTF::printInternal):
      * profiler/ProfilerCompilationKind.h: Added.
      (Profiler):
      (WTF):
      * profiler/ProfilerCompiledBytecode.cpp: Added.
      (Profiler):
      (JSC::Profiler::CompiledBytecode::CompiledBytecode):
      (JSC::Profiler::CompiledBytecode::~CompiledBytecode):
      (JSC::Profiler::CompiledBytecode::toJS):
      * profiler/ProfilerCompiledBytecode.h: Added.
      (Profiler):
      (CompiledBytecode):
      (JSC::Profiler::CompiledBytecode::originStack):
      (JSC::Profiler::CompiledBytecode::description):
      * profiler/ProfilerDatabase.cpp: Added.
      (Profiler):
      (JSC::Profiler::Database::Database):
      (JSC::Profiler::Database::~Database):
      (JSC::Profiler::Database::addBytecodes):
      (JSC::Profiler::Database::ensureBytecodesFor):
      (JSC::Profiler::Database::notifyDestruction):
      (JSC::Profiler::Database::newCompilation):
      (JSC::Profiler::Database::toJS):
      (JSC::Profiler::Database::toJSON):
      (JSC::Profiler::Database::save):
      * profiler/ProfilerDatabase.h: Added.
      (Profiler):
      (Database):
      * profiler/ProfilerExecutionCounter.h: Added.
      (Profiler):
      (ExecutionCounter):
      (JSC::Profiler::ExecutionCounter::ExecutionCounter):
      (JSC::Profiler::ExecutionCounter::address):
      (JSC::Profiler::ExecutionCounter::count):
      * profiler/ProfilerOrigin.cpp: Added.
      (Profiler):
      (JSC::Profiler::Origin::Origin):
      (JSC::Profiler::Origin::dump):
      (JSC::Profiler::Origin::toJS):
      * profiler/ProfilerOrigin.h: Added.
      (JSC):
      (Profiler):
      (Origin):
      (JSC::Profiler::Origin::Origin):
      (JSC::Profiler::Origin::operator!):
      (JSC::Profiler::Origin::bytecodes):
      (JSC::Profiler::Origin::bytecodeIndex):
      (JSC::Profiler::Origin::operator!=):
      (JSC::Profiler::Origin::operator==):
      (JSC::Profiler::Origin::hash):
      (JSC::Profiler::Origin::isHashTableDeletedValue):
      (JSC::Profiler::OriginHash::hash):
      (JSC::Profiler::OriginHash::equal):
      (OriginHash):
      (WTF):
      * profiler/ProfilerOriginStack.cpp: Added.
      (Profiler):
      (JSC::Profiler::OriginStack::OriginStack):
      (JSC::Profiler::OriginStack::~OriginStack):
      (JSC::Profiler::OriginStack::append):
      (JSC::Profiler::OriginStack::operator==):
      (JSC::Profiler::OriginStack::hash):
      (JSC::Profiler::OriginStack::dump):
      (JSC::Profiler::OriginStack::toJS):
      * profiler/ProfilerOriginStack.h: Added.
      (JSC):
      (Profiler):
      (OriginStack):
      (JSC::Profiler::OriginStack::OriginStack):
      (JSC::Profiler::OriginStack::operator!):
      (JSC::Profiler::OriginStack::size):
      (JSC::Profiler::OriginStack::fromBottom):
      (JSC::Profiler::OriginStack::fromTop):
      (JSC::Profiler::OriginStack::isHashTableDeletedValue):
      (JSC::Profiler::OriginStackHash::hash):
      (JSC::Profiler::OriginStackHash::equal):
      (OriginStackHash):
      (WTF):
      * runtime/CommonIdentifiers.h:
      * runtime/ExecutionHarness.h:
      (JSC::prepareForExecution):
      (JSC::prepareFunctionForExecution):
      * runtime/JSGlobalData.cpp:
      (JSC::JSGlobalData::JSGlobalData):
      (JSC::JSGlobalData::~JSGlobalData):
      * runtime/JSGlobalData.h:
      (JSGlobalData):
      * runtime/Options.h:
      (JSC):
      
      Source/WTF: 
      
      Made some minor changes to support the new profiler. FileOutputStream now has an
      open() method, and DataLog uses it. StringPrintStream has a reset() method, which
      allows you to reuse the same StringPrintStream for creating multiple strings.
      SegmentedVector now has a const operator[]. And, WTFString now can do fromUTF8() on
      a CString directly.
      
      * wtf/DataLog.cpp:
      (WTF::initializeLogFileOnce):
      * wtf/FilePrintStream.cpp:
      (WTF::FilePrintStream::open):
      (WTF):
      * wtf/FilePrintStream.h:
      * wtf/SegmentedVector.h:
      (WTF::SegmentedVector::at):
      (SegmentedVector):
      (WTF::SegmentedVector::operator[]):
      * wtf/StringPrintStream.cpp:
      (WTF::StringPrintStream::reset):
      (WTF):
      * wtf/StringPrintStream.h:
      (StringPrintStream):
      * wtf/text/WTFString.cpp:
      (WTF::String::fromUTF8):
      (WTF):
      * wtf/text/WTFString.h:
      (String):
      
      Tools: 
      
      Added a tool that allows you to grok the output from JSC's new profiler. Currently,
      this still gets confused a bit about the execution counts of a method running
      standalone versus a method running inlined, but other than that, it's pretty cool.
      See the attached "sampling profiling session" attached to the bug to see it in
      action.
              
      Also had to feed EFL's build system.
      
      * DumpRenderTree/efl/CMakeLists.txt:
      * Scripts/display-profiler-output: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136601 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4a81fa41
  6. 17 Oct, 2012 1 commit
    • fpizlo@apple.com's avatar
      Array and object allocations via 'new Object' or 'new Array' should be inlined... · 4500e353
      fpizlo@apple.com authored
      Array and object allocations via 'new Object' or 'new Array' should be inlined in bytecode to allow allocation site profiling
      https://bugs.webkit.org/show_bug.cgi?id=99557
      
      Reviewed by Geoffrey Garen.
      
      This uses the old jneq_ptr trick to allow for the bytecode to "see" that the
      operation in question is what we almost certainly know it to be.
      
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::dump):
      * bytecode/Opcode.h:
      (JSC):
      (JSC::padOpcodeName):
      * bytecode/SpecialPointer.h:
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::emitCall):
      (JSC::BytecodeGenerator::emitCallEval):
      (JSC::BytecodeGenerator::expectedFunctionForIdentifier):
      (JSC):
      (JSC::BytecodeGenerator::emitExpectedFunctionSnippet):
      (JSC::BytecodeGenerator::emitConstruct):
      * bytecompiler/BytecodeGenerator.h:
      (BytecodeGenerator):
      * bytecompiler/NodesCodegen.cpp:
      (JSC::NewExprNode::emitBytecode):
      (JSC::FunctionCallValueNode::emitBytecode):
      (JSC::FunctionCallResolveNode::emitBytecode):
      (JSC::FunctionCallBracketNode::emitBytecode):
      (JSC::FunctionCallDotNode::emitBytecode):
      (JSC::CallFunctionCallDotNode::emitBytecode):
      (JSC::ApplyFunctionCallDotNode::emitBytecode):
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::parseBlock):
      * dfg/DFGCapabilities.h:
      (JSC::DFG::canCompileOpcode):
      * jit/JIT.cpp:
      (JSC::JIT::privateCompileMainPass):
      * jit/JIT.h:
      (JIT):
      * jit/JITOpcodes.cpp:
      (JSC::JIT::emit_op_new_array_with_size):
      (JSC):
      * jit/JITStubs.cpp:
      (JSC::DEFINE_STUB_FUNCTION):
      (JSC):
      * jit/JITStubs.h:
      * llint/LLIntSlowPaths.cpp:
      (JSC::LLInt::LLINT_SLOW_PATH_DECL):
      (LLInt):
      * llint/LLIntSlowPaths.h:
      (LLInt):
      * llint/LowLevelInterpreter.asm:
      * runtime/ArrayConstructor.cpp:
      (JSC::constructArrayWithSizeQuirk):
      (JSC):
      * runtime/ArrayConstructor.h:
      (JSC):
      * runtime/CommonIdentifiers.h:
      * runtime/JSGlobalObject.cpp:
      (JSC::JSGlobalObject::reset):
      (JSC):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131644 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4500e353
  7. 17 Apr, 2012 1 commit
    • barraclough@apple.com's avatar
      Array.prototype.toString should be generic · 364138ec
      barraclough@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=81588
      
      Reviewed by Sam Weinig.
      
      Source/JavaScriptCore: 
      
      * runtime/ArrayPrototype.cpp:
      (JSC::arrayProtoFuncToString):
          - check for join function, use fast case if base object is array & join is present & default.
      * runtime/CommonIdentifiers.h:
          - added 'join'.
      
      LayoutTests: 
      
      * fast/js/array-functions-non-arrays-expected.txt:
          - check in new results
      * fast/js/array-prototype-properties-expected.txt:
          - new more detailed error message.
      * fast/js/script-tests/array-functions-non-arrays.js:
          - added new test cases, fix incorrect one.
      * sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.2_Array_prototype_toString/S15.4.4.2_A2_T1-expected.txt:
          - check in failing result (test is wrong)
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114405 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      364138ec
  8. 13 Apr, 2012 2 commits
  9. 05 Apr, 2012 1 commit
    • benjamin@webkit.org's avatar
      Speed up the conversion from JSValue to String for bulk operations · 8063cc71
      benjamin@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=83243
      
      Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-04-05
      Reviewed by Geoffrey Garen.
      
      When making operations on primitive types, we loose some time converting
      values to JSString in order to extract the string.
      
      This patch speeds up some basic Array operations by avoiding the creation
      of intermediary JSString when possible.
      
      For the cases where we need to convert a lot of JSValue in a tight loop,
      an inline conversion is used.
      
      * runtime/ArrayPrototype.cpp:
      (JSC::arrayProtoFuncToString):
      (JSC::arrayProtoFuncToLocaleString):
      (JSC::arrayProtoFuncJoin):
      (JSC::arrayProtoFuncPush):
      (JSC::arrayProtoFuncSort):
      * runtime/CommonIdentifiers.h:
      * runtime/JSArray.cpp:
      (JSC::JSArray::sort):
      * runtime/JSString.h:
      (JSC::JSValue::toUString):
      (JSC):
      (JSC::inlineJSValueNotStringtoUString):
      (JSC::JSValue::toUStringInline):
      * runtime/JSValue.cpp:
      (JSC::JSValue::toUStringSlowCase):
      (JSC):
      * runtime/JSValue.h:
      (JSValue):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113396 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8063cc71
  10. 20 Mar, 2012 1 commit
    • benjamin@webkit.org's avatar
      Cache the type string of JavaScript object · 25ecbabb
      benjamin@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=81446
      
      Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-03-20
      Reviewed by Geoffrey Garen.
      
      Instead of creating the JSString every time, we create
      lazily the strings in JSGlobalData.
      
      This avoid the construction of the StringImpl and of the JSString,
      which gives some performance improvements.
      
      * runtime/CommonIdentifiers.h:
      * runtime/JSValue.cpp:
      (JSC::JSValue::toStringSlowCase):
      * runtime/Operations.cpp:
      (JSC::jsTypeStringForValue):
      * runtime/SmallStrings.cpp:
      (JSC::SmallStrings::SmallStrings):
      (JSC::SmallStrings::finalizeSmallStrings):
      (JSC::SmallStrings::initialize):
      (JSC):
      * runtime/SmallStrings.h:
      (SmallStrings):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@111433 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      25ecbabb
  11. 27 Feb, 2012 1 commit
    • barraclough@apple.com's avatar
      RegExp lastIndex should behave as a regular property · 46406a91
      barraclough@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=79446
      
      Reviewed by Sam Weinig.
      
      lastIndex should be a regular data descriptor, with the attributes configurable:false,
      enumerable:false, writable:true. As such, it should be possible to reconfigure writable
      as false. If the lastIndex property is reconfigured to be read-only, we should respect
      this correctly.
      
      Source/JavaScriptCore: 
      
      * runtime/CommonIdentifiers.h:
          - Removed some unused identifiers, added lastIndex.
      * runtime/RegExpObject.cpp:
      (JSC::RegExpObject::getOwnPropertySlot):
          - lastIndex is no longer a static value, provided specific handling.
      (JSC::RegExpObject::getOwnPropertyDescriptor):
          - lastIndex is no longer a static value, provided specific handling.
      (JSC::RegExpObject::deleteProperty):
          - lastIndex is no longer a static value, provided specific handling.
      (JSC::RegExpObject::getOwnPropertyNames):
          - lastIndex is no longer a static value, provided specific handling.
      (JSC::RegExpObject::getPropertyNames):
          - lastIndex is no longer a static value, provided specific handling.
      (JSC::reject):
          - helper function for defineOwnProperty.
      (JSC::RegExpObject::defineOwnProperty):
          - lastIndex is no longer a static value, provided specific handling.
      (JSC::RegExpObject::put):
          - lastIndex is no longer a static value, provided specific handling.
      (JSC::RegExpObject::match):
          - Pass setLastIndex an ExecState, so it can throw if read-only.
      * runtime/RegExpObject.h:
      (JSC::RegExpObject::setLastIndex):
          - Pass setLastIndex an ExecState, so it can throw if read-only.
      (RegExpObjectData):
          - Added lastIndexIsWritable.
      * runtime/RegExpPrototype.cpp:
      (JSC::regExpProtoFuncCompile):
          - Pass setLastIndex an ExecState, so it can throw if read-only.
      
      LayoutTests: 
      
      * fast/regex/lastIndex-expected.txt: Added.
      * fast/regex/lastIndex.html: Added.
      * fast/regex/script-tests/lastIndex.js: Added.
          - Added test cases for correct handling of lastIndex.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@109008 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      46406a91
  12. 17 Feb, 2012 1 commit
    • oliver@apple.com's avatar
      Implement Error.stack · ddf4b487
      oliver@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=66994
      
      Reviewed by Gavin Barraclough.
      
      Source/JavaScriptCore:
      
      Implement support for stack traces on exception objects.  This is a rewrite
      of the core portion of the last stack walking logic, but the mechanical work
      of adding the information to an exception comes from the original work by
      Juan Carlos Montemayor Elosua.
      
      * interpreter/Interpreter.cpp:
      (JSC::getCallerInfo):
      (JSC):
      (JSC::getSourceURLFromCallFrame):
      (JSC::getStackFrameCodeType):
      (JSC::Interpreter::getStackTrace):
      (JSC::Interpreter::throwException):
      (JSC::Interpreter::privateExecute):
      * interpreter/Interpreter.h:
      (JSC):
      (StackFrame):
      (JSC::StackFrame::toString):
      (Interpreter):
      * jsc.cpp:
      (GlobalObject::finishCreation):
      (functionJSCStack):
      * parser/Nodes.h:
      (JSC::FunctionBodyNode::setInferredName):
      * parser/Parser.h:
      (JSC::::parse):
      * runtime/CommonIdentifiers.h:
      * runtime/Error.cpp:
      (JSC::addErrorInfo):
      * runtime/Error.h:
      (JSC):
      
      LayoutTests:
      
      Add testcases for producing a stack trace on exception objects.
      
      * fast/js/exception-properties-expected.txt:
      * fast/js/script-tests/exception-properties.js:
      * fast/js/script-tests/stack-trace.js: Added.
      (printStack):
      (hostThrower):
      (callbacker):
      (outer):
      (inner):
      (evaler):
      (normalOuter):
      (normalInner):
      (scripterInner):
      (scripterOuter):
      (selfRecursive1):
      (selfRecursive2):
      (selfRecursive3):
      (throwError):
      (object.get getter1.o.valueOf):
      (object.get getter1):
      (object.get getter2):
      (object.get getter3.o2.valueOf):
      (object.get getter3):
      (object.nonInlineable.callCount):
      (object.nonInlineable):
      (object.inlineable):
      (yetAnotherInlinedCall):
      (makeInlinableCall):
      (.try.g):
      (h):
      (mapTest):
      (mapTestDriver):
      (dfgFunction):
      (try.f):
      * fast/js/stack-trace-expected.txt: Added.
      * fast/js/stack-trace.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ddf4b487
  13. 16 Feb, 2012 2 commits
    • ossy@webkit.org's avatar
      Unreviewed. Rolling out r107980, because it broke 32 bit platforms. · e412a79a
      ossy@webkit.org authored
      Source/JavaScriptCore:
      
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::throwException):
      (JSC::Interpreter::privateExecute):
      * interpreter/Interpreter.h:
      (JSC):
      (Interpreter):
      * jsc.cpp:
      (GlobalObject::finishCreation):
      * parser/Nodes.h:
      (JSC::FunctionBodyNode::setInferredName):
      * parser/Parser.h:
      (JSC::::parse):
      * runtime/CommonIdentifiers.h:
      * runtime/Error.cpp:
      (JSC::addErrorInfo):
      * runtime/Error.h:
      (JSC):
      
      LayoutTests:
      
      * fast/js/exception-properties-expected.txt:
      * fast/js/script-tests/exception-properties.js:
      * fast/js/script-tests/stack-trace.js: Removed.
      * fast/js/stack-trace-expected.txt: Removed.
      * fast/js/stack-trace.html: Removed.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e412a79a
    • oliver@apple.com's avatar
      Implement Error.stack · 49d0475c
      oliver@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=66994
      
      Reviewed by Gavin Barraclough.
      
      Source/JavaScriptCore:
      
      Implement support for stack traces on exception objects.  This is a rewrite
      of the core portion of the last stack walking logic, but the mechanical work
      of adding the information to an exception comes from the original work by
      Juan Carlos Montemayor Elosua.
      
      * interpreter/Interpreter.cpp:
      (JSC::getCallerInfo):
      (JSC):
      (JSC::getSourceURLFromCallFrame):
      (JSC::getStackFrameCodeType):
      (JSC::Interpreter::getStackTrace):
      (JSC::Interpreter::throwException):
      (JSC::Interpreter::privateExecute):
      * interpreter/Interpreter.h:
      (JSC):
      (StackFrame):
      (JSC::StackFrame::toString):
      (Interpreter):
      * jsc.cpp:
      (GlobalObject::finishCreation):
      (functionJSCStack):
      * parser/Nodes.h:
      (JSC::FunctionBodyNode::setInferredName):
      * parser/Parser.h:
      (JSC::::parse):
      * runtime/CommonIdentifiers.h:
      * runtime/Error.cpp:
      (JSC::addErrorInfo):
      * runtime/Error.h:
      (JSC):
      
      LayoutTests:
      
      Add testcases for producing a stack trace on exception objects.
      
      * fast/js/exception-properties-expected.txt:
      * fast/js/script-tests/exception-properties.js:
      * fast/js/script-tests/stack-trace.js: Added.
      (printStack):
      (hostThrower):
      (callbacker):
      (outer):
      (inner):
      (evaler):
      (normalOuter):
      (normalInner):
      (scripterInner):
      (scripterOuter):
      (selfRecursive1):
      (selfRecursive2):
      (selfRecursive3):
      (throwError):
      (object.get getter1.o.valueOf):
      (object.get getter1):
      (object.get getter2):
      (object.get getter3.o2.valueOf):
      (object.get getter3):
      (object.nonInlineable.callCount):
      (object.nonInlineable):
      (object.inlineable):
      (yetAnotherInlinedCall):
      (makeInlinableCall):
      (.try.g):
      (h):
      (mapTest):
      (mapTestDriver):
      (dfgFunction):
      (try.f):
      * fast/js/stack-trace-expected.txt: Added.
      * fast/js/stack-trace.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107980 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      49d0475c
  14. 01 Feb, 2012 1 commit
    • ossy@webkit.org's avatar
      Implement Error.stack · 0d2b6111
      ossy@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=66994
      
      Unreviewed, rolling out r106407.
      
      Source/JavaScriptCore:
      
      * JavaScriptCore.exp:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
      * interpreter/AbstractPC.cpp:
      (JSC::AbstractPC::AbstractPC):
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::throwException):
      * interpreter/Interpreter.h:
      (JSC):
      (Interpreter):
      * jsc.cpp:
      (GlobalObject::finishCreation):
      * parser/Parser.h:
      (JSC::::parse):
      * runtime/CommonIdentifiers.h:
      * runtime/Error.cpp:
      (JSC::addErrorInfo):
      * runtime/Error.h:
      (JSC):
      
      LayoutTests:
      
      * fast/js/exception-properties-expected.txt:
      * fast/js/script-tests/exception-properties.js:
      * fast/js/script-tests/stack-trace.js: Removed.
      * fast/js/stack-trace-expected.txt: Removed.
      * fast/js/stack-trace.html: Removed.
      * platform/chromium/test_expectations.txt:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106454 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0d2b6111
  15. 31 Jan, 2012 1 commit
    • oliver@apple.com's avatar
      Implement Error.stack · 435c2e23
      oliver@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=66994
      
      Source/JavaScriptCore:
      
      Reviewed by Gavin Barraclough.
      
      Original patch by Juan Carlos Montemayor Elosua:
          This patch utilizes topCallFrame to create a stack trace when
          an error is thrown. Users will also be able to use the stack()
          command in jsc to get arrays with stack trace information.
      
      Modified to be correct on ToT, with a variety of correctness,
      performance, and security improvements.
      
      * JavaScriptCore.exp:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
      * interpreter/Interpreter.cpp:
      (JSC::getCallerLine):
      (JSC::getSourceURLFromCallFrame):
      (JSC::getStackFrameCodeType):
      (JSC::Interpreter::getStackTrace):
      (JSC::Interpreter::throwException):
      * interpreter/Interpreter.h:
      (JSC::StackFrame::toString):
      * jsc.cpp:
      (GlobalObject::finishCreation):
      (functionJSCStack):
      * parser/Parser.h:
      (JSC::Parser::parse):
      * runtime/CommonIdentifiers.h:
      * runtime/Error.cpp:
      (JSC::addErrorInfo):
      * runtime/Error.h:
      
      LayoutTests:
      
      Reviewed by Gavin Barraclough
      
      Original patch by Juan Carlos Montemayor Elosua.
      
      Unit tests that contain both normal and special cases for stack trace
      generation.
      
      * fast/js/exception-properties-expected.txt:
      * fast/js/script-tests/exception-properties.js:
      * fast/js/script-tests/stack-trace.js: Added.
      (printStack):
      (hostThrower):
      (callbacker):
      (outer):
      (inner):
      (evaler):
      (normalOuter):
      (normalInner):
      (scripterInner):
      (scripterOuter):
      * fast/js/stack-trace-expected.txt: Added.
      * fast/js/stack-trace.html: Added.
      * platform/chromium/test_expectations.txt:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106407 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      435c2e23
  16. 18 Oct, 2011 1 commit
    • ggaren@apple.com's avatar
      Switched ropes from malloc memory to GC memory · fbf6d9a0
      ggaren@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=70364
      
      Reviewed by Gavin Barraclough.
      
      ~1% SunSpider speedup. Neutral elsewhere. Removes one cause for strings
      having C++ destructors.
      
      * heap/MarkStack.cpp:
      (JSC::visitChildren): Call the JSString visitChildren function now,
      since it's no longer a no-op.
      
      * runtime/JSString.cpp:
      (JSC::JSString::~JSString): Moved this destructor out of line because
      it's called virtually, so there's no value to inlining.
      
      (JSC::JSString::RopeBuilder::expand): Switched RopeBuilder to be a thin
      initializing wrapper around JSString. JSString now represents ropes
      directly, rather than relying on an underlying malloc object.
      
      (JSC::JSString::visitChildren): Visit our rope fibers, since they're GC
      objects now.
      
      (JSC::JSString::resolveRope):
      (JSC::JSString::resolveRopeSlowCase):
      (JSC::JSString::outOfMemory): Updated for operating on JSStrings instead
      of malloc objects.
      
      (JSC::JSString::replaceCharacter): Removed optimizations for substringing
      ropes and replacing subsections of ropes. We want to reimplement versions
      of these optimizations in the future, but this patch already has good
      performance without them.
      
      * runtime/JSString.h:
      (JSC::RopeBuilder::JSString):
      (JSC::RopeBuilder::finishCreation):
      (JSC::RopeBuilder::createNull):
      (JSC::RopeBuilder::create):
      (JSC::RopeBuilder::createHasOtherOwner):
      (JSC::jsSingleCharacterString):
      (JSC::jsSingleCharacterSubstring):
      (JSC::jsNontrivialString):
      (JSC::jsString):
      (JSC::jsSubstring):
      (JSC::jsOwnedString): Lots of mechanical changes here. The two important
      things are: (1) The fibers in JSString::m_fibers are JSStrings now, not
      malloc objects; (2) I simplified the JSString constructor interface to
      only accept PassRefPtr<StringImpl>, instead of variations on that like
      UString, reducing refcount churn.
      
      * runtime/JSValue.h:
      * runtime/JSValue.cpp:
      (JSC::JSValue::toPrimitiveString): Updated this function to return a
      JSString instead of a UString, since that's what clients want now.
      
      * runtime/Operations.cpp:
      (JSC::jsAddSlowCase):
      * runtime/Operations.h:
      (JSC::jsString):
      * runtime/SmallStrings.cpp:
      (JSC::SmallStrings::createEmptyString): Updated for interface changes above.
      
      * runtime/StringConstructor.cpp:
      (JSC::constructWithStringConstructor):
      * runtime/StringObject.h:
      (JSC::StringObject::create): Don't create a new JSString if we already
      have a JSString.
      
      * runtime/StringPrototype.cpp:
      (JSC::stringProtoFuncConcat): Updated for interface changes above.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97827 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fbf6d9a0
  17. 27 Sep, 2011 2 commits
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r96131. · 3b381c1e
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/96131
      https://bugs.webkit.org/show_bug.cgi?id=68927
      
      It made 18+ tests crash on all platform (Requested by
      Ossy_night on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2011-09-27
      
      Source/JavaScriptCore:
      
      * JavaScriptCore.exp:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::throwException):
      * interpreter/Interpreter.h:
      * jsc.cpp:
      (GlobalObject::finishCreation):
      * parser/Parser.h:
      (JSC::Parser::parse):
      * runtime/CommonIdentifiers.h:
      * runtime/Error.cpp:
      (JSC::addErrorInfo):
      * runtime/Error.h:
      
      LayoutTests:
      
      * fast/js/exception-properties-expected.txt:
      * fast/js/script-tests/exception-properties.js:
      * fast/js/script-tests/stack-trace.js: Removed.
      * fast/js/stack-trace-expected.txt: Removed.
      * fast/js/stack-trace.html: Removed.
      * platform/chromium/test_expectations.txt:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96146 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3b381c1e
    • commit-queue@webkit.org's avatar
      Implement Error.stack · f177874f
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=66994
      
      Patch by Juan Carlos Montemayor Elosua <j.mont@me.com> on 2011-09-27
      Reviewed by Oliver Hunt.
      
      Source/JavaScriptCore:
      
      This patch utilizes topCallFrame to create a stack trace when
      an error is thrown. Users will also be able to use the stack()
      command in jsc to get arrays with stack trace information.
      
      * JavaScriptCore.exp:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
      * interpreter/Interpreter.cpp:
      (JSC::getCallerLine):
      (JSC::getSourceURLFromCallFrame):
      (JSC::getStackFrameCodeType):
      (JSC::Interpreter::getStackTrace):
      (JSC::Interpreter::throwException):
      * interpreter/Interpreter.h:
      (JSC::StackFrame::toString):
      * jsc.cpp:
      (GlobalObject::finishCreation):
      (functionJSCStack):
      * parser/Parser.h:
      (JSC::Parser::parse):
      * runtime/CommonIdentifiers.h:
      * runtime/Error.cpp:
      (JSC::addErrorInfo):
      * runtime/Error.h:
      
      LayoutTests:
      
      Unit tests that contain both normal and special cases for stack trace
      generation.
      
      * fast/js/exception-properties-expected.txt:
      * fast/js/script-tests/exception-properties.js:
      * fast/js/script-tests/stack-trace.js: Added.
      (printStack):
      (hostThrower):
      (callbacker):
      (outer):
      (inner):
      (evaler):
      (normalOuter):
      (normalInner):
      (scripterInner):
      (scripterOuter):
      * fast/js/stack-trace-expected.txt: Added.
      * fast/js/stack-trace.html: Added.
      * platform/chromium/test_expectations.txt:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96131 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f177874f
  18. 22 Sep, 2011 1 commit
    • barraclough@apple.com's avatar
      Implement Function.prototype.bind · 22215665
      barraclough@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=26382
      
      Reviewed by Sam Weinig.
      
      Source/JavaScriptCore: 
      
      This patch provides a basic functional implementation
      for Function.bind. It should (hopefully!) be fully
      functionally correct, and the bound functions can be
      called to quickly (since they are a subclass of
      JSFunction, not InternalFunction), but we'll probably
      want to follow up with some optimization work to keep
      bound calls in JIT code.
      
      * JavaScriptCore.JSVALUE32_64only.exp:
      * JavaScriptCore.JSVALUE64only.exp:
      * JavaScriptCore.exp:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * jit/JITStubs.cpp:
      (JSC::JITThunks::hostFunctionStub):
      * jit/JITStubs.h:
      * jsc.cpp:
      (GlobalObject::addFunction):
      * runtime/CommonIdentifiers.h:
      * runtime/ConstructData.h:
      * runtime/Executable.h:
      (JSC::NativeExecutable::NativeExecutable):
      * runtime/FunctionPrototype.cpp:
      (JSC::FunctionPrototype::addFunctionProperties):
      (JSC::functionProtoFuncBind):
      * runtime/FunctionPrototype.h:
      * runtime/JSBoundFunction.cpp: Added.
      (JSC::boundFunctionCall):
      (JSC::boundFunctionConstruct):
      (JSC::JSBoundFunction::create):
      (JSC::JSBoundFunction::hasInstance):
      (JSC::JSBoundFunction::getOwnPropertySlot):
      (JSC::JSBoundFunction::getOwnPropertyDescriptor):
      (JSC::JSBoundFunction::JSBoundFunction):
      (JSC::JSBoundFunction::finishCreation):
      * runtime/JSBoundFunction.h: Added.
      (JSC::JSBoundFunction::targetFunction):
      (JSC::JSBoundFunction::boundThis):
      (JSC::JSBoundFunction::boundArgs):
      (JSC::JSBoundFunction::createStructure):
      * runtime/JSFunction.cpp:
      (JSC::JSFunction::create):
      (JSC::JSFunction::finishCreation):
      (JSC::createDescriptorForThrowingProperty):
      (JSC::JSFunction::getOwnPropertySlot):
      * runtime/JSFunction.h:
      * runtime/JSGlobalData.cpp:
      (JSC::JSGlobalData::getHostFunction):
      * runtime/JSGlobalData.h:
      * runtime/JSGlobalObject.cpp:
      (JSC::JSGlobalObject::reset):
      (JSC::JSGlobalObject::visitChildren):
      * runtime/JSGlobalObject.h:
      (JSC::JSGlobalObject::boundFunctionStructure):
      * runtime/Lookup.cpp:
      (JSC::setUpStaticFunctionSlot):
      
      Source/WebCore: 
      
      Test: fast/js/function-bind.html
      
      * bindings/js/JSDOMBinding.cpp:
      (WebCore::objectToStringFunctionGetter):
      * bindings/js/JSDOMWindowCustom.cpp:
      (WebCore::nonCachingStaticFunctionGetter):
      * bindings/js/JSHistoryCustom.cpp:
      (WebCore::nonCachingStaticBackFunctionGetter):
      (WebCore::nonCachingStaticForwardFunctionGetter):
      (WebCore::nonCachingStaticGoFunctionGetter):
      * bindings/js/JSLocationCustom.cpp:
      (WebCore::nonCachingStaticReplaceFunctionGetter):
      (WebCore::nonCachingStaticReloadFunctionGetter):
      (WebCore::nonCachingStaticAssignFunctionGetter):
          - Function::create no longer requires functionStructure() to be passed.
      
      LayoutTests: 
      
      We now pass Function.bind tests.
      
      * fast/js/Object-getOwnPropertyNames-expected.txt:
      * fast/js/basic-strict-mode-expected.txt:
      * fast/js/function-bind-expected.txt: Added.
      * fast/js/function-bind.html: Added.
      * fast/js/mozilla/strict/15.3.4.5-expected.txt:
      * fast/js/script-tests/function-bind.js: Added.
      * ietestcenter/Javascript/15.2.3.3-4-38-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-0-1-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-0-2-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-13.b-1-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-13.b-2-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-13.b-3-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-13.b-4-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-13.b-5-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-15-1-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-15-2-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-16-1-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-2-1-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-2-2-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-2-3-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-2-4-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-2-5-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-2-6-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-2-7-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-2-8-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-2-9-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-8-1-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-8-2-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-9-1-expected.txt:
      * ietestcenter/Javascript/15.3.4.5-9-2-expected.txt:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95751 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      22215665
  19. 16 Jun, 2011 1 commit
    • barraclough@apple.com's avatar
      https://bugs.webkit.org/show_bug.cgi?id=53014 · 93e9016d
      barraclough@apple.com authored
      ES5 strict mode keyword restrictions aren't implemented
      
      Reviewed by Oliver Hunt.
      
      The following are future restricted words is strict mode code:
          implements, interface, let, package, private, protected, public, static, yield
      
      Source/JavaScriptCore: 
      
      * parser/JSParser.h:
          - Add RESERVED_IF_STRICT token.
      * parser/Keywords.table:
          - Add new future restricted words.
      * parser/Lexer.cpp:
      (JSC::Lexer::parseIdentifier):
          - Check for RESERVED_IF_STRICT; in nonstrict code this is converted to IDENT.
      (JSC::Lexer::lex):
          - Pass strictMode flag to parseIdentifier.
      * parser/Lexer.h:
          - parseIdentifier needs a strictMode flag.
      * runtime/CommonIdentifiers.h:
          - Add identifiers for new reserved words.
      
      LayoutTests: 
      
      * fast/js/keywords-and-reserved_words-expected.txt: Added.
      * fast/js/keywords-and-reserved_words.html: Added.
      * fast/js/script-tests/keywords-and-reserved_words.js: Added.
      (isKeyword):
      (isStrictKeyword):
      (classifyIdentifier):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@89109 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      93e9016d
  20. 04 Jun, 2011 1 commit
    • oliver@apple.com's avatar
      2011-06-03 Oliver Hunt <oliver@apple.com> · 77099a66
      oliver@apple.com authored
              Reviewed by Maciej Stachowiak.
      
              Lexer needs to provide Identifier for reserved words
              https://bugs.webkit.org/show_bug.cgi?id=62086
      
              Alas it is necessary to provide an Identifier reference for keywords
              so that we can do the right thing when they're used in object literals.
              We now keep Identifiers for all reserved words in the CommonIdentifiers
              structure so that we can access them without a hash lookup.
      
              * KeywordLookupGenerator.py:
              * parser/Lexer.cpp:
              (JSC::Lexer::parseIdentifier):
              * parser/Lexer.h:
              * runtime/CommonIdentifiers.cpp:
              (JSC::CommonIdentifiers::CommonIdentifiers):
              * runtime/CommonIdentifiers.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@88094 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      77099a66
  21. 04 Mar, 2011 1 commit
    • barraclough@apple.com's avatar
      Bug 55736 - Implement seal/freeze/preventExtensions for normal object types. · dd993107
      barraclough@apple.com authored
      Provide basic functionallity from section 15.2.4 of ECMA-262.
      This support will need expanding to cover arrays, too.
      
      Reviewed by Sam Weinig.
      
      Source/JavaScriptCore: 
      
      Shows a 0.5% progression on SunSpidey, this seems to be due to changing
      ObjectConstructor to use a static table.
      
      * DerivedSources.make:
      * JavaScriptCore.exp:
      * interpreter/CallFrame.h:
      (JSC::ExecState::objectConstructorTable):
          Add a static table for ObjectConstructor.
      * runtime/CommonIdentifiers.h:
      * runtime/JSGlobalData.cpp:
      (JSC::JSGlobalData::JSGlobalData):
      (JSC::JSGlobalData::~JSGlobalData):
          Add a static table for ObjectConstructor.
      * runtime/JSGlobalData.h:
      * runtime/JSGlobalObject.cpp:
      (JSC::JSGlobalObject::reset):
          Add a static table for ObjectConstructor.
      * runtime/JSObject.cpp:
      (JSC::JSObject::seal):
      (JSC::JSObject::freeze):
      (JSC::JSObject::preventExtensions):
          Transition the object's structure.
      (JSC::JSObject::defineOwnProperty):
          Check isExtensible.
      * runtime/JSObject.h:
      (JSC::JSObject::isSealed):
      (JSC::JSObject::isFrozen):
      (JSC::JSObject::isExtensible):
          These wrap method on structure.
      (JSC::JSObject::putDirectInternal):
          Check isExtensible.
      * runtime/ObjectConstructor.cpp:
      (JSC::ObjectConstructor::ObjectConstructor):
      (JSC::ObjectConstructor::getOwnPropertySlot):
      (JSC::ObjectConstructor::getOwnPropertyDescriptor):
          Change ObjectConstructor to use a static table.
      (JSC::objectConstructorSeal):
      (JSC::objectConstructorFreeze):
      (JSC::objectConstructorPreventExtensions):
      (JSC::objectConstructorIsSealed):
      (JSC::objectConstructorIsFrozen):
      (JSC::objectConstructorIsExtensible):
          Add new methods on Object.
      * runtime/ObjectConstructor.h:
      (JSC::ObjectConstructor::createStructure):
      * runtime/Structure.cpp:
      (JSC::Structure::Structure):
          init/propagate  m_preventExtensions
      (JSC::Structure::sealTransition):
      (JSC::Structure::freezeTransition):
      (JSC::Structure::preventExtensionsTransition):
          transition the structure, materializing the property map, setting m_preventExtensions & changing attributes.
      (JSC::Structure::isSealed):
      (JSC::Structure::isFrozen):
          check attributes to detect if object is sealed/frozen.
      * runtime/Structure.h:
      (JSC::Structure::isExtensible):
          checks the m_preventExtensions flag.
      
      LayoutTests: 
      
      Update results - many more tests PASS.
      Also adds a new testcase.
      
      * fast/js/Object-getOwnPropertyNames-expected.txt:
      * fast/js/script-tests/Object-getOwnPropertyNames.js:
      * ietestcenter/Javascript/15.2.3.10-0-1-expected.txt:
      * ietestcenter/Javascript/15.2.3.10-0-2-expected.txt:
      * ietestcenter/Javascript/15.2.3.10-1-expected.txt:
      * ietestcenter/Javascript/15.2.3.10-2-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-0-1-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-0-2-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-1-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-1-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-10-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-11-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-12-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-13-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-14-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-15-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-16-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-17-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-18-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-19-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-2-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-20-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-21-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-22-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-23-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-24-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-25-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-26-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-27-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-3-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-4-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-5-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-6-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-7-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-8-expected.txt:
      * ietestcenter/Javascript/15.2.3.11-4-9-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-0-1-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-0-2-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-1-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-1-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-10-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-11-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-12-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-13-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-14-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-15-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-16-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-17-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-18-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-19-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-2-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-20-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-21-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-22-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-23-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-24-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-25-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-26-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-27-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-3-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-4-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-5-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-6-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-7-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-8-expected.txt:
      * ietestcenter/Javascript/15.2.3.12-3-9-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-0-1-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-0-2-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-0-3-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-1-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-1-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-10-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-11-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-12-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-13-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-14-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-15-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-16-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-17-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-18-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-19-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-2-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-20-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-21-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-3-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-4-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-5-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-6-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-7-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-8-expected.txt:
      * ietestcenter/Javascript/15.2.3.13-2-9-expected.txt:
      * ietestcenter/Javascript/15.2.3.14-2-4-expected.txt:
      * ietestcenter/Javascript/15.2.3.14-2-5-expected.txt:
      * ietestcenter/Javascript/15.2.3.14-2-6-expected.txt:
      * ietestcenter/Javascript/15.2.3.3-4-20-expected.txt:
      * ietestcenter/Javascript/15.2.3.3-4-21-expected.txt:
      * ietestcenter/Javascript/15.2.3.3-4-22-expected.txt:
      * ietestcenter/Javascript/15.2.3.3-4-23-expected.txt:
      * ietestcenter/Javascript/15.2.3.3-4-24-expected.txt:
      * ietestcenter/Javascript/15.2.3.3-4-25-expected.txt:
      * ietestcenter/Javascript/15.2.3.4-4-2-expected.txt:
      * ietestcenter/Javascript/15.2.3.6-4-1-expected.txt:
      * ietestcenter/Javascript/15.2.3.8-0-1-expected.txt:
      * ietestcenter/Javascript/15.2.3.8-0-2-expected.txt:
      * ietestcenter/Javascript/15.2.3.8-1-expected.txt:
      * ietestcenter/Javascript/15.2.3.9-0-1-expected.txt:
      * ietestcenter/Javascript/15.2.3.9-0-2-expected.txt:
      * ietestcenter/Javascript/15.2.3.9-1-expected.txt:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      dd993107
  22. 20 Jan, 2011 1 commit
    • ossy@webkit.org's avatar
      Refactoring of the custom allocation framework · 95c1bc42
      ossy@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=49897
      
      Patch by Zoltan Horvath <zoltan@webkit.org> on 2011-01-20
      Reviewed by Csaba Osztrogonác.
      
      Source/JavaScriptCore:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      * wtf/FastAllocBase.h: Turn FastAllocBase's implementation into a macro.
      
      Source/WebCore:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      Source/WebKit:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      Source/WebKit2:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      Tools:
      
      Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
      The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
      equivalent macro implementation at the necessary places.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      95c1bc42
  23. 01 Jan, 2011 1 commit
    • abarth@webkit.org's avatar
      Move JavaScriptCore to Source · 76da8fc1
      abarth@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=51604
      
      Reviewed by Eric Seidel.
      
      Update references to JavaScriptCore to point to the new location.
      
      * Android.mk:
      * CMakeLists.txt:
      * DerivedSources.pro:
      * GNUmakefile.am:
      * Makefile:
      * WebKit.pri:
      * WebKit.pro:
      * wscript:
      
      Tools: 
      
      Update references to JavaScriptCore to point to the new location.
      
      * BuildSlaveSupport/build.webkit.org-config/master.cfg:
      * DumpRenderTree/qt/DumpRenderTree.pro:
      * DumpRenderTree/qt/ImageDiff.pro:
      * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
      * DumpRenderTree/wscript:
      * Scripts/build-jsc:
      * Scripts/build-webkit:
      * Scripts/do-file-rename:
      * Scripts/do-webcore-rename:
      * Scripts/run-javascriptcore-tests:
      * Scripts/update-javascriptcore-test-results:
      * Scripts/webkitdirs.pm:
      * Scripts/webkitpy/common/config/build_unittest.py:
      * Scripts/webkitpy/style/checker.py:
      * Scripts/webkitpy/style/checker_unittest.py:
      * Scripts/webkitpy/style/checkers/cpp_unittest.py:
      * WebKitTestRunner/InjectedBundle/qt/InjectedBundle.pro:
      * WebKitTestRunner/qt/WebKitTestRunner.pro:
      * wx/build/settings.py:
      
      WebCore: 
      
      Update references to JavaScriptCore.
      
      * Android.derived.jscbindings.mk:
      * Android.v8bindings.mk:
      * CMakeLists.txt:
      * WebCore.gyp/WebCore.gyp:
      * WebCore.pro:
        - These changes are subtle and might not be 100% correct.
      * move-js-headers.sh:
      
      WebKit/chromium: 
      
      * WebKit.gyp:
        - Point to JavaScriptCore in its new location.
      
      WebKit/gtk: 
      
      * GNUmakefile.am:
      * docs/GNUmakefile.am:
        - Point to JavaScriptCore in its new location.
      
      WebKit/qt: 
      
      * WebKit_pch.h:
      * docs/qtwebkit.qdocconf:
        - Point to JavaScriptCore in its new location.
      
      WebKit/win: 
      
      * WebKit.vcproj/WebKit.sln:
        - Point to JavaScriptCore in its new location.
      
      WebKit/wx: 
      
      * bindings/python/wscript:
      * wscript:
        - Point to JavaScriptCore in its new location.
      
      WebKit2: 
      
      * WebKit2.pro:
        - Point to JavaScriptCore in its new location.
      
      Websites/bugs.webkit.org: 
      
      * PrettyPatch/PrettyPatch.rb:
        - Remove reference to JavaScriptCore as a source directory.
      
      Websites/webkit.org: 
      
      * coding/assertion-guidelines.html:
        - Update documentation to point to the new location of
          JavaScriptCore.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74855 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      76da8fc1
  24. 11 Oct, 2010 1 commit
    • oliver@apple.com's avatar
      2010-10-01 Oliver Hunt <oliver@apple.com> · 5930185c
      oliver@apple.com authored
              Reviewed by Gavin Barraclough.
      
              [ES5] Implement strict mode
              https://bugs.webkit.org/show_bug.cgi?id=10701
      
              Initial strict mode implementation.  This is the simplest
              implementation that could possibly work and adds (hopefully)
              all of the restrictions required by strict mode.  There are
              a number of inefficiencies, especially in the handling of
              arguments and eval as smart implementations would make this
              patch more complicated.
      
              The SyntaxChecker AST builder has become somewhat more complex
              as strict mode does require more parse tree information to
              validate the syntax.
      
              Summary of major changes to the parser:
                  * We track when we enter strict mode (this may come as a surprise)
                  * Strict mode actually requires a degree of AST knowledge to validate
                    so the SyntaxChecker now produces values that can be used to distinguish
                    "node" types.
                  * We now track variables that are written to.  We do this to
                    statically identify writes to global properties that don't exist
                    and abort at that point.  This should actually make it possible
                    to optimise some other cases in the future but for now it's
                    purely for validity checking.  Currently writes are only tracked
                    in strict mode code.
                  * Labels are now tracked as it is now a syntax error to jump to a label
                    that does not exist (or to use break, continue, or return in a context
                    where they would be invalid).
      
              Runtime changes:
                  * In order to get correct hanlding of the Arguments object all
                    strict mode functions that reference arguments create and tearoff
                    the arguments object on entry.  This is not strictly necessary
                    but was the least work necessary to get the correct behaviour.
                  * PutPropertySlot now tracks whether it is being used for a strict
                    mode write, and if so Object::put will throw when a write can't be
                    completed.
                  * StrictEvalActivation was added as an "activation" object for strict
                    mode eval (so that strict eval does not introduce new variables into
                    the containing scope).
      
              * CMakeLists.txt:
              * GNUmakefile.am:
              * JavaScriptCore.exp:
              * JavaScriptCore.pro:
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
              * JavaScriptCore.xcodeproj/project.pbxproj:
              * bytecode/CodeBlock.cpp:
              (JSC::CodeBlock::dump):
              (JSC::CodeBlock::CodeBlock):
              (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
              * bytecode/CodeBlock.h:
              (JSC::CodeBlock::isStrictMode):
              * bytecode/EvalCodeCache.h:
              (JSC::EvalCodeCache::get):
              * bytecode/Opcode.h:
              * bytecompiler/BytecodeGenerator.cpp:
              (JSC::BytecodeGenerator::BytecodeGenerator):
              (JSC::BytecodeGenerator::createArgumentsIfNecessary):
              (JSC::BytecodeGenerator::emitReturn):
              * bytecompiler/BytecodeGenerator.h:
              (JSC::BytecodeGenerator::isStrictMode):
              (JSC::BytecodeGenerator::makeFunction):
              * debugger/Debugger.cpp:
              (JSC::evaluateInGlobalCallFrame):
              * debugger/DebuggerCallFrame.cpp:
              (JSC::DebuggerCallFrame::evaluate):
              * interpreter/Interpreter.cpp:
              (JSC::Interpreter::callEval):
              (JSC::Interpreter::unwindCallFrame):
              (JSC::Interpreter::execute):
              (JSC::Interpreter::privateExecute):
              * jit/JIT.cpp:
              (JSC::JIT::privateCompileMainPass):
              (JSC::JIT::privateCompileSlowCases):
              * jit/JIT.h:
              * jit/JITOpcodes.cpp:
              (JSC::JIT::emit_op_get_pnames):
              (JSC::JIT::emit_op_convert_this_strict):
              (JSC::JIT::emitSlow_op_convert_this_strict):
              * jit/JITOpcodes32_64.cpp:
              (JSC::JIT::emit_op_get_pnames):
              * jit/JITStubs.cpp:
              (JSC::DEFINE_STUB_FUNCTION):
              * jit/JITStubs.h:
              * parser/ASTBuilder.h:
              (JSC::ASTBuilder::createFunctionBody):
              (JSC::ASTBuilder::isResolve):
              * parser/JSParser.cpp:
              (JSC::JSParser::next):
              (JSC::JSParser::startLoop):
              (JSC::JSParser::endLoop):
              (JSC::JSParser::startSwitch):
              (JSC::JSParser::endSwitch):
              (JSC::JSParser::setStrictMode):
              (JSC::JSParser::strictMode):
              (JSC::JSParser::isValidStrictMode):
              (JSC::JSParser::declareParameter):
              (JSC::JSParser::breakIsValid):
              (JSC::JSParser::pushLabel):
              (JSC::JSParser::popLabel):
              (JSC::JSParser::hasLabel):
              (JSC::JSParser::DepthManager::DepthManager):
              (JSC::JSParser::DepthManager::~DepthManager):
              (JSC::JSParser::Scope::Scope):
              (JSC::JSParser::Scope::startSwitch):
              (JSC::JSParser::Scope::endSwitch):
              (JSC::JSParser::Scope::startLoop):
              (JSC::JSParser::Scope::endLoop):
              (JSC::JSParser::Scope::inLoop):
              (JSC::JSParser::Scope::breakIsValid):
              (JSC::JSParser::Scope::pushLabel):
              (JSC::JSParser::Scope::popLabel):
              (JSC::JSParser::Scope::hasLabel):
              (JSC::JSParser::Scope::isFunction):
              (JSC::JSParser::Scope::declareVariable):
              (JSC::JSParser::Scope::declareWrite):
              (JSC::JSParser::Scope::deleteProperty):
              (JSC::JSParser::Scope::declareParameter):
              (JSC::JSParser::Scope::setNeedsFullActivation):
              (JSC::JSParser::Scope::collectFreeVariables):
              (JSC::JSParser::Scope::getUncapturedWrittenVariables):
              (JSC::JSParser::Scope::getDeletedVariables):
              (JSC::JSParser::Scope::setStrictMode):
              (JSC::JSParser::Scope::strictMode):
              (JSC::JSParser::Scope::isValidStrictMode):
              (JSC::JSParser::pushScope):
              (JSC::JSParser::popScope):
              (JSC::JSParser::declareVariable):
              (JSC::JSParser::declareWrite):
              (JSC::JSParser::deleteProperty):
              (JSC::jsParse):
              (JSC::JSParser::JSParser):
              (JSC::JSParser::parseProgram):
              (JSC::JSParser::parseSourceElements):
              (JSC::JSParser::parseDoWhileStatement):
              (JSC::JSParser::parseWhileStatement):
              (JSC::JSParser::parseVarDeclarationList):
              (JSC::JSParser::parseConstDeclarationList):
              (JSC::JSParser::parseForStatement):
              (JSC::JSParser::parseBreakStatement):
              (JSC::JSParser::parseContinueStatement):
              (JSC::JSParser::parseReturnStatement):
              (JSC::JSParser::parseWithStatement):
              (JSC::JSParser::parseSwitchStatement):
              (JSC::JSParser::parseSwitchClauses):
              (JSC::JSParser::parseSwitchDefaultClause):
              (JSC::JSParser::parseTryStatement):
              (JSC::JSParser::parseBlockStatement):
              (JSC::JSParser::parseStatement):
              (JSC::JSParser::parseFormalParameters):
              (JSC::JSParser::parseFunctionBody):
              (JSC::JSParser::parseFunctionInfo):
              (JSC::JSParser::parseFunctionDeclaration):
              (JSC::JSParser::parseExpressionOrLabelStatement):
              (JSC::JSParser::parseIfStatement):
              (JSC::JSParser::parseExpression):
              (JSC::JSParser::parseAssignmentExpression):
              (JSC::JSParser::parseConditionalExpression):
              (JSC::JSParser::parseBinaryExpression):
              (JSC::JSParser::parseStrictObjectLiteral):
              (JSC::JSParser::parsePrimaryExpression):
              (JSC::JSParser::parseMemberExpression):
              (JSC::JSParser::parseUnaryExpression):
              * parser/JSParser.h:
              * parser/Lexer.cpp:
              (JSC::Lexer::parseString):
              (JSC::Lexer::lex):
              * parser/Lexer.h:
              (JSC::Lexer::isReparsing):
              * parser/Nodes.cpp:
              (JSC::ScopeNode::ScopeNode):
              (JSC::FunctionBodyNode::FunctionBodyNode):
              (JSC::FunctionBodyNode::create):
              * parser/Nodes.h:
              (JSC::ScopeNode::isStrictMode):
              * parser/Parser.cpp:
              (JSC::Parser::parse):
              * parser/Parser.h:
              (JSC::Parser::parse):
              * parser/SyntaxChecker.h:
              (JSC::SyntaxChecker::SyntaxChecker):
              (JSC::SyntaxChecker::makeFunctionCallNode):
              (JSC::SyntaxChecker::appendToComma):
              (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::createRegex):
              (JSC::SyntaxChecker::createNewExpr):
              (JSC::SyntaxChecker::createConditionalExpr):
              (JSC::SyntaxChecker::createAssignResolve):
              (JSC::SyntaxChecker::createFunctionExpr):
              (JSC::SyntaxChecker::createFunctionBody):
              (JSC::SyntaxChecker::appendBinaryExpressionInfo):
              (JSC::SyntaxChecker::operatorStackPop):
              * runtime/Arguments.cpp:
              (JSC::Arguments::createStrictModeCallerIfNecessary):
              (JSC::Arguments::createStrictModeCalleeIfNecessary):
              (JSC::Arguments::getOwnPropertySlot):
              (JSC::Arguments::getOwnPropertyDescriptor):
              (JSC::Arguments::put):
              (JSC::Arguments::deleteProperty):
              * runtime/Arguments.h:
              (JSC::Arguments::Arguments):
              * runtime/CommonIdentifiers.cpp:
              (JSC::CommonIdentifiers::CommonIdentifiers):
              * runtime/CommonIdentifiers.h:
              * runtime/Error.cpp:
              (JSC::StrictModeTypeErrorFunction::StrictModeTypeErrorFunction):
              (JSC::StrictModeTypeErrorFunction::constructThrowTypeError):
              (JSC::StrictModeTypeErrorFunction::getConstructData):
              (JSC::StrictModeTypeErrorFunction::callThrowTypeError):
              (JSC::StrictModeTypeErrorFunction::getCallData):
              (JSC::createTypeErrorFunction):
              * runtime/Error.h:
              * runtime/Executable.cpp:
              (JSC::EvalExecutable::EvalExecutable):
              (JSC::ProgramExecutable::ProgramExecutable):
              (JSC::FunctionExecutable::FunctionExecutable):
              (JSC::EvalExecutable::compileInternal):
              (JSC::ProgramExecutable::checkSyntax):
              (JSC::ProgramExecutable::compileInternal):
              (JSC::FunctionExecutable::compileForCallInternal):
              (JSC::FunctionExecutable::compileForConstructInternal):
              (JSC::FunctionExecutable::reparseExceptionInfo):
              (JSC::EvalExecutable::reparseExceptionInfo):
              (JSC::FunctionExecutable::fromGlobalCode):
              (JSC::ProgramExecutable::reparseExceptionInfo):
              * runtime/Executable.h:
              (JSC::ScriptExecutable::ScriptExecutable):
              (JSC::ScriptExecutable::isStrictMode):
              (JSC::EvalExecutable::create):
              (JSC::FunctionExecutable::create):
              * runtime/JSActivation.cpp:
              (JSC::JSActivation::toStrictThisObject):
              * runtime/JSActivation.h:
              * runtime/JSFunction.cpp:
              (JSC::createDescriptorForThrowingProperty):
              (JSC::JSFunction::getOwnPropertySlot):
              (JSC::JSFunction::getOwnPropertyDescriptor):
              (JSC::JSFunction::put):
              * runtime/JSGlobalData.cpp:
              (JSC::JSGlobalData::JSGlobalData):
              * runtime/JSGlobalData.h:
              * runtime/JSGlobalObject.cpp:
              (JSC::JSGlobalObject::reset):
              * runtime/JSGlobalObject.h:
              (JSC::JSGlobalObject::internalFunctionStructure):
              * runtime/JSGlobalObjectFunctions.cpp:
              (JSC::globalFuncEval):
              * runtime/JSObject.cpp:
              (JSC::JSObject::put):
              (JSC::JSObject::toStrictThisObject):
              (JSC::throwTypeError):
              * runtime/JSObject.h:
              (JSC::JSObject::isStrictModeFunction):
              (JSC::JSObject::putDirectInternal):
              (JSC::JSObject::putDirect):
              (JSC::JSValue::putDirect):
              (JSC::JSValue::toStrictThisObject):
              * runtime/JSStaticScopeObject.cpp:
              (JSC::JSStaticScopeObject::toStrictThisObject):
              * runtime/JSStaticScopeObject.h:
              * runtime/JSValue.h:
              * runtime/JSZombie.h:
              (JSC::JSZombie::toStrictThisObject):
              * runtime/PutPropertySlot.h:
              (JSC::PutPropertySlot::PutPropertySlot):
              (JSC::PutPropertySlot::isStrictMode):
              * runtime/StrictEvalActivation.cpp: Added.
              (JSC::StrictEvalActivation::StrictEvalActivation):
              (JSC::StrictEvalActivation::deleteProperty):
              (JSC::StrictEvalActivation::toThisObject):
              (JSC::StrictEvalActivation::toStrictThisObject):
              * runtime/StrictEvalActivation.h: Added.
      2010-10-01  Oliver Hunt  <oliver@apple.com>
      
              Reviewed by Gavin Barraclough.
      
              [ES5] Implement strict mode
              https://bugs.webkit.org/show_bug.cgi?id=10701
      
              Tests for the many different behaviours we get in strict mode.
      
              * fast/js/basic-strict-mode-expected.txt: Added.
              * fast/js/basic-strict-mode.html: Added.
              * fast/js/script-tests/basic-strict-mode.js: Added.
              (testThis):
              (testGlobalAccess):
      2010-10-01  Oliver Hunt  <oliver@apple.com>
      
              Reviewed by Gavin Barraclough.
      
              [ES5] Implement strict mode
              https://bugs.webkit.org/show_bug.cgi?id=10701
      
              Test: fast/js/basic-strict-mode.html
      
              Override toStrictThisObject on the domwindow so that
              it correctly provides the shell object when used as this
              in a strict mode function.
      
              * bindings/js/JSDOMWindowBase.cpp:
              (WebCore::JSDOMWindowBase::toStrictThisObject):
              * bindings/js/JSDOMWindowBase.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69516 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5930185c
  25. 09 Mar, 2010 1 commit
    • barraclough@apple.com's avatar
      This caused a performance regression, by breaking the code · 448a8d3d
      barraclough@apple.com authored
      generator's logic to calculate the skip level for resolving
      variables (traced by rdar:7683350)  Reverting for now.
      
      Reviewed by NOBODY (reverting r54510).
      
      * parser/Grammar.y:
      * parser/NodeConstructors.h:
      (JSC::ContinueNode::ContinueNode):
      (JSC::BreakNode::BreakNode):
      (JSC::ForInNode::ForInNode):
      * runtime/CommonIdentifiers.cpp:
      (JSC::CommonIdentifiers::CommonIdentifiers):
      * runtime/CommonIdentifiers.h:
      * runtime/FunctionPrototype.cpp:
      (JSC::FunctionPrototype::FunctionPrototype):
      * runtime/Identifier.cpp:
      (JSC::Identifier::add):
      * runtime/PropertyNameArray.cpp:
      (JSC::PropertyNameArray::add):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55751 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      448a8d3d
  26. 08 Feb, 2010 1 commit
    • barraclough@apple.com's avatar
      Use an empty identifier instead of a null identifier for parse · 419c15b2
      barraclough@apple.com authored
      tokens without an identifier.
      
      Reviewed by Sam Weinig.
      
      This helps encapsulate the null UStringImpl within UString.
      
      * parser/Grammar.y:
      * parser/NodeConstructors.h:
      (JSC::ContinueNode::ContinueNode):
      (JSC::BreakNode::BreakNode):
      (JSC::ForInNode::ForInNode):
      * runtime/CommonIdentifiers.cpp:
      (JSC::CommonIdentifiers::CommonIdentifiers):
      * runtime/CommonIdentifiers.h:
      * runtime/FunctionPrototype.cpp:
      (JSC::FunctionPrototype::FunctionPrototype):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54510 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      419c15b2
  27. 12 Jan, 2010 1 commit
    • eric@webkit.org's avatar
      2010-01-12 Kent Hansen <kent.hansen@nokia.com> · c293f4c8
      eric@webkit.org authored
              Reviewed by Geoffrey Garen.
      
              [ES5] Implement Object.getOwnPropertyNames
              https://bugs.webkit.org/show_bug.cgi?id=32242
      
              Add an extra argument to getPropertyNames() and getOwnPropertyNames()
              (and all reimplementations thereof) that indicates whether non-enumerable
              properties should be added.
      
              * API/JSCallbackObject.h:
              * API/JSCallbackObjectFunctions.h:
              (JSC::::getOwnPropertyNames):
              * JavaScriptCore.exp:
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
              * debugger/DebuggerActivation.cpp:
              (JSC::DebuggerActivation::getOwnPropertyNames):
              * debugger/DebuggerActivation.h:
              * runtime/Arguments.cpp:
              (JSC::Arguments::getOwnPropertyNames):
              * runtime/Arguments.h:
              * runtime/CommonIdentifiers.h:
              * runtime/JSArray.cpp:
              (JSC::JSArray::getOwnPropertyNames):
              * runtime/JSArray.h:
              * runtime/JSByteArray.cpp:
              (JSC::JSByteArray::getOwnPropertyNames):
              * runtime/JSByteArray.h:
              * runtime/JSFunction.cpp:
              (JSC::JSFunction::getOwnPropertyNames):
              * runtime/JSFunction.h:
              * runtime/JSNotAnObject.cpp:
              (JSC::JSNotAnObject::getOwnPropertyNames):
              * runtime/JSNotAnObject.h:
              * runtime/JSObject.cpp:
              (JSC::getClassPropertyNames):
              (JSC::JSObject::getPropertyNames):
              (JSC::JSObject::getOwnPropertyNames):
              * runtime/JSObject.h:
              * runtime/JSVariableObject.cpp:
              (JSC::JSVariableObject::getOwnPropertyNames):
              * runtime/JSVariableObject.h:
              * runtime/ObjectConstructor.cpp:
              (JSC::ObjectConstructor::ObjectConstructor):
              (JSC::objectConstructorGetOwnPropertyNames):
              * runtime/RegExpMatchesArray.h:
              (JSC::RegExpMatchesArray::getOwnPropertyNames):
              * runtime/StringObject.cpp:
              (JSC::StringObject::getOwnPropertyNames):
              * runtime/StringObject.h:
              * runtime/Structure.cpp: Rename getEnumerablePropertyNames() to getPropertyNames(), which takes an extra argument.
              (JSC::Structure::getPropertyNames):
              * runtime/Structure.h:
              (JSC::):
      2010-01-12  Kent Hansen  <kent.hansen@nokia.com>
      
              Reviewed by Geoffrey Garen.
      
              [ES5] Implement Object.getOwnPropertyNames
              https://bugs.webkit.org/show_bug.cgi?id=32242
      
              Add new argument to the reimplementation of getOwnPropertyNames().
      
              * UserObjectImp.cpp:
              (UserObjectImp::getOwnPropertyNames):
              * UserObjectImp.h:
      2010-01-12  Kent Hansen  <kent.hansen@nokia.com>
      
              Reviewed by Geoffrey Garen.
      
              [ES5] Implement Object.getOwnPropertyNames
              https://bugs.webkit.org/show_bug.cgi?id=32242
      
              Add tests for Object.getOwnPropertyNames(o), both standard usage and cross origin.
      
              * fast/js/Object-getOwnPropertyNames-expected.txt: Added.
              * fast/js/Object-getOwnPropertyNames.html: Added.
              * fast/js/script-tests/Object-getOwnPropertyNames.js: Added.
              * http/tests/security/cross-frame-access-enumeration-expected.txt:
              * http/tests/security/cross-frame-access-enumeration.html:
      2010-01-12  Kent Hansen  <kent.hansen@nokia.com>
      
              Reviewed by Geoffrey Garen.
      
              [ES5] Implement Object.getOwnPropertyNames
              https://bugs.webkit.org/show_bug.cgi?id=32242
      
              Add new argument to reimplementations of getPropertyNames()
              and getOwnPropertyNames(), and update the JS bindings generator.
      
              Test: fast/js/Object-getOwnPropertyNames.html
      
              * bindings/js/JSDOMWindowCustom.cpp:
              (WebCore::JSDOMWindow::getPropertyNames):
              (WebCore::JSDOMWindow::getOwnPropertyNames):
              * bindings/js/JSDOMWindowShell.cpp:
              (WebCore::JSDOMWindowShell::getPropertyNames):
              (WebCore::JSDOMWindowShell::getOwnPropertyNames):
              * bindings/js/JSDOMWindowShell.h:
              * bindings/js/JSHistoryCustom.cpp:
              (WebCore::JSHistory::getOwnPropertyNames):
              * bindings/js/JSLocationCustom.cpp:
              (WebCore::JSLocation::getOwnPropertyNames):
              * bindings/js/JSQuarantinedObjectWrapper.cpp:
              (WebCore::JSQuarantinedObjectWrapper::getPropertyNames):
              (WebCore::JSQuarantinedObjectWrapper::getOwnPropertyNames):
              * bindings/js/JSQuarantinedObjectWrapper.h:
              * bindings/js/JSStorageCustom.cpp:
              (WebCore::JSStorage::getOwnPropertyNames):
              * bindings/scripts/CodeGeneratorJS.pm:
              * bridge/runtime_array.cpp:
              (JSC::RuntimeArray::getOwnPropertyNames):
              * bridge/runtime_array.h:
              * bridge/runtime_object.cpp:
              (JSC::RuntimeObjectImp::getPropertyNames):
              (JSC::RuntimeObjectImp::getOwnPropertyNames):
              * bridge/runtime_object.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53170 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c293f4c8
  28. 19 Sep, 2009 2 commits
  29. 18 Sep, 2009 1 commit
  30. 12 Sep, 2009 1 commit
    • oliver@apple.com's avatar
      [ES5] Implement Object.keys · d1f19755
      oliver@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=29170
      
      Reviewed by Maciej Stachowiak.
      
      This patch basically requires two separate steps, the first is to split getPropertyNames
      into two functions -- getOwnPropertyNames and getPropertyNames, basically making them behave
      in the same way as getOwnPropertySlot and getPropertySlot.  In essence getOwnPropertyNames
      produces the list of properties on an object excluding its prototype chain and getPropertyNames
      just iterates the the object and its prototype chain calling getOwnPropertyNames at each level.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48336 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d1f19755
  31. 26 Aug, 2009 1 commit
    • oliver@apple.com's avatar
      [ES5] Implement getOwnPropertyDescriptor · 4b4f785d
      oliver@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=28724
      
      Reviewed by Gavin Barraclough.
      
      JavaScriptCore:
      Implement the core runtime support for getOwnPropertyDescriptor.
      This adds a virtual getOwnPropertyDescriptor method to every class
      that implements getOwnPropertySlot that shadows the behaviour of
      getOwnPropertySlot.  The alternative would be to make getOwnPropertySlot
      (or PropertySlots in general) provide property attribute information,
      but quick testing showed this to be a regression.
      
      WebCore:
      Implement the WebCore side of getOwnPropertyDescriptor.  This
      requires a custom implementation of getOwnPropertyDescriptor
      for every class with a custom implementation of getOwnPropertySlot.
      
      The bindings generator has been updated to generate appropriate
      versions of getOwnPropertyDescriptor for the general case where
      a custom getOwnPropertyDescriptor is not needed.  ES5 is vague
      about how getOwnPropertyDescriptor should work in the context of
      "host" functions with polymorphic [[GetOwnProperty]], so it seems
      okay that occasionally we "guess" what attributes -- eg. determining
      whether a property is writable.
      
      Test: fast/js/getOwnPropertyDescriptor.html
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@47780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4b4f785d
  32. 14 Aug, 2009 1 commit
  33. 09 Aug, 2009 1 commit
  34. 14 Jul, 2009 1 commit
    • bfulgham@webkit.org's avatar
      JavaScriptCore: · 8a8a2f45
      bfulgham@webkit.org authored
      2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
      
              Reviewed by Darin Adler.
      
              Change all Noncopyable inheriting visibility to public.
              https://bugs.webkit.org/show_bug.cgi?id=27225
      
              Change all Noncopyable inheriting visibility to public because
              it is needed to the custom allocation framework (bug #20422).
      
              * bytecode/SamplingTool.h:
              * bytecompiler/RegisterID.h:
              * interpreter/CachedCall.h:
              * interpreter/RegisterFile.h:
              * parser/Lexer.h:
              * parser/Parser.h:
              * runtime/ArgList.h:
              * runtime/BatchedTransitionOptimizer.h:
              * runtime/Collector.h:
              * runtime/CommonIdentifiers.h:
              * runtime/JSCell.h:
              * runtime/JSGlobalObject.h:
              * runtime/JSLock.h:
              * runtime/JSONObject.cpp:
              * runtime/SmallStrings.cpp:
              * runtime/SmallStrings.h:
              * wtf/CrossThreadRefCounted.h:
              * wtf/GOwnPtr.h:
              * wtf/Locker.h:
              * wtf/MessageQueue.h:
              * wtf/OwnArrayPtr.h:
              * wtf/OwnFastMallocPtr.h:
              * wtf/OwnPtr.h:
              * wtf/RefCounted.h:
              * wtf/ThreadSpecific.h:
              * wtf/Threading.h:
              * wtf/Vector.h:
              * wtf/unicode/Collator.h:
      
      WebCore:
      
      2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
      
              Reviewed by Darin Adler.
      
              Change all Noncopyable inheriting visibility to public.
              https://bugs.webkit.org/show_bug.cgi?id=27225
      
              Change all Noncopyable inheriting visibility to public because
              it is needed to the custom allocation framework (bug #20422).
      
              * bindings/js/GCController.h:
              * bindings/js/WorkerScriptController.h:
              * bindings/v8/V8DOMMap.cpp:
              (WebCore::):
              * bridge/runtime.h:
              * css/CSSSelector.h:
              * css/CSSSelectorList.h:
              * css/CSSStyleSelector.h:
              * dom/ClassNames.h:
              * dom/MessagePortChannel.h:
              * dom/XMLTokenizerLibxml2.cpp:
              * dom/XMLTokenizerScope.h:
              * editing/ReplaceSelectionCommand.cpp:
              * editing/SelectionController.h:
              * editing/TextIterator.cpp:
              * history/PageCache.h:
              * html/CanvasRenderingContext2D.h:
              * html/HTMLParser.h:
              * html/HTMLParserQuirks.h:
              * html/PreloadScanner.h:
              * loader/Cache.h:
              * loader/CrossOriginPreflightResultCache.h:
              * loader/FrameLoader.h:
              * loader/ProgressTracker.h:
              * loader/ThreadableLoader.h:
              * loader/appcache/ApplicationCacheGroup.h:
              * loader/archive/ArchiveResourceCollection.h:
              * loader/icon/IconDatabase.h:
              * loader/icon/IconLoader.h:
              * loader/icon/PageURLRecord.h:
              * loader/loader.h:
              * page/ContextMenuController.h:
              * page/EventHandler.h:
              * page/FrameTree.h:
              * page/Page.h:
              * page/PageGroup.h:
              * page/PageGroupLoadDeferrer.h:
              * page/mac/EventHandlerMac.mm:
              * platform/AutodrainedPool.h:
              * platform/ContextMenu.h:
              * platform/EventLoop.h:
              * platform/HostWindow.h:
              * platform/Pasteboard.h:
              * platform/PurgeableBuffer.h:
              * platform/RunLoopTimer.h:
              * platform/ThreadGlobalData.h:
              * platform/ThreadTimers.h:
              * platform/Timer.h:
              * platform/TreeShared.h:
              * platform/graphics/FontData.h:
              * platform/graphics/GlyphWidthMap.h:
              * platform/graphics/GraphicsContext.h:
              * platform/graphics/ImageBuffer.h:
              * platform/graphics/ImageSource.h:
              * platform/graphics/MediaPlayer.h:
              * platform/graphics/skia/GraphicsContextPlatformPrivate.h:
              * platform/graphics/skia/PlatformContextSkia.h:
              * platform/graphics/win/QTMovieWin.cpp:
              * platform/mac/LocalCurrentGraphicsContext.h:
              * platform/network/FormDataBuilder.h:
              * platform/network/ResourceHandleInternal.h:
              * platform/network/soup/ResourceHandleSoup.cpp:
              * platform/text/StringBuffer.h:
              * platform/text/TextCodec.h:
              * platform/win/WindowMessageBroadcaster.h:
              * rendering/CounterNode.h:
              * rendering/LayoutState.h:
              * rendering/RenderFrameSet.h:
              * rendering/RenderView.h:
              * rendering/TransformState.h:
              * svg/SVGAnimatedProperty.h:
              * svg/SynchronizableTypeWrapper.h:
              * workers/WorkerMessagingProxy.h:
              * workers/WorkerRunLoop.cpp:
              * xml/XPathExpressionNode.h:
              * xml/XPathParser.h:
              * xml/XPathPredicate.h:
              * xml/XPathStep.h:
      
      WebKit/gtk:
      
      2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
      
              Reviewed by Darin Adler.
      
              Change all Noncopyable inheriting visibility to public.
              https://bugs.webkit.org/show_bug.cgi?id=27225
      
              Change all Noncopyable inheriting visibility to public because
              it is needed to the custom allocation framework (bug #20422).
      
              * webkit/webkitdownload.cpp:
      
      WebKit/win:
      
      2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
      
              Reviewed by Darin Adler.
      
              Change all Noncopyable inheriting visibility to public.
              https://bugs.webkit.org/show_bug.cgi?id=27225
      
              Change all Noncopyable inheriting visibility to public because
              it is needed to the custom allocation framework (bug #20422).
      
              * COMEnumVariant.h:
              * WebDatabaseManager.cpp:
              * WebInspector.h:
              * WebLocalizableStrings.cpp:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@45891 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8a8a2f45