Ignore:
Timestamp:
Mar 16, 2010, 1:46:02 PM (15 years ago)
Author:
Darin Adler
Message:

Added arrayLength function and used it instead of hand-written code.

Reviewed by Sam Weinig.

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/UString.cpp

    r55833 r56081  
    179179{
    180180    UChar buf[1 + sizeof(i) * 3];
    181     UChar* end = buf + sizeof(buf) / sizeof(UChar);
     181    UChar* end = buf + arrayLength(buf);
    182182    UChar* p = end;
    183183
     
    208208{
    209209    UChar buf[1 + sizeof(i) * 3];
    210     UChar* end = buf + sizeof(buf) / sizeof(UChar);
     210    UChar* end = buf + arrayLength(buf);
    211211    UChar* p = end;
    212212
     
    241241{
    242242    UChar buf[sizeof(u) * 3];
    243     UChar* end = buf + sizeof(buf) / sizeof(UChar);
     243    UChar* end = buf + arrayLength(buf);
    244244    UChar* p = end;
    245245
     
    259259{
    260260    UChar buf[1 + sizeof(l) * 3];
    261     UChar* end = buf + sizeof(buf) / sizeof(UChar);
     261    UChar* end = buf + arrayLength(buf);
    262262    UChar* p = end;
    263263
Note: See TracChangeset for help on using the changeset viewer.