diff options
Diffstat (limited to 'Source/JavaScriptCore/runtime')
-rw-r--r-- | Source/JavaScriptCore/runtime/Executable.h | 2 | ||||
-rw-r--r-- | Source/JavaScriptCore/runtime/JSGlobalObject.cpp | 12 | ||||
-rw-r--r-- | Source/JavaScriptCore/runtime/JSGlobalObject.h | 3 | ||||
-rw-r--r-- | Source/JavaScriptCore/runtime/JSONObject.cpp | 3 | ||||
-rw-r--r-- | Source/JavaScriptCore/runtime/JSString.h | 11 | ||||
-rw-r--r-- | Source/JavaScriptCore/runtime/WeakGCMap.h | 5 |
6 files changed, 26 insertions, 10 deletions
diff --git a/Source/JavaScriptCore/runtime/Executable.h b/Source/JavaScriptCore/runtime/Executable.h index debb3e369..e999d3a08 100644 --- a/Source/JavaScriptCore/runtime/Executable.h +++ b/Source/JavaScriptCore/runtime/Executable.h @@ -285,7 +285,7 @@ namespace JSC { #endif const SourceCode& source() { return m_source; } - intptr_t sourceID() const { return m_source.provider()->asID(); } + intptr_t sourceID() const { return m_source.providerID(); } const UString& sourceURL() const { return m_source.provider()->url(); } int lineNo() const { return m_firstLine; } int lastLine() const { return m_lastLine; } diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp index 8c8aa9079..86186b7e1 100644 --- a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp +++ b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp @@ -244,8 +244,8 @@ void JSGlobalObject::reset(JSValue prototype) m_methodCallDummy.set(exec->globalData(), this, constructEmptyObject(exec)); - ErrorPrototype* errorPrototype = ErrorPrototype::create(exec, this, ErrorPrototype::createStructure(exec->globalData(), this, m_objectPrototype.get())); - m_errorStructure.set(exec->globalData(), this, ErrorInstance::createStructure(exec->globalData(), this, errorPrototype)); + m_errorPrototype.set(exec->globalData(), this, ErrorPrototype::create(exec, this, ErrorPrototype::createStructure(exec->globalData(), this, m_objectPrototype.get()))); + m_errorStructure.set(exec->globalData(), this, ErrorInstance::createStructure(exec->globalData(), this, m_errorPrototype.get())); // Constructors @@ -259,9 +259,9 @@ void JSGlobalObject::reset(JSValue prototype) m_regExpConstructor.set(exec->globalData(), this, RegExpConstructor::create(exec, this, RegExpConstructor::createStructure(exec->globalData(), this, m_functionPrototype.get()), m_regExpPrototype.get())); - m_errorConstructor.set(exec->globalData(), this, ErrorConstructor::create(exec, this, ErrorConstructor::createStructure(exec->globalData(), this, m_functionPrototype.get()), errorPrototype)); + m_errorConstructor.set(exec->globalData(), this, ErrorConstructor::create(exec, this, ErrorConstructor::createStructure(exec->globalData(), this, m_functionPrototype.get()), m_errorPrototype.get())); - Structure* nativeErrorPrototypeStructure = NativeErrorPrototype::createStructure(exec->globalData(), this, errorPrototype); + Structure* nativeErrorPrototypeStructure = NativeErrorPrototype::createStructure(exec->globalData(), this, m_errorPrototype.get()); Structure* nativeErrorStructure = NativeErrorConstructor::createStructure(exec->globalData(), this, m_functionPrototype.get()); m_evalErrorConstructor.set(exec->globalData(), this, NativeErrorConstructor::create(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "EvalError")); m_rangeErrorConstructor.set(exec->globalData(), this, NativeErrorConstructor::create(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "RangeError")); @@ -278,7 +278,7 @@ void JSGlobalObject::reset(JSValue prototype) m_numberPrototype->putDirectWithoutTransition(exec->globalData(), exec->propertyNames().constructor, numberConstructor, DontEnum); m_datePrototype->putDirectWithoutTransition(exec->globalData(), exec->propertyNames().constructor, dateConstructor, DontEnum); m_regExpPrototype->putDirectWithoutTransition(exec->globalData(), exec->propertyNames().constructor, m_regExpConstructor.get(), DontEnum); - errorPrototype->putDirectWithoutTransition(exec->globalData(), exec->propertyNames().constructor, m_errorConstructor.get(), DontEnum); + m_errorPrototype->putDirectWithoutTransition(exec->globalData(), exec->propertyNames().constructor, m_errorConstructor.get(), DontEnum); putDirectWithoutTransition(exec->globalData(), Identifier(exec, "Object"), objectConstructor, DontEnum); putDirectWithoutTransition(exec->globalData(), Identifier(exec, "Function"), functionConstructor, DontEnum); @@ -374,6 +374,7 @@ void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor) visitIfNeeded(visitor, &thisObject->m_numberPrototype); visitIfNeeded(visitor, &thisObject->m_datePrototype); visitIfNeeded(visitor, &thisObject->m_regExpPrototype); + visitIfNeeded(visitor, &thisObject->m_errorPrototype); visitIfNeeded(visitor, &thisObject->m_argumentsStructure); visitIfNeeded(visitor, &thisObject->m_arrayStructure); @@ -389,6 +390,7 @@ void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor) visitIfNeeded(visitor, &thisObject->m_boundFunctionStructure); visitIfNeeded(visitor, &thisObject->m_namedFunctionStructure); visitIfNeeded(visitor, &thisObject->m_numberObjectStructure); + visitIfNeeded(visitor, &thisObject->m_privateNameStructure); visitIfNeeded(visitor, &thisObject->m_regExpMatchesArrayStructure); visitIfNeeded(visitor, &thisObject->m_regExpStructure); visitIfNeeded(visitor, &thisObject->m_stringObjectStructure); diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.h b/Source/JavaScriptCore/runtime/JSGlobalObject.h index 59b49755b..1e75b7267 100644 --- a/Source/JavaScriptCore/runtime/JSGlobalObject.h +++ b/Source/JavaScriptCore/runtime/JSGlobalObject.h @@ -41,6 +41,7 @@ namespace JSC { class DatePrototype; class Debugger; class ErrorConstructor; + class ErrorPrototype; class FunctionPrototype; class GetterSetter; class GlobalCodeBlock; @@ -117,6 +118,7 @@ namespace JSC { WriteBarrier<NumberPrototype> m_numberPrototype; WriteBarrier<DatePrototype> m_datePrototype; WriteBarrier<RegExpPrototype> m_regExpPrototype; + WriteBarrier<ErrorPrototype> m_errorPrototype; WriteBarrier<Structure> m_argumentsStructure; WriteBarrier<Structure> m_arrayStructure; @@ -252,6 +254,7 @@ namespace JSC { NumberPrototype* numberPrototype() const { return m_numberPrototype.get(); } DatePrototype* datePrototype() const { return m_datePrototype.get(); } RegExpPrototype* regExpPrototype() const { return m_regExpPrototype.get(); } + ErrorPrototype* errorPrototype() const { return m_errorPrototype.get(); } JSObject* methodCallDummy() const { return m_methodCallDummy.get(); } diff --git a/Source/JavaScriptCore/runtime/JSONObject.cpp b/Source/JavaScriptCore/runtime/JSONObject.cpp index de9977d6e..065ae3828 100644 --- a/Source/JavaScriptCore/runtime/JSONObject.cpp +++ b/Source/JavaScriptCore/runtime/JSONObject.cpp @@ -471,6 +471,9 @@ inline Stringifier::Holder::Holder(JSGlobalData& globalData, JSObject* object) : m_object(globalData, object) , m_isArray(object->inherits(&JSArray::s_info)) , m_index(0) +#ifndef NDEBUG + , m_size(0) +#endif { } diff --git a/Source/JavaScriptCore/runtime/JSString.h b/Source/JavaScriptCore/runtime/JSString.h index 5079e8583..111853c39 100644 --- a/Source/JavaScriptCore/runtime/JSString.h +++ b/Source/JavaScriptCore/runtime/JSString.h @@ -200,9 +200,7 @@ namespace JSC { { if (m_index == JSRopeString::s_maxInternalRopeLength) expand(); - m_jsString->m_fibers[m_index++].set(m_globalData, m_jsString, jsString); - m_jsString->m_length += jsString->m_length; - m_jsString->m_is8Bit = m_jsString->m_is8Bit && jsString->m_is8Bit; + m_jsString->append(m_globalData, m_index++, jsString); } JSRopeString* release() @@ -252,6 +250,13 @@ namespace JSC { JSString::finishCreation(globalData); } + void append(JSGlobalData& globalData, size_t index, JSString* jsString) + { + m_fibers[index].set(globalData, this, jsString); + m_length += jsString->m_length; + m_is8Bit = m_is8Bit && jsString->m_is8Bit; + } + static JSRopeString* createNull(JSGlobalData& globalData) { JSRopeString* newString = new (NotNull, allocateCell<JSRopeString>(globalData.heap)) JSRopeString(globalData); diff --git a/Source/JavaScriptCore/runtime/WeakGCMap.h b/Source/JavaScriptCore/runtime/WeakGCMap.h index 98483c312..9e8db4d60 100644 --- a/Source/JavaScriptCore/runtime/WeakGCMap.h +++ b/Source/JavaScriptCore/runtime/WeakGCMap.h @@ -69,7 +69,10 @@ public: ExternalType get(const KeyType& key) const { - return HandleTypes<MappedType>::getFromSlot(const_cast<JSValue*>(&m_map.get(key)->jsValue())); + WeakImpl* impl = m_map.get(key); + if (!impl || impl->state() != WeakImpl::Live) + return ExternalType(); + return HandleTypes<MappedType>::getFromSlot(const_cast<JSValue*>(&impl->jsValue())); } void set(JSGlobalData&, const KeyType& key, ExternalType value) |