[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75
ggaren at apple.com
ggaren at apple.com
Thu Oct 29 20:42:07 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit b3a125eb59913c2f10a7c058fead9e94301d7b2e
Author: ggaren at apple.com <ggaren at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Oct 8 22:25:14 2009 +0000
Rolled out r49322 and friends because they killed the build
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49328 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 3762ec8..7cf56bd 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,74 +1,3 @@
-2009-10-08 Geoffrey Garen <ggaren at apple.com>
-
- Windows build fix: Added missing #include.
-
- * runtime/JSGlobalData.h:
-
-2009-10-01 Geoffrey Garen <ggaren at apple.com>
-
- Reviewed by Sam Weinig.
-
- Take one branch instead of two to test for JSValue().
-
- 1.1% SunSpider speedup.
-
- * jit/JITCall.cpp:
- (JSC::JIT::compileOpCall):
- * jit/JITOpcodes.cpp:
- (JSC::JIT::emit_op_to_jsnumber):
- (JSC::JIT::emit_op_create_arguments):
- * jit/JITPropertyAccess.cpp:
- (JSC::JIT::emitSlow_op_get_by_val):
- (JSC::JIT::emit_op_put_by_val): Test for the empty value tag, instead
- of testing for the cell tag with a 0 payload.
-
- * runtime/JSValue.cpp:
- (JSC::JSValue::description): Added support for dumping the new empty value,
- and deleted values, in debug builds.
-
- * runtime/JSValue.h:
- (JSC::JSValue::JSValue()): Construct JSValue() with the empty value tag.
-
- (JSC::JSValue::JSValue(JSCell*)): Convert null pointer to the empty value
- tag, to avoid having two different c++ versions of null / empty.
-
- (JSC::JSValue::operator bool): Test for the empty value tag, instead
- of testing for the cell tag with a 0 payload.
-
-2009-10-08 Geoffrey Garen <ggaren at apple.com>
-
- Reviewed by Sam Weinig.
-
- Migrated some code that didn't belong out of Structure.
-
- SunSpider says maybe 1.03x faster.
-
- * runtime/JSCell.h: Nixed Structure::markAggregate, and made marking of
- a Structure's prototype the direct responsility of the object using it.
- (Giving Structure a mark function was misleading because it implied that
- all live structures get marked during GC, when they don't.)
-
- * runtime/JSGlobalObject.cpp:
- (JSC::markIfNeeded):
- (JSC::JSGlobalObject::markChildren): Added code to mark prototypes stored
- on the global object. Maybe this wasn't necessary, but now we don't have
- to wonder.
-
- * runtime/JSObject.cpp:
- (JSC::JSObject::getPropertyNames):
- (JSC::JSObject::getOwnPropertyNames):
- (JSC::JSObject::getEnumerableNamesFromClassInfoTable):
- * runtime/JSObject.h:
- (JSC::JSObject::markChildrenDirect):
- * runtime/PropertyNameArray.h:
- * runtime/Structure.cpp:
- * runtime/Structure.h:
- (JSC::Structure::setEnumerationCache):
- (JSC::Structure::enumerationCache): Moved property name gathering code
- from Structure to JSObject because having a Structure iterate its JSObject
- was a layering violation. A JSObject is implemented using a Structure; not
- the other way around.
-
2009-10-08 Zoltan Herczeg <zherczeg at inf.u-szeged.hu>
Reviewed by Gavin Barraclough.
diff --git a/JavaScriptCore/runtime/JSCell.h b/JavaScriptCore/runtime/JSCell.h
index 79b7953..503c6c4 100644
--- a/JavaScriptCore/runtime/JSCell.h
+++ b/JavaScriptCore/runtime/JSCell.h
@@ -342,6 +342,11 @@ namespace JSC {
append(value.asCell());
}
+ inline void Structure::markAggregate(MarkStack& markStack)
+ {
+ markStack.append(m_prototype);
+ }
+
inline Heap* Heap::heap(JSValue v)
{
if (!v.isCell())
diff --git a/JavaScriptCore/runtime/JSGlobalData.h b/JavaScriptCore/runtime/JSGlobalData.h
index 709122c..3ad90ad 100644
--- a/JavaScriptCore/runtime/JSGlobalData.h
+++ b/JavaScriptCore/runtime/JSGlobalData.h
@@ -36,7 +36,6 @@
#include "MarkStack.h"
#include "NumericStrings.h"
#include "SmallStrings.h"
-#include "Structure.h"
#include "TimeoutChecker.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
diff --git a/JavaScriptCore/runtime/JSGlobalObject.cpp b/JavaScriptCore/runtime/JSGlobalObject.cpp
index 6b6e6d9..3bb281e 100644
--- a/JavaScriptCore/runtime/JSGlobalObject.cpp
+++ b/JavaScriptCore/runtime/JSGlobalObject.cpp
@@ -89,7 +89,7 @@ static inline void markIfNeeded(MarkStack& markStack, JSValue v)
static inline void markIfNeeded(MarkStack& markStack, const RefPtr<Structure>& s)
{
if (s)
- markIfNeeded(markStack, s->storedPrototype());
+ s->markAggregate(markStack);
}
JSGlobalObject::~JSGlobalObject()
@@ -394,21 +394,6 @@ void JSGlobalObject::markChildren(MarkStack& markStack)
markIfNeeded(markStack, d()->methodCallDummy);
markIfNeeded(markStack, d()->errorStructure);
- markIfNeeded(markStack, d()->argumentsStructure);
- markIfNeeded(markStack, d()->arrayStructure);
- markIfNeeded(markStack, d()->booleanObjectStructure);
- markIfNeeded(markStack, d()->callbackConstructorStructure);
- markIfNeeded(markStack, d()->callbackFunctionStructure);
- markIfNeeded(markStack, d()->callbackObjectStructure);
- markIfNeeded(markStack, d()->dateStructure);
- markIfNeeded(markStack, d()->emptyObjectStructure);
- markIfNeeded(markStack, d()->errorStructure);
- markIfNeeded(markStack, d()->functionStructure);
- markIfNeeded(markStack, d()->numberObjectStructure);
- markIfNeeded(markStack, d()->prototypeFunctionStructure);
- markIfNeeded(markStack, d()->regExpMatchesArrayStructure);
- markIfNeeded(markStack, d()->regExpStructure);
- markIfNeeded(markStack, d()->stringObjectStructure);
// No need to mark the other structures, because their prototypes are all
// guaranteed to be referenced elsewhere.
diff --git a/JavaScriptCore/runtime/JSObject.cpp b/JavaScriptCore/runtime/JSObject.cpp
index 90c36aa..db2a9b2 100644
--- a/JavaScriptCore/runtime/JSObject.cpp
+++ b/JavaScriptCore/runtime/JSObject.cpp
@@ -42,25 +42,6 @@ namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(JSObject);
-static inline void getEnumerablePropertyNames(ExecState* exec, const ClassInfo* classInfo, PropertyNameArray& propertyNames)
-{
- // Add properties from the static hashtables of properties
- for (; classInfo; classInfo = classInfo->parentClass) {
- const HashTable* table = classInfo->propHashTable(exec);
- if (!table)
- continue;
- table->initializeIfNeeded(exec);
- ASSERT(table->table);
-
- int hashSizeMask = table->compactSize - 1;
- const HashEntry* entry = table->table;
- for (int i = 0; i <= hashSizeMask; ++i, ++entry) {
- if (entry->key() && !(entry->attributes() & DontEnum))
- propertyNames.add(entry->key());
- }
- }
-}
-
void JSObject::markChildren(MarkStack& markStack)
{
#ifndef NDEBUG
@@ -443,52 +424,12 @@ bool JSObject::getPropertySpecificValue(ExecState*, const Identifier& propertyNa
void JSObject::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames)
{
- bool shouldCache = propertyNames.shouldCache() && !(propertyNames.size() || m_structure->isDictionary());
-
- if (shouldCache) {
- if (PropertyNameArrayData* data = m_structure->enumerationCache()) {
- if (data->cachedPrototypeChain() == m_structure->prototypeChain(exec)) {
- propertyNames.setData(data);
- return;
- }
-
- m_structure->clearEnumerationCache();
- }
- }
-
- getOwnPropertyNames(exec, propertyNames);
-
- if (prototype().isObject()) {
- propertyNames.setShouldCache(false); // No need for our prototypes to waste memory on caching, since they're not being enumerated directly.
- JSObject* prototype = asObject(this->prototype());
- while(1) {
- if (!prototype->structure()->typeInfo().hasDefaultGetPropertyNames()) {
- prototype->getPropertyNames(exec, propertyNames);
- break;
- }
- prototype->getOwnPropertyNames(exec, propertyNames);
- JSValue nextProto = prototype->prototype();
- if (!nextProto.isObject())
- break;
- prototype = asObject(nextProto);
- }
- }
-
- if (shouldCache) {
- StructureChain* protoChain = m_structure->prototypeChain(exec);
- if (!protoChain->isCacheable())
- return;
- RefPtr<PropertyNameArrayData> data = propertyNames.data();
- data->setCachedPrototypeChain(protoChain);
- data->setCachedStructure(m_structure);
- m_structure->setEnumerationCache(data.release());
- }
+ m_structure->getEnumerablePropertyNames(exec, propertyNames, this);
}
void JSObject::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames)
{
- m_structure->getEnumerablePropertyNames(propertyNames);
- getEnumerablePropertyNames(exec, classInfo(), propertyNames);
+ m_structure->getOwnEnumerablePropertyNames(exec, propertyNames, this);
}
bool JSObject::toBoolean(ExecState*) const
diff --git a/JavaScriptCore/runtime/JSObject.h b/JavaScriptCore/runtime/JSObject.h
index dc40a63..84b5f4b 100644
--- a/JavaScriptCore/runtime/JSObject.h
+++ b/JavaScriptCore/runtime/JSObject.h
@@ -682,7 +682,7 @@ ALWAYS_INLINE void JSObject::markChildrenDirect(MarkStack& markStack)
{
JSCell::markChildren(markStack);
- markStack.append(prototype());
+ m_structure->markAggregate(markStack);
PropertyStorage storage = propertyStorage();
size_t storageSize = m_structure->propertyStorageSize();
diff --git a/JavaScriptCore/runtime/PropertyNameArray.h b/JavaScriptCore/runtime/PropertyNameArray.h
index 77fbac8..afcc83f 100644
--- a/JavaScriptCore/runtime/PropertyNameArray.h
+++ b/JavaScriptCore/runtime/PropertyNameArray.h
@@ -23,13 +23,11 @@
#include "CallFrame.h"
#include "Identifier.h"
-#include "StructureChain.h"
+#include "Structure.h"
#include <wtf/HashSet.h>
#include <wtf/Vector.h>
namespace JSC {
-
- class Structure;
class PropertyNameArrayData : public RefCounted<PropertyNameArrayData> {
public:
diff --git a/JavaScriptCore/runtime/Structure.cpp b/JavaScriptCore/runtime/Structure.cpp
index 643a49a..7209b5f 100644
--- a/JavaScriptCore/runtime/Structure.cpp
+++ b/JavaScriptCore/runtime/Structure.cpp
@@ -282,6 +282,52 @@ void Structure::materializePropertyMap()
}
}
+void Structure::getOwnEnumerablePropertyNames(ExecState* exec, PropertyNameArray& propertyNames, JSObject* baseObject)
+{
+ getEnumerableNamesFromPropertyTable(propertyNames);
+ getEnumerableNamesFromClassInfoTable(exec, baseObject->classInfo(), propertyNames);
+}
+
+void Structure::getEnumerablePropertyNames(ExecState* exec, PropertyNameArray& propertyNames, JSObject* baseObject)
+{
+ bool shouldCache = propertyNames.shouldCache() && !(propertyNames.size() || isDictionary());
+
+ if (shouldCache && m_cachedPropertyNameArrayData) {
+ if (m_cachedPropertyNameArrayData->cachedPrototypeChain() == prototypeChain(exec)) {
+ propertyNames.setData(m_cachedPropertyNameArrayData);
+ return;
+ }
+ clearEnumerationCache();
+ }
+
+ baseObject->getOwnPropertyNames(exec, propertyNames);
+
+ if (m_prototype.isObject()) {
+ propertyNames.setShouldCache(false); // No need for our prototypes to waste memory on caching, since they're not being enumerated directly.
+ JSObject* prototype = asObject(m_prototype);
+ while(1) {
+ if (!prototype->structure()->typeInfo().hasDefaultGetPropertyNames()) {
+ prototype->getPropertyNames(exec, propertyNames);
+ break;
+ }
+ prototype->getOwnPropertyNames(exec, propertyNames);
+ JSValue nextProto = prototype->prototype();
+ if (!nextProto.isObject())
+ break;
+ prototype = asObject(nextProto);
+ }
+ }
+
+ if (shouldCache) {
+ StructureChain* protoChain = prototypeChain(exec);
+ m_cachedPropertyNameArrayData = propertyNames.data();
+ if (!protoChain->isCacheable())
+ return;
+ m_cachedPropertyNameArrayData->setCachedPrototypeChain(protoChain);
+ m_cachedPropertyNameArrayData->setCachedStructure(this);
+ }
+}
+
void Structure::clearEnumerationCache()
{
if (m_cachedPropertyNameArrayData)
@@ -1011,7 +1057,7 @@ static int comparePropertyMapEntryIndices(const void* a, const void* b)
return 0;
}
-void Structure::getEnumerablePropertyNames(PropertyNameArray& propertyNames)
+void Structure::getEnumerableNamesFromPropertyTable(PropertyNameArray& propertyNames)
{
materializePropertyMapIfNecessary();
if (!m_propertyTable)
@@ -1068,6 +1114,25 @@ void Structure::getEnumerablePropertyNames(PropertyNameArray& propertyNames)
}
}
+void Structure::getEnumerableNamesFromClassInfoTable(ExecState* exec, const ClassInfo* classInfo, PropertyNameArray& propertyNames)
+{
+ // Add properties from the static hashtables of properties
+ for (; classInfo; classInfo = classInfo->parentClass) {
+ const HashTable* table = classInfo->propHashTable(exec);
+ if (!table)
+ continue;
+ table->initializeIfNeeded(exec);
+ ASSERT(table->table);
+
+ int hashSizeMask = table->compactSize - 1;
+ const HashEntry* entry = table->table;
+ for (int i = 0; i <= hashSizeMask; ++i, ++entry) {
+ if (entry->key() && !(entry->attributes() & DontEnum))
+ propertyNames.add(entry->key());
+ }
+ }
+}
+
#if DO_PROPERTYMAP_CONSTENCY_CHECK
void Structure::checkConsistency()
diff --git a/JavaScriptCore/runtime/Structure.h b/JavaScriptCore/runtime/Structure.h
index a027b1a..ed9f6e5 100644
--- a/JavaScriptCore/runtime/Structure.h
+++ b/JavaScriptCore/runtime/Structure.h
@@ -30,7 +30,6 @@
#include "JSType.h"
#include "JSValue.h"
#include "PropertyMapHashTable.h"
-#include "PropertyNameArray.h"
#include "StructureChain.h"
#include "StructureTransitionTable.h"
#include "JSTypeInfo.h"
@@ -77,6 +76,8 @@ namespace JSC {
~Structure();
+ void markAggregate(MarkStack&);
+
// These should be used with caution.
size_t addPropertyWithoutTransition(const Identifier& propertyName, unsigned attributes, JSCell* specificValue);
size_t removePropertyWithoutTransition(const Identifier& propertyName);
@@ -115,6 +116,9 @@ namespace JSC {
return hasTransition(propertyName._ustring.rep(), attributes);
}
+ void getEnumerablePropertyNames(ExecState*, PropertyNameArray&, JSObject*);
+ void getOwnEnumerablePropertyNames(ExecState*, PropertyNameArray&, JSObject*);
+
bool hasGetterSetterProperties() const { return m_hasGetterSetterProperties; }
void setHasGetterSetterProperties(bool hasGetterSetterProperties) { m_hasGetterSetterProperties = hasGetterSetterProperties; }
@@ -123,11 +127,6 @@ namespace JSC {
JSCell* specificValue() { return m_specificValueInPrevious; }
void despecifyDictionaryFunction(const Identifier& propertyName);
- void setEnumerationCache(PassRefPtr<PropertyNameArrayData> data) { m_cachedPropertyNameArrayData = data; }
- PropertyNameArrayData* enumerationCache() { return m_cachedPropertyNameArrayData.get(); }
- void clearEnumerationCache();
- void getEnumerablePropertyNames(PropertyNameArray&);
-
private:
Structure(JSValue prototype, const TypeInfo&);
@@ -141,6 +140,8 @@ namespace JSC {
size_t put(const Identifier& propertyName, unsigned attributes, JSCell* specificValue);
size_t remove(const Identifier& propertyName);
void addAnonymousSlots(unsigned slotCount);
+ void getEnumerableNamesFromPropertyTable(PropertyNameArray&);
+ void getEnumerableNamesFromClassInfoTable(ExecState*, const ClassInfo*, PropertyNameArray&);
void expandPropertyMapHashTable();
void rehashPropertyMapHashTable();
@@ -161,6 +162,8 @@ namespace JSC {
materializePropertyMap();
}
+ void clearEnumerationCache();
+
signed char transitionCount() const
{
// Since the number of transitions is always the same as m_offset, we keep the size of Structure down by not storing both.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list