Reviewed by Adele.
authorthatcher <thatcher@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Apr 2006 22:06:06 +0000 (22:06 +0000)
committerthatcher <thatcher@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Apr 2006 22:06:06 +0000 (22:06 +0000)
        Fixes <rdar://problem/4498338> JavaScriptCore fails to compile for ppc64
        Other 64 bit build fixes.

        * kjs/collector.cpp:
        (KJS::Collector::markOtherThreadConservatively): test for __DARWIN_UNIX03 and use __r1
        * kjs/dtoa.cpp:
        (Bigint::): cast PRIVATE_mem to unsigned to prevent warning
        * bindings/jni/jni_utility.cpp:
        (KJS::Bindings::getJavaVM): cast jniError to long to prevent format warning
        (KJS::Bindings::getJNIEnv): cast jniError to long to prevent format warning
        * bindings/runtime_root.cpp:
        (KJS::Bindings::addNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
        (KJS::Bindings::removeNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning

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

JavaScriptCore/ChangeLog
JavaScriptCore/bindings/jni/jni_utility.cpp
JavaScriptCore/bindings/runtime_root.cpp
JavaScriptCore/kjs/collector.cpp
JavaScriptCore/kjs/dtoa.cpp

index ad6cef5ad5729eb58c65125fcbeba8cac6160450..8a137f07e37bba5dcbef92746d781cf2ead0a514 100644 (file)
@@ -1,3 +1,21 @@
+2006-04-03  Timothy Hatcher  <timothy@apple.com>
+
+        Reviewed by Adele.
+
+        Fixes <rdar://problem/4498338> JavaScriptCore fails to compile for ppc64
+        Other 64 bit build fixes.
+
+        * kjs/collector.cpp:
+        (KJS::Collector::markOtherThreadConservatively): test for __DARWIN_UNIX03 and use __r1
+        * kjs/dtoa.cpp:
+        (Bigint::): cast PRIVATE_mem to unsigned to prevent warning
+        * bindings/jni/jni_utility.cpp:
+        (KJS::Bindings::getJavaVM): cast jniError to long to prevent format warning
+        (KJS::Bindings::getJNIEnv): cast jniError to long to prevent format warning
+        * bindings/runtime_root.cpp:
+        (KJS::Bindings::addNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
+        (KJS::Bindings::removeNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
+
 2006-03-31  Darin Adler  <darin@apple.com>
 
         Reviewed by Geoff.
index 094f97355d74747599009984fef1292482620a4c..c57e379681a9dc8f0c6b63ec317de9c401070d10 100644 (file)
@@ -55,7 +55,7 @@ JavaVM *getJavaVM()
         jvm = jvmArray[0];
     }
     else 
-        fprintf(stderr, "%s: JNI_GetCreatedJavaVMs failed, returned %ld\n", __PRETTY_FUNCTION__, jniError);
+        fprintf(stderr, "%s: JNI_GetCreatedJavaVMs failed, returned %ld\n", __PRETTY_FUNCTION__, (long)jniError);
         
     return jvm;
 }
@@ -69,7 +69,7 @@ JNIEnv *getJNIEnv()
     if ( jniError == JNI_OK )
         return env;
     else
-        fprintf(stderr, "%s: AttachCurrentThread failed, returned %ld\n", __PRETTY_FUNCTION__, jniError);
+        fprintf(stderr, "%s: AttachCurrentThread failed, returned %ld\n", __PRETTY_FUNCTION__, (long)jniError);
     return NULL;
 }
 
index d69dd17cc388bad5ff0ea7b6df8d2f6f6fbcc00a..5b0eff9d0296770f6338f82853cbbe822b50b7f0 100644 (file)
@@ -159,7 +159,7 @@ void KJS::Bindings::addNativeReference (const Bindings::RootObject *root, JSObje
     if (root) {
         CFMutableDictionaryRef referencesDictionary = getReferencesDictionary (root);
         
-        unsigned int numReferences = (unsigned int)CFDictionaryGetValue (referencesDictionary, imp);
+        unsigned long numReferences = (unsigned long)CFDictionaryGetValue (referencesDictionary, imp);
         if (numReferences == 0) {
             JSLock lock;
             gcProtect(imp);
@@ -179,7 +179,7 @@ void KJS::Bindings::removeNativeReference (JSObject *imp)
     CFMutableDictionaryRef referencesDictionary = findReferenceDictionary (imp);
 
     if (referencesDictionary) {
-        unsigned int numReferences = (unsigned int)CFDictionaryGetValue (referencesDictionary, imp);
+        unsigned long numReferences = (unsigned long)CFDictionaryGetValue (referencesDictionary, imp);
         if (numReferences == 1) {
             JSLock lock;
             gcUnprotect(imp);
index 19ac73a29afc0d8183a3d5000ba786ce78e4f02b..42d6f241c762a22df4d40dcd48070d14ce39cd62 100644 (file)
@@ -371,6 +371,8 @@ void Collector::markOtherThreadConservatively(Thread *thread)
   // scan the stack
 #if PLATFORM(X86)
   markStackObjectsConservatively((void *)regs.esp, pthread_get_stackaddr_np(thread->posixThread));
+#elif (PLATFORM(PPC) || PLATFORM(PPC64)) && __DARWIN_UNIX03
+  markStackObjectsConservatively((void *)regs.__r1, pthread_get_stackaddr_np(thread->posixThread));
 #elif PLATFORM(PPC) || PLATFORM(PPC64)
   markStackObjectsConservatively((void *)regs.r1, pthread_get_stackaddr_np(thread->posixThread));
 #else
index 0370e5efe4d7dd980c06b9206382d826fe4585df..c8b26716c38dc57d9e39bf05a5e77313e2161f0e 100644 (file)
@@ -527,7 +527,7 @@ Balloc
 #else
                len = (sizeof(Bigint) + (x-1)*sizeof(ULong) + sizeof(double) - 1)
                        /sizeof(double);
-               if (pmem_next - private_mem + len <= PRIVATE_mem) {
+               if (pmem_next - private_mem + len <= (unsigned)PRIVATE_mem) {
                        rv = (Bigint*)pmem_next;
                        pmem_next += len;
                        }