1. 28 Jan, 2011 3 commits
    • oliver@apple.com's avatar
      2011-01-27 Oliver Hunt <oliver@apple.com> · c975423a
      oliver@apple.com authored
              Reviewed by Geoffrey Garen.
      
              Convert markstack to a slot visitor API
              https://bugs.webkit.org/show_bug.cgi?id=53219
      
              Move the MarkStack over to a slot based marking API.
      
              In order to avoiding aliasing concerns there are two new types
              that need to be used when holding on to JSValues and JSCell that
              need to be marked: WriteBarrier and DeprecatedPtr.  WriteBarrier
              is expected to be used for any JSValue or Cell that's lifetime and
              marking is controlled by another GC object.  DeprecatedPtr is used
              for any value that we need to rework ownership for.
      
              The change over to this model has produced a large amount of
              code changes, but they are mostly mechanical (forwarding JSGlobalData,
              etc).
      
              * API/JSCallbackObject.h:
              (JSC::JSCallbackObjectData::setPrivateProperty):
              (JSC::JSCallbackObjectData::JSPrivatePropertyMap::getPrivateProperty):
              (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty):
              (JSC::JSCallbackObjectData::JSPrivatePropertyMap::markChildren):
              (JSC::JSCallbackObject::setPrivateProperty):
              * API/JSCallbackObjectFunctions.h:
              (JSC::::put):
              (JSC::::staticFunctionGetter):
              * API/JSObjectRef.cpp:
              (JSObjectMakeConstructor):
              (JSObjectSetPrivateProperty):
              * API/JSWeakObjectMapRefInternal.h:
              * JavaScriptCore.exp:
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
              * JavaScriptCore.xcodeproj/project.pbxproj:
              * bytecode/CodeBlock.cpp:
              (JSC::CodeBlock::markAggregate):
              * bytecode/CodeBlock.h:
              (JSC::CodeBlock::globalObject):
              * bytecompiler/BytecodeGenerator.cpp:
              (JSC::BytecodeGenerator::BytecodeGenerator):
              (JSC::BytecodeGenerator::emitJumpIfNotFunctionCall):
              (JSC::BytecodeGenerator::emitJumpIfNotFunctionApply):
              (JSC::BytecodeGenerator::findScopedProperty):
              * debugger/DebuggerActivation.cpp:
              (JSC::DebuggerActivation::DebuggerActivation):
              (JSC::DebuggerActivation::markChildren):
              * debugger/DebuggerActivation.h:
              * interpreter/Interpreter.cpp:
              (JSC::Interpreter::resolve):
              (JSC::Interpreter::resolveSkip):
              (JSC::Interpreter::resolveGlobalDynamic):
              (JSC::Interpreter::resolveBaseAndProperty):
              (JSC::Interpreter::unwindCallFrame):
              (JSC::appendSourceToError):
              (JSC::Interpreter::execute):
              (JSC::Interpreter::privateExecute):
              * interpreter/Register.h:
              (JSC::Register::jsValueSlot):
              * jit/JITStubs.cpp:
              (JSC::JITThunks::tryCacheGetByID):
              (JSC::DEFINE_STUB_FUNCTION):
              * jsc.cpp:
              (GlobalObject::GlobalObject):
              * runtime/Arguments.cpp:
              (JSC::Arguments::markChildren):
              (JSC::Arguments::getOwnPropertySlot):
              (JSC::Arguments::getOwnPropertyDescriptor):
              (JSC::Arguments::put):
              * runtime/Arguments.h:
              (JSC::Arguments::setActivation):
              (JSC::Arguments::Arguments):
              * runtime/ArrayConstructor.cpp:
              (JSC::ArrayConstructor::ArrayConstructor):
              (JSC::constructArrayWithSizeQuirk):
              * runtime/ArrayPrototype.cpp:
              (JSC::arrayProtoFuncSplice):
              * runtime/BatchedTransitionOptimizer.h:
              (JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer):
              (JSC::BatchedTransitionOptimizer::~BatchedTransitionOptimizer):
              * runtime/BooleanConstructor.cpp:
              (JSC::BooleanConstructor::BooleanConstructor):
              (JSC::constructBoolean):
              (JSC::constructBooleanFromImmediateBoolean):
              * runtime/BooleanPrototype.cpp:
              (JSC::BooleanPrototype::BooleanPrototype):
              * runtime/ConservativeSet.h:
              (JSC::ConservativeSet::mark):
              * runtime/DateConstructor.cpp:
              (JSC::DateConstructor::DateConstructor):
              * runtime/DateInstance.cpp:
              (JSC::DateInstance::DateInstance):
              * runtime/DatePrototype.cpp:
              (JSC::dateProtoFuncSetTime):
              (JSC::setNewValueFromTimeArgs):
              (JSC::setNewValueFromDateArgs):
              (JSC::dateProtoFuncSetYear):
              * runtime/ErrorConstructor.cpp:
              (JSC::ErrorConstructor::ErrorConstructor):
              * runtime/ErrorInstance.cpp:
              (JSC::ErrorInstance::ErrorInstance):
              * runtime/ErrorPrototype.cpp:
              (JSC::ErrorPrototype::ErrorPrototype):
              * runtime/FunctionConstructor.cpp:
              (JSC::FunctionConstructor::FunctionConstructor):
              * runtime/FunctionPrototype.cpp:
              (JSC::FunctionPrototype::FunctionPrototype):
              * runtime/GetterSetter.cpp:
              (JSC::GetterSetter::markChildren):
              * runtime/GetterSetter.h:
              (JSC::GetterSetter::GetterSetter):
              (JSC::GetterSetter::getter):
              (JSC::GetterSetter::setGetter):
              (JSC::GetterSetter::setter):
              (JSC::GetterSetter::setSetter):
              * runtime/GlobalEvalFunction.cpp:
              (JSC::GlobalEvalFunction::GlobalEvalFunction):
              (JSC::GlobalEvalFunction::markChildren):
              * runtime/GlobalEvalFunction.h:
              (JSC::GlobalEvalFunction::cachedGlobalObject):
              * runtime/Heap.cpp:
              (JSC::Heap::markProtectedObjects):
              (JSC::Heap::markTempSortVectors):
              (JSC::Heap::markRoots):
              * runtime/InternalFunction.cpp:
              (JSC::InternalFunction::InternalFunction):
              * runtime/JSAPIValueWrapper.h:
              (JSC::JSAPIValueWrapper::value):
              (JSC::JSAPIValueWrapper::JSAPIValueWrapper):
              * runtime/JSActivation.cpp:
              (JSC::JSActivation::put):
              * runtime/JSArray.cpp:
              (JSC::JSArray::JSArray):
              (JSC::JSArray::getOwnPropertySlot):
              (JSC::JSArray::getOwnPropertyDescriptor):
              (JSC::JSArray::put):
              (JSC::JSArray::putSlowCase):
              (JSC::JSArray::deleteProperty):
              (JSC::JSArray::increaseVectorLength):
              (JSC::JSArray::setLength):
              (JSC::JSArray::pop):
              (JSC::JSArray::push):
              (JSC::JSArray::unshiftCount):
              (JSC::JSArray::sort):
              (JSC::JSArray::fillArgList):
              (JSC::JSArray::copyToRegisters):
              (JSC::JSArray::compactForSorting):
              * runtime/JSArray.h:
              (JSC::JSArray::getIndex):
              (JSC::JSArray::setIndex):
              (JSC::JSArray::uncheckedSetIndex):
              (JSC::JSArray::markChildrenDirect):
              * runtime/JSByteArray.cpp:
              (JSC::JSByteArray::JSByteArray):
              * runtime/JSCell.h:
              (JSC::JSCell::MarkStack::append):
              (JSC::JSCell::MarkStack::appendCell):
              * runtime/JSFunction.cpp:
              (JSC::JSFunction::JSFunction):
              (JSC::JSFunction::getOwnPropertySlot):
              * runtime/JSGlobalObject.cpp:
              (JSC::markIfNeeded):
              (JSC::JSGlobalObject::reset):
              (JSC::JSGlobalObject::resetPrototype):
              (JSC::JSGlobalObject::markChildren):
              * runtime/JSGlobalObject.h:
              (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
              (JSC::JSGlobalObject::regExpConstructor):
              (JSC::JSGlobalObject::errorConstructor):
              (JSC::JSGlobalObject::evalErrorConstructor):
              (JSC::JSGlobalObject::rangeErrorConstructor):
              (JSC::JSGlobalObject::referenceErrorConstructor):
              (JSC::JSGlobalObject::syntaxErrorConstructor):
              (JSC::JSGlobalObject::typeErrorConstructor):
              (JSC::JSGlobalObject::URIErrorConstructor):
              (JSC::JSGlobalObject::evalFunction):
              (JSC::JSGlobalObject::objectPrototype):
              (JSC::JSGlobalObject::functionPrototype):
              (JSC::JSGlobalObject::arrayPrototype):
              (JSC::JSGlobalObject::booleanPrototype):
              (JSC::JSGlobalObject::stringPrototype):
              (JSC::JSGlobalObject::numberPrototype):
              (JSC::JSGlobalObject::datePrototype):
              (JSC::JSGlobalObject::regExpPrototype):
              (JSC::JSGlobalObject::methodCallDummy):
              (JSC::constructArray):
              * runtime/JSONObject.cpp:
              (JSC::Stringifier::Holder::object):
              (JSC::Stringifier::Holder::objectSlot):
              (JSC::Stringifier::markAggregate):
              (JSC::Stringifier::stringify):
              (JSC::Stringifier::Holder::appendNextProperty):
              (JSC::Walker::callReviver):
              (JSC::Walker::walk):
              * runtime/JSObject.cpp:
              (JSC::JSObject::defineGetter):
              (JSC::JSObject::defineSetter):
              (JSC::JSObject::removeDirect):
              (JSC::JSObject::putDirectFunction):
              (JSC::JSObject::putDirectFunctionWithoutTransition):
              (JSC::putDescriptor):
              (JSC::JSObject::defineOwnProperty):
              * runtime/JSObject.h:
              (JSC::JSObject::putDirectOffset):
              (JSC::JSObject::putUndefinedAtDirectOffset):
              (JSC::JSObject::flattenDictionaryObject):
              (JSC::JSObject::putDirectInternal):
              (JSC::JSObject::putDirect):
              (JSC::JSObject::putDirectFunction):
              (JSC::JSObject::putDirectWithoutTransition):
              (JSC::JSObject::putDirectFunctionWithoutTransition):
              (JSC::JSValue::putDirect):
              (JSC::JSObject::allocatePropertyStorageInline):
              (JSC::JSObject::markChildrenDirect):
              * runtime/JSStaticScopeObject.cpp:
              (JSC::JSStaticScopeObject::markChildren):
              * runtime/JSString.cpp:
              (JSC::StringObject::create):
              * runtime/JSValue.h:
              * runtime/JSWrapperObject.cpp:
              (JSC::JSWrapperObject::markChildren):
              * runtime/JSWrapperObject.h:
              (JSC::JSWrapperObject::internalValue):
              (JSC::JSWrapperObject::setInternalValue):
              * runtime/LiteralParser.cpp:
              (JSC::LiteralParser::parse):
              * runtime/Lookup.cpp:
              (JSC::setUpStaticFunctionSlot):
              * runtime/Lookup.h:
              (JSC::lookupPut):
              * runtime/MarkStack.h:
              * runtime/MathObject.cpp:
              (JSC::MathObject::MathObject):
              * runtime/NativeErrorConstructor.cpp:
              (JSC::NativeErrorConstructor::NativeErrorConstructor):
              * runtime/NativeErrorPrototype.cpp:
              (JSC::NativeErrorPrototype::NativeErrorPrototype):
              * runtime/NumberConstructor.cpp:
              (JSC::NumberConstructor::NumberConstructor):
              (JSC::constructWithNumberConstructor):
              * runtime/NumberObject.cpp:
              (JSC::constructNumber):
              * runtime/NumberPrototype.cpp:
              (JSC::NumberPrototype::NumberPrototype):
              * runtime/ObjectConstructor.cpp:
              (JSC::ObjectConstructor::ObjectConstructor):
              (JSC::objectConstructorGetOwnPropertyDescriptor):
              * runtime/Operations.h:
              (JSC::normalizePrototypeChain):
              (JSC::resolveBase):
              * runtime/PrototypeFunction.cpp:
              (JSC::PrototypeFunction::PrototypeFunction):
              * runtime/PutPropertySlot.h:
              (JSC::PutPropertySlot::setExistingProperty):
              (JSC::PutPropertySlot::setNewProperty):
              (JSC::PutPropertySlot::base):
              * runtime/RegExpConstructor.cpp:
              (JSC::RegExpConstructor::RegExpConstructor):
              * runtime/ScopeChain.cpp:
              (JSC::ScopeChainNode::print):
              * runtime/ScopeChain.h:
              (JSC::ScopeChainNode::~ScopeChainNode):
              (JSC::ScopeChainIterator::operator*):
              (JSC::ScopeChainIterator::operator->):
              (JSC::ScopeChain::top):
              * runtime/ScopeChainMark.h:
              (JSC::ScopeChain::markAggregate):
              * runtime/SmallStrings.cpp:
              (JSC::isMarked):
              (JSC::SmallStrings::markChildren):
              * runtime/SmallStrings.h:
              (JSC::SmallStrings::emptyString):
              (JSC::SmallStrings::singleCharacterString):
              (JSC::SmallStrings::singleCharacterStrings):
              * runtime/StringConstructor.cpp:
              (JSC::StringConstructor::StringConstructor):
              * runtime/StringObject.cpp:
              (JSC::StringObject::StringObject):
              * runtime/StringObject.h:
              * runtime/StringPrototype.cpp:
              (JSC::StringPrototype::StringPrototype):
              * runtime/Structure.cpp:
              (JSC::Structure::flattenDictionaryStructure):
              * runtime/Structure.h:
              (JSC::Structure::storedPrototypeSlot):
              * runtime/WeakGCMap.h:
              (JSC::WeakGCMap::uncheckedGet):
              (JSC::WeakGCMap::uncheckedGetSlot):
              (JSC::::get):
              (JSC::::take):
              (JSC::::set):
              (JSC::::uncheckedRemove):
              * runtime/WriteBarrier.h: Added.
              (JSC::DeprecatedPtr::DeprecatedPtr):
              (JSC::DeprecatedPtr::get):
              (JSC::DeprecatedPtr::operator*):
              (JSC::DeprecatedPtr::operator->):
              (JSC::DeprecatedPtr::slot):
              (JSC::DeprecatedPtr::operator UnspecifiedBoolType*):
              (JSC::DeprecatedPtr::operator!):
              (JSC::WriteBarrierBase::set):
              (JSC::WriteBarrierBase::get):
              (JSC::WriteBarrierBase::operator*):
              (JSC::WriteBarrierBase::operator->):
              (JSC::WriteBarrierBase::slot):
              (JSC::WriteBarrierBase::operator UnspecifiedBoolType*):
              (JSC::WriteBarrierBase::operator!):
              (JSC::WriteBarrier::WriteBarrier):
              (JSC::operator==):
      2011-01-27  Oliver Hunt  <oliver@apple.com>
      
              Reviewed by Geoffrey Garen.
      
              Convert markstack to a slot visitor API
              https://bugs.webkit.org/show_bug.cgi?id=53219
      
              There's no reason to recurse here, the value we
              were marking was protected.
      
              * JSValueWrapper.cpp:
              (JSValueWrapper::JSObjectMark):
      2011-01-27  Oliver Hunt  <oliver@apple.com>
      
              Reviewed by Geoffrey Garen.
      
              Convert markstack to a slot visitor API
              https://bugs.webkit.org/show_bug.cgi?id=53219
      
              Update WebCore to the new marking apis, correct bindings
              codegen.
      
              * ForwardingHeaders/runtime/WriteBarrier.h: Added.
              * WebCore.exp.in:
              * bindings/js/DOMWrapperWorld.h:
              (WebCore::DOMWrapperWorld::globalData):
              * bindings/js/JSAudioConstructor.cpp:
              (WebCore::JSAudioConstructor::JSAudioConstructor):
              * bindings/js/JSDOMBinding.cpp:
              (WebCore::markDOMNodesForDocument):
              (WebCore::markDOMObjectWrapper):
              (WebCore::markDOMNodeWrapper):
              * bindings/js/JSDOMGlobalObject.cpp:
              (WebCore::JSDOMGlobalObject::markChildren):
              (WebCore::JSDOMGlobalObject::setInjectedScript):
              (WebCore::JSDOMGlobalObject::injectedScript):
              * bindings/js/JSDOMGlobalObject.h:
              (WebCore::JSDOMGlobalObject::JSDOMGlobalObjectData::JSDOMGlobalObjectData):
              (WebCore::getDOMConstructor):
              * bindings/js/JSDOMWindowCustom.cpp:
              (WebCore::JSDOMWindow::setLocation):
              (WebCore::DialogHandler::dialogCreated):
              * bindings/js/JSDOMWindowShell.cpp:
              (WebCore::JSDOMWindowShell::JSDOMWindowShell):
              (WebCore::JSDOMWindowShell::setWindow):
              (WebCore::JSDOMWindowShell::markChildren):
              (WebCore::JSDOMWindowShell::unwrappedObject):
              * bindings/js/JSDOMWindowShell.h:
              (WebCore::JSDOMWindowShell::window):
              (WebCore::JSDOMWindowShell::setWindow):
              * bindings/js/JSEventListener.cpp:
              (WebCore::JSEventListener::JSEventListener):
              (WebCore::JSEventListener::markJSFunction):
              * bindings/js/JSEventListener.h:
              (WebCore::JSEventListener::jsFunction):
              * bindings/js/JSHTMLDocumentCustom.cpp:
              (WebCore::JSHTMLDocument::setAll):
              * bindings/js/JSImageConstructor.cpp:
              (WebCore::JSImageConstructor::JSImageConstructor):
              * bindings/js/JSImageDataCustom.cpp:
              (WebCore::toJS):
              * bindings/js/JSJavaScriptCallFrameCustom.cpp:
              (WebCore::JSJavaScriptCallFrame::scopeChain):
              (WebCore::JSJavaScriptCallFrame::scopeType):
              * bindings/js/JSNodeFilterCondition.cpp:
              (WebCore::JSNodeFilterCondition::markAggregate):
              (WebCore::JSNodeFilterCondition::acceptNode):
              * bindings/js/JSNodeFilterCondition.h:
              * bindings/js/JSNodeFilterCustom.cpp:
              * bindings/js/JSOptionConstructor.cpp:
              (WebCore::JSOptionConstructor::JSOptionConstructor):
              * bindings/js/JSSQLResultSetRowListCustom.cpp:
              (WebCore::JSSQLResultSetRowList::item):
              * bindings/js/ScriptCachedFrameData.cpp:
              (WebCore::ScriptCachedFrameData::restore):
              * bindings/js/ScriptObject.cpp:
              (WebCore::ScriptGlobalObject::set):
              * bindings/js/SerializedScriptValue.cpp:
              (WebCore::CloneDeserializer::putProperty):
              * bindings/scripts/CodeGeneratorJS.pm:
              * dom/Document.h:
      2011-01-27  Oliver Hunt  <oliver@apple.com>
      
              Reviewed by Geoffrey Garen.
      
              Convert markstack to a slot visitor API
              https://bugs.webkit.org/show_bug.cgi?id=53219
      
              Update to new marking api
      
              * WebView/WebScriptDebugDelegate.mm:
              (-[WebScriptCallFrame scopeChain]):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77006 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c975423a
    • msaboff@apple.com's avatar
      2011-01-28 Michael Saboff <msaboff@apple.com> · 53783a0b
      msaboff@apple.com authored
              Potentially Unsafe HashSet of RuntimeObject* in RootObject definition
              https://bugs.webkit.org/show_bug.cgi?id=53271
      
              Reapplying this this change.  No change from prior patch in
              JavaScriptCore.
      
              Added new isValid() methods to check if a contained object in
              a WeakGCMap is valid when using an unchecked iterator.
      
              * runtime/WeakGCMap.h:
              (JSC::WeakGCMap::isValid):
      2011-01-28  Michael Saboff  <msaboff@apple.com>
      
              Reviewed by Geoffrey Garen.
      
              Potentially Unsafe HashSet of RuntimeObject* in RootObject definition
              https://bugs.webkit.org/show_bug.cgi?id=53271
      
              Reapplying this patch with the change that the second ASSERT in 
              RootObject::removeRuntimeObject was changed to use
              .uncheckedGet() instead of the failing .get().  The object in question
              could be in the process of being GC'ed.  The get() call will not return
              such an object while the uncheckedGet() call will return the (unsafe) 
              object.  This is the behavior we want.
      
              Precautionary change.
              Changed RootObject to use WeakGCMap instead of HashSet.
              Found will looking for another issue, but can't produce a test case
              that is problematic.  THerefore there aren't any new tests.
      
              * bridge/runtime_root.cpp:
              (JSC::Bindings::RootObject::invalidate):
              (JSC::Bindings::RootObject::addRuntimeObject):
              (JSC::Bindings::RootObject::removeRuntimeObject):
              * bridge/runtime_root.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76969 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      53783a0b
    • ossy@webkit.org's avatar
      Unreviewed, rolling out r76893. · f1a40a73
      ossy@webkit.org authored
      http://trac.webkit.org/changeset/76893
      https://bugs.webkit.org/show_bug.cgi?id=53287
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2011-01-28
      It made some tests crash on GTK and Qt debug bots (Requested
      by Ossy on #webkit).
      
      Source/JavaScriptCore: 
      
      * runtime/WeakGCMap.h:
      
      Source/WebCore: 
      
      * bridge/runtime_root.cpp:
      (JSC::Bindings::RootObject::invalidate):
      (JSC::Bindings::RootObject::addRuntimeObject):
      (JSC::Bindings::RootObject::removeRuntimeObject):
      * bridge/runtime_root.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76925 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f1a40a73
  2. 27 Jan, 2011 1 commit
    • msaboff@apple.com's avatar
      2011-01-27 Michael Saboff <msaboff@apple.com> · 47435971
      msaboff@apple.com authored
              Potentially Unsafe HashSet of RuntimeObject* in RootObject definition
              https://bugs.webkit.org/show_bug.cgi?id=53271
      
              Added new isValid() methods to check if a contained object in
              a WeakGCMap is valid when using an unchecked iterator.
      
              * runtime/WeakGCMap.h:
              (JSC::WeakGCMap::isValid):
      2011-01-27  Michael Saboff  <msaboff@apple.com>
      
              Reviewed by Darin Adler.
      
              Potentially Unsafe HashSet of RuntimeObject* in RootObject definition
              https://bugs.webkit.org/show_bug.cgi?id=53271
      
              Precautionary change.
              Changed RootObject to use WeakGCMap instead of HashSet.
              Found will looking for another issue, but can't produce a test case
              that is problematic.  THerefore there aren't any new tests.
      
              * bridge/runtime_root.cpp:
              (JSC::Bindings::RootObject::invalidate):
              (JSC::Bindings::RootObject::addRuntimeObject):
              (JSC::Bindings::RootObject::removeRuntimeObject):
              * bridge/runtime_root.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      47435971
  3. 25 Jan, 2011 1 commit
  4. 22 Jan, 2011 4 commits
    • ggaren@apple.com's avatar
      2011-01-22 Geoffrey Garen <ggaren@apple.com> · 7fc55f20
      ggaren@apple.com authored
              Reviewed by Dan Bernstein.
      
              ASSERT running run-webkit-tests --threaded.
              https://bugs.webkit.org/show_bug.cgi?id=52971
              
              SunSpider and v8 report no change.
      
              * runtime/ConservativeSet.cpp:
              (JSC::ConservativeSet::grow):
              (JSC::ConservativeSet::add):
              * runtime/ConservativeSet.h: Tweaked the inline capacity to 128, and
              the growth policy to 2X, to make SunSpider and v8 happy.
              (JSC::ConservativeSet::ConservativeSet):
              (JSC::ConservativeSet::~ConservativeSet):
              (JSC::ConservativeSet::mark): Use OSAllocator directly, instead of malloc.
              Malloc is forbidden during a multi-threaded mark phase because it can
              cause deadlock.
      2011-01-22  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Dan Bernstein.
      
              Beefed up --threaded mode to catch even more kinds of errors.
              https://bugs.webkit.org/show_bug.cgi?id=52971
      
              * DumpRenderTree/pthreads/JavaScriptThreadingPthreads.cpp: Use a shared
              context group to force JSC to mark multiple threads. (This used to be
              the default, but it changed in SnowLeopard.)
              (runJavaScriptThread): Do more locking and unlocking, and more allocation,
              to give threading mistakes more chances to show themselves.
              (startJavaScriptThreads):
              (stopJavaScriptThreads):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7fc55f20
    • ggaren@apple.com's avatar
      2011-01-22 Geoffrey Garen <ggaren@apple.com> · c9bfff41
      ggaren@apple.com authored
              Reviewed by Geoffrey Garen.
      
              Rubber-stamped by Maciej Stachowiak.
      
              A few of Maciej's review suggestions for my last patch.
              https://bugs.webkit.org/show_bug.cgi?id=52946        
      
              SunSpider reports no change.
      
              * Android.mk:
              * CMakeLists.txt:
              * GNUmakefile.am:
              * JavaScriptCore.gypi:
              * JavaScriptCore.pro:
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
              * JavaScriptCore.xcodeproj/project.pbxproj: Updated build systems.
      
              * runtime/ConservativeSet.cpp: Added.
              (JSC::isPointerAligned):
              (JSC::ConservativeSet::add):
              * runtime/ConservativeSet.h: Added.
              (JSC::ConservativeSet::ConservativeSet):
              (JSC::ConservativeSet::mark): Split ConservativeSet out into its own
              file, and moved the conservative check into ConservativeSet::add, making
              ConservativeSet's responsibility clearer.
      
              * runtime/Heap.cpp:
              (JSC::Heap::markRoots):
              * runtime/MachineStackMarker.cpp:
              (JSC::MachineStackMarker::markCurrentThreadConservativelyInternal):
              (JSC::MachineStackMarker::markOtherThreadConservatively):
              * runtime/MachineStackMarker.h:
              * runtime/MarkStack.h: Updated for changes above.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76454 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c9bfff41
    • paroga@webkit.org's avatar
      2011-01-22 Patrick Gansterer <paroga@webkit.org> · 95057d93
      paroga@webkit.org authored
              Unreviewed WinCE build fix for r76430.
      
              * runtime/MachineStackMarker.cpp:
              (JSC::swapIfBackwards):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76441 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      95057d93
    • ggaren@apple.com's avatar
      Reorganized MarkedSpace, making many of its functions private. · d95a475b
      ggaren@apple.com authored
      Reviewed by Beth Dakin.
      
      * runtime/JSCell.h:
      (JSC::JSCell::Heap::heap):
      * runtime/MarkedSpace.h:
      (JSC::MarkedSpace::globalData):
      (JSC::MarkedSpace::heap):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76432 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d95a475b
  5. 21 Jan, 2011 4 commits
    • ggaren@apple.com's avatar
      Try to fix build: moved helper function out of #ifdef. · 46903aba
      ggaren@apple.com authored
      * runtime/MachineStackMarker.cpp:
      (JSC::swapIfBackwards):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      46903aba
    • ggaren@apple.com's avatar
      A few of Maciej's review suggestions for my last patch. · eda35d36
      ggaren@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=52946        
      
      Rubber-stamped by Maciej Stachowiak.
      
      SunSpider reports no change.
      
      * runtime/MachineStackMarker.cpp:
      (JSC::swapIfBackwards): Added a helper function for handling platforms
      where the stack can grow in any direction.
      
      (JSC::MachineStackMarker::markCurrentThreadConservativelyInternal):
      (JSC::MachineStackMarker::markOtherThreadConservatively): Use the helper
      function.
      
      (JSC::isPointerAligned): Use "!" instead of "==0" because a robot told me to.
      
      (JSC::MachineStackMarker::markConservatively): Changed to use a more
      standard looping idiom, and to use the helper function above.
      
      * runtime/MarkedSpace.h:
      (JSC::MarkedSpace::isCellAligned): Use "!" instead of "==0" because a robot told me to.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76430 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      eda35d36
    • ggaren@apple.com's avatar
      2011-01-21 Geoffrey Garen <ggaren@apple.com> · 86f21951
      ggaren@apple.com authored
              Reviewed by Maciej Stachowiak.
      
              Cleaned up some conservative marking code.
              https://bugs.webkit.org/show_bug.cgi?id=52946
              
              SunSpider reports no change.
      
              * interpreter/RegisterFile.h: No need for a special marking function,
              since we already expose a start() and end().
      
              * runtime/Heap.cpp:
              (JSC::Heap::registerFile):
              (JSC::Heap::markRoots):
              * runtime/Heap.h:
              (JSC::Heap::contains): Migrated markConservatively() to the machine stack
              marker class. Now, Heap just provides a contains() function, which the
              machine stack marker uses for checking whether a pointer points into the heap.
      
              * runtime/MachineStackMarker.cpp:
              (JSC::MachineStackMarker::markCurrentThreadConservativelyInternal):
              (JSC::MachineStackMarker::markOtherThreadConservatively):
              (JSC::isPointerAligned):
              (JSC::MachineStackMarker::markConservatively):
              * runtime/MachineStackMarker.h: Move the conservative marking code here.
      
              * runtime/MarkStack.h:
              (JSC::ConservativeSet::add):
              (JSC::ConservativeSet::mark): Changed to using a vector instead of hash
              set. Vector seems to be a bit faster, and it generates smaller code.
      
              * runtime/MarkedSpace.cpp:
              (JSC::MarkedSpace::containsSlowCase):
              * runtime/MarkedSpace.h:
              (JSC::MarkedSpace::isCellAligned):
              (JSC::MarkedSpace::isPossibleCell):
              (JSC::MarkedSpace::contains): Kept the code for determining whether a
              pointer pointed into marked space, and moved the code for marking
              a set of conservative pointers into the machine stack marker.
      
              * wtf/HashSet.h:
              (WTF::::add): Added two missing inlines that I noticed while testing
              vector vs hash set.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      86f21951
    • ggaren@apple.com's avatar
      2011-01-21 Geoffrey Garen <ggaren@apple.com> · ef52669c
      ggaren@apple.com authored
              Reviewed by Sam Weinig.
      
              Moved the mark stack from global data to the heap, since it pertains
              to the heap, and not the virtual machine as a whole.
              https://bugs.webkit.org/show_bug.cgi?id=52930
              
              SunSpider reports no change.
      
              * runtime/Heap.cpp:
              (JSC::Heap::Heap):
              (JSC::Heap::markRoots):
              * runtime/Heap.h:
              * runtime/JSGlobalData.cpp:
              (JSC::JSGlobalData::JSGlobalData):
              * runtime/JSGlobalData.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ef52669c
  6. 20 Jan, 2011 2 commits
    • ggaren@apple.com's avatar
      2011-01-20 Geoffrey Garen <ggaren@apple.com> · 7c9ff4d4
      ggaren@apple.com authored
              Reviewed by Oliver Hunt.
      
              When marking conservatively, guard against reviving dead objects.
              https://bugs.webkit.org/show_bug.cgi?id=52840
              
              SunSpider and v8 say no change.
      
              * interpreter/RegisterFile.h:
              (JSC::RegisterFile::markCallFrames): Updated to use the ConservativeSet API.
      
              * runtime/Heap.cpp:
              (JSC::Heap::recordExtraCost): No need to guard against conservative
              marking reviving dead objects anymore, since the conservative marking
              mechanism guards against this now.
      
              (JSC::Heap::markConservatively):
              (JSC::Heap::markProtectedObjects):
              (JSC::Heap::markTempSortVectors): Don't drain the mark stack inside a
              marking function. We want to establish a separation of concerns between
              visiting roots and draining the mark stack.
      
              (JSC::Heap::markRoots): Gather the set of conservative references before
              clearning mark bits, because conservative marking now uses the mark bits
              to determine if a reference is valid, and avoid reviving dead objects.
      
              (JSC::Heap::collectAllGarbage): No need to guard against conservative
              marking reviving dead objects anymore, since the conservative marking
              mechanism guards against this now.
      
              * runtime/Heap.h: Updated to use the ConservativeSet API.
      
              * runtime/MachineStackMarker.cpp:
              (JSC::MachineStackMarker::markCurrentThreadConservativelyInternal):
              (JSC::MachineStackMarker::markCurrentThreadConservatively):
              (JSC::MachineStackMarker::markOtherThreadConservatively):
              (JSC::MachineStackMarker::markMachineStackConservatively):
              * runtime/MachineStackMarker.h: Ditto.
      
              * runtime/MarkStack.h:
              (JSC::ConservativeSet::add):
              (JSC::ConservativeSet::mark): Added ConservativeSet, for gathering the
              set of conservative references. This is different from MarkStack, since
              we don't mark the set until it is completely gathered.
      
              * runtime/MarkedSpace.cpp:
              (JSC::MarkedSpace::freeBlock):
              (JSC::MarkedSpace::resizeBlocks):
              (JSC::MarkedSpace::markConservatively):
              * runtime/MarkedSpace.h: When marking conservatively, guard against
              reviving dead objects.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76331 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7c9ff4d4
    • 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
  7. 19 Jan, 2011 3 commits
    • ggaren@apple.com's avatar
      Rolled back in r76078, with crash fixed. · aa9d3fb4
      ggaren@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=52668
              
      Reviewed by Darin Adler.
      
      * runtime/JSGlobalObject.cpp:
      (JSC::JSGlobalObject::markChildren): Account for the fact that the global
      object moves its variables into and out of the register file. While out
      of the register file, the symbol table's size is not an accurate count
      for the size of the register array, since the BytecodeGenerator might
      be compiling, adding items to the symbol table.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      aa9d3fb4
    • darin@apple.com's avatar
      2011-01-18 Darin Adler <darin@apple.com> · 4cd37c31
      darin@apple.com authored
              Reviewed by Geoffrey Garen.
      
              Stack overflow when converting an Error object to string
              https://bugs.webkit.org/show_bug.cgi?id=46410
      
              * fast/js/script-tests/toString-recursion.js: Added.
              * fast/js/toString-recursion-expected.txt: Added.
              * fast/js/toString-recursion.html: Added.
      2011-01-18  Darin Adler  <darin@apple.com>
      
              Reviewed by Geoffrey Garen.
      
              Stack overflow when converting an Error object to string
              https://bugs.webkit.org/show_bug.cgi?id=46410
      
              * Android.mk: Added StringRecursionChecker.cpp and
              StringRecursionChecker.h.
              * CMakeLists.txt: Ditto.
              * GNUmakefile.am: Ditto.
              * JavaScriptCore.gypi: Ditto.
              * JavaScriptCore.pro: Ditto.
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
              * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
      
              * runtime/ArrayPrototype.cpp:
              (JSC::arrayProtoFuncToString): Use StringRecursionChecker instead
              of the older hand-written code to do the same thing.
              (JSC::arrayProtoFuncToLocaleString): Ditto.
              (JSC::arrayProtoFuncJoin): Ditto.
      
              * runtime/ErrorPrototype.cpp:
              (JSC::errorProtoFuncToString): Use StringRecursionChecker.
      
              * runtime/JSGlobalData.h: Renamed arrayVisitedElements to
              stringRecursionCheckVisitedObjects.
      
              * runtime/RegExpPrototype.cpp:
              (JSC::regExpProtoFuncToString): Use StringRecursionChecker.
      
              * runtime/StringRecursionChecker.cpp: Added.
              * runtime/StringRecursionChecker.h: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4cd37c31
    • oliver@apple.com's avatar
      2011-01-19 Oliver Hunt <oliver@apple.com> · e217b16e
      oliver@apple.com authored
              Reviewed by Gavin Barraclough.
      
              Remove non-spec support for callable RegExp
              https://bugs.webkit.org/show_bug.cgi?id=28285
      
              Update test results for new behaviour.
      
              * fast/js/sputnik/Conformance/11_Expressions/11.4_Unary_Operators/11.4.3_The_typeof_Operator/S11.4.3_A3.6-expected.txt:
              * fast/js/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.7/S15.10.7_A1_T1-expected.txt:
              * fast/js/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.7/S15.10.7_A1_T2-expected.txt:
              * fast/js/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.7/S15.10.7_A3_T1-expected.txt:
              * fast/js/sputnik/Conformance/15_Native_Objects/15.10_RegExp/15.10.7/S15.10.7_A3_T2-expected.txt:
              * fast/loader/stateobjects/pushstate-object-types-expected.txt:
              * fast/regex/cross-frame-callable-expected.txt:
              * fast/regex/script-tests/cross-frame-callable.js:
              (doTest):
      2011-01-19  Oliver Hunt  <oliver@apple.com>
      
              Reviewed by Gavin Barraclough.
      
              Remove non-spec support for callable RegExp
              https://bugs.webkit.org/show_bug.cgi?id=28285
      
              Remove support for callable regexps.  If it breaks sites we can
              just roll this out.
      
              * runtime/RegExpObject.cpp:
              * runtime/RegExpObject.h:
              * tests/mozilla/expected.html: update results.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76180 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e217b16e
  8. 18 Jan, 2011 3 commits
  9. 15 Jan, 2011 1 commit
  10. 14 Jan, 2011 4 commits
    • ggaren@apple.com's avatar
      Reverted accidentally committed code from my last checkin. · edf34a60
      ggaren@apple.com authored
      * runtime/Heap.cpp:
      (JSC::Heap::markRoots):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75867 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      edf34a60
    • ggaren@apple.com's avatar
      Try to fix the GTK bot. · 2029c2ad
      ggaren@apple.com authored
      Reviewed by Sam Weinig.
      
      * runtime/Heap.cpp:
      (JSC::Heap::Heap):
      (JSC::Heap::markRoots): Kids, remember to initialize your data members.
      Knowing is half the battle.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75866 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2029c2ad
    • ggaren@apple.com's avatar
      Try to fix non-Dtrace builds: #include Tracing.h instead of TracingDtrace.h. · c2c80282
      ggaren@apple.com authored
      * runtime/Heap.cpp:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75856 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c2c80282
    • ggaren@apple.com's avatar
      2011-01-13 Geoffrey Garen <ggaren@apple.com> · 7c622bc0
      ggaren@apple.com authored
              Reviewed by Oliver Hunt.
      
              Split out a MarkedSpace strategy object from Heap.
              https://bugs.webkit.org/show_bug.cgi?id=52421
      
              * Misc/WebCoreStatistics.mm:
              (+[WebCoreStatistics memoryStatistics]): Updated for class move.
      2011-01-13  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Oliver Hunt.
      
              Split out a MarkedSpace strategy object from Heap.
              https://bugs.webkit.org/show_bug.cgi?id=52421
              
              SunSpider reports no change.
      
              * Android.mk:
              * CMakeLists.txt:
              * GNUmakefile.am:
              * JavaScriptCore.gypi:
              * JavaScriptCore.pro:
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
              * JavaScriptCore.xcodeproj/project.pbxproj: Updated our 7 build systems. Which is cool.
      
              * runtime/Heap.cpp:
              (JSC::Heap::Heap):
              (JSC::Heap::destroy):
              (JSC::Heap::recordExtraCost):
              (JSC::Heap::allocate):
              (JSC::Heap::markConservatively):
              (JSC::Heap::markRoots):
              (JSC::Heap::objectCount):
              (JSC::Heap::statistics):
              (JSC::Heap::size):
              (JSC::Heap::isBusy):
              (JSC::Heap::collectAllGarbage):
              (JSC::Heap::primaryHeapBegin):
              (JSC::Heap::primaryHeapEnd):
              * runtime/Heap.h:
              (JSC::Heap::globalData):
              (JSC::Heap::markedSpace):
              (JSC::Heap::isCellMarked):
              (JSC::Heap::checkMarkCell):
              (JSC::Heap::markCell): Moved all code pertaining to managing chunks of
              collector memory out of this class. Heap now just delegates to MarkedSpace.
      
              * runtime/JSCell.h:
              (JSC::JSCell::Heap::heap): Updated for MarkedSpace delegation.
      
              * runtime/JSValue.h: Moved the ValueStringPair typedef to help with #includes.
      
              * runtime/MarkedSpace.cpp: Copied from runtime/Heap.cpp.
              (JSC::MarkedSpace::MarkedSpace):
              (JSC::MarkedSpace::destroy):
              (JSC::MarkedSpace::allocateBlock):
              (JSC::MarkedSpace::freeBlock):
              (JSC::MarkedSpace::allocate):
              (JSC::MarkedSpace::resizeBlocks):
              (JSC::MarkedSpace::growBlocks):
              (JSC::MarkedSpace::shrinkBlocks):
              (JSC::MarkedSpace::markConservatively):
              (JSC::MarkedSpace::clearMarkBits):
              (JSC::MarkedSpace::markedCells):
              (JSC::MarkedSpace::sweep):
              (JSC::MarkedSpace::objectCount):
              (JSC::MarkedSpace::addToStatistics):
              (JSC::MarkedSpace::statistics):
              (JSC::MarkedSpace::size):
              (JSC::MarkedSpace::reset):
              (JSC::MarkedSpace::primaryHeapBegin):
              (JSC::MarkedSpace::primaryHeapEnd):
              * runtime/MarkedSpace.h: Copied from runtime/Heap.h.
              (JSC::MarkedSpace::globalData):
              (JSC::MarkedSpace::didShrink):
              (JSC::MarkedSpace::cellBlock):
              (JSC::MarkedSpace::cellOffset):
              (JSC::MarkedSpace::isCellMarked):
              (JSC::MarkedSpace::checkMarkCell):
              (JSC::MarkedSpace::markCell): Moved all code pertaining to managing chunks of
              collector memory into this class.
      
              * runtime/MemoryStatistics.cpp:
              (JSC::heapStatistics):
              * runtime/MemoryStatistics.h: Updated for MarkedSpace delegation.
      2011-01-13  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Oliver Hunt.
      
              Split out a MarkedSpace strategy object from Heap.
              https://bugs.webkit.org/show_bug.cgi?id=52421
      
              * Shared/mac/WebMemorySampler.mac.mm:
              (WebKit::WebMemorySampler::sampleWebKit): Updated for class move.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75855 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7c622bc0
  11. 12 Jan, 2011 3 commits
    • pvarga@webkit.org's avatar
      2011-01-12 Peter Varga <pvarga@webkit.org> · f5f4c2d2
      pvarga@webkit.org authored
              Reviewed by Gavin Barraclough.
      
              Add Yarr.h to YARR
              https://bugs.webkit.org/show_bug.cgi?id=51021
      
              Move other common constants and functions from YARR's different files
              to Yarr.h.
              Use Yarr.h header instead of including other YARR headers where it
              is possible.
      
              * JavaScriptCore.gypi:
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
              * JavaScriptCore.xcodeproj/project.pbxproj:
              * runtime/RegExp.cpp:
              * yarr/Yarr.h: Added.
              * yarr/YarrInterpreter.cpp:
              * yarr/YarrInterpreter.h:
              * yarr/YarrJIT.cpp:
              (JSC::Yarr::jitCompile):
              (JSC::Yarr::execute):
              * yarr/YarrJIT.h:
              * yarr/YarrParser.h:
              * yarr/YarrPattern.cpp:
              (JSC::Yarr::YarrPattern::compile):
              (JSC::Yarr::YarrPattern::YarrPattern):
              * yarr/YarrPattern.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75602 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f5f4c2d2
    • ossy@webkit.org's avatar
      Unreviewed, rolling out r75595. · f27ce280
      ossy@webkit.org authored
      http://trac.webkit.org/changeset/75595
      https://bugs.webkit.org/show_bug.cgi?id=52286
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2011-01-12
      It broke fast/regex/pcre-test-1.html (Requested by Ossy on
      #webkit).
      
      * JavaScriptCore.gypi:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * runtime/RegExp.cpp:
      * yarr/Yarr.h: Removed.
      * yarr/YarrInterpreter.cpp:
      * yarr/YarrInterpreter.h:
      * yarr/YarrJIT.cpp:
      (JSC::Yarr::jitCompile):
      * yarr/YarrJIT.h:
      (JSC::Yarr::execute):
      * yarr/YarrParser.h:
      * yarr/YarrPattern.cpp:
      (JSC::Yarr::compile):
      (JSC::Yarr::YarrPattern::YarrPattern):
      * yarr/YarrPattern.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75597 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f27ce280
    • pvarga@webkit.org's avatar
      2011-01-12 Peter Varga <pvarga@webkit.org> · 2dfa6f9f
      pvarga@webkit.org authored
              Reviewed by Gavin Barraclough.
      
              Add Yarr.h to YARR
              https://bugs.webkit.org/show_bug.cgi?id=51021
      
              Move other common constants and functions from YARR's different files
              to Yarr.h.
              Use Yarr.h header instead of including other YARR headers where it
              is possible.
      
              * JavaScriptCore.gypi:
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
              * JavaScriptCore.xcodeproj/project.pbxproj:
              * runtime/RegExp.cpp:
              * yarr/Yarr.h: Added.
              * yarr/YarrInterpreter.cpp:
              * yarr/YarrInterpreter.h:
              * yarr/YarrJIT.cpp:
              (JSC::Yarr::jitCompile):
              (JSC::Yarr::execute):
              * yarr/YarrJIT.h:
              * yarr/YarrParser.h:
              * yarr/YarrPattern.cpp:
              (JSC::Yarr::YarrPattern::compile):
              (JSC::Yarr::YarrPattern::YarrPattern):
              * yarr/YarrPattern.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75595 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2dfa6f9f
  12. 11 Jan, 2011 2 commits
    • msaboff@apple.com's avatar
      2011-01-11 Michael Saboff <msaboff@apple.com> · eb23d0e2
      msaboff@apple.com authored
              Reviewed by Geoffrey Garen.
      
              Missing call to popTempSortVector() for exception case in JSArray::sort.
              https://bugs.webkit.org/show_bug.cgi?id=50718
      
              Fix to patch of 50718 that added pushTempSortVector() and 
              popTempSortVector() to JSArray::sort() to mark elements during sort.
              Need to add popTempSortVector() for the return case if toString()
              had an exception.
      
              * runtime/JSArray.cpp:
              (JSC::JSArray::sort): Added popTempSortVector()
      2011-01-11  Michael Saboff  <msaboff@apple.com>
      
              Reviewed by Geoffrey Garen.
      
              Missing call to popTempSortVector() for exception case in JSArray::sort.
              https://bugs.webkit.org/show_bug.cgi?id=50718
      
              New test to validate balanced calls to pushTempSortVector() and
              popTempSortVector().
      
              * fast/js/array-sort-exception-expected.txt: Added.
              * fast/js/array-sort-exception.html: Added.
              * fast/js/script-tests/array-sort-exception.js: Added.
              (do_gc):
              (Item):
              (toString_throw):
              (test):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75531 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      eb23d0e2
    • xan@webkit.org's avatar
      2011-01-11 Xan Lopez <xlopez@igalia.com> · 602cf1bc
      xan@webkit.org authored
              Reviewed by Darin Adler.
      
              Microoptimization in ~JSString
              https://bugs.webkit.org/show_bug.cgi?id=52222
      
              The case where m_fibers is 0 seems to be the most common one
              (almost 1/2 of the time, followed at some distance by m_fibers = 1
              in 1/4 of the cases in a typical SunSpider execution). We can save
              one comparison in this common case by doing a bit of refactoring
              in the JSString destructor; overall a 0.3% progression, but only
              the string tests show improvement.
      
              * runtime/JSString.h:
              (JSC::RopeBuilder::~JSString):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      602cf1bc
  13. 10 Jan, 2011 6 commits
    • ggaren@apple.com's avatar
      Build fix: removed some uses of nextNumber that I missed last time. · eaa5d1d5
      ggaren@apple.com authored
      * runtime/Heap.cpp:
      (JSC::Heap::reset):
      (JSC::Heap::collectAllGarbage):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75453 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      eaa5d1d5
    • ggaren@apple.com's avatar
      2011-01-10 Geoffrey Garen <ggaren@apple.com> · 1fde23bf
      ggaren@apple.com authored
              Reviewed by Oliver Hunt.
      
              Removed dead number allocation code.
              https://bugs.webkit.org/show_bug.cgi?id=52177
      
              * runtime/Heap.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75451 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1fde23bf
    • ggaren@apple.com's avatar
      Moved Collector.* => Heap.*, since the file contains a class named "Heap". · a8b3854a
      ggaren@apple.com authored
      Reviewed by Oliver Hunt.
      
      Source/JavaScriptCore: 
      
      * API/JSCallbackObject.cpp:
      * Android.mk:
      * CMakeLists.txt:
      * GNUmakefile.am:
      * JavaScriptCore.gypi:
      * JavaScriptCore.pro:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * interpreter/Interpreter.cpp:
      * interpreter/RegisterFile.h:
      * jit/JITStubs.cpp:
      * runtime/Collector.cpp: Removed.
      * runtime/Collector.h: Removed.
      * runtime/CollectorHeapIterator.h:
      * runtime/GCActivityCallbackCF.cpp:
      * runtime/Heap.cpp: Copied from JavaScriptCore/runtime/Collector.cpp.
      * runtime/Heap.h: Copied from JavaScriptCore/runtime/Collector.h.
      * runtime/InitializeThreading.cpp:
      * runtime/JSCell.h:
      * runtime/JSGlobalData.cpp:
      * runtime/JSGlobalData.h:
      * runtime/JSLock.cpp:
      * runtime/JSNumberCell.h:
      * runtime/MachineStackMarker.cpp:
      * runtime/MemoryStatistics.h:
      * runtime/Protect.h:
      * runtime/UString.cpp:
      * runtime/WeakGCMap.h:
      * runtime/WeakGCPtr.h:
      
      Source/JavaScriptGlue: 
      
      * JSUtils.h:
      
      Source/WebCore: 
      
      * ForwardingHeaders/runtime/Collector.h: Removed.
      * ForwardingHeaders/runtime/Heap.h: Copied from WebCore/ForwardingHeaders/runtime/Collector.h.
      * WebCore.vcproj/WebCore.vcproj:
      * bindings/js/GCController.cpp:
      * bindings/js/ScriptGCEvent.cpp:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75443 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a8b3854a
    • xan@webkit.org's avatar
      2011-01-10 Xan Lopez <xlopez@igalia.com> · 4a2d85ba
      xan@webkit.org authored
              Reviewed by Gavin Barraclough.
      
              Remove unused isString() case in JSString::toPrimitiveString()
              https://bugs.webkit.org/show_bug.cgi?id=52167
      
              We never call toPrimitiveString() with strings, so remove the
              check and add an ASSERT ensuring this never happens. 0.7% overall
              progression in sunspider, since one of the call sites is very hot.
      
              * runtime/JSString.h:
              (JSC::JSValue::toPrimitiveString):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75427 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4a2d85ba
    • barraclough@apple.com's avatar
      Rename the existing YARR files and classes · 7dd3056d
      barraclough@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=51872
      
      Patch by Peter Varga <pvarga@inf.u-szeged.hu> on 2011-01-10
      Reviewed by Gavin Barraclough.
      
      Replace the "Regex" prefix with "Yarr" in the name of YARR files and classes.
      
      * Android.mk:
      * CMakeLists.txt:
      * GNUmakefile.am:
      * JavaScriptCore.gypi:
      * JavaScriptCore.pro:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * runtime/RegExp.cpp:
      (JSC::RegExp::compile):
      (JSC::RegExp::match):
      (JSC::RegExp::printTraceData):
      * yarr/YarrInterpreter.cpp: Renamed from Source/JavaScriptCore/yarr/RegexInterpreter.cpp.
      (JSC::Yarr::Interpreter::appendParenthesesDisjunctionContext):
      (JSC::Yarr::Interpreter::popParenthesesDisjunctionContext):
      (JSC::Yarr::Interpreter::DisjunctionContext::DisjunctionContext):
      (JSC::Yarr::Interpreter::DisjunctionContext::operator new):
      (JSC::Yarr::Interpreter::allocDisjunctionContext):
      (JSC::Yarr::Interpreter::freeDisjunctionContext):
      (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::ParenthesesDisjunctionContext):
      (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::operator new):
      (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::restoreOutput):
      (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::getDisjunctionContext):
      (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext):
      (JSC::Yarr::Interpreter::freeParenthesesDisjunctionContext):
      (JSC::Yarr::Interpreter::InputStream::InputStream):
      (JSC::Yarr::Interpreter::InputStream::next):
      (JSC::Yarr::Interpreter::InputStream::rewind):
      (JSC::Yarr::Interpreter::InputStream::read):
      (JSC::Yarr::Interpreter::InputStream::readPair):
      (JSC::Yarr::Interpreter::InputStream::readChecked):
      (JSC::Yarr::Interpreter::InputStream::reread):
      (JSC::Yarr::Interpreter::InputStream::prev):
      (JSC::Yarr::Interpreter::InputStream::getPos):
      (JSC::Yarr::Interpreter::InputStream::setPos):
      (JSC::Yarr::Interpreter::InputStream::atStart):
      (JSC::Yarr::Interpreter::InputStream::atEnd):
      (JSC::Yarr::Interpreter::InputStream::checkInput):
      (JSC::Yarr::Interpreter::InputStream::uncheckInput):
      (JSC::Yarr::Interpreter::InputStream::isNotAvailableInput):
      (JSC::Yarr::Interpreter::testCharacterClass):
      (JSC::Yarr::Interpreter::checkCharacter):
      (JSC::Yarr::Interpreter::checkCasedCharacter):
      (JSC::Yarr::Interpreter::checkCharacterClass):
      (JSC::Yarr::Interpreter::tryConsumeBackReference):
      (JSC::Yarr::Interpreter::matchAssertionBOL):
      (JSC::Yarr::Interpreter::matchAssertionEOL):
      (JSC::Yarr::Interpreter::matchAssertionWordBoundary):
      (JSC::Yarr::Interpreter::backtrackPatternCharacter):
      (JSC::Yarr::Interpreter::backtrackPatternCasedCharacter):
      (JSC::Yarr::Interpreter::matchCharacterClass):
      (JSC::Yarr::Interpreter::backtrackCharacterClass):
      (JSC::Yarr::Interpreter::matchBackReference):
      (JSC::Yarr::Interpreter::backtrackBackReference):
      (JSC::Yarr::Interpreter::recordParenthesesMatch):
      (JSC::Yarr::Interpreter::resetMatches):
      (JSC::Yarr::Interpreter::parenthesesDoBacktrack):
      (JSC::Yarr::Interpreter::matchParenthesesOnceBegin):
      (JSC::Yarr::Interpreter::matchParenthesesOnceEnd):
      (JSC::Yarr::Interpreter::backtrackParenthesesOnceBegin):
      (JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):
      (JSC::Yarr::Interpreter::matchParenthesesTerminalBegin):
      (JSC::Yarr::Interpreter::matchParenthesesTerminalEnd):
      (JSC::Yarr::Interpreter::backtrackParenthesesTerminalBegin):
      (JSC::Yarr::Interpreter::backtrackParenthesesTerminalEnd):
      (JSC::Yarr::Interpreter::matchParentheticalAssertionBegin):
      (JSC::Yarr::Interpreter::matchParentheticalAssertionEnd):
      (JSC::Yarr::Interpreter::backtrackParentheticalAssertionBegin):
      (JSC::Yarr::Interpreter::backtrackParentheticalAssertionEnd):
      (JSC::Yarr::Interpreter::matchParentheses):
      (JSC::Yarr::Interpreter::backtrackParentheses):
      (JSC::Yarr::Interpreter::lookupForBeginChars):
      (JSC::Yarr::Interpreter::matchDisjunction):
      (JSC::Yarr::Interpreter::matchNonZeroDisjunction):
      (JSC::Yarr::Interpreter::interpret):
      (JSC::Yarr::Interpreter::Interpreter):
      (JSC::Yarr::ByteCompiler::ParenthesesStackEntry::ParenthesesStackEntry):
      (JSC::Yarr::ByteCompiler::ByteCompiler):
      (JSC::Yarr::ByteCompiler::compile):
      (JSC::Yarr::ByteCompiler::checkInput):
      (JSC::Yarr::ByteCompiler::assertionBOL):
      (JSC::Yarr::ByteCompiler::assertionEOL):
      (JSC::Yarr::ByteCompiler::assertionWordBoundary):
      (JSC::Yarr::ByteCompiler::atomPatternCharacter):
      (JSC::Yarr::ByteCompiler::atomCharacterClass):
      (JSC::Yarr::ByteCompiler::atomBackReference):
      (JSC::Yarr::ByteCompiler::atomParenthesesOnceBegin):
      (JSC::Yarr::ByteCompiler::atomParenthesesTerminalBegin):
      (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
      (JSC::Yarr::ByteCompiler::atomParentheticalAssertionBegin):
      (JSC::Yarr::ByteCompiler::atomParentheticalAssertionEnd):
      (JSC::Yarr::ByteCompiler::popParenthesesStack):
      (JSC::Yarr::ByteCompiler::dumpDisjunction):
      (JSC::Yarr::ByteCompiler::closeAlternative):
      (JSC::Yarr::ByteCompiler::closeBodyAlternative):
      (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternEnd):
      (JSC::Yarr::ByteCompiler::atomParenthesesOnceEnd):
      (JSC::Yarr::ByteCompiler::atomParenthesesTerminalEnd):
      (JSC::Yarr::ByteCompiler::regexBegin):
      (JSC::Yarr::ByteCompiler::regexEnd):
      (JSC::Yarr::ByteCompiler::alternativeBodyDisjunction):
      (JSC::Yarr::ByteCompiler::alternativeDisjunction):
      (JSC::Yarr::ByteCompiler::emitDisjunction):
      (JSC::Yarr::byteCompile):
      (JSC::Yarr::interpret):
      * yarr/YarrInterpreter.h: Renamed from Source/JavaScriptCore/yarr/RegexInterpreter.h.
      (JSC::Yarr::ByteTerm::ByteTerm):
      (JSC::Yarr::ByteTerm::BOL):
      (JSC::Yarr::ByteTerm::CheckInput):
      (JSC::Yarr::ByteTerm::EOL):
      (JSC::Yarr::ByteTerm::WordBoundary):
      (JSC::Yarr::ByteTerm::BackReference):
      (JSC::Yarr::ByteTerm::BodyAlternativeBegin):
      (JSC::Yarr::ByteTerm::BodyAlternativeDisjunction):
      (JSC::Yarr::ByteTerm::BodyAlternativeEnd):
      (JSC::Yarr::ByteTerm::AlternativeBegin):
      (JSC::Yarr::ByteTerm::AlternativeDisjunction):
      (JSC::Yarr::ByteTerm::AlternativeEnd):
      (JSC::Yarr::ByteTerm::SubpatternBegin):
      (JSC::Yarr::ByteTerm::SubpatternEnd):
      (JSC::Yarr::ByteTerm::invert):
      (JSC::Yarr::ByteTerm::capture):
      (JSC::Yarr::ByteDisjunction::ByteDisjunction):
      (JSC::Yarr::BytecodePattern::BytecodePattern):
      (JSC::Yarr::BytecodePattern::~BytecodePattern):
      * yarr/YarrJIT.cpp: Renamed from Source/JavaScriptCore/yarr/RegexJIT.cpp.
      (JSC::Yarr::YarrGenerator::optimizeAlternative):
      (JSC::Yarr::YarrGenerator::matchCharacterClassRange):
      (JSC::Yarr::YarrGenerator::matchCharacterClass):
      (JSC::Yarr::YarrGenerator::jumpIfNoAvailableInput):
      (JSC::Yarr::YarrGenerator::jumpIfAvailableInput):
      (JSC::Yarr::YarrGenerator::checkInput):
      (JSC::Yarr::YarrGenerator::atEndOfInput):
      (JSC::Yarr::YarrGenerator::notAtEndOfInput):
      (JSC::Yarr::YarrGenerator::jumpIfCharEquals):
      (JSC::Yarr::YarrGenerator::jumpIfCharNotEquals):
      (JSC::Yarr::YarrGenerator::readCharacter):
      (JSC::Yarr::YarrGenerator::storeToFrame):
      (JSC::Yarr::YarrGenerator::storeToFrameWithPatch):
      (JSC::Yarr::YarrGenerator::loadFromFrame):
      (JSC::Yarr::YarrGenerator::loadFromFrameAndJump):
      (JSC::Yarr::YarrGenerator::IndirectJumpEntry::IndirectJumpEntry):
      (JSC::Yarr::YarrGenerator::IndirectJumpEntry::addJump):
      (JSC::Yarr::YarrGenerator::AlternativeBacktrackRecord::AlternativeBacktrackRecord):
      (JSC::Yarr::YarrGenerator::GenerationState::GenerationState):
      (JSC::Yarr::YarrGenerator::GenerationState::addIndirectJumpEntry):
      (JSC::Yarr::YarrGenerator::GenerationState::emitIndirectJumpTable):
      (JSC::Yarr::YarrGenerator::GenerationState::incrementParenNestingLevel):
      (JSC::Yarr::YarrGenerator::GenerationState::decrementParenNestingLevel):
      (JSC::Yarr::YarrGenerator::GenerationState::addParenthesesTail):
      (JSC::Yarr::YarrGenerator::GenerationState::emitParenthesesTail):
      (JSC::Yarr::YarrGenerator::GenerationState::addJumpToNextInteration):
      (JSC::Yarr::YarrGenerator::GenerationState::addJumpsToNextInteration):
      (JSC::Yarr::YarrGenerator::GenerationState::addDataLabelToNextIteration):
      (JSC::Yarr::YarrGenerator::GenerationState::linkToNextIteration):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::BacktrackDestination):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::clear):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::clearDataLabel):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::hasDestination):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::isStackOffset):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::isLabel):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::isJumpList):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::hasDataLabel):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::copyTarget):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::copyTo):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::addBacktrackJump):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::setStackOffset):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::setLabel):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::setNextBacktrackLabel):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::copyBacktrackToLabel):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::setBacktrackToLabel):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::setBacktrackJumpList):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::setBacktrackSourceLabel):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::setDataLabel):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::setSubDataLabelPtr):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::linkToNextBacktrack):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::getStackOffset):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::getLabel):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::getBacktrackJumps):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::getDataLabel):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::jumpToBacktrack):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::linkDataLabelToHereIfExists):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::plantJumpToBacktrackIfExists):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::linkAlternativeBacktracks):
      (JSC::Yarr::YarrGenerator::BacktrackDestination::linkAlternativeBacktracksTo):
      (JSC::Yarr::YarrGenerator::TermGenerationState::TermGenerationState):
      (JSC::Yarr::YarrGenerator::TermGenerationState::resetAlternative):
      (JSC::Yarr::YarrGenerator::TermGenerationState::alternativeValid):
      (JSC::Yarr::YarrGenerator::TermGenerationState::nextAlternative):
      (JSC::Yarr::YarrGenerator::TermGenerationState::alternative):
      (JSC::Yarr::YarrGenerator::TermGenerationState::isLastAlternative):
      (JSC::Yarr::YarrGenerator::TermGenerationState::resetTerm):
      (JSC::Yarr::YarrGenerator::TermGenerationState::termValid):
      (JSC::Yarr::YarrGenerator::TermGenerationState::nextTerm):
      (JSC::Yarr::YarrGenerator::TermGenerationState::term):
      (JSC::Yarr::YarrGenerator::TermGenerationState::isLastTerm):
      (JSC::Yarr::YarrGenerator::TermGenerationState::getSubParenNum):
      (JSC::Yarr::YarrGenerator::TermGenerationState::isMainDisjunction):
      (JSC::Yarr::YarrGenerator::TermGenerationState::setParenthesesTail):
      (JSC::Yarr::YarrGenerator::TermGenerationState::getParenthesesTail):
      (JSC::Yarr::YarrGenerator::TermGenerationState::lookaheadTerm):
      (JSC::Yarr::YarrGenerator::TermGenerationState::isSinglePatternCharacterLookaheadTerm):
      (JSC::Yarr::YarrGenerator::TermGenerationState::inputOffset):
      (JSC::Yarr::YarrGenerator::TermGenerationState::clearBacktrack):
      (JSC::Yarr::YarrGenerator::TermGenerationState::jumpToBacktrack):
      (JSC::Yarr::YarrGenerator::TermGenerationState::plantJumpToBacktrackIfExists):
      (JSC::Yarr::YarrGenerator::TermGenerationState::linkDataLabelToBacktrackIfExists):
      (JSC::Yarr::YarrGenerator::TermGenerationState::addBacktrackJump):
      (JSC::Yarr::YarrGenerator::TermGenerationState::setBacktrackDataLabel):
      (JSC::Yarr::YarrGenerator::TermGenerationState::setBackTrackStackOffset):
      (JSC::Yarr::YarrGenerator::TermGenerationState::setBacktrackLabel):
      (JSC::Yarr::YarrGenerator::TermGenerationState::linkAlternativeBacktracks):
      (JSC::Yarr::YarrGenerator::TermGenerationState::linkAlternativeBacktracksTo):
      (JSC::Yarr::YarrGenerator::TermGenerationState::setBacktrackLink):
      (JSC::Yarr::YarrGenerator::TermGenerationState::chainBacktracks):
      (JSC::Yarr::YarrGenerator::TermGenerationState::chainBacktrackJumps):
      (JSC::Yarr::YarrGenerator::TermGenerationState::getBacktrackDestination):
      (JSC::Yarr::YarrGenerator::TermGenerationState::propagateBacktrackingFrom):
      (JSC::Yarr::YarrGenerator::ParenthesesTail::ParenthesesTail):
      (JSC::Yarr::YarrGenerator::ParenthesesTail::processBacktracks):
      (JSC::Yarr::YarrGenerator::ParenthesesTail::setNextIteration):
      (JSC::Yarr::YarrGenerator::ParenthesesTail::addAfterParenJump):
      (JSC::Yarr::YarrGenerator::ParenthesesTail::generateCode):
      (JSC::Yarr::YarrGenerator::generateAssertionBOL):
      (JSC::Yarr::YarrGenerator::generateAssertionEOL):
      (JSC::Yarr::YarrGenerator::matchAssertionWordchar):
      (JSC::Yarr::YarrGenerator::generateAssertionWordBoundary):
      (JSC::Yarr::YarrGenerator::generatePatternCharacterSingle):
      (JSC::Yarr::YarrGenerator::generatePatternCharacterPair):
      (JSC::Yarr::YarrGenerator::generatePatternCharacterFixed):
      (JSC::Yarr::YarrGenerator::generatePatternCharacterGreedy):
      (JSC::Yarr::YarrGenerator::generatePatternCharacterNonGreedy):
      (JSC::Yarr::YarrGenerator::generateCharacterClassSingle):
      (JSC::Yarr::YarrGenerator::generateCharacterClassFixed):
      (JSC::Yarr::YarrGenerator::generateCharacterClassGreedy):
      (JSC::Yarr::YarrGenerator::generateCharacterClassNonGreedy):
      (JSC::Yarr::YarrGenerator::generateParenthesesDisjunction):
      (JSC::Yarr::YarrGenerator::generateParenthesesSingle):
      (JSC::Yarr::YarrGenerator::generateParenthesesGreedyNoBacktrack):
      (JSC::Yarr::YarrGenerator::generateParentheticalAssertion):
      (JSC::Yarr::YarrGenerator::generateTerm):
      (JSC::Yarr::YarrGenerator::generateDisjunction):
      (JSC::Yarr::YarrGenerator::generateEnter):
      (JSC::Yarr::YarrGenerator::generateReturn):
      (JSC::Yarr::YarrGenerator::YarrGenerator):
      (JSC::Yarr::YarrGenerator::generate):
      (JSC::Yarr::YarrGenerator::compile):
      (JSC::Yarr::jitCompile):
      * yarr/YarrJIT.h: Renamed from Source/JavaScriptCore/yarr/RegexJIT.h.
      (JSC::Yarr::YarrCodeBlock::YarrCodeBlock):
      (JSC::Yarr::YarrCodeBlock::~YarrCodeBlock):
      (JSC::Yarr::YarrCodeBlock::setFallBack):
      (JSC::Yarr::YarrCodeBlock::isFallBack):
      (JSC::Yarr::YarrCodeBlock::set):
      (JSC::Yarr::YarrCodeBlock::execute):
      (JSC::Yarr::YarrCodeBlock::getAddr):
      (JSC::Yarr::execute):
      * yarr/YarrParser.h: Renamed from Source/JavaScriptCore/yarr/RegexParser.h.
      (JSC::Yarr::Parser::CharacterClassParserDelegate::CharacterClassParserDelegate):
      (JSC::Yarr::Parser::CharacterClassParserDelegate::begin):
      (JSC::Yarr::Parser::CharacterClassParserDelegate::atomPatternCharacter):
      (JSC::Yarr::Parser::CharacterClassParserDelegate::atomBuiltInCharacterClass):
      (JSC::Yarr::Parser::CharacterClassParserDelegate::end):
      (JSC::Yarr::Parser::CharacterClassParserDelegate::assertionWordBoundary):
      (JSC::Yarr::Parser::CharacterClassParserDelegate::atomBackReference):
      (JSC::Yarr::Parser::Parser):
      (JSC::Yarr::Parser::parseEscape):
      (JSC::Yarr::Parser::parseAtomEscape):
      (JSC::Yarr::Parser::parseCharacterClassEscape):
      (JSC::Yarr::Parser::parseCharacterClass):
      (JSC::Yarr::Parser::parseParenthesesBegin):
      (JSC::Yarr::Parser::parseParenthesesEnd):
      (JSC::Yarr::Parser::parseQuantifier):
      (JSC::Yarr::Parser::parseTokens):
      (JSC::Yarr::Parser::parse):
      (JSC::Yarr::Parser::saveState):
      (JSC::Yarr::Parser::restoreState):
      (JSC::Yarr::Parser::atEndOfPattern):
      (JSC::Yarr::Parser::peek):
      (JSC::Yarr::Parser::peekIsDigit):
      (JSC::Yarr::Parser::peekDigit):
      (JSC::Yarr::Parser::consume):
      (JSC::Yarr::Parser::consumeDigit):
      (JSC::Yarr::Parser::consumeNumber):
      (JSC::Yarr::Parser::consumeOctal):
      (JSC::Yarr::Parser::tryConsume):
      (JSC::Yarr::Parser::tryConsumeHex):
      (JSC::Yarr::parse):
      * yarr/YarrPattern.cpp: Renamed from Source/JavaScriptCore/yarr/RegexPattern.cpp.
      (JSC::Yarr::CharacterClassConstructor::CharacterClassConstructor):
      (JSC::Yarr::CharacterClassConstructor::reset):
      (JSC::Yarr::CharacterClassConstructor::append):
      (JSC::Yarr::CharacterClassConstructor::putChar):
      (JSC::Yarr::CharacterClassConstructor::isUnicodeUpper):
      (JSC::Yarr::CharacterClassConstructor::isUnicodeLower):
      (JSC::Yarr::CharacterClassConstructor::putRange):
      (JSC::Yarr::CharacterClassConstructor::charClass):
      (JSC::Yarr::CharacterClassConstructor::addSorted):
      (JSC::Yarr::CharacterClassConstructor::addSortedRange):
      (JSC::Yarr::BeginCharHelper::BeginCharHelper):
      (JSC::Yarr::BeginCharHelper::addBeginChar):
      (JSC::Yarr::BeginCharHelper::merge):
      (JSC::Yarr::BeginCharHelper::addCharacter):
      (JSC::Yarr::BeginCharHelper::linkHotTerms):
      (JSC::Yarr::YarrPatternConstructor::YarrPatternConstructor):
      (JSC::Yarr::YarrPatternConstructor::~YarrPatternConstructor):
      (JSC::Yarr::YarrPatternConstructor::reset):
      (JSC::Yarr::YarrPatternConstructor::assertionBOL):
      (JSC::Yarr::YarrPatternConstructor::assertionEOL):
      (JSC::Yarr::YarrPatternConstructor::assertionWordBoundary):
      (JSC::Yarr::YarrPatternConstructor::atomPatternCharacter):
      (JSC::Yarr::YarrPatternConstructor::atomBuiltInCharacterClass):
      (JSC::Yarr::YarrPatternConstructor::atomCharacterClassBegin):
      (JSC::Yarr::YarrPatternConstructor::atomCharacterClassAtom):
      (JSC::Yarr::YarrPatternConstructor::atomCharacterClassRange):
      (JSC::Yarr::YarrPatternConstructor::atomCharacterClassBuiltIn):
      (JSC::Yarr::YarrPatternConstructor::atomCharacterClassEnd):
      (JSC::Yarr::YarrPatternConstructor::atomParenthesesSubpatternBegin):
      (JSC::Yarr::YarrPatternConstructor::atomParentheticalAssertionBegin):
      (JSC::Yarr::YarrPatternConstructor::atomParenthesesEnd):
      (JSC::Yarr::YarrPatternConstructor::atomBackReference):
      (JSC::Yarr::YarrPatternConstructor::copyDisjunction):
      (JSC::Yarr::YarrPatternConstructor::copyTerm):
      (JSC::Yarr::YarrPatternConstructor::quantifyAtom):
      (JSC::Yarr::YarrPatternConstructor::disjunction):
      (JSC::Yarr::YarrPatternConstructor::regexBegin):
      (JSC::Yarr::YarrPatternConstructor::regexEnd):
      (JSC::Yarr::YarrPatternConstructor::regexError):
      (JSC::Yarr::YarrPatternConstructor::setupAlternativeOffsets):
      (JSC::Yarr::YarrPatternConstructor::setupDisjunctionOffsets):
      (JSC::Yarr::YarrPatternConstructor::setupOffsets):
      (JSC::Yarr::YarrPatternConstructor::checkForTerminalParentheses):
      (JSC::Yarr::YarrPatternConstructor::optimizeBOL):
      (JSC::Yarr::YarrPatternConstructor::addBeginTerm):
      (JSC::Yarr::YarrPatternConstructor::setupDisjunctionBeginTerms):
      (JSC::Yarr::YarrPatternConstructor::setupAlternativeBeginTerms):
      (JSC::Yarr::YarrPatternConstructor::setupBeginChars):
      (JSC::Yarr::compile):
      (JSC::Yarr::YarrPattern::YarrPattern):
      * yarr/YarrPattern.h: Renamed from Source/JavaScriptCore/yarr/RegexPattern.h.
      (JSC::Yarr::CharacterRange::CharacterRange):
      (JSC::Yarr::CharacterClassTable::create):
      (JSC::Yarr::CharacterClassTable::CharacterClassTable):
      (JSC::Yarr::CharacterClass::CharacterClass):
      (JSC::Yarr::PatternTerm::PatternTerm):
      (JSC::Yarr::PatternTerm::ForwardReference):
      (JSC::Yarr::PatternTerm::BOL):
      (JSC::Yarr::PatternTerm::EOL):
      (JSC::Yarr::PatternTerm::WordBoundary):
      (JSC::Yarr::PatternTerm::invert):
      (JSC::Yarr::PatternTerm::capture):
      (JSC::Yarr::PatternTerm::quantify):
      (JSC::Yarr::PatternAlternative::PatternAlternative):
      (JSC::Yarr::PatternAlternative::lastTerm):
      (JSC::Yarr::PatternAlternative::removeLastTerm):
      (JSC::Yarr::PatternAlternative::setOnceThrough):
      (JSC::Yarr::PatternAlternative::onceThrough):
      (JSC::Yarr::PatternDisjunction::PatternDisjunction):
      (JSC::Yarr::PatternDisjunction::~PatternDisjunction):
      (JSC::Yarr::PatternDisjunction::addNewAlternative):
      (JSC::Yarr::TermChain::TermChain):
      (JSC::Yarr::BeginChar::BeginChar):
      (JSC::Yarr::YarrPattern::~YarrPattern):
      (JSC::Yarr::YarrPattern::reset):
      (JSC::Yarr::YarrPattern::containsIllegalBackReference):
      (JSC::Yarr::YarrPattern::newlineCharacterClass):
      (JSC::Yarr::YarrPattern::digitsCharacterClass):
      (JSC::Yarr::YarrPattern::spacesCharacterClass):
      (JSC::Yarr::YarrPattern::wordcharCharacterClass):
      (JSC::Yarr::YarrPattern::nondigitsCharacterClass):
      (JSC::Yarr::YarrPattern::nonspacesCharacterClass):
      (JSC::Yarr::YarrPattern::nonwordcharCharacterClass):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75421 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7dd3056d
    • barraclough@apple.com's avatar
      Bug 52079 - Syntax errors should be early errors. · 7e6bd6d6
      barraclough@apple.com authored
      Reviewed by Oliver Hunt.
      
      Source/JavaScriptCore: 
      
      From chapter 16 the spec:
          An implementation must report most errors at the time the relevant ECMAScript language construct is
          evaluated. An early error is an error that can be detected and reported prior to the evaluation of
          any construct in the Program containing the error. An implementation must report early errors in a
          Program prior to the first evaluation of that Program. Early errors in eval code are reported at
          the time eval is called but prior to evaluation of any construct within the eval code. All errors
          that are not early errors are runtime errors.
      
          An implementation must treat any instance of the following kinds of errors as an early error:
              * Any syntax error."
      
      * JavaScriptCore.xcodeproj/project.pbxproj:
          Added new files.
      * bytecode/CodeBlock.cpp:
          Removed op_throw_syntax_error.
      * bytecode/Opcode.h:
          Removed op_throw_syntax_error.
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::generate):
          If m_expressionTooDeep then throw a runtime error.
      (JSC::BytecodeGenerator::BytecodeGenerator):
          Initialize m_expressionTooDeep.
      (JSC::BytecodeGenerator::emitThrowExpressionTooDeepException):
          Sets m_expressionTooDeep.
      * bytecompiler/BytecodeGenerator.h:
          Added m_expressionTooDeep, removed emitThrowSyntaxError.
      * bytecompiler/NodesCodegen.cpp:
      (JSC::RegExpNode::emitBytecode):
      (JSC::ContinueNode::emitBytecode):
      (JSC::BreakNode::emitBytecode):
      (JSC::ReturnNode::emitBytecode):
      (JSC::LabelNode::emitBytecode):
          Conditions that threw syntax error are now handled during parsing;
          during bytecompilation these are now just ASSERTs.
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::privateExecute):
      * jit/JIT.cpp:
      (JSC::JIT::privateCompileMainPass):
      * jit/JIT.h:
      * jit/JITOpcodes.cpp:
      * jit/JITOpcodes32_64.cpp:
      * jit/JITStubs.cpp:
      * jit/JITStubs.h:
          Removed op_throw_syntax_error.
      * parser/ASTBuilder.h:
      (JSC::ASTBuilder::createRegExp):
          Renamed; added syntax check.
      * parser/JSParser.cpp:
      (JSC::JSParser::breakIsValid):
      (JSC::JSParser::hasLabel):
      (JSC::JSParser::Scope::Scope):
      (JSC::JSParser::Scope::setIsFunction):
      (JSC::JSParser::Scope::isFunctionBoundary):
      (JSC::JSParser::ScopeRef::hasContainingScope):
      (JSC::JSParser::ScopeRef::containingScope):
      (JSC::JSParser::AutoPopScopeRef::AutoPopScopeRef):
      (JSC::JSParser::AutoPopScopeRef::~AutoPopScopeRef):
      (JSC::JSParser::AutoPopScopeRef::setPopped):
      (JSC::JSParser::popScopeInternal):
      (JSC::JSParser::popScope):
      (JSC::jsParse):
      (JSC::JSParser::JSParser):
      (JSC::JSParser::parseProgram):
      (JSC::JSParser::parseBreakStatement):
      (JSC::JSParser::parseContinueStatement):
      (JSC::JSParser::parseReturnStatement):
      (JSC::JSParser::parseTryStatement):
      (JSC::JSParser::parseFunctionInfo):
      (JSC::JSParser::parseExpressionOrLabelStatement):
      (JSC::JSParser::parsePrimaryExpression):
      * parser/JSParser.h:
      * parser/Nodes.h:
      * parser/Parser.cpp:
      (JSC::Parser::parse):
      * parser/SyntaxChecker.h:
      (JSC::SyntaxChecker::createRegExp):
          Renamed; added syntax check.
      * runtime/ExceptionHelpers.cpp:
      (JSC::createOutOfMemoryError):
      (JSC::throwOutOfMemoryError):
      * runtime/ExceptionHelpers.h:
          Broke out createOutOfMemoryError.
      * runtime/Executable.cpp:
      (JSC::EvalExecutable::compileInternal):
      (JSC::ProgramExecutable::compileInternal):
      (JSC::FunctionExecutable::compileForCallInternal):
      (JSC::FunctionExecutable::compileForConstructInternal):
          Add check for exception after bytecode generation.
      * runtime/RegExpConstructor.cpp:
      (JSC::constructRegExp):
      * runtime/RegExpPrototype.cpp:
      (JSC::regExpProtoFuncCompile):
          RegExp error prefixes not included in error string.
      * yarr/RegexParser.h:
      (JSC::Yarr::Parser::parse):
          Removed regexBegin/regexEnd/regexError.
      * yarr/RegexPattern.cpp:
      (JSC::Yarr::RegexPatternConstructor::regexBegin):
          Removed regexEnd/regexError.
      (JSC::Yarr::compileRegex):
          Add call to regexBegin (no longer called from the parser).
      * yarr/YarrSyntaxChecker.cpp: Added.
      (JSC::Yarr::SyntaxChecker::assertionBOL):
      (JSC::Yarr::SyntaxChecker::assertionEOL):
      (JSC::Yarr::SyntaxChecker::assertionWordBoundary):
      (JSC::Yarr::SyntaxChecker::atomPatternCharacter):
      (JSC::Yarr::SyntaxChecker::atomBuiltInCharacterClass):
      (JSC::Yarr::SyntaxChecker::atomCharacterClassBegin):
      (JSC::Yarr::SyntaxChecker::atomCharacterClassAtom):
      (JSC::Yarr::SyntaxChecker::atomCharacterClassRange):
      (JSC::Yarr::SyntaxChecker::atomCharacterClassBuiltIn):
      (JSC::Yarr::SyntaxChecker::atomCharacterClassEnd):
      (JSC::Yarr::SyntaxChecker::atomParenthesesSubpatternBegin):
      (JSC::Yarr::SyntaxChecker::atomParentheticalAssertionBegin):
      (JSC::Yarr::SyntaxChecker::atomParenthesesEnd):
      (JSC::Yarr::SyntaxChecker::atomBackReference):
      (JSC::Yarr::SyntaxChecker::quantifyAtom):
      (JSC::Yarr::SyntaxChecker::disjunction):
      (JSC::Yarr::checkSyntax):
      * yarr/YarrSyntaxChecker.h: Added.
          Check RegExp syntax.
      
      LayoutTests: 
      
      Fix syntax errors in layout tests, and update expected results.
      
      * editing/selection/select-crash-001.html:
      * editing/selection/select-crash-002.html:
      * fast/canvas/webgl/renderbuffer-initialization.html:
      * fast/forms/25153.html:
      * fast/forms/textfield-drag-into-disabled.html:
      * fast/js/exception-codegen-crash-expected.txt:
      * fast/js/exception-codegen-crash.html:
      * fast/js/kde/parse-expected.txt:
      * fast/js/kde/script-tests/parse.js:
      * fast/js/large-expressions-expected.txt:
      * fast/js/named-function-expression-expected.txt:
      * fast/js/parser-syntax-check-expected.txt:
      * fast/js/script-tests/large-expressions.js:
      * fast/js/script-tests/named-function-expression.js:
      * fast/js/script-tests/parser-syntax-check.js:
      * fast/js/sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A11.1_T3-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A11_T3-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A12.1_T3-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A12_T3-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A1_T1-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A1_T2-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A1_T3-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A1_T4-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A5_T1-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A5_T2-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A5_T3-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A6-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A8_T1-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A8_T2-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A1_T1-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A1_T2-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A1_T3-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A1_T4-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A5_T1-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A5_T2-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A5_T3-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A6-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A8_T1-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A8_T2-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T1-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T10-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T2-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T3-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T4-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T5-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T6-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T7-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T8-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T9-expected.txt:
      * http/tests/security/isolatedWorld/events.html:
      * http/tests/security/isolatedWorld/userGestureEvents.html:
      * svg/custom/resources/use-instanceRoot-event-listeners.js:
      * svg/custom/rgbcolor-syntax.svg:
      * svg/custom/use-instanceRoot-modifications.svg:
      * svg/custom/use-property-changes-through-svg-dom.svg:
      * webarchive/adopt-attribute-styled-body-webarchive-expected.webarchive:
      * webarchive/resources/adopt-attribute-styled-body-iframe.html:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75408 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7e6bd6d6
  14. 08 Jan, 2011 1 commit
    • ggaren@apple.com's avatar
      2011-01-07 Geoffrey Garen <ggaren@apple.com> · bde96098
      ggaren@apple.com authored
              Reviewed by Gavin Barraclough.
      
              Split machine stack marking functions into their own class (MachineStackMarker)
              https://bugs.webkit.org/show_bug.cgi?id=52088
      
              * API/APIShims.h:
              (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock): Moved registerThread()
              call behind an #ifdef because we shouldn't be registering threads at all
              if we don't support usage on multiple threads.
      
              * Android.mk:
              * CMakeLists.txt:
              * GNUmakefile.am:
              * JavaScriptCore.gypi:
              * JavaScriptCore.pro:
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
              * JavaScriptCore.xcodeproj/project.pbxproj: Updated projects.
      
              * runtime/Collector.cpp:
              (JSC::Heap::Heap):
              (JSC::Heap::destroy):
              (JSC::Heap::markRoots):
              * runtime/Collector.h:
              (JSC::Heap::machineStackMarker): Moved code to machineStackMarker.
      
              * runtime/JSGlobalData.h:
              (JSC::JSGlobalData::makeUsableFromMultipleThreads): Removed an unnecessary
              level of indirection, to make Heap less of a God class.
      
              * runtime/MachineStackMarker.h: Copied from Source/JavaScriptCore/runtime/Collector.h.
              * runtime/MachineStackMarker.cpp: Copied from Source/JavaScriptCore/runtime/Collector.cpp.
              (JSC::MachineStackMarker::MachineStackMarker):
              (JSC::MachineStackMarker::~MachineStackMarker):
              (JSC::MachineStackMarker::makeUsableFromMultipleThreads):
              (JSC::MachineStackMarker::registerThread):
              (JSC::MachineStackMarker::unregisterThread):
              (JSC::MachineStackMarker::markCurrentThreadConservativelyInternal):
              (JSC::MachineStackMarker::markCurrentThreadConservatively):
              (JSC::MachineStackMarker::markOtherThreadConservatively):
              (JSC::MachineStackMarker::markMachineStackConservatively): Moved code from Heap.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75342 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bde96098
  15. 07 Jan, 2011 1 commit
    • barraclough@apple.com's avatar
      Source/JavaScriptCore: [GTK] Port scrollbar painting to GtkStyleContext · d6544ee5
      barraclough@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=52051
      
      Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2011-01-07
      Reviewed by Martin Robinson.
      
      * wtf/gobject/GTypedefs.h: Add GtkStyleContext forward
      declaration.
      
      WebCore: Bug 52035 - Unregistering DOMWrapperWorlds is unsafe
      
      Reviewed by Geoff Garen.
      
      The method DOMWrapperWorld::unregisterWorld() effectively calls the DOMWrapperWorld's
      destructor early, in order to release wrappers once we know we no longer intend to use them.
      Whilst it is okay to have a method to throw away wrappers (assuming we know we're willing to
      lose any state stored on them) it is not okay to deregister the world from the JSGlobalData.
      A sequence of events that triggers the bug would look like this:
      
      (1) Create a DOMWrapperWorld.
      (2) Register a timer in the world.
      (3) Call unregisterWorld() on the world.
      (4) Timer goes off, code is executed in the world, creates a Node not attached to a Document.
      (5) We attempt to lookup a wrapper map for the world on the JSGlobalData, but because we've
          called forgetWorld() none exists.
      (6) Attempt to add a wrapper to a NULL map.
      
      Fix the problem by not removing the JSGlobalData's wrapper map until the world really goes away.
      
      * WebCore.exp.in:
      * bindings/js/DOMWrapperWorld.cpp:
      (WebCore::DOMWrapperWorld::DOMWrapperWorld):
      (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
      (WebCore::DOMWrapperWorld::clearWrappers):
      * bindings/js/DOMWrapperWorld.h:
      
      WebKit/mac: Bug 52035 - Unregistering DOMWrapperWorlds is unsafe
      
      Reviewed by Geoff Garen.
      
      The method DOMWrapperWorld::unregisterWorld() effectively calls the DOMWrapperWorld's
      destructor early, in order to release wrappers once we know we no longer intend to use them.
      Whilst it is okay to have a method to throw away wrappers (assuming we know we're willing to
      lose any state stored on them) it is not okay to deregister the world from the JSGlobalData.
      A sequence of events that triggers the bug would look like this:
      
      (1) Create a DOMWrapperWorld.
      (2) Register a timer in the world.
      (3) Call unregisterWorld() on the world.
      (4) Timer goes off, code is executed in the world, creates a Node not attached to a Document.
      (5) We attempt to lookup a wrapper map for the world on the JSGlobalData, but because we've
          called forgetWorld() none exists.
      (6) Attempt to add a wrapper to a NULL map.
      
      Fix the problem by not removing the JSGlobalData's wrapper map until the world really goes away.
      
      * WebView/WebScriptWorld.mm:
      (-[WebScriptWorld unregisterWorld]):
      
      WebKit/win: Bug 52035 - Unregistering DOMWrapperWorlds is unsafe
      
      Reviewed by Geoff Garen.
      
      The method DOMWrapperWorld::unregisterWorld() effectively calls the DOMWrapperWorld's
      destructor early, in order to release wrappers once we know we no longer intend to use them.
      Whilst it is okay to have a method to throw away wrappers (assuming we know we're willing to
      lose any state stored on them) it is not okay to deregister the world from the JSGlobalData.
      A sequence of events that triggers the bug would look like this:
      
      (1) Create a DOMWrapperWorld.
      (2) Register a timer in the world.
      (3) Call unregisterWorld() on the world.
      (4) Timer goes off, code is executed in the world, creates a Node not attached to a Document.
      (5) We attempt to lookup a wrapper map for the world on the JSGlobalData, but because we've
          called forgetWorld() none exists.
      (6) Attempt to add a wrapper to a NULL map.
      
      Fix the problem by not removing the JSGlobalData's wrapper map until the world really goes away.
      
      * WebScriptWorld.cpp:
      (WebScriptWorld::unregisterWorld):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75265 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d6544ee5
  16. 06 Jan, 2011 1 commit
    • msaboff@apple.com's avatar
      2011-01-06 Michael Saboff <msaboff@apple.com> · fcb0c9f6
      msaboff@apple.com authored
              Reviewed by Gavin Barraclough.
      
              Enhancement: Add Regexp Debug Compare between JIT and Interpreter
              https://bugs.webkit.org/show_bug.cgi?id=51834
      
              * JavaScriptCore: Copied from JavaScriptCore.
      2011-01-06  Michael Saboff  <msaboff@apple.com>
      
              Reviewed by Gavin Barraclough.
      
              Added debug code to compare the results of JIT regexp with 
              interpreted regexp and displays discrepencies.  This debug code is
              controlled by the ENABLE_YARR_JIT_DEBUG macro in wtf/Platform.h and
              is only valid if ENABLE_YARR_JIT is enabled.
      
              Fixed a discovered problem in RegExp::printTraceData, changing
              m_pattern to the getter pattern().
              Also deleted an extraneous semicolon.
      
              Enhancement: Add Regexp Debug Compare between JIT and Interpreter
              https://bugs.webkit.org/show_bug.cgi?id=51834
      
              * runtime/RegExp.cpp:
              (JSC::RegExp::compile):
              (JSC::RegExp::match):
              (JSC::RegExp::printTraceData):
              * wtf/Platform.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fcb0c9f6