2006-08-22 Anders Carlsson <acarlsson@apple.com>
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Aug 2006 19:45:25 +0000 (19:45 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Aug 2006 19:45:25 +0000 (19:45 +0000)
        Reviewed by Geoff.

        Switch over the NPAPI and Java bindings to using HashMaps instead of dictionaries.

        * JavaScriptCore.xcodeproj/project.pbxproj:
        * bindings/c/c_class.cpp:
        (KJS::Bindings::CClass::CClass):
        (KJS::Bindings::CClass::~CClass):
        (KJS::Bindings::CClass::classForIsA):
        (KJS::Bindings::CClass::methodsNamed):
        (KJS::Bindings::CClass::fieldNamed):
        * bindings/c/c_class.h:
        * bindings/jni/jni_class.cpp:
        (JavaClass::JavaClass):
        (JavaClass::~JavaClass):
        (JavaClass::methodsNamed):
        (JavaClass::fieldNamed):
        * bindings/jni/jni_class.h:
        * bindings/objc/objc_class.h:
        * bindings/objc/objc_class.mm:
        (KJS::Bindings::deleteMethod):
        (KJS::Bindings::deleteField):
        (KJS::Bindings::):
        (KJS::Bindings::ObjcClass::methodsNamed):
        (KJS::Bindings::ObjcClass::fieldNamed):
        * bindings/runtime.cpp:
        * bindings/runtime.h:
        * bindings/runtime_object.cpp:
        (RuntimeObjectImp::fieldGetter):
        (RuntimeObjectImp::getOwnPropertySlot):
        (RuntimeObjectImp::put):
        (RuntimeObjectImp::canPut):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15969 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
JavaScriptCore/bindings/c/c_class.cpp
JavaScriptCore/bindings/c/c_class.h
JavaScriptCore/bindings/jni/jni_class.cpp
JavaScriptCore/bindings/jni/jni_class.h
JavaScriptCore/bindings/objc/objc_class.h
JavaScriptCore/bindings/objc/objc_class.mm
JavaScriptCore/bindings/runtime.cpp
JavaScriptCore/bindings/runtime.h
JavaScriptCore/bindings/runtime_object.cpp

index b98a89a3600d2a5f6ed84054e3b65ab66db1a69b..d55a35aa00806773045942775d6384d7ed14bac8 100644 (file)
@@ -1,3 +1,38 @@
+2006-08-22  Anders Carlsson  <acarlsson@apple.com>
+
+        Reviewed by Geoff.
+        
+        Switch over the NPAPI and Java bindings to using HashMaps instead of dictionaries.
+        
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * bindings/c/c_class.cpp:
+        (KJS::Bindings::CClass::CClass):
+        (KJS::Bindings::CClass::~CClass):
+        (KJS::Bindings::CClass::classForIsA):
+        (KJS::Bindings::CClass::methodsNamed):
+        (KJS::Bindings::CClass::fieldNamed):
+        * bindings/c/c_class.h:
+        * bindings/jni/jni_class.cpp:
+        (JavaClass::JavaClass):
+        (JavaClass::~JavaClass):
+        (JavaClass::methodsNamed):
+        (JavaClass::fieldNamed):
+        * bindings/jni/jni_class.h:
+        * bindings/objc/objc_class.h:
+        * bindings/objc/objc_class.mm:
+        (KJS::Bindings::deleteMethod):
+        (KJS::Bindings::deleteField):
+        (KJS::Bindings::):
+        (KJS::Bindings::ObjcClass::methodsNamed):
+        (KJS::Bindings::ObjcClass::fieldNamed):
+        * bindings/runtime.cpp:
+        * bindings/runtime.h:
+        * bindings/runtime_object.cpp:
+        (RuntimeObjectImp::fieldGetter):
+        (RuntimeObjectImp::getOwnPropertySlot):
+        (RuntimeObjectImp::put):
+        (RuntimeObjectImp::canPut):
+
 2006-08-21  Vladimir Olexa  <vladimir.olexa@gmail.com>
 
         Reviewed by Darin.
index 5729cd8dc41e1d5d6d70383d2f10758eb17a77ad..8e50beb08d9ebb7aa7f7c3a55a773e67bd3f5633 100644 (file)
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C277108902AFE008A9EFC /* Build configuration list for PBXProject "JavaScriptCore" */;
+                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        mainGroup = 0867D691FE84028FC02AAC07 /* JavaScriptCore */;
                        productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
                        projectDirPath = "";
+                       projectRoot = "";
+                       shouldCheckCompatibility = 1;
                        targets = (
                                932F5B3E0822A1C700736975 /* JavaScriptCore */,
                                935F69F508244FEA003D1A45 /* dftables */,
index 41e78367c7381715735bc43e8fc6e788b68d4394..89b13978bacac1f25dcb2a79eec5ff1deffa1542 100644 (file)
@@ -29,6 +29,7 @@
 #include "c_instance.h"
 #include "c_runtime.h"
 #include "npruntime_impl.h"
+#include "identifier.h"
 
 // FIXME: Should use HashMap instead of CFDictionary for better performance and for portability.
 
@@ -38,27 +39,26 @@ namespace Bindings {
 CClass::CClass(NPClass* aClass)
 {
     _isa = aClass;
-    _methods = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &MethodDictionaryValueCallBacks);
-    _fields = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &FieldDictionaryValueCallBacks);
 }
 
 CClass::~CClass()
 {
-    CFRelease(_methods);
-    CFRelease(_fields);
+    deleteAllValues(_methods);
+    deleteAllValues(_fields);
 }
     
-static CFMutableDictionaryRef classesByIsA = 0;
+typedef HashMap<NPClass*, CClass*> ClassesByIsAMap;
+static ClassesByIsAMap* classesByIsA = 0;
 
 CClass* CClass::classForIsA(NPClass* isa)
 {
     if (!classesByIsA)
-        classesByIsA = CFDictionaryCreateMutable(NULL, 0, NULL, NULL);
+        classesByIsA = new ClassesByIsAMap;
 
-    CClass* aClass = (CClass*)CFDictionaryGetValue(classesByIsA, isa);
+    CClass* aClass = classesByIsA->get(isa);
     if (!aClass) {
         aClass = new CClass(isa);
-        CFDictionaryAddValue(classesByIsA, isa, aClass);
+        classesByIsA->set(isa, aClass);
     }
 
     return aClass;
@@ -69,50 +69,42 @@ const char* CClass::name() const
     return "";
 }
 
-MethodList CClass::methodsNamed(const char* _name, Instance* instance) const
+MethodList CClass::methodsNamed(const Identifier& identifier, Instance* instance) const
 {
     MethodList methodList;
 
-    CFStringRef methodName = CFStringCreateWithCString(NULL, _name, kCFStringEncodingASCII);
-    Method* method = (Method*)CFDictionaryGetValue(_methods, methodName);
+    Method* method = _methods.get(identifier.ustring().rep());
     if (method) {
-        CFRelease(methodName);
         methodList.addMethod(method);
         return methodList;
     }
 
-    NPIdentifier ident = _NPN_GetStringIdentifier(_name);
+    NPIdentifier ident = _NPN_GetStringIdentifier(identifier.ascii());
     const CInstance* inst = static_cast<const CInstance*>(instance);
     NPObject* obj = inst->getObject();
     if (_isa->hasMethod && _isa->hasMethod(obj, ident)){
-        Method* aMethod = new CMethod(ident); // deleted when the dictionary is destroyed
-        CFDictionaryAddValue(_methods, methodName, aMethod);
+        Method* aMethod = new CMethod(ident); // deleted in the CClass destructor
+        _methods.set(identifier.ustring().rep(), aMethod);
         methodList.addMethod(aMethod);
     }
-
-    CFRelease(methodName);
+    
     return methodList;
 }
 
 
-Field* CClass::fieldNamed(const char* name, Instance* instance) const
+Field* CClass::fieldNamed(const Identifier& identifier, Instance* instance) const
 {
-    CFStringRef fieldName = CFStringCreateWithCString(NULL, name, kCFStringEncodingASCII);
-    Field* aField = (Field *)CFDictionaryGetValue(_fields, fieldName);
-    if (aField) {
-        CFRelease(fieldName);
+    Field* aField = _fields.get(identifier.ustring().rep());
+    if (aField)
         return aField;
-    }
-
-    NPIdentifier ident = _NPN_GetStringIdentifier(name);
+    
+    NPIdentifier ident = _NPN_GetStringIdentifier(identifier.ascii());
     const CInstance* inst = static_cast<const CInstance*>(instance);
     NPObject* obj = inst->getObject();
     if (_isa->hasProperty && _isa->hasProperty(obj, ident)){
-        aField = new CField(ident); // deleted when the dictionary is destroyed
-        CFDictionaryAddValue(_fields, fieldName, aField);
+        aField = new CField(ident); // deleted in the CClass destructor
+        _fields.set(identifier.ustring().rep(), aField);
     }
-
-    CFRelease(fieldName);
     return aField;
 }
 
index 7020c181ae39135181a5f4dd654af2e0f8a4df3d..5f5c21e7aeb5449eae957fc45d4a0f27fe8f291d 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "npruntime.h"
 #include "runtime.h"
+#include <wtf/HashMap.h>
 
 namespace KJS {
 namespace Bindings {
@@ -41,8 +42,8 @@ public:
     virtual ~CClass();
 
     virtual const char* name() const;    
-    virtual MethodList methodsNamed(const char* name, Instance*) const;
-    virtual Field* fieldNamed(const char* name, Instance*) const;
+    virtual MethodList methodsNamed(const Identifier&, Instance*) const;
+    virtual Field* fieldNamed(const Identifier&, Instance*) const;
 
     virtual Constructor* constructorAt(int) const { return 0; }
     virtual int numConstructors() const { return 0; }
@@ -52,8 +53,8 @@ private:
     CClass& operator=(const CClass&); // prohibit assignment
 
     NPClass* _isa;
-    CFMutableDictionaryRef _methods;
-    CFMutableDictionaryRef _fields;
+    mutable MethodMap _methods;
+    mutable FieldMap _fields;
 };
 
 } // namespace Bindings
index b870003c829637f2090669f2407c4bb9f33905c3..a93ff0d7fa27459a1ef7ebeb47cbff247b3562df 100644 (file)
 #include "config.h"
 #include <jni_class.h>
 
+#include "identifier.h"
 #include <jni_utility.h>
 #include <jni_runtime.h>
 
 using namespace KJS::Bindings;
 
-JavaClass::JavaClass (jobject anInstance)
+JavaClass::JavaClass(jobject anInstance)
 {
     jobject aClass = callJNIObjectMethod(anInstance, "getClass", "()Ljava/lang/Class;");
     
     if (!aClass) {
-        fprintf (stderr, "%s:  unable to call getClass on instance %p\n", __PRETTY_FUNCTION__, anInstance);
+        fprintf(stderr, "%s:  unable to call getClass on instance %p\n", __PRETTY_FUNCTION__, anInstance);
         return;
     }
     
     jstring className = (jstring)callJNIObjectMethod(aClass, "getName", "()Ljava/lang/String;");
-    const char *classNameC = getCharactersFromJString (className);
-    _name = strdup (classNameC);
+    const char *classNameC = getCharactersFromJString(className);
+    _name = strdup(classNameC);
     releaseCharactersForJString(className, classNameC);
 
     int i;
     JNIEnv *env = getJNIEnv();
     
     // Get the fields
-    jarray fields = (jarray)callJNIObjectMethod (aClass, "getFields", "()[Ljava/lang/reflect/Field;");
-    int numFields = env->GetArrayLength (fields);    
-    _fields = CFDictionaryCreateMutable(NULL, numFields, &kCFTypeDictionaryKeyCallBacks, &FieldDictionaryValueCallBacks);
+    jarray fields = (jarray)callJNIObjectMethod(aClass, "getFields", "()[Ljava/lang/reflect/Field;");
+    int numFields = env->GetArrayLength(fields);    
     for (i = 0; i < numFields; i++) {
-        jobject aJField = env->GetObjectArrayElement ((jobjectArray)fields, i);
-        Field *aField = new JavaField (env, aJField); // deleted when the dictionary is destroyed
-        CFStringRef fieldName = CFStringCreateWithCString(NULL, aField->name(), kCFStringEncodingASCII);
-        CFDictionaryAddValue ((CFMutableDictionaryRef)_fields, fieldName, aField);
-        CFRelease (fieldName);
-        env->DeleteLocalRef (aJField);
+        jobject aJField = env->GetObjectArrayElement((jobjectArray)fields, i);
+        Field *aField = new JavaField(env, aJField); // deleted in the JavaClass destructor
+        _fields.set(Identifier(aField->name()).ustring().rep(), aField);
+        env->DeleteLocalRef(aJField);
     }
     
     // Get the methods
-    jarray methods = (jarray)callJNIObjectMethod (aClass, "getMethods", "()[Ljava/lang/reflect/Method;");
-    int numMethods = env->GetArrayLength (methods);    
-    _methods = CFDictionaryCreateMutable(NULL, numMethods, &kCFTypeDictionaryKeyCallBacks, &MethodListDictionaryValueCallBacks);
+    jarray methods = (jarray)callJNIObjectMethod(aClass, "getMethods", "()[Ljava/lang/reflect/Method;");
+    int numMethods = env->GetArrayLength(methods);
     for (i = 0; i < numMethods; i++) {
-        jobject aJMethod = env->GetObjectArrayElement ((jobjectArray)methods, i);
-        Method *aMethod = new JavaMethod (env, aJMethod); // deleted when the dictionary is destroyed
-        CFStringRef methodName = CFStringCreateWithCString(NULL, aMethod->name(), kCFStringEncodingASCII);
-        MethodList *methodList = (MethodList *)CFDictionaryGetValue ((CFMutableDictionaryRef)_methods, methodName);
+        jobject aJMethod = env->GetObjectArrayElement((jobjectArray)methods, i);
+        Method *aMethod = new JavaMethod(env, aJMethod); // deleted in the JavaClass destructor
+        MethodList *methodList = _methods.get(Identifier(aMethod->name()).ustring().rep());
         if (!methodList) {
             methodList = new MethodList();
-            CFDictionaryAddValue ((CFMutableDictionaryRef)_methods, methodName, methodList);
+            _methods.set(Identifier(aMethod->name()).ustring().rep(), methodList);
         }
-        methodList->addMethod (aMethod);
-        CFRelease (methodName);
-        env->DeleteLocalRef (aJMethod);
+        methodList->addMethod(aMethod);
+        env->DeleteLocalRef(aJMethod);
     }
     
     // Get the constructors
     jarray constructors = (jarray)callJNIObjectMethod (aClass, "getConstructors", "()[Ljava/lang/reflect/Constructor;");
-    _numConstructors = env->GetArrayLength (constructors);    
+    _numConstructors = env->GetArrayLength(constructors);    
     _constructors = new JavaConstructor[_numConstructors];
     for (i = 0; i < _numConstructors; i++) {
-        jobject aConstructor = env->GetObjectArrayElement ((jobjectArray)constructors, i);
-        _constructors[i] = JavaConstructor (env, aConstructor);
-        env->DeleteLocalRef (aConstructor);
+        jobject aConstructor = env->GetObjectArrayElement((jobjectArray)constructors, i);
+        _constructors[i] = JavaConstructor(env, aConstructor);
+        env->DeleteLocalRef(aConstructor);
     }
 }
 
-JavaClass::~JavaClass () {
+JavaClass::~JavaClass() {
     free((void *)_name);
-    CFRelease (_fields);
-    CFRelease (_methods);
+    deleteAllValues(_fields);
+    
+    MethodListMap::const_iterator end = _methods.end();
+    for (MethodListMap::const_iterator it = _methods.begin(); it != end; ++it) {
+        const MethodList* methodList = it->second;
+        int length = methodList->length();
+        for (int i = 0; i < length; i++)
+            delete methodList->methodAt(i);    
+        delete methodList;
+    }
     delete [] _constructors;
 }
 
-MethodList JavaClass::methodsNamed(const char *name, Instance*) const
+MethodList JavaClass::methodsNamed(const Identifier& identifier, Instance*) const
 {
-    CFStringRef methodName = CFStringCreateWithCString(NULL, name, kCFStringEncodingASCII);
-    MethodList *methodList = (MethodList *)CFDictionaryGetValue(_methods, methodName);
-    CFRelease (methodName);
+    MethodList *methodList = _methods.get(identifier.ustring().rep());
+    
     if (methodList)
         return *methodList;
     return MethodList();
 }
 
-Field *JavaClass::fieldNamed(const char *name, Instance*) const
+Field *JavaClass::fieldNamed(const Identifier& identifier, Instance*) const
 {
-    CFStringRef fieldName = CFStringCreateWithCString(NULL, name, kCFStringEncodingASCII);
-    Field *aField = (Field *)CFDictionaryGetValue(_fields, fieldName);
-    CFRelease (fieldName);
-    return aField;
+    return _fields.get(identifier.ustring().rep());
 }
 
 bool JavaClass::isNumberClass() const
index 65e8823a71a193304cf0142ecf770c675a831e04..8180ffa4bcc9d7e2e582a898fb28be87ce03694e 100644 (file)
@@ -27,6 +27,7 @@
 #define JNI_CLASS_H_
 
 #include <jni_runtime.h>
+#include <wtf/HashMap.h>
 
 namespace KJS {
 
@@ -39,9 +40,9 @@ public:
 
     virtual const char *name() const { return _name; };
     
-    virtual MethodList methodsNamed(const char *name, Instance *instance) const;
+    virtual MethodList methodsNamed(const Identifier&, Instance *instance) const;
     
-    virtual Field *fieldNamed(const char *name, Instance *instance) const;
+    virtual Field *fieldNamed(const Identifier&, Instance *instance) const;
     
     virtual Constructor *constructorAt(int i) const {
         return &_constructors[i]; 
@@ -59,8 +60,8 @@ private:
     JavaClass &operator=(const JavaClass &other); // prevent copying
     
     const char *_name;
-    CFDictionaryRef _fields;
-    CFDictionaryRef _methods;
+    FieldMap _fields;
+    MethodListMap _methods;
     JavaConstructor *_constructors;
     int _numConstructors;
 };
index 5d29ca9ab44f041bf7b67c2517d671a818a574a4..ccd5af8f3d36c6a5b156c968b3c64a81bd34a8f9 100644 (file)
@@ -44,8 +44,8 @@ public:
     
     virtual const char *name() const;
     
-    virtual MethodList methodsNamed(const char *name, Instance *instance) const;
-    virtual Field *fieldNamed(const char *name, Instance *instance) const;
+    virtual MethodList methodsNamed(const Identifier&, Instance *instance) const;
+    virtual Field *fieldNamed(const Identifier&, Instance *instance) const;
 
     virtual JSValue *fallbackObject(ExecState *exec, Instance *instance, const Identifier &propertyName);
     
index a3d2d32c90269daa964f364591c7e9408407c32e..59ab54e57a002a77862da0f95148a5605491c959 100644 (file)
 namespace KJS {
 namespace Bindings {
     
+static void deleteMethod(CFAllocatorRef, const void* value)
+{
+    delete static_cast<const Method*>(value);
+}
+    
+static void deleteField(CFAllocatorRef, const void* value)
+{
+    delete static_cast<const Field*>(value);
+}
+
+const CFDictionaryValueCallBacks MethodDictionaryValueCallBacks = { 0, 0, &deleteMethod, 0 , 0 };
+const CFDictionaryValueCallBacks FieldDictionaryValueCallBacks = { 0, 0, &deleteField, 0 , 0 };    
+    
 ObjcClass::ObjcClass(ClassStructPtr aClass)
 {
     _isa = aClass;
@@ -70,12 +83,12 @@ const char* ObjcClass::name() const
     return object_getClassName(_isa);
 }
 
-MethodList ObjcClass::methodsNamed(const char* JSName, Instance*) const
+MethodList ObjcClass::methodsNamed(const Identifier& identifier, Instance*) const
 {
     MethodList methodList;
     char fixedSizeBuffer[1024];
     char* buffer = fixedSizeBuffer;
-
+    const char* JSName = identifier.ascii();
     if (!convertJSMethodNameToObjc(JSName, buffer, sizeof(fixedSizeBuffer))) {
         int length = strlen(JSName) + 1;
         buffer = new char[length];
@@ -148,10 +161,11 @@ MethodList ObjcClass::methodsNamed(const char* JSName, Instance*) const
     return methodList;
 }
 
-Field* ObjcClass::fieldNamed(const char* name, Instance* instance) const
+Field* ObjcClass::fieldNamed(const Identifier& identifier, Instance* instance) const
 {
     ClassStructPtr thisClass = _isa;
 
+    const char* name = identifier.ascii();
     CFStringRef fieldName = CFStringCreateWithCString(NULL, name, kCFStringEncodingASCII);
     Field* aField = (Field*)CFDictionaryGetValue(_fields, fieldName);
     if (aField) {
index bf52a03744a8418e657d9e671f5fb9b972cdb7dd..c5a86e101f1d043c5c1cdaf61d08e9d77d6b6550 100644 (file)
 
 namespace KJS { namespace Bindings {
 
-void deleteMethodList(CFAllocatorRef, const void* value)
-{
-    const MethodList* methodList = static_cast<const MethodList*>(value);
-    int end = methodList->length();
-    for (int i = 0; i < end; i++)
-        delete methodList->methodAt(i);    
-    delete methodList;
-}
-
-void deleteMethod(CFAllocatorRef, const void* value)
-{
-    delete static_cast<const Method*>(value);
-}
-
-void deleteField(CFAllocatorRef, const void* value)
-{
-    delete static_cast<const Field*>(value);
-}
-
 void MethodList::addMethod(Method *aMethod)
 {
     Method **_newMethods = new Method *[_length + 1];
index 853cd4fd12069c65cdaba5fdc625119236df0410..dd969a5370981a0b022b9836c767433f2461696a 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "value.h"
 
-#include <CoreFoundation/CFDictionary.h>
+#include <wtf/HashMap.h>
 
 namespace KJS  {
 
@@ -110,12 +110,12 @@ class Class
 public:
     virtual const char *name() const = 0;
     
-    virtual MethodList methodsNamed(const char *name, Instance*) const = 0;
+    virtual MethodList methodsNamed(const Identifier&, Instance*) const = 0;
     
     virtual Constructor *constructorAt(int i) const = 0;
     virtual int numConstructors() const = 0;
     
-    virtual Field *fieldNamed(const char *name, Instance*) const = 0;
+    virtual Field *fieldNamed(const Identifier&, Instance*) const = 0;
 
     virtual JSValue* fallbackObject(ExecState*, Instance*, const Identifier&) { return jsUndefined(); }
     
@@ -197,14 +197,10 @@ public:
 
 const char *signatureForParameters(const List&);
 
-void deleteMethodList(CFAllocatorRef, const void* value);
-void deleteMethod(CFAllocatorRef, const void* value);
-void deleteField(CFAllocatorRef, const void* value);
-
-const CFDictionaryValueCallBacks MethodListDictionaryValueCallBacks = { 0, 0, &deleteMethodList, 0 , 0 };
-const CFDictionaryValueCallBacks MethodDictionaryValueCallBacks = { 0, 0, &deleteMethod, 0 , 0 };
-const CFDictionaryValueCallBacks FieldDictionaryValueCallBacks = { 0, 0, &deleteField, 0 , 0 };
-
+typedef HashMap<RefPtr<UString::Rep>, MethodList*> MethodListMap;
+typedef HashMap<RefPtr<UString::Rep>, Method*> MethodMap; 
+typedef HashMap<RefPtr<UString::Rep>, Field*> FieldMap; 
+    
 } // namespace Bindings
 
 } // namespace KJS
index e852851a472d24da9c0ad8abdfe9ddac7ab84a37..96f0b497f396b88ebdc5df59516839bf21a2c966 100644 (file)
@@ -63,7 +63,7 @@ JSValue *RuntimeObjectImp::fieldGetter(ExecState* exec, JSObject*, const Identif
     instance->begin();
 
     Class *aClass = instance->getClass();
-    Field *aField = aClass->fieldNamed(propertyName.ascii(), instance);
+    Field *aField = aClass->fieldNamed(propertyName, instance);
     JSValue *result = instance->getValueOfField(exec, aField); 
     
     instance->end();
@@ -95,7 +95,7 @@ bool RuntimeObjectImp::getOwnPropertySlot(ExecState *exec, const Identifier& pro
     
     if (aClass) {
         // See if the instance has a field with the specified name.
-        Field *aField = aClass->fieldNamed(propertyName.ascii(), instance.get());
+        Field *aField = aClass->fieldNamed(propertyName, instance.get());
         if (aField) {
             slot.setCustom(this, fieldGetter);
             instance->end();
@@ -130,7 +130,7 @@ void RuntimeObjectImp::put(ExecState* exec, const Identifier& propertyName, JSVa
     instance->begin();
 
     // Set the value of the property.
-    Field *aField = instance->getClass()->fieldNamed(propertyName.ascii(), instance.get());
+    Field *aField = instance->getClass()->fieldNamed(propertyName, instance.get());
     if (aField) {
         getInternalInstance()->setValueOfField(exec, aField, value);
     }
@@ -149,7 +149,7 @@ bool RuntimeObjectImp::canPut(ExecState*, const Identifier& propertyName) const
 
     instance->begin();
 
-    Field *aField = instance->getClass()->fieldNamed(propertyName.ascii(), instance.get());
+    Field *aField = instance->getClass()->fieldNamed(propertyName, instance.get());
 
     instance->end();