isJSArray should use ArrayType rather than the ClassInfo
https://bugs.webkit.org/show_bug.cgi?id=156551

Reviewed by Filip Pizlo.

Using the JSType rather than the ClassInfo should be slightly faster
since the type is inline on the cell whereas the ClassInfo is only
on the structure.

* runtime/JSArray.h:
(JSC::isJSArray):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@199513 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index f9823ec..9a83243 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,17 @@
+2016-04-13  Keith Miller  <keith_miller@apple.com>
+
+        isJSArray should use ArrayType rather than the ClassInfo
+        https://bugs.webkit.org/show_bug.cgi?id=156551
+
+        Reviewed by Filip Pizlo.
+
+        Using the JSType rather than the ClassInfo should be slightly faster
+        since the type is inline on the cell whereas the ClassInfo is only
+        on the structure.
+
+        * runtime/JSArray.h:
+        (JSC::isJSArray):
+
 2016-04-13  Mark Lam  <mark.lam@apple.com>
 
         ES6: Implement RegExp.prototype[@@search].
diff --git a/Source/JavaScriptCore/runtime/JSArray.h b/Source/JavaScriptCore/runtime/JSArray.h
index 2eb651b..494c7b5 100644
--- a/Source/JavaScriptCore/runtime/JSArray.h
+++ b/Source/JavaScriptCore/runtime/JSArray.h
@@ -287,7 +287,12 @@
     return asArray(value.asCell());
 }
 
-inline bool isJSArray(JSCell* cell) { return cell->classInfo() == JSArray::info(); }
+inline bool isJSArray(JSCell* cell)
+{
+    ASSERT((cell->classInfo() == JSArray::info()) == (cell->type() == ArrayType));
+    return cell->type() == ArrayType;
+}
+
 inline bool isJSArray(JSValue v) { return v.isCell() && isJSArray(v.asCell()); }
 
 inline JSArray* constructArray(ExecState* exec, Structure* arrayStructure, const ArgList& values)