Commit 0a028aa2 authored by ddkilzer@apple.com's avatar ddkilzer@apple.com

2009-06-20 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>

        Bug 24986: ARM JIT port
        <https://bugs.webkit.org/show_bug.cgi?id=24986>

        Reviewed by Oliver Hunt.

        Move SegmentedVector to /wtf subdirectory
        and change "namespace JSC" to "namespace WTF"

        Additional build file updates by David Kilzer.

        * GNUmakefile.am: Updated path to SegmentedVector.h.
        * JavaScriptCore.order: Updated SegmentedVector namespace from
        JSC to WTF in mangled C++ method name.
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
        Removed reference to bytecompiler\SegmentedVector.h.
        * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added reference to
        wtf\SegmentedVector.h.
        * JavaScriptCore.xcodeproj/project.pbxproj: Moved
        SegmentedVector.h definition from bytecompiler subdirectory to
        wtf subdirectory.
        * bytecompiler/BytecodeGenerator.h: Updated #include path to
        SegmentedVector.h and prepended WTF:: namespace to its use.
        * parser/Lexer.h: Ditto.
        * wtf/SegmentedVector.h: Renamed from JavaScriptCore/bytecompiler/SegmentedVector.h.
        (WTF::SegmentedVector::SegmentedVector):
        (WTF::SegmentedVector::~SegmentedVector):
        (WTF::SegmentedVector::size):
        (WTF::SegmentedVector::at):
        (WTF::SegmentedVector::operator[]):
        (WTF::SegmentedVector::last):
        (WTF::SegmentedVector::append):
        (WTF::SegmentedVector::removeLast):
        (WTF::SegmentedVector::grow):
        (WTF::SegmentedVector::clear):
        (WTF::SegmentedVector::deleteAllSegments):
        (WTF::SegmentedVector::segmentExistsFor):
        (WTF::SegmentedVector::segmentFor):
        (WTF::SegmentedVector::subscriptFor):
        (WTF::SegmentedVector::ensureSegmentsFor):
        (WTF::SegmentedVector::ensureSegment):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@44897 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4a649f1b
2009-06-20 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
Bug 24986: ARM JIT port
<https://bugs.webkit.org/show_bug.cgi?id=24986>
Reviewed by Oliver Hunt.
Move SegmentedVector to /wtf subdirectory
and change "namespace JSC" to "namespace WTF"
Additional build file updates by David Kilzer.
* GNUmakefile.am: Updated path to SegmentedVector.h.
* JavaScriptCore.order: Updated SegmentedVector namespace from
JSC to WTF in mangled C++ method name.
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
Removed reference to bytecompiler\SegmentedVector.h.
* JavaScriptCore.vcproj/WTF/WTF.vcproj: Added reference to
wtf\SegmentedVector.h.
* JavaScriptCore.xcodeproj/project.pbxproj: Moved
SegmentedVector.h definition from bytecompiler subdirectory to
wtf subdirectory.
* bytecompiler/BytecodeGenerator.h: Updated #include path to
SegmentedVector.h and prepended WTF:: namespace to its use.
* parser/Lexer.h: Ditto.
* wtf/SegmentedVector.h: Renamed from JavaScriptCore/bytecompiler/SegmentedVector.h.
(WTF::SegmentedVector::SegmentedVector):
(WTF::SegmentedVector::~SegmentedVector):
(WTF::SegmentedVector::size):
(WTF::SegmentedVector::at):
(WTF::SegmentedVector::operator[]):
(WTF::SegmentedVector::last):
(WTF::SegmentedVector::append):
(WTF::SegmentedVector::removeLast):
(WTF::SegmentedVector::grow):
(WTF::SegmentedVector::clear):
(WTF::SegmentedVector::deleteAllSegments):
(WTF::SegmentedVector::segmentExistsFor):
(WTF::SegmentedVector::segmentFor):
(WTF::SegmentedVector::subscriptFor):
(WTF::SegmentedVector::ensureSegmentsFor):
(WTF::SegmentedVector::ensureSegment):
2009-06-19 Gavin Barraclough <barraclough@apple.com>
Reviewed by NOBODY (build fix take 2 - rename FIELD_OFFSET to something that doesn't conflict with winnt.h).
......
......@@ -108,7 +108,6 @@ javascriptcore_sources += \
JavaScriptCore/bytecompiler/RegisterID.h \
JavaScriptCore/bytecode/SamplingTool.cpp \
JavaScriptCore/bytecode/SamplingTool.h \
JavaScriptCore/bytecompiler/SegmentedVector.h \
JavaScriptCore/config.h \
JavaScriptCore/debugger/DebuggerActivation.cpp \
JavaScriptCore/debugger/DebuggerActivation.h \
......@@ -257,6 +256,7 @@ javascriptcore_sources += \
JavaScriptCore/wtf/RefPtr.h \
JavaScriptCore/wtf/RefPtrHashMap.h \
JavaScriptCore/wtf/RetainPtr.h \
JavaScriptCore/wtf/SegmentedVector.h \
JavaScriptCore/wtf/StdLibExtras.h \
JavaScriptCore/wtf/StringExtras.h \
JavaScriptCore/wtf/TCPackedCache.h \
......
......@@ -186,7 +186,7 @@ __Z10jscyyparsePv
__ZN3JSC5Lexer3lexEPvS1_
__ZN3JSC10Identifier3addEPNS_12JSGlobalDataEPKti
__ZN3WTF7HashSetIPN3JSC7UString3RepENS_7StrHashIS4_EENS_10HashTraitsIS4_EEE3addINS1_11UCharBufferENS1_21UCharBufferTranslatorEE
__ZN3JSC15SegmentedVectorINS_10IdentifierELm64EE6appendIS1_EEvRKT_
__ZN3WTF15SegmentedVectorINS_10IdentifierELm64EE6appendIS1_EEvRKT_
__ZNK3JSC9HashTable11createTableEPNS_12JSGlobalDataE
__ZN3JSC20ParserArenaDeletablenwEmPNS_12JSGlobalDataE
__ZN3WTF6VectorIPN3JSC20ParserArenaDeletableELm0EE15reserveCapacityEm
......
......@@ -1471,10 +1471,6 @@
RelativePath="..\..\bytecompiler\RegisterID.h"
>
</File>
<File
RelativePath="..\..\bytecompiler\SegmentedVector.h"
>
</File>
</Filter>
<Filter
Name="bytecode"
......
......@@ -408,6 +408,10 @@
RelativePath="..\..\wtf\RetainPtr.h"
>
</File>
<File
RelativePath="..\..\wtf\SegmentedVector.h"
>
</File>
<File
RelativePath="..\..\wtf\StdLibExtras.h"
>
......
......@@ -1228,6 +1228,7 @@
65C647B3093EF8D60022C380 /* RefPtr.h */,
148A1ECD0D10C23B0069A47C /* RefPtrHashMap.h */,
51F648D60BB4E2CA0033D760 /* RetainPtr.h */,
969A07290ED1CE6900F1F681 /* SegmentedVector.h */,
FE1B44790ECCD73B004F4DD1 /* StdLibExtras.h */,
E11D51750B2E798D0056C188 /* StringExtras.h */,
5DA479650CFBCF56009328A0 /* TCPackedCache.h */,
......@@ -1277,7 +1278,6 @@
969A07270ED1CE6900F1F681 /* Label.h */,
960097A50EBABB58007A7297 /* LabelScope.h */,
969A07280ED1CE6900F1F681 /* RegisterID.h */,
969A07290ED1CE6900F1F681 /* SegmentedVector.h */,
);
path = bytecompiler;
sourceTree = "<group>";
......
......@@ -37,11 +37,11 @@
#include "LabelScope.h"
#include "Interpreter.h"
#include "RegisterID.h"
#include "SegmentedVector.h"
#include "SymbolTable.h"
#include "Debugger.h"
#include "Nodes.h"
#include <wtf/PassRefPtr.h>
#include <wtf/SegmentedVector.h>
#include <wtf/Vector.h>
namespace JSC {
......@@ -449,11 +449,11 @@ namespace JSC {
RegisterID m_thisRegister;
RegisterID m_argumentsRegister;
int m_activationRegisterIndex;
SegmentedVector<RegisterID, 32> m_calleeRegisters;
SegmentedVector<RegisterID, 32> m_parameters;
SegmentedVector<RegisterID, 32> m_globals;
SegmentedVector<Label, 32> m_labels;
SegmentedVector<LabelScope, 8> m_labelScopes;
WTF::SegmentedVector<RegisterID, 32> m_calleeRegisters;
WTF::SegmentedVector<RegisterID, 32> m_parameters;
WTF::SegmentedVector<RegisterID, 32> m_globals;
WTF::SegmentedVector<Label, 32> m_labels;
WTF::SegmentedVector<LabelScope, 8> m_labelScopes;
RefPtr<RegisterID> m_lastConstant;
int m_finallyDepth;
int m_dynamicScopeDepth;
......
......@@ -23,9 +23,9 @@
#define Lexer_h
#include "Lookup.h"
#include "SegmentedVector.h"
#include "SourceCode.h"
#include <wtf/ASCIICType.h>
#include <wtf/SegmentedVector.h>
#include <wtf/Vector.h>
#include <wtf/unicode/Unicode.h>
......@@ -108,7 +108,7 @@ namespace JSC {
int m_next2;
int m_next3;
SegmentedVector<JSC::Identifier, initialIdentifierTableCapacity> m_identifiers;
WTF::SegmentedVector<JSC::Identifier, initialIdentifierTableCapacity> m_identifiers;
JSGlobalData* m_globalData;
......
......@@ -31,7 +31,7 @@
#include <wtf/Vector.h>
namespace JSC {
namespace WTF {
// SegmentedVector is just like Vector, but it doesn't move the values
// stored in its buffer when it grows. Therefore, it is safe to keep
......@@ -108,7 +108,7 @@ namespace JSC {
private:
typedef Vector<T, SegmentSize> Segment;
void deleteAllSegments()
{
// Skip the first segment, because it's our inline segment, which was
......@@ -116,22 +116,22 @@ namespace JSC {
for (size_t i = 1; i < m_segments.size(); i++)
delete m_segments[i];
}
bool segmentExistsFor(size_t index)
{
return index / SegmentSize < m_segments.size();
}
Segment* segmentFor(size_t index)
{
return m_segments[index / SegmentSize];
}
size_t subscriptFor(size_t index)
{
return index % SegmentSize;
}
void ensureSegmentsFor(size_t size)
{
size_t segmentCount = m_size / SegmentSize;
......@@ -147,7 +147,7 @@ namespace JSC {
size_t end = neededSegmentCount - 1;
for (size_t i = segmentCount - 1; i < end; ++i)
ensureSegment(i, SegmentSize);
// Grow segment N to accomodate the remainder.
ensureSegment(end, subscriptFor(size - 1) + 1);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment