Ignore:
Timestamp:
Jun 12, 2007, 9:25:28 PM (18 years ago)
Author:
andersca
Message:

Reviewed by Oliver.


Get rid of the MethodList class and use a good ol' Vector instead.

  • bindings/c/c_class.cpp: (KJS::Bindings::CClass::methodsNamed):
  • bindings/c/c_instance.cpp: (KJS::Bindings::CInstance::invokeMethod):
  • bindings/jni/jni_class.cpp: (JavaClass::JavaClass): (JavaClass::~JavaClass):
  • bindings/jni/jni_instance.cpp: (JavaInstance::invokeMethod):
  • bindings/objc/objc_class.mm: (KJS::Bindings::ObjcClass::methodsNamed):
  • bindings/objc/objc_instance.mm: (ObjcInstance::invokeMethod):
  • bindings/objc/objc_runtime.mm: (ObjcFallbackObjectImp::callAsFunction):
  • bindings/runtime.cpp:
  • bindings/runtime.h:
  • bindings/runtime_method.cpp: (RuntimeMethod::lengthGetter): (RuntimeMethod::callAsFunction):
  • bindings/runtime_object.cpp: (RuntimeObjectImp::getOwnPropertySlot):
File:
1 edited

Legend:

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

    r23467 r23479  
    4444
    4545namespace KJS { namespace Bindings {
    46 
    47 void MethodList::addMethod(Method *aMethod)
    48 {
    49     Method **_newMethods = new Method *[_length + 1];
    50     if (_length > 0) {
    51         memcpy(_newMethods, _methods, sizeof(Method *) * _length);
    52         delete [] _methods;
    53     }
    54     _methods = _newMethods;
    55     _methods[_length++] = aMethod;
    56 }
    57 
    58 unsigned int MethodList::length() const
    59 {
    60     return _length;
    61 }
    62 
    63 Method *MethodList::methodAt(unsigned int index) const
    64 {
    65     assert(index < _length);
    66     return _methods[index];
    67 }
    68    
    69 MethodList::~MethodList()
    70 {
    71     delete [] _methods;
    72 }
    73 
    74 MethodList::MethodList(const MethodList &other)
    75 {
    76     _length = other._length;
    77     _methods = new Method *[_length];
    78     if (_length > 0)
    79         memcpy (_methods, other._methods, sizeof(Method *) * _length);
    80 }
    81 
    82 MethodList &MethodList::operator=(const MethodList &other)
    83 {
    84     if (this == &other)
    85         return *this;
    86            
    87     delete [] _methods;
    88    
    89     _length = other._length;
    90     _methods = new Method *[_length];
    91     if (_length > 0)
    92         memcpy(_methods, other._methods, sizeof(Method *) * _length);
    93 
    94     return *this;
    95 }
    9646
    9747Array::Array(PassRefPtr<RootObject> rootObject)
Note: See TracChangeset for help on using the changeset viewer.