1. 28 Nov, 2007 1 commit
    • mjs@apple.com's avatar
      JavaScriptCore: · d342e879
      mjs@apple.com authored
              Reviewed by Darin and Geoff.
      
              - Fixed "Stack overflow crash in JavaScript garbage collector mark pass"
              http://bugs.webkit.org/show_bug.cgi?id=12216
              
              Implement mark stack. This version is not suitable for prime time because it makes a
              huge allocation on every collect, and potentially makes marking of detached subtrees
              slow. But it is an 0.4% SunSpider speedup even without much tweaking.
              
              The basic approach is to replace mark() methods with
              markChildren(MarkStack&) methods. Reachable references are pushed
              onto a mark stack (which encapsulates ignoring already-marked
              references). 
              
              Objects are no longer responsible for actually setting their own
              mark bits, the collector does that. This means that for objects on
              the number heap we don't have to call markChildren() at all since
              we know there aren't any.
              
              The mark phase of collect pushes roots onto the mark stack
              and drains it as often as possible.
              
              To make this approach viable requires a constant-size mark stack
              and a slow fallback approach for when the stack size is exceeded,
              plus optimizations to make the required stack small in common
              cases. This should be doable.
      
              * JavaScriptCore.exp: Export new symbols.
              * JavaScriptCore.xcodeproj/project.pbxproj: Add new file.
              * kjs/collector.cpp:
              (KJS::Collector::heapAllocate):
              (KJS::drainMarkStack): Helper for all of the below.
              (KJS::Collector::markStackObjectsConservatively): Use mark stack.
              (KJS::Collector::markCurrentThreadConservatively): ditto
              (KJS::Collector::markOtherThreadConservatively): ditto
              (KJS::Collector::markProtectedObjects): ditto
              (KJS::Collector::markMainThreadOnlyObjects): ditto
              (KJS::Collector::collect): ditto
              * kjs/collector.h:
              (KJS::Collector::cellMayHaveRefs): Helper for MarkStack.
      
              * kjs/MarkStack.h: Added. The actual mark stack implementation.
              (KJS::MarkStack::push):
              (KJS::MarkStack::pushAtom):
              (KJS::MarkStack::pop):
              (KJS::MarkStack::isEmpty):
              (KJS::MarkStack::reserveCapacity):
      
              Changed mark() methods to markChildren() methods:
              
              * kjs/ExecState.cpp:
              (KJS::ExecState::markChildren):
              * kjs/ExecState.h:
              * kjs/JSWrapperObject.cpp:
              (KJS::JSWrapperObject::markChildren):
              * kjs/JSWrapperObject.h:
              * kjs/array_instance.cpp:
              (KJS::ArrayInstance::markChildren):
              * kjs/array_instance.h:
              * kjs/bool_object.cpp:
              (BooleanInstance::markChildren):
              * kjs/bool_object.h:
              * kjs/error_object.cpp:
              * kjs/error_object.h:
              * kjs/function.cpp:
              (KJS::FunctionImp::markChildren):
              (KJS::Arguments::Arguments):
              (KJS::Arguments::markChildren):
              (KJS::ActivationImp::markChildren):
              * kjs/function.h:
              * kjs/internal.cpp:
              (KJS::GetterSetterImp::markChildren):
              * kjs/interpreter.cpp:
              (KJS::Interpreter::markRoots):
              * kjs/interpreter.h:
              * kjs/list.cpp:
              (KJS::List::markProtectedListsSlowCase):
              * kjs/list.h:
              (KJS::List::markProtectedLists):
              * kjs/object.cpp:
              (KJS::JSObject::markChildren):
              * kjs/object.h:
              (KJS::ScopeChain::markChildren):
              * kjs/property_map.cpp:
              (KJS::PropertyMap::markChildren):
              * kjs/property_map.h:
              * kjs/scope_chain.h:
              * kjs/string_object.cpp:
              (KJS::StringInstance::markChildren):
              * kjs/string_object.h:
      
      JavaScriptGlue:
      
              Reviewed by Darin and Geoff.
      
              Fixups for JavaScriptCore mark stack.
      
              * JSObject.cpp:
              (JSUserObject::Mark):
              * JSObject.h:
              * JSValueWrapper.cpp:
              (JSValueWrapper::JSObjectMark):
              * JSValueWrapper.h:
              * UserObjectImp.cpp:
              * UserObjectImp.h:
      
      WebCore:
      
              Reviewed by Darin and Geoff.
      
              Implement mark stack. This version is not suitable for prime time because it makes a
              huge allocation on every collect, and potentially makes marking of detached subtrees
              slow. But it is a .2% - .4% speedup even without much tweaking.
      
              I replaced mark() methods with markChildren() as usual. One
              optimization that is lost is avoiding walking detached DOM
              subtrees more than once to mark them; since marking is not
              recursive there's no obvious way to bracket operation on the tree
              any more.
      
              * bindings/js/JSDocumentCustom.cpp:
              (WebCore::JSDocument::markChildren):
              * bindings/js/JSNodeCustom.cpp:
              (WebCore::JSNode::markChildren):
              * bindings/js/JSNodeFilterCondition.cpp:
              * bindings/js/JSNodeFilterCondition.h:
              * bindings/js/JSNodeFilterCustom.cpp:
              (WebCore::JSNodeFilter::markChildren):
              * bindings/js/JSNodeIteratorCustom.cpp:
              (WebCore::JSNodeIterator::markChildren):
              * bindings/js/JSTreeWalkerCustom.cpp:
              (WebCore::JSTreeWalker::markChildren):
              * bindings/js/JSXMLHttpRequest.cpp:
              (KJS::JSXMLHttpRequest::markChildren):
              * bindings/js/JSXMLHttpRequest.h:
              * bindings/js/kjs_binding.cpp:
              (KJS::ScriptInterpreter::markDOMNodesForDocument):
              * bindings/js/kjs_binding.h:
              * bindings/js/kjs_events.cpp:
              (WebCore::JSUnprotectedEventListener::markChildren):
              * bindings/js/kjs_events.h:
              * bindings/js/kjs_window.cpp:
              (KJS::Window::markChildren):
              * bindings/js/kjs_window.h:
              * bindings/scripts/CodeGeneratorJS.pm:
              * dom/Node.cpp:
              (WebCore::Node::Node):
              * dom/Node.h:
              * dom/NodeFilter.h:
              * dom/NodeFilterCondition.h:
      
      LayoutTests:
      
              Not reviewed.
              
              - Test cases for "Stack overflow crash in JavaScript garbage collector mark pass"
              http://bugs.webkit.org/show_bug.cgi?id=12216
      
              I have fixed this with the mark stack work.
              
              * fast/js/gc-breadth-2-expected.txt: Added.
              * fast/js/gc-breadth-2.html: Added.
              * fast/js/gc-breadth-expected.txt: Added.
              * fast/js/gc-breadth.html: Added.
              * fast/js/gc-depth-expected.txt: Added.
              * fast/js/gc-depth.html: Added.
              * fast/js/resources/gc-breadth-2.js: Added.
              * fast/js/resources/gc-breadth.js: Added.
              * fast/js/resources/gc-depth.js: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28106 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d342e879
  2. 18 Nov, 2007 1 commit
  3. 01 Nov, 2007 1 commit
  4. 31 Oct, 2007 1 commit
    • mjs's avatar
      Reviewed by Oliver. · bc013785
      mjs authored
              
              - shave some cycles off of local storage access for a 1% SunSpider speedup
              
              Keep the LocalStorage pointer in the ExecState, not 
      
              * kjs/ExecState.cpp:
              (KJS::ExecState::updateLocalStorage):
              * kjs/ExecState.h:
              (KJS::ExecState::localStorage):
              * kjs/nodes.cpp:
              (KJS::LocalVarAccessNode::evaluate):
              (KJS::LocalVarFunctionCallNode::evaluate):
              (KJS::PostIncLocalVarNode::evaluate):
              (KJS::PostDecLocalVarNode::evaluate):
              (KJS::LocalVarTypeOfNode::evaluate):
              (KJS::PreIncLocalVarNode::evaluate):
              (KJS::PreDecLocalVarNode::evaluate):
              (KJS::ReadModifyLocalVarNode::evaluate):
              (KJS::AssignLocalVarNode::evaluate):
              (KJS::FunctionBodyNode::processDeclarationsForFunctionCode):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27339 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bc013785
  5. 26 Oct, 2007 3 commits
    • mrowe@apple.com's avatar
      2007-10-26 Mark Rowe <mrowe@apple.com> · 0dd4e6ca
      mrowe@apple.com authored
              Gtk build fix.
      
              * kjs/ExecState.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27101 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0dd4e6ca
    • mjs's avatar
      Windows build fix. · fd142eff
      mjs authored
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27100 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fd142eff
    • mjs's avatar
      JavaScriptCore: · e58111ce
      mjs authored
              Reviewed by Oliver.
              
              - moved Context class into ExecState.{h,cpp} in preparation for merging 
              ExecState and Context classes.
      
              * kjs/ExecState.h: Moved CodeType enum and Context class here in
              preparation for merging ExecState and Context.
              * kjs/ExecState.cpp: Moved Context class here from Context.cpp.
              (KJS::Context::Context):
              (KJS::Context::~Context):
              (KJS::Context::mark):
              * kjs/context.h: Removed.
              * kjs/Context.cpp: Removed.
              * kjs/function.h: Removed CodeType enum.
              * kjs/LabelStack.h: Added. Pulled LabelStack class out of internal.h.
              * kjs/internal.h: Removed LabelStack.
              * JavaScriptCore.xcodeproj/project.pbxproj: Added new file, removed ones that are gone.
              * kjs/collector.cpp: Fixed includes.
              * kjs/function.cpp: ditto
              * kjs/internal.cpp: ditto
              * kjs/interpreter.cpp: ditto
              * kjs/lookup.h: ditto
              * kjs/nodes.cpp: ditto
      
      WebCore:
      
              Reviewed by Oliver.
      
              - update for JavaScriptCore header changes
      
              * bindings/objc/WebScriptObject.mm:
              * bridge/mac/WebCoreScriptDebugger.mm:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27097 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e58111ce
  6. 06 Apr, 2007 1 commit
  7. 18 Mar, 2007 1 commit
    • mjs's avatar
      JavaScriptCore: · 23fc88db
      mjs authored
              Reviewed by Mark.
              
              - avoid static construction (and global variable access) in a smarter, more portable way,
              to later enable MUTLI_THREAD mode to work on other platforms and compilers.
              
              * kjs/CommonIdentifiers.cpp: Added. New class to hold all the shared identifiers.
              (KJS::CommonIdentifiers::CommonIdentifiers):
              (KJS::CommonIdentifiers::shared):
              * kjs/CommonIdentifiers.h: Added.
      
              * kjs/ExecState.h:
              (KJS::ExecState::propertyNames): Hand the CommonIdentifiers instance here for easy access.
              (KJS::ExecState::ExecState):
      
              * API/JSObjectRef.cpp:
              (JSObjectMakeConstructor):
              * CMakeLists.txt:
              * JavaScriptCore.exp:
              * JavaScriptCore.pri:
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
              * JavaScriptCore.xcodeproj/project.pbxproj:
              * JavaScriptCoreSources.bkl:
              * bindings/runtime_array.cpp:
              (RuntimeArray::getOwnPropertySlot):
              (RuntimeArray::put):
              * bindings/runtime_method.cpp:
              (RuntimeMethod::getOwnPropertySlot):
              * kjs/array_object.cpp:
              (ArrayInstance::getOwnPropertySlot):
              (ArrayInstance::put):
              (ArrayInstance::deleteProperty):
              (ArrayProtoFunc::ArrayProtoFunc):
              (ArrayProtoFunc::callAsFunction):
              (ArrayObjectImp::ArrayObjectImp):
              * kjs/bool_object.cpp:
              (BooleanPrototype::BooleanPrototype):
              (BooleanProtoFunc::BooleanProtoFunc):
              (BooleanProtoFunc::callAsFunction):
              (BooleanObjectImp::BooleanObjectImp):
              * kjs/completion.h:
              (KJS::Completion::Completion):
              * kjs/date_object.cpp:
              (KJS::DateProtoFunc::DateProtoFunc):
              (KJS::DateObjectImp::DateObjectImp):
              (KJS::DateObjectFuncImp::DateObjectFuncImp):
              * kjs/error_object.cpp:
              (ErrorPrototype::ErrorPrototype):
              (ErrorProtoFunc::ErrorProtoFunc):
              (ErrorProtoFunc::callAsFunction):
              (ErrorObjectImp::ErrorObjectImp):
              (ErrorObjectImp::construct):
              (NativeErrorPrototype::NativeErrorPrototype):
              (NativeErrorImp::NativeErrorImp):
              (NativeErrorImp::construct):
              (NativeErrorImp::callAsFunction):
              * kjs/function.cpp:
              (KJS::FunctionImp::getOwnPropertySlot):
              (KJS::FunctionImp::put):
              (KJS::FunctionImp::deleteProperty):
              (KJS::FunctionImp::getParameterName):
              (KJS::DeclaredFunctionImp::construct):
              (KJS::IndexToNameMap::unMap):
              (KJS::Arguments::Arguments):
              (KJS::ActivationImp::getOwnPropertySlot):
              (KJS::ActivationImp::deleteProperty):
              (KJS::GlobalFuncImp::GlobalFuncImp):
              * kjs/function_object.cpp:
              (FunctionPrototype::FunctionPrototype):
              (FunctionProtoFunc::FunctionProtoFunc):
              (FunctionProtoFunc::callAsFunction):
              (FunctionObjectImp::FunctionObjectImp):
              (FunctionObjectImp::construct):
              * kjs/grammar.y:
              * kjs/identifier.cpp:
              * kjs/identifier.h:
              * kjs/interpreter.cpp:
              (KJS::Interpreter::init):
              (KJS::Interpreter::initGlobalObject):
              * kjs/interpreter.h:
              * kjs/lookup.h:
              * kjs/math_object.cpp:
              (MathFuncImp::MathFuncImp):
              * kjs/nodes.cpp:
              (ArrayNode::evaluate):
              (FuncDeclNode::processFuncDecl):
              (FuncExprNode::evaluate):
              * kjs/number_object.cpp:
              (NumberPrototype::NumberPrototype):
              (NumberProtoFunc::NumberProtoFunc):
              (NumberObjectImp::NumberObjectImp):
              * kjs/object.cpp:
              (KJS::JSObject::put):
              (KJS::JSObject::defaultValue):
              (KJS::JSObject::hasInstance):
              * kjs/object.h:
              (KJS::JSObject::getOwnPropertySlot):
              * kjs/object_object.cpp:
              (ObjectPrototype::ObjectPrototype):
              (ObjectProtoFunc::ObjectProtoFunc):
              (ObjectObjectImp::ObjectObjectImp):
              * kjs/regexp_object.cpp:
              (RegExpPrototype::RegExpPrototype):
              (RegExpProtoFunc::RegExpProtoFunc):
              (RegExpObjectImp::RegExpObjectImp):
              * kjs/string_object.cpp:
              (KJS::StringInstance::getOwnPropertySlot):
              (KJS::StringInstance::put):
              (KJS::StringInstance::deleteProperty):
              (KJS::StringPrototype::StringPrototype):
              (KJS::StringProtoFunc::StringProtoFunc):
              (KJS::StringProtoFunc::callAsFunction):
              (KJS::StringObjectImp::StringObjectImp):
              (KJS::StringObjectFuncImp::StringObjectFuncImp):
              * kjs/testkjs.cpp:
              (TestFunctionImp::TestFunctionImp):
      
      WebCore:
      
              Reviewed by Mark.
      
              - avoid static construction (and global variable access) in a smarter, more portable way,
              to later enable MUTLI_THREAD mode to work on other platforms and compilers.
              
              * bindings/js/JSCustomXPathNSResolver.cpp:
              (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
              * bindings/js/JSHTMLInputElementBase.cpp:
              (WebCore::JSHTMLInputElementBaseFunction::JSHTMLInputElementBaseFunction):
              * bindings/js/JSHTMLOptionElementConstructor.cpp:
              (WebCore::JSHTMLOptionElementConstructor::JSHTMLOptionElementConstructor):
              * bindings/js/JSXMLHttpRequest.cpp:
              (KJS::JSXMLHttpRequestConstructorImp::JSXMLHttpRequestConstructorImp):
              * bindings/js/JSXSLTProcessor.cpp:
              (KJS::XSLTProcessorConstructorImp::XSLTProcessorConstructorImp):
              * bindings/js/kjs_dom.cpp:
              (KJS::DOMNamedNodeMap::getOwnPropertySlot):
              (KJS::DOMNamedNodesCollection::getOwnPropertySlot):
              * bindings/js/kjs_events.cpp:
              (KJS::JSAbstractEventListener::handleEvent):
              * bindings/js/kjs_html.cpp:
              (KJS::HTMLElementFunction::HTMLElementFunction):
              (KJS::JSHTMLCollection::getOwnPropertySlot):
              * bindings/js/kjs_window.cpp:
              (KJS::ScheduledAction::execute):
              * bindings/objc/WebScriptObject.mm:
              * bindings/scripts/CodeGeneratorJS.pm:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20310 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      23fc88db
  8. 27 Oct, 2006 1 commit
    • darin's avatar
      Reviewed by Geoff. · b847b44b
      darin authored
              - made changes so the code compiles with the highest warning level
                under MSVC (disabling some warnings, making some code fixes)
      
              * API/JSCallbackConstructor.cpp:
              (KJS::JSCallbackConstructor::construct):
              * API/JSCallbackFunction.cpp:
              (KJS::JSCallbackFunction::callAsFunction):
              * API/JSCallbackObject.cpp:
              (KJS::JSCallbackObject::init):
              (KJS::JSCallbackObject::construct):
              (KJS::JSCallbackObject::callAsFunction):
              * API/JSObjectRef.cpp:
              (JSPropertyNameArrayGetNameAtIndex):
              * API/JSStringRef.cpp:
              (JSStringCreateWithCharacters):
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
              * bindings/c/c_utility.cpp:
              (KJS::Bindings::convertUTF8ToUTF16):
              (KJS::Bindings::coerceValueToNPVariantStringType):
              (KJS::Bindings::convertValueToNPVariant):
              * kjs/DateMath.h:
              (KJS::GregorianDateTime::GregorianDateTime):
              * kjs/ExecState.h:
              (KJS::ExecState::hadException):
              * kjs/JSImmediate.h:
              (KJS::JSImmediate::fromDouble):
              (KJS::JSImmediate::toDouble):
              (KJS::JSImmediate::NanAsBits):
              (KJS::JSImmediate::oneAsBits):
              * kjs/Parser.h:
              * kjs/PropertyNameArray.h:
              (KJS::PropertyNameArray::size):
              * kjs/array_object.cpp:
              (ArrayObjectImp::callAsFunction):
              * kjs/bool_object.cpp:
              (BooleanObjectImp::callAsFunction):
              * kjs/collector.cpp:
              (KJS::Collector::allocate):
              (KJS::Collector::markCurrentThreadConservatively):
              (KJS::Collector::collect):
              * kjs/completion.h:
              (KJS::Completion::isValueCompletion):
              * kjs/date_object.cpp:
              (KJS::findMonth):
              * kjs/debugger.cpp:
              (Debugger::sourceParsed):
              (Debugger::sourceUnused):
              (Debugger::exception):
              (Debugger::atStatement):
              (Debugger::callEvent):
              (Debugger::returnEvent):
              * kjs/dtoa.cpp:
              * kjs/error_object.cpp:
              (ErrorObjectImp::callAsFunction):
              (NativeErrorImp::callAsFunction):
              * kjs/function.cpp:
              (KJS::FunctionImp::processVarDecls):
              (KJS::GlobalFuncImp::callAsFunction):
              * kjs/function_object.cpp:
              (FunctionPrototype::callAsFunction):
              * kjs/grammar.y:
              * kjs/identifier.cpp:
              (KJS::CStringTranslator::translate):
              (KJS::Identifier::add):
              * kjs/internal.h:
              * kjs/lexer.cpp:
              (Lexer::lex):
              (Lexer::isIdentStart):
              (Lexer::isIdentPart):
              (isDecimalDigit):
              (Lexer::isHexDigit):
              (Lexer::isOctalDigit):
              (Lexer::matchPunctuator):
              (Lexer::singleEscape):
              (Lexer::convertOctal):
              (Lexer::convertHex):
              (Lexer::convertUnicode):
              (Lexer::record8):
              * kjs/lexer.h:
              * kjs/math_object.cpp:
              (MathFuncImp::callAsFunction):
              * kjs/number_object.cpp:
              (integer_part_noexp):
              (intPow10):
              (NumberProtoFunc::callAsFunction):
              (NumberObjectImp::callAsFunction):
              * kjs/object.cpp:
              (KJS::JSObject::deleteProperty):
              (KJS::JSObject::callAsFunction):
              (KJS::JSObject::toBoolean):
              (KJS::JSObject::toObject):
              * kjs/object.h:
              (KJS::JSObject::getPropertySlot):
              * kjs/property_map.cpp:
              (KJS::isValid):
              (KJS::PropertyMap::put):
              (KJS::PropertyMap::insert):
              (KJS::PropertyMap::containsGettersOrSetters):
              * kjs/property_map.h:
              (KJS::PropertyMap::hasGetterSetterProperties):
              * kjs/property_slot.h:
              * kjs/string_object.cpp:
              (StringInstance::getPropertyNames):
              (StringObjectImp::callAsFunction):
              (StringObjectFuncImp::callAsFunction):
              * kjs/ustring.cpp:
              (KJS::UString::Rep::computeHash):
              (KJS::UString::UString):
              (KJS::UString::from):
              (KJS::UString::append):
              (KJS::UString::ascii):
              (KJS::UString::operator=):
              (KJS::UString::find):
              (KJS::UString::rfind):
              * kjs/ustring.h:
              (KJS::UChar::high):
              (KJS::UChar::low):
              (KJS::UCharReference::low):
              (KJS::UCharReference::high):
              * kjs/value.cpp:
              (KJS::JSValue::toUInt16):
              * kjs/value.h:
              * pcre/pcre_compile.c:
              (get_othercase_range):
              * pcre/pcre_exec.c:
              (match):
              * pcre/pcre_internal.h:
              * wtf/HashFunctions.h:
              (WTF::intHash):
              (WTF::PtrHash::hash):
              * wtf/MathExtras.h:
              (isnan):
              (lround):
              (lroundf):
              * wtf/StringExtras.h:
              (strncasecmp):
              * wtf/unicode/icu/UnicodeIcu.h:
              (WTF::Unicode::isPrintableChar):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@17372 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b847b44b
  9. 10 Jul, 2006 1 commit
    • ggaren's avatar
      Reviewed by Darin. · 3f491d49
      ggaren authored
              
              Added exception out parameter to API object callbacks, removed semi-bogus
              JSContext(.*)Exception functions.
              
              To make these calls syntactically simple, I added an exceptionSlot()
              method to the ExecState class, which provides a JSValue** slot in which to 
              store a JSValue* exception.
      
              * API/APICast.h:
              (toRef):
              * API/JSCallbackConstructor.cpp:
              (KJS::JSCallbackConstructor::construct):
              * API/JSCallbackFunction.cpp:
              (KJS::JSCallbackFunction::callAsFunction):
              * API/JSCallbackObject.cpp:
              (KJS::JSCallbackObject::init):
              (KJS::JSCallbackObject::getOwnPropertySlot):
              (KJS::JSCallbackObject::put):
              (KJS::JSCallbackObject::deleteProperty):
              (KJS::JSCallbackObject::construct):
              (KJS::JSCallbackObject::callAsFunction):
              (KJS::JSCallbackObject::getPropertyList):
              (KJS::JSCallbackObject::toBoolean):
              (KJS::JSCallbackObject::toNumber):
              (KJS::JSCallbackObject::toString):
              (KJS::JSCallbackObject::staticValueGetter):
              (KJS::JSCallbackObject::callbackGetter):
              * API/JSContextRef.cpp:
              (JSCheckSyntax):
              * API/JSContextRef.h:
              * API/JSNode.c:
              (JSNodePrototype_appendChild):
              (JSNodePrototype_removeChild):
              (JSNodePrototype_replaceChild):
              (JSNode_getNodeType):
              (JSNode_getChildNodes):
              (JSNode_getFirstChild):
              (JSNode_construct):
              * API/JSNode.h:
              * API/JSNodeList.c:
              (JSNodeListPrototype_item):
              (JSNodeList_length):
              (JSNodeList_getProperty):
              * API/JSObjectRef.h:
              * API/minidom.c:
              (print):
              * API/testapi.c:
              (MyObject_initialize):
              (MyObject_hasProperty):
              (MyObject_getProperty):
              (MyObject_setProperty):
              (MyObject_deleteProperty):
              (MyObject_getPropertyList):
              (MyObject_callAsFunction):
              (MyObject_callAsConstructor):
              (MyObject_convertToType):
              (print_callAsFunction):
              (myConstructor_callAsConstructor):
              (main):
              * JavaScriptCore.exp:
              * kjs/ExecState.h:
              (KJS::ExecState::exceptionHandle):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15317 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3f491d49
  10. 30 Jun, 2006 2 commits
    • darin's avatar
      Reviewed and tweaked by Darin. · dddf8ede
      darin authored
              - Compile fixes for wx port / gcc 4.0.2
      
              * kjs/array_object.cpp:
              Added missing headers. 
      
              * kjs/ExecState.h:
              gcc needs class prototypes before defining those classes as friend classes
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15125 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      dddf8ede
    • darin's avatar
      Reviewed by Darin. · fed93534
      darin authored
              Compilation fixes for Linux/Gdk.
      
              * JavaScriptCore/kjs/interpreter.cpp: added include of signal.h
              * JavaScriptCore/kjs/ExecState.h: added missing class declaration 
              * JavaScriptCore/kjs/ExecState.cpp: case wrong on include of context.h 
              * JavaScriptCore/JavaScriptCoreSources.bkl: added Context.cpp and ExecState.cpp
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fed93534
  11. 13 Jun, 2006 1 commit
    • ggaren's avatar
      JavaScriptCore: · 01b2e77a
      ggaren authored
              Reviewed by TimO, Maciej.
              
              - Merged InterpreterImp code into Interpreter, which implements
              all interpreter functionality now. This is part of my continuing quest
              to create an external notion of JS "execution context" that is unified and simple --
              something to replace the mix of Context, ContextImp, ExecState, Interpreter,
              InterpreterImp, and JSRun.
              
              All tests pass. Leaks test has not regressed from its baseline ~207 leaks
              with ~3460 leaked nodes.
      
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
              * JavaScriptCore.xcodeproj/project.pbxproj:
              * bindings/NP_jsobject.cpp:
              * bindings/objc/WebScriptObject.mm:
              (+[WebScriptObject throwException:]):
              * bindings/runtime_root.cpp:
              * bindings/runtime_root.h:
              * kjs/Context.cpp:
              (KJS::Context::Context):
              * kjs/ExecState.cpp: Added.
              (KJS::ExecState::lexicalInterpreter):
              * kjs/ExecState.h: Added.
              (KJS::ExecState::dynamicInterpreter):
              * kjs/SavedBuiltins.h: Added.
              * kjs/bool_object.cpp:
              (BooleanPrototype::BooleanPrototype):
              * kjs/collector.cpp:
              (KJS::Collector::collect):
              (KJS::Collector::numInterpreters):
              * kjs/context.h:
              * kjs/debugger.cpp:
              (Debugger::attach):
              (Debugger::detach):
              * kjs/function.cpp:
              (KJS::FunctionImp::callAsFunction):
              (KJS::GlobalFuncImp::callAsFunction):
              * kjs/function_object.cpp:
              (FunctionObjectImp::construct):
              * kjs/internal.cpp:
              * kjs/internal.h:
              * kjs/interpreter.cpp:
              (KJS::interpreterMap):
              (KJS::Interpreter::Interpreter):
              (KJS::Interpreter::init):
              (KJS::Interpreter::~Interpreter):
              (KJS::Interpreter::globalObject):
              (KJS::Interpreter::initGlobalObject):
              (KJS::Interpreter::globalExec):
              (KJS::Interpreter::checkSyntax):
              (KJS::Interpreter::evaluate):
              (KJS::Interpreter::builtinObject):
              (KJS::Interpreter::builtinFunction):
              (KJS::Interpreter::builtinArray):
              (KJS::Interpreter::builtinBoolean):
              (KJS::Interpreter::builtinString):
              (KJS::Interpreter::builtinNumber):
              (KJS::Interpreter::builtinDate):
              (KJS::Interpreter::builtinRegExp):
              (KJS::Interpreter::builtinError):
              (KJS::Interpreter::builtinObjectPrototype):
              (KJS::Interpreter::builtinFunctionPrototype):
              (KJS::Interpreter::builtinArrayPrototype):
              (KJS::Interpreter::builtinBooleanPrototype):
              (KJS::Interpreter::builtinStringPrototype):
              (KJS::Interpreter::builtinNumberPrototype):
              (KJS::Interpreter::builtinDatePrototype):
              (KJS::Interpreter::builtinRegExpPrototype):
              (KJS::Interpreter::builtinErrorPrototype):
              (KJS::Interpreter::builtinEvalError):
              (KJS::Interpreter::builtinRangeError):
              (KJS::Interpreter::builtinReferenceError):
              (KJS::Interpreter::builtinSyntaxError):
              (KJS::Interpreter::builtinTypeError):
              (KJS::Interpreter::builtinURIError):
              (KJS::Interpreter::builtinEvalErrorPrototype):
              (KJS::Interpreter::builtinRangeErrorPrototype):
              (KJS::Interpreter::builtinReferenceErrorPrototype):
              (KJS::Interpreter::builtinSyntaxErrorPrototype):
              (KJS::Interpreter::builtinTypeErrorPrototype):
              (KJS::Interpreter::builtinURIErrorPrototype):
              (KJS::Interpreter::mark):
              (KJS::Interpreter::interpreterWithGlobalObject):
              (KJS::Interpreter::saveBuiltins):
              (KJS::Interpreter::restoreBuiltins):
              * kjs/interpreter.h:
              (KJS::Interpreter::setCompatMode):
              (KJS::Interpreter::compatMode):
              (KJS::Interpreter::firstInterpreter):
              (KJS::Interpreter::nextInterpreter):
              (KJS::Interpreter::prevInterpreter):
              (KJS::Interpreter::debugger):
              (KJS::Interpreter::setDebugger):
              (KJS::Interpreter::setContext):
              (KJS::Interpreter::context):
              * kjs/nodes.cpp:
              (StatementNode::hitStatement):
              (RegExpNode::evaluate):
              * kjs/protect.h:
      
      JavaScriptGlue:
      
              Reviewed by TimO, Maciej.
              
              - JSGlue part of merging InterpreterImp into Interpreter.
              
              Since there's now a kjs forwarding header, I moved all forwarding
              headers into a "ForwardingHeaders" directory, like in WebCore.
      
              * ForwardingHeaders: Added.
              * ForwardingHeaders/kjs: Added.
              * ForwardingHeaders/kjs/ExecState.h: Added.
              * ForwardingHeaders/wtf: Added.
              * JavaScriptGlue.xcodeproj/project.pbxproj:
              * config.h:
              * wtf: Removed.
              * wtf/AlwaysInline.h: Removed.
              * wtf/Assertions.h: Removed.
              * wtf/FastMalloc.h: Removed.
              * wtf/Forward.h: Removed.
              * wtf/HashCountedSet.h: Removed.
              * wtf/HashSet.h: Removed.
              * wtf/Noncopyable.h: Removed.
              * wtf/OwnArrayPtr.h: Removed.
              * wtf/OwnPtr.h: Removed.
              * wtf/PassRefPtr.h: Removed.
              * wtf/Platform.h: Removed.
              * wtf/RefPtr.h: Removed.
              * wtf/Vector.h: Removed.
      
      WebCore:
      
              Reviewed by TimO, Maciej.
      
              - WebCore part of merging InterpreterImp into Interpreter. No test
              because there's no behavior change.
              
              A substantive change here is that ScriptInterpreter::mark must now chain to
              Interpreter::mark, since Interpreter needs to mark the things that
              InterpreterImp used to mark.
              
              * WebCore.xcodeproj/project.pbxproj:
              * bindings/js/kjs_binding.cpp:
              * bindings/js/kjs_window.cpp:
              (KJS::Window::put):
              * bridge/mac/WebCoreFrameBridge.mm:
              * bridge/mac/WebCoreScriptDebugger.mm:
              (-[WebCoreScriptCallFrame evaluateWebScript:]):
              * kwq/KWQPageState.mm:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@14834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      01b2e77a