[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:31:21 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 7d078a76c6a32e229f4ee9f876d96d5d557b1b0b
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Aug 15 04:32:46 2002 +0000

    	Another pass of tweaks, including one bug fix.
    
            * kjs/array_object.cpp:
            (ArrayInstanceImp::ArrayInstanceImp): Use malloc, not new.
            (ArrayInstanceImp::get): Use a local variable so we don't rely on the optimizer
    	to avoid indexing twice.
            (ArrayInstanceImp::hasProperty): Use a local variable, and also check against
    	UndefinedImp::staticUndefined rather than doing type() != UndefinedType.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1823 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index d738aa0..d4d30b5 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,14 @@
+2002-08-14  Darin Adler  <darin at apple.com>
+
+	Another pass of tweaks, including one bug fix.
+
+        * kjs/array_object.cpp:
+        (ArrayInstanceImp::ArrayInstanceImp): Use malloc, not new.
+        (ArrayInstanceImp::get): Use a local variable so we don't rely on the optimizer
+	to avoid indexing twice.
+        (ArrayInstanceImp::hasProperty): Use a local variable, and also check against
+	UndefinedImp::staticUndefined rather than doing type() != UndefinedType.
+
 2002-08-14  Maciej Stachowiak  <mjs at apple.com>
 
         Simplified array handling by using NULL to represent empty cells
diff --git a/JavaScriptCore/ChangeLog-2002-12-03 b/JavaScriptCore/ChangeLog-2002-12-03
index d738aa0..d4d30b5 100644
--- a/JavaScriptCore/ChangeLog-2002-12-03
+++ b/JavaScriptCore/ChangeLog-2002-12-03
@@ -1,3 +1,14 @@
+2002-08-14  Darin Adler  <darin at apple.com>
+
+	Another pass of tweaks, including one bug fix.
+
+        * kjs/array_object.cpp:
+        (ArrayInstanceImp::ArrayInstanceImp): Use malloc, not new.
+        (ArrayInstanceImp::get): Use a local variable so we don't rely on the optimizer
+	to avoid indexing twice.
+        (ArrayInstanceImp::hasProperty): Use a local variable, and also check against
+	UndefinedImp::staticUndefined rather than doing type() != UndefinedType.
+
 2002-08-14  Maciej Stachowiak  <mjs at apple.com>
 
         Simplified array handling by using NULL to represent empty cells
diff --git a/JavaScriptCore/ChangeLog-2003-10-25 b/JavaScriptCore/ChangeLog-2003-10-25
index d738aa0..d4d30b5 100644
--- a/JavaScriptCore/ChangeLog-2003-10-25
+++ b/JavaScriptCore/ChangeLog-2003-10-25
@@ -1,3 +1,14 @@
+2002-08-14  Darin Adler  <darin at apple.com>
+
+	Another pass of tweaks, including one bug fix.
+
+        * kjs/array_object.cpp:
+        (ArrayInstanceImp::ArrayInstanceImp): Use malloc, not new.
+        (ArrayInstanceImp::get): Use a local variable so we don't rely on the optimizer
+	to avoid indexing twice.
+        (ArrayInstanceImp::hasProperty): Use a local variable, and also check against
+	UndefinedImp::staticUndefined rather than doing type() != UndefinedType.
+
 2002-08-14  Maciej Stachowiak  <mjs at apple.com>
 
         Simplified array handling by using NULL to represent empty cells
diff --git a/JavaScriptCore/kjs/array_object.cpp b/JavaScriptCore/kjs/array_object.cpp
index dcf2203..0ac4af4 100644
--- a/JavaScriptCore/kjs/array_object.cpp
+++ b/JavaScriptCore/kjs/array_object.cpp
@@ -51,10 +51,10 @@ ArrayInstanceImp::ArrayInstanceImp(const Object &proto, const List &list)
   : ObjectImp(proto)
   , length(list.size())
   , capacity(length)
-  , storage(length ? new (ValueImp *)[length] : 0)
+  , storage(length ? (ValueImp **)malloc(sizeof(ValueImp *) * length) : 0)
 {
   ListIterator it = list.begin();
-  const unsigned l = length;
+  unsigned l = length;
   for (unsigned i = 0; i < l; ++i) {
     storage[i] = (it++).imp();
   }
@@ -62,7 +62,7 @@ ArrayInstanceImp::ArrayInstanceImp(const Object &proto, const List &list)
 
 ArrayInstanceImp::~ArrayInstanceImp()
 {
-  free (storage);
+  free(storage);
 }
 
 Value ArrayInstanceImp::get(ExecState *exec, const UString &propertyName) const
@@ -73,9 +73,10 @@ Value ArrayInstanceImp::get(ExecState *exec, const UString &propertyName) const
   bool ok;
   unsigned index = propertyName.toULong(&ok);
   if (ok) {
-    if (index >= length || storage[index] == NULL)
+    if (index >= length)
       return Undefined();
-    return Value(storage[index]);
+    ValueImp *v = storage[index];
+    return v ? Value(v) : Undefined();
   }
 
   return ObjectImp::get(exec, propertyName);
@@ -83,9 +84,10 @@ Value ArrayInstanceImp::get(ExecState *exec, const UString &propertyName) const
 
 Value ArrayInstanceImp::get(ExecState *exec, unsigned index) const
 {
-  if (index >= length || storage[index] == NULL)
+  if (index >= length)
     return Undefined();
-  return Value(storage[index]);
+  ValueImp *v = storage[index];
+  return v ? Value(v) : Undefined();
 }
 
 // Special implementation of [[Put]] - see ECMA 15.4.5.1
@@ -123,7 +125,8 @@ bool ArrayInstanceImp::hasProperty(ExecState *exec, const UString &propertyName)
   if (ok) {
     if (index >= length)
       return false;
-    return storage[index] != NULL && storage[index]->type() != UndefinedType;
+    ValueImp *v = storage[index];
+    return v && v != UndefinedImp::staticUndefined;
   }
   
   return ObjectImp::hasProperty(exec, propertyName);
@@ -133,7 +136,8 @@ bool ArrayInstanceImp::hasProperty(ExecState *exec, unsigned index) const
 {
   if (index >= length)
     return false;
-  return storage[index] != NULL && storage[index]->type() != UndefinedType;
+  ValueImp *v = storage[index];
+  return v && v != UndefinedImp::staticUndefined;
 }
 
 bool ArrayInstanceImp::deleteProperty(ExecState *exec, const UString &propertyName)
@@ -146,7 +150,7 @@ bool ArrayInstanceImp::deleteProperty(ExecState *exec, const UString &propertyNa
   if (ok) {
     if (index >= length)
       return true;
-    storage[index] = NULL;
+    storage[index] = 0;
     return true;
   }
   
@@ -157,7 +161,7 @@ bool ArrayInstanceImp::deleteProperty(ExecState *exec, unsigned index)
 {
   if (index >= length)
     return true;
-  storage[index] = NULL;
+  storage[index] = 0;
   return true;
 }
 
@@ -178,10 +182,10 @@ void ArrayInstanceImp::setLength(unsigned newLength)
 void ArrayInstanceImp::mark()
 {
   ObjectImp::mark();
-  const unsigned l = length;
+  unsigned l = length;
   for (unsigned i = 0; i < l; ++i) {
     ValueImp *imp = storage[i];
-    if (imp != NULL && !imp->marked())
+    if (imp && !imp->marked())
       imp->mark();
   }
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list