JSObject::findPropertyHashEntry() should take VM instead of ExecState.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Mar 2014 04:01:06 +0000 (04:01 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Mar 2014 04:01:06 +0000 (04:01 +0000)
<https://webkit.org/b/129529>

Callers already have VM in a local, and findPropertyHashEntry() only
uses the VM, no need to go all the way through ExecState.

Reviewed by Geoffrey Garen.

* runtime/JSObject.cpp:
(JSC::JSObject::put):
(JSC::JSObject::deleteProperty):
(JSC::JSObject::findPropertyHashEntry):
* runtime/JSObject.h:

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSObject.cpp
Source/JavaScriptCore/runtime/JSObject.h

index c2e13a966299ceb6313d2312645199966ba5eca8..005be1acfec8adf8269b322522c2bd67bcf808aa 100644 (file)
@@ -1,3 +1,19 @@
+2014-02-28  Andreas Kling  <akling@apple.com>
+
+        JSObject::findPropertyHashEntry() should take VM instead of ExecState.
+        <https://webkit.org/b/129529>
+
+        Callers already have VM in a local, and findPropertyHashEntry() only
+        uses the VM, no need to go all the way through ExecState.
+
+        Reviewed by Geoffrey Garen.
+
+        * runtime/JSObject.cpp:
+        (JSC::JSObject::put):
+        (JSC::JSObject::deleteProperty):
+        (JSC::JSObject::findPropertyHashEntry):
+        * runtime/JSObject.h:
+
 2014-02-28  Joseph Pecoraro  <pecoraro@apple.com>
 
         Deadlock remotely inspecting iOS Simulator
index 9b74012309736826e3f1f1ab75e26a179b2d30e0..b0a706e73cdccce599e441f240a682777f8e5a84 100644 (file)
@@ -396,7 +396,7 @@ void JSObject::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSV
         }
         const ClassInfo* info = obj->classInfo();
         if (info->hasStaticSetterOrReadonlyProperties(vm)) {
-            if (const HashEntry* entry = obj->findPropertyHashEntry(exec, propertyName)) {
+            if (const HashEntry* entry = obj->findPropertyHashEntry(vm, propertyName)) {
                 putEntry(exec, entry, obj, propertyName, value, slot);
                 return;
             }
@@ -1273,7 +1273,7 @@ bool JSObject::deleteProperty(JSCell* cell, ExecState* exec, PropertyName proper
     }
 
     // Look in the static hashtable of properties
-    const HashEntry* entry = thisObject->findPropertyHashEntry(exec, propertyName);
+    const HashEntry* entry = thisObject->findPropertyHashEntry(vm, propertyName);
     if (entry) {
         if (entry->attributes() & DontDelete && !vm.isInDefineOwnProperty())
             return false; // this builtin property can't be deleted
@@ -1401,11 +1401,11 @@ JSValue JSObject::defaultValue(const JSObject* object, ExecState* exec, Preferre
     return exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("No default value")));
 }
 
-const HashEntry* JSObject::findPropertyHashEntry(ExecState* exec, PropertyName propertyName) const
+const HashEntry* JSObject::findPropertyHashEntry(VM& vm, PropertyName propertyName) const
 {
     for (const ClassInfo* info = classInfo(); info; info = info->parentClass) {
-        if (const HashTable* propHashTable = info->propHashTable(exec)) {
-            if (const HashEntry* entry = propHashTable->entry(exec, propertyName))
+        if (const HashTable* propHashTable = info->propHashTable(vm)) {
+            if (const HashEntry* entry = propHashTable->entry(vm, propertyName))
                 return entry;
         }
     }
index 104e7567ea086d17c3223911715285c2bc7dbf45..716d4da19de79fbfaad58b4d787a5524896c1987 100644 (file)
@@ -952,7 +952,7 @@ private:
     bool inlineGetOwnPropertySlot(ExecState*, PropertyName, PropertySlot&);
     JS_EXPORT_PRIVATE void fillGetterPropertySlot(PropertySlot&, JSValue, unsigned, PropertyOffset);
 
-    const HashEntry* findPropertyHashEntry(ExecState*, PropertyName) const;
+    const HashEntry* findPropertyHashEntry(VM&, PropertyName) const;
         
     void putIndexedDescriptor(ExecState*, SparseArrayEntry*, const PropertyDescriptor&, PropertyDescriptor& old);