Added arrayLength function and used it instead of hand-written code.
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Mar 2010 20:46:02 +0000 (20:46 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Mar 2010 20:46:02 +0000 (20:46 +0000)
commit78e387cde9e8eb5e14d480627be2906edccf539e
tree5fc9257e697b5509805f94143993e26be542d2f9
parent0bbc1d2dec57ad723d37d74a8f92b25d19c0d2f9
Added arrayLength function and used it instead of hand-written code.

Reviewed by Sam Weinig.

* JavaScriptCore.xcodeproj/project.pbxproj:
Removed PtrAndFlags.h. The file was removed long ago.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::privateExecute): Use arrayLength.

* runtime/Collector.h:
(JSC::CollectorBitmap::count): Remove WTF:: prefix from use
of bitCount. In WTF we inject things into the global namespace
and this is no exception.

* runtime/DatePrototype.cpp:
(JSC::formatLocaleDate): Use arrayLength.

* runtime/JSFunction.h:
(JSC::JSFunction::nativeFunction): Remove WTF:: prefix as above.
(JSC::JSFunction::scopeChain): Ditto.
(JSC::JSFunction::setScopeChain): Ditto.
(JSC::JSFunction::setNativeFunction): Ditto.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::reset): Use arrayLength.

* runtime/JSImmediate.h:
(JSC::reinterpretDoubleToIntptr): Remove WTF:: prefix as above.
(JSC::reinterpretIntptrToDouble): Ditto.

* runtime/JSONObject.cpp:
(JSC::Stringifier::appendQuotedString): Use arrayLength.
(JSC::Stringifier::toJSON): Ditto.
(JSC::Stringifier::appendStringifiedValue): Ditto.
* runtime/SmallStrings.cpp:
(JSC::SmallStrings::SmallStrings): Ditto.

* runtime/UString.cpp:
(JSC::UString::from): Use arrayLength.

* wtf/StdLibExtras.h:
(WTF::bitwise_cast): Marked this inline!
(WTF::arrayLength): Added function template (actually written by Sam).
Added using declarations for public things in WTF namespace defined
in this file.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@56081 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
JavaScriptCore/interpreter/Interpreter.cpp
JavaScriptCore/runtime/Collector.h
JavaScriptCore/runtime/DatePrototype.cpp
JavaScriptCore/runtime/JSFunction.h
JavaScriptCore/runtime/JSGlobalObject.cpp
JavaScriptCore/runtime/JSImmediate.h
JavaScriptCore/runtime/JSONObject.cpp
JavaScriptCore/runtime/SmallStrings.cpp
JavaScriptCore/runtime/UString.cpp
JavaScriptCore/wtf/StdLibExtras.h