Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (97893 => 97894)
--- trunk/Source/_javascript_Core/ChangeLog 2011-10-19 23:31:12 UTC (rev 97893)
+++ trunk/Source/_javascript_Core/ChangeLog 2011-10-19 23:55:48 UTC (rev 97894)
@@ -1,3 +1,23 @@
+2011-10-19 Geoffrey Garen <[email protected]>
+
+ Removed StringImplBase, fusing it into StringImpl
+ https://bugs.webkit.org/show_bug.cgi?id=70443
+
+ Reviewed by Gavin Barraclough.
+
+ * GNUmakefile.list.am:
+ * _javascript_Core.gypi:
+ * _javascript_Core.order:
+ * _javascript_Core.vcproj/WTF/WTF.vcproj:
+ * _javascript_Core.xcodeproj/project.pbxproj:
+ * wtf/CMakeLists.txt:
+ * wtf/text/StringImpl.h:
+ (WTF::StringImpl::StringImpl):
+ (WTF::StringImpl::ref):
+ (WTF::StringImpl::length):
+ * wtf/text/StringImplBase.h: Removed.
+ * wtf/wtf.pri: Removed!
+
2011-10-19 Mark Hahnenberg <[email protected]>
Add getConstructData to the MethodTable
Modified: trunk/Source/_javascript_Core/GNUmakefile.list.am (97893 => 97894)
--- trunk/Source/_javascript_Core/GNUmakefile.list.am 2011-10-19 23:31:12 UTC (rev 97893)
+++ trunk/Source/_javascript_Core/GNUmakefile.list.am 2011-10-19 23:55:48 UTC (rev 97894)
@@ -626,7 +626,6 @@
Source/_javascript_Core/wtf/text/StringBuilder.h \
Source/_javascript_Core/wtf/text/StringConcatenate.h \
Source/_javascript_Core/wtf/text/StringHash.h \
- Source/_javascript_Core/wtf/text/StringImplBase.h \
Source/_javascript_Core/wtf/text/StringImpl.cpp \
Source/_javascript_Core/wtf/text/StringImpl.h \
Source/_javascript_Core/wtf/text/StringOperators.h \
Modified: trunk/Source/_javascript_Core/_javascript_Core.gypi (97893 => 97894)
--- trunk/Source/_javascript_Core/_javascript_Core.gypi 2011-10-19 23:31:12 UTC (rev 97893)
+++ trunk/Source/_javascript_Core/_javascript_Core.gypi 2011-10-19 23:55:48 UTC (rev 97894)
@@ -239,7 +239,6 @@
'wtf/text/StringConcatenate.h',
'wtf/text/StringHash.h',
'wtf/text/StringImpl.h',
- 'wtf/text/StringImplBase.h',
'wtf/text/StringOperators.h',
'wtf/text/TextPosition.h',
'wtf/text/WTFString.h',
Modified: trunk/Source/_javascript_Core/_javascript_Core.order (97893 => 97894)
--- trunk/Source/_javascript_Core/_javascript_Core.order 2011-10-19 23:31:12 UTC (rev 97893)
+++ trunk/Source/_javascript_Core/_javascript_Core.order 2011-10-19 23:55:48 UTC (rev 97894)
@@ -2002,7 +2002,6 @@
__ZN3JSC10ASTBuilder19makeURightShiftNodeEPNS_14ExpressionNodeES2_b
__ZN3JSC3JIT15emit_op_urshiftEPNS_11InstructionE
__ZN3JSC3JIT19emitSlow_op_urshiftEPNS_11InstructionERPNS_13SlowCaseEntryE
-__ZN3WTF6VectorIPNS_14StringImplBaseELm32EE14expandCapacityEm
_cti_op_urshift
_cti_op_bitand
_cti_op_div
Modified: trunk/Source/_javascript_Core/_javascript_Core.vcproj/WTF/WTF.vcproj (97893 => 97894)
--- trunk/Source/_javascript_Core/_javascript_Core.vcproj/WTF/WTF.vcproj 2011-10-19 23:31:12 UTC (rev 97893)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcproj/WTF/WTF.vcproj 2011-10-19 23:55:48 UTC (rev 97894)
@@ -492,10 +492,6 @@
>
</File>
<File
- RelativePath="..\..\wtf\text\StringImplBase.h"
- >
- </File>
- <File
RelativePath="..\..\wtf\text\StringOperators.h"
>
</File>
Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (97893 => 97894)
--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2011-10-19 23:31:12 UTC (rev 97893)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2011-10-19 23:55:48 UTC (rev 97894)
@@ -337,7 +337,6 @@
86AE6C4D136A11E400963012 /* DFGFPRInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AE6C4B136A11E400963012 /* DFGFPRInfo.h */; };
86AE6C4E136A11E400963012 /* DFGGPRInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AE6C4C136A11E400963012 /* DFGGPRInfo.h */; };
86B99AE3117E578100DF5A90 /* StringBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B99AE1117E578100DF5A90 /* StringBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 86B99AE4117E578100DF5A90 /* StringImplBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B99AE2117E578100DF5A90 /* StringImplBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
86BB09C0138E381B0056702F /* DFGRepatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86BB09BE138E381B0056702F /* DFGRepatch.cpp */; };
86BB09C1138E381B0056702F /* DFGRepatch.h in Headers */ = {isa = PBXBuildFile; fileRef = 86BB09BF138E381B0056702F /* DFGRepatch.h */; };
86C36EEA0EE1289D00B3DF59 /* MacroAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C36EE90EE1289D00B3DF59 /* MacroAssembler.h */; };
@@ -1114,7 +1113,6 @@
86AE6C4B136A11E400963012 /* DFGFPRInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGFPRInfo.h; path = dfg/DFGFPRInfo.h; sourceTree = "<group>"; };
86AE6C4C136A11E400963012 /* DFGGPRInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGGPRInfo.h; path = dfg/DFGGPRInfo.h; sourceTree = "<group>"; };
86B99AE1117E578100DF5A90 /* StringBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringBuffer.h; path = text/StringBuffer.h; sourceTree = "<group>"; };
- 86B99AE2117E578100DF5A90 /* StringImplBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringImplBase.h; path = text/StringImplBase.h; sourceTree = "<group>"; };
86BB09BE138E381B0056702F /* DFGRepatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGRepatch.cpp; path = dfg/DFGRepatch.cpp; sourceTree = "<group>"; };
86BB09BF138E381B0056702F /* DFGRepatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGRepatch.h; path = dfg/DFGRepatch.h; sourceTree = "<group>"; };
86C36EE90EE1289D00B3DF59 /* MacroAssembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssembler.h; sourceTree = "<group>"; };
@@ -2259,7 +2257,6 @@
868BFA05117CEFD100B908B1 /* StringHash.h */,
868BFA06117CEFD100B908B1 /* StringImpl.cpp */,
868BFA07117CEFD100B908B1 /* StringImpl.h */,
- 86B99AE2117E578100DF5A90 /* StringImplBase.h */,
718A8482134F3A1200B87529 /* StringOperators.h */,
8626BECE11928E3900782FAB /* StringStatics.cpp */,
F3BD31D0126730180065467F /* TextPosition.h */,
@@ -2798,7 +2795,6 @@
868BFA0D117CEFD100B908B1 /* StringHash.h in Headers */,
5D63E9AD10F2BD6E00FC8AE9 /* StringHasher.h in Headers */,
868BFA0F117CEFD100B908B1 /* StringImpl.h in Headers */,
- 86B99AE4117E578100DF5A90 /* StringImplBase.h in Headers */,
71DA9D82134F3F3D00B767E7 /* StringOperators.h in Headers */,
BC18C4680E16F5CD00B34460 /* StringObject.h in Headers */,
BC18C46A0E16F5CD00B34460 /* StringPrototype.h in Headers */,
Modified: trunk/Source/_javascript_Core/wtf/CMakeLists.txt (97893 => 97894)
--- trunk/Source/_javascript_Core/wtf/CMakeLists.txt 2011-10-19 23:31:12 UTC (rev 97893)
+++ trunk/Source/_javascript_Core/wtf/CMakeLists.txt 2011-10-19 23:55:48 UTC (rev 97894)
@@ -133,7 +133,6 @@
text/StringBuffer.h
text/StringHash.h
text/StringImpl.h
- text/StringImplBase.h
text/WTFString.h
threads/BinarySemaphore.h
Modified: trunk/Source/_javascript_Core/wtf/text/StringImpl.h (97893 => 97894)
--- trunk/Source/_javascript_Core/wtf/text/StringImpl.h 2011-10-19 23:31:12 UTC (rev 97893)
+++ trunk/Source/_javascript_Core/wtf/text/StringImpl.h 2011-10-19 23:55:48 UTC (rev 97894)
@@ -31,7 +31,6 @@
#include <wtf/StdLibExtras.h>
#include <wtf/StringHasher.h>
#include <wtf/Vector.h>
-#include <wtf/text/StringImplBase.h>
#include <wtf/unicode/Unicode.h>
#if USE(CF)
@@ -63,7 +62,8 @@
typedef bool (*CharacterMatchFunctionPtr)(UChar);
typedef bool (*IsWhiteSpaceFunctionPtr)(UChar);
-class StringImpl : public StringImplBase {
+class StringImpl {
+ WTF_MAKE_NONCOPYABLE(StringImpl); WTF_MAKE_FAST_ALLOCATED;
friend struct JSC::IdentifierCStringTranslator;
friend struct JSC::IdentifierUCharBufferTranslator;
friend struct WTF::CStringTranslator;
@@ -71,12 +71,22 @@
friend struct WTF::HashAndUTF8CharactersTranslator;
friend struct WTF::UCharBufferTranslator;
friend class AtomicStringImpl;
+
private:
+ enum BufferOwnership {
+ BufferInternal,
+ BufferOwned,
+ BufferSubstring,
+ BufferShared,
+ };
+
// Used to construct static strings, which have an special refCount that can never hit zero.
// This means that the static string will never be destroyed, which is important because
// static strings will be shared across threads & ref-counted in a non-threadsafe manner.
+ enum StaticStringConstructType { ConstructStaticString };
StringImpl(const UChar* characters, unsigned length, StaticStringConstructType)
- : StringImplBase(length, ConstructStaticString)
+ : m_refCountAndFlags(s_refCountFlagStatic | s_refCountFlagIsIdentifier | BufferOwned)
+ , m_length(length)
, m_data(characters)
, m_buffer(0)
, m_hash(0)
@@ -89,7 +99,8 @@
// Create a normal string with internal storage (BufferInternal)
StringImpl(unsigned length)
- : StringImplBase(length, BufferInternal)
+ : m_refCountAndFlags(s_refCountIncrement | s_refCountFlagShouldReportedCost | BufferInternal)
+ , m_length(length)
, m_data(reinterpret_cast<const UChar*>(this + 1))
, m_buffer(0)
, m_hash(0)
@@ -100,7 +111,8 @@
// Create a StringImpl adopting ownership of the provided buffer (BufferOwned)
StringImpl(const UChar* characters, unsigned length)
- : StringImplBase(length, BufferOwned)
+ : m_refCountAndFlags(s_refCountIncrement | s_refCountFlagShouldReportedCost | BufferOwned)
+ , m_length(length)
, m_data(characters)
, m_buffer(0)
, m_hash(0)
@@ -111,7 +123,8 @@
// Used to create new strings that are a substring of an existing StringImpl (BufferSubstring)
StringImpl(const UChar* characters, unsigned length, PassRefPtr<StringImpl> base)
- : StringImplBase(length, BufferSubstring)
+ : m_refCountAndFlags(s_refCountIncrement | s_refCountFlagShouldReportedCost | BufferSubstring)
+ , m_length(length)
, m_data(characters)
, m_substringBuffer(base.leakRef())
, m_hash(0)
@@ -123,7 +136,8 @@
// Used to construct new strings sharing an existing SharedUChar (BufferShared)
StringImpl(const UChar* characters, unsigned length, PassRefPtr<SharedUChar> sharedBuffer)
- : StringImplBase(length, BufferShared)
+ : m_refCountAndFlags(s_refCountIncrement | s_refCountFlagShouldReportedCost | BufferShared)
+ , m_length(length)
, m_data(characters)
, m_sharedBuffer(sharedBuffer.leakRef())
, m_hash(0)
@@ -203,6 +217,8 @@
}
static PassRefPtr<StringImpl> adopt(StringBuffer&);
+ void ref() { m_refCountAndFlags += s_refCountIncrement; }
+ unsigned length() const { return m_length; }
SharedUChar* sharedBuffer();
const UChar* characters() const { return m_data; }
@@ -340,6 +356,20 @@
template <class UCharPredicate> PassRefPtr<StringImpl> stripMatchedCharacters(UCharPredicate);
template <class UCharPredicate> PassRefPtr<StringImpl> simplifyMatchedCharactersToSpace(UCharPredicate);
+ // The bottom 7 bits hold flags, the top 25 bits hold the ref count.
+ // When dereferencing StringImpls we check for the ref count AND the
+ // static bit both being zero - static strings are never deleted.
+ static const unsigned s_refCountMask = 0xFFFFFF80;
+ static const unsigned s_refCountIncrement = 0x80;
+ static const unsigned s_refCountFlagStatic = 0x40;
+ static const unsigned s_refCountFlagHasTerminatingNullCharacter = 0x20;
+ static const unsigned s_refCountFlagIsAtomic = 0x10;
+ static const unsigned s_refCountFlagShouldReportedCost = 0x8;
+ static const unsigned s_refCountFlagIsIdentifier = 0x4;
+ static const unsigned s_refCountMaskBufferOwnership = 0x3;
+
+ unsigned m_refCountAndFlags;
+ unsigned m_length;
const UChar* m_data;
union {
void* m_buffer;
Deleted: trunk/Source/_javascript_Core/wtf/text/StringImplBase.h (97893 => 97894)
--- trunk/Source/_javascript_Core/wtf/text/StringImplBase.h 2011-10-19 23:31:12 UTC (rev 97893)
+++ trunk/Source/_javascript_Core/wtf/text/StringImplBase.h 2011-10-19 23:55:48 UTC (rev 97894)
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef StringImplBase_h
-#define StringImplBase_h
-
-#include <wtf/unicode/Unicode.h>
-
-namespace WTF {
-
-class StringImplBase {
- WTF_MAKE_NONCOPYABLE(StringImplBase); WTF_MAKE_FAST_ALLOCATED;
-public:
- unsigned length() const { return m_length; }
- void ref() { m_refCountAndFlags += s_refCountIncrement; }
-
-protected:
- enum BufferOwnership {
- BufferInternal,
- BufferOwned,
- BufferSubstring,
- BufferShared,
- };
-
- // For SmallStringStorage, which allocates an array and uses an in-place new.
- StringImplBase() { }
-
- StringImplBase(unsigned length, BufferOwnership ownership)
- : m_refCountAndFlags(s_refCountIncrement | s_refCountFlagShouldReportedCost | ownership)
- , m_length(length)
- {
- }
-
- enum StaticStringConstructType { ConstructStaticString };
- StringImplBase(unsigned length, StaticStringConstructType)
- : m_refCountAndFlags(s_refCountFlagStatic | s_refCountFlagIsIdentifier | BufferOwned)
- , m_length(length)
- {
- }
-
- // The bottom 7 bits hold flags, the top 25 bits hold the ref count.
- // When dereferencing StringImpls we check for the ref count AND the
- // static bit both being zero - static strings are never deleted.
- static const unsigned s_refCountMask = 0xFFFFFF80;
- static const unsigned s_refCountIncrement = 0x80;
- static const unsigned s_refCountFlagStatic = 0x40;
- static const unsigned s_refCountFlagHasTerminatingNullCharacter = 0x20;
- static const unsigned s_refCountFlagIsAtomic = 0x10;
- static const unsigned s_refCountFlagShouldReportedCost = 0x8;
- static const unsigned s_refCountFlagIsIdentifier = 0x4;
- static const unsigned s_refCountMaskBufferOwnership = 0x3;
-
- unsigned m_refCountAndFlags;
- unsigned m_length;
-};
-
-} // namespace WTF
-
-using WTF::StringImplBase;
-
-#endif
Modified: trunk/Source/_javascript_Core/wtf/wtf.pri (97893 => 97894)
--- trunk/Source/_javascript_Core/wtf/wtf.pri 2011-10-19 23:31:12 UTC (rev 97893)
+++ trunk/Source/_javascript_Core/wtf/wtf.pri 2011-10-19 23:55:48 UTC (rev 97894)
@@ -109,7 +109,6 @@
wtf/text/StringBuilder.h \
wtf/text/StringConcatenate.h \
wtf/text/StringHash.h \
- wtf/text/StringImplBase.h \
wtf/text/StringImpl.h \
wtf/text/StringOperators.h \
wtf/text/TextPosition.h \
Modified: trunk/Source/_javascript_Glue/ChangeLog (97893 => 97894)
--- trunk/Source/_javascript_Glue/ChangeLog 2011-10-19 23:31:12 UTC (rev 97893)
+++ trunk/Source/_javascript_Glue/ChangeLog 2011-10-19 23:55:48 UTC (rev 97894)
@@ -1,3 +1,12 @@
+2011-10-19 Geoffrey Garen <[email protected]>
+
+ Removed StringImplBase, fusing it into StringImpl
+ https://bugs.webkit.org/show_bug.cgi?id=70443
+
+ Reviewed by Gavin Barraclough.
+
+ * ForwardingHeaders/wtf/text/StringImplBase.h: Removed.
+
2011-10-14 Mark Hahnenberg <[email protected]>
Rename getOwnPropertySlot to getOwnPropertySlotVirtual
Deleted: trunk/Source/_javascript_Glue/ForwardingHeaders/wtf/text/StringImplBase.h (97893 => 97894)
--- trunk/Source/_javascript_Glue/ForwardingHeaders/wtf/text/StringImplBase.h 2011-10-19 23:31:12 UTC (rev 97893)
+++ trunk/Source/_javascript_Glue/ForwardingHeaders/wtf/text/StringImplBase.h 2011-10-19 23:55:48 UTC (rev 97894)
@@ -1 +0,0 @@
-#include <_javascript_Core/StringImplBase.h>
Modified: trunk/Source/WebCore/ChangeLog (97893 => 97894)
--- trunk/Source/WebCore/ChangeLog 2011-10-19 23:31:12 UTC (rev 97893)
+++ trunk/Source/WebCore/ChangeLog 2011-10-19 23:55:48 UTC (rev 97894)
@@ -1,3 +1,13 @@
+2011-10-19 Geoffrey Garen <[email protected]>
+
+ Removed StringImplBase, fusing it into StringImpl
+ https://bugs.webkit.org/show_bug.cgi?id=70443
+
+ Reviewed by Gavin Barraclough.
+
+ * ForwardingHeaders/runtime/RopeImpl.h: Removed.
+ * ForwardingHeaders/wtf/text/StringImplBase.h: Removed.
+
2011-10-19 Shinya Kawanaka <[email protected]>
ArrayBuffer should have slice method.
Deleted: trunk/Source/WebCore/ForwardingHeaders/runtime/RopeImpl.h (97893 => 97894)
--- trunk/Source/WebCore/ForwardingHeaders/runtime/RopeImpl.h 2011-10-19 23:31:12 UTC (rev 97893)
+++ trunk/Source/WebCore/ForwardingHeaders/runtime/RopeImpl.h 2011-10-19 23:55:48 UTC (rev 97894)
@@ -1,4 +0,0 @@
-#ifndef WebCore_FWD_RopeImpl_h
-#define WebCore_FWD_RopeImpl_h
-#include <_javascript_Core/RopeImpl.h>
-#endif
Deleted: trunk/Source/WebCore/ForwardingHeaders/wtf/text/StringImplBase.h (97893 => 97894)
--- trunk/Source/WebCore/ForwardingHeaders/wtf/text/StringImplBase.h 2011-10-19 23:31:12 UTC (rev 97893)
+++ trunk/Source/WebCore/ForwardingHeaders/wtf/text/StringImplBase.h 2011-10-19 23:55:48 UTC (rev 97894)
@@ -1,4 +0,0 @@
-#ifndef WebCore_FWD_StringImplBase_h
-#define WebCore_FWD_StringImplBase_h
-#include <_javascript_Core/StringImplBase.h>
-#endif