1. 22 Jul, 2005 1 commit
    • ggaren's avatar
      JavaScriptCore: · c9983ce3
      ggaren authored
              Reviewed by darin.
      
              * tests/mozilla/jsDriver.pl: now takes the path to testkjs as a command-line argument
              * tests/mozilla/run-mozilla-tests: Removed.
      
      WebKitTools:
      
              Moved Tools/Scripts/run-mozilla-tests to WebKitTools/Scripts/run-javascriptcore-tests.
              run-javascriptcore-tests now passes its command-line arguments to jsDriver.pl
      
              Moved Tools/Scripts/update-mozilla-js-test-results to
              WebKitTools/Scripts/update-javascriptcore-test-results.
      
              Reviewed by darin.
      
              * Scripts/run-javascriptcore-tests: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@9874 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c9983ce3
  2. 19 Jul, 2005 1 commit
  3. 18 Jul, 2005 1 commit
  4. 15 Jul, 2005 1 commit
    • ggaren's avatar
      -rolled in KDE fixes for http://bugzilla.opendarwin.org/show_bug.cgi?id=3601 · 57b32066
      ggaren authored
              Error instance type info
      
              Reviewed by mjs.
      
              * kjs/error_object.cpp:
              - Created ErrorInstanceImp class for Error() objects.
              - Changed parent object for Native Errors to "Function" (matches
              ECMA spec).
              (ErrorInstanceImp::ErrorInstanceImp):
              (ErrorProtoFuncImp::call):
              (ErrorObjectImp::construct):
              (NativeErrorImp::construct):
      
              * kjs/error_object.h:
              (KJS::ErrorInstanceImp::classInfo):
              * kjs/object.h: made comment more informative about ClassInfo
      
              * tests/mozilla/expected.html:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@9795 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      57b32066
  5. 14 Jul, 2005 3 commits
  6. 12 Jul, 2005 1 commit
    • ggaren's avatar
      -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3881 · c5fb7ed5
      ggaren authored
              arguments object should share values with function parameters
      
              Reviewed by mjs.
      
              ArgumentsImp now uses a simple hash lookup to share values
              with the activation object.
      
              * kjs/function.cpp:
              (KJS::FunctionImp::getParameterName):
              (KJS::IndexToNameMap::IndexToNameMap):
              (KJS::IndexToNameMap::~IndexToNameMap):
              (KJS::IndexToNameMap::isMapped):
              (KJS::IndexToNameMap::unMap):
              (KJS::IndexToNameMap::operator[]):
              (KJS::ArgumentsImp::ArgumentsImp):
              (KJS::ArgumentsImp::mark):
              (KJS::ArgumentsImp::get):
              (KJS::ArgumentsImp::put):
              (KJS::ArgumentsImp::deleteProperty):
              (KJS::ArgumentsImp::hasOwnProperty):
              (KJS::ActivationImp::createArgumentsObject):
              * kjs/function.h:
              * tests/mozilla/expected.html: updated results
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@9676 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c5fb7ed5
  7. 08 Jul, 2005 2 commits
  8. 03 Jul, 2005 1 commit
    • mjs's avatar
      JavaScriptCore: · c261a117
      mjs authored
      	Original patch from Mark Rowe <opendarwin.org@bdash.net.nz>, reviewed by me.
      	Fixes to patch by me, reviewed by John Sullivan.
      
      	- fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3293
      
              Test cases added:
              * tests/mozilla/expected.html: Two tests newly pass.
      
              * bindings/objc/objc_runtime.h:
              * bindings/objc/objc_runtime.mm:
              (ObjcFallbackObjectImp::hasOwnProperty):
              * bindings/runtime_array.cpp:
              (RuntimeArrayImp::hasOwnProperty):
              * bindings/runtime_array.h:
              * bindings/runtime_object.cpp:
              (RuntimeObjectImp::hasOwnProperty):
              * bindings/runtime_object.h:
              * kjs/array_instance.h:
              * kjs/array_object.cpp:
              (ArrayInstanceImp::hasOwnProperty):
              * kjs/function.cpp:
              (KJS::FunctionImp::hasOwnProperty):
              (KJS::ActivationImp::hasOwnProperty):
              * kjs/function.h:
              * kjs/lookup.h:
              * kjs/object.cpp:
              (KJS::ObjectImp::hasProperty):
              (KJS::ObjectImp::hasOwnProperty):
              * kjs/object.h:
              (KJS::Object::hasOwnProperty):
              * kjs/object_object.cpp:
              (ObjectPrototypeImp::ObjectPrototypeImp):
              (ObjectProtoFuncImp::call):
              * kjs/object_object.h:
              (KJS::ObjectProtoFuncImp::):
              * kjs/string_object.cpp:
              (StringInstanceImp::hasOwnProperty):
              * kjs/string_object.h:
      
      WebCore:
      
      	Original patch from Mark Rowe <opendarwin.org@bdash.net.nz>, reviewed by me.
      	Fixes to patch by me, reviewed by John Sullivan.
      
      	- fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3293
      
              Test cases added:
              * layout-tests/fast/js/has-own-property.html: Added - tests this change.
              * layout-tests/fast/js/eval-var-decl.html: Added - test depends on this change.
      
              * khtml/ecma/kjs_css.cpp:
              (KJS::DOMCSSStyleDeclaration::hasOwnProperty):
              * khtml/ecma/kjs_css.h:
              * khtml/ecma/kjs_dom.cpp:
              (KJS::DOMNodeList::hasOwnProperty):
              (KJS::DOMElement::tryGet):
              (KJS::DOMNamedNodeMap::hasOwnProperty):
              * khtml/ecma/kjs_dom.h:
              * khtml/ecma/kjs_html.cpp:
              (KJS::HTMLDocument::hasOwnProperty):
              (KJS::HTMLDocument::tryGet):
              (KJS::KJS::HTMLElement::hasOwnProperty):
              (KJS::KJS::HTMLCollection::hasOwnProperty):
              * khtml/ecma/kjs_html.h:
              * khtml/ecma/kjs_window.cpp:
              (KJS::Window::hasOwnProperty):
              (KJS::Konqueror::hasOwnProperty):
              * khtml/ecma/kjs_window.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@9582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c261a117
  9. 01 Jul, 2005 3 commits
    • ggaren's avatar
      JavaScriptCore: · 8be9c93b
      ggaren authored
              -landed patch by Carsten Guenther <cguenther@gmail.com>
      
              -fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3477
              some US-centric date formats not parsed by JavaScript (clock at news8austin.com)
      
              -relevant tests:
                     mozilla/ecma_3/Date/15.9.5.5.js
                     layout-tests/fast/js/date-parse-test.html
      
              Reviewed by darin.
      
              * kjs/date_object.cpp:
              (formatLocaleDate):
              (day):
              (dayFromYear):
              (daysInYear):
              (timeFromYear):
              (yearFromTime):
              (weekDay):
              (timeZoneOffset):
              (DateProtoFuncImp::call):
              (DateObjectImp::construct):
              (KJS::parseDate):
              (ymdhms_to_seconds):
              (KJS::makeTime):
              (findMonth):
              (KJS::KRFCDate_parseDate):
              * kjs/date_object.h:
              * tests/mozilla/expected.html: updated expected results to reflect fix
      
      WebCore:
      
              -landed patch by Carsten Guenther <cguenther@gmail.com>
              http://bugzilla...
      8be9c93b
    • ggaren's avatar
      -fixed <rdar://problem/4168186> JavaScript fails to throw exceptions · cf56a6ab
      ggaren authored
              for invalid return statements
      
              relevant tests:
                  ecma/Statements/12.9-1-n.js
                  ecma_2/Exceptions/lexical-052.js
                  ecma_2/Exceptions/statement-009.js
      
              Reviewed by sullivan.
      
              * kjs/nodes.cpp:
              (ReturnNode::execute): now throws exception if return is not inside
              a function.
      
              * tests/mozilla/expected.html: updated to reflect fix
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@9558 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cf56a6ab
    • ggaren's avatar
      Reviewed by sullivan. · cccf3f02
      ggaren authored
              * tests/mozilla/expected.html: Updated test results for last fix.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@9557 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cccf3f02
  10. 30 Jun, 2005 1 commit
    • ggaren's avatar
      -rolled in KDE fix to <rdar://problem/4167660> JavaScript fails to · b5a40fe4
      ggaren authored
              throw exceptions for invalid break/continue statements
      
              No layout tests because it's already covered by the Mozilla suite
      
              Reviewed by mjs.
      
              * kjs/internal.h: LabelStack now tracks where you are relative to
              switch and iteration (loop) statements
      
              (KJS::LabelStack::LabelStack):
              (KJS::LabelStack::pushIteration):
              (KJS::LabelStack::popIteration):
              (KJS::LabelStack::inIteration):
              (KJS::LabelStack::pushSwitch):
              (KJS::LabelStack::popSwitch):
              (KJS::LabelStack::inSwitch):
      
              * kjs/nodes.cpp:
              These files were updated to use the new LabelStack:
              (DoWhileNode::execute):
              (WhileNode::execute):
              (ForNode::execute):
              (ForInNode::execute):
              (SwitchNode::execute):
      
              These files were updated to throw exceptions for invalid
              break/continue statements:
              (BreakNode::execute):
              (ContinueNode::execute):
      
              * tests/mozilla/expected.html: Updated expected results to reflect fix
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@9551 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b5a40fe4
  11. 29 Jun, 2005 1 commit
  12. 28 Jun, 2005 1 commit
  13. 22 Jun, 2005 1 commit
  14. 21 Jun, 2005 3 commits
    • adele's avatar
      JavaScriptCore: · 7fc92270
      adele authored
              rolling out fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=3293, since it caused layout test failures.
      	fast/forms/element-by-name
              fast/loader/loadInProgress
      
              * ChangeLog:
              * bindings/objc/objc_runtime.h:
              * bindings/objc/objc_runtime.mm:
              (ObjcFallbackObjectImp::hasProperty):
              * bindings/runtime_array.cpp:
              (RuntimeArrayImp::hasProperty):
              * bindings/runtime_array.h:
              * bindings/runtime_object.cpp:
              (RuntimeObjectImp::hasProperty):
              * bindings/runtime_object.h:
              * kjs/array_instance.h:
              * kjs/array_object.cpp:
              (ArrayInstanceImp::hasProperty):
              * kjs/function.cpp:
              (KJS::FunctionImp::hasProperty):
              (KJS::ActivationImp::hasProperty):
              * kjs/function.h:
              * kjs/object.cpp:
              (KJS::ObjectImp::hasProperty):
              * kjs/object.h:
              * kjs/object_object.cpp:
              (ObjectPrototypeImp::ObjectPrototypeImp):
              (ObjectProtoFuncImp::call):
              * kjs/object_object.h:
              (KJS::ObjectProtoFuncImp::):
              * kjs/string_object.cpp:
              (StringInstanceImp::hasProperty):
              * kjs/string_object.h:
              * tests/mozilla/expected.html:
      
      WebCore:
      
              rolling out fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=3293, since it caused layout test failures.
      	fast/forms/element-by-name
              fast/loader/loadInProgress
      
              * ChangeLog:
              * khtml/ecma/kjs_binding.h:
              * khtml/ecma/kjs_css.cpp:
              (KJS::DOMCSSStyleDeclaration::hasProperty):
              * khtml/ecma/kjs_css.h:
              * khtml/ecma/kjs_dom.cpp:
              (KJS::DOMNodeList::hasProperty):
              (KJS::DOMNamedNodeMap::hasProperty):
              * khtml/ecma/kjs_dom.h:
              * khtml/ecma/kjs_html.cpp:
              (KJS::HTMLDocument::hasProperty):
              (KJS::KJS::HTMLElement::hasProperty):
              (KJS::KJS::HTMLCollection::hasProperty):
              * khtml/ecma/kjs_html.h:
              * khtml/ecma/kjs_window.cpp:
              (KJS::Window::hasProperty):
              (KJS::Konqueror::hasProperty):
              * khtml/ecma/kjs_window.h:
              * layout-tests/fast/js/eval-var-decl-expected.txt: Removed. This test used hasOwnProperty
              * layout-tests/fast/js/eval-var-decl.html: Removed. This test used hasOwnProperty
              * layout-tests/fast/js/hasOwnProperty-expected.txt: Removed.
              * layout-tests/fast/js/hasOwnProperty.html: Removed.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@9455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7fc92270
    • ggaren's avatar
      - fixed <rdar://problem/4155532> 'delete' succeeds on functions · 44ab4974
      ggaren authored
              - fixed <rdar://problem/4155049> javascript function named as "opener" doesn't get called because of window.opener property
      
              Reviewed by cblu.
      
              * kjs/nodes.cpp:
              (FuncDeclNode::processFuncDecl): Functions now have DontDelete and Internal attributes set when appropriate.
      
              Test cases:
              * tests/mozilla/expected.html: Updated for one new success.
              - see also test case added in WebCore.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@9448 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      44ab4974
    • mjs's avatar
      JavaScriptCore: · a8a255be
      mjs authored
              Reviewed by Darin(first pass) and Hyatt.
      
              - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3576
              (roll in support for "const" keyword from KDE tree)
              - make processVarDecls handle deletability of variables declared
              in an eval block the same as evaluate would
              - make eval() call processVarDecls - needed to match mozilla and
              to make the second change testable
      
              I started with the KDE implementation of const but I ended up changing it a bit
              to avoid the use of a global variable. Now instead of the global variable it distinguishes
              const and var at the grammar level so the appropriate node can know the right kind of
              declaration.
      
              Test cases:
              * tests/mozilla/expected.html: Updated for one new test that is
              failing - we used to bail on it entirely because it checks for
              const support before starting.
              - see also test cases added in WebCore
      
              * kjs/grammar.y: Add rules for const declarations.
              * kjs/keywords.table: Add const keyword.
              * kjs/nodes.cpp:
              (VarDeclNode::VarDeclNode): Add parameter.
              (VarDeclNode::evaluate): Add const support.
              (VarDeclNode::processVarDecls): Add const support.
              (VarStatementNode::execute): Irrelevant change.
              (ForInNode::ForInNode): Tell our variable node that it's a variable.
              * kjs/nodes.h:
              (KJS::VarDeclNode::): Add declaration of type enum, extra constructor parameter.
              (KJS::VarStatementNode::VarStatementNode): Irrelevant change.
              * kjs/function.cpp:
              (KJS::GlobalFuncImp::call): Process var decls before evaluating.
      
      WebCore:
      
              Reviewed by Darin(first pass) and Hyatt.
      
              - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3576
              (roll in support for "const" keyword from KDE tree)
              - make processVarDecls handle deletability of variables declared
              in an eval block the same as evaluate would
              - make eval() call processVarDecls - needed to match mozilla and
              to make the second change testable
      
      	Test cases only, fix is in JavaScriptCore
      
              Test cases added:
              * layout-tests/fast/js/const-expected.txt: Added.
              * layout-tests/fast/js/const.html: Added.
              * layout-tests/fast/js/eval-var-decl-expected.txt: Added.
              * layout-tests/fast/js/eval-var-decl.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@9445 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a8a255be
  15. 20 Jun, 2005 1 commit
    • mjs's avatar
      JavaScriptCore: · 0e5da23b
      mjs authored
              Patch from Mark Rowe <opendarwin.org@bdash.net.nz>, reviewed by me.
      
      	- fixed http://bugzilla.opendarwin.org/attachment.cgi?id=2483
      
              Test cases added:
              * tests/mozilla/expected.html: Updated for two fixed tests.
      	- also added a layout test
      
      	* bindings/objc/objc_runtime.h:
              * bindings/objc/objc_runtime.mm:
              (ObjcFallbackObjectImp::hasOwnProperty):
              * bindings/runtime_array.cpp:
              (RuntimeArrayImp::hasOwnProperty):
              * bindings/runtime_array.h:
              * bindings/runtime_object.cpp:
              (RuntimeObjectImp::hasOwnProperty):
              * bindings/runtime_object.h:
              * kjs/array_instance.h:
              * kjs/array_object.cpp:
              (ArrayInstanceImp::hasOwnProperty):
              * kjs/function.cpp:
              (KJS::FunctionImp::hasOwnProperty):
              (KJS::ActivationImp::hasOwnProperty):
              * kjs/function.h:
              * kjs/object.cpp:
              (KJS::ObjectImp::hasProperty):
              (KJS::ObjectImp::hasOwnProperty):
              * kjs/object.h:
              (KJS::Object::hasOwnProperty):
              * kjs/object_object.cpp:
              (ObjectPrototypeImp::ObjectPrototypeImp):
              (ObjectProtoFuncImp::call):
              * kjs/object_object.h:
              (KJS::ObjectProtoFuncImp::):
              * kjs/string_object.cpp:
              (StringInstanceImp::hasOwnProperty):
              * kjs/string_object.h:
      
      WebCore:
      
              Patch from Mark Rowe <opendarwin.org@bdash.net.nz>, reviewed by me.
      
      	- fixed http://bugzilla.opendarwin.org/attachment.cgi?id=2483
      
              Test cases added:
              * layout-tests/fast/js/hasOwnProperty-expected.txt: Added.
              * layout-tests/fast/js/hasOwnProperty.html: Added.
      	- also fixed two mozilla JS tests
      
              * khtml/ecma/kjs_binding.h:
              * khtml/ecma/kjs_css.cpp:
              (KJS::DOMCSSStyleDeclaration::hasOwnProperty):
              * khtml/ecma/kjs_css.h:
              * khtml/ecma/kjs_dom.cpp:
              (KJS::DOMNodeList::hasOwnProperty):
              (KJS::DOMNamedNodeMap::hasOwnProperty):
              * khtml/ecma/kjs_dom.h:
              * khtml/ecma/kjs_html.cpp:
              (KJS::HTMLDocument::hasOwnProperty):
              (KJS::KJS::HTMLElement::hasOwnProperty):
              (KJS::KJS::HTMLCollection::hasOwnProperty):
              * khtml/ecma/kjs_html.h:
              * khtml/ecma/kjs_window.cpp:
              (KJS::Window::hasOwnProperty):
              (KJS::Konqueror::hasOwnProperty):
              * khtml/ecma/kjs_window.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@9441 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0e5da23b
  16. 16 Jun, 2005 1 commit
  17. 14 Jun, 2005 1 commit
  18. 04 May, 2005 1 commit
  19. 20 Apr, 2005 1 commit
    • darin's avatar
      Reviewed by Maciej. · 140be37d
      darin authored
              - speedups, total 12% on JavaScript iBench
      
              I ran the benchmark under Shark and followed its advice a lot, mainly.
      
              * kjs/collector.cpp:
              (KJS::Collector::allocate): Take out special case for 0; costing speed but unexercised.
              Use numLiveObjectsAtLastCollect instead of numAllocationsSinceLastCollect so we don't
              have to bump it each time we call allocate. Put numLiveObjects into a local variable to
              cut down on global variable accesses. Make "next" cell pointer be a byte offset rather
              than a pointer so we don't need a special case for NULL. Allow freeList to point to some
              bogus item when the entire block is full rather than going out of our way to make it
              point to NULL.
              (KJS::Collector::markProtectedObjects): Get table size and pointer into locals outside
              the loop to avoid re-loading them over and over again.
              (KJS::Collector::collect): Put numLiveObjects into a local variable to cut down on global
              variable accesses. Make "next" cell pointer be a byte offset as above. Put numLiveObjects
              into a local variable to cut down on global variable accesses. Set numLiveObjectsAtLastCollect
              rather than numAllocationsSinceLastCollect.
              (KJS::Collector::numReferencedObjects): Get table size and pointer into locals outside
              the loop to avoid re-loading them over and over again.
              (KJS::Collector::rootObjectClasses): Ditto.
      
              * kjs/internal.h: Make Value be a friend of NumberImp so it can construct number objects
              directly, avoiding the conversion from Number to Value.
      
              * kjs/internal.cpp: (StringImp::toObject): Don't use Object::dynamicCast, because we know
              the thing is an object and we don't want to do all the extra work; just cast directly.
      
              * kjs/list.cpp: (KJS::List::List): Construct valueRefCount in a way that avoids the need for
              a branch -- in the hot case this just meant avoiding checking a variable we just set to false.
      
              * kjs/lookup.cpp: (keysMatch): Marked this inline.
      
              * kjs/nodes.cpp: Disabled KJS_BREAKPOINT, to avoid calling hitStatement all the time.
              (BooleanNode::evaluate): Make a Value directly, rather than making a Boolean which is converted
              into a Value.
              (NumberNode::evaluate): Ditto.
              (StringNode::evaluate): Ditto.
              (ArrayNode::evaluate): Ditto.
              (FunctionCallNode::evaluate): Use new inline baseIfMutable to avoid unnecessary getBase function.
              Also just use a pointer for func, rather than an Object.
              (PostfixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
              passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
              integer and back.
              (DeleteNode::evaluate): Make a Value directly.
              (TypeOfNode::evaluate): Use new inline baseIfMutable and make Value directly.
              (PrefixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
              passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
              integer and back.
              (UnaryPlusNode::evaluate): Make a Value directly.
              (NegateNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
              passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
              integer and back.
              (BitwiseNotNode::evaluate): Make a Value directly.
              (LogicalNotNode::evaluate): Ditto.
              (ShiftNode::evaluate): Don't convert to a double before making a Value.
              (RelationalNode::evaluate): Make a Value directly.
              (EqualNode::evaluate): Ditto.
              (BitOperNode::evaluate): Ditto.
              (AssignNode::evaluate): Make a Value directly. Change code so that it passes a "known to be integer"
              boolean in, often avoiding a conversion from floating point to integer and back.
              (VarDeclNode::evaluate): Make a Value directly.
              (ForNode::execute): Remove unused local variable.
      
              * kjs/operations.h:
              (KJS::isNaN): Inlined.
              (KJS::isInf): Ditto.
              (KJS::isPosInf): Ditto.
              (KJS::isNegInf): Ditto.
      
              * kjs/operations.cpp: Change isNaN, isInf, isPosInf, and isNegInf to be inlines.
              (KJS::equal): Rewrite to avoid creating values and recursing back into the function.
              (KJS::relation): Rearranged code so that we don't need explicit isNaN checks.
              (KJS::add): Changed code to make Value directly, and so that it passes a "known to be integer"
              boolean in, often avoiding a conversion from floating point to integer and back.
              (KJS::mult): Ditto.
      
              * kjs/property_map.cpp:
              (KJS::PropertyMap::~PropertyMap): Get size and entries pointer outside loop to avoid
              re-getting them inside the loop.
              (KJS::PropertyMap::clear): Ditto. Clear value pointer in addition to key, so we can just
              look at the value pointer in the mark function.
              (KJS::PropertyMap::get): Get sizeMask and entries pointer outside loop to avoid
              re-getting them inside the loop.
              (KJS::PropertyMap::put): Ditto.
              (KJS::PropertyMap::insert): Ditto.
              (KJS::PropertyMap::remove): Ditto.
              (KJS::PropertyMap::mark): Get size and entries pointer outside loop to avoid
              re-getting them inside the loop. Don't bother checking key for 0, since we already have
              to check value for 0. (Also had to change clear() to set value to 0.)
              (KJS::PropertyMap::addEnumerablesToReferenceList): Get size and entries pointer outside
              loop to avoid re-getting them inside the loop.
              (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): Ditto.
              (KJS::PropertyMap::save): Ditto.
      
              - other changes
      
              * kjs/protected_values.h: Remove unneeded class name qualifiers.
      
              * kjs/reference.h:
              (KJS::Reference::baseIfMutable): New inline function: replaces isMutable().
              (KJS::Reference::Reference): Inlined.
              * kjs/reference.cpp:
              (KJS::Reference::getValue): Rewrite to not use getBase.
              (KJS::Reference::putValue): Ditto.
              (KJS::Reference::deleteValue): Dittol
      
              * kjs/simple_number.h:
              (KJS::SimpleNumber::integerFits): Added. For use when the parameter is known to be integral.
      
              * kjs/string_object.cpp: (StringProtoFuncImp::call): Create the number without first converting
              to double in various cases that involve integers.
      
              * kjs/ustring.h:
              (KJS::UString::attach): Inlined.
              (KJS::UString::release): Inlined.
              * kjs/ustring.cpp:
              (KJS::UString::find): Get first character outside the loop instead of re-fetching it each time.
      
              * kjs/value.cpp:
              (Value::Value): Added overloads for all the various specific types of values, so you don't have
              to convert from, say, Number to Value, just to create one.
              (Number::Number): Added an overload that takes a boolean to indicate the number is already
              known to be an integer.
      
              * kjs/value.h: Added more Value constructors, added a version of toNumber that returns
              a boolean to indicate if the number is known to be an integer (because it was a "simple number").
              (KJS::ValueImp::marked): Inlined.
              (KJS::ValueImp::dispatchType): Inlined.
              (KJS::ValueImp::dispatchToPrimitive): Inlined.
              (KJS::ValueImp::dispatchToBoolean): Inlined.
              (KJS::ValueImp::dispatchToNumber): Inlined.
              (KJS::ValueImp::dispatchToString): Inlined.
              (KJS::ValueImp::dispatchToUInt32): Inlined.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@9033 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      140be37d
  20. 26 Sep, 2004 1 commit
    • darin's avatar
      Reviewed by Kevin. · 298573ed
      darin authored
              - fixed <rdar://problem/3816097> REGRESSION: mailblocks, and presumably many other pages, failing because variable not found
      
              * kjs/internal.cpp: (InterpreterImp::evaluate): Process variable declarations before executing
              the program. We were doing this properly for functions, but not entire programs.
      
              - fixed <rdar://problem/3814706> REGRESSION: text fields in mailblocks wizards do not accept keystrokes due to use of charCodeAt()
      
              * kjs/string_object.cpp: (StringProtoFuncImp::call): Changed the implementation of charAt
              and charCodeAt to treat a missing parameter as an index of 0, rather than an invalid index.
      
              * tests/mozilla/expected.html: Update for two tests that now pass with these changes.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7682 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      298573ed
  21. 13 Sep, 2004 1 commit
  22. 12 Aug, 2004 2 commits
    • darin's avatar
      Reviewed by Adele. · 81c50384
      darin authored
              - fixed 3 problems with parse functions that I just wrote, fixing 3 more Mozilla JavaScript tests
      
              * kjs/function.cpp:
              (KJS::parseDigit): Fix typo, 'Z' instead of 'z', that prevented lowercase hex digits from working.
              (KJS::parseInt): Add octal support. Specification says it's optional, but I guess not.
              (KJS::parseFloat): Fix check for "0x" in parseFloat to return 0 rather than NaN. Also add code
              to skip leading "+" or "-".
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7245 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      81c50384
    • darin's avatar
      Reviewed by Ken. · bceb27f3
      darin authored
              - fixed 43 Mozilla JavaScript tests
      
              * kjs/date_object.h: Change parseDate and timeClip to take and return doubles.
              * kjs/date_object.cpp:
              (DateObjectImp::construct): Change to use a timeClip function that takes and returns a double rather
              than constructing a number object to pass to it.
              (DateObjectFuncImp::call): Change to use a parseDate function that returns a double.
              (KJS::parseDate): Change to return a double instead of creating the Number object here.
              (KJS::timeClip): Implement this as specified in the language standard.
      
              * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set the DontDelete, ReadOnly, and DontEnum
              flags on the prototype property.
      
              * kjs/function.cpp:
              (KJS::FunctionImp::get): Return null rather than undefined for arguments when the function is not
              currently in scope.
              (KJS::isStrWhiteSpace): Added. Matches specification for StrWhiteSpace. Could move it to some utility
              file later.
              (KJS::parseDigit): Added. Helper function for parseInt.
              (KJS::parseInt): Added. Integer parser that puts result in a double so we're not limited to what
              strtoll can handle. Also matches standard more closely.
              (KJS::parseFloat): Added. Handles "0x" properly and passes flag to make empty string turn into NaN
              instead of 0.
              (KJS::GlobalFuncImp::call): Use the new parseInt and parseFloat.
      
              * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Add a length property.
      
              * kjs/lexer.h: Added error flag and sawError() function for detecting errors.
              * kjs/lexer.cpp:
              (Lexer::setCode): Clear error state.
              (Lexer::lex): Set error state if the lexer encounters an error
      
              * kjs/internal.cpp:
              (NumberImp::toString): Roll in change from KDE version to special case 0 so we handle -0 correctly.
              (Parser::parse): Use new lexer error method so those errors are treated like parser errors.
      
              * kjs/math_object.cpp: (MathFuncImp::call): Change min and max to treat -0 as less than +0.
              Change round to round values between -0.5 and -0 to -0 instead of +0.
      
              * kjs/nodes.h: Add evaluateReference function to GroupNode.
              * kjs/nodes.cpp: (GroupNode::evaluateReference): Pass references through groups (parenthesized
              expressions) properly so that expressions like "delete (x.y)" work. Before, the parentheses
              would change x.y into a value that can't be deleted as a side effect.
      
              * kjs/string_object.cpp: Change parameter count for indexOf and lastIndexOf from 2 to 1 to match
              the specification.
      
              * kjs/testkjs.cpp: Rolled in changes from KDE to add a "quit" function to the test tool and
              get rid of the fixed size limit for code.
      
              * kjs/ustring.cpp: (KJS::UString::substr): Added optimized case for substr(0, length) so it just
              returns the string without creating a new Rep, since I'm using substr in a place where it will
              often be passed a 0.
      
              * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed one wrong entry in the Unicode table I added to
              the other day that was making a couple tests fail.
              * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
              * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
              * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
              * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
              * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
      
              * kjs/string_object.lut.h: Regenerated.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7239 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bceb27f3
  23. 10 Aug, 2004 1 commit
    • darin's avatar
      Reviewed by Maciej. · e3385e92
      darin authored
              - fixed 28 Mozilla JavaScript tests
      
              * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Check for undefined rather than
              checking the number of arguments for the join method.
      
              * kjs/lexer.cpp: (Lexer::lex): Parse hexadecimal and octal constants in doubles rather
              than integers, so we aren't limited to 32 bits.
      
              * kjs/math_object.cpp: (MathFuncImp::call): Get rid of many unneeded special cases in
              the implementation of the pow operation. Also simplied a case that was handling positive
              and negative infinity separately.
      
              * kjs/nodes.cpp: (ShiftNode::evaluate): Keep the result of shifts in a double instead of
              putting them in a long, so that unsigned shift will work properly.
      
              * kjs/number_object.cpp: Add the DontDelete and ReadOnly flags to the numeric constants.
      
              * kjs/operations.cpp:
              (KJS::isPosInf): Added an implementation inside APPLE_CHANGES that does not depend on the
              sign of isinf; our isinf function returns +1 even for negative infinity.
              (KJS::isNegInf): And again.
              (KJS::relation): Put in a nice simple implementation of comparison inside APPLE_CHANGES.
              Our floating point already handles the various infinity cases correctly.
      
              * kjs/regexp_object.cpp:
              (RegExpProtoFuncImp::call): Add missing return before Null() in Exec method.
              (RegExpObjectImp::arrayOfMatches): Put undefined rather than an empty string into the
              array in cases where we did not match.
              (RegExpObjectImp::construct): Set the DontDelete, ReadOnly, and DontEnum flags for
              "global", "ignoreCase", "multiline", and "source".
      
              * kjs/string_object.cpp: (StringProtoFuncImp::call): For the match method, turn a null
              string into undefined rather than an empty string. For the slice method, handle an
              undefined parameter for the limit properly as decribed in the specification, and add
              the limit to one case that didn't have the limit at all. For the methods that generate
              HTML strings, use lowercase tags instead of uppercase.
      
              * kjs/ustring.cpp:
              (KJS::UChar::toLower): Use u_tolower from the ICU library.
              (KJS::UChar::toUpper): Use u_toupper from the ICU library.
              (KJS::UString::append): Fix some math that caused a buffer overflow.
              (KJS::convertUTF16OffsetsToUTF8Offsets): Ignore negative numbers (-1 is used as a special
              flag) rather than converting them all to 0.
              (KJS::convertUTF8OffsetsToUTF16Offsets): Ditto.
      
              * tests/mozilla/jsDriver.pl: Fixed the relative links to point to our actual test files.
      
              * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed the Unicode table in this test to match
              the Unicode specification in a few cases where it was wrong before.
              * tests/mozilla/ecma/String/15.5.4.11-2.js: Ditto.
              * tests/mozilla/ecma/String/15.5.4.11-3.js: Ditto.
              * tests/mozilla/ecma/String/15.5.4.11-5.js: Ditto.
              * tests/mozilla/ecma/String/15.5.4.11-6.js: Ditto.
              * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
              * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
              * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
              * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
              * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
      
              * JavaScriptCore.pbproj/project.pbxproj: Link to libicu.
      
              * kjs/number_object.lut.h: Regenerated.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7222 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e3385e92
  24. 03 Aug, 2004 2 commits
    • kdecker's avatar
      Reviewed by Darin. · 3df0fb9c
      kdecker authored
      	Rolled in changes from the latest KJS sources that support additional
      	Number.prototype functions.
      
      	Specifically this patch covers the follow parts of the ECMA 3 spec:
        	15.7.4.5, 15.7.4.6, and 15.7.4.7
      
      	Fixes:
      	<rdar://problem/3663716> missing Number.toFixed (and toPrecision, toExponential)
      	<rdar://problem/3749492> missing Number.toPrecision prototype implementation
      	<rdar://problem/3749591> missing Number.toExponential prototype implementation
      
              * kjs/identifier.h: Added toFixed, toPrecision, and toExponential to the
      	list of supported identifiers (a macro).
              * kjs/number_object.cpp: Implemented support for toFixed(), toPrecision(),
      	and toExponential().
              (NumberPrototypeImp::NumberPrototypeImp):
              (NumberProtoFuncImp::call):
              * kjs/number_object.h: Added property names for toFixed, toPrecision,
      	and toExponential.
              (KJS::NumberProtoFuncImp::):
              * tests/mozilla/expected.html: Update results.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3df0fb9c
    • darin's avatar
      Reviewed by Ken. · 066b7458
      darin authored
              - added support for copying RegExp objects so 7 more Mozilla regexp tests pass
      
              * kjs/regexp_object.cpp: (RegExpObjectImp::construct): Check for case where
              we are supposed to just copy the regular expression object, and do so.
              Also tighten up arguments check to handle case where an actual "undefined"
              is passed rather than just omitting an argument.
      
              * tests/mozilla/expected.html: Update results.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7181 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      066b7458
  25. 02 Aug, 2004 2 commits
    • darin's avatar
      * tests/mozilla/.cvsignore: Added. · de7e93fa
      darin authored
              * tests/mozilla/expected.html: Update results.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7179 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      de7e93fa
    • darin's avatar
      Reviewed by Ken. · 14571bb3
      darin authored
              - fixed a couple things making 5 Mozilla regexp tests pass
      
              * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call): Implement toString
              for the prototype.
              (RegExpObjectImp::construct): Fix bug where the string "undefined" would
              be used as the flags string when no parameter was passed.
      
              * kjs/regexp_object.h: (KJS::RegExpPrototypeImp::classInfo):
              Added a class info object for RegExp prototype so it can return
              a string instead of raising an exception when converting to a string.
      
              * tests/mozilla/expected.html: Update results.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      14571bb3
  26. 13 Jul, 2004 1 commit
    • kdecker's avatar
      Reviewed by mjs · 90fbd0f7
      kdecker authored
       	- Modified the test driver to spew out each test as it processes it.  This is such a good thing to see from a performance perspective because it illustrates which tests JavaScriptCore chokes heavily.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7021 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      90fbd0f7