summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-09-14 16:29:47 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-09-14 16:29:47 +0200
commitd0424a769059c84ae20beb3c217812792ea6726b (patch)
tree6f94a5c3db8c52c6694ee56498542a6c35417350 /Source/JavaScriptCore
parent88a04ac016f57c2d78e714682445dff2e7db4ade (diff)
downloadqtwebkit-d0424a769059c84ae20beb3c217812792ea6726b.tar.gz
Imported WebKit commit 37c5e5041d39a14ea0d429a77ebd352e4bd26516 (http://svn.webkit.org/repository/webkit/trunk@128608)
New snapshot that enables WebKit2 build on Windows (still some bugs) and allows for WebKit to be built with qmake && make
Diffstat (limited to 'Source/JavaScriptCore')
-rw-r--r--Source/JavaScriptCore/API/JSCallbackObject.h5
-rw-r--r--Source/JavaScriptCore/API/JSCallbackObjectFunctions.h10
-rw-r--r--Source/JavaScriptCore/API/JSObjectRef.cpp2
-rw-r--r--Source/JavaScriptCore/CMakeLists.txt1
-rw-r--r--Source/JavaScriptCore/ChangeLog1082
-rw-r--r--Source/JavaScriptCore/GNUmakefile.list.am14
-rwxr-xr-xSource/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def20
-rw-r--r--Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj52
-rw-r--r--Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj57
-rw-r--r--Source/JavaScriptCore/Target.pri1
-rw-r--r--Source/JavaScriptCore/bytecode/ArrayProfile.h10
-rw-r--r--Source/JavaScriptCore/bytecode/CodeBlock.cpp30
-rw-r--r--Source/JavaScriptCore/bytecode/CodeBlock.h29
-rw-r--r--Source/JavaScriptCore/bytecode/GetByIdStatus.cpp3
-rw-r--r--Source/JavaScriptCore/bytecode/Opcode.h16
-rw-r--r--Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp78
-rw-r--r--Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h11
-rw-r--r--Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp6
-rw-r--r--Source/JavaScriptCore/debugger/Debugger.cpp2
-rw-r--r--Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp10
-rw-r--r--Source/JavaScriptCore/debugger/DebuggerCallFrame.h2
-rw-r--r--Source/JavaScriptCore/dfg/DFGAbstractState.cpp24
-rw-r--r--Source/JavaScriptCore/dfg/DFGAdjacencyList.h2
-rw-r--r--Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp75
-rw-r--r--Source/JavaScriptCore/dfg/DFGArrayMode.cpp34
-rw-r--r--Source/JavaScriptCore/dfg/DFGArrayMode.h83
-rw-r--r--Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp53
-rw-r--r--Source/JavaScriptCore/dfg/DFGCSEPhase.cpp14
-rw-r--r--Source/JavaScriptCore/dfg/DFGCapabilities.h3
-rw-r--r--Source/JavaScriptCore/dfg/DFGFixupPhase.cpp26
-rw-r--r--Source/JavaScriptCore/dfg/DFGGraph.h2
-rw-r--r--Source/JavaScriptCore/dfg/DFGNode.h2
-rw-r--r--Source/JavaScriptCore/dfg/DFGNodeType.h2
-rw-r--r--Source/JavaScriptCore/dfg/DFGOperations.cpp61
-rw-r--r--Source/JavaScriptCore/dfg/DFGOperations.h12
-rw-r--r--Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp2
-rw-r--r--Source/JavaScriptCore/dfg/DFGRepatch.cpp52
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp90
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h35
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp55
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp87
-rw-r--r--Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp2
-rw-r--r--Source/JavaScriptCore/heap/CopiedSpace.h2
-rw-r--r--Source/JavaScriptCore/heap/Heap.cpp9
-rw-r--r--Source/JavaScriptCore/heap/Heap.h1
-rw-r--r--Source/JavaScriptCore/heap/MarkedAllocator.cpp2
-rw-r--r--Source/JavaScriptCore/heap/MarkedAllocator.h6
-rw-r--r--Source/JavaScriptCore/heap/MarkedBlock.cpp47
-rw-r--r--Source/JavaScriptCore/heap/MarkedBlock.h35
-rw-r--r--Source/JavaScriptCore/heap/MarkedSpace.cpp12
-rw-r--r--Source/JavaScriptCore/heap/MarkedSpace.h12
-rw-r--r--Source/JavaScriptCore/icu/unicode/localpointer.h300
-rw-r--r--Source/JavaScriptCore/icu/unicode/parseerr.h6
-rw-r--r--Source/JavaScriptCore/icu/unicode/platform.h310
-rw-r--r--Source/JavaScriptCore/icu/unicode/ptypes.h92
-rw-r--r--Source/JavaScriptCore/icu/unicode/putil.h19
-rw-r--r--Source/JavaScriptCore/icu/unicode/uchar.h742
-rw-r--r--Source/JavaScriptCore/icu/unicode/ucnv.h290
-rw-r--r--Source/JavaScriptCore/icu/unicode/ucnv_err.h25
-rw-r--r--Source/JavaScriptCore/icu/unicode/ucol.h344
-rw-r--r--Source/JavaScriptCore/icu/unicode/uconfig.h55
-rw-r--r--Source/JavaScriptCore/icu/unicode/uenum.h47
-rw-r--r--Source/JavaScriptCore/icu/unicode/uiter.h10
-rw-r--r--Source/JavaScriptCore/icu/unicode/uloc.h305
-rw-r--r--Source/JavaScriptCore/icu/unicode/umachine.h109
-rw-r--r--Source/JavaScriptCore/icu/unicode/unorm.h38
-rw-r--r--Source/JavaScriptCore/icu/unicode/unorm2.h391
-rw-r--r--Source/JavaScriptCore/icu/unicode/urename.h3625
-rw-r--r--Source/JavaScriptCore/icu/unicode/uscript.h156
-rw-r--r--Source/JavaScriptCore/icu/unicode/uset.h471
-rw-r--r--Source/JavaScriptCore/icu/unicode/ustring.h428
-rw-r--r--Source/JavaScriptCore/icu/unicode/utf.h31
-rw-r--r--Source/JavaScriptCore/icu/unicode/utf16.h33
-rw-r--r--Source/JavaScriptCore/icu/unicode/utf8.h118
-rw-r--r--Source/JavaScriptCore/icu/unicode/utypes.h168
-rw-r--r--Source/JavaScriptCore/icu/unicode/uvernum.h138
-rw-r--r--Source/JavaScriptCore/icu/unicode/uversion.h215
-rw-r--r--Source/JavaScriptCore/interpreter/CallFrame.h4
-rw-r--r--Source/JavaScriptCore/interpreter/Interpreter.cpp38
-rw-r--r--Source/JavaScriptCore/jit/JIT.cpp6
-rw-r--r--Source/JavaScriptCore/jit/JIT.h2
-rw-r--r--Source/JavaScriptCore/jit/JITInlineMethods.h35
-rw-r--r--Source/JavaScriptCore/jit/JITOpcodes.cpp4
-rw-r--r--Source/JavaScriptCore/jit/JITPropertyAccess.cpp47
-rw-r--r--Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp45
-rw-r--r--Source/JavaScriptCore/jit/JITStubs.cpp18
-rw-r--r--Source/JavaScriptCore/jsc.cpp4
-rw-r--r--Source/JavaScriptCore/jsc.pro2
-rw-r--r--Source/JavaScriptCore/llint/LLIntSlowPaths.cpp31
-rw-r--r--Source/JavaScriptCore/llint/LowLevelInterpreter.asm12
-rw-r--r--Source/JavaScriptCore/llint/LowLevelInterpreter.h33
-rw-r--r--Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm65
-rw-r--r--Source/JavaScriptCore/llint/LowLevelInterpreter64.asm61
-rw-r--r--Source/JavaScriptCore/parser/Lexer.cpp10
-rw-r--r--Source/JavaScriptCore/parser/NodeConstructors.h2
-rw-r--r--Source/JavaScriptCore/parser/Nodes.h1
-rw-r--r--Source/JavaScriptCore/parser/Parser.h4
-rw-r--r--Source/JavaScriptCore/parser/SourceCode.h6
-rw-r--r--Source/JavaScriptCore/parser/SourceProvider.h18
-rw-r--r--Source/JavaScriptCore/runtime/Arguments.cpp4
-rw-r--r--Source/JavaScriptCore/runtime/Arguments.h1
-rw-r--r--Source/JavaScriptCore/runtime/ArrayConstructor.cpp2
-rw-r--r--Source/JavaScriptCore/runtime/ArrayConventions.h103
-rw-r--r--Source/JavaScriptCore/runtime/ArrayPrototype.cpp60
-rw-r--r--Source/JavaScriptCore/runtime/ArrayPrototype.h11
-rw-r--r--Source/JavaScriptCore/runtime/ArrayStorage.h106
-rw-r--r--Source/JavaScriptCore/runtime/Butterfly.h106
-rw-r--r--Source/JavaScriptCore/runtime/ButterflyInlineMethods.h179
-rw-r--r--Source/JavaScriptCore/runtime/ClassInfo.h4
-rw-r--r--Source/JavaScriptCore/runtime/Executable.h8
-rw-r--r--Source/JavaScriptCore/runtime/IndexingHeader.h122
-rw-r--r--Source/JavaScriptCore/runtime/IndexingHeaderInlineMethods.h54
-rw-r--r--Source/JavaScriptCore/runtime/IndexingType.h61
-rw-r--r--Source/JavaScriptCore/runtime/JSActivation.cpp64
-rw-r--r--Source/JavaScriptCore/runtime/JSActivation.h156
-rw-r--r--Source/JavaScriptCore/runtime/JSArray.cpp1807
-rw-r--r--Source/JavaScriptCore/runtime/JSArray.h319
-rw-r--r--Source/JavaScriptCore/runtime/JSBoundFunction.cpp8
-rw-r--r--Source/JavaScriptCore/runtime/JSCell.cpp5
-rw-r--r--Source/JavaScriptCore/runtime/JSCell.h23
-rw-r--r--Source/JavaScriptCore/runtime/JSFunction.cpp66
-rw-r--r--Source/JavaScriptCore/runtime/JSFunction.h16
-rw-r--r--Source/JavaScriptCore/runtime/JSGlobalData.cpp4
-rw-r--r--Source/JavaScriptCore/runtime/JSGlobalData.h1
-rw-r--r--Source/JavaScriptCore/runtime/JSGlobalObject.cpp2
-rw-r--r--Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp1
-rw-r--r--Source/JavaScriptCore/runtime/JSONObject.cpp8
-rw-r--r--Source/JavaScriptCore/runtime/JSObject.cpp1042
-rw-r--r--Source/JavaScriptCore/runtime/JSObject.h398
-rw-r--r--Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp3
-rw-r--r--Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp4
-rw-r--r--Source/JavaScriptCore/runtime/JSSymbolTableObject.h13
-rw-r--r--Source/JavaScriptCore/runtime/JSTypeInfo.h10
-rw-r--r--Source/JavaScriptCore/runtime/JSVariableObject.h11
-rw-r--r--Source/JavaScriptCore/runtime/LiteralParser.cpp10
-rw-r--r--Source/JavaScriptCore/runtime/ObjectConstructor.cpp2
-rw-r--r--Source/JavaScriptCore/runtime/ObjectPrototype.cpp29
-rw-r--r--Source/JavaScriptCore/runtime/ObjectPrototype.h6
-rw-r--r--Source/JavaScriptCore/runtime/PropertyOffset.h2
-rw-r--r--Source/JavaScriptCore/runtime/PropertyStorage.h (renamed from Source/JavaScriptCore/runtime/StorageBarrier.h)49
-rw-r--r--Source/JavaScriptCore/runtime/PutDirectIndexMode.h36
-rw-r--r--Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp24
-rw-r--r--Source/JavaScriptCore/runtime/RegExpMatchesArray.h20
-rw-r--r--Source/JavaScriptCore/runtime/RegExpObject.cpp6
-rw-r--r--Source/JavaScriptCore/runtime/RegExpObject.h2
-rw-r--r--Source/JavaScriptCore/runtime/Reject.h44
-rw-r--r--Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp37
-rw-r--r--Source/JavaScriptCore/runtime/SparseArrayValueMap.h134
-rw-r--r--Source/JavaScriptCore/runtime/SparseArrayValueMapInlineMethods.h203
-rw-r--r--Source/JavaScriptCore/runtime/StringObject.cpp19
-rw-r--r--Source/JavaScriptCore/runtime/StringObject.h4
-rw-r--r--Source/JavaScriptCore/runtime/StringPrototype.cpp2
-rw-r--r--Source/JavaScriptCore/runtime/Structure.cpp39
-rw-r--r--Source/JavaScriptCore/runtime/Structure.h20
-rw-r--r--Source/JavaScriptCore/runtime/StructureTransitionTable.h30
-rw-r--r--Source/JavaScriptCore/runtime/SymbolTable.h32
-rw-r--r--Source/JavaScriptCore/shell/PlatformBlackBerry.cmake2
-rw-r--r--Source/JavaScriptCore/tests/mozilla/js1_6/Array/regress-304828.js10
158 files changed, 11736 insertions, 5005 deletions
diff --git a/Source/JavaScriptCore/API/JSCallbackObject.h b/Source/JavaScriptCore/API/JSCallbackObject.h
index 36d7fa9c2..8d7aedd3e 100644
--- a/Source/JavaScriptCore/API/JSCallbackObject.h
+++ b/Source/JavaScriptCore/API/JSCallbackObject.h
@@ -168,7 +168,7 @@ public:
using Parent::methodTable;
protected:
- static const unsigned StructureFlags = ProhibitsPropertyCaching | OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesHasInstance | OverridesVisitChildren | OverridesGetPropertyNames | Parent::StructureFlags;
+ static const unsigned StructureFlags = ProhibitsPropertyCaching | OverridesGetOwnPropertySlot | InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | ImplementsHasInstance | OverridesHasInstance | OverridesVisitChildren | OverridesGetPropertyNames | Parent::StructureFlags;
private:
static String className(const JSObject*);
@@ -178,6 +178,7 @@ private:
static JSValue defaultValue(const JSObject*, ExecState*, PreferredPrimitiveType);
static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
+ static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
@@ -187,7 +188,7 @@ private:
static bool hasInstance(JSObject*, ExecState*, JSValue, JSValue proto);
- static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
+ static void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
static ConstructType getConstructData(JSCell*, ConstructData&);
static CallType getCallData(JSCell*, CallData&);
diff --git a/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h b/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
index 0691dafc3..39d078239 100644
--- a/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
+++ b/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
@@ -183,6 +183,12 @@ bool JSCallbackObject<Parent>::getOwnPropertySlot(JSCell* cell, ExecState* exec,
}
template <class Parent>
+bool JSCallbackObject<Parent>::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
+{
+ return cell->methodTable()->getOwnPropertySlot(cell, exec, Identifier::from(exec, propertyName), slot);
+}
+
+template <class Parent>
JSValue JSCallbackObject<Parent>::defaultValue(const JSObject* object, ExecState* exec, PreferredPrimitiveType hint)
{
const JSCallbackObject* thisObject = jsCast<const JSCallbackObject*>(object);
@@ -449,7 +455,7 @@ EncodedJSValue JSCallbackObject<Parent>::call(ExecState* exec)
}
template <class Parent>
-void JSCallbackObject<Parent>::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
+void JSCallbackObject<Parent>::getOwnNonIndexPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(object);
JSContextRef execRef = toRef(exec);
@@ -484,7 +490,7 @@ void JSCallbackObject<Parent>::getOwnPropertyNames(JSObject* object, ExecState*
}
}
- Parent::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
+ Parent::getOwnNonIndexPropertyNames(thisObject, exec, propertyNames, mode);
}
template <class Parent>
diff --git a/Source/JavaScriptCore/API/JSObjectRef.cpp b/Source/JavaScriptCore/API/JSObjectRef.cpp
index e206cb16f..7a8956e4a 100644
--- a/Source/JavaScriptCore/API/JSObjectRef.cpp
+++ b/Source/JavaScriptCore/API/JSObjectRef.cpp
@@ -29,7 +29,9 @@
#include "JSObjectRefPrivate.h"
#include "APICast.h"
+#include "ButterflyInlineMethods.h"
#include "CodeBlock.h"
+#include "CopiedSpaceInlineMethods.h"
#include "DateConstructor.h"
#include "ErrorConstructor.h"
#include "FunctionConstructor.h"
diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt
index 2065c5b39..9a2e7b56c 100644
--- a/Source/JavaScriptCore/CMakeLists.txt
+++ b/Source/JavaScriptCore/CMakeLists.txt
@@ -246,6 +246,7 @@ SET(JavaScriptCore_SOURCES
runtime/RegExpObject.cpp
runtime/RegExpPrototype.cpp
runtime/SmallStrings.cpp
+ runtime/SparseArrayValueMap.cpp
runtime/StrictEvalActivation.cpp
runtime/StringConstructor.cpp
runtime/StringObject.cpp
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index e92f02211..9e4905f93 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,1085 @@
+2012-09-14 Parth Patel <parpatel@rim.com>
+
+ [BlackBerry] Switching from Slogger to Slogger2 requires changes in CMakeList of
+ webkit in order to include libraries of slog2
+ https://bugs.webkit.org/show_bug.cgi?id=96391
+
+ Reviewed by Yong Li.
+
+ Changes in Cmake files of JavaScriptCore of webkit to include slog2 libs in build
+ files of webkit in response to switching from Slogger to Slogger2.
+
+ * shell/PlatformBlackBerry.cmake:
+
+2012-09-14 Mark Hahnenberg <mhahnenberg@apple.com>
+
+ Remove the Zapped BlockState
+ https://bugs.webkit.org/show_bug.cgi?id=96708
+
+ Reviewed by Geoffrey Garen.
+
+ The Zapped block state is rather confusing. It indicates that a block is in one of two different states that we
+ can't tell the difference between:
+
+ 1) I have run all destructors of things that are zapped, and I have not allocated any more objects. This block
+ is ready for reclaiming if you so choose.
+ 2) I have run all the destructors of things that are zapped, but I have allocated more stuff since then, so it
+ is not safe to reclaim this block.
+
+ This state adds a lot of complexity to our state transition model for MarkedBlocks. We should get rid of it.
+ We can replace this state by making sure mark bits represent all of the liveness information we need when running
+ our conservative stack scan. Instead of zapping the free list when canonicalizing cell liveness data prior to
+ a conservative scan, we can instead mark all objects in the block except for those in the free list. This should
+ incur no performance penalty since we're doing it on a very small O(1) number of blocks at the beginning of the collection.
+
+ For the time being we still need to use zapping to determine whether we have run an object's destructor or not.
+
+ * heap/MarkedAllocator.cpp:
+ (JSC::MarkedAllocator::tryAllocateHelper): Renaming stuff.
+ * heap/MarkedAllocator.h: Renamed zapFreeList to canonicalizeCellLivenessData to match.
+ (MarkedAllocator):
+ (JSC::MarkedAllocator::canonicalizeCellLivenessData): Same as old zapFreeList, but just call canonicalize instead.
+ * heap/MarkedBlock.cpp:
+ (JSC::MarkedBlock::specializedSweep): Remove the check for Zapped block stuff. Also change the block state to Marked
+ instead of Zapped if we're not producing a FreeList since that's the only other state that really makes any sense.
+ (JSC::MarkedBlock::sweepHelper): Remove Zapped related code.
+ (SetAllMarksFunctor): Functor to set all the mark bits in the block since there's not a simple function to call on
+ the Bitmap itself.
+ (JSC::SetAllMarksFunctor::operator()):
+ (JSC):
+ (JSC::MarkedBlock::canonicalizeCellLivenessData): Remove all the stuff for Zapped. For FreeListed, set all the mark bits
+ and then clear the ones for the objects in the FreeList. This ensures that only the things that were in the FreeList
+ are considered to be dead by the conservative scan, just like if we were to have zapped the FreeList like before.
+ * heap/MarkedBlock.h:
+ (MarkedBlock):
+ (JSC::MarkedBlock::clearMarked): Add function to clear individual mark bits, since we need that functionality now.
+ (JSC):
+ (JSC::MarkedBlock::isLive): Remove code for Zapped stuff. Marked handles all interesting cases now.
+ (JSC::MarkedBlock::forEachCell): Add new iterator function that iterates over all cells in the block, regardless of
+ whether they're live or a dead.
+ * heap/MarkedSpace.cpp:
+ (JSC::MarkedSpace::canonicalizeCellLivenessData): Change to call the renamed canonicalize function.
+
+2012-09-13 Kevin Funk <kevin.funk@kdab.com>
+
+ Make compile with both OS(WINCE) and PLATFORM(QT) support
+ https://bugs.webkit.org/show_bug.cgi?id=95536
+
+ Reviewed by Simon Hausmann.
+
+ Do not link against advapi32 on wince
+
+ * jsc.pro:
+
+2012-09-13 Geoffrey Garen <ggaren@apple.com>
+
+ Refactored the DFG to make fewer assumptions about variable capture
+ https://bugs.webkit.org/show_bug.cgi?id=96680
+
+ Reviewed by Gavin Barraclough.
+
+ A variable capture optimization patch I'm working on broke DFG
+ correctness and the arguments simplification optimization phase, so I've
+ refactored both to make fewer assumptions about variable capture.
+
+ * bytecode/CodeBlock.h:
+ (JSC::CodeBlock::isCaptured): This is the new One True Way to find out
+ if a variable was captured. This gives us a single point of maintenance
+ as we chagne capture behavior.
+
+ * dfg/DFGAbstractState.cpp:
+ (JSC::DFG::AbstractState::clobberCapturedVars): Don't assume that captured
+ variables have any particular location. Instead, ask the One True Function.
+
+ * dfg/DFGArgumentsSimplificationPhase.cpp:
+ (JSC::DFG::ArgumentsSimplificationPhase::run):
+ (JSC::DFG::ArgumentsSimplificationPhase::observeProperArgumentsUse):
+ (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize): Mechanical
+ changes to separate being captured from being 'arguments'. What used
+ to be
+ if (captured)
+ if (arguments)
+ x
+ y
+ is now
+ if (arguments)
+ x
+ y
+ else if (captured)
+ y
+
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::getLocal):
+ (JSC::DFG::ByteCodeParser::setLocal):
+ (JSC::DFG::ByteCodeParser::getArgument):
+ (JSC::DFG::ByteCodeParser::setArgument):
+ (JSC::DFG::ByteCodeParser::flushDirect):
+ (JSC::DFG::ByteCodeParser::parseBlock):
+ (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
+ * dfg/DFGSpeculativeJIT.cpp:
+ (JSC::DFG::SpeculativeJIT::compile): Use the One True Function.
+
+2012-09-13 Benjamin Poulain <bpoulain@apple.com>
+
+ Improve the SourceProvider hierarchy
+ https://bugs.webkit.org/show_bug.cgi?id=95635
+
+ Reviewed by Geoffrey Garen.
+
+ SourceProvider was designed to have subclasses magically handling the data without
+ decoding all of it. The virtual methods length() and getRange() were based
+ on these assumptions.
+
+ In practice, the magic was in our head, there is no implementation that takes
+ advantage of that.
+
+ SourceProvider is modified to adopt WebCore's ScriptSourceProvider::source() and base
+ everything on it.
+ The code using SourceProvider is also simplified.
+
+ * interpreter/Interpreter.cpp:
+ (JSC::appendSourceToError): Keep a reference to the string instead of querying it for
+ each time it is used.
+ * parser/Lexer.cpp:
+ (JSC::::setCode):
+ (JSC::::sourceCode):
+ * parser/Parser.h:
+ (JSC::parse):
+ * parser/SourceCode.h:
+ (JSC::SourceCode::SourceCode):
+ (JSC::SourceCode::subExpression):
+ * parser/SourceProvider.h:
+ (SourceProvider):
+ (JSC::SourceProvider::getRange):
+
+2012-09-13 Filip Pizlo <fpizlo@apple.com>
+
+ DFG: Dead GetButterfly's shouldn't be subject to CSE
+ https://bugs.webkit.org/show_bug.cgi?id=96707
+ <rdar://problem/12296311>
+
+ Reviewed by Oliver Hunt.
+
+ There were a number of cases of this that creeped into the CSE: it would
+ match something even though it was dead.
+
+ * dfg/DFGCSEPhase.cpp:
+ (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
+ (JSC::DFG::CSEPhase::checkArrayElimination):
+ (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
+ (JSC::DFG::CSEPhase::getScopeChainLoadElimination):
+ (JSC::DFG::CSEPhase::getLocalLoadElimination):
+
+2012-09-13 Oliver Hunt <oliver@apple.com>
+
+ Make global const initialisation explicit in the bytecode
+ https://bugs.webkit.org/show_bug.cgi?id=96711
+
+ Reviewed by Gavin Barraclough.
+
+ Added op_init_global_const to make initialisation of global const
+ fields explicit. This will help us keep correct semantics in the
+ upcoming variable resolution refactoring.
+
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::dump):
+ * bytecode/Opcode.h:
+ (JSC):
+ (JSC::padOpcodeName):
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::emitInitGlobalConst):
+ (JSC):
+ * bytecompiler/BytecodeGenerator.h:
+ (BytecodeGenerator):
+ * bytecompiler/NodesCodegen.cpp:
+ (JSC::ConstDeclNode::emitCodeSingle):
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::parseBlock):
+ * dfg/DFGCapabilities.h:
+ (JSC::DFG::canCompileOpcode):
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+ * jit/JIT.cpp:
+ (JSC::JIT::privateCompileMainPass):
+ (JSC::JIT::privateCompileSlowCases):
+ * llint/LowLevelInterpreter32_64.asm:
+ * llint/LowLevelInterpreter64.asm:
+
+2012-09-13 Mark Hahnenberg <mhahnenberg@apple.com>
+
+ Rename forEachCell to forEachLiveCell
+ https://bugs.webkit.org/show_bug.cgi?id=96685
+
+ Reviewed by Oliver Hunt.
+
+ forEachCell actually only iterates over live cells. We should rename it to
+ reflect what it actually does. This is also helpful because we want to add a new
+ forEachCell that actually does iterate each and every cell in a MarkedBlock
+ regardless of whether or not it is live.
+
+ * debugger/Debugger.cpp:
+ (JSC::Debugger::recompileAllJSFunctions):
+ * heap/Heap.cpp:
+ (JSC::Heap::globalObjectCount):
+ (JSC::Heap::objectTypeCounts):
+ * heap/MarkedBlock.h:
+ (MarkedBlock):
+ (JSC::MarkedBlock::forEachLiveCell):
+ * heap/MarkedSpace.h:
+ (MarkedSpace):
+ (JSC::MarkedSpace::forEachLiveCell):
+ * runtime/JSGlobalData.cpp:
+ (JSC::JSGlobalData::releaseExecutableMemory):
+
+2012-09-13 Filip Pizlo <fpizlo@apple.com>
+
+ [Qt][Win] REGRESSION(r128400): It broke the build
+ https://bugs.webkit.org/show_bug.cgi?id=96617
+
+ Reviewed by Simon Hausmann.
+
+ Changed "JSC::Array" to "JSC::ArrayClass" because it's not used often enough
+ for the brevity to be beneficial, and because "Array" causes too much namespace
+ pollution.
+
+ * runtime/IndexingType.h:
+ (JSC):
+ * runtime/JSArray.cpp:
+ (JSC::JSArray::pop):
+ (JSC::JSArray::push):
+ (JSC::JSArray::sortNumeric):
+ (JSC::JSArray::sort):
+ (JSC::JSArray::fillArgList):
+ (JSC::JSArray::copyToArguments):
+ (JSC::JSArray::compactForSorting):
+ * runtime/JSObject.cpp:
+ (JSC::JSObject::getOwnPropertySlotByIndex):
+ (JSC::JSObject::putByIndex):
+ (JSC::JSObject::ensureArrayStorageExistsAndEnterDictionaryIndexingMode):
+ (JSC::JSObject::deletePropertyByIndex):
+ (JSC::JSObject::getOwnPropertyNames):
+ (JSC::JSObject::putByIndexBeyondVectorLength):
+ (JSC::JSObject::putDirectIndexBeyondVectorLength):
+ (JSC::JSObject::getNewVectorLength):
+ (JSC::JSObject::getOwnPropertyDescriptor):
+ * runtime/JSObject.h:
+ (JSC::JSObject::getArrayLength):
+ (JSC::JSObject::getVectorLength):
+ (JSC::JSObject::canGetIndexQuickly):
+ (JSC::JSObject::canSetIndexQuickly):
+ (JSC::JSObject::inSparseIndexingMode):
+ (JSC::JSObject::ensureArrayStorage):
+
+2012-09-13 Filip Pizlo <fpizlo@apple.com>
+
+ Testing whether indexing type is ArrayWithArrayStorage should not compare against ArrayWithArrayStorage
+ https://bugs.webkit.org/show_bug.cgi?id=96611
+
+ Reviewed by Gavin Barraclough.
+
+ * dfg/DFGRepatch.cpp:
+ (JSC::DFG::tryCacheGetByID):
+ * dfg/DFGSpeculativeJIT.cpp:
+ (JSC::DFG::SpeculativeJIT::checkArray):
+ * jit/JITPropertyAccess.cpp:
+ (JSC::JIT::privateCompilePatchGetArrayLength):
+ * jit/JITPropertyAccess32_64.cpp:
+ (JSC::JIT::privateCompilePatchGetArrayLength):
+ * llint/LowLevelInterpreter32_64.asm:
+ * llint/LowLevelInterpreter64.asm:
+
+2012-09-09 Filip Pizlo <fpizlo@apple.com>
+
+ JSC should have property butterflies
+ https://bugs.webkit.org/show_bug.cgi?id=91933
+
+ Reviewed by Geoffrey Garen.
+
+ This changes the JSC object model. Previously, all objects had fast lookup for
+ named properties. Integer indexed properties were only fast if you used a
+ JSArray. With this change, all objects have fast indexed properties. This is
+ accomplished without any space overhead by using a bidirectional object layout,
+ aka butterflies. Each JSObject has a m_butterfly pointer where previously it
+ had a m_outOfLineStorage pointer. To the left of the location pointed to by
+ m_butterfly, we place all named out-of-line properties. To the right, we place
+ all indexed properties along with indexing meta-data. Though, some indexing
+ meta-data is placed in the 8-byte word immediately left of the pointed-to
+ location; this is in anticipation of the indexing meta-data being small enough
+ in the common case that m_butterfly always points to the first indexed
+ property.
+
+ This is performance neutral, except on tests that use indexed properties on
+ plain objects, where the speed-up is in excess of an order of magnitude.
+
+ One notable aspect of what this change brings is that it allows indexing
+ storage to morph over time. Currently this is only used to allow all non-array
+ objects to start out without any indexed storage. But it could be used for
+ some kinds of array type inference in the future.
+
+ * API/JSCallbackObject.h:
+ (JSCallbackObject):
+ * API/JSCallbackObjectFunctions.h:
+ (JSC::::getOwnPropertySlotByIndex):
+ (JSC):
+ (JSC::::getOwnNonIndexPropertyNames):
+ * API/JSObjectRef.cpp:
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * Target.pri:
+ * bytecode/ArrayProfile.h:
+ (JSC):
+ (JSC::arrayModeFromStructure):
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::emitDirectPutById):
+ * dfg/DFGAbstractState.cpp:
+ (JSC::DFG::AbstractState::execute):
+ * dfg/DFGAdjacencyList.h:
+ (JSC::DFG::AdjacencyList::AdjacencyList):
+ (AdjacencyList):
+ * dfg/DFGArrayMode.cpp:
+ (JSC::DFG::fromObserved):
+ (JSC::DFG::modeAlreadyChecked):
+ (JSC::DFG::modeToString):
+ * dfg/DFGArrayMode.h:
+ (DFG):
+ (JSC::DFG::modeUsesButterfly):
+ (JSC::DFG::modeIsJSArray):
+ (JSC::DFG::isInBoundsAccess):
+ (JSC::DFG::modeSupportsLength):
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::handleGetByOffset):
+ (JSC::DFG::ByteCodeParser::parseBlock):
+ * dfg/DFGCSEPhase.cpp:
+ (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
+ (JSC::DFG::CSEPhase::performNodeCSE):
+ * dfg/DFGFixupPhase.cpp:
+ (JSC::DFG::FixupPhase::fixupNode):
+ (JSC::DFG::FixupPhase::addNode):
+ (FixupPhase):
+ (JSC::DFG::FixupPhase::checkArray):
+ * dfg/DFGGraph.h:
+ (JSC::DFG::Graph::byValIsPure):
+ * dfg/DFGNode.h:
+ (JSC::DFG::Node::Node):
+ (Node):
+ * dfg/DFGNodeType.h:
+ (DFG):
+ * dfg/DFGOperations.cpp:
+ (JSC::DFG::putByVal):
+ * dfg/DFGOperations.h:
+ * dfg/DFGPredictionPropagationPhase.cpp:
+ (JSC::DFG::PredictionPropagationPhase::propagate):
+ * dfg/DFGRepatch.cpp:
+ (JSC::DFG::generateProtoChainAccessStub):
+ (JSC::DFG::tryCacheGetByID):
+ (JSC::DFG::tryBuildGetByIDList):
+ (JSC::DFG::emitPutReplaceStub):
+ (JSC::DFG::emitPutTransitionStub):
+ (JSC::DFG::tryBuildPutByIdList):
+ * dfg/DFGSpeculativeJIT.cpp:
+ (JSC::DFG::SpeculativeJIT::checkArray):
+ (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
+ (JSC::DFG::SpeculativeJIT::compileGetArrayLength):
+ (JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
+ (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
+ * dfg/DFGSpeculativeJIT.h:
+ (JSC::DFG::SpeculativeJIT::callOperation):
+ (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ (JSC::DFG::SpeculativeJIT::cachedGetById):
+ (JSC::DFG::SpeculativeJIT::cachedPutById):
+ (JSC::DFG::SpeculativeJIT::compile):
+ * dfg/DFGSpeculativeJIT64.cpp:
+ (JSC::DFG::SpeculativeJIT::cachedGetById):
+ (JSC::DFG::SpeculativeJIT::cachedPutById):
+ (JSC::DFG::SpeculativeJIT::compile):
+ * dfg/DFGStructureCheckHoistingPhase.cpp:
+ (JSC::DFG::StructureCheckHoistingPhase::run):
+ * heap/CopiedSpace.h:
+ (CopiedSpace):
+ * jit/JIT.h:
+ * jit/JITInlineMethods.h:
+ (JSC::JIT::emitAllocateBasicJSObject):
+ (JSC::JIT::emitAllocateBasicStorage):
+ (JSC::JIT::emitAllocateJSArray):
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_new_array):
+ (JSC::JIT::emitSlow_op_new_array):
+ * jit/JITPropertyAccess.cpp:
+ (JSC::JIT::emit_op_get_by_val):
+ (JSC::JIT::compileGetDirectOffset):
+ (JSC::JIT::emit_op_put_by_val):
+ (JSC::JIT::compileGetByIdHotPath):
+ (JSC::JIT::emit_op_put_by_id):
+ (JSC::JIT::compilePutDirectOffset):
+ (JSC::JIT::privateCompilePatchGetArrayLength):
+ * jit/JITPropertyAccess32_64.cpp:
+ (JSC::JIT::emit_op_get_by_val):
+ (JSC::JIT::emit_op_put_by_val):
+ (JSC::JIT::compileGetByIdHotPath):
+ (JSC::JIT::emit_op_put_by_id):
+ (JSC::JIT::compilePutDirectOffset):
+ (JSC::JIT::compileGetDirectOffset):
+ (JSC::JIT::privateCompilePatchGetArrayLength):
+ * jit/JITStubs.cpp:
+ (JSC::DEFINE_STUB_FUNCTION):
+ * jsc.cpp:
+ * llint/LLIntSlowPaths.cpp:
+ (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+ * llint/LowLevelInterpreter.asm:
+ * llint/LowLevelInterpreter32_64.asm:
+ * llint/LowLevelInterpreter64.asm:
+ * runtime/Arguments.cpp:
+ (JSC::Arguments::deletePropertyByIndex):
+ (JSC::Arguments::defineOwnProperty):
+ * runtime/ArrayConstructor.cpp:
+ * runtime/ArrayConventions.h: Added.
+ (JSC):
+ (JSC::isDenseEnoughForVector):
+ (JSC::indexingHeaderForArray):
+ (JSC::baseIndexingHeaderForArray):
+ * runtime/ArrayPrototype.cpp:
+ (JSC::ArrayPrototype::create):
+ (JSC):
+ (JSC::ArrayPrototype::ArrayPrototype):
+ (JSC::arrayProtoFuncToString):
+ (JSC::arrayProtoFuncJoin):
+ (JSC::arrayProtoFuncSort):
+ (JSC::arrayProtoFuncFilter):
+ (JSC::arrayProtoFuncMap):
+ (JSC::arrayProtoFuncEvery):
+ (JSC::arrayProtoFuncForEach):
+ (JSC::arrayProtoFuncSome):
+ (JSC::arrayProtoFuncReduce):
+ (JSC::arrayProtoFuncReduceRight):
+ * runtime/ArrayPrototype.h:
+ (ArrayPrototype):
+ (JSC::ArrayPrototype::createStructure):
+ * runtime/ArrayStorage.h: Added.
+ (JSC):
+ (ArrayStorage):
+ (JSC::ArrayStorage::ArrayStorage):
+ (JSC::ArrayStorage::from):
+ (JSC::ArrayStorage::butterfly):
+ (JSC::ArrayStorage::indexingHeader):
+ (JSC::ArrayStorage::length):
+ (JSC::ArrayStorage::setLength):
+ (JSC::ArrayStorage::vectorLength):
+ (JSC::ArrayStorage::setVectorLength):
+ (JSC::ArrayStorage::copyHeaderFromDuringGC):
+ (JSC::ArrayStorage::inSparseMode):
+ (JSC::ArrayStorage::lengthOffset):
+ (JSC::ArrayStorage::vectorLengthOffset):
+ (JSC::ArrayStorage::numValuesInVectorOffset):
+ (JSC::ArrayStorage::vectorOffset):
+ (JSC::ArrayStorage::indexBiasOffset):
+ (JSC::ArrayStorage::sparseMapOffset):
+ (JSC::ArrayStorage::sizeFor):
+ * runtime/Butterfly.h: Added.
+ (JSC):
+ (Butterfly):
+ (JSC::Butterfly::Butterfly):
+ (JSC::Butterfly::totalSize):
+ (JSC::Butterfly::fromBase):
+ (JSC::Butterfly::offsetOfIndexingHeader):
+ (JSC::Butterfly::offsetOfPublicLength):
+ (JSC::Butterfly::offsetOfVectorLength):
+ (JSC::Butterfly::indexingHeader):
+ (JSC::Butterfly::propertyStorage):
+ (JSC::Butterfly::indexingPayload):
+ (JSC::Butterfly::arrayStorage):
+ (JSC::Butterfly::offsetOfPropertyStorage):
+ (JSC::Butterfly::indexOfPropertyStorage):
+ (JSC::Butterfly::base):
+ * runtime/ButterflyInlineMethods.h: Added.
+ (JSC):
+ (JSC::Butterfly::createUninitialized):
+ (JSC::Butterfly::create):
+ (JSC::Butterfly::createUninitializedDuringCollection):
+ (JSC::Butterfly::base):
+ (JSC::Butterfly::growPropertyStorage):
+ (JSC::Butterfly::growArrayRight):
+ (JSC::Butterfly::resizeArray):
+ (JSC::Butterfly::unshift):
+ (JSC::Butterfly::shift):
+ * runtime/ClassInfo.h:
+ (MethodTable):
+ (JSC):
+ * runtime/IndexingHeader.h: Added.
+ (JSC):
+ (IndexingHeader):
+ (JSC::IndexingHeader::offsetOfIndexingHeader):
+ (JSC::IndexingHeader::offsetOfPublicLength):
+ (JSC::IndexingHeader::offsetOfVectorLength):
+ (JSC::IndexingHeader::IndexingHeader):
+ (JSC::IndexingHeader::vectorLength):
+ (JSC::IndexingHeader::setVectorLength):
+ (JSC::IndexingHeader::publicLength):
+ (JSC::IndexingHeader::setPublicLength):
+ (JSC::IndexingHeader::from):
+ (JSC::IndexingHeader::fromEndOf):
+ (JSC::IndexingHeader::propertyStorage):
+ (JSC::IndexingHeader::arrayStorage):
+ (JSC::IndexingHeader::butterfly):
+ * runtime/IndexingHeaderInlineMethods.h: Added.
+ (JSC):
+ (JSC::IndexingHeader::preCapacity):
+ (JSC::IndexingHeader::indexingPayloadSizeInBytes):
+ * runtime/IndexingType.h: Added.
+ (JSC):
+ (JSC::hasIndexingHeader):
+ * runtime/JSActivation.cpp:
+ (JSC::JSActivation::JSActivation):
+ (JSC::JSActivation::visitChildren):
+ (JSC::JSActivation::getOwnNonIndexPropertyNames):
+ * runtime/JSActivation.h:
+ (JSActivation):
+ (JSC::JSActivation::tearOff):
+ * runtime/JSArray.cpp:
+ (JSC):
+ (JSC::createArrayButterflyInDictionaryIndexingMode):
+ (JSC::JSArray::setLengthWritable):
+ (JSC::JSArray::defineOwnProperty):
+ (JSC::JSArray::getOwnPropertySlot):
+ (JSC::JSArray::getOwnPropertyDescriptor):
+ (JSC::JSArray::put):
+ (JSC::JSArray::deleteProperty):
+ (JSC::JSArray::getOwnNonIndexPropertyNames):
+ (JSC::JSArray::unshiftCountSlowCase):
+ (JSC::JSArray::setLength):
+ (JSC::JSArray::pop):
+ (JSC::JSArray::push):
+ (JSC::JSArray::shiftCount):
+ (JSC::JSArray::unshiftCount):
+ (JSC::JSArray::sortNumeric):
+ (JSC::JSArray::sort):
+ (JSC::JSArray::fillArgList):
+ (JSC::JSArray::copyToArguments):
+ (JSC::JSArray::compactForSorting):
+ * runtime/JSArray.h:
+ (JSC):
+ (JSArray):
+ (JSC::JSArray::JSArray):
+ (JSC::JSArray::length):
+ (JSC::JSArray::createStructure):
+ (JSC::JSArray::isLengthWritable):
+ (JSC::createArrayButterfly):
+ (JSC::JSArray::create):
+ (JSC::JSArray::tryCreateUninitialized):
+ * runtime/JSBoundFunction.cpp:
+ (JSC::boundFunctionCall):
+ (JSC::boundFunctionConstruct):
+ (JSC::JSBoundFunction::finishCreation):
+ * runtime/JSCell.cpp:
+ (JSC::JSCell::getOwnNonIndexPropertyNames):
+ (JSC):
+ * runtime/JSCell.h:
+ (JSCell):
+ * runtime/JSFunction.cpp:
+ (JSC::JSFunction::getOwnPropertySlot):
+ (JSC::JSFunction::getOwnPropertyDescriptor):
+ (JSC::JSFunction::getOwnNonIndexPropertyNames):
+ (JSC::JSFunction::defineOwnProperty):
+ * runtime/JSFunction.h:
+ (JSFunction):
+ * runtime/JSGlobalData.cpp:
+ (JSC::JSGlobalData::JSGlobalData):
+ * runtime/JSGlobalData.h:
+ (JSGlobalData):
+ * runtime/JSGlobalObject.cpp:
+ (JSC::JSGlobalObject::reset):
+ * runtime/JSONObject.cpp:
+ (JSC::Stringifier::Holder::appendNextProperty):
+ (JSC::Walker::walk):
+ * runtime/JSObject.cpp:
+ (JSC):
+ (JSC::JSObject::visitButterfly):
+ (JSC::JSObject::visitChildren):
+ (JSC::JSFinalObject::visitChildren):
+ (JSC::JSObject::getOwnPropertySlotByIndex):
+ (JSC::JSObject::put):
+ (JSC::JSObject::putByIndex):
+ (JSC::JSObject::enterDictionaryIndexingModeWhenArrayStorageAlreadyExists):
+ (JSC::JSObject::enterDictionaryIndexingMode):
+ (JSC::JSObject::createArrayStorage):
+ (JSC::JSObject::createInitialArrayStorage):
+ (JSC::JSObject::ensureArrayStorageExistsAndEnterDictionaryIndexingMode):
+ (JSC::JSObject::putDirectAccessor):
+ (JSC::JSObject::deleteProperty):
+ (JSC::JSObject::deletePropertyByIndex):
+ (JSC::JSObject::getOwnPropertyNames):
+ (JSC::JSObject::getOwnNonIndexPropertyNames):
+ (JSC::JSObject::preventExtensions):
+ (JSC::JSObject::fillGetterPropertySlot):
+ (JSC::JSObject::putIndexedDescriptor):
+ (JSC::JSObject::defineOwnIndexedProperty):
+ (JSC::JSObject::allocateSparseIndexMap):
+ (JSC::JSObject::deallocateSparseIndexMap):
+ (JSC::JSObject::putByIndexBeyondVectorLengthWithArrayStorage):
+ (JSC::JSObject::putByIndexBeyondVectorLength):
+ (JSC::JSObject::putDirectIndexBeyondVectorLengthWithArrayStorage):
+ (JSC::JSObject::putDirectIndexBeyondVectorLength):
+ (JSC::JSObject::getNewVectorLength):
+ (JSC::JSObject::increaseVectorLength):
+ (JSC::JSObject::checkIndexingConsistency):
+ (JSC::JSObject::growOutOfLineStorage):
+ (JSC::JSObject::getOwnPropertyDescriptor):
+ (JSC::putDescriptor):
+ (JSC::JSObject::putDirectMayBeIndex):
+ (JSC::JSObject::defineOwnNonIndexProperty):
+ (JSC::JSObject::defineOwnProperty):
+ (JSC::JSObject::getOwnPropertySlotSlow):
+ * runtime/JSObject.h:
+ (JSC::JSObject::getArrayLength):
+ (JSObject):
+ (JSC::JSObject::getVectorLength):
+ (JSC::JSObject::putDirectIndex):
+ (JSC::JSObject::canGetIndexQuickly):
+ (JSC::JSObject::getIndexQuickly):
+ (JSC::JSObject::canSetIndexQuickly):
+ (JSC::JSObject::setIndexQuickly):
+ (JSC::JSObject::initializeIndex):
+ (JSC::JSObject::completeInitialization):
+ (JSC::JSObject::inSparseIndexingMode):
+ (JSC::JSObject::butterfly):
+ (JSC::JSObject::outOfLineStorage):
+ (JSC::JSObject::offsetForLocation):
+ (JSC::JSObject::indexingShouldBeSparse):
+ (JSC::JSObject::butterflyOffset):
+ (JSC::JSObject::butterflyAddress):
+ (JSC::JSObject::arrayStorage):
+ (JSC::JSObject::arrayStorageOrZero):
+ (JSC::JSObject::ensureArrayStorage):
+ (JSC::JSObject::checkIndexingConsistency):
+ (JSC::JSNonFinalObject::JSNonFinalObject):
+ (JSC):
+ (JSC::JSObject::setButterfly):
+ (JSC::JSObject::setButterflyWithoutChangingStructure):
+ (JSC::JSObject::JSObject):
+ (JSC::JSObject::inlineGetOwnPropertySlot):
+ (JSC::JSObject::putDirectInternal):
+ (JSC::JSObject::setStructureAndReallocateStorageIfNecessary):
+ (JSC::JSObject::putDirectWithoutTransition):
+ (JSC::offsetInButterfly):
+ (JSC::offsetRelativeToPatchedStorage):
+ (JSC::indexRelativeToBase):
+ (JSC::offsetRelativeToBase):
+ * runtime/JSPropertyNameIterator.cpp:
+ (JSC::JSPropertyNameIterator::create):
+ * runtime/JSSymbolTableObject.cpp:
+ (JSC::JSSymbolTableObject::getOwnNonIndexPropertyNames):
+ * runtime/JSSymbolTableObject.h:
+ (JSSymbolTableObject):
+ * runtime/JSTypeInfo.h:
+ (JSC):
+ (JSC::TypeInfo::interceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero):
+ (JSC::TypeInfo::overridesGetPropertyNames):
+ * runtime/LiteralParser.cpp:
+ (JSC::::parse):
+ * runtime/ObjectConstructor.cpp:
+ * runtime/ObjectPrototype.cpp:
+ (JSC::ObjectPrototype::ObjectPrototype):
+ (JSC):
+ * runtime/ObjectPrototype.h:
+ (ObjectPrototype):
+ * runtime/PropertyOffset.h:
+ (JSC::offsetInOutOfLineStorage):
+ * runtime/PropertyStorage.h: Added.
+ (JSC):
+ * runtime/PutDirectIndexMode.h: Added.
+ (JSC):
+ * runtime/RegExpMatchesArray.cpp:
+ (JSC::RegExpMatchesArray::RegExpMatchesArray):
+ (JSC):
+ (JSC::RegExpMatchesArray::create):
+ (JSC::RegExpMatchesArray::finishCreation):
+ * runtime/RegExpMatchesArray.h:
+ (RegExpMatchesArray):
+ (JSC::RegExpMatchesArray::createStructure):
+ * runtime/RegExpObject.cpp:
+ (JSC::RegExpObject::getOwnNonIndexPropertyNames):
+ * runtime/RegExpObject.h:
+ (RegExpObject):
+ * runtime/Reject.h: Added.
+ (JSC):
+ (JSC::reject):
+ * runtime/SparseArrayValueMap.cpp: Added.
+ (JSC):
+ * runtime/SparseArrayValueMap.h: Added.
+ (JSC):
+ (SparseArrayEntry):
+ (JSC::SparseArrayEntry::SparseArrayEntry):
+ (SparseArrayValueMap):
+ (JSC::SparseArrayValueMap::sparseMode):
+ (JSC::SparseArrayValueMap::setSparseMode):
+ (JSC::SparseArrayValueMap::lengthIsReadOnly):
+ (JSC::SparseArrayValueMap::setLengthIsReadOnly):
+ (JSC::SparseArrayValueMap::find):
+ (JSC::SparseArrayValueMap::remove):
+ (JSC::SparseArrayValueMap::notFound):
+ (JSC::SparseArrayValueMap::isEmpty):
+ (JSC::SparseArrayValueMap::contains):
+ (JSC::SparseArrayValueMap::size):
+ (JSC::SparseArrayValueMap::begin):
+ (JSC::SparseArrayValueMap::end):
+ * runtime/SparseArrayValueMapInlineMethods.h: Added.
+ (JSC):
+ (JSC::SparseArrayValueMap::SparseArrayValueMap):
+ (JSC::SparseArrayValueMap::~SparseArrayValueMap):
+ (JSC::SparseArrayValueMap::finishCreation):
+ (JSC::SparseArrayValueMap::create):
+ (JSC::SparseArrayValueMap::destroy):
+ (JSC::SparseArrayValueMap::createStructure):
+ (JSC::SparseArrayValueMap::add):
+ (JSC::SparseArrayValueMap::putEntry):
+ (JSC::SparseArrayValueMap::putDirect):
+ (JSC::SparseArrayEntry::get):
+ (JSC::SparseArrayEntry::getNonSparseMode):
+ (JSC::SparseArrayValueMap::visitChildren):
+ * runtime/StorageBarrier.h: Removed.
+ * runtime/StringObject.cpp:
+ (JSC::StringObject::putByIndex):
+ (JSC):
+ (JSC::StringObject::deletePropertyByIndex):
+ * runtime/StringObject.h:
+ (StringObject):
+ * runtime/StringPrototype.cpp:
+ * runtime/Structure.cpp:
+ (JSC::Structure::Structure):
+ (JSC::Structure::materializePropertyMap):
+ (JSC::Structure::nonPropertyTransition):
+ (JSC):
+ * runtime/Structure.h:
+ (Structure):
+ (JSC::Structure::indexingType):
+ (JSC::Structure::indexingTypeIncludingHistory):
+ (JSC::Structure::indexingTypeOffset):
+ (JSC::Structure::create):
+ * runtime/StructureTransitionTable.h:
+ (JSC):
+ (JSC::toAttributes):
+ (JSC::newIndexingType):
+ (JSC::StructureTransitionTable::Hash::hash):
+ * tests/mozilla/js1_6/Array/regress-304828.js:
+
+2012-09-12 Mark Lam <mark.lam@apple.com>
+
+ Refactor Opcodes to distinguish between core and extension opcodes.
+ https://bugs.webkit.org/show_bug.cgi?id=96466.
+
+ Reviewed by Filip Pizlo.
+
+ * bytecode/Opcode.h:
+ (JSC): Added FOR_EACH_CORE_OPCODE_ID() macro.
+ * llint/LowLevelInterpreter.h:
+ (JSC): Auto-generate llint opcode aliases using the
+ FOR_EACH_CORE_OPCODE_ID() macro.
+
+2012-09-11 Geoffrey Garen <ggaren@apple.com>
+
+ Second step to fixing the Windows build: Add new symbols.
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2012-09-11 Geoffrey Garen <ggaren@apple.com>
+
+ First step to fixing the Windows build: Remove old symbols.
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2012-09-11 Geoffrey Garen <ggaren@apple.com>
+
+ Don't allocate a backing store just for a function's name
+ https://bugs.webkit.org/show_bug.cgi?id=96468
+
+ Reviewed by Oliver Hunt.
+
+ Treat function.name like function.length etc., and use a custom getter.
+ This saves space in closures.
+
+ * debugger/DebuggerCallFrame.cpp:
+ (JSC::DebuggerCallFrame::functionName):
+ * debugger/DebuggerCallFrame.h:
+ (DebuggerCallFrame): Updated for interface change.
+
+ * runtime/Executable.h:
+ (JSC::JSFunction::JSFunction): Do a little inlining.
+
+ * runtime/JSFunction.cpp:
+ (JSC::JSFunction::finishCreation): Gone now. That's the point of the patch.
+
+ (JSC::JSFunction::name):
+ (JSC::JSFunction::displayName):
+ (JSC::JSFunction::nameGetter):
+ (JSC::JSFunction::getOwnPropertySlot):
+ (JSC::JSFunction::getOwnPropertyDescriptor):
+ (JSC::JSFunction::getOwnPropertyNames):
+ (JSC::JSFunction::put):
+ (JSC::JSFunction::deleteProperty):
+ (JSC::JSFunction::defineOwnProperty): Added custom accessors for .name
+ just like .length and others.
+
+ * runtime/JSFunction.h:
+ (JSC::JSFunction::create):
+ (JSFunction): Updated for interface changes.
+
+2012-09-11 Mark Hahnenberg <mhahnenberg@apple.com>
+
+ IncrementalSweeper should not sweep/free Zapped blocks
+ https://bugs.webkit.org/show_bug.cgi?id=96464
+
+ Reviewed by Filip Pizlo.
+
+ This is not beneficial in terms of performance because there isn't any way a block can emerge
+ in the Zapped state from a call to Heap::collect() unless we run an eager sweep on it, in which
+ case we've already run all the destructors we possibly can. This also causes bugs since we don't
+ take zapped-ness into account when determining whether or not a block is empty to free it. The
+ incremental sweeper can then accidentally free blocks that it thinks are empty but are in fact
+ zapped with still-live objects in them.
+
+ * heap/MarkedBlock.h:
+ (JSC::MarkedBlock::needsSweeping): It is only valid to sweep a block if it is in the Marked state.
+
+2012-09-11 Geoffrey Garen <ggaren@apple.com>
+
+ JSActivation should inline allocate its registers, and eliminate
+ 'arguments' registers in the common case
+ https://bugs.webkit.org/show_bug.cgi?id=96427
+
+ Reviewed by Filip Pizlo.
+
+ This cuts the size class for simple closures down to 64 bytes.
+
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::BytecodeGenerator): Set the usesNonStrictEval
+ flag, which is new. Use a more specific test for whether a function
+ uses 'arguments', so we can avoid allocating, initializing, and tearing
+ off those registers in the common case. Distinguish between capturing
+ arguments and not, so we can avoid allocating space for arguments in
+ the torn-off object.
+
+ We can make this even more general in the future, with some bytecode
+ generator refactoring.
+
+ (JSC::BytecodeGenerator::resolve): Updated for new interface.
+
+ * bytecompiler/BytecodeGenerator.h:
+ (BytecodeGenerator):
+ (JSC::BytecodeGenerator::symbolTable): Updated some types.
+
+ * heap/Heap.cpp:
+ (JSC::Heap::isValidAllocation): Allow large allocations, now that they
+ are both supported and used.
+
+ * heap/Heap.h:
+ (Heap): Added a new form of allocateCell that specifies the full size
+ of the allocation, to allow for extra space on the end.
+
+ * interpreter/CallFrame.h:
+ (JSC::ExecState::argumentOffset):
+ (JSC::ExecState::argumentOffsetIncludingThis):
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::unwindCallFrame): Refactored this code to be more
+ specific about tearing off 'arguments' vs activations. This is something
+ I forgot in my last patch, and it is required now that we can have
+ acitvations without 'arguments' registers.
+
+ * runtime/Arguments.h:
+ (JSC::Arguments::setRegisters): No need for setRegisters anymore because
+ the activation object's storage doesn't change.
+
+ * runtime/JSActivation.cpp:
+ (JSC::JSActivation::JSActivation): Initialize our storage manually because
+ it's not declared to the C++ compiler.
+
+ (JSC::JSActivation::visitChildren): No copyAndAppend because our storage
+ is not out-of-line anymore.
+
+ (JSC::JSActivation::symbolTableGet):
+ (JSC::JSActivation::symbolTablePut):
+ (JSC::JSActivation::getOwnPropertyNames):
+ (JSC::JSActivation::symbolTablePutWithAttributes):
+ (JSC::JSActivation::getOwnPropertySlot):
+ (JSC::JSActivation::getOwnPropertyDescriptor):
+ (JSC::JSActivation::argumentsGetter): Refactored isTornOff() testing to
+ avoid using a data member and to avoid hard-coding any offset assumptions.
+
+ * runtime/JSActivation.h:
+ (JSC):
+ (JSActivation):
+ (JSC::JSActivation::create):
+ (JSC::JSActivation::isDynamicScope):
+ (JSC::JSActivation::captureStart):
+ (JSC::JSActivation::storageSize):
+ (JSC::JSActivation::storageSizeInBytes):
+ (JSC::JSActivation::registerOffset):
+ (JSC::JSActivation::tearOff):
+ (JSC::JSActivation::isTornOff):
+ (JSC::JSActivation::storage):
+ (JSC::JSActivation::allocationSize):
+ (JSC::JSActivation::isValid): New helper functions for doing the math
+ on our inline storage. Note that in the "AllOfTheThings" tear-off case,
+ the number of things is not known at compile time, so we store the
+ number in the argument count register. We can't just copy the raw contents
+ of the register beacuse we need a value that is safe for precise marking,
+ and the value in the register file has an invalid tag.
+
+ * runtime/JSCell.h:
+ (JSC::allocateCell): New function for allocating with extra storage
+ on the end.
+
+ * runtime/JSSymbolTableObject.h:
+ (JSC::JSSymbolTableObject::JSSymbolTableObject):
+ (JSC::JSSymbolTableObject::finishCreation):
+ * runtime/JSVariableObject.h:
+ (JSC::JSVariableObject::JSVariableObject):
+ (JSVariableObject): Make it easier for subclasses to use their symbol
+ tables during construction, by passing the table as a constructor argument.
+
+ * runtime/SymbolTable.h:
+ (JSC::SharedSymbolTable::usesNonStrictEval):
+ (JSC::SharedSymbolTable::setUsesNonStrictEval):
+ (SharedSymbolTable):
+ (JSC::SharedSymbolTable::captureMode):
+ (JSC::SharedSymbolTable::setCaptureMode):
+ (JSC::SharedSymbolTable::captureStart):
+ (JSC::SharedSymbolTable::setCaptureStart):
+ (JSC::SharedSymbolTable::captureEnd):
+ (JSC::SharedSymbolTable::setCaptureEnd):
+ (JSC::SharedSymbolTable::parameterCountIncludingThis):
+ (JSC::SharedSymbolTable::setParameterCountIncludingThis):
+ (JSC::SharedSymbolTable::SharedSymbolTable): Added data members to more
+ precisely describe what kind of capture is in play, and to avoid having
+ data members in the activation. We expect N activations per symbol table,
+ so this can be a big savings in heavy closure usage.
+
+2012-09-11 Ryuan Choi <ryuan.choi@samsung.com>
+
+ Fix build break with LLINT on 32bit machine after r128219
+ https://bugs.webkit.org/show_bug.cgi?id=96461
+
+ Unreviewed build fix.
+
+ * llint/LowLevelInterpreter32_64.asm: Fixed typo.
+
+2012-09-11 Michael Saboff <msaboff@apple.com>
+
+ Build fixed for http://trac.webkit.org/changeset/128243
+
+ Rubber stamped by Stephanie Lewis.
+
+ Added missing include file needed by 96422.
+
+ * icu/unicode/unorm2.h: Added.
+
+2012-09-11 Michael Saboff <msaboff@apple.com>
+
+ Build fixed for http://trac.webkit.org/changeset/128243
+
+ Rubber stamped by Stephanie Lewis.
+
+ Added missing include file needed by 96422.
+
+ * icu/unicode/ptypes.h: Added.
+
+2012-09-11 Michael Saboff <msaboff@apple.com>
+
+ Update ICU header files to more recent version
+ https://bugs.webkit.org/show_bug.cgi?id=96422
+
+ Reviewed by Geoff Garen.
+
+ Updated ICU header files to 4.6.1. Modifications made as part of the merge are:
+ platform.h - Changed ifndef / define / endif for U_HAVE_UINT8_T, U_HAVE_UINT16_T, U_HAVE_UINT32_T,
+ U_HAVE_UINT64_T, U_IS_BIG_ENDIAN and U_ENABLE_TRACING to match the existing platform.h
+ putil.h (line 132) - Changes defined(U_WINDOWS) to defined(WIN32) || defined(OS2) to match existing putil.h
+ ustring.h (line 945) - Wrapped macro argument cs with { (const UChar *)cs } to match existing ustring.h
+ utypes.h (line 545) - Changed defined(U_WINDOWS) to defined(WIN32) to match existing utypes.h
+
+ * icu/unicode/localpointer.h: Added.
+ * icu/unicode/parseerr.h:
+ * icu/unicode/platform.h:
+ * icu/unicode/putil.h:
+ * icu/unicode/uchar.h:
+ * icu/unicode/ucnv.h:
+ * icu/unicode/ucnv_err.h:
+ * icu/unicode/ucol.h:
+ * icu/unicode/uconfig.h:
+ * icu/unicode/uenum.h:
+ * icu/unicode/uiter.h:
+ * icu/unicode/uloc.h:
+ * icu/unicode/umachine.h:
+ * icu/unicode/unorm.h:
+ * icu/unicode/urename.h:
+ * icu/unicode/uscript.h:
+ * icu/unicode/uset.h:
+ * icu/unicode/ustring.h:
+ * icu/unicode/utf.h:
+ * icu/unicode/utf16.h:
+ * icu/unicode/utf8.h:
+ * icu/unicode/utypes.h:
+ * icu/unicode/uvernum.h: Added.
+ * icu/unicode/uversion.h:
+
+2012-09-11 Matt Lilek <mrl@apple.com>
+
+ OS X port should compile with newer versions of clang
+ https://bugs.webkit.org/show_bug.cgi?id=96434
+
+ m_identIsVarDecl is unused - remove it.
+
+ Reviewed by Anders Carlsson.
+
+ * parser/NodeConstructors.h:
+ (JSC::ForInNode::ForInNode):
+ * parser/Nodes.h:
+ (ForInNode):
+
+2012-09-11 Filip Pizlo <fpizlo@apple.com>
+
+ LLInt should optimize and profile array length accesses
+ https://bugs.webkit.org/show_bug.cgi?id=96417
+
+ Reviewed by Oliver Hunt.
+
+ This fixes the following hole in our array profiling strategy, where the array
+ is large (more than 1000 elements):
+
+ for (var i = 0; i < array.length; ++i) ...
+
+ The peeled use of array.length (in the array prologue) will execute only once
+ before DFG optimization kicks in from the loop's OSR point. Since it executed
+ only once, it executed in the LLInt. And prior to this patch, the LLInt did
+ not profile array.length accesses - so the DFG will assume, based on the lack
+ of profiling, that the access is in fact not an access to the JSArray length
+ property. That could then impede our ability to hoist the array structure
+ check, and may make us pessimistic in other ways as well, since the generic
+ GetById used for the array length access will be viewed as a side-effecting
+ operation.
+
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::printGetByIdCacheStatus):
+ (JSC::CodeBlock::finalizeUnconditionally):
+ * bytecode/GetByIdStatus.cpp:
+ (JSC::GetByIdStatus::computeFromLLInt):
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::parseBlock):
+ * dfg/DFGCapabilities.h:
+ (JSC::DFG::canCompileOpcode):
+ * dfg/DFGFixupPhase.cpp:
+ (JSC::DFG::FixupPhase::fixupNode):
+ * jit/JIT.cpp:
+ (JSC::JIT::privateCompileMainPass):
+ (JSC::JIT::privateCompileSlowCases):
+ * llint/LLIntSlowPaths.cpp:
+ (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+ * llint/LowLevelInterpreter.asm:
+ * llint/LowLevelInterpreter32_64.asm:
+ * llint/LowLevelInterpreter64.asm:
+
2012-09-11 Raphael Kubo da Costa <rakuco@webkit.org>
[EFL] Rewrite the EFL-related Find modules
diff --git a/Source/JavaScriptCore/GNUmakefile.list.am b/Source/JavaScriptCore/GNUmakefile.list.am
index 9d8161fdd..b1715248c 100644
--- a/Source/JavaScriptCore/GNUmakefile.list.am
+++ b/Source/JavaScriptCore/GNUmakefile.list.am
@@ -457,8 +457,10 @@ javascriptcore_sources += \
Source/JavaScriptCore/runtime/Arguments.h \
Source/JavaScriptCore/runtime/ArrayConstructor.cpp \
Source/JavaScriptCore/runtime/ArrayConstructor.h \
+ Source/JavaScriptCore/runtime/ArrayConventions.h \
Source/JavaScriptCore/runtime/ArrayPrototype.cpp \
Source/JavaScriptCore/runtime/ArrayPrototype.h \
+ Source/JavaScriptCore/runtime/ArrayStorage.h \
Source/JavaScriptCore/runtime/BatchedTransitionOptimizer.h \
Source/JavaScriptCore/runtime/BigInteger.h \
Source/JavaScriptCore/runtime/BooleanConstructor.cpp \
@@ -467,6 +469,8 @@ javascriptcore_sources += \
Source/JavaScriptCore/runtime/BooleanObject.h \
Source/JavaScriptCore/runtime/BooleanPrototype.cpp \
Source/JavaScriptCore/runtime/BooleanPrototype.h \
+ Source/JavaScriptCore/runtime/ButterflyInlineMethods.h \
+ Source/JavaScriptCore/runtime/Butterfly.h \
Source/JavaScriptCore/runtime/CachedTranscendentalFunction.h \
Source/JavaScriptCore/runtime/CallData.cpp \
Source/JavaScriptCore/runtime/CallData.h \
@@ -511,6 +515,9 @@ javascriptcore_sources += \
Source/JavaScriptCore/runtime/GetterSetter.h \
Source/JavaScriptCore/runtime/Identifier.cpp \
Source/JavaScriptCore/runtime/Identifier.h \
+ Source/JavaScriptCore/runtime/IndexingHeaderInlineMethods.h \
+ Source/JavaScriptCore/runtime/IndexingHeader.h \
+ Source/JavaScriptCore/runtime/IndexingType.h \
Source/JavaScriptCore/runtime/InitializeThreading.cpp \
Source/JavaScriptCore/runtime/InitializeThreading.h \
Source/JavaScriptCore/runtime/InternalFunction.cpp \
@@ -616,7 +623,9 @@ javascriptcore_sources += \
Source/JavaScriptCore/runtime/PropertyOffset.h \
Source/JavaScriptCore/runtime/PropertySlot.cpp \
Source/JavaScriptCore/runtime/PropertySlot.h \
+ Source/JavaScriptCore/runtime/PropertyStorage.h \
Source/JavaScriptCore/runtime/Protect.h \
+ Source/JavaScriptCore/runtime/PutDirectIndexMode.h \
Source/JavaScriptCore/runtime/PutPropertySlot.h \
Source/JavaScriptCore/runtime/RegExpCache.cpp \
Source/JavaScriptCore/runtime/RegExpCache.h \
@@ -633,11 +642,14 @@ javascriptcore_sources += \
Source/JavaScriptCore/runtime/RegExpObject.h \
Source/JavaScriptCore/runtime/RegExpPrototype.cpp \
Source/JavaScriptCore/runtime/RegExpPrototype.h \
+ Source/JavaScriptCore/runtime/Reject.h \
Source/JavaScriptCore/runtime/SamplingCounter.cpp \
Source/JavaScriptCore/runtime/SamplingCounter.h \
Source/JavaScriptCore/runtime/SmallStrings.cpp \
Source/JavaScriptCore/runtime/SmallStrings.h \
- Source/JavaScriptCore/runtime/StorageBarrier.h \
+ Source/JavaScriptCore/runtime/SparseArrayValueMapInlineMethods.h \
+ Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp \
+ Source/JavaScriptCore/runtime/SparseArrayValueMap.h \
Source/JavaScriptCore/runtime/StrictEvalActivation.cpp \
Source/JavaScriptCore/runtime/StrictEvalActivation.h \
Source/JavaScriptCore/runtime/StringConstructor.cpp \
diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
index 843bd1475..4d54364f0 100755
--- a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
+++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
@@ -22,7 +22,7 @@ EXPORTS
??0RegExpObject@JSC@@IAE@PAVJSGlobalObject@1@PAVStructure@1@PAVRegExp@1@@Z
??0SHA1@WTF@@QAE@XZ
??0StringObject@JSC@@IAE@AAVJSGlobalData@1@PAVStructure@1@@Z
- ??0Structure@JSC@@AAE@AAVJSGlobalData@1@PAVJSGlobalObject@1@VJSValue@1@ABVTypeInfo@1@PBUClassInfo@1@@Z
+ ??0Structure@JSC@@AAE@AAVJSGlobalData@1@PAVJSGlobalObject@1@VJSValue@1@ABVTypeInfo@1@PBUClassInfo@1@E@Z
??0ThreadCondition@WTF@@QAE@XZ
??0WTFThreadData@WTF@@QAE@XZ
??0YarrPattern@Yarr@JSC@@QAE@ABVString@WTF@@_N1PAPBD@Z
@@ -162,8 +162,8 @@ EXPORTS
?detach@Debugger@JSC@@UAEXPAVJSGlobalObject@2@@Z
?detachThread@WTF@@YAXI@Z
?didTimeOut@TimeoutChecker@JSC@@QAE_NPAVExecState@2@@Z
+ ?displayName@JSFunction@JSC@@QAE?AVString@WTF@@PAVExecState@2@@Z
?deleteAllCompiledCode@Heap@JSC@@QAEXXZ
- ?displayName@JSFunction@JSC@@QAE?BVString@WTF@@PAVExecState@2@@Z
?dtoa@WTF@@YAXQADNAA_NAAHAAI@Z
?dumpAllOptions@Options@JSC@@SAXPAU_iobuf@@@Z
?dumpCallFrame@Interpreter@JSC@@QAEXPAVExecState@2@@Z
@@ -185,13 +185,12 @@ EXPORTS
?fastRealloc@WTF@@YAPAXPAXI@Z
?fastStrDup@WTF@@YAPADPBD@Z
?fastZeroedMalloc@WTF@@YAPAXI@Z
- ?fillGetterPropertySlot@JSObject@JSC@@AAEXAAVPropertySlot@2@PAV?$WriteBarrierBase@W4Unknown@JSC@@@2@@Z
+ ?fillGetterPropertySlot@JSObject@JSC@@AAEXAAVPropertySlot@2@H@Z
?finalize@WeakHandleOwner@JSC@@UAEXV?$Handle@W4Unknown@JSC@@@2@PAX@Z
?findAllocator@WeakSet@JSC@@AAEPAUFreeCell@WeakBlock@2@XZ
?finishCreation@BooleanObject@JSC@@IAEXAAVJSGlobalData@2@@Z
?finishCreation@DateInstance@JSC@@IAEXAAVJSGlobalData@2@N@Z
?finishCreation@InternalFunction@JSC@@IAEXAAVJSGlobalData@2@ABVString@WTF@@@Z
- ?finishCreation@JSArray@JSC@@IAEXAAVJSGlobalData@2@I@Z
?finishCreation@RegExpObject@JSC@@IAEXPAVJSGlobalObject@2@@Z
?finishCreation@StringObject@JSC@@IAEXAAVJSGlobalData@2@PAVJSString@2@@Z
?focus@Profile@JSC@@QAEXPBVProfileNode@2@@Z
@@ -204,13 +203,14 @@ EXPORTS
?getCallableObjectSlow@JSC@@YAPAVJSCell@1@PAV21@@Z
?getConstructData@JSCell@JSC@@SA?AW4ConstructType@2@PAV12@AATConstructData@2@@Z
?getObject@JSCell@JSC@@QAEPAVJSObject@2@XZ
+ ?getOwnNonIndexPropertyNames@JSObject@JSC@@SAXPAV12@PAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z
+ ?getOwnNonIndexPropertyNames@JSSymbolTableObject@JSC@@SAXPAVJSObject@2@PAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z
?getOwnPropertyDescriptor@JSGlobalObject@JSC@@SA_NPAVJSObject@2@PAVExecState@2@VPropertyName@2@AAVPropertyDescriptor@2@@Z
?getOwnPropertyDescriptor@JSObject@JSC@@SA_NPAV12@PAVExecState@2@VPropertyName@2@AAVPropertyDescriptor@2@@Z
?getOwnPropertyNames@JSObject@JSC@@SAXPAV12@PAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z
- ?getOwnPropertyNames@JSSymbolTableObject@JSC@@SAXPAVJSObject@2@PAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z
?getOwnPropertySlot@JSGlobalObject@JSC@@SA_NPAVJSCell@2@PAVExecState@2@VPropertyName@2@AAVPropertySlot@2@@Z
- ?getOwnPropertySlotByIndex@JSArray@JSC@@SA_NPAVJSCell@2@PAVExecState@2@IAAVPropertySlot@2@@Z
?getOwnPropertySlotByIndex@JSObject@JSC@@SA_NPAVJSCell@2@PAVExecState@2@IAAVPropertySlot@2@@Z
+ ?getOwnPropertySlotSlow@JSObject@JSC@@AAE_NPAVExecState@2@VPropertyName@2@AAVPropertySlot@2@@Z
?getPropertyNames@JSObject@JSC@@SAXPAV12@PAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z
?getSlice@ArgList@JSC@@QBEXHAAV12@@Z
?getStackTrace@Interpreter@JSC@@SAXPAVJSGlobalData@2@AAV?$Vector@UStackFrame@JSC@@$0A@@WTF@@@Z
@@ -220,8 +220,8 @@ EXPORTS
?getter@PropertyDescriptor@JSC@@QBE?AVJSValue@2@XZ
?globalExec@JSGlobalObject@JSC@@QAEPAVExecState@2@XZ
?globalObjectCount@Heap@JSC@@QAEIXZ
- ?growOutOfLineStorage@JSObject@JSC@@QAEPAV?$WriteBarrierBase@W4Unknown@JSC@@@2@AAVJSGlobalData@2@II@Z
?grow@HandleSet@JSC@@AAEXXZ
+ ?growOutOfLineStorage@JSObject@JSC@@QAEPAVButterfly@2@AAVJSGlobalData@2@II@Z
?hasInstance@JSObject@JSC@@SA_NPAV12@PAVExecState@2@VJSValue@2@2@Z
?hasProperty@JSObject@JSC@@QBE_NPAVExecState@2@I@Z
?hasProperty@JSObject@JSC@@QBE_NPAVExecState@2@VPropertyName@2@@Z
@@ -253,7 +253,7 @@ EXPORTS
?monotonicallyIncreasingTime@WTF@@YANXZ
?monthFromDayInYear@WTF@@YAHH_N@Z
?msToYear@WTF@@YAHN@Z
- ?name@JSFunction@JSC@@QAEABVString@WTF@@PAVExecState@2@@Z
+ ?name@JSFunction@JSC@@QAE?AVString@WTF@@PAVExecState@2@@Z
?neuter@ArrayBufferView@WTF@@MAEXXZ
?newUninitialized@CString@WTF@@SA?AV12@IAAPAD@Z
?notifyWriteSlow@SymbolTableEntry@JSC@@AAEXXZ
@@ -276,7 +276,7 @@ EXPORTS
?put@JSGlobalObject@JSC@@SAXPAVJSCell@2@PAVExecState@2@VPropertyName@2@VJSValue@2@AAVPutPropertySlot@2@@Z
?put@JSObject@JSC@@SAXPAVJSCell@2@PAVExecState@2@VPropertyName@2@VJSValue@2@AAVPutPropertySlot@2@@Z
?putByIndex@JSObject@JSC@@SAXPAVJSCell@2@PAVExecState@2@IVJSValue@2@_N@Z
- ?putDirectIndexBeyondVectorLength@JSArray@JSC@@AAE_NPAVExecState@2@IVJSValue@2@W4PutDirectIndexMode@2@@Z
+ ?putDirectIndexBeyondVectorLength@JSObject@JSC@@AAE_NPAVExecState@2@IVJSValue@2@IW4PutDirectIndexMode@2@@Z
?putDirectVirtual@JSGlobalObject@JSC@@SAXPAVJSObject@2@PAVExecState@2@VPropertyName@2@VJSValue@2@I@Z
?putDirectVirtual@JSObject@JSC@@SAXPAV12@PAVExecState@2@VPropertyName@2@VJSValue@2@I@Z
?randomNumber@WTF@@YANXZ
@@ -355,10 +355,10 @@ EXPORTS
?toThisObjectSlowCase@JSValue@JSC@@ABEPAVJSObject@2@PAVExecState@2@@Z
?toWTFStringSlowCase@JSValue@JSC@@ABE?AVString@WTF@@PAVExecState@2@@Z
?transfer@ArrayBuffer@WTF@@QAE_NAAVArrayBufferContents@2@AAV?$Vector@V?$RefPtr@VArrayBufferView@WTF@@@WTF@@$0A@@2@@Z
+ ?tryAllocateSlowCase@CopiedSpace@JSC@@AAE?AVCheckedBoolean@@IPAPAX@Z
?tryFastCalloc@WTF@@YA?AUTryMallocReturnValue@1@II@Z
?tryFastMalloc@WTF@@YA?AUTryMallocReturnValue@1@I@Z
?tryFastRealloc@WTF@@YA?AUTryMallocReturnValue@1@PAXI@Z
- ?tryFinishCreationUninitialized@JSArray@JSC@@IAEPAV12@AAVJSGlobalData@2@I@Z
?tryLock@Mutex@WTF@@QAE_NXZ
?type@DebuggerCallFrame@JSC@@QBE?AW4Type@12@XZ
?unlock@JSLock@JSC@@QAEXXZ
diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
index 43fdfb21a..d75be0b67 100644
--- a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
+++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
@@ -514,6 +514,58 @@
Name="runtime"
>
<File
+ RelativePath="..\..\runtime\Reject.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\runtime\SparseArrayValueMapInlineMethods.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\runtime\ArrayStorage.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\runtime\IndexingType.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\runtime\PropertyStorage.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\runtime\PutDirectIndexMode.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\runtime\ButterflyInlineMethods.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\runtime\Butterfly.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\runtime\IndexingHeaderInlineMethods.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\runtime\SparseArrayValueMap.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\runtime\ArrayConventions.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\runtime\IndexingHeader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\runtime\SparseArrayValueMap.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\runtime\ArgList.cpp"
>
</File>
diff --git a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
index 7d180ebae..db75c0761 100644
--- a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
+++ b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
@@ -73,6 +73,8 @@
0F0B83B514BCF86200885B4F /* MethodCallLinkInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83B314BCF85E00885B4F /* MethodCallLinkInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F0B83B714BCF8E100885B4F /* GlobalResolveInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83B614BCF8DF00885B4F /* GlobalResolveInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F0B83B914BCF95F00885B4F /* CallReturnOffsetToBytecodeOffset.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83B814BCF95B00885B4F /* CallReturnOffsetToBytecodeOffset.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0F0CD4C215F1A6070032F1C0 /* PutDirectIndexMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0CD4C015F1A6040032F1C0 /* PutDirectIndexMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0F0CD4C415F6B6BB0032F1C0 /* SparseArrayValueMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F0CD4C315F6B6B50032F1C0 /* SparseArrayValueMap.cpp */; };
0F0FC45A14BD15F500B81154 /* LLIntCallLinkInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0FC45814BD15F100B81154 /* LLIntCallLinkInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F15F15F14B7A73E005DE37D /* CommonSlowPaths.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F15F15D14B7A73A005DE37D /* CommonSlowPaths.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F16015D156198C900C2587C /* DFGArgumentsSimplificationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F16015A156198BF00C2587C /* DFGArgumentsSimplificationPhase.cpp */; };
@@ -188,6 +190,17 @@
0FB5467914F5C46B002C2989 /* LazyOperandValueProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB5467814F5C468002C2989 /* LazyOperandValueProfile.cpp */; };
0FB5467B14F5C7E1002C2989 /* MethodOfGettingAValueProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB5467A14F5C7D4002C2989 /* MethodOfGettingAValueProfile.h */; settings = {ATTRIBUTES = (Private, ); }; };
0FB5467D14F5CFD6002C2989 /* MethodOfGettingAValueProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB5467C14F5CFD3002C2989 /* MethodOfGettingAValueProfile.cpp */; };
+ 0FB7F39515ED8E4600F167B2 /* ArrayConventions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38915ED8E3800F167B2 /* ArrayConventions.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0FB7F39615ED8E4600F167B2 /* ArrayStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38A15ED8E3800F167B2 /* ArrayStorage.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0FB7F39715ED8E4600F167B2 /* Butterfly.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38B15ED8E3800F167B2 /* Butterfly.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0FB7F39815ED8E4600F167B2 /* ButterflyInlineMethods.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38C15ED8E3800F167B2 /* ButterflyInlineMethods.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0FB7F39915ED8E4600F167B2 /* IndexingHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38D15ED8E3800F167B2 /* IndexingHeader.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0FB7F39A15ED8E4600F167B2 /* IndexingHeaderInlineMethods.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38E15ED8E3800F167B2 /* IndexingHeaderInlineMethods.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0FB7F39B15ED8E4600F167B2 /* IndexingType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38F15ED8E3800F167B2 /* IndexingType.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0FB7F39C15ED8E4600F167B2 /* PropertyStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F39015ED8E3800F167B2 /* PropertyStorage.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0FB7F39D15ED8E4600F167B2 /* Reject.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F39115ED8E3800F167B2 /* Reject.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0FB7F39E15ED8E4600F167B2 /* SparseArrayValueMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F39215ED8E3800F167B2 /* SparseArrayValueMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0FB7F39F15ED8E4600F167B2 /* SparseArrayValueMapInlineMethods.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F39315ED8E3800F167B2 /* SparseArrayValueMapInlineMethods.h */; settings = {ATTRIBUTES = (Private, ); }; };
0FBC0AE71496C7C400D4FBDD /* DFGExitProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FBC0AE41496C7C100D4FBDD /* DFGExitProfile.cpp */; };
0FBC0AE81496C7C700D4FBDD /* DFGExitProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FBC0AE51496C7C100D4FBDD /* DFGExitProfile.h */; settings = {ATTRIBUTES = (Private, ); }; };
0FBD7E691447999600481315 /* CodeOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FBD7E671447998F00481315 /* CodeOrigin.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -566,7 +579,6 @@
A766B44F0EE8DCD1009518CA /* ExecutableAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; };
A76C51761182748D00715B05 /* JSInterfaceJIT.h in Headers */ = {isa = PBXBuildFile; fileRef = A76C51741182748D00715B05 /* JSInterfaceJIT.h */; settings = {ATTRIBUTES = (Private, ); }; };
A76F54A313B28AAB00EF2BCE /* JITWriteBarrier.h in Headers */ = {isa = PBXBuildFile; fileRef = A76F54A213B28AAB00EF2BCE /* JITWriteBarrier.h */; };
- A781E359141970C700094D90 /* StorageBarrier.h in Headers */ = {isa = PBXBuildFile; fileRef = A781E358141970C700094D90 /* StorageBarrier.h */; settings = {ATTRIBUTES = (Private, ); }; };
A784A26111D16622005776AC /* ASTBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A7EE7411B98B8D0065A14F /* ASTBuilder.h */; };
A784A26411D16622005776AC /* SyntaxChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A7EE7711B98B8D0065A14F /* SyntaxChecker.h */; };
A7B48F490EE8936F00DCBDB6 /* ExecutableAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */; };
@@ -831,6 +843,8 @@
0F0B83B314BCF85E00885B4F /* MethodCallLinkInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MethodCallLinkInfo.h; sourceTree = "<group>"; };
0F0B83B614BCF8DF00885B4F /* GlobalResolveInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GlobalResolveInfo.h; sourceTree = "<group>"; };
0F0B83B814BCF95B00885B4F /* CallReturnOffsetToBytecodeOffset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallReturnOffsetToBytecodeOffset.h; sourceTree = "<group>"; };
+ 0F0CD4C015F1A6040032F1C0 /* PutDirectIndexMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PutDirectIndexMode.h; sourceTree = "<group>"; };
+ 0F0CD4C315F6B6B50032F1C0 /* SparseArrayValueMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SparseArrayValueMap.cpp; sourceTree = "<group>"; };
0F0FC45814BD15F100B81154 /* LLIntCallLinkInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LLIntCallLinkInfo.h; sourceTree = "<group>"; };
0F15F15D14B7A73A005DE37D /* CommonSlowPaths.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonSlowPaths.h; sourceTree = "<group>"; };
0F16015A156198BF00C2587C /* DFGArgumentsSimplificationPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGArgumentsSimplificationPhase.cpp; path = dfg/DFGArgumentsSimplificationPhase.cpp; sourceTree = "<group>"; };
@@ -947,6 +961,17 @@
0FB5467814F5C468002C2989 /* LazyOperandValueProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LazyOperandValueProfile.cpp; sourceTree = "<group>"; };
0FB5467A14F5C7D4002C2989 /* MethodOfGettingAValueProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MethodOfGettingAValueProfile.h; sourceTree = "<group>"; };
0FB5467C14F5CFD3002C2989 /* MethodOfGettingAValueProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MethodOfGettingAValueProfile.cpp; sourceTree = "<group>"; };
+ 0FB7F38915ED8E3800F167B2 /* ArrayConventions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayConventions.h; sourceTree = "<group>"; };
+ 0FB7F38A15ED8E3800F167B2 /* ArrayStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayStorage.h; sourceTree = "<group>"; };
+ 0FB7F38B15ED8E3800F167B2 /* Butterfly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Butterfly.h; sourceTree = "<group>"; };
+ 0FB7F38C15ED8E3800F167B2 /* ButterflyInlineMethods.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ButterflyInlineMethods.h; sourceTree = "<group>"; };
+ 0FB7F38D15ED8E3800F167B2 /* IndexingHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IndexingHeader.h; sourceTree = "<group>"; };
+ 0FB7F38E15ED8E3800F167B2 /* IndexingHeaderInlineMethods.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IndexingHeaderInlineMethods.h; sourceTree = "<group>"; };
+ 0FB7F38F15ED8E3800F167B2 /* IndexingType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IndexingType.h; sourceTree = "<group>"; };
+ 0FB7F39015ED8E3800F167B2 /* PropertyStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PropertyStorage.h; sourceTree = "<group>"; };
+ 0FB7F39115ED8E3800F167B2 /* Reject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reject.h; sourceTree = "<group>"; };
+ 0FB7F39215ED8E3800F167B2 /* SparseArrayValueMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SparseArrayValueMap.h; sourceTree = "<group>"; };
+ 0FB7F39315ED8E3800F167B2 /* SparseArrayValueMapInlineMethods.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SparseArrayValueMapInlineMethods.h; sourceTree = "<group>"; };
0FBC0AE41496C7C100D4FBDD /* DFGExitProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DFGExitProfile.cpp; sourceTree = "<group>"; };
0FBC0AE51496C7C100D4FBDD /* DFGExitProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFGExitProfile.h; sourceTree = "<group>"; };
0FBD7E671447998F00481315 /* CodeOrigin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeOrigin.h; sourceTree = "<group>"; };
@@ -1341,7 +1366,6 @@
A767FF9F14F4502900789059 /* JSCTypedArrayStubs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCTypedArrayStubs.h; sourceTree = "<group>"; };
A76C51741182748D00715B05 /* JSInterfaceJIT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInterfaceJIT.h; sourceTree = "<group>"; };
A76F54A213B28AAB00EF2BCE /* JITWriteBarrier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITWriteBarrier.h; sourceTree = "<group>"; };
- A781E358141970C700094D90 /* StorageBarrier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageBarrier.h; sourceTree = "<group>"; };
A79EDB0811531CD60019E912 /* JSObjectRefPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSObjectRefPrivate.h; sourceTree = "<group>"; };
A7A7EE7411B98B8D0065A14F /* ASTBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASTBuilder.h; sourceTree = "<group>"; };
A7A7EE7711B98B8D0065A14F /* SyntaxChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SyntaxChecker.h; sourceTree = "<group>"; };
@@ -2021,6 +2045,20 @@
7EF6E0BB0EB7A1EC0079AFAF /* runtime */ = {
isa = PBXGroup;
children = (
+ 0F0CD4C315F6B6B50032F1C0 /* SparseArrayValueMap.cpp */,
+ 0F0CD4C015F1A6040032F1C0 /* PutDirectIndexMode.h */,
+ 0FB7F38915ED8E3800F167B2 /* ArrayConventions.h */,
+ 0FB7F38A15ED8E3800F167B2 /* ArrayStorage.h */,
+ 0FB7F38B15ED8E3800F167B2 /* Butterfly.h */,
+ 0FB7F38C15ED8E3800F167B2 /* ButterflyInlineMethods.h */,
+ 0FB7F38D15ED8E3800F167B2 /* IndexingHeader.h */,
+ 0FB7F38E15ED8E3800F167B2 /* IndexingHeaderInlineMethods.h */,
+ 0FB7F38F15ED8E3800F167B2 /* IndexingType.h */,
+ 0FB7F39015ED8E3800F167B2 /* PropertyStorage.h */,
+ 0FB7F39115ED8E3800F167B2 /* Reject.h */,
+ 0FB7F39215ED8E3800F167B2 /* SparseArrayValueMap.h */,
+ 0FB7F39315ED8E3800F167B2 /* SparseArrayValueMapInlineMethods.h */,
+ C2D58C3315912FEE0021A844 /* GCActivityCallback.cpp */,
BCF605110E203EF800B9A64D /* ArgList.cpp */,
BCF605120E203EF800B9A64D /* ArgList.h */,
BC257DE50E1F51C50016B6C9 /* Arguments.cpp */,
@@ -2206,7 +2244,6 @@
0F77008E1402FDD60078EB39 /* SamplingCounter.h */,
93303FE80E6A72B500786E6A /* SmallStrings.cpp */,
93303FEA0E6A72C000786E6A /* SmallStrings.h */,
- A781E358141970C700094D90 /* StorageBarrier.h */,
A730B6111250068F009D25B1 /* StrictEvalActivation.cpp */,
A730B6101250068F009D25B1 /* StrictEvalActivation.h */,
BC18C3C00E16EE3300B34460 /* StringConstructor.cpp */,
@@ -2757,7 +2794,6 @@
E49DC16C12EF294E00184A1F /* SourceProviderCache.h in Headers */,
E49DC16D12EF295300184A1F /* SourceProviderCacheItem.h in Headers */,
A7386554118697B400540279 /* SpecializedThunkJIT.h in Headers */,
- A781E359141970C700094D90 /* StorageBarrier.h in Headers */,
A730B6121250068F009D25B1 /* StrictEvalActivation.h in Headers */,
BC18C4660E16F5CD00B34460 /* StringConstructor.h in Headers */,
BC18C4680E16F5CD00B34460 /* StringObject.h in Headers */,
@@ -2906,6 +2942,18 @@
14874AE615EBDE4A002E3587 /* JSScope.h in Headers */,
FED287B215EC9A5700DA8161 /* LLIntOpcode.h in Headers */,
1442566215EDE98D0066A49B /* JSWithScope.h in Headers */,
+ 0FB7F39515ED8E4600F167B2 /* ArrayConventions.h in Headers */,
+ 0FB7F39615ED8E4600F167B2 /* ArrayStorage.h in Headers */,
+ 0FB7F39715ED8E4600F167B2 /* Butterfly.h in Headers */,
+ 0FB7F39815ED8E4600F167B2 /* ButterflyInlineMethods.h in Headers */,
+ 0FB7F39915ED8E4600F167B2 /* IndexingHeader.h in Headers */,
+ 0FB7F39A15ED8E4600F167B2 /* IndexingHeaderInlineMethods.h in Headers */,
+ 0FB7F39B15ED8E4600F167B2 /* IndexingType.h in Headers */,
+ 0FB7F39C15ED8E4600F167B2 /* PropertyStorage.h in Headers */,
+ 0FB7F39D15ED8E4600F167B2 /* Reject.h in Headers */,
+ 0FB7F39E15ED8E4600F167B2 /* SparseArrayValueMap.h in Headers */,
+ 0FB7F39F15ED8E4600F167B2 /* SparseArrayValueMapInlineMethods.h in Headers */,
+ 0F0CD4C215F1A6070032F1C0 /* PutDirectIndexMode.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -3507,6 +3555,7 @@
14874AE315EBDE4A002E3587 /* JSNameScope.cpp in Sources */,
14874AE515EBDE4A002E3587 /* JSScope.cpp in Sources */,
1442566115EDE98D0066A49B /* JSWithScope.cpp in Sources */,
+ 0F0CD4C415F6B6BB0032F1C0 /* SparseArrayValueMap.cpp in Sources */,
FE20CE9D15F04A9500DF3430 /* LLIntCLoop.cpp in Sources */,
C225494315F7DBAA0065E898 /* SlotVisitor.cpp in Sources */,
);
diff --git a/Source/JavaScriptCore/Target.pri b/Source/JavaScriptCore/Target.pri
index 336d8008b..6f063fafb 100644
--- a/Source/JavaScriptCore/Target.pri
+++ b/Source/JavaScriptCore/Target.pri
@@ -246,6 +246,7 @@ SOURCES += \
runtime/RegExpCache.cpp \
runtime/SamplingCounter.cpp \
runtime/SmallStrings.cpp \
+ runtime/SparseArrayValueMap.cpp \
runtime/StrictEvalActivation.cpp \
runtime/StringConstructor.cpp \
runtime/StringObject.cpp \
diff --git a/Source/JavaScriptCore/bytecode/ArrayProfile.h b/Source/JavaScriptCore/bytecode/ArrayProfile.h
index 5a656e2dd..312473f3c 100644
--- a/Source/JavaScriptCore/bytecode/ArrayProfile.h
+++ b/Source/JavaScriptCore/bytecode/ArrayProfile.h
@@ -35,16 +35,16 @@ namespace JSC {
class LLIntOffsetsExtractor;
+// This is a bitfield where each bit represents an IndexingType that we have seen.
+// There are 17 indexing types (0 to 16, inclusive), so 32 bits is more than enough.
typedef unsigned ArrayModes;
-static const unsigned IsNotArray = 1;
-static const unsigned IsJSArray = 2;
+#define asArrayModes(type) \
+ (1 << static_cast<unsigned>(type))
inline ArrayModes arrayModeFromStructure(Structure* structure)
{
- if (structure->classInfo() == &JSArray::s_info)
- return IsJSArray;
- return IsNotArray;
+ return asArrayModes(structure->indexingTypeIncludingHistory());
}
class ArrayProfile {
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
index d79a37668..6b31be221 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
@@ -291,10 +291,14 @@ void CodeBlock::printGetByIdCacheStatus(ExecState* exec, int location)
UNUSED_PARAM(ident); // tell the compiler to shut up in certain platform configurations.
#if ENABLE(LLINT)
- Structure* structure = instruction[4].u.structure.get();
- dataLog(" llint(");
- dumpStructure("struct", exec, structure, ident);
- dataLog(")");
+ if (exec->interpreter()->getOpcodeID(instruction[0].u.opcode) == op_get_array_length)
+ dataLog(" llint(array_length)");
+ else {
+ Structure* structure = instruction[4].u.structure.get();
+ dataLog(" llint(");
+ dumpStructure("struct", exec, structure, ident);
+ dataLog(")");
+ }
#endif
#if ENABLE(JIT)
@@ -1001,6 +1005,22 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
it++;
break;
}
+ case op_init_global_const: {
+ WriteBarrier<Unknown>* registerPointer = (++it)->u.registerPointer;
+ int r0 = (++it)->u.operand;
+ dataLog("[%4d] init_global_const\t g%d(%p), %s", location, m_globalObject->findRegisterIndex(registerPointer), registerPointer, registerName(exec, r0).data());
+ dumpBytecodeCommentAndNewLine(location);
+ break;
+ }
+ case op_init_global_const_check: {
+ WriteBarrier<Unknown>* registerPointer = (++it)->u.registerPointer;
+ int r0 = (++it)->u.operand;
+ dataLog("[%4d] init_global_const_check\t g%d(%p), %s", location, m_globalObject->findRegisterIndex(registerPointer), registerPointer, registerName(exec, r0).data());
+ dumpBytecodeCommentAndNewLine(location);
+ it++;
+ it++;
+ break;
+ }
case op_resolve_base: {
int r0 = (++it)->u.operand;
int id0 = (++it)->u.operand;
@@ -2081,6 +2101,8 @@ void CodeBlock::finalizeUnconditionally()
curInstruction[7].u.structureChain.clear();
curInstruction[0].u.opcode = interpreter->getOpcode(op_put_by_id);
break;
+ case op_get_array_length:
+ break;
default:
ASSERT_NOT_REACHED();
}
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.h b/Source/JavaScriptCore/bytecode/CodeBlock.h
index 1d56999ff..07d1e0a06 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.h
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.h
@@ -547,29 +547,16 @@ namespace JSC {
return needsFullScopeChain() && codeType() != GlobalCode;
}
- bool argumentsAreCaptured() const
- {
- return needsActivation() || usesArguments();
- }
-
- bool argumentIsCaptured(int) const
- {
- return argumentsAreCaptured();
- }
-
- bool localIsCaptured(InlineCallFrame* inlineCallFrame, int operand) const
- {
- if (!inlineCallFrame)
- return operand < m_numCapturedVars;
-
- return inlineCallFrame->capturedVars.get(operand);
- }
-
- bool isCaptured(InlineCallFrame* inlineCallFrame, int operand) const
+ bool isCaptured(int operand, InlineCallFrame* inlineCallFrame = 0) const
{
+ if (inlineCallFrame && !operandIsArgument(operand))
+ return inlineCallFrame->capturedVars.get(operand);
+
+ // Our estimate of argument capture is conservative.
if (operandIsArgument(operand))
- return argumentIsCaptured(operandToArgument(operand));
- return localIsCaptured(inlineCallFrame, operand);
+ return needsActivation() || usesArguments();
+
+ return operand < m_numCapturedVars;
}
CodeType codeType() const { return m_codeType; }
diff --git a/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp b/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp
index 8f2a46879..e44568a26 100644
--- a/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp
+++ b/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp
@@ -43,6 +43,9 @@ GetByIdStatus GetByIdStatus::computeFromLLInt(CodeBlock* profiledBlock, unsigned
if (instruction[0].u.opcode == LLInt::getOpcode(llint_op_method_check))
instruction++;
+
+ if (instruction[0].u.opcode == LLInt::getOpcode(llint_op_get_array_length))
+ return GetByIdStatus(NoInformation, false);
Structure* structure = instruction[4].u.structure.get();
if (!structure)
diff --git a/Source/JavaScriptCore/bytecode/Opcode.h b/Source/JavaScriptCore/bytecode/Opcode.h
index 5cbae8a09..87b100056 100644
--- a/Source/JavaScriptCore/bytecode/Opcode.h
+++ b/Source/JavaScriptCore/bytecode/Opcode.h
@@ -39,7 +39,7 @@
namespace JSC {
- #define FOR_EACH_OPCODE_ID(macro) \
+ #define FOR_EACH_CORE_OPCODE_ID_WITH_EXTENSION(macro, extension__) \
macro(op_enter, 1) \
macro(op_create_activation, 2) \
macro(op_init_lazy_reg, 2) \
@@ -105,6 +105,8 @@ namespace JSC {
macro(op_get_global_var_watchable, 5) /* has value profiling */ \
macro(op_put_global_var, 3) \
macro(op_put_global_var_check, 5) \
+ macro(op_init_global_const, 3) \
+ macro(op_init_global_const_check, 5) \
macro(op_resolve_base, 5) /* has value profiling */ \
macro(op_ensure_property_exists, 3) \
macro(op_resolve_with_base, 5) /* has value profiling */ \
@@ -200,10 +202,20 @@ namespace JSC {
macro(op_profile_will_call, 2) \
macro(op_profile_did_call, 2) \
\
- FOR_EACH_LLINT_OPCODE_EXTENSION(macro) \
+ extension__ \
\
macro(op_end, 2) // end must be the last opcode in the list
+ #define FOR_EACH_CORE_OPCODE_ID(macro) \
+ FOR_EACH_CORE_OPCODE_ID_WITH_EXTENSION(macro, /* No extension */ )
+
+ #define FOR_EACH_OPCODE_ID(macro) \
+ FOR_EACH_CORE_OPCODE_ID_WITH_EXTENSION( \
+ macro, \
+ FOR_EACH_LLINT_OPCODE_EXTENSION(macro) \
+ )
+
+
#define OPCODE_ID_ENUM(opcode, length) opcode,
typedef enum { FOR_EACH_OPCODE_ID(OPCODE_ID_ENUM) } OpcodeID;
#undef OPCODE_ID_ENUM
diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
index 82f9d6f60..055f605d2 100644
--- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
+++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
@@ -260,7 +260,7 @@ void BytecodeGenerator::preserveLastVar()
m_lastVar = &m_calleeRegisters.last();
}
-BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, JSScope* scope, SymbolTable* symbolTable, ProgramCodeBlock* codeBlock, CompilationKind compilationKind)
+BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, JSScope* scope, SharedSymbolTable* symbolTable, ProgramCodeBlock* codeBlock, CompilationKind compilationKind)
: m_shouldEmitDebugHooks(scope->globalObject()->debugger())
, m_shouldEmitProfileHooks(scope->globalObject()->globalObjectMethodTable()->supportsProfiling(scope->globalObject()))
, m_shouldEmitRichSourceInfo(scope->globalObject()->globalObjectMethodTable()->supportsRichSourceInfo(scope->globalObject()))
@@ -295,13 +295,15 @@ BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, JSScope* scope, S
if (m_shouldEmitDebugHooks)
m_codeBlock->setNeedsFullScopeChain(true);
+ codeBlock->setGlobalData(m_globalData);
+ symbolTable->setUsesNonStrictEval(codeBlock->usesEval() && !codeBlock->isStrictMode());
+ m_codeBlock->setNumParameters(1); // Allocate space for "this"
+
prependComment("entering Program block");
emitOpcode(op_enter);
- codeBlock->setGlobalData(m_globalData);
// FIXME: Move code that modifies the global object to Interpreter::execute.
- m_codeBlock->setNumParameters(1); // Allocate space for "this"
codeBlock->m_numCapturedVars = codeBlock->m_numVars;
if (compilationKind == OptimizingCompilation)
@@ -342,7 +344,7 @@ BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, JSScope* scope, S
}
}
-BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, JSScope* scope, SymbolTable* symbolTable, CodeBlock* codeBlock, CompilationKind)
+BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, JSScope* scope, SharedSymbolTable* symbolTable, CodeBlock* codeBlock, CompilationKind)
: m_shouldEmitDebugHooks(scope->globalObject()->debugger())
, m_shouldEmitProfileHooks(scope->globalObject()->globalObjectMethodTable()->supportsProfiling(scope->globalObject()))
, m_shouldEmitRichSourceInfo(scope->globalObject()->globalObjectMethodTable()->supportsRichSourceInfo(scope->globalObject()))
@@ -378,7 +380,9 @@ BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, JSScope* sc
m_codeBlock->setNeedsFullScopeChain(true);
codeBlock->setGlobalData(m_globalData);
-
+ symbolTable->setUsesNonStrictEval(codeBlock->usesEval() && !codeBlock->isStrictMode());
+ symbolTable->setParameterCountIncludingThis(functionBody->parameters()->size() + 1);
+
prependComment("entering Function block");
emitOpcode(op_enter);
if (m_codeBlock->needsFullScopeChain()) {
@@ -388,7 +392,7 @@ BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, JSScope* sc
m_codeBlock->setActivationRegister(m_activationRegister->index());
}
- if (m_codeBlock->needsFullScopeChain() || functionBody->usesArguments()) {
+ if (functionBody->usesArguments() || codeBlock->usesEval() || m_shouldEmitDebugHooks) { // May reify arguments object.
RegisterID* unmodifiedArgumentsRegister = addVar(); // Anonymous, so it can't be modified by user code.
RegisterID* argumentsRegister = addVar(propertyNames().arguments, false); // Can be changed by assigning to 'arguments'.
@@ -419,6 +423,25 @@ BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, JSScope* sc
}
}
+ bool capturesAnyArgument = codeBlock->usesArguments() || codeBlock->usesEval() || m_shouldEmitDebugHooks; // May reify arguments object.
+ if (!capturesAnyArgument && functionBody->hasCapturedVariables()) {
+ FunctionParameters& parameters = *functionBody->parameters();
+ for (size_t i = 0; i < parameters.size(); ++i) {
+ if (!functionBody->captures(parameters[i]))
+ continue;
+ capturesAnyArgument = true;
+ break;
+ }
+ }
+
+ if (capturesAnyArgument) {
+ symbolTable->setCaptureMode(SharedSymbolTable::AllOfTheThings);
+ symbolTable->setCaptureStart(-CallFrame::offsetFor(symbolTable->parameterCountIncludingThis()));
+ } else {
+ symbolTable->setCaptureMode(SharedSymbolTable::SomeOfTheThings);
+ symbolTable->setCaptureStart(m_codeBlock->m_numVars);
+ }
+
RegisterID* calleeRegister = resolveCallee(functionBody); // May push to the scope chain and/or add a captured var.
const DeclarationStacks::FunctionStack& functionStack = functionBody->functionStack();
@@ -484,9 +507,11 @@ BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, JSScope* sc
addVar(ident, varStack[i].second & DeclarationStacks::IsConstant);
}
- if (m_shouldEmitDebugHooks)
+ if (m_shouldEmitDebugHooks || codeBlock->usesEval())
codeBlock->m_numCapturedVars = codeBlock->m_numVars;
+ symbolTable->setCaptureEnd(codeBlock->m_numCapturedVars);
+
FunctionParameters& parameters = *functionBody->parameters();
m_parameters.grow(parameters.size() + 1); // reserve space for "this"
@@ -514,7 +539,7 @@ BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, JSScope* sc
}
}
-BytecodeGenerator::BytecodeGenerator(EvalNode* evalNode, JSScope* scope, SymbolTable* symbolTable, EvalCodeBlock* codeBlock, CompilationKind)
+BytecodeGenerator::BytecodeGenerator(EvalNode* evalNode, JSScope* scope, SharedSymbolTable* symbolTable, EvalCodeBlock* codeBlock, CompilationKind)
: m_shouldEmitDebugHooks(scope->globalObject()->debugger())
, m_shouldEmitProfileHooks(scope->globalObject()->globalObjectMethodTable()->supportsProfiling(scope->globalObject()))
, m_shouldEmitRichSourceInfo(scope->globalObject()->globalObjectMethodTable()->supportsRichSourceInfo(scope->globalObject()))
@@ -549,11 +574,13 @@ BytecodeGenerator::BytecodeGenerator(EvalNode* evalNode, JSScope* scope, SymbolT
if (m_shouldEmitDebugHooks || m_baseScopeDepth)
m_codeBlock->setNeedsFullScopeChain(true);
- prependComment("entering Eval block");
- emitOpcode(op_enter);
codeBlock->setGlobalData(m_globalData);
+ symbolTable->setUsesNonStrictEval(codeBlock->usesEval() && !codeBlock->isStrictMode());
m_codeBlock->setNumParameters(1);
+ prependComment("entering Eval block");
+ emitOpcode(op_enter);
+
const DeclarationStacks::FunctionStack& functionStack = evalNode->functionStack();
for (size_t i = 0; i < functionStack.size(); ++i)
m_codeBlock->addFunctionDecl(FunctionExecutable::create(*m_globalData, functionStack[i]));
@@ -1355,7 +1382,7 @@ ResolveResult BytecodeGenerator::resolve(const Identifier& property)
}
#if !ASSERT_DISABLED
if (JSActivation* activation = jsDynamicCast<JSActivation*>(currentVariableObject))
- ASSERT(activation->isValidScopedLookup(entry.getIndex()));
+ ASSERT(activation->isValid(entry));
#endif
return ResolveResult::lexicalResolve(entry.getIndex(), depth, flags);
}
@@ -1636,6 +1663,31 @@ RegisterID* BytecodeGenerator::emitGetStaticVar(RegisterID* dst, const ResolveRe
}
}
+RegisterID* BytecodeGenerator::emitInitGlobalConst(const ResolveResult& resolveResult, const Identifier& identifier, RegisterID* value)
+{
+ ASSERT(m_codeType == GlobalCode);
+ switch (resolveResult.type()) {
+ case ResolveResult::IndexedGlobal:
+ case ResolveResult::ReadOnlyIndexedGlobal:
+ emitOpcode(op_init_global_const);
+ instructions().append(resolveResult.registerPointer());
+ instructions().append(value->index());
+ return value;
+
+ case ResolveResult::WatchedIndexedGlobal:
+ emitOpcode(op_init_global_const_check);
+ instructions().append(resolveResult.registerPointer());
+ instructions().append(value->index());
+ instructions().append(jsCast<JSGlobalObject*>(resolveResult.globalObject())->symbolTable()->get(identifier.impl()).addressOfIsWatched());
+ instructions().append(addConstant(identifier));
+ return value;
+
+ default:
+ ASSERT_NOT_REACHED();
+ return 0;
+ }
+}
+
RegisterID* BytecodeGenerator::emitPutStaticVar(const ResolveResult& resolveResult, const Identifier& identifier, RegisterID* value)
{
switch (resolveResult.type()) {
@@ -1731,7 +1783,9 @@ RegisterID* BytecodeGenerator::emitDirectPutById(RegisterID* base, const Identif
instructions().append(0);
instructions().append(0);
instructions().append(0);
- instructions().append(property != m_globalData->propertyNames->underscoreProto);
+ instructions().append(
+ property != m_globalData->propertyNames->underscoreProto
+ && PropertyName(property).asIndex() == PropertyName::NotAnIndex);
return value;
}
diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
index 28a806eb3..398719749 100644
--- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
+++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
@@ -261,9 +261,9 @@ namespace JSC {
JS_EXPORT_PRIVATE static void setDumpsGeneratedCode(bool dumpsGeneratedCode);
static bool dumpsGeneratedCode();
- BytecodeGenerator(ProgramNode*, JSScope*, SymbolTable*, ProgramCodeBlock*, CompilationKind);
- BytecodeGenerator(FunctionBodyNode*, JSScope*, SymbolTable*, CodeBlock*, CompilationKind);
- BytecodeGenerator(EvalNode*, JSScope*, SymbolTable*, EvalCodeBlock*, CompilationKind);
+ BytecodeGenerator(ProgramNode*, JSScope*, SharedSymbolTable*, ProgramCodeBlock*, CompilationKind);
+ BytecodeGenerator(FunctionBodyNode*, JSScope*, SharedSymbolTable*, CodeBlock*, CompilationKind);
+ BytecodeGenerator(EvalNode*, JSScope*, SharedSymbolTable*, EvalCodeBlock*, CompilationKind);
~BytecodeGenerator();
@@ -462,6 +462,7 @@ namespace JSC {
RegisterID* emitGetStaticVar(RegisterID* dst, const ResolveResult&, const Identifier&);
RegisterID* emitPutStaticVar(const ResolveResult&, const Identifier&, RegisterID* value);
+ RegisterID* emitInitGlobalConst(const ResolveResult&, const Identifier&, RegisterID* value);
RegisterID* emitResolve(RegisterID* dst, const ResolveResult&, const Identifier& property);
RegisterID* emitResolveBase(RegisterID* dst, const ResolveResult&, const Identifier& property);
@@ -654,7 +655,7 @@ namespace JSC {
public:
Vector<Instruction>& instructions() { return m_instructions; }
- SymbolTable& symbolTable() { return *m_symbolTable; }
+ SharedSymbolTable& symbolTable() { return *m_symbolTable; }
#if ENABLE(BYTECODE_COMMENTS)
Vector<Comment>& comments() { return m_comments; }
#endif
@@ -697,7 +698,7 @@ namespace JSC {
bool m_shouldEmitRichSourceInfo;
Strong<JSScope> m_scope;
- SymbolTable* m_symbolTable;
+ SharedSymbolTable* m_symbolTable;
#if ENABLE(BYTECODE_COMMENTS)
Vector<Comment> m_comments;
diff --git a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp b/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
index 63f4657c9..e4d35471f 100644
--- a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
+++ b/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
@@ -1387,9 +1387,11 @@ RegisterID* ConstDeclNode::emitCodeSingle(BytecodeGenerator& generator)
RefPtr<RegisterID> value = m_init ? generator.emitNode(m_init) : generator.emitLoad(0, jsUndefined());
- if (resolveResult.isStatic())
+ if (resolveResult.isStatic()) {
+ if (generator.codeType() == GlobalCode)
+ return generator.emitInitGlobalConst(resolveResult, m_ident, value.get());
return generator.emitPutStaticVar(resolveResult, m_ident, value.get());
-
+ }
if (generator.codeType() != EvalCode)
return value.get();
diff --git a/Source/JavaScriptCore/debugger/Debugger.cpp b/Source/JavaScriptCore/debugger/Debugger.cpp
index 5d7a9b109..8d360efc2 100644
--- a/Source/JavaScriptCore/debugger/Debugger.cpp
+++ b/Source/JavaScriptCore/debugger/Debugger.cpp
@@ -118,7 +118,7 @@ void Debugger::recompileAllJSFunctions(JSGlobalData* globalData)
return;
Recompiler recompiler(this);
- globalData->heap.objectSpace().forEachCell(recompiler);
+ globalData->heap.objectSpace().forEachLiveCell(recompiler);
}
JSValue evaluateInGlobalCallFrame(const String& script, JSValue& exception, JSGlobalObject* globalObject)
diff --git a/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp b/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp
index 97e792b6d..e924ad34c 100644
--- a/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp
+++ b/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp
@@ -36,18 +36,18 @@
namespace JSC {
-const String* DebuggerCallFrame::functionName() const
+String DebuggerCallFrame::functionName() const
{
if (!m_callFrame->codeBlock())
- return 0;
+ return String();
if (!m_callFrame->callee())
- return 0;
+ return String();
JSObject* function = m_callFrame->callee();
if (!function || !function->inherits(&JSFunction::s_info))
- return 0;
- return &jsCast<JSFunction*>(function)->name(m_callFrame);
+ return String();
+ return jsCast<JSFunction*>(function)->name(m_callFrame);
}
String DebuggerCallFrame::calculatedFunctionName() const
diff --git a/Source/JavaScriptCore/debugger/DebuggerCallFrame.h b/Source/JavaScriptCore/debugger/DebuggerCallFrame.h
index 1a9fb0277..66585a637 100644
--- a/Source/JavaScriptCore/debugger/DebuggerCallFrame.h
+++ b/Source/JavaScriptCore/debugger/DebuggerCallFrame.h
@@ -51,7 +51,7 @@ namespace JSC {
CallFrame* callFrame() const { return m_callFrame; }
JSGlobalObject* dynamicGlobalObject() const { return m_callFrame->dynamicGlobalObject(); }
JSScope* scope() const { return m_callFrame->scope(); }
- JS_EXPORT_PRIVATE const String* functionName() const;
+ JS_EXPORT_PRIVATE String functionName() const;
JS_EXPORT_PRIVATE String calculatedFunctionName() const;
JS_EXPORT_PRIVATE Type type() const;
JS_EXPORT_PRIVATE JSObject* thisObject() const;
diff --git a/Source/JavaScriptCore/dfg/DFGAbstractState.cpp b/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
index 5f79f666f..b860a7310 100644
--- a/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
+++ b/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
@@ -852,11 +852,11 @@ bool AbstractState::execute(unsigned indexInBlock)
forNode(node.child2()).filter(SpecInt32);
forNode(nodeIndex).makeTop();
break;
- case Array::JSArray:
+ case IN_BOUNDS_ARRAY_STORAGE_MODES:
forNode(node.child2()).filter(SpecInt32);
forNode(nodeIndex).makeTop();
break;
- case Array::JSArrayOutOfBounds:
+ case OUT_OF_BOUNDS_ARRAY_STORAGE_MODES:
forNode(node.child2()).filter(SpecInt32);
clobberWorld(node.codeOrigin, indexInBlock);
forNode(nodeIndex).makeTop();
@@ -916,10 +916,10 @@ bool AbstractState::execute(unsigned indexInBlock)
case Array::Generic:
clobberWorld(node.codeOrigin, indexInBlock);
break;
- case Array::JSArray:
+ case IN_BOUNDS_ARRAY_STORAGE_MODES:
forNode(child2).filter(SpecInt32);
break;
- case Array::JSArrayOutOfBounds:
+ case OUT_OF_BOUNDS_ARRAY_STORAGE_MODES:
forNode(child2).filter(SpecInt32);
clobberWorld(node.codeOrigin, indexInBlock);
break;
@@ -1341,7 +1341,7 @@ bool AbstractState::execute(unsigned indexInBlock)
forNode(node.child1()).set(node.structureTransitionData().newStructure);
m_haveStructures = true;
break;
- case GetPropertyStorage:
+ case GetButterfly:
case AllocatePropertyStorage:
case ReallocatePropertyStorage:
node.setCanExit(false);
@@ -1359,8 +1359,7 @@ bool AbstractState::execute(unsigned indexInBlock)
case Array::String:
forNode(node.child1()).filter(SpecString);
break;
- case Array::JSArray:
- case Array::JSArrayOutOfBounds:
+ case ALL_ARRAY_STORAGE_MODES:
// This doesn't filter anything meaningful right now. We may want to add
// CFA tracking of array mode speculations, but we don't have that, yet.
forNode(node.child1()).filter(SpecCell);
@@ -1523,11 +1522,14 @@ inline void AbstractState::clobberCapturedVars(const CodeOrigin& codeOrigin)
m_variables.local(i).makeTop();
}
} else {
- for (size_t i = m_codeBlock->m_numCapturedVars; i--;)
- m_variables.local(i).makeTop();
+ for (size_t i = m_codeBlock->m_numVars; i--;) {
+ if (m_codeBlock->isCaptured(i))
+ m_variables.local(i).makeTop();
+ }
}
- if (m_codeBlock->argumentsAreCaptured()) {
- for (size_t i = m_variables.numberOfArguments(); i--;)
+
+ for (size_t i = m_variables.numberOfArguments(); i--;) {
+ if (m_codeBlock->isCaptured(argumentToOperand(i)))
m_variables.argument(i).makeTop();
}
}
diff --git a/Source/JavaScriptCore/dfg/DFGAdjacencyList.h b/Source/JavaScriptCore/dfg/DFGAdjacencyList.h
index a59223b05..921a67a93 100644
--- a/Source/JavaScriptCore/dfg/DFGAdjacencyList.h
+++ b/Source/JavaScriptCore/dfg/DFGAdjacencyList.h
@@ -44,6 +44,8 @@ public:
enum { Size = 3 };
+ AdjacencyList() { }
+
AdjacencyList(Kind kind)
#if !ASSERT_DISABLED
: m_kind(kind)
diff --git a/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp b/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp
index ab0da20c7..fe839d54f 100644
--- a/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp
@@ -188,28 +188,30 @@ public:
// aliasing. But not yet.
observeBadArgumentsUse(node.child1());
- if (variableAccessData->isCaptured()) {
- // If this is an assignment to the arguments register, then
- // pretend as if the arguments were created. We don't want to
- // optimize code that explicitly assigns to the arguments,
- // because that seems too ugly.
-
- // But, before getting rid of CreateArguments, we will have
- // an assignment to the arguments registers with JSValue().
- // That's because CSE will refuse to get rid of the
- // init_lazy_reg since it treats CreateArguments as reading
- // local variables. That could be fixed, but it's easier to
- // work around this here.
- if (source.op() == JSConstant
- && !source.valueOfJSConstant(codeBlock()))
- break;
-
- if (argumentsRegister != InvalidVirtualRegister
- && (variableAccessData->local() == argumentsRegister
- || variableAccessData->local() == unmodifiedArgumentsRegister(argumentsRegister)))
- m_createsArguments.add(node.codeOrigin.inlineCallFrame);
+ // If this is an assignment to the arguments register, then
+ // pretend as if the arguments were created. We don't want to
+ // optimize code that explicitly assigns to the arguments,
+ // because that seems too ugly.
+
+ // But, before getting rid of CreateArguments, we will have
+ // an assignment to the arguments registers with JSValue().
+ // That's because CSE will refuse to get rid of the
+ // init_lazy_reg since it treats CreateArguments as reading
+ // local variables. That could be fixed, but it's easier to
+ // work around this here.
+ if (source.op() == JSConstant
+ && !source.valueOfJSConstant(codeBlock()))
+ break;
+
+ if (argumentsRegister != InvalidVirtualRegister
+ && (variableAccessData->local() == argumentsRegister
+ || variableAccessData->local() == unmodifiedArgumentsRegister(argumentsRegister))) {
+ m_createsArguments.add(node.codeOrigin.inlineCallFrame);
break;
}
+
+ if (variableAccessData->isCaptured())
+ break;
// Make sure that if it's a variable that we think is aliased to
// the arguments, that we know that it might actually not be.
@@ -432,9 +434,8 @@ public:
VariableAccessData* variableAccessData = node.variableAccessData();
- if (variableAccessData->isCaptured()) {
- ASSERT(m_graph.argumentsRegisterFor(node.codeOrigin) == variableAccessData->local()
- || unmodifiedArgumentsRegister(m_graph.argumentsRegisterFor(node.codeOrigin)) == variableAccessData->local());
+ if (m_graph.argumentsRegisterFor(node.codeOrigin) == variableAccessData->local()
+ || unmodifiedArgumentsRegister(m_graph.argumentsRegisterFor(node.codeOrigin)) == variableAccessData->local()) {
// The child of this store should really be the empty value.
Node emptyJSValue(JSConstant, node.codeOrigin, OpInfo(codeBlock()->addOrFindConstant(JSValue())));
emptyJSValue.ref();
@@ -446,6 +447,7 @@ public:
changed = true;
break;
}
+ ASSERT(!variableAccessData->isCaptured());
// If this is a store into a VariableAccessData* that is marked as
// arguments aliasing for an InlineCallFrame* that does not create
@@ -755,12 +757,14 @@ private:
}
VariableAccessData* variableAccessData = child.variableAccessData();
- if (variableAccessData->isCaptured()) {
- if (child.local() == m_graph.uncheckedArgumentsRegisterFor(child.codeOrigin)
- && node.codeOrigin.inlineCallFrame != child.codeOrigin.inlineCallFrame)
- m_createsArguments.add(child.codeOrigin.inlineCallFrame);
+ if (child.local() == m_graph.uncheckedArgumentsRegisterFor(child.codeOrigin)
+ && node.codeOrigin.inlineCallFrame != child.codeOrigin.inlineCallFrame) {
+ m_createsArguments.add(child.codeOrigin.inlineCallFrame);
return;
}
+
+ if (variableAccessData->isCaptured())
+ return;
ArgumentsAliasingData& data = m_argumentsAliasing.find(variableAccessData)->second;
data.mergeCallContext(node.codeOrigin.inlineCallFrame);
@@ -774,16 +778,15 @@ private:
switch (source.op()) {
case GetLocal: {
VariableAccessData* variableAccessData = source.variableAccessData();
- if (variableAccessData->isCaptured()) {
- int argumentsRegister = m_graph.uncheckedArgumentsRegisterFor(source.codeOrigin);
- if (argumentsRegister == InvalidVirtualRegister)
- break;
- if (argumentsRegister == variableAccessData->local())
- return true;
- if (unmodifiedArgumentsRegister(argumentsRegister) == variableAccessData->local())
- return true;
+ int argumentsRegister = m_graph.uncheckedArgumentsRegisterFor(source.codeOrigin);
+ if (argumentsRegister == InvalidVirtualRegister)
+ break;
+ if (argumentsRegister == variableAccessData->local())
+ return true;
+ if (unmodifiedArgumentsRegister(argumentsRegister) == variableAccessData->local())
+ return true;
+ if (variableAccessData->isCaptured())
break;
- }
ArgumentsAliasingData& data =
m_argumentsAliasing.find(variableAccessData)->second;
if (!data.isValid())
diff --git a/Source/JavaScriptCore/dfg/DFGArrayMode.cpp b/Source/JavaScriptCore/dfg/DFGArrayMode.cpp
index cd3944fb4..eda578205 100644
--- a/Source/JavaScriptCore/dfg/DFGArrayMode.cpp
+++ b/Source/JavaScriptCore/dfg/DFGArrayMode.cpp
@@ -40,8 +40,12 @@ Array::Mode fromObserved(ArrayModes modes, bool makeSafe)
switch (modes) {
case 0:
return Array::Undecided;
- case IsJSArray:
- return makeSafe ? Array::JSArrayOutOfBounds : Array::JSArray;
+ case asArrayModes(NonArrayWithArrayStorage):
+ return makeSafe ? Array::ArrayStorageOutOfBounds : Array::ArrayStorage;
+ case asArrayModes(ArrayWithArrayStorage):
+ return makeSafe ? Array::ArrayWithArrayStorageOutOfBounds : Array::ArrayWithArrayStorage;
+ case asArrayModes(NonArrayWithArrayStorage) | asArrayModes(ArrayWithArrayStorage):
+ return makeSafe ? Array::PossiblyArrayWithArrayStorageOutOfBounds : Array::PossiblyArrayWithArrayStorage;
default:
// We know that this is possibly a kind of array for which, though there is no
// useful data in the array profile, we may be able to extract useful data from
@@ -120,10 +124,14 @@ bool modeAlreadyChecked(AbstractValue& value, Array::Mode arrayMode)
case Array::String:
return isStringSpeculation(value.m_type);
- case Array::JSArray:
- case Array::JSArrayOutOfBounds:
+ case NON_ARRAY_ARRAY_STORAGE_MODES:
return value.m_currentKnownStructure.hasSingleton()
- && value.m_currentKnownStructure.singleton()->classInfo() == &JSArray::s_info;
+ && (value.m_currentKnownStructure.singleton()->indexingType() & HasArrayStorage);
+
+ case ARRAY_WITH_ARRAY_STORAGE_MODES:
+ return value.m_currentKnownStructure.hasSingleton()
+ && (value.m_currentKnownStructure.singleton()->indexingType() & HasArrayStorage)
+ && (value.m_currentKnownStructure.singleton()->indexingType() & IsArray);
case Array::Arguments:
return isArgumentsSpeculation(value.m_type);
@@ -174,10 +182,18 @@ const char* modeToString(Array::Mode mode)
return "ForceExit";
case Array::String:
return "String";
- case Array::JSArray:
- return "JSArray";
- case Array::JSArrayOutOfBounds:
- return "JSArrayOutOfBounds";
+ case Array::ArrayStorage:
+ return "ArrayStorage";
+ case Array::ArrayStorageOutOfBounds:
+ return "ArrayStorageOutOfBounds";
+ case Array::ArrayWithArrayStorage:
+ return "ArrayWithArrayStorage";
+ case Array::ArrayWithArrayStorageOutOfBounds:
+ return "ArrayWithArrayStorageOutOfBounds";
+ case Array::PossiblyArrayWithArrayStorage:
+ return "PossiblyArrayWithArrayStorage";
+ case Array::PossiblyArrayWithArrayStorageOutOfBounds:
+ return "PossiblyArrayWithArrayStorageOutOfBounds";
case Array::Arguments:
return "Arguments";
case Array::Int8Array:
diff --git a/Source/JavaScriptCore/dfg/DFGArrayMode.h b/Source/JavaScriptCore/dfg/DFGArrayMode.h
index 36a8637f5..2eb009be0 100644
--- a/Source/JavaScriptCore/dfg/DFGArrayMode.h
+++ b/Source/JavaScriptCore/dfg/DFGArrayMode.h
@@ -46,8 +46,12 @@ enum Mode {
ForceExit, // Implies that we have no idea how to execute this operation, so we should just give up.
Generic,
String,
- JSArray,
- JSArrayOutOfBounds,
+ ArrayStorage,
+ ArrayStorageOutOfBounds,
+ ArrayWithArrayStorage,
+ ArrayWithArrayStorageOutOfBounds,
+ PossiblyArrayWithArrayStorage,
+ PossiblyArrayWithArrayStorageOutOfBounds,
Arguments,
Int8Array,
Int16Array,
@@ -61,6 +65,29 @@ enum Mode {
};
} // namespace Array
+// Helpers for 'case' statements. For example, saying "case AllArrayStorageModes:"
+// is the same as having multiple case statements listing off all of the modes that
+// have the word "ArrayStorage" in them.
+#define NON_ARRAY_ARRAY_STORAGE_MODES \
+ Array::ArrayStorage: \
+ case Array::ArrayStorageOutOfBounds: \
+ case Array::PossiblyArrayWithArrayStorage: \
+ case Array::PossiblyArrayWithArrayStorageOutOfBounds
+#define ARRAY_WITH_ARRAY_STORAGE_MODES \
+ Array::ArrayWithArrayStorage: \
+ case Array::ArrayWithArrayStorageOutOfBounds
+#define ALL_ARRAY_STORAGE_MODES \
+ NON_ARRAY_ARRAY_STORAGE_MODES: \
+ case ARRAY_WITH_ARRAY_STORAGE_MODES
+#define IN_BOUNDS_ARRAY_STORAGE_MODES \
+ Array::ArrayStorage: \
+ case Array::ArrayWithArrayStorage: \
+ case Array::PossiblyArrayWithArrayStorage
+#define OUT_OF_BOUNDS_ARRAY_STORAGE_MODES \
+ Array::ArrayStorageOutOfBounds: \
+ case Array::ArrayWithArrayStorageOutOfBounds: \
+ case Array::PossiblyArrayWithArrayStorageOutOfBounds
+
Array::Mode fromObserved(ArrayModes modes, bool makeSafe);
Array::Mode fromStructure(Structure*, bool makeSafe);
@@ -71,11 +98,30 @@ bool modeAlreadyChecked(AbstractValue&, Array::Mode);
const char* modeToString(Array::Mode);
+inline bool modeUsesButterfly(Array::Mode arrayMode)
+{
+ switch (arrayMode) {
+ case ALL_ARRAY_STORAGE_MODES:
+ return true;
+ default:
+ return false;
+ }
+}
+
inline bool modeIsJSArray(Array::Mode arrayMode)
{
switch (arrayMode) {
- case Array::JSArray:
- case Array::JSArrayOutOfBounds:
+ case ARRAY_WITH_ARRAY_STORAGE_MODES:
+ return true;
+ default:
+ return false;
+ }
+}
+
+inline bool isInBoundsAccess(Array::Mode arrayMode)
+{
+ switch (arrayMode) {
+ case IN_BOUNDS_ARRAY_STORAGE_MODES:
return true;
default:
return false;
@@ -114,25 +160,6 @@ inline Array::Mode modeForPut(Array::Mode arrayMode)
}
}
-inline bool modesCompatibleForStorageLoad(Array::Mode left, Array::Mode right)
-{
- if (left == right)
- return true;
-
- bool leftIsJSArray =
- left == Array::JSArray
- || left == Array::JSArrayOutOfBounds;
-
- bool rightIsJSArray =
- right == Array::JSArray
- || right == Array::JSArrayOutOfBounds;
-
- if (leftIsJSArray && rightIsJSArray)
- return true;
-
- return false;
-}
-
inline bool modeIsSpecific(Array::Mode mode)
{
switch (mode) {
@@ -147,7 +174,15 @@ inline bool modeIsSpecific(Array::Mode mode)
inline bool modeSupportsLength(Array::Mode mode)
{
- return modeIsSpecific(mode);
+ switch (mode) {
+ case Array::Undecided:
+ case Array::ForceExit:
+ case Array::Generic:
+ case NON_ARRAY_ARRAY_STORAGE_MODES:
+ return false;
+ default:
+ return true;
+ }
}
} } // namespace JSC::DFG
diff --git a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
index 201c42e71..f8ef37b03 100644
--- a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
+++ b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
@@ -193,7 +193,7 @@ private:
NodeIndex getLocal(unsigned operand)
{
NodeIndex nodeIndex = m_currentBlock->variablesAtTail.local(operand);
- bool isCaptured = m_codeBlock->localIsCaptured(m_inlineStackTop->m_inlineCallFrame, operand);
+ bool isCaptured = m_codeBlock->isCaptured(operand, m_inlineStackTop->m_inlineCallFrame);
if (nodeIndex != NoNode) {
Node* nodePtr = &m_graph[nodeIndex];
@@ -253,7 +253,7 @@ private:
}
void setLocal(unsigned operand, NodeIndex value, SetMode setMode = NormalSet)
{
- bool isCaptured = m_codeBlock->localIsCaptured(m_inlineStackTop->m_inlineCallFrame, operand);
+ bool isCaptured = m_codeBlock->isCaptured(operand, m_inlineStackTop->m_inlineCallFrame);
if (setMode == NormalSet) {
ArgumentPosition* argumentPosition = findArgumentPositionForLocal(operand);
@@ -272,12 +272,10 @@ private:
NodeIndex getArgument(unsigned operand)
{
unsigned argument = operandToArgument(operand);
-
- bool isCaptured = m_codeBlock->argumentIsCaptured(argument);
-
ASSERT(argument < m_numArguments);
NodeIndex nodeIndex = m_currentBlock->variablesAtTail.argument(argument);
+ bool isCaptured = m_codeBlock->isCaptured(operand);
if (nodeIndex != NoNode) {
Node* nodePtr = &m_graph[nodeIndex];
@@ -339,10 +337,10 @@ private:
void setArgument(int operand, NodeIndex value, SetMode setMode = NormalSet)
{
unsigned argument = operandToArgument(operand);
- bool isCaptured = m_codeBlock->argumentIsCaptured(argument);
-
ASSERT(argument < m_numArguments);
+ bool isCaptured = m_codeBlock->isCaptured(operand);
+
// Always flush arguments, except for 'this'.
if (argument && setMode == NormalSet)
flushDirect(operand);
@@ -402,7 +400,7 @@ private:
// FIXME: This should check if the same operand had already been flushed to
// some other local variable.
- bool isCaptured = m_codeBlock->isCaptured(m_inlineStackTop->m_inlineCallFrame, operand);
+ bool isCaptured = m_codeBlock->isCaptured(operand, m_inlineStackTop->m_inlineCallFrame);
ASSERT(operand < FirstConstantRegisterIndex);
@@ -1685,7 +1683,7 @@ void ByteCodeParser::handleGetByOffset(
if (isInlineOffset(offset))
propertyStorage = base;
else
- propertyStorage = addToGraph(GetPropertyStorage, base);
+ propertyStorage = addToGraph(GetButterfly, base);
set(destinationOperand,
addToGraph(
GetByOffset, OpInfo(m_graph.m_storageAccessData.size()), OpInfo(prediction),
@@ -1773,7 +1771,7 @@ bool ByteCodeParser::parseBlock(unsigned limit)
m_graph.m_arguments.resize(m_numArguments);
for (unsigned argument = 0; argument < m_numArguments; ++argument) {
VariableAccessData* variable = newVariableAccessData(
- argumentToOperand(argument), m_codeBlock->argumentIsCaptured(argument));
+ argumentToOperand(argument), m_codeBlock->isCaptured(argumentToOperand(argument)));
variable->mergeStructureCheckHoistingFailed(
m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCache));
NodeIndex setArgument = addToGraph(SetArgument, OpInfo(variable));
@@ -2276,7 +2274,8 @@ bool ByteCodeParser::parseBlock(unsigned limit)
NEXT_OPCODE(op_put_scoped_var);
}
case op_get_by_id:
- case op_get_by_id_out_of_line: {
+ case op_get_by_id_out_of_line:
+ case op_get_array_length: {
SpeculatedType prediction = getPrediction();
NodeIndex base = get(currentInstruction[2].u.operand);
@@ -2317,7 +2316,7 @@ bool ByteCodeParser::parseBlock(unsigned limit)
if (isInlineOffset(putByIdStatus.offset()))
propertyStorage = base;
else
- propertyStorage = addToGraph(GetPropertyStorage, base);
+ propertyStorage = addToGraph(GetButterfly, base);
addToGraph(PutByOffset, OpInfo(m_graph.m_storageAccessData.size()), propertyStorage, base, value);
StorageAccessData storageAccessData;
@@ -2368,13 +2367,13 @@ bool ByteCodeParser::parseBlock(unsigned limit)
} else {
propertyStorage = addToGraph(
ReallocatePropertyStorage, OpInfo(transitionData),
- base, addToGraph(GetPropertyStorage, base));
+ base, addToGraph(GetButterfly, base));
}
} else {
if (isInlineOffset(putByIdStatus.offset()))
propertyStorage = base;
else
- propertyStorage = addToGraph(GetPropertyStorage, base);
+ propertyStorage = addToGraph(GetButterfly, base);
}
addToGraph(PutStructure, OpInfo(transitionData), base);
@@ -2458,7 +2457,8 @@ bool ByteCodeParser::parseBlock(unsigned limit)
NEXT_OPCODE(op_get_global_var_watchable);
}
- case op_put_global_var: {
+ case op_put_global_var:
+ case op_init_global_const: {
NodeIndex value = get(currentInstruction[2].u.operand);
addToGraph(
PutGlobalVar,
@@ -2467,7 +2467,8 @@ bool ByteCodeParser::parseBlock(unsigned limit)
NEXT_OPCODE(op_put_global_var);
}
- case op_put_global_var_check: {
+ case op_put_global_var_check:
+ case op_init_global_const_check: {
NodeIndex value = get(currentInstruction[2].u.operand);
CodeBlock* codeBlock = m_inlineStackTop->m_codeBlock;
JSGlobalObject* globalObject = codeBlock->globalObject();
@@ -3187,17 +3188,21 @@ ByteCodeParser::InlineStackEntry::InlineStackEntry(
if (inlineCallFrame.caller.inlineCallFrame)
inlineCallFrame.capturedVars = inlineCallFrame.caller.inlineCallFrame->capturedVars;
else {
- for (int i = byteCodeParser->m_codeBlock->m_numCapturedVars; i--;)
- inlineCallFrame.capturedVars.set(i);
+ for (int i = byteCodeParser->m_codeBlock->m_numVars; i--;) {
+ if (byteCodeParser->m_codeBlock->isCaptured(i))
+ inlineCallFrame.capturedVars.set(i);
+ }
}
-
- if (codeBlock->argumentsAreCaptured()) {
- for (int i = argumentCountIncludingThis; i--;)
+
+ for (int i = argumentCountIncludingThis; i--;) {
+ if (codeBlock->isCaptured(argumentToOperand(i)))
inlineCallFrame.capturedVars.set(argumentToOperand(i) + inlineCallFrame.stackOffset);
}
- for (int i = codeBlock->m_numCapturedVars; i--;)
- inlineCallFrame.capturedVars.set(i + inlineCallFrame.stackOffset);
-
+ for (size_t i = codeBlock->m_numVars; i--;) {
+ if (codeBlock->isCaptured(i))
+ inlineCallFrame.capturedVars.set(i + inlineCallFrame.stackOffset);
+ }
+
#if DFG_ENABLE(DEBUG_VERBOSE)
dataLog("Current captured variables: ");
inlineCallFrame.capturedVars.dump(WTF::dataFile());
diff --git a/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp b/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp
index b3681975d..0914f62c6 100644
--- a/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp
@@ -582,8 +582,10 @@ private:
break;
Node& node = m_graph[index];
+ if (!node.shouldGenerate())
+ continue;
switch (node.op()) {
- case GetPropertyStorage:
+ case GetButterfly:
if (node.child1() == child1)
return index;
break;
@@ -632,6 +634,8 @@ private:
break;
Node& node = m_graph[index];
+ if (!node.shouldGenerate())
+ continue;
switch (node.op()) {
case PutByOffset:
case PutStructure:
@@ -661,6 +665,8 @@ private:
break;
Node& node = m_graph[index];
+ if (!node.shouldGenerate())
+ continue;
switch (node.op()) {
case GetIndexedPropertyStorage: {
if (node.child1() == child1 && node.arrayMode() == arrayMode)
@@ -688,6 +694,8 @@ private:
for (unsigned i = endIndexForPureCSE(); i--;) {
NodeIndex index = m_currentBlock->at(i);
Node& node = m_graph[index];
+ if (!node.shouldGenerate())
+ continue;
if (node.op() == GetScopeChain
&& node.scopeChainDepth() == depth)
return index;
@@ -702,6 +710,8 @@ private:
for (unsigned i = m_indexInBlock; i--;) {
NodeIndex index = m_currentBlock->at(i);
Node& node = m_graph[index];
+ if (!node.shouldGenerate())
+ continue;
switch (node.op()) {
case GetLocal:
if (node.local() == local) {
@@ -1160,7 +1170,7 @@ private:
break;
}
- case GetPropertyStorage:
+ case GetButterfly:
setReplacement(getPropertyStorageLoadElimination(node.child1().index()));
break;
diff --git a/Source/JavaScriptCore/dfg/DFGCapabilities.h b/Source/JavaScriptCore/dfg/DFGCapabilities.h
index 2bc9b2965..bccde7ca7 100644
--- a/Source/JavaScriptCore/dfg/DFGCapabilities.h
+++ b/Source/JavaScriptCore/dfg/DFGCapabilities.h
@@ -120,6 +120,7 @@ inline CapabilityLevel canCompileOpcode(OpcodeID opcodeID, CodeBlock*, Instructi
case op_put_scoped_var:
case op_get_by_id:
case op_get_by_id_out_of_line:
+ case op_get_array_length:
case op_put_by_id:
case op_put_by_id_out_of_line:
case op_put_by_id_transition_direct:
@@ -130,6 +131,8 @@ inline CapabilityLevel canCompileOpcode(OpcodeID opcodeID, CodeBlock*, Instructi
case op_get_global_var_watchable:
case op_put_global_var:
case op_put_global_var_check:
+ case op_init_global_const:
+ case op_init_global_const_check:
case op_jmp:
case op_loop:
case op_jtrue:
diff --git a/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp b/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
index 7700b4b86..2f92e5608 100644
--- a/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
@@ -92,7 +92,7 @@ private:
arrayMode = refineArrayMode(
fromObserved(arrayProfile->observedArrayModes(), false),
m_graph[node.child1()].prediction(),
- m_graph[m_compileIndex].prediction());
+ m_graph[m_compileIndex].prediction());
if (modeSupportsLength(arrayMode) && arrayProfile->hasDefiniteStructure()) {
m_graph.ref(nodePtr->child1());
Node checkStructure(CheckStructure, nodePtr->codeOrigin, OpInfo(m_graph.addStructureSet(arrayProfile->expectedStructure())), nodePtr->child1().index());
@@ -112,7 +112,7 @@ private:
break;
nodePtr->setOp(GetArrayLength);
ASSERT(nodePtr->flags() & NodeMustGenerate);
- nodePtr->clearFlags(NodeMustGenerate);
+ nodePtr->clearFlags(NodeMustGenerate | NodeClobbersWorld);
m_graph.deref(m_compileIndex);
nodePtr->setArrayMode(arrayMode);
@@ -365,6 +365,16 @@ private:
#endif
}
+ NodeIndex addNode(const Node& node, bool shouldGenerate)
+ {
+ NodeIndex nodeIndex = m_graph.size();
+ m_graph.append(node);
+ m_insertionSet.append(m_indexInBlock, nodeIndex);
+ if (shouldGenerate)
+ m_graph[nodeIndex].ref();
+ return nodeIndex;
+ }
+
NodeIndex checkArray(Array::Mode arrayMode, CodeOrigin codeOrigin, NodeIndex array, bool (*storageCheck)(Array::Mode) = canCSEStorage, bool shouldGenerate = true)
{
ASSERT(modeIsSpecific(arrayMode));
@@ -381,15 +391,11 @@ private:
if (shouldGenerate)
m_graph.ref(array);
- Node getIndexedPropertyStorage(
- GetIndexedPropertyStorage, codeOrigin, OpInfo(arrayMode), array);
- if (shouldGenerate)
- getIndexedPropertyStorage.ref();
- NodeIndex getIndexedPropertyStorageIndex = m_graph.size();
- m_graph.append(getIndexedPropertyStorage);
- m_insertionSet.append(m_indexInBlock, getIndexedPropertyStorageIndex);
- return getIndexedPropertyStorageIndex;
+ if (modeUsesButterfly(arrayMode))
+ return addNode(Node(GetButterfly, codeOrigin, array), shouldGenerate);
+
+ return addNode(Node(GetIndexedPropertyStorage, codeOrigin, OpInfo(arrayMode), array), shouldGenerate);
}
void blessArrayOperation(Edge base, unsigned storageChildIdx)
diff --git a/Source/JavaScriptCore/dfg/DFGGraph.h b/Source/JavaScriptCore/dfg/DFGGraph.h
index 70cbbaf07..4166f72c9 100644
--- a/Source/JavaScriptCore/dfg/DFGGraph.h
+++ b/Source/JavaScriptCore/dfg/DFGGraph.h
@@ -473,7 +473,7 @@ public:
{
switch (node.arrayMode()) {
case Array::Generic:
- case Array::JSArrayOutOfBounds:
+ case OUT_OF_BOUNDS_ARRAY_STORAGE_MODES:
return false;
case Array::String:
return node.op() == GetByVal;
diff --git a/Source/JavaScriptCore/dfg/DFGNode.h b/Source/JavaScriptCore/dfg/DFGNode.h
index 0a51b71d7..a4358798a 100644
--- a/Source/JavaScriptCore/dfg/DFGNode.h
+++ b/Source/JavaScriptCore/dfg/DFGNode.h
@@ -78,6 +78,8 @@ struct OpInfo {
struct Node {
enum VarArgTag { VarArg };
+ Node() { }
+
// Construct a node with up to 3 children, no immediate value.
Node(NodeType op, CodeOrigin codeOrigin, NodeIndex child1 = NoNode, NodeIndex child2 = NoNode, NodeIndex child3 = NoNode)
: codeOrigin(codeOrigin)
diff --git a/Source/JavaScriptCore/dfg/DFGNodeType.h b/Source/JavaScriptCore/dfg/DFGNodeType.h
index d86b9b356..4c2a85ccc 100644
--- a/Source/JavaScriptCore/dfg/DFGNodeType.h
+++ b/Source/JavaScriptCore/dfg/DFGNodeType.h
@@ -137,7 +137,7 @@ namespace JSC { namespace DFG {
macro(PhantomPutStructure, NodeMustGenerate | NodeDoesNotExit) \
macro(AllocatePropertyStorage, NodeMustGenerate | NodeDoesNotExit | NodeResultStorage) \
macro(ReallocatePropertyStorage, NodeMustGenerate | NodeDoesNotExit | NodeResultStorage) \
- macro(GetPropertyStorage, NodeResultStorage) \
+ macro(GetButterfly, NodeResultStorage) \
macro(CheckArray, NodeMustGenerate) \
macro(GetIndexedPropertyStorage, NodeResultStorage) \
macro(GetByOffset, NodeResultJS) \
diff --git a/Source/JavaScriptCore/dfg/DFGOperations.cpp b/Source/JavaScriptCore/dfg/DFGOperations.cpp
index b5bfd2334..19a389218 100644
--- a/Source/JavaScriptCore/dfg/DFGOperations.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOperations.cpp
@@ -27,6 +27,7 @@
#include "DFGOperations.h"
#include "Arguments.h"
+#include "ButterflyInlineMethods.h"
#include "CodeBlock.h"
#include "CopiedSpaceInlineMethods.h"
#include "DFGOSRExit.h"
@@ -226,14 +227,14 @@ static inline void putByVal(ExecState* exec, JSValue baseValue, uint32_t index,
JSGlobalData& globalData = exec->globalData();
NativeCallFrameTracer tracer(&globalData, exec);
- if (isJSArray(baseValue)) {
- JSArray* array = asArray(baseValue);
- if (array->canSetIndex(index)) {
- array->setIndex(globalData, index, value);
+ if (baseValue.isObject()) {
+ JSObject* object = asObject(baseValue);
+ if (object->canSetIndexQuickly(index)) {
+ object->setIndexQuickly(globalData, index, value);
return;
}
- JSArray::putByIndex(array, exec, index, value, strict);
+ object->methodTable()->putByIndex(object, exec, index, value, strict);
return;
}
@@ -341,11 +342,12 @@ static inline EncodedJSValue getByVal(ExecState* exec, JSCell* base, uint32_t in
JSGlobalData& globalData = exec->globalData();
NativeCallFrameTracer tracer(&globalData, exec);
- // FIXME: the JIT used to handle these in compiled code!
- if (isJSArray(base) && asArray(base)->canGetIndex(index))
- return JSValue::encode(asArray(base)->getIndex(index));
+ if (base->isObject()) {
+ JSObject* object = asObject(base);
+ if (object->canGetIndexQuickly(index))
+ return JSValue::encode(object->getIndexQuickly(index));
+ }
- // FIXME: the JITstub used to relink this to an optimized form!
if (isJSString(base) && asString(base)->canGetIndex(index))
return JSValue::encode(asString(base)->getIndex(exec, index));
@@ -548,15 +550,15 @@ void DFG_OPERATION operationPutByValCellNonStrict(ExecState* exec, JSCell* cell,
operationPutByValInternal<false>(exec, JSValue::encode(cell), encodedProperty, encodedValue);
}
-void DFG_OPERATION operationPutByValBeyondArrayBoundsStrict(ExecState* exec, JSArray* array, int32_t index, EncodedJSValue encodedValue)
+void DFG_OPERATION operationPutByValBeyondArrayBoundsStrict(ExecState* exec, JSObject* array, int32_t index, EncodedJSValue encodedValue)
{
JSGlobalData* globalData = &exec->globalData();
NativeCallFrameTracer tracer(globalData, exec);
if (index >= 0) {
// We should only get here if index is outside the existing vector.
- ASSERT(!array->canSetIndex(index));
- JSArray::putByIndex(array, exec, index, JSValue::decode(encodedValue), true);
+ ASSERT(!array->canSetIndexQuickly(index));
+ array->methodTable()->putByIndex(array, exec, index, JSValue::decode(encodedValue), true);
return;
}
@@ -565,15 +567,15 @@ void DFG_OPERATION operationPutByValBeyondArrayBoundsStrict(ExecState* exec, JSA
array, exec, Identifier::from(exec, index), JSValue::decode(encodedValue), slot);
}
-void DFG_OPERATION operationPutByValBeyondArrayBoundsNonStrict(ExecState* exec, JSArray* array, int32_t index, EncodedJSValue encodedValue)
+void DFG_OPERATION operationPutByValBeyondArrayBoundsNonStrict(ExecState* exec, JSObject* array, int32_t index, EncodedJSValue encodedValue)
{
JSGlobalData* globalData = &exec->globalData();
NativeCallFrameTracer tracer(globalData, exec);
if (index >= 0) {
// We should only get here if index is outside the existing vector.
- ASSERT(!array->canSetIndex(index));
- JSArray::putByIndex(array, exec, index, JSValue::decode(encodedValue), false);
+ ASSERT(!array->canSetIndexQuickly(index));
+ array->methodTable()->putByIndex(array, exec, index, JSValue::decode(encodedValue), false);
return;
}
@@ -1263,20 +1265,29 @@ void DFG_OPERATION operationReallocateStorageAndFinishPut(ExecState* exec, JSObj
char* DFG_OPERATION operationAllocatePropertyStorageWithInitialCapacity(ExecState* exec)
{
- JSGlobalData& globalData = exec->globalData();
- void* result;
- if (!globalData.heap.tryAllocateStorage(initialOutOfLineCapacity * sizeof(JSValue), &result))
- CRASH();
- return reinterpret_cast<char*>(reinterpret_cast<JSValue*>(result) + initialOutOfLineCapacity + 1);
+ return reinterpret_cast<char*>(
+ Butterfly::createUninitialized(exec->globalData(), 0, initialOutOfLineCapacity, false, 0));
}
char* DFG_OPERATION operationAllocatePropertyStorage(ExecState* exec, size_t newSize)
{
- JSGlobalData& globalData = exec->globalData();
- void* result;
- if (!globalData.heap.tryAllocateStorage(newSize, &result))
- CRASH();
- return reinterpret_cast<char*>(reinterpret_cast<JSValue*>(result) + 1) + newSize;
+ return reinterpret_cast<char*>(
+ Butterfly::createUninitialized(exec->globalData(), 0, newSize, false, 0));
+}
+
+char* DFG_OPERATION operationReallocateButterflyToHavePropertyStorageWithInitialCapacity(ExecState* exec, JSObject* object)
+{
+ ASSERT(!object->structure()->outOfLineCapacity());
+ Butterfly* result = object->growOutOfLineStorage(exec->globalData(), 0, initialOutOfLineCapacity);
+ object->setButterflyWithoutChangingStructure(result);
+ return reinterpret_cast<char*>(result);
+}
+
+char* DFG_OPERATION operationReallocateButterflyToGrowPropertyStorage(ExecState* exec, JSObject* object, size_t newSize)
+{
+ Butterfly* result = object->growOutOfLineStorage(exec->globalData(), object->structure()->outOfLineCapacity(), newSize);
+ object->setButterflyWithoutChangingStructure(result);
+ return reinterpret_cast<char*>(result);
}
double DFG_OPERATION operationFModOnInts(int32_t a, int32_t b)
diff --git a/Source/JavaScriptCore/dfg/DFGOperations.h b/Source/JavaScriptCore/dfg/DFGOperations.h
index aa52703c7..02c6b3ab3 100644
--- a/Source/JavaScriptCore/dfg/DFGOperations.h
+++ b/Source/JavaScriptCore/dfg/DFGOperations.h
@@ -95,7 +95,7 @@ typedef size_t DFG_OPERATION (*S_DFGOperation_ECC)(ExecState*, JSCell*, JSCell*)
typedef size_t DFG_OPERATION (*S_DFGOperation_EJ)(ExecState*, EncodedJSValue);
typedef size_t DFG_OPERATION (*S_DFGOperation_EJJ)(ExecState*, EncodedJSValue, EncodedJSValue);
typedef size_t DFG_OPERATION (*S_DFGOperation_J)(EncodedJSValue);
-typedef void DFG_OPERATION (*V_DFGOperation_EAZJ)(ExecState*, JSArray*, int32_t, EncodedJSValue);
+typedef void DFG_OPERATION (*V_DFGOperation_EOZJ)(ExecState*, JSObject*, int32_t, EncodedJSValue);
typedef void DFG_OPERATION (*V_DFGOperation_EC)(ExecState*, JSCell*);
typedef void DFG_OPERATION (*V_DFGOperation_ECIcf)(ExecState*, JSCell*, InlineCallFrame*);
typedef void DFG_OPERATION (*V_DFGOperation_ECCIcf)(ExecState*, JSCell*, JSCell*, InlineCallFrame*);
@@ -108,8 +108,10 @@ typedef void DFG_OPERATION (*V_DFGOperation_EJPP)(ExecState*, EncodedJSValue, En
typedef void DFG_OPERATION (*V_DFGOperation_EPZJ)(ExecState*, void*, int32_t, EncodedJSValue);
typedef void DFG_OPERATION (*V_DFGOperation_W)(WatchpointSet*);
typedef char* DFG_OPERATION (*P_DFGOperation_E)(ExecState*);
-typedef char* DFG_OPERATION (*P_DFGOperation_ES)(ExecState*, size_t);
+typedef char* DFG_OPERATION (*P_DFGOperation_EO)(ExecState*, JSObject*);
+typedef char* DFG_OPERATION (*P_DFGOperation_EOS)(ExecState*, JSObject*, size_t);
typedef char* DFG_OPERATION (*P_DFGOperation_EPS)(ExecState*, void*, size_t);
+typedef char* DFG_OPERATION (*P_DFGOperation_ES)(ExecState*, size_t);
// These routines are provide callbacks out to C++ implementations of operations too complex to JIT.
JSCell* DFG_OPERATION operationNewObject(ExecState*) WTF_INTERNAL;
@@ -142,8 +144,8 @@ void DFG_OPERATION operationPutByValStrict(ExecState*, EncodedJSValue encodedBas
void DFG_OPERATION operationPutByValNonStrict(ExecState*, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue) WTF_INTERNAL;
void DFG_OPERATION operationPutByValCellStrict(ExecState*, JSCell*, EncodedJSValue encodedProperty, EncodedJSValue encodedValue) WTF_INTERNAL;
void DFG_OPERATION operationPutByValCellNonStrict(ExecState*, JSCell*, EncodedJSValue encodedProperty, EncodedJSValue encodedValue) WTF_INTERNAL;
-void DFG_OPERATION operationPutByValBeyondArrayBoundsStrict(ExecState*, JSArray*, int32_t index, EncodedJSValue encodedValue) WTF_INTERNAL;
-void DFG_OPERATION operationPutByValBeyondArrayBoundsNonStrict(ExecState*, JSArray*, int32_t index, EncodedJSValue encodedValue) WTF_INTERNAL;
+void DFG_OPERATION operationPutByValBeyondArrayBoundsStrict(ExecState*, JSObject*, int32_t index, EncodedJSValue encodedValue) WTF_INTERNAL;
+void DFG_OPERATION operationPutByValBeyondArrayBoundsNonStrict(ExecState*, JSObject*, int32_t index, EncodedJSValue encodedValue) WTF_INTERNAL;
EncodedJSValue DFG_OPERATION operationArrayPush(ExecState*, EncodedJSValue encodedValue, JSArray*) WTF_INTERNAL;
EncodedJSValue DFG_OPERATION operationArrayPop(ExecState*, JSArray*) WTF_INTERNAL;
EncodedJSValue DFG_OPERATION operationRegExpExec(ExecState*, JSCell*, JSCell*) WTF_INTERNAL;
@@ -189,6 +191,8 @@ size_t DFG_OPERATION operationIsFunction(EncodedJSValue) WTF_INTERNAL;
void DFG_OPERATION operationReallocateStorageAndFinishPut(ExecState*, JSObject*, Structure*, PropertyOffset, EncodedJSValue) WTF_INTERNAL;
char* DFG_OPERATION operationAllocatePropertyStorageWithInitialCapacity(ExecState*) WTF_INTERNAL;
char* DFG_OPERATION operationAllocatePropertyStorage(ExecState*, size_t newSize) WTF_INTERNAL;
+char* DFG_OPERATION operationReallocateButterflyToHavePropertyStorageWithInitialCapacity(ExecState*, JSObject*) WTF_INTERNAL;
+char* DFG_OPERATION operationReallocateButterflyToGrowPropertyStorage(ExecState*, JSObject*, size_t newSize) WTF_INTERNAL;
// This method is used to lookup an exception hander, keyed by faultLocation, which is
// the return location from one of the calls out to one of the helper operations above.
diff --git a/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp b/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
index af57ab8fe..5b23650fa 100644
--- a/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
@@ -448,7 +448,7 @@ private:
break;
}
- case GetPropertyStorage:
+ case GetButterfly:
case GetIndexedPropertyStorage:
case AllocatePropertyStorage:
case ReallocatePropertyStorage: {
diff --git a/Source/JavaScriptCore/dfg/DFGRepatch.cpp b/Source/JavaScriptCore/dfg/DFGRepatch.cpp
index 1af4999e8..690f0dd3e 100644
--- a/Source/JavaScriptCore/dfg/DFGRepatch.cpp
+++ b/Source/JavaScriptCore/dfg/DFGRepatch.cpp
@@ -199,12 +199,12 @@ static void generateProtoChainAccessStub(ExecState* exec, StructureStubInfo& stu
stubJit.load32(MacroAssembler::Address(resultGPR, OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)), resultGPR);
#endif
} else {
- stubJit.loadPtr(protoObject->addressOfOutOfLineStorage(), resultGPR);
+ stubJit.loadPtr(protoObject->butterflyAddress(), resultGPR);
#if USE(JSVALUE64)
- stubJit.loadPtr(MacroAssembler::Address(resultGPR, offsetInOutOfLineStorage(offset) * sizeof(WriteBarrier<Unknown>)), resultGPR);
+ stubJit.loadPtr(MacroAssembler::Address(resultGPR, offsetInButterfly(offset) * sizeof(WriteBarrier<Unknown>)), resultGPR);
#elif USE(JSVALUE32_64)
- stubJit.load32(MacroAssembler::Address(resultGPR, offsetInOutOfLineStorage(offset) * sizeof(WriteBarrier<Unknown>) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)), resultTagGPR);
- stubJit.load32(MacroAssembler::Address(resultGPR, offsetInOutOfLineStorage(offset) * sizeof(WriteBarrier<Unknown>) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)), resultGPR);
+ stubJit.load32(MacroAssembler::Address(resultGPR, offsetInButterfly(offset) * sizeof(WriteBarrier<Unknown>) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)), resultTagGPR);
+ stubJit.load32(MacroAssembler::Address(resultGPR, offsetInButterfly(offset) * sizeof(WriteBarrier<Unknown>) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)), resultGPR);
#endif
}
@@ -254,13 +254,12 @@ static bool tryCacheGetByID(ExecState* exec, JSValue baseValue, const Identifier
MacroAssembler::JumpList failureCases;
stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSCell::structureOffset()), scratchGPR);
- failureCases.append(stubJit.branchPtr(
- MacroAssembler::NotEqual,
- MacroAssembler::Address(scratchGPR, Structure::classInfoOffset()),
- MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
+ stubJit.load8(MacroAssembler::Address(scratchGPR, Structure::indexingTypeOffset()), scratchGPR);
+ failureCases.append(stubJit.branchTest32(MacroAssembler::Zero, scratchGPR, MacroAssembler::TrustedImm32(IsArray)));
+ failureCases.append(stubJit.branchTest32(MacroAssembler::Zero, scratchGPR, MacroAssembler::TrustedImm32(HasArrayStorage)));
- stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSArray::storageOffset()), scratchGPR);
- stubJit.load32(MacroAssembler::Address(scratchGPR, OBJECT_OFFSETOF(ArrayStorage, m_length)), scratchGPR);
+ stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::butterflyOffset()), scratchGPR);
+ stubJit.load32(MacroAssembler::Address(scratchGPR, ArrayStorage::lengthOffset()), scratchGPR);
failureCases.append(stubJit.branch32(MacroAssembler::LessThan, scratchGPR, MacroAssembler::TrustedImm32(0)));
#if USE(JSVALUE64)
@@ -427,7 +426,7 @@ static bool tryBuildGetByIDList(ExecState* exec, JSValue baseValue, const Identi
stubJit.load32(MacroAssembler::Address(baseGPR, offsetRelativeToBase(slot.cachedOffset())), scratchGPR);
#endif
} else {
- stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::offsetOfOutOfLineStorage()), scratchGPR);
+ stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::butterflyOffset()), scratchGPR);
#if USE(JSVALUE64)
stubJit.loadPtr(MacroAssembler::Address(scratchGPR, offsetRelativeToBase(slot.cachedOffset())), scratchGPR);
#else
@@ -477,7 +476,7 @@ static bool tryBuildGetByIDList(ExecState* exec, JSValue baseValue, const Identi
}
#endif
} else {
- stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::offsetOfOutOfLineStorage()), resultGPR);
+ stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::butterflyOffset()), resultGPR);
#if USE(JSVALUE64)
stubJit.loadPtr(MacroAssembler::Address(resultGPR, offsetRelativeToBase(slot.cachedOffset())), resultGPR);
#else
@@ -685,17 +684,17 @@ static void emitPutReplaceStub(
if (isInlineOffset(slot.cachedOffset()))
stubJit.storePtr(valueGPR, MacroAssembler::Address(baseGPR, JSObject::offsetOfInlineStorage() + offsetInInlineStorage(slot.cachedOffset()) * sizeof(JSValue)));
else {
- stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::offsetOfOutOfLineStorage()), scratchGPR);
- stubJit.storePtr(valueGPR, MacroAssembler::Address(scratchGPR, offsetInOutOfLineStorage(slot.cachedOffset()) * sizeof(JSValue)));
+ stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::butterflyOffset()), scratchGPR);
+ stubJit.storePtr(valueGPR, MacroAssembler::Address(scratchGPR, offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue)));
}
#elif USE(JSVALUE32_64)
if (isInlineOffset(slot.cachedOffset())) {
stubJit.store32(valueGPR, MacroAssembler::Address(baseGPR, JSObject::offsetOfInlineStorage() + offsetInInlineStorage(slot.cachedOffset()) * sizeof(JSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)));
stubJit.store32(valueTagGPR, MacroAssembler::Address(baseGPR, JSObject::offsetOfInlineStorage() + offsetInInlineStorage(slot.cachedOffset()) * sizeof(JSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)));
} else {
- stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::offsetOfOutOfLineStorage()), scratchGPR);
- stubJit.store32(valueGPR, MacroAssembler::Address(scratchGPR, offsetInOutOfLineStorage(slot.cachedOffset()) * sizeof(JSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)));
- stubJit.store32(valueTagGPR, MacroAssembler::Address(scratchGPR, offsetInOutOfLineStorage(slot.cachedOffset()) * sizeof(JSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)));
+ stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::butterflyOffset()), scratchGPR);
+ stubJit.store32(valueGPR, MacroAssembler::Address(scratchGPR, offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)));
+ stubJit.store32(valueTagGPR, MacroAssembler::Address(scratchGPR, offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)));
}
#endif
@@ -834,7 +833,7 @@ static void emitPutTransitionStub(
size_t oldSize = oldStructure->outOfLineCapacity() * sizeof(JSValue);
ASSERT(newSize > oldSize);
- stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::offsetOfOutOfLineStorage()), scratchGPR3);
+ stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::butterflyOffset()), scratchGPR3);
stubJit.loadPtr(&copiedAllocator->m_currentRemaining, scratchGPR1);
slowPath.append(stubJit.branchSubPtr(MacroAssembler::Signed, MacroAssembler::TrustedImm32(newSize), scratchGPR1));
stubJit.storePtr(scratchGPR1, &copiedAllocator->m_currentRemaining);
@@ -848,7 +847,7 @@ static void emitPutTransitionStub(
}
}
- stubJit.storePtr(scratchGPR1, MacroAssembler::Address(baseGPR, JSObject::offsetOfOutOfLineStorage()));
+ stubJit.storePtr(scratchGPR1, MacroAssembler::Address(baseGPR, JSObject::butterflyOffset()));
scratchGPR1HasStorage = true;
}
@@ -858,8 +857,8 @@ static void emitPutTransitionStub(
stubJit.storePtr(valueGPR, MacroAssembler::Address(baseGPR, JSObject::offsetOfInlineStorage() + offsetInInlineStorage(slot.cachedOffset()) * sizeof(JSValue)));
else {
if (!scratchGPR1HasStorage)
- stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::offsetOfOutOfLineStorage()), scratchGPR1);
- stubJit.storePtr(valueGPR, MacroAssembler::Address(scratchGPR1, offsetInOutOfLineStorage(slot.cachedOffset()) * sizeof(JSValue)));
+ stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::butterflyOffset()), scratchGPR1);
+ stubJit.storePtr(valueGPR, MacroAssembler::Address(scratchGPR1, offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue)));
}
#elif USE(JSVALUE32_64)
if (isInlineOffset(slot.cachedOffset())) {
@@ -867,9 +866,9 @@ static void emitPutTransitionStub(
stubJit.store32(valueTagGPR, MacroAssembler::Address(baseGPR, JSObject::offsetOfInlineStorage() + offsetInInlineStorage(slot.cachedOffset()) * sizeof(JSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)));
} else {
if (!scratchGPR1HasStorage)
- stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::offsetOfOutOfLineStorage()), scratchGPR1);
- stubJit.store32(valueGPR, MacroAssembler::Address(scratchGPR1, offsetInOutOfLineStorage(slot.cachedOffset()) * sizeof(JSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)));
- stubJit.store32(valueTagGPR, MacroAssembler::Address(scratchGPR1, offsetInOutOfLineStorage(slot.cachedOffset()) * sizeof(JSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)));
+ stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::butterflyOffset()), scratchGPR1);
+ stubJit.store32(valueGPR, MacroAssembler::Address(scratchGPR1, offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)));
+ stubJit.store32(valueTagGPR, MacroAssembler::Address(scratchGPR1, offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)));
}
#endif
@@ -1024,6 +1023,11 @@ static bool tryBuildPutByIdList(ExecState* exec, JSValue baseValue, const Identi
&& oldStructure->outOfLineCapacity())
return false;
+ // Skip optimizing the case where we need realloc, and the structure has
+ // indexing storage.
+ if (hasIndexingHeader(oldStructure->indexingType()))
+ return false;
+
normalizePrototypeChain(exec, baseCell);
StructureChain* prototypeChain = structure->prototypeChain(exec);
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
index c9c07da80..b1f3212f9 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
@@ -315,19 +315,37 @@ void SpeculativeJIT::checkArray(Node& node)
case Array::String:
expectedClassInfo = &JSString::s_info;
break;
- case Array::JSArray:
- case Array::JSArrayOutOfBounds: {
- // This code duplicates the code below in anticipation of this code being
- // substantially changed in the future.
+ case NON_ARRAY_ARRAY_STORAGE_MODES: {
GPRTemporary temp(this);
m_jit.loadPtr(
MacroAssembler::Address(baseReg, JSCell::structureOffset()), temp.gpr());
speculationCheck(
Uncountable, JSValueRegs(), NoNode,
- m_jit.branchPtr(
- MacroAssembler::NotEqual,
- MacroAssembler::Address(temp.gpr(), Structure::classInfoOffset()),
- MacroAssembler::TrustedImmPtr(&JSArray::s_info)));
+ m_jit.branchTest8(
+ MacroAssembler::Zero,
+ MacroAssembler::Address(temp.gpr(), Structure::indexingTypeOffset()),
+ MacroAssembler::TrustedImm32(HasArrayStorage)));
+
+ noResult(m_compileIndex);
+ return;
+ }
+ case ARRAY_WITH_ARRAY_STORAGE_MODES: {
+ GPRTemporary temp(this);
+ GPRReg tempGPR = temp.gpr();
+ m_jit.loadPtr(
+ MacroAssembler::Address(baseReg, JSCell::structureOffset()), tempGPR);
+ m_jit.load8(MacroAssembler::Address(tempGPR, Structure::indexingTypeOffset()), tempGPR);
+ // FIXME: This can be turned into a single branch. But we currently have no evidence
+ // that doing so would be profitable, nor do I feel comfortable with the present test
+ // coverage for this code path.
+ speculationCheck(
+ Uncountable, JSValueRegs(), NoNode,
+ m_jit.branchTest32(
+ MacroAssembler::Zero, tempGPR, MacroAssembler::TrustedImm32(IsArray)));
+ speculationCheck(
+ Uncountable, JSValueRegs(), NoNode,
+ m_jit.branchTest32(
+ MacroAssembler::Zero, tempGPR, MacroAssembler::TrustedImm32(HasArrayStorage)));
noResult(m_compileIndex);
return;
@@ -1342,11 +1360,10 @@ void SpeculativeJIT::compile(BasicBlock& block)
InlineCallFrame* inlineCallFrame = node.codeOrigin.inlineCallFrame;
int argumentCountIncludingThis = inlineCallFrame->arguments.size();
unsigned argumentPositionStart = node.argumentPositionStart();
- bool argumentsAreCaptured =
- baselineCodeBlockForInlineCallFrame(inlineCallFrame)->argumentsAreCaptured();
+ CodeBlock* codeBlock = baselineCodeBlockForInlineCallFrame(inlineCallFrame);
for (int i = 0; i < argumentCountIncludingThis; ++i) {
ValueRecovery recovery;
- if (argumentsAreCaptured)
+ if (codeBlock->isCaptured(argumentToOperand(i)))
recovery = ValueRecovery::alreadyInRegisterFile();
else {
ArgumentPosition& argumentPosition =
@@ -3006,11 +3023,6 @@ void SpeculativeJIT::compileGetIndexedPropertyStorage(Node& node)
m_jit.loadPtr(MacroAssembler::Address(storageReg, StringImpl::dataOffset()), storageReg);
break;
- case Array::JSArray:
- case Array::JSArrayOutOfBounds:
- m_jit.loadPtr(MacroAssembler::Address(baseReg, JSArray::storageOffset()), storageReg);
- break;
-
default:
ASSERT(descriptor);
m_jit.loadPtr(MacroAssembler::Address(baseReg, descriptor->m_storageOffset), storageReg);
@@ -3125,13 +3137,12 @@ void SpeculativeJIT::compileGetArrayLength(Node& node)
const TypedArrayDescriptor* descriptor = typedArrayDescriptor(node.arrayMode());
switch (node.arrayMode()) {
- case Array::JSArray:
- case Array::JSArrayOutOfBounds: {
+ case ARRAY_WITH_ARRAY_STORAGE_MODES: {
StorageOperand storage(this, node.child2());
GPRTemporary result(this, storage);
GPRReg storageReg = storage.gpr();
GPRReg resultReg = result.gpr();
- m_jit.load32(MacroAssembler::Address(storageReg, OBJECT_OFFSETOF(ArrayStorage, m_length)), resultReg);
+ m_jit.load32(MacroAssembler::Address(storageReg, ArrayStorage::lengthOffset()), resultReg);
speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::LessThan, resultReg, MacroAssembler::TrustedImm32(0)));
@@ -3227,6 +3238,20 @@ bool SpeculativeJIT::compileRegExpExec(Node& node)
void SpeculativeJIT::compileAllocatePropertyStorage(Node& node)
{
+ if (hasIndexingHeader(node.structureTransitionData().previousStructure->indexingType())) {
+ SpeculateCellOperand base(this, node.child1());
+
+ GPRReg baseGPR = base.gpr();
+
+ flushRegisters();
+
+ GPRResult result(this);
+ callOperation(operationReallocateButterflyToHavePropertyStorageWithInitialCapacity, result.gpr(), baseGPR);
+
+ storageResult(result.gpr(), m_compileIndex);
+ return;
+ }
+
SpeculateCellOperand base(this, node.child1());
GPRTemporary scratch(this);
@@ -3248,13 +3273,31 @@ void SpeculativeJIT::compileAllocatePropertyStorage(Node& node)
addSlowPathGenerator(
slowPathCall(slowPath, this, operationAllocatePropertyStorageWithInitialCapacity, scratchGPR));
- m_jit.storePtr(scratchGPR, JITCompiler::Address(baseGPR, JSObject::offsetOfOutOfLineStorage()));
+ m_jit.storePtr(scratchGPR, JITCompiler::Address(baseGPR, JSObject::butterflyOffset()));
storageResult(scratchGPR, m_compileIndex);
}
void SpeculativeJIT::compileReallocatePropertyStorage(Node& node)
{
+ size_t oldSize = node.structureTransitionData().previousStructure->outOfLineCapacity() * sizeof(JSValue);
+ size_t newSize = oldSize * outOfLineGrowthFactor;
+ ASSERT(newSize == node.structureTransitionData().newStructure->outOfLineCapacity() * sizeof(JSValue));
+
+ if (hasIndexingHeader(node.structureTransitionData().previousStructure->indexingType())) {
+ SpeculateCellOperand base(this, node.child1());
+
+ GPRReg baseGPR = base.gpr();
+
+ flushRegisters();
+
+ GPRResult result(this);
+ callOperation(operationReallocateButterflyToGrowPropertyStorage, result.gpr(), baseGPR, newSize / sizeof(JSValue));
+
+ storageResult(result.gpr(), m_compileIndex);
+ return;
+ }
+
SpeculateCellOperand base(this, node.child1());
StorageOperand oldStorage(this, node.child2());
GPRTemporary scratch1(this);
@@ -3267,9 +3310,6 @@ void SpeculativeJIT::compileReallocatePropertyStorage(Node& node)
JITCompiler::Jump slowPath;
- size_t oldSize = node.structureTransitionData().previousStructure->outOfLineCapacity() * sizeof(JSValue);
- size_t newSize = oldSize * outOfLineGrowthFactor;
- ASSERT(newSize == node.structureTransitionData().newStructure->outOfLineCapacity() * sizeof(JSValue));
CopiedAllocator* copiedAllocator = &m_jit.globalData()->heap.storageAllocator();
m_jit.loadPtr(&copiedAllocator->m_currentRemaining, scratchGPR2);
@@ -3280,13 +3320,13 @@ void SpeculativeJIT::compileReallocatePropertyStorage(Node& node)
m_jit.addPtr(JITCompiler::TrustedImm32(sizeof(JSValue)), scratchGPR2);
addSlowPathGenerator(
- slowPathCall(slowPath, this, operationAllocatePropertyStorage, scratchGPR2, newSize));
+ slowPathCall(slowPath, this, operationAllocatePropertyStorage, scratchGPR2, newSize / sizeof(JSValue)));
// We have scratchGPR2 = new storage, scratchGPR1 = scratch
for (ptrdiff_t offset = 0; offset < static_cast<ptrdiff_t>(oldSize); offset += sizeof(void*)) {
m_jit.loadPtr(JITCompiler::Address(oldStorageGPR, -(offset + sizeof(JSValue) + sizeof(void*))), scratchGPR1);
m_jit.storePtr(scratchGPR1, JITCompiler::Address(scratchGPR2, -(offset + sizeof(JSValue) + sizeof(void*))));
}
- m_jit.storePtr(scratchGPR2, JITCompiler::Address(baseGPR, JSObject::offsetOfOutOfLineStorage()));
+ m_jit.storePtr(scratchGPR2, JITCompiler::Address(baseGPR, JSObject::butterflyOffset()));
storageResult(scratchGPR2, m_compileIndex);
}
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
index 06a8d9e31..286b72c1a 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
@@ -1156,9 +1156,14 @@ public:
m_jit.setupArgumentsExecState();
return appendCallWithExceptionCheckSetResult(operation, result);
}
- JITCompiler::Call callOperation(P_DFGOperation_ES operation, GPRReg result, size_t size)
+ JITCompiler::Call callOperation(P_DFGOperation_EO operation, GPRReg result, GPRReg object)
{
- m_jit.setupArgumentsWithExecState(TrustedImmPtr(size));
+ m_jit.setupArgumentsWithExecState(object);
+ return appendCallWithExceptionCheckSetResult(operation, result);
+ }
+ JITCompiler::Call callOperation(P_DFGOperation_EOS operation, GPRReg result, GPRReg object, size_t size)
+ {
+ m_jit.setupArgumentsWithExecState(object, TrustedImmPtr(size));
return appendCallWithExceptionCheckSetResult(operation, result);
}
JITCompiler::Call callOperation(P_DFGOperation_EPS operation, GPRReg result, GPRReg old, size_t size)
@@ -1166,6 +1171,11 @@ public:
m_jit.setupArgumentsWithExecState(old, TrustedImmPtr(size));
return appendCallWithExceptionCheckSetResult(operation, result);
}
+ JITCompiler::Call callOperation(P_DFGOperation_ES operation, GPRReg result, size_t size)
+ {
+ m_jit.setupArgumentsWithExecState(TrustedImmPtr(size));
+ return appendCallWithExceptionCheckSetResult(operation, result);
+ }
JITCompiler::Call callOperation(J_DFGOperation_E operation, GPRReg result)
{
m_jit.setupArgumentsExecState();
@@ -1378,7 +1388,7 @@ public:
m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
return appendCallWithExceptionCheck(operation);
}
- JITCompiler::Call callOperation(V_DFGOperation_EAZJ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3)
+ JITCompiler::Call callOperation(V_DFGOperation_EOZJ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3)
{
m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
return appendCallWithExceptionCheck(operation);
@@ -1448,6 +1458,21 @@ public:
m_jit.setupArgumentsExecState();
return appendCallWithExceptionCheckSetResult(operation, result);
}
+ JITCompiler::Call callOperation(P_DFGOperation_EO operation, GPRReg result, GPRReg arg1)
+ {
+ m_jit.setupArgumentsWithExecState(arg1);
+ return appendCallWithExceptionCheckSetResult(operation, result);
+ }
+ JITCompiler::Call callOperation(P_DFGOperation_EOS operation, GPRReg result, GPRReg arg1, size_t arg2)
+ {
+ m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(arg2));
+ return appendCallWithExceptionCheckSetResult(operation, result);
+ }
+ JITCompiler::Call callOperation(P_DFGOperation_EPS operation, GPRReg result, GPRReg old, size_t size)
+ {
+ m_jit.setupArgumentsWithExecState(old, TrustedImmPtr(size));
+ return appendCallWithExceptionCheckSetResult(operation, result);
+ }
JITCompiler::Call callOperation(P_DFGOperation_ES operation, GPRReg result, size_t size)
{
m_jit.setupArgumentsWithExecState(TrustedImmPtr(size));
@@ -1696,7 +1721,7 @@ public:
m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3Payload, arg3Tag);
return appendCallWithExceptionCheck(operation);
}
- JITCompiler::Call callOperation(V_DFGOperation_EAZJ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3Tag, GPRReg arg3Payload)
+ JITCompiler::Call callOperation(V_DFGOperation_EOZJ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3Tag, GPRReg arg3Payload)
{
m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3Payload, arg3Tag);
return appendCallWithExceptionCheck(operation);
@@ -2185,7 +2210,7 @@ public:
m_jit.storePtr(structure, MacroAssembler::Address(resultGPR, JSCell::structureOffset()));
// Initialize the object's property storage pointer.
- m_jit.storePtr(MacroAssembler::TrustedImmPtr(0), MacroAssembler::Address(resultGPR, ClassType::offsetOfOutOfLineStorage()));
+ m_jit.storePtr(MacroAssembler::TrustedImmPtr(0), MacroAssembler::Address(resultGPR, JSObject::butterflyOffset()));
}
template<typename T>
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
index 38889fd05..f40db37a6 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
@@ -508,7 +508,7 @@ void SpeculativeJIT::cachedGetById(CodeOrigin codeOrigin, GPRReg baseTagGPROrNon
JITCompiler::DataLabelPtr structureToCompare;
JITCompiler::PatchableJump structureCheck = m_jit.patchableBranchPtrWithPatch(JITCompiler::NotEqual, JITCompiler::Address(basePayloadGPR, JSCell::structureOffset()), structureToCompare, JITCompiler::TrustedImmPtr(reinterpret_cast<void*>(-1)));
- JITCompiler::ConvertibleLoadLabel propertyStorageLoad = m_jit.convertibleLoadPtr(JITCompiler::Address(basePayloadGPR, JSObject::offsetOfOutOfLineStorage()), resultPayloadGPR);
+ JITCompiler::ConvertibleLoadLabel propertyStorageLoad = m_jit.convertibleLoadPtr(JITCompiler::Address(basePayloadGPR, JSObject::butterflyOffset()), resultPayloadGPR);
JITCompiler::DataLabelCompact tagLoadWithPatch = m_jit.load32WithCompactAddressOffsetPatch(JITCompiler::Address(resultPayloadGPR, OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)), resultTagGPR);
JITCompiler::DataLabelCompact payloadLoadWithPatch = m_jit.load32WithCompactAddressOffsetPatch(JITCompiler::Address(resultPayloadGPR, OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)), resultPayloadGPR);
@@ -565,7 +565,7 @@ void SpeculativeJIT::cachedPutById(CodeOrigin codeOrigin, GPRReg basePayloadGPR,
writeBarrier(basePayloadGPR, valueTagGPR, valueUse, WriteBarrierForPropertyAccess, scratchGPR);
- JITCompiler::ConvertibleLoadLabel propertyStorageLoad = m_jit.convertibleLoadPtr(JITCompiler::Address(basePayloadGPR, JSObject::offsetOfOutOfLineStorage()), scratchGPR);
+ JITCompiler::ConvertibleLoadLabel propertyStorageLoad = m_jit.convertibleLoadPtr(JITCompiler::Address(basePayloadGPR, JSObject::butterflyOffset()), scratchGPR);
JITCompiler::DataLabel32 tagStoreWithPatch = m_jit.store32WithAddressOffsetPatch(valueTagGPR, JITCompiler::Address(scratchGPR, OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)));
JITCompiler::DataLabel32 payloadStoreWithPatch = m_jit.store32WithAddressOffsetPatch(valuePayloadGPR, JITCompiler::Address(scratchGPR, OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)));
@@ -2554,7 +2554,7 @@ void SpeculativeJIT::compile(Node& node)
jsValueResult(resultTag.gpr(), resultPayload.gpr(), m_compileIndex);
break;
}
- case Array::JSArray: {
+ case IN_BOUNDS_ARRAY_STORAGE_MODES: {
SpeculateStrictInt32Operand property(this, node.child2());
StorageOperand storage(this, node.child3());
GPRReg propertyReg = property.gpr();
@@ -2563,14 +2563,7 @@ void SpeculativeJIT::compile(Node& node)
if (!m_compileOkay)
return;
- // Check that base is an array, and that property is contained within m_vector (< m_vectorLength).
- // If we have predicted the base to be type array, we can skip the check.
- {
- SpeculateCellOperand base(this, node.child1());
- GPRReg baseReg = base.gpr();
- // We've already speculated that it's some kind of array, at this point.
- speculationCheck(OutOfBounds, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(baseReg, JSArray::vectorLengthOffset())));
- }
+ speculationCheck(OutOfBounds, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(storageReg, ArrayStorage::vectorLengthOffset())));
GPRTemporary resultTag(this);
GPRTemporary resultPayload(this);
@@ -2582,12 +2575,13 @@ void SpeculativeJIT::compile(Node& node)
jsValueResult(resultTag.gpr(), resultPayload.gpr(), m_compileIndex);
break;
}
- case Array::JSArrayOutOfBounds: {
+ case OUT_OF_BOUNDS_ARRAY_STORAGE_MODES: {
SpeculateCellOperand base(this, node.child1());
SpeculateStrictInt32Operand property(this, node.child2());
StorageOperand storage(this, node.child3());
GPRReg propertyReg = property.gpr();
GPRReg storageReg = storage.gpr();
+ GPRReg baseReg = base.gpr();
if (!m_compileOkay)
return;
@@ -2597,13 +2591,9 @@ void SpeculativeJIT::compile(Node& node)
GPRReg resultTagReg = resultTag.gpr();
GPRReg resultPayloadReg = resultPayload.gpr();
- // Check that base is an array, and that property is contained within m_vector (< m_vectorLength).
- // If we have predicted the base to be type array, we can skip the check.
- GPRReg baseReg = base.gpr();
- // We've already speculated that it's some kind of array, at this point.
JITCompiler::Jump outOfBounds = m_jit.branch32(
MacroAssembler::AboveOrEqual, propertyReg,
- MacroAssembler::Address(baseReg, JSArray::vectorLengthOffset()));
+ MacroAssembler::Address(storageReg, ArrayStorage::vectorLengthOffset()));
m_jit.load32(MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), resultTagReg);
JITCompiler::Jump hole = m_jit.branch32(
@@ -2712,8 +2702,7 @@ void SpeculativeJIT::compile(Node& node)
GPRReg propertyReg = property.gpr();
switch (arrayMode) {
- case Array::JSArray:
- case Array::JSArrayOutOfBounds: {
+ case ALL_ARRAY_STORAGE_MODES: {
JSValueOperand value(this, child3);
GPRReg valueTagReg = value.tagGPR();
@@ -2741,8 +2730,8 @@ void SpeculativeJIT::compile(Node& node)
break;
}
- MacroAssembler::Jump beyondArrayBounds = m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(baseReg, JSArray::vectorLengthOffset()));
- if (arrayMode == Array::JSArray)
+ MacroAssembler::Jump beyondArrayBounds = m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(storageReg, ArrayStorage::vectorLengthOffset()));
+ if (isInBoundsAccess(node.arrayMode()))
speculationCheck(OutOfBounds, JSValueRegs(), NoNode, beyondArrayBounds);
base.use();
@@ -2755,9 +2744,9 @@ void SpeculativeJIT::compile(Node& node)
m_jit.add32(TrustedImm32(1), MacroAssembler::Address(storageReg, OBJECT_OFFSETOF(ArrayStorage, m_numValuesInVector)));
// If we're writing to a hole we might be growing the array;
- MacroAssembler::Jump lengthDoesNotNeedUpdate = m_jit.branch32(MacroAssembler::Below, propertyReg, MacroAssembler::Address(storageReg, OBJECT_OFFSETOF(ArrayStorage, m_length)));
+ MacroAssembler::Jump lengthDoesNotNeedUpdate = m_jit.branch32(MacroAssembler::Below, propertyReg, MacroAssembler::Address(storageReg, ArrayStorage::lengthOffset()));
m_jit.add32(TrustedImm32(1), propertyReg);
- m_jit.store32(propertyReg, MacroAssembler::Address(storageReg, OBJECT_OFFSETOF(ArrayStorage, m_length)));
+ m_jit.store32(propertyReg, MacroAssembler::Address(storageReg, ArrayStorage::lengthOffset()));
m_jit.sub32(TrustedImm32(1), propertyReg);
lengthDoesNotNeedUpdate.link(&m_jit);
@@ -2767,7 +2756,7 @@ void SpeculativeJIT::compile(Node& node)
m_jit.store32(valueTagReg, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)));
m_jit.store32(valuePayloadReg, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)));
- if (arrayMode == Array::JSArrayOutOfBounds) {
+ if (!isInBoundsAccess(node.arrayMode())) {
addSlowPathGenerator(
slowPathCall(
beyondArrayBounds, this,
@@ -2897,18 +2886,18 @@ void SpeculativeJIT::compile(Node& node)
StorageOperand storage(this, node.child3());
GPRReg storageGPR = storage.gpr();
- m_jit.load32(MacroAssembler::Address(storageGPR, OBJECT_OFFSETOF(ArrayStorage, m_length)), storageLengthGPR);
+ m_jit.load32(MacroAssembler::Address(storageGPR, ArrayStorage::lengthOffset()), storageLengthGPR);
// Refuse to handle bizarre lengths.
speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::Above, storageLengthGPR, TrustedImm32(0x7ffffffe)));
- MacroAssembler::Jump slowPath = m_jit.branch32(MacroAssembler::AboveOrEqual, storageLengthGPR, MacroAssembler::Address(baseGPR, JSArray::vectorLengthOffset()));
+ MacroAssembler::Jump slowPath = m_jit.branch32(MacroAssembler::AboveOrEqual, storageLengthGPR, MacroAssembler::Address(storageGPR, ArrayStorage::vectorLengthOffset()));
m_jit.store32(valueTagGPR, MacroAssembler::BaseIndex(storageGPR, storageLengthGPR, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)));
m_jit.store32(valuePayloadGPR, MacroAssembler::BaseIndex(storageGPR, storageLengthGPR, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)));
m_jit.add32(TrustedImm32(1), storageLengthGPR);
- m_jit.store32(storageLengthGPR, MacroAssembler::Address(storageGPR, OBJECT_OFFSETOF(ArrayStorage, m_length)));
+ m_jit.store32(storageLengthGPR, MacroAssembler::Address(storageGPR, ArrayStorage::lengthOffset()));
m_jit.add32(TrustedImm32(1), MacroAssembler::Address(storageGPR, OBJECT_OFFSETOF(ArrayStorage, m_numValuesInVector)));
m_jit.move(TrustedImm32(JSValue::Int32Tag), storageGPR);
@@ -2933,19 +2922,19 @@ void SpeculativeJIT::compile(Node& node)
GPRReg storageGPR = storage.gpr();
GPRReg storageLengthGPR = storageLength.gpr();
- m_jit.load32(MacroAssembler::Address(storageGPR, OBJECT_OFFSETOF(ArrayStorage, m_length)), storageLengthGPR);
+ m_jit.load32(MacroAssembler::Address(storageGPR, ArrayStorage::lengthOffset()), storageLengthGPR);
JITCompiler::JumpList setUndefinedCases;
setUndefinedCases.append(m_jit.branchTest32(MacroAssembler::Zero, storageLengthGPR));
m_jit.sub32(TrustedImm32(1), storageLengthGPR);
- MacroAssembler::Jump slowCase = m_jit.branch32(MacroAssembler::AboveOrEqual, storageLengthGPR, MacroAssembler::Address(baseGPR, JSArray::vectorLengthOffset()));
+ MacroAssembler::Jump slowCase = m_jit.branch32(MacroAssembler::AboveOrEqual, storageLengthGPR, MacroAssembler::Address(storageGPR, ArrayStorage::vectorLengthOffset()));
m_jit.load32(MacroAssembler::BaseIndex(storageGPR, storageLengthGPR, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), valueTagGPR);
m_jit.load32(MacroAssembler::BaseIndex(storageGPR, storageLengthGPR, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), valuePayloadGPR);
- m_jit.store32(storageLengthGPR, MacroAssembler::Address(storageGPR, OBJECT_OFFSETOF(ArrayStorage, m_length)));
+ m_jit.store32(storageLengthGPR, MacroAssembler::Address(storageGPR, ArrayStorage::lengthOffset()));
setUndefinedCases.append(m_jit.branch32(MacroAssembler::Equal, TrustedImm32(JSValue::EmptyValueTag), valueTagGPR));
@@ -3589,14 +3578,14 @@ void SpeculativeJIT::compile(Node& node)
compileReallocatePropertyStorage(node);
break;
- case GetPropertyStorage: {
+ case GetButterfly: {
SpeculateCellOperand base(this, node.child1());
GPRTemporary result(this, base);
GPRReg baseGPR = base.gpr();
GPRReg resultGPR = result.gpr();
- m_jit.loadPtr(JITCompiler::Address(baseGPR, JSObject::offsetOfOutOfLineStorage()), resultGPR);
+ m_jit.loadPtr(JITCompiler::Address(baseGPR, JSObject::butterflyOffset()), resultGPR);
storageResult(resultGPR, m_compileIndex);
break;
@@ -3956,7 +3945,7 @@ void SpeculativeJIT::compile(Node& node)
JITCompiler::Jump structuresNotMatch = m_jit.branchPtr(JITCompiler::NotEqual, resultPayloadGPR, JITCompiler::Address(globalObjectGPR, JSCell::structureOffset()));
// Fast case
- m_jit.loadPtr(JITCompiler::Address(globalObjectGPR, JSObject::offsetOfOutOfLineStorage()), resultPayloadGPR);
+ m_jit.loadPtr(JITCompiler::Address(globalObjectGPR, JSObject::butterflyOffset()), resultPayloadGPR);
m_jit.load32(JITCompiler::Address(resolveInfoGPR, OBJECT_OFFSETOF(GlobalResolveInfo, offset)), resolveInfoGPR);
#if DFG_ENABLE(JIT_ASSERT)
JITCompiler::Jump isOutOfLine = m_jit.branch32(JITCompiler::GreaterThanOrEqual, resolveInfoGPR, TrustedImm32(inlineStorageCapacity));
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
index 0435df930..aa5fe6773 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
@@ -498,7 +498,7 @@ void SpeculativeJIT::cachedGetById(CodeOrigin codeOrigin, GPRReg baseGPR, GPRReg
JITCompiler::PatchableJump structureCheck = m_jit.patchableBranchPtrWithPatch(JITCompiler::NotEqual, JITCompiler::Address(baseGPR, JSCell::structureOffset()), structureToCompare, JITCompiler::TrustedImmPtr(reinterpret_cast<void*>(-1)));
JITCompiler::ConvertibleLoadLabel propertyStorageLoad =
- m_jit.convertibleLoadPtr(JITCompiler::Address(baseGPR, JSObject::offsetOfOutOfLineStorage()), resultGPR);
+ m_jit.convertibleLoadPtr(JITCompiler::Address(baseGPR, JSObject::butterflyOffset()), resultGPR);
JITCompiler::DataLabelCompact loadWithPatch = m_jit.loadPtrWithCompactAddressOffsetPatch(JITCompiler::Address(resultGPR, 0), resultGPR);
JITCompiler::Label doneLabel = m_jit.label();
@@ -534,7 +534,7 @@ void SpeculativeJIT::cachedPutById(CodeOrigin codeOrigin, GPRReg baseGPR, GPRReg
writeBarrier(baseGPR, valueGPR, valueUse, WriteBarrierForPropertyAccess, scratchGPR);
JITCompiler::ConvertibleLoadLabel propertyStorageLoad =
- m_jit.convertibleLoadPtr(JITCompiler::Address(baseGPR, JSObject::offsetOfOutOfLineStorage()), scratchGPR);
+ m_jit.convertibleLoadPtr(JITCompiler::Address(baseGPR, JSObject::butterflyOffset()), scratchGPR);
JITCompiler::DataLabel32 storeWithPatch = m_jit.storePtrWithAddressOffsetPatch(valueGPR, JITCompiler::Address(scratchGPR, 0));
JITCompiler::Label doneLabel = m_jit.label();
@@ -2584,8 +2584,26 @@ void SpeculativeJIT::compile(Node& node)
jsValueResult(result.gpr(), m_compileIndex);
break;
}
- case Array::JSArray:
- case Array::JSArrayOutOfBounds: {
+ case IN_BOUNDS_ARRAY_STORAGE_MODES: {
+ SpeculateStrictInt32Operand property(this, node.child2());
+ StorageOperand storage(this, node.child3());
+
+ GPRReg propertyReg = property.gpr();
+ GPRReg storageReg = storage.gpr();
+
+ if (!m_compileOkay)
+ return;
+
+ speculationCheck(OutOfBounds, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(storageReg, ArrayStorage::vectorLengthOffset())));
+
+ GPRTemporary result(this);
+ m_jit.loadPtr(MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), result.gpr());
+ speculationCheck(OutOfBounds, JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::Zero, result.gpr()));
+
+ jsValueResult(result.gpr(), m_compileIndex);
+ break;
+ }
+ case OUT_OF_BOUNDS_ARRAY_STORAGE_MODES: {
SpeculateCellOperand base(this, node.child1());
SpeculateStrictInt32Operand property(this, node.child2());
StorageOperand storage(this, node.child3());
@@ -2597,27 +2615,19 @@ void SpeculativeJIT::compile(Node& node)
if (!m_compileOkay)
return;
- // We will have already speculated that the base is some kind of array,
- // at this point.
-
- MacroAssembler::Jump outOfBounds = m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(baseReg, JSArray::vectorLengthOffset()));
- if (node.arrayMode() == Array::JSArray)
- speculationCheck(OutOfBounds, JSValueRegs(), NoNode, outOfBounds);
+ MacroAssembler::Jump outOfBounds = m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(storageReg, ArrayStorage::vectorLengthOffset()));
GPRTemporary result(this);
m_jit.loadPtr(MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), result.gpr());
MacroAssembler::Jump hole = m_jit.branchTestPtr(MacroAssembler::Zero, result.gpr());
- if (node.arrayMode() == Array::JSArray)
- speculationCheck(OutOfBounds, JSValueRegs(), NoNode, hole);
- else {
- MacroAssembler::JumpList slowCases;
- slowCases.append(outOfBounds);
- slowCases.append(hole);
- addSlowPathGenerator(
- slowPathCall(
- slowCases, this, operationGetByValArrayInt,
- result.gpr(), baseReg, propertyReg));
- }
+
+ MacroAssembler::JumpList slowCases;
+ slowCases.append(outOfBounds);
+ slowCases.append(hole);
+ addSlowPathGenerator(
+ slowPathCall(
+ slowCases, this, operationGetByValArrayInt,
+ result.gpr(), baseReg, propertyReg));
jsValueResult(result.gpr(), m_compileIndex);
break;
@@ -2703,6 +2713,9 @@ void SpeculativeJIT::compile(Node& node)
if (alreadyHandled)
break;
+ // FIXME: the base may not be necessary for some array access modes. But we have to
+ // keep it alive to this point, so it's likely to be in a register anyway. Likely
+ // no harm in locking it here.
SpeculateCellOperand base(this, child1);
SpeculateStrictInt32Operand property(this, child2);
@@ -2710,11 +2723,9 @@ void SpeculativeJIT::compile(Node& node)
GPRReg propertyReg = property.gpr();
switch (arrayMode) {
- case Array::JSArray:
- case Array::JSArrayOutOfBounds: {
+ case ALL_ARRAY_STORAGE_MODES: {
JSValueOperand value(this, child3);
- // Map base, property & value into registers, allocate a scratch register.
GPRReg valueReg = value.gpr();
if (!m_compileOkay)
@@ -2738,8 +2749,8 @@ void SpeculativeJIT::compile(Node& node)
break;
}
- MacroAssembler::Jump beyondArrayBounds = m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(baseReg, JSArray::vectorLengthOffset()));
- if (arrayMode == Array::JSArray)
+ MacroAssembler::Jump beyondArrayBounds = m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(storageReg, ArrayStorage::vectorLengthOffset()));
+ if (isInBoundsAccess(arrayMode))
speculationCheck(OutOfBounds, JSValueRegs(), NoNode, beyondArrayBounds);
base.use();
@@ -2752,9 +2763,9 @@ void SpeculativeJIT::compile(Node& node)
m_jit.add32(TrustedImm32(1), MacroAssembler::Address(storageReg, OBJECT_OFFSETOF(ArrayStorage, m_numValuesInVector)));
// If we're writing to a hole we might be growing the array;
- MacroAssembler::Jump lengthDoesNotNeedUpdate = m_jit.branch32(MacroAssembler::Below, propertyReg, MacroAssembler::Address(storageReg, OBJECT_OFFSETOF(ArrayStorage, m_length)));
+ MacroAssembler::Jump lengthDoesNotNeedUpdate = m_jit.branch32(MacroAssembler::Below, propertyReg, MacroAssembler::Address(storageReg, ArrayStorage::lengthOffset()));
m_jit.add32(TrustedImm32(1), propertyReg);
- m_jit.store32(propertyReg, MacroAssembler::Address(storageReg, OBJECT_OFFSETOF(ArrayStorage, m_length)));
+ m_jit.store32(propertyReg, MacroAssembler::Address(storageReg, ArrayStorage::lengthOffset()));
m_jit.sub32(TrustedImm32(1), propertyReg);
lengthDoesNotNeedUpdate.link(&m_jit);
@@ -2763,7 +2774,7 @@ void SpeculativeJIT::compile(Node& node)
// Store the value to the array.
m_jit.storePtr(valueReg, MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
- if (arrayMode == Array::JSArrayOutOfBounds) {
+ if (!isInBoundsAccess(arrayMode)) {
addSlowPathGenerator(
slowPathCall(
beyondArrayBounds, this,
@@ -2932,17 +2943,17 @@ void SpeculativeJIT::compile(Node& node)
StorageOperand storage(this, node.child3());
GPRReg storageGPR = storage.gpr();
- m_jit.load32(MacroAssembler::Address(storageGPR, OBJECT_OFFSETOF(ArrayStorage, m_length)), storageLengthGPR);
+ m_jit.load32(MacroAssembler::Address(storageGPR, ArrayStorage::lengthOffset()), storageLengthGPR);
// Refuse to handle bizarre lengths.
speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::Above, storageLengthGPR, TrustedImm32(0x7ffffffe)));
- MacroAssembler::Jump slowPath = m_jit.branch32(MacroAssembler::AboveOrEqual, storageLengthGPR, MacroAssembler::Address(baseGPR, JSArray::vectorLengthOffset()));
+ MacroAssembler::Jump slowPath = m_jit.branch32(MacroAssembler::AboveOrEqual, storageLengthGPR, MacroAssembler::Address(storageGPR, ArrayStorage::vectorLengthOffset()));
m_jit.storePtr(valueGPR, MacroAssembler::BaseIndex(storageGPR, storageLengthGPR, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
m_jit.add32(TrustedImm32(1), storageLengthGPR);
- m_jit.store32(storageLengthGPR, MacroAssembler::Address(storageGPR, OBJECT_OFFSETOF(ArrayStorage, m_length)));
+ m_jit.store32(storageLengthGPR, MacroAssembler::Address(storageGPR, ArrayStorage::lengthOffset()));
m_jit.add32(TrustedImm32(1), MacroAssembler::Address(storageGPR, OBJECT_OFFSETOF(ArrayStorage, m_numValuesInVector)));
m_jit.orPtr(GPRInfo::tagTypeNumberRegister, storageLengthGPR);
@@ -2968,18 +2979,18 @@ void SpeculativeJIT::compile(Node& node)
GPRReg valueGPR = value.gpr();
GPRReg storageLengthGPR = storageLength.gpr();
- m_jit.load32(MacroAssembler::Address(storageGPR, OBJECT_OFFSETOF(ArrayStorage, m_length)), storageLengthGPR);
+ m_jit.load32(MacroAssembler::Address(storageGPR, ArrayStorage::lengthOffset()), storageLengthGPR);
JITCompiler::JumpList setUndefinedCases;
setUndefinedCases.append(m_jit.branchTest32(MacroAssembler::Zero, storageLengthGPR));
m_jit.sub32(TrustedImm32(1), storageLengthGPR);
- MacroAssembler::Jump slowCase = m_jit.branch32(MacroAssembler::AboveOrEqual, storageLengthGPR, MacroAssembler::Address(baseGPR, JSArray::vectorLengthOffset()));
+ MacroAssembler::Jump slowCase = m_jit.branch32(MacroAssembler::AboveOrEqual, storageLengthGPR, MacroAssembler::Address(storageGPR, ArrayStorage::vectorLengthOffset()));
m_jit.loadPtr(MacroAssembler::BaseIndex(storageGPR, storageLengthGPR, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), valueGPR);
- m_jit.store32(storageLengthGPR, MacroAssembler::Address(storageGPR, OBJECT_OFFSETOF(ArrayStorage, m_length)));
+ m_jit.store32(storageLengthGPR, MacroAssembler::Address(storageGPR, ArrayStorage::lengthOffset()));
setUndefinedCases.append(m_jit.branchTestPtr(MacroAssembler::Zero, valueGPR));
@@ -3567,14 +3578,14 @@ void SpeculativeJIT::compile(Node& node)
compileReallocatePropertyStorage(node);
break;
- case GetPropertyStorage: {
+ case GetButterfly: {
SpeculateCellOperand base(this, node.child1());
GPRTemporary result(this, base);
GPRReg baseGPR = base.gpr();
GPRReg resultGPR = result.gpr();
- m_jit.loadPtr(JITCompiler::Address(baseGPR, JSObject::offsetOfOutOfLineStorage()), resultGPR);
+ m_jit.loadPtr(JITCompiler::Address(baseGPR, JSObject::butterflyOffset()), resultGPR);
storageResult(resultGPR, m_compileIndex);
break;
@@ -3917,7 +3928,7 @@ void SpeculativeJIT::compile(Node& node)
#endif
m_jit.neg32(resolveInfoGPR);
m_jit.signExtend32ToPtr(resolveInfoGPR, resolveInfoGPR);
- m_jit.loadPtr(JITCompiler::Address(globalObjectGPR, JSObject::offsetOfOutOfLineStorage()), resultGPR);
+ m_jit.loadPtr(JITCompiler::Address(globalObjectGPR, JSObject::butterflyOffset()), resultGPR);
m_jit.loadPtr(JITCompiler::BaseIndex(resultGPR, resolveInfoGPR, JITCompiler::ScalePtr, (inlineStorageCapacity - 2) * static_cast<ptrdiff_t>(sizeof(JSValue))), resultGPR);
addSlowPathGenerator(
diff --git a/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp b/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp
index dec2e49f7..f6fe127a3 100644
--- a/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp
@@ -94,7 +94,7 @@ public:
case StructureTransitionWatchpoint:
case AllocatePropertyStorage:
case ReallocatePropertyStorage:
- case GetPropertyStorage:
+ case GetButterfly:
case GetByVal:
case PutByVal:
case PutByValAlias:
diff --git a/Source/JavaScriptCore/heap/CopiedSpace.h b/Source/JavaScriptCore/heap/CopiedSpace.h
index ec394ca8f..e8a4f8724 100644
--- a/Source/JavaScriptCore/heap/CopiedSpace.h
+++ b/Source/JavaScriptCore/heap/CopiedSpace.h
@@ -81,7 +81,7 @@ private:
static bool isOversize(size_t);
static CopiedBlock* oversizeBlockFor(void* ptr);
- CheckedBoolean tryAllocateSlowCase(size_t, void**);
+ JS_EXPORT_PRIVATE CheckedBoolean tryAllocateSlowCase(size_t, void**);
CheckedBoolean tryAllocateOversize(size_t, void**);
CheckedBoolean tryReallocateOversize(void**, size_t, size_t);
diff --git a/Source/JavaScriptCore/heap/Heap.cpp b/Source/JavaScriptCore/heap/Heap.cpp
index 4ab8ccb31..c7fb8c015 100644
--- a/Source/JavaScriptCore/heap/Heap.cpp
+++ b/Source/JavaScriptCore/heap/Heap.cpp
@@ -618,7 +618,7 @@ size_t Heap::protectedGlobalObjectCount()
size_t Heap::globalObjectCount()
{
- return m_objectSpace.forEachCell<CountIfGlobalObject>();
+ return m_objectSpace.forEachLiveCell<CountIfGlobalObject>();
}
size_t Heap::protectedObjectCount()
@@ -633,7 +633,7 @@ PassOwnPtr<TypeCountSet> Heap::protectedObjectTypeCounts()
PassOwnPtr<TypeCountSet> Heap::objectTypeCounts()
{
- return m_objectSpace.forEachCell<RecordType>();
+ return m_objectSpace.forEachLiveCell<RecordType>();
}
void Heap::deleteAllCompiledCode()
@@ -801,14 +801,11 @@ void Heap::didAllocate(size_t bytes)
m_bytesAllocated += bytes;
}
-bool Heap::isValidAllocation(size_t bytes)
+bool Heap::isValidAllocation(size_t)
{
if (!isValidThreadState(m_globalData))
return false;
- if (bytes > MarkedSpace::maxCellSize)
- return false;
-
if (m_operationInProgress != NoOperation)
return false;
diff --git a/Source/JavaScriptCore/heap/Heap.h b/Source/JavaScriptCore/heap/Heap.h
index e48386791..c9bbec1f6 100644
--- a/Source/JavaScriptCore/heap/Heap.h
+++ b/Source/JavaScriptCore/heap/Heap.h
@@ -182,6 +182,7 @@ namespace JSC {
friend class CopiedSpace;
friend class SlotVisitor;
template<typename T> friend void* allocateCell(Heap&);
+ template<typename T> friend void* allocateCell(Heap&, size_t);
void* allocateWithDestructor(size_t);
void* allocateWithoutDestructor(size_t);
diff --git a/Source/JavaScriptCore/heap/MarkedAllocator.cpp b/Source/JavaScriptCore/heap/MarkedAllocator.cpp
index ab37ead4c..8a7d02e21 100644
--- a/Source/JavaScriptCore/heap/MarkedAllocator.cpp
+++ b/Source/JavaScriptCore/heap/MarkedAllocator.cpp
@@ -49,7 +49,7 @@ inline void* MarkedAllocator::tryAllocateHelper(size_t bytes)
}
if (bytes > block->cellSize()) {
- block->zapFreeList(freeList);
+ block->canonicalizeCellLivenessData(freeList);
continue;
}
diff --git a/Source/JavaScriptCore/heap/MarkedAllocator.h b/Source/JavaScriptCore/heap/MarkedAllocator.h
index 7273c13e4..f9cb6ae52 100644
--- a/Source/JavaScriptCore/heap/MarkedAllocator.h
+++ b/Source/JavaScriptCore/heap/MarkedAllocator.h
@@ -21,7 +21,7 @@ class MarkedAllocator {
public:
MarkedAllocator();
void reset();
- void zapFreeList();
+ void canonicalizeCellLivenessData();
size_t cellSize() { return m_cellSize; }
bool cellsNeedDestruction() { return m_cellsNeedDestruction; }
bool onlyContainsStructures() { return m_onlyContainsStructures; }
@@ -92,14 +92,14 @@ inline void MarkedAllocator::reset()
m_blocksToSweep = m_blockList.head();
}
-inline void MarkedAllocator::zapFreeList()
+inline void MarkedAllocator::canonicalizeCellLivenessData()
{
if (!m_currentBlock) {
ASSERT(!m_freeList.head);
return;
}
- m_currentBlock->zapFreeList(m_freeList);
+ m_currentBlock->canonicalizeCellLivenessData(m_freeList);
m_currentBlock = 0;
m_freeList = MarkedBlock::FreeList();
}
diff --git a/Source/JavaScriptCore/heap/MarkedBlock.cpp b/Source/JavaScriptCore/heap/MarkedBlock.cpp
index b0f3b88d5..c345080fe 100644
--- a/Source/JavaScriptCore/heap/MarkedBlock.cpp
+++ b/Source/JavaScriptCore/heap/MarkedBlock.cpp
@@ -81,8 +81,6 @@ MarkedBlock::FreeList MarkedBlock::specializedSweep()
continue;
JSCell* cell = reinterpret_cast_ptr<JSCell*>(&atoms()[i]);
- if (blockState == Zapped && !cell->isZapped())
- continue;
if (destructorCallNeeded && blockState != New)
callDestructor(cell);
@@ -95,7 +93,7 @@ MarkedBlock::FreeList MarkedBlock::specializedSweep()
}
}
- m_state = ((sweepMode == SweepToFreeList) ? FreeListed : Zapped);
+ m_state = ((sweepMode == SweepToFreeList) ? FreeListed : Marked);
return FreeList(head, count * cellSize());
}
@@ -132,18 +130,21 @@ MarkedBlock::FreeList MarkedBlock::sweepHelper(SweepMode sweepMode)
return sweepMode == SweepToFreeList
? specializedSweep<Marked, SweepToFreeList, destructorCallNeeded>()
: specializedSweep<Marked, SweepOnly, destructorCallNeeded>();
- case Zapped:
- ASSERT(!m_onlyContainsStructures || heap()->isSafeToSweepStructures());
- return sweepMode == SweepToFreeList
- ? specializedSweep<Zapped, SweepToFreeList, destructorCallNeeded>()
- : specializedSweep<Zapped, SweepOnly, destructorCallNeeded>();
}
ASSERT_NOT_REACHED();
return FreeList();
}
-void MarkedBlock::zapFreeList(const FreeList& freeList)
+class SetAllMarksFunctor : public MarkedBlock::VoidFunctor {
+public:
+ void operator()(JSCell* cell)
+ {
+ MarkedBlock::blockFor(cell)->setMarked(cell);
+ }
+};
+
+void MarkedBlock::canonicalizeCellLivenessData(const FreeList& freeList)
{
HEAP_LOG_BLOCK_STATE_TRANSITION(this);
FreeCell* head = freeList.head;
@@ -156,40 +157,26 @@ void MarkedBlock::zapFreeList(const FreeList& freeList)
// Hence if the block is Marked we need to leave it Marked.
ASSERT(!head);
-
- return;
- }
-
- if (m_state == Zapped) {
- // If the block is in the Zapped state then we know that someone already
- // zapped it for us. This could not have happened during a GC, but might
- // be the result of someone having done a GC scan to perform some operation
- // over all live objects (or all live blocks). It also means that somebody
- // had allocated in this block since the last GC, swept all dead objects
- // onto the free list, left the block in the FreeListed state, then the heap
- // scan happened, and canonicalized the block, leading to all dead objects
- // being zapped. Therefore, it is safe for us to simply do nothing, since
- // dead objects will have 0 in their vtables and live objects will have
- // non-zero vtables, which is consistent with the block being zapped.
-
- ASSERT(!head);
-
return;
}
-
+
ASSERT(m_state == FreeListed);
// Roll back to a coherent state for Heap introspection. Cells newly
// allocated from our free list are not currently marked, so we need another
- // way to tell what's live vs dead. We use zapping for that.
+ // way to tell what's live vs dead.
+ SetAllMarksFunctor functor;
+ forEachCell(functor);
+
FreeCell* next;
for (FreeCell* current = head; current; current = next) {
next = current->next;
reinterpret_cast<JSCell*>(current)->zap();
+ clearMarked(current);
}
- m_state = Zapped;
+ m_state = Marked;
}
} // namespace JSC
diff --git a/Source/JavaScriptCore/heap/MarkedBlock.h b/Source/JavaScriptCore/heap/MarkedBlock.h
index 8c03d5b4f..4b2a5fd53 100644
--- a/Source/JavaScriptCore/heap/MarkedBlock.h
+++ b/Source/JavaScriptCore/heap/MarkedBlock.h
@@ -136,7 +136,7 @@ namespace JSC {
// cell liveness data. To restore accurate cell liveness data, call one
// of these functions:
void didConsumeFreeList(); // Call this once you've allocated all the items in the free list.
- void zapFreeList(const FreeList&); // Call this to undo the free list.
+ void canonicalizeCellLivenessData(const FreeList&);
void clearMarks();
size_t markCount();
@@ -154,7 +154,8 @@ namespace JSC {
bool isLive(const JSCell*);
bool isLiveCell(const void*);
void setMarked(const void*);
-
+ void clearMarked(const void*);
+
bool needsSweeping();
#if ENABLE(GGC)
@@ -186,12 +187,13 @@ namespace JSC {
#endif
template <typename Functor> void forEachCell(Functor&);
+ template <typename Functor> void forEachLiveCell(Functor&);
template <typename Functor> void forEachDeadCell(Functor&);
private:
static const size_t atomAlignmentMask = atomSize - 1; // atomSize must be a power of two.
- enum BlockState { New, FreeListed, Allocated, Marked, Zapped };
+ enum BlockState { New, FreeListed, Allocated, Marked };
template<bool destructorCallNeeded> FreeList sweepHelper(SweepMode = SweepOnly);
typedef char Atom[atomSize];
@@ -364,21 +366,18 @@ namespace JSC {
m_marks.set(atomNumber(p));
}
+ inline void MarkedBlock::clearMarked(const void* p)
+ {
+ ASSERT(m_marks.get(atomNumber(p)));
+ m_marks.clear(atomNumber(p));
+ }
+
inline bool MarkedBlock::isLive(const JSCell* cell)
{
switch (m_state) {
case Allocated:
return true;
- case Zapped:
- if (isZapped(cell)) {
- // Object dead in previous collection, not allocated since previous collection: mark bit should not be set.
- ASSERT(!m_marks.get(atomNumber(cell)));
- return false;
- }
-
- // Newly allocated objects: mark bit not set.
- // Objects that survived prior collection: mark bit set.
- return true;
+
case Marked:
return m_marks.get(atomNumber(cell));
@@ -411,6 +410,14 @@ namespace JSC {
{
for (size_t i = firstAtom(); i < m_endAtom; i += m_atomsPerCell) {
JSCell* cell = reinterpret_cast_ptr<JSCell*>(&atoms()[i]);
+ functor(cell);
+ }
+ }
+
+ template <typename Functor> inline void MarkedBlock::forEachLiveCell(Functor& functor)
+ {
+ for (size_t i = firstAtom(); i < m_endAtom; i += m_atomsPerCell) {
+ JSCell* cell = reinterpret_cast_ptr<JSCell*>(&atoms()[i]);
if (!isLive(cell))
continue;
@@ -431,7 +438,7 @@ namespace JSC {
inline bool MarkedBlock::needsSweeping()
{
- return m_state == Marked || m_state == Zapped;
+ return m_state == Marked;
}
#if ENABLE(GGC)
diff --git a/Source/JavaScriptCore/heap/MarkedSpace.cpp b/Source/JavaScriptCore/heap/MarkedSpace.cpp
index 689e5f9ab..9a823c50b 100644
--- a/Source/JavaScriptCore/heap/MarkedSpace.cpp
+++ b/Source/JavaScriptCore/heap/MarkedSpace.cpp
@@ -146,17 +146,17 @@ void MarkedSpace::reapWeakSets()
void MarkedSpace::canonicalizeCellLivenessData()
{
for (size_t cellSize = preciseStep; cellSize <= preciseCutoff; cellSize += preciseStep) {
- allocatorFor(cellSize).zapFreeList();
- destructorAllocatorFor(cellSize).zapFreeList();
+ allocatorFor(cellSize).canonicalizeCellLivenessData();
+ destructorAllocatorFor(cellSize).canonicalizeCellLivenessData();
}
for (size_t cellSize = impreciseStep; cellSize <= impreciseCutoff; cellSize += impreciseStep) {
- allocatorFor(cellSize).zapFreeList();
- destructorAllocatorFor(cellSize).zapFreeList();
+ allocatorFor(cellSize).canonicalizeCellLivenessData();
+ destructorAllocatorFor(cellSize).canonicalizeCellLivenessData();
}
- m_largeAllocator.zapFreeList();
- m_structureAllocator.zapFreeList();
+ m_largeAllocator.canonicalizeCellLivenessData();
+ m_structureAllocator.canonicalizeCellLivenessData();
}
bool MarkedSpace::isPagedOut(double deadline)
diff --git a/Source/JavaScriptCore/heap/MarkedSpace.h b/Source/JavaScriptCore/heap/MarkedSpace.h
index 03679d9d3..e68ba9172 100644
--- a/Source/JavaScriptCore/heap/MarkedSpace.h
+++ b/Source/JavaScriptCore/heap/MarkedSpace.h
@@ -93,8 +93,8 @@ public:
typedef HashSet<MarkedBlock*>::iterator BlockIterator;
- template<typename Functor> typename Functor::ReturnType forEachCell(Functor&);
- template<typename Functor> typename Functor::ReturnType forEachCell();
+ template<typename Functor> typename Functor::ReturnType forEachLiveCell(Functor&);
+ template<typename Functor> typename Functor::ReturnType forEachLiveCell();
template<typename Functor> typename Functor::ReturnType forEachBlock(Functor&);
template<typename Functor> typename Functor::ReturnType forEachBlock();
@@ -140,20 +140,20 @@ private:
MarkedBlockSet m_blocks;
};
-template<typename Functor> inline typename Functor::ReturnType MarkedSpace::forEachCell(Functor& functor)
+template<typename Functor> inline typename Functor::ReturnType MarkedSpace::forEachLiveCell(Functor& functor)
{
canonicalizeCellLivenessData();
BlockIterator end = m_blocks.set().end();
for (BlockIterator it = m_blocks.set().begin(); it != end; ++it)
- (*it)->forEachCell(functor);
+ (*it)->forEachLiveCell(functor);
return functor.returnValue();
}
-template<typename Functor> inline typename Functor::ReturnType MarkedSpace::forEachCell()
+template<typename Functor> inline typename Functor::ReturnType MarkedSpace::forEachLiveCell()
{
Functor functor;
- return forEachCell(functor);
+ return forEachLiveCell(functor);
}
inline MarkedAllocator& MarkedSpace::firstAllocator()
diff --git a/Source/JavaScriptCore/icu/unicode/localpointer.h b/Source/JavaScriptCore/icu/unicode/localpointer.h
new file mode 100644
index 000000000..b76a1f856
--- /dev/null
+++ b/Source/JavaScriptCore/icu/unicode/localpointer.h
@@ -0,0 +1,300 @@
+/*
+*******************************************************************************
+*
+* Copyright (C) 2009-2010, International Business Machines
+* Corporation and others. All Rights Reserved.
+*
+*******************************************************************************
+* file name: localpointer.h
+* encoding: US-ASCII
+* tab size: 8 (not used)
+* indentation:4
+*
+* created on: 2009nov13
+* created by: Markus W. Scherer
+*/
+
+#ifndef __LOCALPOINTER_H__
+#define __LOCALPOINTER_H__
+
+/**
+ * \file
+ * \brief C++ API: "Smart pointers" for use with and in ICU4C C++ code.
+ *
+ * These classes are inspired by
+ * - std::auto_ptr
+ * - boost::scoped_ptr & boost::scoped_array
+ * - Taligent Safe Pointers (TOnlyPointerTo)
+ *
+ * but none of those provide for all of the goals for ICU smart pointers:
+ * - Smart pointer owns the object and releases it when it goes out of scope.
+ * - No transfer of ownership via copy/assignment to reduce misuse. Simpler & more robust.
+ * - ICU-compatible: No exceptions.
+ * - Need to be able to orphan/release the pointer and its ownership.
+ * - Need variants for normal C++ object pointers, C++ arrays, and ICU C service objects.
+ *
+ * For details see http://site.icu-project.org/design/cpp/scoped_ptr
+ */
+
+#include "unicode/utypes.h"
+
+#if U_SHOW_CPLUSPLUS_API
+
+U_NAMESPACE_BEGIN
+
+/**
+ * "Smart pointer" base class; do not use directly: use LocalPointer etc.
+ *
+ * Base class for smart pointer classes that do not throw exceptions.
+ *
+ * Do not use this base class directly, since it does not delete its pointer.
+ * A subclass must implement methods that delete the pointer:
+ * Destructor and adoptInstead().
+ *
+ * There is no operator T *() provided because the programmer must decide
+ * whether to use getAlias() (without transfer of ownership) or orpan()
+ * (with transfer of ownership and NULLing of the pointer).
+ *
+ * @see LocalPointer
+ * @see LocalArray
+ * @see U_DEFINE_LOCAL_OPEN_POINTER
+ * @stable ICU 4.4
+ */
+template<typename T>
+class LocalPointerBase {
+public:
+ /**
+ * Constructor takes ownership.
+ * @param p simple pointer to an object that is adopted
+ * @stable ICU 4.4
+ */
+ explicit LocalPointerBase(T *p=NULL) : ptr(p) {}
+ /**
+ * Destructor deletes the object it owns.
+ * Subclass must override: Base class does nothing.
+ * @stable ICU 4.4
+ */
+ ~LocalPointerBase() { /* delete ptr; */ }
+ /**
+ * NULL check.
+ * @return TRUE if ==NULL
+ * @stable ICU 4.4
+ */
+ UBool isNull() const { return ptr==NULL; }
+ /**
+ * NULL check.
+ * @return TRUE if !=NULL
+ * @stable ICU 4.4
+ */
+ UBool isValid() const { return ptr!=NULL; }
+ /**
+ * Comparison with a simple pointer, so that existing code
+ * with ==NULL need not be changed.
+ * @param other simple pointer for comparison
+ * @return true if this pointer value equals other
+ * @stable ICU 4.4
+ */
+ bool operator==(const T *other) const { return ptr==other; }
+ /**
+ * Comparison with a simple pointer, so that existing code
+ * with !=NULL need not be changed.
+ * @param other simple pointer for comparison
+ * @return true if this pointer value differs from other
+ * @stable ICU 4.4
+ */
+ bool operator!=(const T *other) const { return ptr!=other; }
+ /**
+ * Access without ownership change.
+ * @return the pointer value
+ * @stable ICU 4.4
+ */
+ T *getAlias() const { return ptr; }
+ /**
+ * Access without ownership change.
+ * @return the pointer value as a reference
+ * @stable ICU 4.4
+ */
+ T &operator*() const { return *ptr; }
+ /**
+ * Access without ownership change.
+ * @return the pointer value
+ * @stable ICU 4.4
+ */
+ T *operator->() const { return ptr; }
+ /**
+ * Gives up ownership; the internal pointer becomes NULL.
+ * @return the pointer value;
+ * caller becomes responsible for deleting the object
+ * @stable ICU 4.4
+ */
+ T *orphan() {
+ T *p=ptr;
+ ptr=NULL;
+ return p;
+ }
+ /**
+ * Deletes the object it owns,
+ * and adopts (takes ownership of) the one passed in.
+ * Subclass must override: Base class does not delete the object.
+ * @param p simple pointer to an object that is adopted
+ * @stable ICU 4.4
+ */
+ void adoptInstead(T *p) {
+ // delete ptr;
+ ptr=p;
+ }
+protected:
+ T *ptr;
+private:
+ // No comparison operators with other LocalPointerBases.
+ bool operator==(const LocalPointerBase &other);
+ bool operator!=(const LocalPointerBase &other);
+ // No ownership transfer: No copy constructor, no assignment operator.
+ LocalPointerBase(const LocalPointerBase &other);
+ void operator=(const LocalPointerBase &other);
+ // No heap allocation. Use only on the stack.
+ static void * U_EXPORT2 operator new(size_t size);
+ static void * U_EXPORT2 operator new[](size_t size);
+#if U_HAVE_PLACEMENT_NEW
+ static void * U_EXPORT2 operator new(size_t, void *ptr);
+#endif
+};
+
+/**
+ * "Smart pointer" class, deletes objects via the standard C++ delete operator.
+ * For most methods see the LocalPointerBase base class.
+ *
+ * Usage example:
+ * \code
+ * LocalPointer<UnicodeString> s(new UnicodeString((UChar32)0x50005));
+ * int32_t length=s->length(); // 2
+ * UChar lead=s->charAt(0); // 0xd900
+ * if(some condition) { return; } // no need to explicitly delete the pointer
+ * s.adoptInstead(new UnicodeString((UChar)0xfffc));
+ * length=s->length(); // 1
+ * // no need to explicitly delete the pointer
+ * \endcode
+ *
+ * @see LocalPointerBase
+ * @stable ICU 4.4
+ */
+template<typename T>
+class LocalPointer : public LocalPointerBase<T> {
+public:
+ /**
+ * Constructor takes ownership.
+ * @param p simple pointer to an object that is adopted
+ * @stable ICU 4.4
+ */
+ explicit LocalPointer(T *p=NULL) : LocalPointerBase<T>(p) {}
+ /**
+ * Destructor deletes the object it owns.
+ * @stable ICU 4.4
+ */
+ ~LocalPointer() {
+ delete LocalPointerBase<T>::ptr;
+ }
+ /**
+ * Deletes the object it owns,
+ * and adopts (takes ownership of) the one passed in.
+ * @param p simple pointer to an object that is adopted
+ * @stable ICU 4.4
+ */
+ void adoptInstead(T *p) {
+ delete LocalPointerBase<T>::ptr;
+ LocalPointerBase<T>::ptr=p;
+ }
+};
+
+/**
+ * "Smart pointer" class, deletes objects via the C++ array delete[] operator.
+ * For most methods see the LocalPointerBase base class.
+ * Adds operator[] for array item access.
+ *
+ * Usage example:
+ * \code
+ * LocalArray<UnicodeString> a(new UnicodeString[2]);
+ * a[0].append((UChar)0x61);
+ * if(some condition) { return; } // no need to explicitly delete the array
+ * a.adoptInstead(new UnicodeString[4]);
+ * a[3].append((UChar)0x62).append((UChar)0x63).reverse();
+ * // no need to explicitly delete the array
+ * \endcode
+ *
+ * @see LocalPointerBase
+ * @stable ICU 4.4
+ */
+template<typename T>
+class LocalArray : public LocalPointerBase<T> {
+public:
+ /**
+ * Constructor takes ownership.
+ * @param p simple pointer to an array of T objects that is adopted
+ * @stable ICU 4.4
+ */
+ explicit LocalArray(T *p=NULL) : LocalPointerBase<T>(p) {}
+ /**
+ * Destructor deletes the array it owns.
+ * @stable ICU 4.4
+ */
+ ~LocalArray() {
+ delete[] LocalPointerBase<T>::ptr;
+ }
+ /**
+ * Deletes the array it owns,
+ * and adopts (takes ownership of) the one passed in.
+ * @param p simple pointer to an array of T objects that is adopted
+ * @stable ICU 4.4
+ */
+ void adoptInstead(T *p) {
+ delete[] LocalPointerBase<T>::ptr;
+ LocalPointerBase<T>::ptr=p;
+ }
+ /**
+ * Array item access (writable).
+ * No index bounds check.
+ * @param i array index
+ * @return reference to the array item
+ * @stable ICU 4.4
+ */
+ T &operator[](ptrdiff_t i) const { return LocalPointerBase<T>::ptr[i]; }
+};
+
+/**
+ * \def U_DEFINE_LOCAL_OPEN_POINTER
+ * "Smart pointer" definition macro, deletes objects via the closeFunction.
+ * Defines a subclass of LocalPointerBase which works just
+ * like LocalPointer<Type> except that this subclass will use the closeFunction
+ * rather than the C++ delete operator.
+ *
+ * Requirement: The closeFunction must tolerate a NULL pointer.
+ * (We could add a NULL check here but it is normally redundant.)
+ *
+ * Usage example:
+ * \code
+ * LocalUCaseMapPointer csm(ucasemap_open(localeID, options, &errorCode));
+ * utf8OutLength=ucasemap_utf8ToLower(csm.getAlias(),
+ * utf8Out, (int32_t)sizeof(utf8Out),
+ * utf8In, utf8InLength, &errorCode);
+ * if(U_FAILURE(errorCode)) { return; } // no need to explicitly delete the UCaseMap
+ * \endcode
+ *
+ * @see LocalPointerBase
+ * @see LocalPointer
+ * @stable ICU 4.4
+ */
+#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction) \
+ class LocalPointerClassName : public LocalPointerBase<Type> { \
+ public: \
+ explicit LocalPointerClassName(Type *p=NULL) : LocalPointerBase<Type>(p) {} \
+ ~LocalPointerClassName() { closeFunction(ptr); } \
+ void adoptInstead(Type *p) { \
+ closeFunction(ptr); \
+ ptr=p; \
+ } \
+ }
+
+U_NAMESPACE_END
+
+#endif /* U_SHOW_CPLUSPLUS_API */
+#endif /* __LOCALPOINTER_H__ */
diff --git a/Source/JavaScriptCore/icu/unicode/parseerr.h b/Source/JavaScriptCore/icu/unicode/parseerr.h
index d1ba39486..44ff00811 100644
--- a/Source/JavaScriptCore/icu/unicode/parseerr.h
+++ b/Source/JavaScriptCore/icu/unicode/parseerr.h
@@ -1,6 +1,6 @@
/*
**********************************************************************
-* Copyright (C) 1999-2004, International Business Machines
+* Copyright (C) 1999-2005, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
@@ -15,6 +15,10 @@
/**
+ * \file
+ * \brief C API: Parse Error Information
+ */
+/**
* The capacity of the context strings in UParseError.
* @stable ICU 2.0
*/
diff --git a/Source/JavaScriptCore/icu/unicode/platform.h b/Source/JavaScriptCore/icu/unicode/platform.h
index 9595a268a..3de40d256 100644
--- a/Source/JavaScriptCore/icu/unicode/platform.h
+++ b/Source/JavaScriptCore/icu/unicode/platform.h
@@ -1,11 +1,15 @@
/*
******************************************************************************
*
-* Copyright (C) 1997-2004, International Business Machines
+* Copyright (C) 1997-2010, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
*
+* Note: autoconf creates platform.h from platform.h.in at configure time.
+*
+******************************************************************************
+*
* FILE NAME : platform.h
*
* Date Name Description
@@ -16,23 +20,56 @@
******************************************************************************
*/
-/* Define the platform we're on. */
+#ifndef _PLATFORM_H
+#define _PLATFORM_H
+
+/**
+ * \file
+ * \brief Basic types for the platform
+ */
+
+/* This file should be included before uvernum.h. */
+#if defined(UVERNUM_H)
+# error Do not include unicode/uvernum.h before #including unicode/platform.h. Instead of unicode/uvernum.h, #include unicode/uversion.h
+#endif
+
+/**
+ * Determine wheter to enable auto cleanup of libraries.
+ * @internal
+ */
+#ifndef UCLN_NO_AUTO_CLEANUP
+#define UCLN_NO_AUTO_CLEANUP 1
+#endif
+
+/* Need platform.h when using CYGWINMSVC to get definitions above. Ignore everything else. */
+#ifndef CYGWINMSVC
+
+/** Define the platform we're on. */
#ifndef U_DARWIN
#define U_DARWIN
#endif
-/* Define whether inttypes.h is available */
+/**
+ * \def U_HAVE_DIRENT_H
+ * Define whether dirent.h is available
+ * @internal
+ */
+#ifndef U_HAVE_DIRENT_H
+#define U_HAVE_DIRENT_H 1
+#endif
+
+/** Define whether inttypes.h is available */
#ifndef U_HAVE_INTTYPES_H
#define U_HAVE_INTTYPES_H 1
#endif
-/*
+/**
* Define what support for C++ streams is available.
- * If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available
+ * If U_IOSTREAM_SOURCE is set to 199711, then &lt;iostream&gt; is available
* (1997711 is the date the ISO/IEC C++ FDIS was published), and then
* one should qualify streams using the std namespace in ICU header
* files.
- * If U_IOSTREAM_SOURCE is set to 198506, then <iostream.h> is
+ * If U_IOSTREAM_SOURCE is set to 198506, then &lt;iostream.h&gt; is
* available instead (198506 is the date when Stroustrup published
* "An Extensible I/O Facility for C++" at the summer USENIX conference).
* If U_IOSTREAM_SOURCE is 0, then C++ streams are not available and
@@ -44,7 +81,19 @@
#define U_IOSTREAM_SOURCE 199711
#endif
-/* Determines whether specific types are available */
+/**
+ * \def U_HAVE_STD_STRING
+ * Define whether the standard C++ (STL) &lt;string&gt; header is available.
+ * For platforms that do not use platform.h and do not define this constant
+ * in their platform-specific headers, std_string.h defaults
+ * U_HAVE_STD_STRING to 1.
+ * @internal
+ */
+#ifndef U_HAVE_STD_STRING
+#define U_HAVE_STD_STRING 1
+#endif
+
+/** @{ Determines whether specific types are available */
#ifndef U_HAVE_INT8_T
#define U_HAVE_INT8_T 1
#endif
@@ -77,74 +126,10 @@
#define U_HAVE_UINT64_T 0
#endif
-/*===========================================================================*/
-/* Generic data types */
-/*===========================================================================*/
-
-#include <sys/types.h>
-
-/* If your platform does not have the <inttypes.h> header, you may
- need to edit the typedefs below. */
-#if U_HAVE_INTTYPES_H
-
-/* autoconf 2.13 sometimes can't properly find the data types in <inttypes.h> */
-/* os/390 needs <inttypes.h>, but it doesn't have int8_t, and it sometimes */
-/* doesn't have uint8_t depending on the OS version. */
-/* So we have this work around. */
-#ifdef OS390
-/* The features header is needed to get (u)int64_t sometimes. */
-#include <features.h>
-#if ! U_HAVE_INT8_T
-typedef signed char int8_t;
-#endif
-#if !defined(__uint8_t)
-#define __uint8_t 1
-typedef unsigned char uint8_t;
-#endif
-#endif /* OS390 */
-
-#include <inttypes.h>
-
-#else /* U_HAVE_INTTYPES_H */
-
-#if ! U_HAVE_INT8_T
-typedef signed char int8_t;
-#endif
-
-#if ! U_HAVE_UINT8_T
-typedef unsigned char uint8_t;
-#endif
-
-#if ! U_HAVE_INT16_T
-typedef signed short int16_t;
-#endif
-
-#if ! U_HAVE_UINT16_T
-typedef unsigned short uint16_t;
-#endif
-
-#if ! U_HAVE_INT32_T
-typedef signed int int32_t;
-#endif
-
-#if ! U_HAVE_UINT32_T
-typedef unsigned int uint32_t;
-#endif
-
-#if ! U_HAVE_INT64_T
- typedef signed long long int64_t;
-/* else we may not have a 64-bit type */
-#endif
-
-#if ! U_HAVE_UINT64_T
- typedef unsigned long long uint64_t;
-/* else we may not have a 64-bit type */
-#endif
-
-#endif
+/** @} */
/*===========================================================================*/
-/* Compiler and environment features */
+/** @{ Compiler and environment features */
/*===========================================================================*/
/* Define whether namespace is supported */
@@ -162,7 +147,14 @@ typedef unsigned int uint32_t;
#endif
/* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */
+#ifndef ICU_USE_THREADS
#define ICU_USE_THREADS 1
+#endif
+
+/* On strong memory model CPUs (e.g. x86 CPUs), we use a safe & quick double check lock. */
+#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
+#define UMTX_STRONG_MEMORY_MODEL 1
+#endif
#ifndef U_DEBUG
#define U_DEBUG 0
@@ -192,41 +184,106 @@ typedef unsigned int uint32_t;
#define U_ENABLE_TRACING 1
#endif
-/* Define the library suffix in a C syntax. */
-#define U_HAVE_LIB_SUFFIX 0
-#define U_LIB_SUFFIX_C_NAME
-#define U_LIB_SUFFIX_C_NAME_STRING ""
+/**
+ * Whether to enable Dynamic loading in ICU
+ * @internal
+ */
+#ifndef U_ENABLE_DYLOAD
+#define U_ENABLE_DYLOAD 1
+#endif
+
+/**
+ * Whether to test Dynamic loading as an OS capabilty
+ * @internal
+ */
+#ifndef U_CHECK_DYLOAD
+#define U_CHECK_DYLOAD 1
+#endif
+
+
+/** Do we allow ICU users to use the draft APIs by default? */
+#ifndef U_DEFAULT_SHOW_DRAFT
+#define U_DEFAULT_SHOW_DRAFT 1
+#endif
+
+/** @} */
/*===========================================================================*/
-/* Character data types */
+/** @{ Character data types */
/*===========================================================================*/
-#if defined(OS390) || defined(OS400)
+#if ((defined(OS390) && (!defined(__CHARSET_LIB) || !__CHARSET_LIB))) || defined(OS400)
# define U_CHARSET_FAMILY 1
#endif
+/** @} */
+
/*===========================================================================*/
-/* Information about wchar support */
+/** @{ Information about wchar support */
/*===========================================================================*/
+#ifndef U_HAVE_WCHAR_H
#define U_HAVE_WCHAR_H 1
+#endif
+
+#ifndef U_SIZEOF_WCHAR_T
#define U_SIZEOF_WCHAR_T 4
+#endif
+#ifndef U_HAVE_WCSCPY
#define U_HAVE_WCSCPY 1
+#endif
+
+/** @} */
+
+/**
+ * @{
+ * \def U_DECLARE_UTF16
+ * Do not use this macro. Use the UNICODE_STRING or U_STRING_DECL macros
+ * instead.
+ * @internal
+ *
+ * \def U_GNUC_UTF16_STRING
+ * @internal
+ */
+#ifndef U_GNUC_UTF16_STRING
+#define U_GNUC_UTF16_STRING 0
+#endif
+#if 1 || defined(U_CHECK_UTF16_STRING)
+#if (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \
+ || (defined(__HP_aCC) && __HP_aCC >= 035000) \
+ || (defined(__HP_cc) && __HP_cc >= 111106) \
+ || U_GNUC_UTF16_STRING
+#define U_DECLARE_UTF16(string) u ## string
+#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550)
+/* || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x580) */
+/* Sun's C compiler has issues with this notation, and it's unreliable. */
+#define U_DECLARE_UTF16(string) U ## string
+#elif U_SIZEOF_WCHAR_T == 2 \
+ && (U_CHARSET_FAMILY == 0 || ((defined(OS390) || defined(OS400)) && defined(__UCS2__)))
+#define U_DECLARE_UTF16(string) L ## string
+#endif
+#endif
+
+/** @} */
/*===========================================================================*/
-/* Information about POSIX support */
+/** @{ Information about POSIX support */
/*===========================================================================*/
-#define U_HAVE_NL_LANGINFO 1
+#ifndef U_HAVE_NL_LANGINFO_CODESET
#define U_HAVE_NL_LANGINFO_CODESET 1
+#endif
+
+#ifndef U_NL_LANGINFO_CODESET
#define U_NL_LANGINFO_CODESET CODESET
+#endif
#if 1
#define U_TZSET tzset
#endif
#if 0
-#define U_TIMEZONE
+#define U_TIMEZONE timezone
#endif
#if 1
#define U_TZNAME tzname
@@ -235,33 +292,110 @@ typedef unsigned int uint32_t;
#define U_HAVE_MMAP 1
#define U_HAVE_POPEN 1
+/** @} */
+
/*===========================================================================*/
-/* Symbol import-export control */
+/** @{ Symbol import-export control */
/*===========================================================================*/
+#if 1
+#define U_EXPORT __attribute__((visibility("default")))
+#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
+ || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550)
+#define U_EXPORT __global
+/*#elif defined(__HP_aCC) || defined(__HP_cc)
+#define U_EXPORT __declspec(dllexport)*/
+#else
#define U_EXPORT
+#endif
+
/* U_CALLCONV is releated to U_EXPORT2 */
#define U_EXPORT2
/* cygwin needs to export/import data */
-#ifdef U_CYGWIN
+#if defined(U_CYGWIN) && !defined(__GNUC__)
#define U_IMPORT __declspec(dllimport)
#else
#define U_IMPORT
#endif
+/* @} */
+
/*===========================================================================*/
-/* Code alignment and C function inlining */
+/** @{ Code alignment and C function inlining */
/*===========================================================================*/
#ifndef U_INLINE
-#define U_INLINE inline
+# ifdef __cplusplus
+# define U_INLINE inline
+# else
+# define U_INLINE __inline__
+# endif
#endif
+#ifndef U_ALIGN_CODE
#define U_ALIGN_CODE(n)
+#endif
+
+/** @} */
/*===========================================================================*/
-/* Programs used by ICU code */
+/** @{ GCC built in functions for atomic memory operations */
/*===========================================================================*/
+/**
+ * \def U_HAVE_GCC_ATOMICS
+ * @internal
+ */
+#ifndef U_HAVE_GCC_ATOMICS
+#define U_HAVE_GCC_ATOMICS 1
+#endif
+
+/** @} */
+
+/*===========================================================================*/
+/** @{ Programs used by ICU code */
+/*===========================================================================*/
+
+/**
+ * \def U_MAKE
+ * What program to execute to run 'make'
+ */
+#ifndef U_MAKE
#define U_MAKE "/usr/bin/gnumake"
+#endif
+
+/** @} */
+
+#endif /* CYGWINMSVC */
+
+/*===========================================================================*/
+/* Custom icu entry point renaming */
+/*===========================================================================*/
+
+/**
+ * Define the library suffix with C syntax.
+ * @internal
+ */
+# define U_LIB_SUFFIX_C_NAME
+/**
+ * Define the library suffix as a string with C syntax
+ * @internal
+ */
+# define U_LIB_SUFFIX_C_NAME_STRING ""
+/**
+ * 1 if a custom library suffix is set
+ * @internal
+ */
+# define U_HAVE_LIB_SUFFIX 0
+
+#if U_HAVE_LIB_SUFFIX
+# ifndef U_ICU_ENTRY_POINT_RENAME
+/* Renaming pattern: u_strcpy_41_suffix */
+# define U_ICU_ENTRY_POINT_RENAME(x) x ## _ ## 46 ##
+# define U_DEF_ICUDATA_ENTRY_POINT(major, minor) icudt####major##minor##_dat
+
+# endif
+#endif
+
+#endif
diff --git a/Source/JavaScriptCore/icu/unicode/ptypes.h b/Source/JavaScriptCore/icu/unicode/ptypes.h
new file mode 100644
index 000000000..1f34d2f84
--- /dev/null
+++ b/Source/JavaScriptCore/icu/unicode/ptypes.h
@@ -0,0 +1,92 @@
+/*
+******************************************************************************
+*
+* Copyright (C) 1997-2010, International Business Machines
+* Corporation and others. All Rights Reserved.
+*
+******************************************************************************
+*
+* FILE NAME : ptypes.h
+*
+* Date Name Description
+* 05/13/98 nos Creation (content moved here from ptypes.h).
+* 03/02/99 stephen Added AS400 support.
+* 03/30/99 stephen Added Linux support.
+* 04/13/99 stephen Reworked for autoconf.
+* 09/18/08 srl Moved basic types back to ptypes.h from platform.h
+******************************************************************************
+*/
+
+#ifndef _PTYPES_H
+#define _PTYPES_H
+
+#include <sys/types.h>
+
+#include "unicode/platform.h"
+
+/*===========================================================================*/
+/* Generic data types */
+/*===========================================================================*/
+
+/* If your platform does not have the <inttypes.h> header, you may
+ need to edit the typedefs below. */
+#if U_HAVE_INTTYPES_H
+
+/* autoconf 2.13 sometimes can't properly find the data types in <inttypes.h> */
+/* os/390 needs <inttypes.h>, but it doesn't have int8_t, and it sometimes */
+/* doesn't have uint8_t depending on the OS version. */
+/* So we have this work around. */
+#ifdef OS390
+/* The features header is needed to get (u)int64_t sometimes. */
+#include <features.h>
+#if ! U_HAVE_INT8_T
+typedef signed char int8_t;
+#endif
+#if !defined(__uint8_t)
+#define __uint8_t 1
+typedef unsigned char uint8_t;
+#endif
+#endif /* OS390 */
+
+#include <inttypes.h>
+
+#else /* U_HAVE_INTTYPES_H */
+
+#if ! U_HAVE_INT8_T
+typedef signed char int8_t;
+#endif
+
+#if ! U_HAVE_UINT8_T
+typedef unsigned char uint8_t;
+#endif
+
+#if ! U_HAVE_INT16_T
+typedef signed short int16_t;
+#endif
+
+#if ! U_HAVE_UINT16_T
+typedef unsigned short uint16_t;
+#endif
+
+#if ! U_HAVE_INT32_T
+typedef signed int int32_t;
+#endif
+
+#if ! U_HAVE_UINT32_T
+typedef unsigned int uint32_t;
+#endif
+
+#if ! U_HAVE_INT64_T
+ typedef signed long long int64_t;
+/* else we may not have a 64-bit type */
+#endif
+
+#if ! U_HAVE_UINT64_T
+ typedef unsigned long long uint64_t;
+/* else we may not have a 64-bit type */
+#endif
+
+#endif /* U_HAVE_INTTYPES_H */
+
+#endif /* _PTYPES_H */
+
diff --git a/Source/JavaScriptCore/icu/unicode/putil.h b/Source/JavaScriptCore/icu/unicode/putil.h
index 685df530e..71d5d2643 100644
--- a/Source/JavaScriptCore/icu/unicode/putil.h
+++ b/Source/JavaScriptCore/icu/unicode/putil.h
@@ -1,7 +1,7 @@
/*
******************************************************************************
*
-* Copyright (C) 1997-2004, International Business Machines
+* Copyright (C) 1997-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@@ -25,8 +25,12 @@
#define PUTIL_H
#include "unicode/utypes.h"
+ /**
+ * \file
+ * \brief C API: Platform Utilities
+ */
-/* Define this to 1 if your platform supports IEEE 754 floating point,
+/** Define this to 1 if your platform supports IEEE 754 floating point,
to 0 if it does not. */
#ifndef IEEE_754
# define IEEE_754 1
@@ -54,7 +58,11 @@
* If u_setDataDirectory() has been called, that is it, otherwise
* if the ICU_DATA environment variable is set, use that, otherwise
* If a data directory was specifed at ICU build time
- * (#define ICU_DATA_DIR "path"), use that,
+ * <code>
+ * \code
+ * #define ICU_DATA_DIR "path"
+ * \endcode
+ * </code> use that,
* otherwise no data directory is available.
*
* @return the data directory, or an empty string ("") if no data directory has
@@ -85,6 +93,7 @@ U_STABLE const char* U_EXPORT2 u_getDataDirectory(void);
*/
U_STABLE void U_EXPORT2 u_setDataDirectory(const char *directory);
+#if !U_CHARSET_IS_UTF8
/**
* Please use ucnv_getDefaultName() instead.
* Return the default codepage for this platform and locale.
@@ -94,6 +103,7 @@ U_STABLE void U_EXPORT2 u_setDataDirectory(const char *directory);
* @internal
*/
U_INTERNAL const char* U_EXPORT2 uprv_getDefaultCodepage(void);
+#endif
/**
* Please use uloc_getDefault() instead.
@@ -107,6 +117,7 @@ U_INTERNAL const char* U_EXPORT2 uprv_getDefaultCodepage(void);
U_INTERNAL const char* U_EXPORT2 uprv_getDefaultLocaleID(void);
/**
+ * @{
* Filesystem file and path separator characters.
* Example: '/' and ':' on Unix, '\\' and ';' on Windows.
* @stable ICU 2.0
@@ -134,6 +145,8 @@ U_INTERNAL const char* U_EXPORT2 uprv_getDefaultLocaleID(void);
# define U_PATH_SEP_STRING ":"
#endif
+/** @} */
+
/**
* Convert char characters to UChar characters.
* This utility function is useful only for "invariant characters"
diff --git a/Source/JavaScriptCore/icu/unicode/uchar.h b/Source/JavaScriptCore/icu/unicode/uchar.h
index 7fd490c81..93aa66320 100644
--- a/Source/JavaScriptCore/icu/unicode/uchar.h
+++ b/Source/JavaScriptCore/icu/unicode/uchar.h
@@ -1,6 +1,6 @@
/*
**********************************************************************
-* Copyright (C) 1997-2004, International Business Machines
+* Copyright (C) 1997-2010, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
*
@@ -39,7 +39,7 @@ U_CDECL_BEGIN
* @see u_getUnicodeVersion
* @stable ICU 2.0
*/
-#define U_UNICODE_VERSION "4.0.1"
+#define U_UNICODE_VERSION "6.0"
/**
* \file
@@ -56,12 +56,12 @@ U_CDECL_BEGIN
*
* For more information see
* "About the Unicode Character Database" (http://www.unicode.org/ucd/)
- * and the ICU User Guide chapter on Properties (http://oss.software.ibm.com/icu/userguide/properties.html).
+ * and the ICU User Guide chapter on Properties (http://icu-project.org/userguide/properties.html).
*
* Many functions are designed to match java.lang.Character functions.
* See the individual function documentation,
- * and see the JDK 1.4.1 java.lang.Character documentation
- * at http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Character.html
+ * and see the JDK 1.4 java.lang.Character documentation
+ * at http://java.sun.com/j2se/1.4/docs/api/java/lang/Character.html
*
* There are also functions that provide easy migration from C/POSIX functions
* like isblank(). Their use is generally discouraged because the C/POSIX
@@ -77,12 +77,33 @@ U_CDECL_BEGIN
* (In ICU, BreakIterator is the most sophisticated API for word boundaries.)
* Another example: There is no "istitle()" class for titlecase characters.
*
- * A summary of the behavior of some C/POSIX character classification implementations
- * for Unicode is available at http://oss.software.ibm.com/cvs/icu/~checkout~/icuhtml/design/posix_classes.html
- *
- * <strong>Important</strong>:
- * The behavior of the ICU C/POSIX-style character classification
- * functions is subject to change according to discussion of the above summary.
+ * ICU 3.4 and later provides API access for all twelve C/POSIX character classes.
+ * ICU implements them according to the Standard Recommendations in
+ * Annex C: Compatibility Properties of UTS #18 Unicode Regular Expressions
+ * (http://www.unicode.org/reports/tr18/#Compatibility_Properties).
+ *
+ * API access for C/POSIX character classes is as follows:
+ * - alpha: u_isUAlphabetic(c) or u_hasBinaryProperty(c, UCHAR_ALPHABETIC)
+ * - lower: u_isULowercase(c) or u_hasBinaryProperty(c, UCHAR_LOWERCASE)
+ * - upper: u_isUUppercase(c) or u_hasBinaryProperty(c, UCHAR_UPPERCASE)
+ * - punct: u_ispunct(c)
+ * - digit: u_isdigit(c) or u_charType(c)==U_DECIMAL_DIGIT_NUMBER
+ * - xdigit: u_isxdigit(c) or u_hasBinaryProperty(c, UCHAR_POSIX_XDIGIT)
+ * - alnum: u_hasBinaryProperty(c, UCHAR_POSIX_ALNUM)
+ * - space: u_isUWhiteSpace(c) or u_hasBinaryProperty(c, UCHAR_WHITE_SPACE)
+ * - blank: u_isblank(c) or u_hasBinaryProperty(c, UCHAR_POSIX_BLANK)
+ * - cntrl: u_charType(c)==U_CONTROL_CHAR
+ * - graph: u_hasBinaryProperty(c, UCHAR_POSIX_GRAPH)
+ * - print: u_hasBinaryProperty(c, UCHAR_POSIX_PRINT)
+ *
+ * Note: Some of the u_isxyz() functions in uchar.h predate, and do not match,
+ * the Standard Recommendations in UTS #18. Instead, they match Java
+ * functions according to their API documentation.
+ *
+ * \htmlonly
+ * The C/POSIX character classes are also available in UnicodeSet patterns,
+ * using patterns like [:graph:] or \p{graph}.
+ * \endhtmlonly
*
* Note: There are several ICU whitespace functions.
* Comparison:
@@ -166,200 +187,229 @@ typedef enum UProperty {
/** First constant for binary Unicode properties. @stable ICU 2.1 */
UCHAR_BINARY_START=UCHAR_ALPHABETIC,
/** Binary property ASCII_Hex_Digit. 0-9 A-F a-f @stable ICU 2.1 */
- UCHAR_ASCII_HEX_DIGIT,
+ UCHAR_ASCII_HEX_DIGIT=1,
/** Binary property Bidi_Control.
Format controls which have specific functions
in the Bidi Algorithm. @stable ICU 2.1 */
- UCHAR_BIDI_CONTROL,
+ UCHAR_BIDI_CONTROL=2,
/** Binary property Bidi_Mirrored.
Characters that may change display in RTL text.
Same as u_isMirrored.
See Bidi Algorithm, UTR 9. @stable ICU 2.1 */
- UCHAR_BIDI_MIRRORED,
+ UCHAR_BIDI_MIRRORED=3,
/** Binary property Dash. Variations of dashes. @stable ICU 2.1 */
- UCHAR_DASH,
+ UCHAR_DASH=4,
/** Binary property Default_Ignorable_Code_Point (new in Unicode 3.2).
Ignorable in most processing.
<2060..206F, FFF0..FFFB, E0000..E0FFF>+Other_Default_Ignorable_Code_Point+(Cf+Cc+Cs-White_Space) @stable ICU 2.1 */
- UCHAR_DEFAULT_IGNORABLE_CODE_POINT,
+ UCHAR_DEFAULT_IGNORABLE_CODE_POINT=5,
/** Binary property Deprecated (new in Unicode 3.2).
The usage of deprecated characters is strongly discouraged. @stable ICU 2.1 */
- UCHAR_DEPRECATED,
+ UCHAR_DEPRECATED=6,
/** Binary property Diacritic. Characters that linguistically modify
the meaning of another character to which they apply. @stable ICU 2.1 */
- UCHAR_DIACRITIC,
+ UCHAR_DIACRITIC=7,
/** Binary property Extender.
Extend the value or shape of a preceding alphabetic character,
e.g., length and iteration marks. @stable ICU 2.1 */
- UCHAR_EXTENDER,
+ UCHAR_EXTENDER=8,
/** Binary property Full_Composition_Exclusion.
CompositionExclusions.txt+Singleton Decompositions+
Non-Starter Decompositions. @stable ICU 2.1 */
- UCHAR_FULL_COMPOSITION_EXCLUSION,
+ UCHAR_FULL_COMPOSITION_EXCLUSION=9,
/** Binary property Grapheme_Base (new in Unicode 3.2).
For programmatic determination of grapheme cluster boundaries.
[0..10FFFF]-Cc-Cf-Cs-Co-Cn-Zl-Zp-Grapheme_Link-Grapheme_Extend-CGJ @stable ICU 2.1 */
- UCHAR_GRAPHEME_BASE,
+ UCHAR_GRAPHEME_BASE=10,
/** Binary property Grapheme_Extend (new in Unicode 3.2).
For programmatic determination of grapheme cluster boundaries.
Me+Mn+Mc+Other_Grapheme_Extend-Grapheme_Link-CGJ @stable ICU 2.1 */
- UCHAR_GRAPHEME_EXTEND,
+ UCHAR_GRAPHEME_EXTEND=11,
/** Binary property Grapheme_Link (new in Unicode 3.2).
For programmatic determination of grapheme cluster boundaries. @stable ICU 2.1 */
- UCHAR_GRAPHEME_LINK,
+ UCHAR_GRAPHEME_LINK=12,
/** Binary property Hex_Digit.
Characters commonly used for hexadecimal numbers. @stable ICU 2.1 */
- UCHAR_HEX_DIGIT,
+ UCHAR_HEX_DIGIT=13,
/** Binary property Hyphen. Dashes used to mark connections
between pieces of words, plus the Katakana middle dot. @stable ICU 2.1 */
- UCHAR_HYPHEN,
+ UCHAR_HYPHEN=14,
/** Binary property ID_Continue.
Characters that can continue an identifier.
DerivedCoreProperties.txt also says "NOTE: Cf characters should be filtered out."
ID_Start+Mn+Mc+Nd+Pc @stable ICU 2.1 */
- UCHAR_ID_CONTINUE,
+ UCHAR_ID_CONTINUE=15,
/** Binary property ID_Start.
Characters that can start an identifier.
Lu+Ll+Lt+Lm+Lo+Nl @stable ICU 2.1 */
- UCHAR_ID_START,
+ UCHAR_ID_START=16,
/** Binary property Ideographic.
CJKV ideographs. @stable ICU 2.1 */
- UCHAR_IDEOGRAPHIC,
+ UCHAR_IDEOGRAPHIC=17,
/** Binary property IDS_Binary_Operator (new in Unicode 3.2).
For programmatic determination of
Ideographic Description Sequences. @stable ICU 2.1 */
- UCHAR_IDS_BINARY_OPERATOR,
+ UCHAR_IDS_BINARY_OPERATOR=18,
/** Binary property IDS_Trinary_Operator (new in Unicode 3.2).
For programmatic determination of
Ideographic Description Sequences. @stable ICU 2.1 */
- UCHAR_IDS_TRINARY_OPERATOR,
+ UCHAR_IDS_TRINARY_OPERATOR=19,
/** Binary property Join_Control.
Format controls for cursive joining and ligation. @stable ICU 2.1 */
- UCHAR_JOIN_CONTROL,
+ UCHAR_JOIN_CONTROL=20,
/** Binary property Logical_Order_Exception (new in Unicode 3.2).
Characters that do not use logical order and
require special handling in most processing. @stable ICU 2.1 */
- UCHAR_LOGICAL_ORDER_EXCEPTION,
+ UCHAR_LOGICAL_ORDER_EXCEPTION=21,
/** Binary property Lowercase. Same as u_isULowercase, different from u_islower.
Ll+Other_Lowercase @stable ICU 2.1 */
- UCHAR_LOWERCASE,
+ UCHAR_LOWERCASE=22,
/** Binary property Math. Sm+Other_Math @stable ICU 2.1 */
- UCHAR_MATH,
+ UCHAR_MATH=23,
/** Binary property Noncharacter_Code_Point.
Code points that are explicitly defined as illegal
for the encoding of characters. @stable ICU 2.1 */
- UCHAR_NONCHARACTER_CODE_POINT,
+ UCHAR_NONCHARACTER_CODE_POINT=24,
/** Binary property Quotation_Mark. @stable ICU 2.1 */
- UCHAR_QUOTATION_MARK,
+ UCHAR_QUOTATION_MARK=25,
/** Binary property Radical (new in Unicode 3.2).
For programmatic determination of
Ideographic Description Sequences. @stable ICU 2.1 */
- UCHAR_RADICAL,
+ UCHAR_RADICAL=26,
/** Binary property Soft_Dotted (new in Unicode 3.2).
Characters with a "soft dot", like i or j.
An accent placed on these characters causes
the dot to disappear. @stable ICU 2.1 */
- UCHAR_SOFT_DOTTED,
+ UCHAR_SOFT_DOTTED=27,
/** Binary property Terminal_Punctuation.
Punctuation characters that generally mark
the end of textual units. @stable ICU 2.1 */
- UCHAR_TERMINAL_PUNCTUATION,
+ UCHAR_TERMINAL_PUNCTUATION=28,
/** Binary property Unified_Ideograph (new in Unicode 3.2).
For programmatic determination of
Ideographic Description Sequences. @stable ICU 2.1 */
- UCHAR_UNIFIED_IDEOGRAPH,
+ UCHAR_UNIFIED_IDEOGRAPH=29,
/** Binary property Uppercase. Same as u_isUUppercase, different from u_isupper.
Lu+Other_Uppercase @stable ICU 2.1 */
- UCHAR_UPPERCASE,
+ UCHAR_UPPERCASE=30,
/** Binary property White_Space.
Same as u_isUWhiteSpace, different from u_isspace and u_isWhitespace.
Space characters+TAB+CR+LF-ZWSP-ZWNBSP @stable ICU 2.1 */
- UCHAR_WHITE_SPACE,
+ UCHAR_WHITE_SPACE=31,
/** Binary property XID_Continue.
ID_Continue modified to allow closure under
normalization forms NFKC and NFKD. @stable ICU 2.1 */
- UCHAR_XID_CONTINUE,
+ UCHAR_XID_CONTINUE=32,
/** Binary property XID_Start. ID_Start modified to allow
closure under normalization forms NFKC and NFKD. @stable ICU 2.1 */
- UCHAR_XID_START,
+ UCHAR_XID_START=33,
/** Binary property Case_Sensitive. Either the source of a case
mapping or _in_ the target of a case mapping. Not the same as
the general category Cased_Letter. @stable ICU 2.6 */
- UCHAR_CASE_SENSITIVE,
+ UCHAR_CASE_SENSITIVE=34,
/** Binary property STerm (new in Unicode 4.0.1).
Sentence Terminal. Used in UAX #29: Text Boundaries
(http://www.unicode.org/reports/tr29/)
- @draft ICU 3.0 */
- UCHAR_S_TERM,
+ @stable ICU 3.0 */
+ UCHAR_S_TERM=35,
/** Binary property Variation_Selector (new in Unicode 4.0.1).
Indicates all those characters that qualify as Variation Selectors.
For details on the behavior of these characters,
see StandardizedVariants.html and 15.6 Variation Selectors.
- @draft ICU 3.0 */
- UCHAR_VARIATION_SELECTOR,
+ @stable ICU 3.0 */
+ UCHAR_VARIATION_SELECTOR=36,
/** Binary property NFD_Inert.
ICU-specific property for characters that are inert under NFD,
i.e., they do not interact with adjacent characters.
- Used for example in normalizing transforms in incremental mode
- to find the boundary of safely normalizable text despite possible
- text additions.
-
- There is one such property per normalization form.
- These properties are computed as follows - an inert character is:
- a) unassigned, or ALL of the following:
- b) of combining class 0.
- c) not decomposed by this normalization form.
- AND if NFC or NFKC,
- d) can never compose with a previous character.
- e) can never compose with a following character.
- f) can never change if another character is added.
- Example: a-breve might satisfy all but f, but if you
- add an ogonek it changes to a-ogonek + breve
-
- See also com.ibm.text.UCD.NFSkippable in the ICU4J repository,
- and icu/source/common/unormimp.h .
- @draft ICU 3.0 */
- UCHAR_NFD_INERT,
+ See the documentation for the Normalizer2 class and the
+ Normalizer2::isInert() method.
+ @stable ICU 3.0 */
+ UCHAR_NFD_INERT=37,
/** Binary property NFKD_Inert.
ICU-specific property for characters that are inert under NFKD,
i.e., they do not interact with adjacent characters.
- Used for example in normalizing transforms in incremental mode
- to find the boundary of safely normalizable text despite possible
- text additions.
- @see UCHAR_NFD_INERT
- @draft ICU 3.0 */
- UCHAR_NFKD_INERT,
+ See the documentation for the Normalizer2 class and the
+ Normalizer2::isInert() method.
+ @stable ICU 3.0 */
+ UCHAR_NFKD_INERT=38,
/** Binary property NFC_Inert.
ICU-specific property for characters that are inert under NFC,
i.e., they do not interact with adjacent characters.
- Used for example in normalizing transforms in incremental mode
- to find the boundary of safely normalizable text despite possible
- text additions.
- @see UCHAR_NFD_INERT
- @draft ICU 3.0 */
- UCHAR_NFC_INERT,
+ See the documentation for the Normalizer2 class and the
+ Normalizer2::isInert() method.
+ @stable ICU 3.0 */
+ UCHAR_NFC_INERT=39,
/** Binary property NFKC_Inert.
ICU-specific property for characters that are inert under NFKC,
i.e., they do not interact with adjacent characters.
- Used for example in normalizing transforms in incremental mode
- to find the boundary of safely normalizable text despite possible
- text additions.
- @see UCHAR_NFD_INERT
- @draft ICU 3.0 */
- UCHAR_NFKC_INERT,
+ See the documentation for the Normalizer2 class and the
+ Normalizer2::isInert() method.
+ @stable ICU 3.0 */
+ UCHAR_NFKC_INERT=40,
/** Binary Property Segment_Starter.
ICU-specific property for characters that are starters in terms of
Unicode normalization and combining character sequences.
They have ccc=0 and do not occur in non-initial position of the
canonical decomposition of any character
- (like " in NFD(a-umlaut) and a Jamo T in an NFD(Hangul LVT)).
+ (like a-umlaut in NFD and a Jamo T in an NFD(Hangul LVT)).
ICU uses this property for segmenting a string for generating a set of
canonically equivalent strings, e.g. for canonical closure while
processing collation tailoring rules.
- @draft ICU 3.0 */
- UCHAR_SEGMENT_STARTER,
+ @stable ICU 3.0 */
+ UCHAR_SEGMENT_STARTER=41,
+ /** Binary property Pattern_Syntax (new in Unicode 4.1).
+ See UAX #31 Identifier and Pattern Syntax
+ (http://www.unicode.org/reports/tr31/)
+ @stable ICU 3.4 */
+ UCHAR_PATTERN_SYNTAX=42,
+ /** Binary property Pattern_White_Space (new in Unicode 4.1).
+ See UAX #31 Identifier and Pattern Syntax
+ (http://www.unicode.org/reports/tr31/)
+ @stable ICU 3.4 */
+ UCHAR_PATTERN_WHITE_SPACE=43,
+ /** Binary property alnum (a C/POSIX character class).
+ Implemented according to the UTS #18 Annex C Standard Recommendation.
+ See the uchar.h file documentation.
+ @stable ICU 3.4 */
+ UCHAR_POSIX_ALNUM=44,
+ /** Binary property blank (a C/POSIX character class).
+ Implemented according to the UTS #18 Annex C Standard Recommendation.
+ See the uchar.h file documentation.
+ @stable ICU 3.4 */
+ UCHAR_POSIX_BLANK=45,
+ /** Binary property graph (a C/POSIX character class).
+ Implemented according to the UTS #18 Annex C Standard Recommendation.
+ See the uchar.h file documentation.
+ @stable ICU 3.4 */
+ UCHAR_POSIX_GRAPH=46,
+ /** Binary property print (a C/POSIX character class).
+ Implemented according to the UTS #18 Annex C Standard Recommendation.
+ See the uchar.h file documentation.
+ @stable ICU 3.4 */
+ UCHAR_POSIX_PRINT=47,
+ /** Binary property xdigit (a C/POSIX character class).
+ Implemented according to the UTS #18 Annex C Standard Recommendation.
+ See the uchar.h file documentation.
+ @stable ICU 3.4 */
+ UCHAR_POSIX_XDIGIT=48,
+ /** Binary property Cased. For Lowercase, Uppercase and Titlecase characters. @stable ICU 4.4 */
+ UCHAR_CASED=49,
+ /** Binary property Case_Ignorable. Used in context-sensitive case mappings. @stable ICU 4.4 */
+ UCHAR_CASE_IGNORABLE=50,
+ /** Binary property Changes_When_Lowercased. @stable ICU 4.4 */
+ UCHAR_CHANGES_WHEN_LOWERCASED=51,
+ /** Binary property Changes_When_Uppercased. @stable ICU 4.4 */
+ UCHAR_CHANGES_WHEN_UPPERCASED=52,
+ /** Binary property Changes_When_Titlecased. @stable ICU 4.4 */
+ UCHAR_CHANGES_WHEN_TITLECASED=53,
+ /** Binary property Changes_When_Casefolded. @stable ICU 4.4 */
+ UCHAR_CHANGES_WHEN_CASEFOLDED=54,
+ /** Binary property Changes_When_Casemapped. @stable ICU 4.4 */
+ UCHAR_CHANGES_WHEN_CASEMAPPED=55,
+ /** Binary property Changes_When_NFKC_Casefolded. @stable ICU 4.4 */
+ UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED=56,
/** One more than the last constant for binary Unicode properties. @stable ICU 2.1 */
- UCHAR_BINARY_LIMIT,
+ UCHAR_BINARY_LIMIT=57,
/** Enumerated property Bidi_Class.
Same as u_charDirection, returns UCharDirection values. @stable ICU 2.2 */
@@ -368,66 +418,81 @@ typedef enum UProperty {
UCHAR_INT_START=UCHAR_BIDI_CLASS,
/** Enumerated property Block.
Same as ublock_getCode, returns UBlockCode values. @stable ICU 2.2 */
- UCHAR_BLOCK,
+ UCHAR_BLOCK=0x1001,
/** Enumerated property Canonical_Combining_Class.
Same as u_getCombiningClass, returns 8-bit numeric values. @stable ICU 2.2 */
- UCHAR_CANONICAL_COMBINING_CLASS,
+ UCHAR_CANONICAL_COMBINING_CLASS=0x1002,
/** Enumerated property Decomposition_Type.
Returns UDecompositionType values. @stable ICU 2.2 */
- UCHAR_DECOMPOSITION_TYPE,
+ UCHAR_DECOMPOSITION_TYPE=0x1003,
/** Enumerated property East_Asian_Width.
See http://www.unicode.org/reports/tr11/
Returns UEastAsianWidth values. @stable ICU 2.2 */
- UCHAR_EAST_ASIAN_WIDTH,
+ UCHAR_EAST_ASIAN_WIDTH=0x1004,
/** Enumerated property General_Category.
Same as u_charType, returns UCharCategory values. @stable ICU 2.2 */
- UCHAR_GENERAL_CATEGORY,
+ UCHAR_GENERAL_CATEGORY=0x1005,
/** Enumerated property Joining_Group.
Returns UJoiningGroup values. @stable ICU 2.2 */
- UCHAR_JOINING_GROUP,
+ UCHAR_JOINING_GROUP=0x1006,
/** Enumerated property Joining_Type.
Returns UJoiningType values. @stable ICU 2.2 */
- UCHAR_JOINING_TYPE,
+ UCHAR_JOINING_TYPE=0x1007,
/** Enumerated property Line_Break.
Returns ULineBreak values. @stable ICU 2.2 */
- UCHAR_LINE_BREAK,
+ UCHAR_LINE_BREAK=0x1008,
/** Enumerated property Numeric_Type.
Returns UNumericType values. @stable ICU 2.2 */
- UCHAR_NUMERIC_TYPE,
+ UCHAR_NUMERIC_TYPE=0x1009,
/** Enumerated property Script.
Same as uscript_getScript, returns UScriptCode values. @stable ICU 2.2 */
- UCHAR_SCRIPT,
+ UCHAR_SCRIPT=0x100A,
/** Enumerated property Hangul_Syllable_Type, new in Unicode 4.
Returns UHangulSyllableType values. @stable ICU 2.6 */
- UCHAR_HANGUL_SYLLABLE_TYPE,
+ UCHAR_HANGUL_SYLLABLE_TYPE=0x100B,
/** Enumerated property NFD_Quick_Check.
- Returns UNormalizationCheckResult values. @draft ICU 3.0 */
- UCHAR_NFD_QUICK_CHECK,
+ Returns UNormalizationCheckResult values. @stable ICU 3.0 */
+ UCHAR_NFD_QUICK_CHECK=0x100C,
/** Enumerated property NFKD_Quick_Check.
- Returns UNormalizationCheckResult values. @draft ICU 3.0 */
- UCHAR_NFKD_QUICK_CHECK,
+ Returns UNormalizationCheckResult values. @stable ICU 3.0 */
+ UCHAR_NFKD_QUICK_CHECK=0x100D,
/** Enumerated property NFC_Quick_Check.
- Returns UNormalizationCheckResult values. @draft ICU 3.0 */
- UCHAR_NFC_QUICK_CHECK,
+ Returns UNormalizationCheckResult values. @stable ICU 3.0 */
+ UCHAR_NFC_QUICK_CHECK=0x100E,
/** Enumerated property NFKC_Quick_Check.
- Returns UNormalizationCheckResult values. @draft ICU 3.0 */
- UCHAR_NFKC_QUICK_CHECK,
+ Returns UNormalizationCheckResult values. @stable ICU 3.0 */
+ UCHAR_NFKC_QUICK_CHECK=0x100F,
/** Enumerated property Lead_Canonical_Combining_Class.
ICU-specific property for the ccc of the first code point
of the decomposition, or lccc(c)=ccc(NFD(c)[0]).
Useful for checking for canonically ordered text;
see UNORM_FCD and http://www.unicode.org/notes/tn5/#FCD .
- Returns 8-bit numeric values like UCHAR_CANONICAL_COMBINING_CLASS. @draft ICU 3.0 */
- UCHAR_LEAD_CANONICAL_COMBINING_CLASS,
+ Returns 8-bit numeric values like UCHAR_CANONICAL_COMBINING_CLASS. @stable ICU 3.0 */
+ UCHAR_LEAD_CANONICAL_COMBINING_CLASS=0x1010,
/** Enumerated property Trail_Canonical_Combining_Class.
ICU-specific property for the ccc of the last code point
of the decomposition, or tccc(c)=ccc(NFD(c)[last]).
Useful for checking for canonically ordered text;
see UNORM_FCD and http://www.unicode.org/notes/tn5/#FCD .
- Returns 8-bit numeric values like UCHAR_CANONICAL_COMBINING_CLASS. @draft ICU 3.0 */
- UCHAR_TRAIL_CANONICAL_COMBINING_CLASS,
+ Returns 8-bit numeric values like UCHAR_CANONICAL_COMBINING_CLASS. @stable ICU 3.0 */
+ UCHAR_TRAIL_CANONICAL_COMBINING_CLASS=0x1011,
+ /** Enumerated property Grapheme_Cluster_Break (new in Unicode 4.1).
+ Used in UAX #29: Text Boundaries
+ (http://www.unicode.org/reports/tr29/)
+ Returns UGraphemeClusterBreak values. @stable ICU 3.4 */
+ UCHAR_GRAPHEME_CLUSTER_BREAK=0x1012,
+ /** Enumerated property Sentence_Break (new in Unicode 4.1).
+ Used in UAX #29: Text Boundaries
+ (http://www.unicode.org/reports/tr29/)
+ Returns USentenceBreak values. @stable ICU 3.4 */
+ UCHAR_SENTENCE_BREAK=0x1013,
+ /** Enumerated property Word_Break (new in Unicode 4.1).
+ Used in UAX #29: Text Boundaries
+ (http://www.unicode.org/reports/tr29/)
+ Returns UWordBreakValues values. @stable ICU 3.4 */
+ UCHAR_WORD_BREAK=0x1014,
/** One more than the last constant for enumerated/integer Unicode properties. @stable ICU 2.2 */
- UCHAR_INT_LIMIT,
+ UCHAR_INT_LIMIT=0x1015,
/** Bitmask property General_Category_Mask.
This is the General_Category property returned as a bit mask.
@@ -441,7 +506,7 @@ typedef enum UProperty {
/** First constant for bit-mask Unicode properties. @stable ICU 2.4 */
UCHAR_MASK_START=UCHAR_GENERAL_CATEGORY_MASK,
/** One more than the last constant for bit-mask Unicode properties. @stable ICU 2.4 */
- UCHAR_MASK_LIMIT,
+ UCHAR_MASK_LIMIT=0x2001,
/** Double property Numeric_Value.
Corresponds to u_getNumericValue. @stable ICU 2.4 */
@@ -449,7 +514,7 @@ typedef enum UProperty {
/** First constant for double Unicode properties. @stable ICU 2.4 */
UCHAR_DOUBLE_START=UCHAR_NUMERIC_VALUE,
/** One more than the last constant for double Unicode properties. @stable ICU 2.4 */
- UCHAR_DOUBLE_LIMIT,
+ UCHAR_DOUBLE_LIMIT=0x3001,
/** String property Age.
Corresponds to u_charAge. @stable ICU 2.4 */
@@ -458,42 +523,56 @@ typedef enum UProperty {
UCHAR_STRING_START=UCHAR_AGE,
/** String property Bidi_Mirroring_Glyph.
Corresponds to u_charMirror. @stable ICU 2.4 */
- UCHAR_BIDI_MIRRORING_GLYPH,
+ UCHAR_BIDI_MIRRORING_GLYPH=0x4001,
/** String property Case_Folding.
Corresponds to u_strFoldCase in ustring.h. @stable ICU 2.4 */
- UCHAR_CASE_FOLDING,
+ UCHAR_CASE_FOLDING=0x4002,
/** String property ISO_Comment.
Corresponds to u_getISOComment. @stable ICU 2.4 */
- UCHAR_ISO_COMMENT,
+ UCHAR_ISO_COMMENT=0x4003,
/** String property Lowercase_Mapping.
Corresponds to u_strToLower in ustring.h. @stable ICU 2.4 */
- UCHAR_LOWERCASE_MAPPING,
+ UCHAR_LOWERCASE_MAPPING=0x4004,
/** String property Name.
Corresponds to u_charName. @stable ICU 2.4 */
- UCHAR_NAME,
+ UCHAR_NAME=0x4005,
/** String property Simple_Case_Folding.
Corresponds to u_foldCase. @stable ICU 2.4 */
- UCHAR_SIMPLE_CASE_FOLDING,
+ UCHAR_SIMPLE_CASE_FOLDING=0x4006,
/** String property Simple_Lowercase_Mapping.
Corresponds to u_tolower. @stable ICU 2.4 */
- UCHAR_SIMPLE_LOWERCASE_MAPPING,
+ UCHAR_SIMPLE_LOWERCASE_MAPPING=0x4007,
/** String property Simple_Titlecase_Mapping.
Corresponds to u_totitle. @stable ICU 2.4 */
- UCHAR_SIMPLE_TITLECASE_MAPPING,
+ UCHAR_SIMPLE_TITLECASE_MAPPING=0x4008,
/** String property Simple_Uppercase_Mapping.
Corresponds to u_toupper. @stable ICU 2.4 */
- UCHAR_SIMPLE_UPPERCASE_MAPPING,
+ UCHAR_SIMPLE_UPPERCASE_MAPPING=0x4009,
/** String property Titlecase_Mapping.
Corresponds to u_strToTitle in ustring.h. @stable ICU 2.4 */
- UCHAR_TITLECASE_MAPPING,
+ UCHAR_TITLECASE_MAPPING=0x400A,
/** String property Unicode_1_Name.
Corresponds to u_charName. @stable ICU 2.4 */
- UCHAR_UNICODE_1_NAME,
+ UCHAR_UNICODE_1_NAME=0x400B,
/** String property Uppercase_Mapping.
Corresponds to u_strToUpper in ustring.h. @stable ICU 2.4 */
- UCHAR_UPPERCASE_MAPPING,
+ UCHAR_UPPERCASE_MAPPING=0x400C,
/** One more than the last constant for string Unicode properties. @stable ICU 2.4 */
- UCHAR_STRING_LIMIT,
+ UCHAR_STRING_LIMIT=0x400D,
+
+ /** Provisional property Script_Extensions (new in Unicode 6.0).
+ As a provisional property, it may be modified or removed
+ in future versions of the Unicode Standard, and thus in ICU.
+ Some characters are commonly used in multiple scripts.
+ For more information, see UAX #24: http://www.unicode.org/reports/tr24/.
+ Corresponds to uscript_hasScript and uscript_getScriptExtensions in uscript.h.
+ @draft ICU 4.6 */
+ UCHAR_SCRIPT_EXTENSIONS=0x7000,
+ /** First constant for Unicode properties with unusual value types. @draft ICU 4.6 */
+ UCHAR_OTHER_PROPERTY_START=UCHAR_SCRIPT_EXTENSIONS,
+ /** One more than the last constant for Unicode properties with unusual value types.
+ * @draft ICU 4.6 */
+ UCHAR_OTHER_PROPERTY_LIMIT=0x7001,
/** Represents a nonexistent or invalid property or property value. @stable ICU 2.4 */
UCHAR_INVALID_CODE = -1
@@ -1057,7 +1136,7 @@ enum UBlockCode {
* @stable ICU 2.2
*/
UBLOCK_CYRILLIC_SUPPLEMENTARY = 97,
- /** @draft ICU 3.0 */
+ /** @stable ICU 3.0 */
UBLOCK_CYRILLIC_SUPPLEMENT = UBLOCK_CYRILLIC_SUPPLEMENTARY, /*[0500]*/
/** @stable ICU 2.2 */
UBLOCK_TAGALOG = 98, /*[1700]*/
@@ -1119,8 +1198,191 @@ enum UBlockCode {
/** @stable ICU 2.6 */
UBLOCK_VARIATION_SELECTORS_SUPPLEMENT = 125, /*[E0100]*/
- /** @stable ICU 2.0 */
- UBLOCK_COUNT,
+ /* New blocks in Unicode 4.1 */
+
+ /** @stable ICU 3.4 */
+ UBLOCK_ANCIENT_GREEK_MUSICAL_NOTATION = 126, /*[1D200]*/
+ /** @stable ICU 3.4 */
+ UBLOCK_ANCIENT_GREEK_NUMBERS = 127, /*[10140]*/
+ /** @stable ICU 3.4 */
+ UBLOCK_ARABIC_SUPPLEMENT = 128, /*[0750]*/
+ /** @stable ICU 3.4 */
+ UBLOCK_BUGINESE = 129, /*[1A00]*/
+ /** @stable ICU 3.4 */
+ UBLOCK_CJK_STROKES = 130, /*[31C0]*/
+ /** @stable ICU 3.4 */
+ UBLOCK_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT = 131, /*[1DC0]*/
+ /** @stable ICU 3.4 */
+ UBLOCK_COPTIC = 132, /*[2C80]*/
+ /** @stable ICU 3.4 */
+ UBLOCK_ETHIOPIC_EXTENDED = 133, /*[2D80]*/
+ /** @stable ICU 3.4 */
+ UBLOCK_ETHIOPIC_SUPPLEMENT = 134, /*[1380]*/
+ /** @stable ICU 3.4 */
+ UBLOCK_GEORGIAN_SUPPLEMENT = 135, /*[2D00]*/
+ /** @stable ICU 3.4 */
+ UBLOCK_GLAGOLITIC = 136, /*[2C00]*/
+ /** @stable ICU 3.4 */
+ UBLOCK_KHAROSHTHI = 137, /*[10A00]*/
+ /** @stable ICU 3.4 */
+ UBLOCK_MODIFIER_TONE_LETTERS = 138, /*[A700]*/
+ /** @stable ICU 3.4 */
+ UBLOCK_NEW_TAI_LUE = 139, /*[1980]*/
+ /** @stable ICU 3.4 */
+ UBLOCK_OLD_PERSIAN = 140, /*[103A0]*/
+ /** @stable ICU 3.4 */
+ UBLOCK_PHONETIC_EXTENSIONS_SUPPLEMENT = 141, /*[1D80]*/
+ /** @stable ICU 3.4 */
+ UBLOCK_SUPPLEMENTAL_PUNCTUATION = 142, /*[2E00]*/
+ /** @stable ICU 3.4 */
+ UBLOCK_SYLOTI_NAGRI = 143, /*[A800]*/
+ /** @stable ICU 3.4 */
+ UBLOCK_TIFINAGH = 144, /*[2D30]*/
+ /** @stable ICU 3.4 */
+ UBLOCK_VERTICAL_FORMS = 145, /*[FE10]*/
+
+ /* New blocks in Unicode 5.0 */
+
+ /** @stable ICU 3.6 */
+ UBLOCK_NKO = 146, /*[07C0]*/
+ /** @stable ICU 3.6 */
+ UBLOCK_BALINESE = 147, /*[1B00]*/
+ /** @stable ICU 3.6 */
+ UBLOCK_LATIN_EXTENDED_C = 148, /*[2C60]*/
+ /** @stable ICU 3.6 */
+ UBLOCK_LATIN_EXTENDED_D = 149, /*[A720]*/
+ /** @stable ICU 3.6 */
+ UBLOCK_PHAGS_PA = 150, /*[A840]*/
+ /** @stable ICU 3.6 */
+ UBLOCK_PHOENICIAN = 151, /*[10900]*/
+ /** @stable ICU 3.6 */
+ UBLOCK_CUNEIFORM = 152, /*[12000]*/
+ /** @stable ICU 3.6 */
+ UBLOCK_CUNEIFORM_NUMBERS_AND_PUNCTUATION = 153, /*[12400]*/
+ /** @stable ICU 3.6 */
+ UBLOCK_COUNTING_ROD_NUMERALS = 154, /*[1D360]*/
+
+ /* New blocks in Unicode 5.1 */
+
+ /** @stable ICU 4.0 */
+ UBLOCK_SUNDANESE = 155, /*[1B80]*/
+ /** @stable ICU 4.0 */
+ UBLOCK_LEPCHA = 156, /*[1C00]*/
+ /** @stable ICU 4.0 */
+ UBLOCK_OL_CHIKI = 157, /*[1C50]*/
+ /** @stable ICU 4.0 */
+ UBLOCK_CYRILLIC_EXTENDED_A = 158, /*[2DE0]*/
+ /** @stable ICU 4.0 */
+ UBLOCK_VAI = 159, /*[A500]*/
+ /** @stable ICU 4.0 */
+ UBLOCK_CYRILLIC_EXTENDED_B = 160, /*[A640]*/
+ /** @stable ICU 4.0 */
+ UBLOCK_SAURASHTRA = 161, /*[A880]*/
+ /** @stable ICU 4.0 */
+ UBLOCK_KAYAH_LI = 162, /*[A900]*/
+ /** @stable ICU 4.0 */
+ UBLOCK_REJANG = 163, /*[A930]*/
+ /** @stable ICU 4.0 */
+ UBLOCK_CHAM = 164, /*[AA00]*/
+ /** @stable ICU 4.0 */
+ UBLOCK_ANCIENT_SYMBOLS = 165, /*[10190]*/
+ /** @stable ICU 4.0 */
+ UBLOCK_PHAISTOS_DISC = 166, /*[101D0]*/
+ /** @stable ICU 4.0 */
+ UBLOCK_LYCIAN = 167, /*[10280]*/
+ /** @stable ICU 4.0 */
+ UBLOCK_CARIAN = 168, /*[102A0]*/
+ /** @stable ICU 4.0 */
+ UBLOCK_LYDIAN = 169, /*[10920]*/
+ /** @stable ICU 4.0 */
+ UBLOCK_MAHJONG_TILES = 170, /*[1F000]*/
+ /** @stable ICU 4.0 */
+ UBLOCK_DOMINO_TILES = 171, /*[1F030]*/
+
+ /* New blocks in Unicode 5.2 */
+
+ /** @stable ICU 4.4 */
+ UBLOCK_SAMARITAN = 172, /*[0800]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED = 173, /*[18B0]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_TAI_THAM = 174, /*[1A20]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_VEDIC_EXTENSIONS = 175, /*[1CD0]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_LISU = 176, /*[A4D0]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_BAMUM = 177, /*[A6A0]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_COMMON_INDIC_NUMBER_FORMS = 178, /*[A830]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_DEVANAGARI_EXTENDED = 179, /*[A8E0]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_HANGUL_JAMO_EXTENDED_A = 180, /*[A960]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_JAVANESE = 181, /*[A980]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_MYANMAR_EXTENDED_A = 182, /*[AA60]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_TAI_VIET = 183, /*[AA80]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_MEETEI_MAYEK = 184, /*[ABC0]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_HANGUL_JAMO_EXTENDED_B = 185, /*[D7B0]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_IMPERIAL_ARAMAIC = 186, /*[10840]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_OLD_SOUTH_ARABIAN = 187, /*[10A60]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_AVESTAN = 188, /*[10B00]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_INSCRIPTIONAL_PARTHIAN = 189, /*[10B40]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_INSCRIPTIONAL_PAHLAVI = 190, /*[10B60]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_OLD_TURKIC = 191, /*[10C00]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_RUMI_NUMERAL_SYMBOLS = 192, /*[10E60]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_KAITHI = 193, /*[11080]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_EGYPTIAN_HIEROGLYPHS = 194, /*[13000]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_ENCLOSED_ALPHANUMERIC_SUPPLEMENT = 195, /*[1F100]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT = 196, /*[1F200]*/
+ /** @stable ICU 4.4 */
+ UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C = 197, /*[2A700]*/
+
+ /* New blocks in Unicode 6.0 */
+
+ /** @stable ICU 4.6 */
+ UBLOCK_MANDAIC = 198, /*[0840]*/
+ /** @stable ICU 4.6 */
+ UBLOCK_BATAK = 199, /*[1BC0]*/
+ /** @stable ICU 4.6 */
+ UBLOCK_ETHIOPIC_EXTENDED_A = 200, /*[AB00]*/
+ /** @stable ICU 4.6 */
+ UBLOCK_BRAHMI = 201, /*[11000]*/
+ /** @stable ICU 4.6 */
+ UBLOCK_BAMUM_SUPPLEMENT = 202, /*[16800]*/
+ /** @stable ICU 4.6 */
+ UBLOCK_KANA_SUPPLEMENT = 203, /*[1B000]*/
+ /** @stable ICU 4.6 */
+ UBLOCK_PLAYING_CARDS = 204, /*[1F0A0]*/
+ /** @stable ICU 4.6 */
+ UBLOCK_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS = 205, /*[1F300]*/
+ /** @stable ICU 4.6 */
+ UBLOCK_EMOTICONS = 206, /*[1F600]*/
+ /** @stable ICU 4.6 */
+ UBLOCK_TRANSPORT_AND_MAP_SYMBOLS = 207, /*[1F680]*/
+ /** @stable ICU 4.6 */
+ UBLOCK_ALCHEMICAL_SYMBOLS = 208, /*[1F700]*/
+ /** @stable ICU 4.6 */
+ UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D = 209, /*[2B740]*/
+
+ /** @stable ICU 2.0 */
+ UBLOCK_COUNT = 210,
/** @stable ICU 2.0 */
UBLOCK_INVALID_CODE=-1
@@ -1165,6 +1427,7 @@ typedef enum UCharNameChoice {
U_UNICODE_CHAR_NAME,
U_UNICODE_10_CHAR_NAME,
U_EXTENDED_CHAR_NAME,
+ U_CHAR_NAME_ALIAS, /**< Corrected name from NameAliases.txt. @stable ICU 4.4 */
U_CHAR_NAME_CHOICE_COUNT
} UCharNameChoice;
@@ -1252,7 +1515,8 @@ typedef enum UJoiningGroup {
U_JG_GAF,
U_JG_GAMAL,
U_JG_HAH,
- U_JG_HAMZA_ON_HEH_GOAL,
+ U_JG_TEH_MARBUTA_GOAL, /**< @stable ICU 4.6 */
+ U_JG_HAMZA_ON_HEH_GOAL=U_JG_TEH_MARBUTA_GOAL,
U_JG_HE,
U_JG_HEH,
U_JG_HEH_GOAL,
@@ -1292,50 +1556,130 @@ typedef enum UJoiningGroup {
U_JG_FE, /**< @stable ICU 2.6 */
U_JG_KHAPH, /**< @stable ICU 2.6 */
U_JG_ZHAIN, /**< @stable ICU 2.6 */
+ U_JG_BURUSHASKI_YEH_BARREE, /**< @stable ICU 4.0 */
+ U_JG_FARSI_YEH, /**< @stable ICU 4.4 */
+ U_JG_NYA, /**< @stable ICU 4.4 */
U_JG_COUNT
} UJoiningGroup;
/**
+ * Grapheme Cluster Break constants.
+ *
+ * @see UCHAR_GRAPHEME_CLUSTER_BREAK
+ * @stable ICU 3.4
+ */
+typedef enum UGraphemeClusterBreak {
+ U_GCB_OTHER = 0, /*[XX]*/ /*See note !!*/
+ U_GCB_CONTROL = 1, /*[CN]*/
+ U_GCB_CR = 2, /*[CR]*/
+ U_GCB_EXTEND = 3, /*[EX]*/
+ U_GCB_L = 4, /*[L]*/
+ U_GCB_LF = 5, /*[LF]*/
+ U_GCB_LV = 6, /*[LV]*/
+ U_GCB_LVT = 7, /*[LVT]*/
+ U_GCB_T = 8, /*[T]*/
+ U_GCB_V = 9, /*[V]*/
+ U_GCB_SPACING_MARK = 10, /*[SM]*/ /* from here on: new in Unicode 5.1/ICU 4.0 */
+ U_GCB_PREPEND = 11, /*[PP]*/
+ U_GCB_COUNT = 12
+} UGraphemeClusterBreak;
+
+/**
+ * Word Break constants.
+ * (UWordBreak is a pre-existing enum type in ubrk.h for word break status tags.)
+ *
+ * @see UCHAR_WORD_BREAK
+ * @stable ICU 3.4
+ */
+typedef enum UWordBreakValues {
+ U_WB_OTHER = 0, /*[XX]*/ /*See note !!*/
+ U_WB_ALETTER = 1, /*[LE]*/
+ U_WB_FORMAT = 2, /*[FO]*/
+ U_WB_KATAKANA = 3, /*[KA]*/
+ U_WB_MIDLETTER = 4, /*[ML]*/
+ U_WB_MIDNUM = 5, /*[MN]*/
+ U_WB_NUMERIC = 6, /*[NU]*/
+ U_WB_EXTENDNUMLET = 7, /*[EX]*/
+ U_WB_CR = 8, /*[CR]*/ /* from here on: new in Unicode 5.1/ICU 4.0 */
+ U_WB_EXTEND = 9, /*[Extend]*/
+ U_WB_LF = 10, /*[LF]*/
+ U_WB_MIDNUMLET =11, /*[MB]*/
+ U_WB_NEWLINE =12, /*[NL]*/
+ U_WB_COUNT = 13
+} UWordBreakValues;
+
+/**
+ * Sentence Break constants.
+ *
+ * @see UCHAR_SENTENCE_BREAK
+ * @stable ICU 3.4
+ */
+typedef enum USentenceBreak {
+ U_SB_OTHER = 0, /*[XX]*/ /*See note !!*/
+ U_SB_ATERM = 1, /*[AT]*/
+ U_SB_CLOSE = 2, /*[CL]*/
+ U_SB_FORMAT = 3, /*[FO]*/
+ U_SB_LOWER = 4, /*[LO]*/
+ U_SB_NUMERIC = 5, /*[NU]*/
+ U_SB_OLETTER = 6, /*[LE]*/
+ U_SB_SEP = 7, /*[SE]*/
+ U_SB_SP = 8, /*[SP]*/
+ U_SB_STERM = 9, /*[ST]*/
+ U_SB_UPPER = 10, /*[UP]*/
+ U_SB_CR = 11, /*[CR]*/ /* from here on: new in Unicode 5.1/ICU 4.0 */
+ U_SB_EXTEND = 12, /*[EX]*/
+ U_SB_LF = 13, /*[LF]*/
+ U_SB_SCONTINUE = 14, /*[SC]*/
+ U_SB_COUNT = 15
+} USentenceBreak;
+
+/**
* Line Break constants.
*
* @see UCHAR_LINE_BREAK
* @stable ICU 2.2
*/
typedef enum ULineBreak {
- U_LB_UNKNOWN, /*[XX]*/ /*See note !!*/
- U_LB_AMBIGUOUS, /*[AI]*/
- U_LB_ALPHABETIC, /*[AL]*/
- U_LB_BREAK_BOTH, /*[B2]*/
- U_LB_BREAK_AFTER, /*[BA]*/
- U_LB_BREAK_BEFORE, /*[BB]*/
- U_LB_MANDATORY_BREAK, /*[BK]*/
- U_LB_CONTINGENT_BREAK, /*[CB]*/
- U_LB_CLOSE_PUNCTUATION, /*[CL]*/
- U_LB_COMBINING_MARK, /*[CM]*/
- U_LB_CARRIAGE_RETURN, /*[CR]*/
- U_LB_EXCLAMATION, /*[EX]*/
- U_LB_GLUE, /*[GL]*/
- U_LB_HYPHEN, /*[HY]*/
- U_LB_IDEOGRAPHIC, /*[ID]*/
- U_LB_INSEPERABLE,
- /** Renamed from the misspelled "inseperable" in Unicode 4.0.1/ICU 3.0 @draft ICU 3.0 */
+ U_LB_UNKNOWN = 0, /*[XX]*/ /*See note !!*/
+ U_LB_AMBIGUOUS = 1, /*[AI]*/
+ U_LB_ALPHABETIC = 2, /*[AL]*/
+ U_LB_BREAK_BOTH = 3, /*[B2]*/
+ U_LB_BREAK_AFTER = 4, /*[BA]*/
+ U_LB_BREAK_BEFORE = 5, /*[BB]*/
+ U_LB_MANDATORY_BREAK = 6, /*[BK]*/
+ U_LB_CONTINGENT_BREAK = 7, /*[CB]*/
+ U_LB_CLOSE_PUNCTUATION = 8, /*[CL]*/
+ U_LB_COMBINING_MARK = 9, /*[CM]*/
+ U_LB_CARRIAGE_RETURN = 10, /*[CR]*/
+ U_LB_EXCLAMATION = 11, /*[EX]*/
+ U_LB_GLUE = 12, /*[GL]*/
+ U_LB_HYPHEN = 13, /*[HY]*/
+ U_LB_IDEOGRAPHIC = 14, /*[ID]*/
+ U_LB_INSEPERABLE = 15,
+ /** Renamed from the misspelled "inseperable" in Unicode 4.0.1/ICU 3.0 @stable ICU 3.0 */
U_LB_INSEPARABLE=U_LB_INSEPERABLE,/*[IN]*/
- U_LB_INFIX_NUMERIC, /*[IS]*/
- U_LB_LINE_FEED, /*[LF]*/
- U_LB_NONSTARTER, /*[NS]*/
- U_LB_NUMERIC, /*[NU]*/
- U_LB_OPEN_PUNCTUATION, /*[OP]*/
- U_LB_POSTFIX_NUMERIC, /*[PO]*/
- U_LB_PREFIX_NUMERIC, /*[PR]*/
- U_LB_QUOTATION, /*[QU]*/
- U_LB_COMPLEX_CONTEXT, /*[SA]*/
- U_LB_SURROGATE, /*[SG]*/
- U_LB_SPACE, /*[SP]*/
- U_LB_BREAK_SYMBOLS, /*[SY]*/
- U_LB_ZWSPACE, /*[ZW]*/
- U_LB_NEXT_LINE, /*[NL]*/ /* from here on: new in Unicode 4/ICU 2.6 */
- U_LB_WORD_JOINER, /*[WJ]*/
- U_LB_COUNT
+ U_LB_INFIX_NUMERIC = 16, /*[IS]*/
+ U_LB_LINE_FEED = 17, /*[LF]*/
+ U_LB_NONSTARTER = 18, /*[NS]*/
+ U_LB_NUMERIC = 19, /*[NU]*/
+ U_LB_OPEN_PUNCTUATION = 20, /*[OP]*/
+ U_LB_POSTFIX_NUMERIC = 21, /*[PO]*/
+ U_LB_PREFIX_NUMERIC = 22, /*[PR]*/
+ U_LB_QUOTATION = 23, /*[QU]*/
+ U_LB_COMPLEX_CONTEXT = 24, /*[SA]*/
+ U_LB_SURROGATE = 25, /*[SG]*/
+ U_LB_SPACE = 26, /*[SP]*/
+ U_LB_BREAK_SYMBOLS = 27, /*[SY]*/
+ U_LB_ZWSPACE = 28, /*[ZW]*/
+ U_LB_NEXT_LINE = 29, /*[NL]*/ /* from here on: new in Unicode 4/ICU 2.6 */
+ U_LB_WORD_JOINER = 30, /*[WJ]*/
+ U_LB_H2 = 31, /*[H2]*/ /* from here on: new in Unicode 4.1/ICU 3.4 */
+ U_LB_H3 = 32, /*[H3]*/
+ U_LB_JL = 33, /*[JL]*/
+ U_LB_JT = 34, /*[JT]*/
+ U_LB_JV = 35, /*[JV]*/
+ U_LB_CLOSE_PARENTHESIS = 36, /*[CP]*/ /* new in Unicode 5.2/ICU 4.4 */
+ U_LB_COUNT = 37
} ULineBreak;
/**
@@ -1606,7 +1950,6 @@ u_getNumericValue(UChar32 c);
* @see UCHAR_LOWERCASE
* @see u_isupper
* @see u_istitle
- * @see u_islower
* @stable ICU 2.0
*/
U_STABLE UBool U_EXPORT2
@@ -1878,8 +2221,8 @@ u_isJavaSpaceChar(UChar32 c);
* A character is considered to be a Java whitespace character if and only
* if it satisfies one of the following criteria:
*
- * - It is a Unicode separator (categories "Z"), but is not
- * a no-break space (U+00A0 NBSP or U+2007 Figure Space or U+202F Narrow NBSP).
+ * - It is a Unicode Separator character (categories "Z" = "Zs" or "Zl" or "Zp"), but is not
+ * also a non-breaking space (U+00A0 NBSP or U+2007 Figure Space or U+202F Narrow NBSP).
* - It is U+0009 HORIZONTAL TABULATION.
* - It is U+000A LINE FEED.
* - It is U+000B VERTICAL TABULATION.
@@ -1889,9 +2232,15 @@ u_isJavaSpaceChar(UChar32 c);
* - It is U+001D GROUP SEPARATOR.
* - It is U+001E RECORD SEPARATOR.
* - It is U+001F UNIT SEPARATOR.
- * - It is U+0085 NEXT LINE.
*
- * Same as java.lang.Character.isWhitespace() except that Java omits U+0085.
+ * This API tries to sync with the semantics of Java's
+ * java.lang.Character.isWhitespace(), but it may not return
+ * the exact same results because of the Unicode version
+ * difference.
+ *
+ * Note: Unicode 4.0.1 changed U+200B ZERO WIDTH SPACE from a Space Separator (Zs)
+ * to a Format Control (Cf). Since then, isWhitespace(0x200b) returns false.
+ * See http://www.unicode.org/versions/Unicode4.0.1/
*
* Note: There are several ICU whitespace functions; please see the uchar.h
* file documentation for a detailed comparison.
@@ -2209,6 +2558,9 @@ u_charName(UChar32 code, UCharNameChoice nameChoice,
* The ISO 10646 comment is an informative field in the Unicode Character
* Database (UnicodeData.txt field 11) and is from the ISO 10646 names list.
*
+ * Note: Unicode 5.2 removes all ISO comment data, resulting in empty strings
+ * returned for all characters.
+ *
* @param c The character (code point) for which to get the ISO comment.
* It must be <code>0<=c<=0x10ffff</code>.
* @param dest Destination address for copying the comment.
@@ -2273,7 +2625,7 @@ u_charFromName(UCharNameChoice nameChoice,
* @see u_enumCharNames
* @stable ICU 1.7
*/
-typedef UBool UEnumCharNamesFn(void *context,
+typedef UBool U_CALLCONV UEnumCharNamesFn(void *context,
UChar32 code,
UCharNameChoice nameChoice,
const char *name,
@@ -2439,7 +2791,7 @@ u_getPropertyValueName(UProperty property,
*
* @return a value integer or UCHAR_INVALID_CODE if the given name
* does not match any value of the given property, or if the
- * property is invalid. Note: U CHAR_GENERAL_CATEGORY values
+ * property is invalid. Note: UCHAR_GENERAL_CATEGORY_MASK values
* are not values of UCharCategory, but rather mask values
* produced by U_GET_GC_MASK(). This allows grouped
* categories such as [:L:] to be represented.
@@ -2501,11 +2853,9 @@ u_isIDPart(UChar32 c);
* according to Java.
* True for characters with general category "Cf" (format controls) as well as
* non-whitespace ISO controls
- * (U+0000..U+0008, U+000E..U+001B, U+007F..U+0084, U+0086..U+009F).
+ * (U+0000..U+0008, U+000E..U+001B, U+007F..U+009F).
*
- * Same as java.lang.Character.isIdentifierIgnorable()
- * except that Java also returns TRUE for U+0085 Next Line
- * (it omits U+0085 from whitespace ISO controls).
+ * Same as java.lang.Character.isIdentifierIgnorable().
*
* Note that Unicode just recommends to ignore Cf (format controls).
*
@@ -2568,10 +2918,14 @@ u_isJavaIDPart(UChar32 c);
* Same as java.lang.Character.toLowerCase().
*
* This function only returns the simple, single-code point case mapping.
- * Full case mappings may result in zero, one or more code points and depend
- * on context or language etc.
+ * Full case mappings should be used whenever possible because they produce
+ * better results by working on whole strings.
+ * They take into account the string context and the language and can map
+ * to a result string with a different length as appropriate.
* Full case mappings are applied by the string case mapping functions,
* see ustring.h and the UnicodeString class.
+ * See also the User Guide chapter on C/POSIX migration:
+ * http://icu-project.org/userguide/posix.html#case_mappings
*
* @param c the code point to be mapped
* @return the Simple_Lowercase_Mapping of the code point, if any;
@@ -2589,10 +2943,14 @@ u_tolower(UChar32 c);
* Same as java.lang.Character.toUpperCase().
*
* This function only returns the simple, single-code point case mapping.
- * Full case mappings may result in zero, one or more code points and depend
- * on context or language etc.
+ * Full case mappings should be used whenever possible because they produce
+ * better results by working on whole strings.
+ * They take into account the string context and the language and can map
+ * to a result string with a different length as appropriate.
* Full case mappings are applied by the string case mapping functions,
* see ustring.h and the UnicodeString class.
+ * See also the User Guide chapter on C/POSIX migration:
+ * http://icu-project.org/userguide/posix.html#case_mappings
*
* @param c the code point to be mapped
* @return the Simple_Uppercase_Mapping of the code point, if any;
@@ -2610,10 +2968,14 @@ u_toupper(UChar32 c);
* Same as java.lang.Character.toTitleCase().
*
* This function only returns the simple, single-code point case mapping.
- * Full case mappings may result in zero, one or more code points and depend
- * on context or language etc.
+ * Full case mappings should be used whenever possible because they produce
+ * better results by working on whole strings.
+ * They take into account the string context and the language and can map
+ * to a result string with a different length as appropriate.
* Full case mappings are applied by the string case mapping functions,
* see ustring.h and the UnicodeString class.
+ * See also the User Guide chapter on C/POSIX migration:
+ * http://icu-project.org/userguide/posix.html#case_mappings
*
* @param c the code point to be mapped
* @return the Simple_Titlecase_Mapping of the code point, if any;
@@ -2651,10 +3013,14 @@ u_totitle(UChar32 c);
* itself is returned.
*
* This function only returns the simple, single-code point case mapping.
- * Full case mappings may result in zero, one or more code points and depend
- * on context or language etc.
+ * Full case mappings should be used whenever possible because they produce
+ * better results by working on whole strings.
+ * They take into account the string context and the language and can map
+ * to a result string with a different length as appropriate.
* Full case mappings are applied by the string case mapping functions,
* see ustring.h and the UnicodeString class.
+ * See also the User Guide chapter on C/POSIX migration:
+ * http://icu-project.org/userguide/posix.html#case_mappings
*
* @param c the code point to be mapped
* @param options Either U_FOLD_CASE_DEFAULT or U_FOLD_CASE_EXCLUDE_SPECIAL_I
@@ -2768,6 +3134,7 @@ u_charAge(UChar32 c, UVersionInfo versionArray);
U_STABLE void U_EXPORT2
u_getUnicodeVersion(UVersionInfo versionArray);
+#if !UCONFIG_NO_NORMALIZATION
/**
* Get the FC_NFKC_Closure property string for a character.
* See Unicode Standard Annex #15 for details, search for "FC_NFKC_Closure"
@@ -2792,6 +3159,9 @@ u_getUnicodeVersion(UVersionInfo versionArray);
U_STABLE int32_t U_EXPORT2
u_getFC_NFKC_Closure(UChar32 c, UChar *dest, int32_t destCapacity, UErrorCode *pErrorCode);
+#endif
+
+
U_CDECL_END
#endif /*_UCHAR*/
diff --git a/Source/JavaScriptCore/icu/unicode/ucnv.h b/Source/JavaScriptCore/icu/unicode/ucnv.h
index a042f7abd..98da8ff69 100644
--- a/Source/JavaScriptCore/icu/unicode/ucnv.h
+++ b/Source/JavaScriptCore/icu/unicode/ucnv.h
@@ -1,6 +1,6 @@
/*
**********************************************************************
-* Copyright (C) 1999-2004, International Business Machines
+* Copyright (C) 1999-2010, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* ucnv.h:
@@ -35,12 +35,12 @@
*
* <p>When a converter encounters an illegal, irregular, invalid or unmappable character
* its default behavior is to use a substitution character to replace the
- * bad byte sequence. This behavior can be changed by using {@link ucnv_getFromUCallBack() }
- * or {@link ucnv_getToUCallBack() } on the converter. The header ucnv_err.h defines
+ * bad byte sequence. This behavior can be changed by using {@link ucnv_setFromUCallBack() }
+ * or {@link ucnv_setToUCallBack() } on the converter. The header ucnv_err.h defines
* many other callback actions that can be used instead of a character substitution.</p>
*
* <p>More information about this API can be found in our
- * <a href="http://oss.software.ibm.com/icu/userguide/conversion.html">User's
+ * <a href="http://icu-project.org/userguide/conversion.html">User's
* Guide</a>.</p>
*/
@@ -49,6 +49,7 @@
#include "unicode/ucnv_err.h"
#include "unicode/uenum.h"
+#include "unicode/localpointer.h"
#ifndef __USET_H__
@@ -151,6 +152,9 @@ typedef enum {
* @param codeUnits Points to 'length' bytes of the concerned codepage sequence
* @param length Size (in bytes) of the concerned codepage sequence
* @param reason Defines the reason the callback was invoked
+ * @param pErrorCode ICU error code in/out parameter.
+ * For converter callback functions, set to a conversion error
+ * before the call, and the callback may reset it to U_ZERO_ERROR.
* @see ucnv_setToUCallBack
* @see UConverterToUnicodeArgs
* @stable ICU 2.0
@@ -161,7 +165,7 @@ typedef void (U_EXPORT2 *UConverterToUCallback) (
const char *codeUnits,
int32_t length,
UConverterCallbackReason reason,
- UErrorCode *);
+ UErrorCode *pErrorCode);
/**
* Function pointer for error callback in the unicode to codepage direction.
@@ -172,6 +176,9 @@ typedef void (U_EXPORT2 *UConverterToUCallback) (
* @param length Size (in bytes) of the concerned codepage sequence
* @param codePoint Single UChar32 (UTF-32) containing the concerend Unicode codepoint.
* @param reason Defines the reason the callback was invoked
+ * @param pErrorCode ICU error code in/out parameter.
+ * For converter callback functions, set to a conversion error
+ * before the call, and the callback may reset it to U_ZERO_ERROR.
* @see ucnv_setFromUCallBack
* @stable ICU 2.0
*/
@@ -182,7 +189,7 @@ typedef void (U_EXPORT2 *UConverterFromUCallback) (
int32_t length,
UChar32 codePoint,
UConverterCallbackReason reason,
- UErrorCode *);
+ UErrorCode *pErrorCode);
U_CDECL_END
@@ -226,7 +233,10 @@ U_CDECL_END
/**
* Converter option for specifying a version selector (0..9) for some converters.
- * For example, ucnv_open("UTF-7,version=1", &errorCode);
+ * For example,
+ * \code
+ * ucnv_open("UTF-7,version=1", &errorCode);
+ * \endcode
* See convrtrs.txt.
*
* @see ucnv_open
@@ -247,11 +257,13 @@ U_CDECL_END
#define UCNV_SWAP_LFNL_OPTION_STRING ",swaplfnl"
/**
- * Do a fuzzy compare of a two converter/alias names. The comparison
- * is case-insensitive. It also ignores the characters '-', '_', and
- * ' ' (dash, underscore, and space). Thus the strings "UTF-8",
- * "utf_8", and "Utf 8" are exactly equivalent.
- *
+ * Do a fuzzy compare of two converter/alias names.
+ * The comparison is case-insensitive, ignores leading zeroes if they are not
+ * followed by further digits, and ignores all but letters and digits.
+ * Thus the strings "UTF-8", "utf_8", "u*T@f08" and "Utf 8" are exactly equivalent.
+ * See section 1.4, Charset Alias Matching in Unicode Technical Standard #22
+ * at http://www.unicode.org/reports/tr22/
+ *
* @param name1 a converter name or alias, zero-terminated
* @param name2 a converter name or alias, zero-terminated
* @return 0 if the names match, or a negative value if the name1
@@ -264,11 +276,12 @@ ucnv_compareNames(const char *name1, const char *name2);
/**
- * Creates a UConverter object with the names specified as a C string.
+ * Creates a UConverter object with the name of a coded character set specified as a C string.
* The actual name will be resolved with the alias file
* using a case-insensitive string comparison that ignores
- * the delimiters '-', '_', and ' ' (dash, underscore, and space).
- * E.g., the names "UTF8", "utf-8", and "Utf 8" are all equivalent.
+ * leading zeroes and all non-alphanumeric characters.
+ * E.g., the names "UTF8", "utf-8", "u*T@f08" and "Utf 8" are all equivalent.
+ * (See also ucnv_compareNames().)
* If <code>NULL</code> is passed for the converter name, it will create one with the
* getDefaultName return value.
*
@@ -287,15 +300,27 @@ ucnv_compareNames(const char *name1, const char *name2);
*
* <p>The conversion behavior and names can vary between platforms. ICU may
* convert some characters differently from other platforms. Details on this topic
- * are in the <a href="http://oss.software.ibm.com/icu/userguide/conversion.html">User's
- * Guide</a>.</p>
- *
- * @param converterName Name of the uconv table, may have options appended
+ * are in the <a href="http://icu-project.org/userguide/conversion.html">User's
+ * Guide</a>. Aliases starting with a "cp" prefix have no specific meaning
+ * other than its an alias starting with the letters "cp". Please do not
+ * associate any meaning to these aliases.</p>
+ *
+ * @param converterName Name of the coded character set table.
+ * This may have options appended to the string.
+ * IANA alias character set names, IBM CCSIDs starting with "ibm-",
+ * Windows codepage numbers starting with "windows-" are frequently
+ * used for this parameter. See ucnv_getAvailableName and
+ * ucnv_getAlias for a complete list that is available.
+ * If this parameter is NULL, the default converter will be used.
* @param err outgoing error status <TT>U_MEMORY_ALLOCATION_ERROR, U_FILE_ACCESS_ERROR</TT>
* @return the created Unicode converter object, or <TT>NULL</TT> if an error occured
* @see ucnv_openU
* @see ucnv_openCCSID
+ * @see ucnv_getAvailableName
+ * @see ucnv_getAlias
+ * @see ucnv_getDefaultName
* @see ucnv_close
+ * @see ucnv_compareNames
* @stable ICU 2.0
*/
U_STABLE UConverter* U_EXPORT2
@@ -307,13 +332,16 @@ ucnv_open(const char *converterName, UErrorCode *err);
* The name should be limited to the ASCII-7 alphanumerics range.
* The actual name will be resolved with the alias file
* using a case-insensitive string comparison that ignores
- * the delimiters '-', '_', and ' ' (dash, underscore, and space).
- * E.g., the names "UTF8", "utf-8", and "Utf 8" are all equivalent.
+ * leading zeroes and all non-alphanumeric characters.
+ * E.g., the names "UTF8", "utf-8", "u*T@f08" and "Utf 8" are all equivalent.
+ * (See also ucnv_compareNames().)
* If <TT>NULL</TT> is passed for the converter name, it will create
* one with the ucnv_getDefaultName() return value.
* If the alias is ambiguous, then the preferred converter is used
* and the status is set to U_AMBIGUOUS_ALIAS_WARNING.
- * @param name : name of the uconv table in a zero terminated
+ *
+ * <p>See ucnv_open for the complete details</p>
+ * @param name Name of the UConverter table in a zero terminated
* Unicode string
* @param err outgoing error status <TT>U_MEMORY_ALLOCATION_ERROR,
* U_FILE_ACCESS_ERROR</TT>
@@ -322,7 +350,7 @@ ucnv_open(const char *converterName, UErrorCode *err);
* @see ucnv_open
* @see ucnv_openCCSID
* @see ucnv_close
- * @see ucnv_getDefaultName
+ * @see ucnv_compareNames
* @stable ICU 2.0
*/
U_STABLE UConverter* U_EXPORT2
@@ -404,7 +432,7 @@ ucnv_openCCSID(int32_t codepage,
* <p>The packageName and converterName must point to an ICU udata object, as defined by
* <code> udata_open( packageName, "cnv", converterName, err) </code> or equivalent.
* Typically, packageName will refer to a (.dat) file, or to a package registered with
- * udata_setAppData().</p>
+ * udata_setAppData(). Using a full file or directory pathname for packageName is deprecated.</p>
*
* <p>The name will NOT be looked up in the alias mechanism, nor will the converter be
* stored in the converter cache or the alias table. The only way to open further converters
@@ -432,18 +460,39 @@ U_STABLE UConverter* U_EXPORT2
ucnv_openPackage(const char *packageName, const char *converterName, UErrorCode *err);
/**
- * Thread safe cloning operation
+ * Thread safe converter cloning operation.
+ * For most efficient operation, pass in a stackBuffer (and a *pBufferSize)
+ * with at least U_CNV_SAFECLONE_BUFFERSIZE bytes of space.
+ * If the buffer size is sufficient, then the clone will use the stack buffer;
+ * otherwise, it will be allocated, and *pBufferSize will indicate
+ * the actual size. (This should not occur with U_CNV_SAFECLONE_BUFFERSIZE.)
+ *
+ * You must ucnv_close() the clone in any case.
+ *
+ * If *pBufferSize==0, (regardless of whether stackBuffer==NULL or not)
+ * then *pBufferSize will be changed to a sufficient size
+ * for cloning this converter,
+ * without actually cloning the converter ("pure pre-flighting").
+ *
+ * If *pBufferSize is greater than zero but not large enough for a stack-based
+ * clone, then the converter is cloned using newly allocated memory
+ * and *pBufferSize is changed to the necessary size.
+ *
+ * If the converter clone fits into the stack buffer but the stack buffer is not
+ * sufficiently aligned for the clone, then the clone will use an
+ * adjusted pointer and use an accordingly smaller buffer size.
+ *
* @param cnv converter to be cloned
* @param stackBuffer user allocated space for the new clone. If NULL new memory will be allocated.
* If buffer is not large enough, new memory will be allocated.
* Clients can use the U_CNV_SAFECLONE_BUFFERSIZE. This will probably be enough to avoid memory allocations.
- * @param pBufferSize pointer to size of allocated space.
- * If *pBufferSize == 0, a sufficient size for use in cloning will
- * be returned ('pre-flighting')
- * If *pBufferSize is not enough for a stack-based safe clone,
- * new memory will be allocated.
+ * @param pBufferSize pointer to size of allocated space. pBufferSize must not be NULL.
* @param status to indicate whether the operation went on smoothly or there were errors
- * An informational status value, U_SAFECLONE_ALLOCATED_ERROR, is used if any allocations were necessary.
+ * An informational status value, U_SAFECLONE_ALLOCATED_WARNING,
+ * is used if any allocations were necessary.
+ * However, it is better to check if *pBufferSize grew for checking for
+ * allocations because warning codes can be overridden by subsequent
+ * function calls.
* @return pointer to the new clone
* @stable ICU 2.0
*/
@@ -475,9 +524,30 @@ ucnv_safeClone(const UConverter *cnv,
U_STABLE void U_EXPORT2
ucnv_close(UConverter * converter);
+#if U_SHOW_CPLUSPLUS_API
+
+U_NAMESPACE_BEGIN
+
+/**
+ * \class LocalUConverterPointer
+ * "Smart pointer" class, closes a UConverter via ucnv_close().
+ * For most methods see the LocalPointerBase base class.
+ *
+ * @see LocalPointerBase
+ * @see LocalPointer
+ * @stable ICU 4.4
+ */
+U_DEFINE_LOCAL_OPEN_POINTER(LocalUConverterPointer, UConverter, ucnv_close);
+
+U_NAMESPACE_END
+
+#endif
+
/**
* Fills in the output parameter, subChars, with the substitution characters
* as multiple bytes.
+ * If ucnv_setSubstString() set a Unicode string because the converter is
+ * stateful, then subChars will be an empty string.
*
* @param converter the Unicode converter
* @param subChars the subsitution characters
@@ -486,6 +556,7 @@ ucnv_close(UConverter * converter);
* @param err the outgoing error status code.
* If the substitution character array is too small, an
* <TT>U_INDEX_OUTOFBOUNDS_ERROR</TT> will be returned.
+ * @see ucnv_setSubstString
* @see ucnv_setSubstChars
* @stable ICU 2.0
*/
@@ -498,12 +569,19 @@ ucnv_getSubstChars(const UConverter *converter,
/**
* Sets the substitution chars when converting from unicode to a codepage. The
* substitution is specified as a string of 1-4 bytes, and may contain
- * <TT>NULL</TT> byte.
+ * <TT>NULL</TT> bytes.
+ * The subChars must represent a single character. The caller needs to know the
+ * byte sequence of a valid character in the converter's charset.
+ * For some converters, for example some ISO 2022 variants, only single-byte
+ * substitution characters may be supported.
+ * The newer ucnv_setSubstString() function relaxes these limitations.
+ *
* @param converter the Unicode converter
* @param subChars the substitution character byte sequence we want set
* @param len the number of bytes in subChars
* @param err the error status code. <TT>U_INDEX_OUTOFBOUNDS_ERROR </TT> if
* len is bigger than the maximum number of bytes allowed in subchars
+ * @see ucnv_setSubstString
* @see ucnv_getSubstChars
* @stable ICU 2.0
*/
@@ -514,6 +592,39 @@ ucnv_setSubstChars(UConverter *converter,
UErrorCode *err);
/**
+ * Set a substitution string for converting from Unicode to a charset.
+ * The caller need not know the charset byte sequence for each charset.
+ *
+ * Unlike ucnv_setSubstChars() which is designed to set a charset byte sequence
+ * for a single character, this function takes a Unicode string with
+ * zero, one or more characters, and immediately verifies that the string can be
+ * converted to the charset.
+ * If not, or if the result is too long (more than 32 bytes as of ICU 3.6),
+ * then the function returns with an error accordingly.
+ *
+ * Also unlike ucnv_setSubstChars(), this function works for stateful charsets
+ * by converting on the fly at the point of substitution rather than setting
+ * a fixed byte sequence.
+ *
+ * @param cnv The UConverter object.
+ * @param s The Unicode string.
+ * @param length The number of UChars in s, or -1 for a NUL-terminated string.
+ * @param err Pointer to a standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ *
+ * @see ucnv_setSubstChars
+ * @see ucnv_getSubstChars
+ * @stable ICU 3.6
+ */
+U_STABLE void U_EXPORT2
+ucnv_setSubstString(UConverter *cnv,
+ const UChar *s,
+ int32_t length,
+ UErrorCode *err);
+
+/**
* Fills in the output parameter, errBytes, with the error characters from the
* last failing conversion.
*
@@ -634,8 +745,6 @@ ucnv_resetFromUnicode(UConverter *converter);
U_STABLE int8_t U_EXPORT2
ucnv_getMaxCharSize(const UConverter *converter);
-#ifndef U_HIDE_DRAFT_API
-
/**
* Calculates the size of a buffer for conversion from Unicode to a charset.
* The calculated size is guaranteed to be sufficient for this conversion.
@@ -653,13 +762,11 @@ ucnv_getMaxCharSize(const UConverter *converter);
* converting length UChars with the converter that returned the maxCharSize.
*
* @see ucnv_getMaxCharSize
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
#define UCNV_GET_MAX_BYTES_FOR_STRING(length, maxCharSize) \
(((int32_t)(length)+10)*(int32_t)(maxCharSize))
-#endif /*U_HIDE_DRAFT_API*/
-
/**
* Returns the minimum byte length for characters in this codepage.
* This is usually either 1 or 2.
@@ -786,6 +893,8 @@ ucnv_getStarters(const UConverter* converter,
typedef enum UConverterUnicodeSet {
/** Select the set of roundtrippable Unicode code points. @stable ICU 2.6 */
UCNV_ROUNDTRIP_SET,
+ /** Select the set of Unicode code points with roundtrip or fallback mappings. @stable ICU 4.0 */
+ UCNV_ROUNDTRIP_AND_FALLBACK_SET,
/** Number of UConverterUnicodeSet selectors. @stable ICU 2.6 */
UCNV_SET_COUNT
} UConverterUnicodeSet;
@@ -794,11 +903,16 @@ typedef enum UConverterUnicodeSet {
/**
* Returns the set of Unicode code points that can be converted by an ICU converter.
*
- * The current implementation returns only one kind of set (UCNV_ROUNDTRIP_SET):
+ * Returns one of several kinds of set:
+ *
+ * 1. UCNV_ROUNDTRIP_SET
+ *
* The set of all Unicode code points that can be roundtrip-converted
- * (converted without any data loss) with the converter.
+ * (converted without any data loss) with the converter (ucnv_fromUnicode()).
* This set will not include code points that have fallback mappings
* or are only the result of reverse fallback mappings.
+ * This set will also not include PUA code points with fallbacks, although
+ * ucnv_fromUnicode() will always uses those mappings despite ucnv_setFallback().
* See UTR #22 "Character Mapping Markup Language"
* at http://www.unicode.org/reports/tr22/
*
@@ -809,6 +923,12 @@ typedef enum UConverterUnicodeSet {
* by comparing its roundtrip set with the set of ExemplarCharacters from
* ICU's locale data or other sources
*
+ * 2. UCNV_ROUNDTRIP_AND_FALLBACK_SET
+ *
+ * The set of all Unicode code points that can be converted with the converter (ucnv_fromUnicode())
+ * when fallbacks are turned on (see ucnv_setFallback()).
+ * This set includes all code points with roundtrips and fallbacks (but not reverse fallbacks).
+ *
* In the future, there may be more UConverterUnicodeSet choices to select
* sets with different properties.
*
@@ -1192,6 +1312,12 @@ ucnv_getNextUChar(UConverter * converter,
* Internally, two conversions - ucnv_toUnicode() and ucnv_fromUnicode() -
* are used, "pivoting" through 16-bit Unicode.
*
+ * Important: For streaming conversion (multiple function calls for successive
+ * parts of a text stream), the caller must provide a pivot buffer explicitly,
+ * and must preserve the pivot buffer and associated pointers from one
+ * call to another. (The buffer may be moved if its contents and the relative
+ * pointer positions are preserved.)
+ *
* There is a similar function, ucnv_convert(),
* which has the following limitations:
* - it takes charset names, not converter objects, so that
@@ -1203,7 +1329,7 @@ ucnv_getNextUChar(UConverter * converter,
*
* By contrast, ucnv_convertEx()
* - takes UConverter parameters instead of charset names
- * - fully exposes the pivot buffer for complete error handling
+ * - fully exposes the pivot buffer for streaming conversion and complete error handling
*
* ucnv_convertEx() also provides further convenience:
* - an option to reset the converters at the beginning
@@ -1217,6 +1343,7 @@ ucnv_getNextUChar(UConverter * converter,
* or set U_STRING_NOT_TERMINATED_WARNING if the output exactly fills
* the target buffer
* - the pivot buffer can be provided internally;
+ * possible only for whole-string conversion, not streaming conversion;
* in this case, the caller will not be able to get details about where an
* error occurred
* (if pivotStart==NULL, see below)
@@ -1255,10 +1382,13 @@ ucnv_getNextUChar(UConverter * converter,
* return 0;
* }
*
+ * if(length<0) {
+ * length=strlen(s);
+ * }
* target=u8;
- * ucnv_convertEx(cnv, utf8Cnv,
+ * ucnv_convertEx(utf8Cnv, cnv,
* &target, u8+capacity,
- * &s, length>=0 ? s+length : NULL,
+ * &s, s+length,
* NULL, NULL, NULL, NULL,
* TRUE, TRUE,
* pErrorCode);
@@ -1675,11 +1805,15 @@ U_STABLE const char * U_EXPORT2
ucnv_getCanonicalName(const char *alias, const char *standard, UErrorCode *pErrorCode);
/**
- * returns the current default converter name.
+ * Returns the current default converter name. If you want to open
+ * a default converter, you do not need to use this function.
+ * It is faster if you pass a NULL argument to ucnv_open the
+ * default converter.
*
- * @return returns the current default converter name;
- * if a default converter name cannot be determined,
- * then <code>NULL</code> is returned.
+ * If U_CHARSET_IS_UTF8 is defined to 1 in utypes.h then this function
+ * always returns "UTF-8".
+ *
+ * @return returns the current default converter name.
* Storage owned by the library
* @see ucnv_setDefaultName
* @stable ICU 2.0
@@ -1688,11 +1822,19 @@ U_STABLE const char * U_EXPORT2
ucnv_getDefaultName(void);
/**
- * sets the current default converter name. Caller must own the storage for 'name'
- * and preserve it indefinitely.
- * @param name the converter name to be the default (must exist).
+ * This function is not thread safe. DO NOT call this function when ANY ICU
+ * function is being used from more than one thread! This function sets the
+ * current default converter name. If this function needs to be called, it
+ * should be called during application initialization. Most of the time, the
+ * results from ucnv_getDefaultName() or ucnv_open with a NULL string argument
+ * is sufficient for your application.
+ *
+ * If U_CHARSET_IS_UTF8 is defined to 1 in utypes.h then this function
+ * does nothing.
+ *
+ * @param name the converter name to be the default (must be known by ICU).
* @see ucnv_getDefaultName
- * @system SYSTEM API
+ * @system
* @stable ICU 2.0
*/
U_STABLE void U_EXPORT2
@@ -1730,20 +1872,31 @@ U_STABLE UBool U_EXPORT2
ucnv_isAmbiguous(const UConverter *cnv);
/**
- * Sets the converter to use fallback mapping or not.
+ * Sets the converter to use fallback mappings or not.
+ * Regardless of this flag, the converter will always use
+ * fallbacks from Unicode Private Use code points, as well as
+ * reverse fallbacks (to Unicode).
+ * For details see ".ucm File Format"
+ * in the Conversion Data chapter of the ICU User Guide:
+ * http://www.icu-project.org/userguide/conversion-data.html#ucmformat
+ *
* @param cnv The converter to set the fallback mapping usage on.
* @param usesFallback TRUE if the user wants the converter to take advantage of the fallback
* mapping, FALSE otherwise.
* @stable ICU 2.0
+ * @see ucnv_usesFallback
*/
U_STABLE void U_EXPORT2
ucnv_setFallback(UConverter *cnv, UBool usesFallback);
/**
* Determines if the converter uses fallback mappings or not.
+ * This flag has restrictions, see ucnv_setFallback().
+ *
* @param cnv The converter to be tested
* @return TRUE if the converter uses fallback, FALSE otherwise.
* @stable ICU 2.0
+ * @see ucnv_setFallback
*/
U_STABLE UBool U_EXPORT2
ucnv_usesFallback(const UConverter *cnv);
@@ -1769,7 +1922,7 @@ ucnv_usesFallback(const UConverter *cnv);
* UErrorCode err = U_ZERO_ERROR;
* char input[] = { '\xEF','\xBB', '\xBF','\x41','\x42','\x43' };
* int32_t signatureLength = 0;
- * char *encoding = ucnv_detectUnicodeSignatures(input,sizeof(input),&signatureLength,&err);
+ * char *encoding = ucnv_detectUnicodeSignature(input,sizeof(input),&signatureLength,&err);
* UConverter *conv = NULL;
* UChar output[100];
* UChar *target = output, *out;
@@ -1799,9 +1952,8 @@ ucnv_usesFallback(const UConverter *cnv);
* @param signatureLength A pointer to int32_t to receive the number of bytes that make up the signature
* of the detected UTF. 0 if not detected.
* Can be a NULL pointer.
- * @param pErrorCode A pointer to receive information about any errors that may occur during detection.
- * Must be a valid pointer to an error code value, which must not indicate a failure
- * before the function call.
+ * @param pErrorCode ICU error code in/out parameter.
+ * Must fulfill U_SUCCESS before the function call.
* @return The name of the encoding detected. NULL if encoding is not detected.
* @stable ICU 2.4
*/
@@ -1811,6 +1963,34 @@ ucnv_detectUnicodeSignature(const char* source,
int32_t *signatureLength,
UErrorCode *pErrorCode);
+/**
+ * Returns the number of UChars held in the converter's internal state
+ * because more input is needed for completing the conversion. This function is
+ * useful for mapping semantics of ICU's converter interface to those of iconv,
+ * and this information is not needed for normal conversion.
+ * @param cnv The converter in which the input is held
+ * @param status ICU error code in/out parameter.
+ * Must fulfill U_SUCCESS before the function call.
+ * @return The number of UChars in the state. -1 if an error is encountered.
+ * @stable ICU 3.4
+ */
+U_STABLE int32_t U_EXPORT2
+ucnv_fromUCountPending(const UConverter* cnv, UErrorCode* status);
+
+/**
+ * Returns the number of chars held in the converter's internal state
+ * because more input is needed for completing the conversion. This function is
+ * useful for mapping semantics of ICU's converter interface to those of iconv,
+ * and this information is not needed for normal conversion.
+ * @param cnv The converter in which the input is held as internal state
+ * @param status ICU error code in/out parameter.
+ * Must fulfill U_SUCCESS before the function call.
+ * @return The number of chars in the state. -1 if an error is encountered.
+ * @stable ICU 3.4
+ */
+U_STABLE int32_t U_EXPORT2
+ucnv_toUCountPending(const UConverter* cnv, UErrorCode* status);
+
#endif
#endif
diff --git a/Source/JavaScriptCore/icu/unicode/ucnv_err.h b/Source/JavaScriptCore/icu/unicode/ucnv_err.h
index 2a6104c7e..e092e95f8 100644
--- a/Source/JavaScriptCore/icu/unicode/ucnv_err.h
+++ b/Source/JavaScriptCore/icu/unicode/ucnv_err.h
@@ -1,6 +1,6 @@
/*
**********************************************************************
-* Copyright (C) 1999-2004, International Business Machines
+* Copyright (C) 1999-2009, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
*
@@ -122,23 +122,30 @@ typedef struct UConverter UConverter;
*/
#define UCNV_ESCAPE_C "C"
/**
- * FROM_U_CALLBACK_ESCAPE context option to escape the code unit according to XML Decimal escape (&amp;#DDDD;)
- * TO_U_CALLBACK_ESCAPE context option to escape the character value accoding to XML Decimal escape (&amp;#DDDD;)
+ * FROM_U_CALLBACK_ESCAPE context option to escape the code unit according to XML Decimal escape \htmlonly(&amp;#DDDD;)\endhtmlonly
+ * TO_U_CALLBACK_ESCAPE context option to escape the character value accoding to XML Decimal escape \htmlonly(&amp;#DDDD;)\endhtmlonly
* @stable ICU 2.0
*/
#define UCNV_ESCAPE_XML_DEC "D"
/**
- * FROM_U_CALLBACK_ESCAPE context option to escape the code unit according to XML Hex escape (&amp;#xXXXX;)
- * TO_U_CALLBACK_ESCAPE context option to escape the character value accoding to XML Hex escape (&amp;#xXXXX;)
+ * FROM_U_CALLBACK_ESCAPE context option to escape the code unit according to XML Hex escape \htmlonly(&amp;#xXXXX;)\endhtmlonly
+ * TO_U_CALLBACK_ESCAPE context option to escape the character value accoding to XML Hex escape \htmlonly(&amp;#xXXXX;)\endhtmlonly
* @stable ICU 2.0
*/
#define UCNV_ESCAPE_XML_HEX "X"
/**
- * FROM_U_CALLBACK_ESCAPE context option to escape teh code unit according to Unicode (U+XXXXX)
+ * FROM_U_CALLBACK_ESCAPE context option to escape the code unit according to Unicode (U+XXXXX)
* @stable ICU 2.0
*/
#define UCNV_ESCAPE_UNICODE "U"
+/**
+ * FROM_U_CALLBACK_ESCAPE context option to escape the code unit according to CSS2 conventions (\\HH..H<space>, that is,
+ * a backslash, 1..6 hex digits, and a space)
+ * @stable ICU 4.0
+ */
+#define UCNV_ESCAPE_CSS2 "S"
+
/**
* The process condition code to be used with the callbacks.
* Codes which are greater than UCNV_IRREGULAR should be
@@ -340,17 +347,17 @@ U_STABLE void U_EXPORT2 UCNV_FROM_U_CALLBACK_SUBSTITUTE (
* Note that codeUnit(32bit int eg: unit of a surrogate pair) is represented as
* \\U00023456</li>
* <li>UCNV_ESCAPE_XML_DEC: Substitues the ILLEGAL SEQUENCE with the decimal
- * representation in the format &amp;#DDDDDDDD;, e.g. "&amp;#65534;&amp;#172;&amp;#51454;").
+ * representation in the format \htmlonly&amp;#DDDDDDDD;, e.g. "&amp;#65534;&amp;#172;&amp;#51454;")\endhtmlonly.
* In the Event the converter doesn't support the characters {&amp;,#}[0-9],
* it will substitute the illegal sequence with the substitution characters.
* Note that codeUnit(32bit int eg: unit of a surrogate pair) is represented as
* &amp;#144470; and Zero padding is ignored.</li>
* <li>UCNV_ESCAPE_XML_HEX:Substitues the ILLEGAL SEQUENCE with the decimal
- * representation in the format &#xXXXX, e.g. "&amp;#xFFFE;&amp;#x00AC;&amp;#xC8FE;").
+ * representation in the format \htmlonly&amp;#xXXXX; e.g. "&amp;#xFFFE;&amp;#x00AC;&amp;#xC8FE;")\endhtmlonly.
* In the Event the converter doesn't support the characters {&,#,x}[0-9],
* it will substitute the illegal sequence with the substitution characters.
* Note that codeUnit(32bit int eg: unit of a surrogate pair) is represented as
- * &amp;#x23456;</li>
+ * \htmlonly&amp;#x23456;\endhtmlonly</li>
* </ul>
* @param fromUArgs Information about the conversion in progress
* @param codeUnits Points to 'length' UChars of the concerned Unicode sequence
diff --git a/Source/JavaScriptCore/icu/unicode/ucol.h b/Source/JavaScriptCore/icu/unicode/ucol.h
index cbfb1c3dc..4a4cd606e 100644
--- a/Source/JavaScriptCore/icu/unicode/ucol.h
+++ b/Source/JavaScriptCore/icu/unicode/ucol.h
@@ -1,6 +1,6 @@
/*
*******************************************************************************
-* Copyright (c) 1996-2005, International Business Machines Corporation and others.
+* Copyright (c) 1996-2010, International Business Machines Corporation and others.
* All Rights Reserved.
*******************************************************************************
*/
@@ -13,6 +13,7 @@
#if !UCONFIG_NO_COLLATION
#include "unicode/unorm.h"
+#include "unicode/localpointer.h"
#include "unicode/parseerr.h"
#include "unicode/uloc.h"
#include "unicode/uset.h"
@@ -29,11 +30,11 @@
* <em>Important: </em>The ICU collation service has been reimplemented
* in order to achieve better performance and UCA compliance.
* For details, see the
- * <a href="http://icu.sourceforge.net/cvs/icu/~checkout~/icuhtml/design/collation/ICU_collation_design.htm">
+ * <a href="http://source.icu-project.org/repos/icu/icuhtml/trunk/design/collation/ICU_collation_design.htm">
* collation design document</a>.
* <p>
* For more information about the collation service see
- * <a href="http://icu.sourceforge.net/icu/userguide/Collate_Intro.html">the users guide</a>.
+ * <a href="http://icu-project.org/userguide/Collate_Intro.html">the users guide</a>.
* <p>
* Collation service provides correct sorting orders for most locales supported in ICU.
* If specific data for a locale is not available, the orders eventually falls back
@@ -41,7 +42,7 @@
* <p>
* Sort ordering may be customized by providing your own set of rules. For more on
* this subject see the
- * <a href="http://icu.sourceforge.net/icu/userguide/Collate_Customization.html">
+ * <a href="http://icu-project.org/userguide/Collate_Customization.html">
* Collation customization</a> section of the users guide.
* <p>
* @see UCollationResult
@@ -50,15 +51,6 @@
* @see UCollationElements
*/
-/** A collation element iterator.
-* For usage in C programs.
-*/
-struct collIterate;
-/** structure representing collation element iterator instance
- * @stable ICU 2.0
- */
-typedef struct collIterate collIterate;
-
/** A collator.
* For usage in C programs.
*/
@@ -140,6 +132,20 @@ typedef enum {
} UColAttributeValue;
+/** Enum containing the codes for reordering segments of the collation table that are not script
+ * codes. These reordering codes are to be used in conjunction with the script codes.
+ * @internal
+ */
+typedef enum {
+ UCOL_REORDER_CODE_SPACE = 0x1000,
+ UCOL_REORDER_CODE_FIRST = UCOL_REORDER_CODE_SPACE,
+ UCOL_REORDER_CODE_PUNCTUATION = 0x1001,
+ UCOL_REORDER_CODE_SYMBOL = 0x1002,
+ UCOL_REORDER_CODE_CURRENCY = 0x1003,
+ UCOL_REORDER_CODE_DIGIT = 0x1004,
+ UCOL_REORDER_CODE_LIMIT = 0x1005
+} UColReorderCode;
+
/**
* Base letter represents a primary difference. Set comparison
* level to UCOL_PRIMARY to ignore secondary and tertiary differences.
@@ -149,7 +155,7 @@ typedef enum {
* Diacritical differences on the same base letter represent a secondary
* difference. Set comparison level to UCOL_SECONDARY to ignore tertiary
* differences. Use this to set the strength of a Collator object.
- * Example of secondary difference, "ä" >> "a".
+ * Example of secondary difference, "&auml;" >> "a".
*
* Uppercase and lowercase versions of the same character represents a
* tertiary difference. Set comparison level to UCOL_TERTIARY to include
@@ -159,7 +165,7 @@ typedef enum {
*
* Two characters are considered "identical" when they have the same
* unicode spellings. UCOL_IDENTICAL.
- * For example, "ä" == "ä".
+ * For example, "&auml;" == "&auml;".
*
* UCollationStrength is also used to determine the strength of sort keys
* generated from UCollator objects
@@ -173,12 +179,12 @@ typedef UColAttributeValue UCollationStrength;
* @stable ICU 2.0
*/
typedef enum {
- /** Attribute for direction of secondary weights - used in French.\
+ /** Attribute for direction of secondary weights - used in French.
* Acceptable values are UCOL_ON, which results in secondary weights
* being considered backwards and UCOL_OFF which treats secondary
* weights in the order they appear.*/
UCOL_FRENCH_COLLATION,
- /** Attribute for handling variable elements.\
+ /** Attribute for handling variable elements.
* Acceptable values are UCOL_NON_IGNORABLE (default)
* which treats all the codepoints with non-ignorable
* primary weights in the same way,
@@ -187,7 +193,7 @@ typedef enum {
* to be ignored on primary level and moved to the quaternary
* level.*/
UCOL_ALTERNATE_HANDLING,
- /** Controls the ordering of upper and lower case letters.\
+ /** Controls the ordering of upper and lower case letters.
* Acceptable values are UCOL_OFF (default), which orders
* upper and lower case letters in accordance to their tertiary
* weights, UCOL_UPPER_FIRST which forces upper case letters to
@@ -195,45 +201,45 @@ typedef enum {
* the opposite. */
UCOL_CASE_FIRST,
/** Controls whether an extra case level (positioned before the third
- * level) is generated or not.\ Acceptable values are UCOL_OFF (default),
+ * level) is generated or not. Acceptable values are UCOL_OFF (default),
* when case level is not generated, and UCOL_ON which causes the case
- * level to be generated.\ Contents of the case level are affected by
- * the value of UCOL_CASE_FIRST attribute.\ A simple way to ignore
+ * level to be generated. Contents of the case level are affected by
+ * the value of UCOL_CASE_FIRST attribute. A simple way to ignore
* accent differences in a string is to set the strength to UCOL_PRIMARY
* and enable case level. */
UCOL_CASE_LEVEL,
/** Controls whether the normalization check and necessary normalizations
- * are performed.\ When set to UCOL_OFF (default) no normalization check
- * is performed.\ The correctness of the result is guaranteed only if the
- * input data is in so-called FCD form (see users manual for more info).\
- * When set to UCOL_ON, an incremental check is performed to see whether the input data
- * is in the FCD form.\ If the data is not in the FCD form, incremental
- * NFD normalization is performed. */
+ * are performed. When set to UCOL_OFF (default) no normalization check
+ * is performed. The correctness of the result is guaranteed only if the
+ * input data is in so-called FCD form (see users manual for more info).
+ * When set to UCOL_ON, an incremental check is performed to see whether
+ * the input data is in the FCD form. If the data is not in the FCD form,
+ * incremental NFD normalization is performed. */
UCOL_NORMALIZATION_MODE,
/** An alias for UCOL_NORMALIZATION_MODE attribute */
UCOL_DECOMPOSITION_MODE = UCOL_NORMALIZATION_MODE,
- /** The strength attribute.\ Can be either UCOL_PRIMARY, UCOL_SECONDARY,
- * UCOL_TERTIARY, UCOL_QUATERNARY or UCOL_IDENTICAL.\ The usual strength
- * for most locales (except Japanese) is tertiary.\ Quaternary strength
+ /** The strength attribute. Can be either UCOL_PRIMARY, UCOL_SECONDARY,
+ * UCOL_TERTIARY, UCOL_QUATERNARY or UCOL_IDENTICAL. The usual strength
+ * for most locales (except Japanese) is tertiary. Quaternary strength
* is useful when combined with shifted setting for alternate handling
* attribute and for JIS x 4061 collation, when it is used to distinguish
* between Katakana and Hiragana (this is achieved by setting the
- * UCOL_HIRAGANA_QUATERNARY mode to on.\ Otherwise, quaternary level
+ * UCOL_HIRAGANA_QUATERNARY mode to on. Otherwise, quaternary level
* is affected only by the number of non ignorable code points in
- * the string.\ Identical strength is rarely useful, as it amounts
+ * the string. Identical strength is rarely useful, as it amounts
* to codepoints of the NFD form of the string. */
UCOL_STRENGTH,
- /** when turned on, this attribute
- * positions Hiragana before all
- * non-ignorables on quaternary level
- * This is a sneaky way to produce JIS
- * sort order */
+ /** When turned on, this attribute positions Hiragana before all
+ * non-ignorables on quaternary level This is a sneaky way to produce JIS
+ * sort order */
UCOL_HIRAGANA_QUATERNARY_MODE,
- /** when turned on, this attribute
- * generates a collation key
- * for the numeric value of substrings
- * of digits. This is a way to get '100'
- * to sort AFTER '2'.*/
+ /** When turned on, this attribute generates a collation key
+ * for the numeric value of substrings of digits.
+ * This is a way to get '100' to sort AFTER '2'. Note that the longest
+ * digit substring that can be treated as a single collation element is
+ * 254 digits (not counting leading zeros). If a digit substring is
+ * longer than that, the digits beyond the limit will be treated as a
+ * separate digit substring associated with a separate collation element. */
UCOL_NUMERIC_COLLATION,
UCOL_ATTRIBUTE_COUNT
} UColAttribute;
@@ -286,7 +292,7 @@ ucol_open(const char *loc, UErrorCode *status);
* occurred during parsing. This argument can currently be set
* to NULL, but at users own risk. Please provide a real structure.
* @param status A pointer to an UErrorCode to receive any errors
- * @return A pointer to a UCollator.\ It is not guaranteed that NULL be returned in case
+ * @return A pointer to a UCollator. It is not guaranteed that NULL be returned in case
* of error - please use status argument to check for errors.
* @see ucol_open
* @see ucol_safeClone
@@ -305,7 +311,7 @@ ucol_openRules( const UChar *rules,
* Open a collator defined by a short form string.
* The structure and the syntax of the string is defined in the "Naming collators"
* section of the users guide:
- * http://icu.sourceforge.net/icu/userguide/Collate_Concepts.html#Naming_Collators
+ * http://icu-project.org/userguide/Collate_Concepts.html#Naming_Collators
* Attributes are overriden by the subsequent attributes. So, for "S2_S3", final
* strength will be 3. 3066bis locale overrides individual locale parts.
* The call to this function is equivalent to a call to ucol_open, followed by a
@@ -332,10 +338,10 @@ ucol_openRules( const UChar *rules,
* @see ucol_setVariableTop
* @see ucol_getShortDefinitionString
* @see ucol_normalizeShortDefinitionString
- * @draft ICU 3.0
+ * @stable ICU 3.0
*
*/
-U_CAPI UCollator* U_EXPORT2
+U_STABLE UCollator* U_EXPORT2
ucol_openFromShortString( const char *definition,
UBool forceDefaults,
UParseError *parseError,
@@ -352,18 +358,33 @@ ucol_openFromShortString( const char *definition,
* @param status to hold the error code
* @return the size of the contraction set
*
- * @draft ICU 3.0
+ * @deprecated ICU 3.4, use ucol_getContractionsAndExpansions instead
*/
-U_CAPI int32_t U_EXPORT2
+U_DEPRECATED int32_t U_EXPORT2
ucol_getContractions( const UCollator *coll,
USet *conts,
UErrorCode *status);
+/**
+ * Get a set containing the expansions defined by the collator. The set includes
+ * both the UCA expansions and the expansions defined by the tailoring
+ * @param coll collator
+ * @param contractions if not NULL, the set to hold the contractions
+ * @param expansions if not NULL, the set to hold the expansions
+ * @param addPrefixes add the prefix contextual elements to contractions
+ * @param status to hold the error code
+ *
+ * @stable ICU 3.4
+ */
+U_STABLE void U_EXPORT2
+ucol_getContractionsAndExpansions( const UCollator *coll,
+ USet *contractions, USet *expansions,
+ UBool addPrefixes, UErrorCode *status);
/**
* Close a UCollator.
- * Once closed, a UCollator should not be used.\ Every open collator should
- * be closed.\ Otherwise, a memory leak will result.
+ * Once closed, a UCollator should not be used. Every open collator should
+ * be closed. Otherwise, a memory leak will result.
* @param coll The UCollator to close.
* @see ucol_open
* @see ucol_openRules
@@ -373,6 +394,25 @@ ucol_getContractions( const UCollator *coll,
U_STABLE void U_EXPORT2
ucol_close(UCollator *coll);
+#if U_SHOW_CPLUSPLUS_API
+
+U_NAMESPACE_BEGIN
+
+/**
+ * \class LocalUCollatorPointer
+ * "Smart pointer" class, closes a UCollator via ucol_close().
+ * For most methods see the LocalPointerBase base class.
+ *
+ * @see LocalPointerBase
+ * @see LocalPointer
+ * @stable ICU 4.4
+ */
+U_DEFINE_LOCAL_OPEN_POINTER(LocalUCollatorPointer, UCollator, ucol_close);
+
+U_NAMESPACE_END
+
+#endif
+
/**
* Compare two strings.
* The strings will be compared using the options already specified.
@@ -496,6 +536,37 @@ ucol_setStrength(UCollator *coll,
UCollationStrength strength);
/**
+ * Get the current reordering of scripts (if one has been set).
+ * @param coll The UCollator to query.
+ * @param dest The array to fill with the script ordering.
+ * @param destCapacity The length of dest. If it is 0, then dest may be NULL and the function will only return the length of the result without writing any of the result string (pre-flighting).
+ * @param pErrorCode Must be a valid pointer to an error code value, which must not indicate a failure before the function call.
+ * @return The length of the array of the script ordering.
+ * @see ucol_setReorderCodes
+ * @internal
+ */
+U_INTERNAL int32_t U_EXPORT2
+ucol_getReorderCodes(const UCollator* coll,
+ int32_t* dest,
+ int32_t destCapacity,
+ UErrorCode *pErrorCode);
+
+/**
+ * Set the ordering of scripts for this collator.
+ * @param coll The UCollator to set.
+ * @param reorderCodes An array of script codes in the new order.
+ * @param reorderCodesLength The length of reorderCodes.
+ * @param pErrorCode Must be a valid pointer to an error code value, which must not indicate a failure before the function call.
+ * @see ucol_getReorderCodes
+ * @internal
+ */
+U_INTERNAL void U_EXPORT2
+ucol_setReorderCodes(UCollator* coll,
+ const int32_t* reorderCodes,
+ int32_t reorderCodesLength,
+ UErrorCode *pErrorCode);
+
+/**
* Get the display name for a UCollator.
* The display name is suitable for presentation to a user.
* @param objLoc The locale of the collator in question.
@@ -518,13 +589,13 @@ ucol_getDisplayName( const char *objLoc,
* Get a locale for which collation rules are available.
* A UCollator in a locale returned by this function will perform the correct
* collation for the locale.
- * @param index The index of the desired locale.
+ * @param localeIndex The index of the desired locale.
* @return A locale for which collation rules are available, or 0 if none.
* @see ucol_countAvailable
* @stable ICU 2.0
*/
U_STABLE const char* U_EXPORT2
-ucol_getAvailable(int32_t index);
+ucol_getAvailable(int32_t localeIndex);
/**
* Determine how many locales have collation rules available.
@@ -544,9 +615,9 @@ ucol_countAvailable(void);
* @param status input-output error code
* @return a string enumeration over locale strings. The caller is
* responsible for closing the result.
- * @draft ICU 3.0
+ * @stable ICU 3.0
*/
-U_DRAFT UEnumeration* U_EXPORT2
+U_STABLE UEnumeration* U_EXPORT2
ucol_openAvailableLocales(UErrorCode *status);
#endif
@@ -557,9 +628,9 @@ ucol_openAvailableLocales(UErrorCode *status);
* @param status input-output error code
* @return a string enumeration over locale strings. The caller is
* responsible for closing the result.
- * @draft ICU 3.0
+ * @stable ICU 3.0
*/
-U_DRAFT UEnumeration* U_EXPORT2
+U_STABLE UEnumeration* U_EXPORT2
ucol_getKeywords(UErrorCode *status);
/**
@@ -571,12 +642,34 @@ ucol_getKeywords(UErrorCode *status);
* @param status input-output error code
* @return a string enumeration over collation keyword values, or NULL
* upon error. The caller is responsible for closing the result.
- * @draft ICU 3.0
+ * @stable ICU 3.0
*/
-U_DRAFT UEnumeration* U_EXPORT2
+U_STABLE UEnumeration* U_EXPORT2
ucol_getKeywordValues(const char *keyword, UErrorCode *status);
/**
+ * Given a key and a locale, returns an array of string values in a preferred
+ * order that would make a difference. These are all and only those values where
+ * the open (creation) of the service with the locale formed from the input locale
+ * plus input keyword and that value has different behavior than creation with the
+ * input locale alone.
+ * @param key one of the keys supported by this service. For now, only
+ * "collation" is supported.
+ * @param locale the locale
+ * @param commonlyUsed if set to true it will return only commonly used values
+ * with the given locale in preferred order. Otherwise,
+ * it will return all the available values for the locale.
+ * @param status error status
+ * @return a string enumeration over keyword values for the given key and the locale.
+ * @stable ICU 4.2
+ */
+U_STABLE UEnumeration* U_EXPORT2
+ucol_getKeywordValuesForLocale(const char* key,
+ const char* locale,
+ UBool commonlyUsed,
+ UErrorCode* status);
+
+/**
* Return the functionally equivalent locale for the given
* requested locale, with respect to given keyword, for the
* collation service. If two locales return the same result, then
@@ -589,7 +682,7 @@ ucol_getKeywordValues(const char *keyword, UErrorCode *status);
* applications who wish to cache collators, or otherwise reuse
* collators when possible. The functional equivalent may change
* over time. For more information, please see the <a
- * href="http://icu.sourceforge.net/icu/userguide/locale.html#services">
+ * href="http://icu-project.org/userguide/locale.html#services">
* Locales and Services</a> section of the ICU User Guide.
* @param result fillin for the functionally equivalent locale
* @param resultCapacity capacity of the fillin buffer
@@ -604,9 +697,9 @@ ucol_getKeywordValues(const char *keyword, UErrorCode *status);
* @return the actual buffer size needed for the locale. If greater
* than resultCapacity, the returned full name will be truncated and
* an error code will be returned.
- * @draft ICU 3.0
+ * @stable ICU 3.0
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
ucol_getFunctionalEquivalent(char* result, int32_t resultCapacity,
const char* keyword, const char* locale,
UBool* isAvailable, UErrorCode* status);
@@ -629,7 +722,7 @@ ucol_getRules( const UCollator *coll,
* This string will be normalized.
* The structure and the syntax of the string is defined in the "Naming collators"
* section of the users guide:
- * http://icu.sourceforge.net/icu/userguide/Collate_Concepts.html#Naming_Collators
+ * http://icu-project.org/userguide/Collate_Concepts.html#Naming_Collators
* This API supports preflighting.
* @param coll a collator
* @param locale a locale that will appear as a collators locale in the resulting
@@ -641,9 +734,9 @@ ucol_getRules( const UCollator *coll,
* @return length of the resulting string
* @see ucol_openFromShortString
* @see ucol_normalizeShortDefinitionString
- * @draft ICU 3.0
+ * @stable ICU 3.0
*/
-U_CAPI int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
ucol_getShortDefinitionString(const UCollator *coll,
const char *locale,
char *buffer,
@@ -667,26 +760,33 @@ ucol_getShortDefinitionString(const UCollator *coll,
* @see ucol_openFromShortString
* @see ucol_getShortDefinitionString
*
- * @draft ICU 3.0
+ * @stable ICU 3.0
*/
-U_CAPI int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
ucol_normalizeShortDefinitionString(const char *source,
char *destination,
int32_t capacity,
UParseError *parseError,
UErrorCode *status);
-
+
/**
* Get a sort key for a string from a UCollator.
* Sort keys may be compared using <TT>strcmp</TT>.
+ *
+ * Like ICU functions that write to an output buffer, the buffer contents
+ * is undefined if the buffer capacity (resultLength parameter) is too small.
+ * Unlike ICU functions that write a string to an output buffer,
+ * the terminating zero byte is counted in the sort key length.
* @param coll The UCollator containing the collation rules.
* @param source The string to transform.
* @param sourceLength The length of source, or -1 if null-terminated.
* @param result A pointer to a buffer to receive the attribute.
* @param resultLength The maximum size of result.
- * @return The size needed to fully store the sort key..
+ * @return The size needed to fully store the sort key.
+ * If there was an internal error generating the sort key,
+ * a zero value is returned.
* @see ucol_keyHashCode
* @stable ICU 2.0
*/
@@ -804,9 +904,9 @@ ucol_getVersion(const UCollator* coll, UVersionInfo info);
* UCA version number (3.1.1, 4.0).
* @param coll The UCollator to query.
* @param info the version # information, the result will be filled in
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
ucol_getUCAVersion(const UCollator* coll, UVersionInfo info);
/**
@@ -992,9 +1092,9 @@ ucol_getLocale(const UCollator *coll, ULocDataLocaleType type, UErrorCode *statu
* @return real locale name from which the collation data comes.
* If the collator was instantiated from rules, returns
* NULL.
- * @draft ICU 2.8 likely to change in ICU 3.0, based on feedback
+ * @stable ICU 2.8
*/
-U_DRAFT const char * U_EXPORT2
+U_STABLE const char * U_EXPORT2
ucol_getLocaleByType(const UCollator *coll, ULocDataLocaleType type, UErrorCode *status);
/**
@@ -1011,97 +1111,6 @@ U_STABLE USet * U_EXPORT2
ucol_getTailoredSet(const UCollator *coll, UErrorCode *status);
/**
- * Returned by ucol_collatorToIdentifier to signify that collator is
- * not encodable as an identifier.
- * @internal ICU 3.0
- */
-#define UCOL_SIT_COLLATOR_NOT_ENCODABLE 0x80000000
-
-/**
- * Get a 31-bit identifier given a collator.
- * @param coll UCollator
- * @param locale a locale that will appear as a collators locale in the resulting
- * short string definition. If NULL, the locale will be harvested
- * from the collator.
- * @param status holds error messages
- * @return 31-bit identifier. MSB is used if the collator cannot be encoded. In that
- * case UCOL_SIT_COLLATOR_NOT_ENCODABLE is returned
- * @see ucol_openFromIdentifier
- * @see ucol_identifierToShortString
- * @internal ICU 3.0
- */
-U_INTERNAL uint32_t U_EXPORT2
-ucol_collatorToIdentifier(const UCollator *coll,
- const char *locale,
- UErrorCode *status);
-
-/**
- * Open a collator given a 31-bit identifier
- * @param identifier 31-bit identifier, encoded by calling ucol_collatorToIdentifier
- * @param forceDefaults if FALSE, the settings that are the same as the collator
- * default settings will not be applied (for example, setting
- * French secondary on a French collator would not be executed).
- * If TRUE, all the settings will be applied regardless of the
- * collator default value. If the definition
- * strings that can be produced from a collator instantiated by
- * calling this API are to be cached, should be set to FALSE.
- * @param status for returning errors
- * @return UCollator object
- * @see ucol_collatorToIdentifier
- * @see ucol_identifierToShortString
- * @internal ICU 3.0
- */
-U_INTERNAL UCollator* U_EXPORT2
-ucol_openFromIdentifier(uint32_t identifier,
- UBool forceDefaults,
- UErrorCode *status);
-
-
-/**
- * Calculate the short definition string given an identifier. Supports preflighting.
- * @param identifier 31-bit identifier, encoded by calling ucol_collatorToIdentifier
- * @param buffer buffer to store the result
- * @param capacity buffer capacity
- * @param forceDefaults whether the settings that are the same as the default setting
- * should be forced anyway. Setting this argument to FALSE reduces
- * the number of different configurations, but decreases performace
- * as a collator has to be instantiated.
- * @param status for returning errors
- * @return length of the short definition string
- * @see ucol_collatorToIdentifier
- * @see ucol_openFromIdentifier
- * @see ucol_shortStringToIdentifier
- * @internal ICU 3.0
- */
-U_INTERNAL int32_t U_EXPORT2
-ucol_identifierToShortString(uint32_t identifier,
- char *buffer,
- int32_t capacity,
- UBool forceDefaults,
- UErrorCode *status);
-
-/**
- * Calculate the identifier given a short definition string. Supports preflighting.
- * @param definition short string definition
- * @param forceDefaults whether the settings that are the same as the default setting
- * should be forced anyway. Setting this argument to FALSE reduces
- * the number of different configurations, but decreases performace
- * as a collator has to be instantiated.
- * @param status for returning errors
- * @return identifier
- * @see ucol_collatorToIdentifier
- * @see ucol_openFromIdentifier
- * @see ucol_identifierToShortString
- * @internal ICU 3.0
- */
-U_INTERNAL uint32_t U_EXPORT2
-ucol_shortStringToIdentifier(const char *definition,
- UBool forceDefaults,
- UErrorCode *status);
-
-
-
-/**
* Universal attribute getter that returns UCOL_DEFAULT if the value is default
* @param coll collator which attributes are to be changed
* @param attr attribute type
@@ -1183,9 +1192,9 @@ ucol_prepareShortStringOpen( const char *definition,
* @param status for catching errors
* @return size of the image
* @see ucol_openBinary
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
ucol_cloneBinary(const UCollator *coll,
uint8_t *buffer, int32_t capacity,
UErrorCode *status);
@@ -1205,9 +1214,9 @@ ucol_cloneBinary(const UCollator *coll,
* @param status for catching errors
* @return newly created collator
* @see ucol_cloneBinary
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
-U_DRAFT UCollator* U_EXPORT2
+U_STABLE UCollator* U_EXPORT2
ucol_openBinary(const uint8_t *bin, int32_t length,
const UCollator *base,
UErrorCode *status);
@@ -1216,4 +1225,3 @@ ucol_openBinary(const uint8_t *bin, int32_t length,
#endif /* #if !UCONFIG_NO_COLLATION */
#endif
-
diff --git a/Source/JavaScriptCore/icu/unicode/uconfig.h b/Source/JavaScriptCore/icu/unicode/uconfig.h
index 997cf686b..7d2d26e95 100644
--- a/Source/JavaScriptCore/icu/unicode/uconfig.h
+++ b/Source/JavaScriptCore/icu/unicode/uconfig.h
@@ -1,6 +1,6 @@
/*
**********************************************************************
-* Copyright (C) 2002-2004, International Business Machines
+* Copyright (C) 2002-2009, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* file name: uconfig.h
@@ -15,6 +15,7 @@
#ifndef __UCONFIG_H__
#define __UCONFIG_H__
+
/*!
* \file
* \brief Switches for excluding parts of ICU library code modules.
@@ -24,17 +25,35 @@
* The switches are fairly coarse, controlling large modules.
* Basic services cannot be turned off.
*
+ * Building with any of these options does not guarantee that the
+ * ICU build process will completely work. It is recommended that
+ * the ICU libraries and data be built using the normal build.
+ * At that time you should remove the data used by those services.
+ * After building the ICU data library, you should rebuild the ICU
+ * libraries with these switches customized to your needs.
+ *
* @stable ICU 2.4
*/
/**
+ * If this switch is defined, ICU will attempt to load a header file named "uconfig_local.h"
+ * prior to determining default settings for uconfig variables.
+ *
+ * @internal ICU 4.0
+ *
+ */
+#if defined(UCONFIG_USE_LOCAL)
+#include "uconfig_local.h"
+#endif
+
+/**
* \def UCONFIG_ONLY_COLLATION
* This switch turns off modules that are not needed for collation.
*
* It does not turn off legacy conversion because that is necessary
* for ICU to work on EBCDIC platforms (for the default converter).
* If you want "only collation" and do not build for EBCDIC,
- * then you can #define UCONFIG_NO_LEGACY_CONVERSION 1 as well.
+ * then you can define UCONFIG_NO_LEGACY_CONVERSION 1 as well.
*
* @stable ICU 2.4
*/
@@ -59,11 +78,37 @@
/* common library switches -------------------------------------------------- */
/**
+ * \def UCONFIG_NO_FILE_IO
+ * This switch turns off all file access in the common library
+ * where file access is only used for data loading.
+ * ICU data must then be provided in the form of a data DLL (or with an
+ * equivalent way to link to the data residing in an executable,
+ * as in building a combined library with both the common library's code and
+ * the data), or via udata_setCommonData().
+ * Application data must be provided via udata_setAppData() or by using
+ * "open" functions that take pointers to data, for example ucol_openBinary().
+ *
+ * File access is not used at all in the i18n library.
+ *
+ * File access cannot be turned off for the icuio library or for the ICU
+ * test suites and ICU tools.
+ *
+ * @stable ICU 3.6
+ */
+#ifndef UCONFIG_NO_FILE_IO
+# define UCONFIG_NO_FILE_IO 0
+#endif
+
+/**
* \def UCONFIG_NO_CONVERSION
* ICU will not completely build with this switch turned on.
* This switch turns off all converters.
*
- * @draft ICU 3.2
+ * You may want to use this together with U_CHARSET_IS_UTF8 defined to 1
+ * in utypes.h if char* strings in your environment are always in UTF-8.
+ *
+ * @stable ICU 3.2
+ * @see U_CHARSET_IS_UTF8
*/
#ifndef UCONFIG_NO_CONVERSION
# define UCONFIG_NO_CONVERSION 0
@@ -177,10 +222,10 @@
* \def UCONFIG_NO_SERVICE
* This switch turns off service registration.
*
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
#ifndef UCONFIG_NO_SERVICE
-# define UCONFIG_NO_SERVICE 0
+# define UCONFIG_NO_SERVICE 1
#endif
#endif
diff --git a/Source/JavaScriptCore/icu/unicode/uenum.h b/Source/JavaScriptCore/icu/unicode/uenum.h
index 63690f8b2..0e7d90cc5 100644
--- a/Source/JavaScriptCore/icu/unicode/uenum.h
+++ b/Source/JavaScriptCore/icu/unicode/uenum.h
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2002-2004, International Business Machines
+* Copyright (C) 2002-2010, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -18,8 +18,18 @@
#define __UENUM_H
#include "unicode/utypes.h"
+#include "unicode/localpointer.h"
+
+#if U_SHOW_CPLUSPLUS_API
+#include "unicode/strenum.h"
+#endif
/**
+ * \file
+ * \brief C API: String Enumeration
+ */
+
+/**
* An enumeration object.
* For usage in C programs.
* @stable ICU 2.2
@@ -38,6 +48,25 @@ typedef struct UEnumeration UEnumeration;
U_STABLE void U_EXPORT2
uenum_close(UEnumeration* en);
+#if U_SHOW_CPLUSPLUS_API
+
+U_NAMESPACE_BEGIN
+
+/**
+ * \class LocalUEnumerationPointer
+ * "Smart pointer" class, closes a UEnumeration via uenum_close().
+ * For most methods see the LocalPointerBase base class.
+ *
+ * @see LocalPointerBase
+ * @see LocalPointer
+ * @stable ICU 4.4
+ */
+U_DEFINE_LOCAL_OPEN_POINTER(LocalUEnumerationPointer, UEnumeration, uenum_close);
+
+U_NAMESPACE_END
+
+#endif
+
/**
* Returns the number of elements that the iterator traverses. If
* the iterator is out-of-sync with its service, status is set to
@@ -126,4 +155,20 @@ uenum_next(UEnumeration* en,
U_STABLE void U_EXPORT2
uenum_reset(UEnumeration* en, UErrorCode* status);
+#if U_SHOW_CPLUSPLUS_API
+
+/**
+ * Given a StringEnumeration, wrap it in a UEnumeration. The
+ * StringEnumeration is adopted; after this call, the caller must not
+ * delete it (regardless of error status).
+ * @param adopted the C++ StringEnumeration to be wrapped in a UEnumeration.
+ * @param ec the error code.
+ * @return a UEnumeration wrapping the adopted StringEnumeration.
+ * @draft ICU 4.2
+ */
+U_CAPI UEnumeration* U_EXPORT2
+uenum_openFromStringEnumeration(U_NAMESPACE_QUALIFIER StringEnumeration* adopted, UErrorCode* ec);
+
+#endif
+
#endif
diff --git a/Source/JavaScriptCore/icu/unicode/uiter.h b/Source/JavaScriptCore/icu/unicode/uiter.h
index 963df5cf9..b469e24e6 100644
--- a/Source/JavaScriptCore/icu/unicode/uiter.h
+++ b/Source/JavaScriptCore/icu/unicode/uiter.h
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2002-2004, International Business Machines
+* Copyright (C) 2002-2006,2009 International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -26,7 +26,7 @@
#include "unicode/utypes.h"
-#ifdef XP_CPLUSPLUS
+#if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN
class CharacterIterator;
@@ -650,7 +650,7 @@ uiter_setUTF16BE(UCharIterator *iter, const char *s, int32_t length);
U_STABLE void U_EXPORT2
uiter_setUTF8(UCharIterator *iter, const char *s, int32_t length);
-#ifdef XP_CPLUSPLUS
+#if U_SHOW_CPLUSPLUS_API
/**
* Set up a UCharIterator to wrap around a C++ CharacterIterator.
@@ -673,7 +673,7 @@ uiter_setUTF8(UCharIterator *iter, const char *s, int32_t length);
* @stable ICU 2.1
*/
U_STABLE void U_EXPORT2
-uiter_setCharacterIterator(UCharIterator *iter, CharacterIterator *charIter);
+uiter_setCharacterIterator(UCharIterator *iter, U_NAMESPACE_QUALIFIER CharacterIterator *charIter);
/**
* Set up a UCharIterator to iterate over a C++ Replaceable.
@@ -698,7 +698,7 @@ uiter_setCharacterIterator(UCharIterator *iter, CharacterIterator *charIter);
* @stable ICU 2.1
*/
U_STABLE void U_EXPORT2
-uiter_setReplaceable(UCharIterator *iter, const Replaceable *rep);
+uiter_setReplaceable(UCharIterator *iter, const U_NAMESPACE_QUALIFIER Replaceable *rep);
#endif
diff --git a/Source/JavaScriptCore/icu/unicode/uloc.h b/Source/JavaScriptCore/icu/unicode/uloc.h
index f584ec1c3..95758c3a3 100644
--- a/Source/JavaScriptCore/icu/unicode/uloc.h
+++ b/Source/JavaScriptCore/icu/unicode/uloc.h
@@ -1,6 +1,6 @@
/*
**********************************************************************
-* Copyright (C) 1997-2004, International Business Machines
+* Copyright (C) 1997-2010, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
*
@@ -256,51 +256,68 @@
#define ULOC_COUNTRY_CAPACITY 4
/**
* Useful constant for the maximum size of the whole locale ID
- * (including the terminating NULL).
+ * (including the terminating NULL and all keywords).
* @stable ICU 2.0
*/
-#define ULOC_FULLNAME_CAPACITY 56
-
-
-#ifndef U_HIDE_DRAFT_API
+#define ULOC_FULLNAME_CAPACITY 157
/**
* Useful constant for the maximum size of the script part of a locale ID
* (including the terminating NULL).
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
#define ULOC_SCRIPT_CAPACITY 6
/**
* Useful constant for the maximum size of keywords in a locale
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
#define ULOC_KEYWORDS_CAPACITY 50
/**
- * Useful constant for the maximum size of keywords in a locale
- * @draft ICU 2.8
+ * Useful constant for the maximum total size of keywords and their values in a locale
+ * @stable ICU 2.8
*/
#define ULOC_KEYWORD_AND_VALUES_CAPACITY 100
/**
- * Character separating keywords from the locale string
- * different for EBCDIC - TODO
- * @draft ICU 2.8
+ * Invariant character separating keywords from the locale string
+ * @stable ICU 2.8
*/
#define ULOC_KEYWORD_SEPARATOR '@'
+
/**
- * Character for assigning value to a keyword
- * @draft ICU 2.8
+ * Unicode code point for '@' separating keywords from the locale string.
+ * @see ULOC_KEYWORD_SEPARATOR
+ * @draft ICU 4.6
+ */
+#define ULOC_KEYWORD_SEPARATOR_UNICODE 0x40
+
+/**
+ * Invariant character for assigning value to a keyword
+ * @stable ICU 2.8
*/
#define ULOC_KEYWORD_ASSIGN '='
+
/**
- * Character separating keywords
- * @draft ICU 2.8
+ * Unicode code point for '=' for assigning value to a keyword.
+ * @see ULOC_KEYWORD_ASSIGN
+ * @draft ICU 4.6
+ */
+#define ULOC_KEYWORD_ASSIGN_UNICODE 0x3D
+
+/**
+ * Invariant character separating keywords
+ * @stable ICU 2.8
*/
#define ULOC_KEYWORD_ITEM_SEPARATOR ';'
-#endif /*U_HIDE_DRAFT_API*/
+/**
+ * Unicode code point for ';' separating keywords
+ * @see ULOC_KEYWORD_ITEM_SEPARATOR
+ * @draft ICU 4.6
+ */
+#define ULOC_KEYWORD_ITEM_SEPARATOR_UNICODE 0x3B
/**
* Constants for *_getLocale()
@@ -333,7 +350,7 @@ typedef enum {
ULOC_REQUESTED_LOCALE = 2,
#endif /* U_HIDE_DEPRECATED_API */
- ULOC_DATA_LOCALE_TYPE_LIMIT
+ ULOC_DATA_LOCALE_TYPE_LIMIT = 3
} ULocDataLocaleType ;
@@ -400,9 +417,9 @@ uloc_getLanguage(const char* localeID,
* @param err error information if retrieving the language code failed
* @return the actual buffer size needed for the language code. If it's greater
* than scriptCapacity, the returned language code will be truncated.
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uloc_getScript(const char* localeID,
char* script,
int32_t scriptCapacity,
@@ -420,7 +437,7 @@ uloc_getScript(const char* localeID,
* than countryCapacity, the returned country code will be truncated.
* @stable ICU 2.0
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uloc_getCountry(const char* localeID,
char* country,
int32_t countryCapacity,
@@ -482,9 +499,9 @@ uloc_getName(const char* localeID,
* @param err error information if retrieving the full name failed
* @return the actual buffer size needed for the full name. If it's greater
* than nameCapacity, the returned full name will be truncated.
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uloc_canonicalize(const char* localeID,
char* name,
int32_t nameCapacity,
@@ -559,9 +576,9 @@ uloc_getDisplayLanguage(const char* locale,
* @param status error information if retrieving the displayable script code failed
* @return the actual buffer size needed for the displayable script code. If it's greater
* than scriptCapacity, the returned displayable script code will be truncated.
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uloc_getDisplayScript(const char* locale,
const char* displayLocale,
UChar* script,
@@ -653,9 +670,9 @@ uloc_getDisplayVariant(const char* locale,
* Should not be NULL and should not indicate failure on entry.
* @return the actual buffer size needed for the displayable variant code.
* @see #uloc_openKeywords
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uloc_getDisplayKeyword(const char* keyword,
const char* displayLocale,
UChar* dest,
@@ -679,9 +696,9 @@ uloc_getDisplayKeyword(const char* keyword,
* @param status error information if retrieving the displayable string failed.
* Should not be NULL and must not indicate failure on entry.
* @return the actual buffer size needed for the displayable variant code.
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uloc_getDisplayKeywordValue( const char* locale,
const char* keyword,
const char* displayLocale,
@@ -796,9 +813,9 @@ uloc_getParent(const char* localeID,
* @param err error information if retrieving the full name failed
* @return the actual buffer size needed for the full name. If it's greater
* than nameCapacity, the returned full name will be truncated.
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uloc_getBaseName(const char* localeID,
char* name,
int32_t nameCapacity,
@@ -811,9 +828,9 @@ uloc_getBaseName(const char* localeID,
* @param localeID the locale to get the variant code with
* @param status error information if retrieving the keywords failed
* @return enumeration of keywords or NULL if there are no keywords.
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
-U_DRAFT UEnumeration* U_EXPORT2
+U_STABLE UEnumeration* U_EXPORT2
uloc_openKeywords(const char* localeID,
UErrorCode* status);
@@ -826,9 +843,9 @@ uloc_openKeywords(const char* localeID,
* @param bufferCapacity capacity of receiving buffer
* @param status containing error code - buffer not big enough.
* @return the length of keyword value
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uloc_getKeywordValue(const char* localeID,
const char* keywordName,
char* buffer, int32_t bufferCapacity,
@@ -852,19 +869,56 @@ uloc_getKeywordValue(const char* localeID,
* @param status containing error code - buffer not big enough.
* @return the length needed for the buffer
* @see uloc_getKeywordValue
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uloc_setKeywordValue(const char* keywordName,
const char* keywordValue,
char* buffer, int32_t bufferCapacity,
UErrorCode* status);
/**
+ * enums for the return value for the character and line orientation
+ * functions.
+ * @stable ICU 4.0
+ */
+typedef enum {
+ ULOC_LAYOUT_LTR = 0, /* left-to-right. */
+ ULOC_LAYOUT_RTL = 1, /* right-to-left. */
+ ULOC_LAYOUT_TTB = 2, /* top-to-bottom. */
+ ULOC_LAYOUT_BTT = 3, /* bottom-to-top. */
+ ULOC_LAYOUT_UNKNOWN
+} ULayoutType;
+
+/**
+ * Get the layout character orientation for the specified locale.
+ *
+ * @param localeId locale name
+ * @param status Error status
+ * @return an enum indicating the layout orientation for characters.
+ * @stable ICU 4.0
+ */
+U_STABLE ULayoutType U_EXPORT2
+uloc_getCharacterOrientation(const char* localeId,
+ UErrorCode *status);
+
+/**
+ * Get the layout line orientation for the specified locale.
+ *
+ * @param localeId locale name
+ * @param status Error status
+ * @return an enum indicating the layout orientation for lines.
+ * @stable ICU 4.0
+ */
+U_STABLE ULayoutType U_EXPORT2
+uloc_getLineOrientation(const char* localeId,
+ UErrorCode *status);
+
+/**
* enums for the 'outResult' parameter return value
* @see uloc_acceptLanguageFromHTTP
* @see uloc_acceptLanguage
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
typedef enum {
ULOC_ACCEPT_FAILED = 0, /* No exact match was found. */
@@ -876,15 +930,18 @@ typedef enum {
/**
- * @param httpAcceptLanguage - "Accept-Language:" header as per HTTP.
+ * Based on a HTTP header from a web browser and a list of available locales,
+ * determine an acceptable locale for the user.
* @param result - buffer to accept the result locale
* @param resultAvailable the size of the result buffer.
+ * @param outResult - An out parameter that contains the fallback status
+ * @param httpAcceptLanguage - "Accept-Language:" header as per HTTP.
* @param availableLocales - list of available locales to match
* @param status Error status, may be BUFFER_OVERFLOW_ERROR
* @return length needed for the locale.
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uloc_acceptLanguageFromHTTP(char *result, int32_t resultAvailable,
UAcceptResult *outResult,
const char *httpAcceptLanguage,
@@ -892,26 +949,178 @@ uloc_acceptLanguageFromHTTP(char *result, int32_t resultAvailable,
UErrorCode *status);
/**
- * @param acceptList -list of acceptable languages
- * @param acceptListCount - count of acceptList items
+ * Based on a list of available locales,
+ * determine an acceptable locale for the user.
* @param result - buffer to accept the result locale
* @param resultAvailable the size of the result buffer.
+ * @param outResult - An out parameter that contains the fallback status
+ * @param acceptList - list of acceptable languages
+ * @param acceptListCount - count of acceptList items
* @param availableLocales - list of available locales to match
* @param status Error status, may be BUFFER_OVERFLOW_ERROR
* @return length needed for the locale.
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uloc_acceptLanguage(char *result, int32_t resultAvailable,
UAcceptResult *outResult, const char **acceptList,
int32_t acceptListCount,
UEnumeration* availableLocales,
UErrorCode *status);
-/*eof*/
+/**
+ * Gets the ICU locale ID for the specified Win32 LCID value.
+ *
+ * @param hostID the Win32 LCID to translate
+ * @param locale the output buffer for the ICU locale ID, which will be NUL-terminated
+ * if there is room.
+ * @param localeCapacity the size of the output buffer
+ * @param status an error is returned if the LCID is unrecognized or the output buffer
+ * is too small
+ * @return actual the actual size of the locale ID, not including NUL-termination
+ * @stable ICU 3.8
+ */
+U_STABLE int32_t U_EXPORT2
+uloc_getLocaleForLCID(uint32_t hostID, char *locale, int32_t localeCapacity,
+ UErrorCode *status);
-#endif /*_ULOC*/
+/**
+ * Add the likely subtags for a provided locale ID, per the algorithm described
+ * in the following CLDR technical report:
+ *
+ * http://www.unicode.org/reports/tr35/#Likely_Subtags
+ *
+ * If localeID is already in the maximal form, or there is no data available
+ * for maximization, it will be copied to the output buffer. For example,
+ * "und-Zzzz" cannot be maximized, since there is no reasonable maximization.
+ *
+ * Examples:
+ *
+ * "en" maximizes to "en_Latn_US"
+ *
+ * "de" maximizes to "de_Latn_US"
+ *
+ * "sr" maximizes to "sr_Cyrl_RS"
+ *
+ * "sh" maximizes to "sr_Latn_RS" (Note this will not reverse.)
+ *
+ * "zh_Hani" maximizes to "zh_Hans_CN" (Note this will not reverse.)
+ *
+ * @param localeID The locale to maximize
+ * @param maximizedLocaleID The maximized locale
+ * @param maximizedLocaleIDCapacity The capacity of the maximizedLocaleID buffer
+ * @param err Error information if maximizing the locale failed. If the length
+ * of the localeID and the null-terminator is greater than the maximum allowed size,
+ * or the localeId is not well-formed, the error code is U_ILLEGAL_ARGUMENT_ERROR.
+ * @return The actual buffer size needed for the maximized locale. If it's
+ * greater than maximizedLocaleIDCapacity, the returned ID will be truncated.
+ * On error, the return value is -1.
+ * @stable ICU 4.0
+ */
+U_STABLE int32_t U_EXPORT2
+uloc_addLikelySubtags(const char* localeID,
+ char* maximizedLocaleID,
+ int32_t maximizedLocaleIDCapacity,
+ UErrorCode* err);
+
+
+/**
+ * Minimize the subtags for a provided locale ID, per the algorithm described
+ * in the following CLDR technical report:
+ *
+ * http://www.unicode.org/reports/tr35/#Likely_Subtags
+ *
+ * If localeID is already in the minimal form, or there is no data available
+ * for minimization, it will be copied to the output buffer. Since the
+ * minimization algorithm relies on proper maximization, see the comments
+ * for uloc_addLikelySubtags for reasons why there might not be any data.
+ *
+ * Examples:
+ *
+ * "en_Latn_US" minimizes to "en"
+ *
+ * "de_Latn_US" minimizes to "de"
+ *
+ * "sr_Cyrl_RS" minimizes to "sr"
+ *
+ * "zh_Hant_TW" minimizes to "zh_TW" (The region is preferred to the
+ * script, and minimizing to "zh" would imply "zh_Hans_CN".)
+ *
+ * @param localeID The locale to minimize
+ * @param minimizedLocaleID The minimized locale
+ * @param minimizedLocaleIDCapacity The capacity of the minimizedLocaleID buffer
+ * @param err Error information if minimizing the locale failed. If the length
+ * of the localeID and the null-terminator is greater than the maximum allowed size,
+ * or the localeId is not well-formed, the error code is U_ILLEGAL_ARGUMENT_ERROR.
+ * @return The actual buffer size needed for the minimized locale. If it's
+ * greater than minimizedLocaleIDCapacity, the returned ID will be truncated.
+ * On error, the return value is -1.
+ * @stable ICU 4.0
+ */
+U_STABLE int32_t U_EXPORT2
+uloc_minimizeSubtags(const char* localeID,
+ char* minimizedLocaleID,
+ int32_t minimizedLocaleIDCapacity,
+ UErrorCode* err);
+
+/**
+ * Returns a locale ID for the specified BCP47 language tag string.
+ * If the specified language tag contains any ill-formed subtags,
+ * the first such subtag and all following subtags are ignored.
+ * <p>
+ * This implements the 'Language-Tag' production of BCP47, and so
+ * supports grandfathered (regular and irregular) as well as private
+ * use language tags. Private use tags are represented as 'x-whatever',
+ * and grandfathered tags are converted to their canonical replacements
+ * where they exist. Note that a few grandfathered tags have no modern
+ * replacement, these will be converted using the fallback described in
+ * the first paragraph, so some information might be lost.
+ * @param langtag the input BCP47 language tag.
+ * @param localeID the output buffer receiving a locale ID for the
+ * specified BCP47 language tag.
+ * @param localeIDCapacity the size of the locale ID output buffer.
+ * @param parsedLength if not NULL, succsessfully parsed length
+ * for the input language tag is set.
+ * @param err error information if receiving the locald ID
+ * failed.
+ * @return the length of the locale ID.
+ * @draft ICU 4.2
+ */
+U_DRAFT int32_t U_EXPORT2
+uloc_forLanguageTag(const char* langtag,
+ char* localeID,
+ int32_t localeIDCapacity,
+ int32_t* parsedLength,
+ UErrorCode* err);
+/**
+ * Returns a well-formed language tag for this locale ID.
+ * <p>
+ * <b>Note</b>: When <code>strict</code> is FALSE, any locale
+ * fields which do not satisfy the BCP47 syntax requirement will
+ * be omitted from the result. When <code>strict</code> is
+ * TRUE, this function sets U_ILLEGAL_ARGUMENT_ERROR to the
+ * <code>err</code> if any locale fields do not satisfy the
+ * BCP47 syntax requirement.
+ * @param localeID the input lcoale ID
+ * @param langtag the output buffer receiving BCP47 language
+ * tag for the locale ID.
+ * @param langtagCapacity the size of the BCP47 language tag
+ * output buffer.
+ * @param strict boolean value indicating if the function returns
+ * an error for an ill-formed input locale ID.
+ * @param err error information if receiving the language
+ * tag failed.
+ * @return The length of the BCP47 language tag.
+ * @draft ICU 4.2
+ */
+U_DRAFT int32_t U_EXPORT2
+uloc_toLanguageTag(const char* localeID,
+ char* langtag,
+ int32_t langtagCapacity,
+ UBool strict,
+ UErrorCode* err);
+#endif /*_ULOC*/
diff --git a/Source/JavaScriptCore/icu/unicode/umachine.h b/Source/JavaScriptCore/icu/unicode/umachine.h
index d841f5348..abbdcb79f 100644
--- a/Source/JavaScriptCore/icu/unicode/umachine.h
+++ b/Source/JavaScriptCore/icu/unicode/umachine.h
@@ -1,7 +1,7 @@
/*
******************************************************************************
*
-* Copyright (C) 1999-2004, International Business Machines
+* Copyright (C) 1999-2010, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@@ -26,25 +26,30 @@
/**
* \file
- * \brief Basic types and constants for UTF
- *
+ * \brief Basic types and constants for UTF
+ *
* <h2> Basic types and constants for UTF </h2>
* This file defines basic types and constants for utf.h to be
* platform-independent. umachine.h and utf.h are included into
* utypes.h to provide all the general definitions for ICU.
* All of these definitions used to be in utypes.h before
* the UTF-handling macros made this unmaintainable.
- *
+ *
*/
/*==========================================================================*/
/* Include platform-dependent definitions */
/* which are contained in the platform-specific file platform.h */
/*==========================================================================*/
-#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
+#if defined(U_PALMOS)
+# include "unicode/ppalmos.h"
+#elif !defined(__MINGW32__) && (defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64))
+#ifdef CYGWINMSVC
+# include "unicode/platform.h"
+#endif
# include "unicode/pwin32.h"
#else
-# include "unicode/platform.h"
+# include "unicode/ptypes.h" /* platform.h is included in ptypes.h */
#endif
/*
@@ -86,7 +91,7 @@
/**
* \def U_CDECL_END
- * This is used to end a declaration of a library private ICU C API
+ * This is used to end a declaration of a library private ICU C API
* @stable ICU 2.4
*/
@@ -101,54 +106,33 @@
#endif
/**
- * \def U_NAMESPACE_BEGIN
- * This is used to begin a declaration of a public ICU C++ API.
- * If the compiler doesn't support namespaces, this does nothing.
- * @stable ICU 2.4
- */
-
-/**
- * \def U_NAMESPACE_END
- * This is used to end a declaration of a public ICU C++ API
- * If the compiler doesn't support namespaces, this does nothing.
- * @stable ICU 2.4
- */
-
-/**
- * \def U_NAMESPACE_USE
- * This is used to specify that the rest of the code uses the
- * public ICU C++ API namespace.
- * If the compiler doesn't support namespaces, this does nothing.
- * @stable ICU 2.4
+ * \def U_ATTRIBUTE_DEPRECATED
+ * This is used for GCC specific attributes
+ * @internal
*/
-
+#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2))
+# define U_ATTRIBUTE_DEPRECATED __attribute__ ((deprecated))
/**
- * \def U_NAMESPACE_QUALIFIER
- * This is used to qualify that a function or class is part of
- * the public ICU C++ API namespace.
- * If the compiler doesn't support namespaces, this does nothing.
- * @stable ICU 2.4
+ * \def U_ATTRIBUTE_DEPRECATED
+ * This is used for Visual C++ specific attributes
+ * @internal
*/
-
-/* Define namespace symbols if the compiler supports it. */
-#if U_HAVE_NAMESPACE
-# define U_NAMESPACE_BEGIN namespace U_ICU_NAMESPACE {
-# define U_NAMESPACE_END }
-# define U_NAMESPACE_USE using namespace U_ICU_NAMESPACE;
-# define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE::
+#elif defined(U_WINDOWS) && defined(_MSC_VER) && (_MSC_VER >= 1400)
+# define U_ATTRIBUTE_DEPRECATED __declspec(deprecated)
#else
-# define U_NAMESPACE_BEGIN
-# define U_NAMESPACE_END
-# define U_NAMESPACE_USE
-# define U_NAMESPACE_QUALIFIER
+# define U_ATTRIBUTE_DEPRECATED
#endif
-
/** This is used to declare a function as a public ICU C API @stable ICU 2.0*/
#define U_CAPI U_CFUNC U_EXPORT
+/** This is used to declare a function as a stable public ICU C API*/
#define U_STABLE U_CAPI
+/** This is used to declare a function as a draft public ICU C API */
#define U_DRAFT U_CAPI
-#define U_DEPRECATED U_CAPI
+/** This is used to declare a function as a deprecated public ICU C API */
+#define U_DEPRECATED U_CAPI U_ATTRIBUTE_DEPRECATED
+/** This is used to declare a function as an obsolete public ICU C API */
#define U_OBSOLETE U_CAPI
+/** This is used to declare a function as an internal ICU C API */
#define U_INTERNAL U_CAPI
/*==========================================================================*/
@@ -201,7 +185,7 @@
/**
* Provides a platform independent way to specify a signed 64-bit integer constant.
* note: may be wrong for some 64 bit platforms - ensure your compiler provides INT64_C
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
# define INT64_C(c) c ## LL
# endif
@@ -209,7 +193,7 @@
/**
* Provides a platform independent way to specify an unsigned 64-bit integer constant.
* note: may be wrong for some 64 bit platforms - ensure your compiler provides UINT64_C
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
# define UINT64_C(c) c ## ULL
# endif
@@ -284,7 +268,7 @@ typedef int8_t UBool;
* @stable ICU 2.0
*/
#if !defined(U_WCHAR_IS_UTF16) && !defined(U_WCHAR_IS_UTF32)
-# ifdef __STDC_ISO_10646__
+# ifdef __STDC_ISO_10646__
# if (U_SIZEOF_WCHAR_T==2)
# define U_WCHAR_IS_UTF16
# elif (U_SIZEOF_WCHAR_T==4)
@@ -298,8 +282,8 @@ typedef int8_t UBool;
# if (U_SIZEOF_WCHAR_T==4)
# define U_WCHAR_IS_UTF32
# endif
-# elif defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
-# define U_WCHAR_IS_UTF16
+# elif defined(U_WINDOWS)
+# define U_WCHAR_IS_UTF16
# endif
#endif
@@ -311,17 +295,23 @@ typedef int8_t UBool;
/**
* \var UChar
* Define UChar to be wchar_t if that is 16 bits wide; always assumed to be unsigned.
- * If wchar_t is not 16 bits wide, then define UChar to be uint16_t.
+ * If wchar_t is not 16 bits wide, then define UChar to be uint16_t or char16_t because GCC >=4.4
+ * can handle UTF16 string literals.
* This makes the definition of UChar platform-dependent
* but allows direct string type compatibility with platforms with
* 16-bit wchar_t types.
*
- * @stable ICU 2.0
+ * @draft ICU 4.4
*/
/* Define UChar to be compatible with wchar_t if possible. */
#if U_SIZEOF_WCHAR_T==2
typedef wchar_t UChar;
+#elif U_GNUC_UTF16_STRING
+#if defined _GCC_
+ typedef __CHAR16_TYPE__ char16_t;
+#endif
+ typedef char16_t UChar;
#else
typedef uint16_t UChar;
#endif
@@ -352,6 +342,8 @@ typedef int32_t UChar32;
/* the OS in use. */
/*==========================================================================*/
+#ifndef U_HIDE_INTERNAL_API
+
/**
* \def U_ALIGN_CODE
* This is used to align code fragments to a specific byte boundary.
@@ -362,8 +354,19 @@ typedef int32_t UChar32;
# define U_ALIGN_CODE(n)
#endif
+#endif /* U_HIDE_INTERNAL_API */
+
+/**
+ * \def U_INLINE
+ * This is used to request inlining of a function, on platforms and languages which support it.
+ */
+
#ifndef U_INLINE
-# define U_INLINE
+# ifdef XP_CPLUSPLUS
+# define U_INLINE inline
+# else
+# define U_INLINE
+# endif
#endif
#include "unicode/urename.h"
diff --git a/Source/JavaScriptCore/icu/unicode/unorm.h b/Source/JavaScriptCore/icu/unicode/unorm.h
index 8bdbee7c6..fbb7b49b3 100644
--- a/Source/JavaScriptCore/icu/unicode/unorm.h
+++ b/Source/JavaScriptCore/icu/unicode/unorm.h
@@ -1,6 +1,6 @@
/*
*******************************************************************************
-* Copyright (c) 1996-2004, International Business Machines Corporation
+* Copyright (c) 1996-2010, International Business Machines Corporation
* and others. All Rights Reserved.
*******************************************************************************
* File unorm.h
@@ -20,6 +20,7 @@
#if !UCONFIG_NO_NORMALIZATION
#include "unicode/uiter.h"
+#include "unicode/unorm2.h"
/**
* \file
@@ -27,11 +28,16 @@
*
* <h2>Unicode normalization API</h2>
*
+ * Note: This API has been replaced by the unorm2.h API and is only available
+ * for backward compatibility. The functions here simply delegate to the
+ * unorm2.h functions, for example unorm2_getInstance() and unorm2_normalize().
+ * There is one exception: The new API does not provide a replacement for unorm_compare().
+ *
* <code>unorm_normalize</code> transforms Unicode text into an equivalent composed or
* decomposed form, allowing for easier sorting and searching of text.
* <code>unorm_normalize</code> supports the standard normalization forms described in
* <a href="http://www.unicode.org/unicode/reports/tr15/" target="unicode">
- * Unicode Standard Annex #15 &#8212; Unicode Normalization Forms</a>.
+ * Unicode Standard Annex #15: Unicode Normalization Forms</a>.
*
* Characters with accents or other adornments can be encoded in
* several different ways in Unicode. For example, take the character A-acute.
@@ -106,7 +112,7 @@
* unorm_normalize(UNORM_FCD) may be implemented with UNORM_NFD.
*
* For more details on FCD see the collation design document:
- * http://oss.software.ibm.com/cvs/icu/~checkout~/icuhtml/design/collation/ICU_collation_design.htm
+ * http://source.icu-project.org/repos/icu/icuhtml/trunk/design/collation/ICU_collation_design.htm
*
* ICU collation performs either NFD or FCD normalization automatically if normalization
* is turned on for the collator object.
@@ -182,6 +188,7 @@ enum {
* Normalize a string.
* The string will be normalized according the specified normalization mode
* and options.
+ * The source and result buffers must not be the same, nor overlap.
*
* @param source The string to normalize.
* @param sourceLength The length of source, or -1 if NUL-terminated.
@@ -201,28 +208,7 @@ unorm_normalize(const UChar *source, int32_t sourceLength,
UNormalizationMode mode, int32_t options,
UChar *result, int32_t resultLength,
UErrorCode *status);
-#endif
-/**
- * Result values for unorm_quickCheck().
- * For details see Unicode Technical Report 15.
- * @stable ICU 2.0
- */
-typedef enum UNormalizationCheckResult {
- /**
- * Indicates that string is not in the normalized format
- */
- UNORM_NO,
- /**
- * Indicates that string is in the normalized format
- */
- UNORM_YES,
- /**
- * Indicates that string cannot be determined if it is in the normalized
- * format without further thorough checks.
- */
- UNORM_MAYBE
-} UNormalizationCheckResult;
-#if !UCONFIG_NO_NORMALIZATION
+
/**
* Performing quick check on a string, to quickly determine if the string is
* in a particular normalization format.
@@ -451,7 +437,7 @@ unorm_previous(UCharIterator *src,
*
* @param left Left source string, may be same as dest.
* @param leftLength Length of left source string, or -1 if NUL-terminated.
- * @param right Right source string.
+ * @param right Right source string. Must not be the same as dest, nor overlap.
* @param rightLength Length of right source string, or -1 if NUL-terminated.
* @param dest The output buffer; can be NULL if destCapacity==0 for pure preflighting.
* @param destCapacity The number of UChars that fit into dest.
diff --git a/Source/JavaScriptCore/icu/unicode/unorm2.h b/Source/JavaScriptCore/icu/unicode/unorm2.h
new file mode 100644
index 000000000..a522b4735
--- /dev/null
+++ b/Source/JavaScriptCore/icu/unicode/unorm2.h
@@ -0,0 +1,391 @@
+/*
+*******************************************************************************
+*
+* Copyright (C) 2009-2010, International Business Machines
+* Corporation and others. All Rights Reserved.
+*
+*******************************************************************************
+* file name: unorm2.h
+* encoding: US-ASCII
+* tab size: 8 (not used)
+* indentation:4
+*
+* created on: 2009dec15
+* created by: Markus W. Scherer
+*/
+
+#ifndef __UNORM2_H__
+#define __UNORM2_H__
+
+/**
+ * \file
+ * \brief C API: New API for Unicode Normalization.
+ *
+ * Unicode normalization functionality for standard Unicode normalization or
+ * for using custom mapping tables.
+ * All instances of UNormalizer2 are unmodifiable/immutable.
+ * Instances returned by unorm2_getInstance() are singletons that must not be deleted by the caller.
+ * For more details see the Normalizer2 C++ class.
+ */
+
+#include "unicode/utypes.h"
+#include "unicode/localpointer.h"
+#include "unicode/uset.h"
+
+/**
+ * Constants for normalization modes.
+ * For details about standard Unicode normalization forms
+ * and about the algorithms which are also used with custom mapping tables
+ * see http://www.unicode.org/unicode/reports/tr15/
+ * @stable ICU 4.4
+ */
+typedef enum {
+ /**
+ * Decomposition followed by composition.
+ * Same as standard NFC when using an "nfc" instance.
+ * Same as standard NFKC when using an "nfkc" instance.
+ * For details about standard Unicode normalization forms
+ * see http://www.unicode.org/unicode/reports/tr15/
+ * @stable ICU 4.4
+ */
+ UNORM2_COMPOSE,
+ /**
+ * Map, and reorder canonically.
+ * Same as standard NFD when using an "nfc" instance.
+ * Same as standard NFKD when using an "nfkc" instance.
+ * For details about standard Unicode normalization forms
+ * see http://www.unicode.org/unicode/reports/tr15/
+ * @stable ICU 4.4
+ */
+ UNORM2_DECOMPOSE,
+ /**
+ * "Fast C or D" form.
+ * If a string is in this form, then further decomposition <i>without reordering</i>
+ * would yield the same form as DECOMPOSE.
+ * Text in "Fast C or D" form can be processed efficiently with data tables
+ * that are "canonically closed", that is, that provide equivalent data for
+ * equivalent text, without having to be fully normalized.
+ * Not a standard Unicode normalization form.
+ * Not a unique form: Different FCD strings can be canonically equivalent.
+ * For details see http://www.unicode.org/notes/tn5/#FCD
+ * @stable ICU 4.4
+ */
+ UNORM2_FCD,
+ /**
+ * Compose only contiguously.
+ * Also known as "FCC" or "Fast C Contiguous".
+ * The result will often but not always be in NFC.
+ * The result will conform to FCD which is useful for processing.
+ * Not a standard Unicode normalization form.
+ * For details see http://www.unicode.org/notes/tn5/#FCC
+ * @stable ICU 4.4
+ */
+ UNORM2_COMPOSE_CONTIGUOUS
+} UNormalization2Mode;
+
+/**
+ * Result values for normalization quick check functions.
+ * For details see http://www.unicode.org/reports/tr15/#Detecting_Normalization_Forms
+ * @stable ICU 2.0
+ */
+typedef enum UNormalizationCheckResult {
+ /**
+ * The input string is not in the normalization form.
+ * @stable ICU 2.0
+ */
+ UNORM_NO,
+ /**
+ * The input string is in the normalization form.
+ * @stable ICU 2.0
+ */
+ UNORM_YES,
+ /**
+ * The input string may or may not be in the normalization form.
+ * This value is only returned for composition forms like NFC and FCC,
+ * when a backward-combining character is found for which the surrounding text
+ * would have to be analyzed further.
+ * @stable ICU 2.0
+ */
+ UNORM_MAYBE
+} UNormalizationCheckResult;
+
+/**
+ * Opaque C service object type for the new normalization API.
+ * @stable ICU 4.4
+ */
+struct UNormalizer2;
+typedef struct UNormalizer2 UNormalizer2; /**< C typedef for struct UNormalizer2. @stable ICU 4.4 */
+
+#if !UCONFIG_NO_NORMALIZATION
+
+/**
+ * Returns a UNormalizer2 instance which uses the specified data file
+ * (packageName/name similar to ucnv_openPackage() and ures_open()/ResourceBundle)
+ * and which composes or decomposes text according to the specified mode.
+ * Returns an unmodifiable singleton instance. Do not delete it.
+ *
+ * Use packageName=NULL for data files that are part of ICU's own data.
+ * Use name="nfc" and UNORM2_COMPOSE/UNORM2_DECOMPOSE for Unicode standard NFC/NFD.
+ * Use name="nfkc" and UNORM2_COMPOSE/UNORM2_DECOMPOSE for Unicode standard NFKC/NFKD.
+ * Use name="nfkc_cf" and UNORM2_COMPOSE for Unicode standard NFKC_CF=NFKC_Casefold.
+ *
+ * @param packageName NULL for ICU built-in data, otherwise application data package name
+ * @param name "nfc" or "nfkc" or "nfkc_cf" or name of custom data file
+ * @param mode normalization mode (compose or decompose etc.)
+ * @param pErrorCode Standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return the requested UNormalizer2, if successful
+ * @stable ICU 4.4
+ */
+U_STABLE const UNormalizer2 * U_EXPORT2
+unorm2_getInstance(const char *packageName,
+ const char *name,
+ UNormalization2Mode mode,
+ UErrorCode *pErrorCode);
+
+/**
+ * Constructs a filtered normalizer wrapping any UNormalizer2 instance
+ * and a filter set.
+ * Both are aliased and must not be modified or deleted while this object
+ * is used.
+ * The filter set should be frozen; otherwise the performance will suffer greatly.
+ * @param norm2 wrapped UNormalizer2 instance
+ * @param filterSet USet which determines the characters to be normalized
+ * @param pErrorCode Standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return the requested UNormalizer2, if successful
+ * @stable ICU 4.4
+ */
+U_STABLE UNormalizer2 * U_EXPORT2
+unorm2_openFiltered(const UNormalizer2 *norm2, const USet *filterSet, UErrorCode *pErrorCode);
+
+/**
+ * Closes a UNormalizer2 instance from unorm2_openFiltered().
+ * Do not close instances from unorm2_getInstance()!
+ * @param norm2 UNormalizer2 instance to be closed
+ * @stable ICU 4.4
+ */
+U_STABLE void U_EXPORT2
+unorm2_close(UNormalizer2 *norm2);
+
+#if U_SHOW_CPLUSPLUS_API
+
+U_NAMESPACE_BEGIN
+
+/**
+ * \class LocalUNormalizer2Pointer
+ * "Smart pointer" class, closes a UNormalizer2 via unorm2_close().
+ * For most methods see the LocalPointerBase base class.
+ *
+ * @see LocalPointerBase
+ * @see LocalPointer
+ * @stable ICU 4.4
+ */
+U_DEFINE_LOCAL_OPEN_POINTER(LocalUNormalizer2Pointer, UNormalizer2, unorm2_close);
+
+U_NAMESPACE_END
+
+#endif
+
+/**
+ * Writes the normalized form of the source string to the destination string
+ * (replacing its contents) and returns the length of the destination string.
+ * The source and destination strings must be different buffers.
+ * @param norm2 UNormalizer2 instance
+ * @param src source string
+ * @param length length of the source string, or -1 if NUL-terminated
+ * @param dest destination string; its contents is replaced with normalized src
+ * @param capacity number of UChars that can be written to dest
+ * @param pErrorCode Standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return dest
+ * @stable ICU 4.4
+ */
+U_STABLE int32_t U_EXPORT2
+unorm2_normalize(const UNormalizer2 *norm2,
+ const UChar *src, int32_t length,
+ UChar *dest, int32_t capacity,
+ UErrorCode *pErrorCode);
+/**
+ * Appends the normalized form of the second string to the first string
+ * (merging them at the boundary) and returns the length of the first string.
+ * The result is normalized if the first string was normalized.
+ * The first and second strings must be different buffers.
+ * @param norm2 UNormalizer2 instance
+ * @param first string, should be normalized
+ * @param firstLength length of the first string, or -1 if NUL-terminated
+ * @param firstCapacity number of UChars that can be written to first
+ * @param second string, will be normalized
+ * @param secondLength length of the source string, or -1 if NUL-terminated
+ * @param pErrorCode Standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return first
+ * @stable ICU 4.4
+ */
+U_STABLE int32_t U_EXPORT2
+unorm2_normalizeSecondAndAppend(const UNormalizer2 *norm2,
+ UChar *first, int32_t firstLength, int32_t firstCapacity,
+ const UChar *second, int32_t secondLength,
+ UErrorCode *pErrorCode);
+/**
+ * Appends the second string to the first string
+ * (merging them at the boundary) and returns the length of the first string.
+ * The result is normalized if both the strings were normalized.
+ * The first and second strings must be different buffers.
+ * @param norm2 UNormalizer2 instance
+ * @param first string, should be normalized
+ * @param firstLength length of the first string, or -1 if NUL-terminated
+ * @param firstCapacity number of UChars that can be written to first
+ * @param second string, should be normalized
+ * @param secondLength length of the source string, or -1 if NUL-terminated
+ * @param pErrorCode Standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return first
+ * @stable ICU 4.4
+ */
+U_STABLE int32_t U_EXPORT2
+unorm2_append(const UNormalizer2 *norm2,
+ UChar *first, int32_t firstLength, int32_t firstCapacity,
+ const UChar *second, int32_t secondLength,
+ UErrorCode *pErrorCode);
+
+/**
+ * Gets the decomposition mapping of c. Equivalent to unorm2_normalize(string(c))
+ * on a UNORM2_DECOMPOSE UNormalizer2 instance, but much faster.
+ * This function is independent of the mode of the UNormalizer2.
+ * @param norm2 UNormalizer2 instance
+ * @param c code point
+ * @param decomposition String buffer which will be set to c's
+ * decomposition mapping, if there is one.
+ * @param capacity number of UChars that can be written to decomposition
+ * @param pErrorCode Standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return the non-negative length of c's decomposition, if there is one; otherwise a negative value
+ * @draft ICU 4.6
+ */
+U_DRAFT int32_t U_EXPORT2
+unorm2_getDecomposition(const UNormalizer2 *norm2,
+ UChar32 c, UChar *decomposition, int32_t capacity,
+ UErrorCode *pErrorCode);
+
+/**
+ * Tests if the string is normalized.
+ * Internally, in cases where the quickCheck() method would return "maybe"
+ * (which is only possible for the two COMPOSE modes) this method
+ * resolves to "yes" or "no" to provide a definitive result,
+ * at the cost of doing more work in those cases.
+ * @param norm2 UNormalizer2 instance
+ * @param s input string
+ * @param length length of the string, or -1 if NUL-terminated
+ * @param pErrorCode Standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return TRUE if s is normalized
+ * @stable ICU 4.4
+ */
+U_STABLE UBool U_EXPORT2
+unorm2_isNormalized(const UNormalizer2 *norm2,
+ const UChar *s, int32_t length,
+ UErrorCode *pErrorCode);
+
+/**
+ * Tests if the string is normalized.
+ * For the two COMPOSE modes, the result could be "maybe" in cases that
+ * would take a little more work to resolve definitively.
+ * Use spanQuickCheckYes() and normalizeSecondAndAppend() for a faster
+ * combination of quick check + normalization, to avoid
+ * re-checking the "yes" prefix.
+ * @param norm2 UNormalizer2 instance
+ * @param s input string
+ * @param length length of the string, or -1 if NUL-terminated
+ * @param pErrorCode Standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return UNormalizationCheckResult
+ * @stable ICU 4.4
+ */
+U_STABLE UNormalizationCheckResult U_EXPORT2
+unorm2_quickCheck(const UNormalizer2 *norm2,
+ const UChar *s, int32_t length,
+ UErrorCode *pErrorCode);
+
+/**
+ * Returns the end of the normalized substring of the input string.
+ * In other words, with <code>end=spanQuickCheckYes(s, ec);</code>
+ * the substring <code>UnicodeString(s, 0, end)</code>
+ * will pass the quick check with a "yes" result.
+ *
+ * The returned end index is usually one or more characters before the
+ * "no" or "maybe" character: The end index is at a normalization boundary.
+ * (See the class documentation for more about normalization boundaries.)
+ *
+ * When the goal is a normalized string and most input strings are expected
+ * to be normalized already, then call this method,
+ * and if it returns a prefix shorter than the input string,
+ * copy that prefix and use normalizeSecondAndAppend() for the remainder.
+ * @param norm2 UNormalizer2 instance
+ * @param s input string
+ * @param length length of the string, or -1 if NUL-terminated
+ * @param pErrorCode Standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return "yes" span end index
+ * @stable ICU 4.4
+ */
+U_STABLE int32_t U_EXPORT2
+unorm2_spanQuickCheckYes(const UNormalizer2 *norm2,
+ const UChar *s, int32_t length,
+ UErrorCode *pErrorCode);
+
+/**
+ * Tests if the character always has a normalization boundary before it,
+ * regardless of context.
+ * For details see the Normalizer2 base class documentation.
+ * @param norm2 UNormalizer2 instance
+ * @param c character to test
+ * @return TRUE if c has a normalization boundary before it
+ * @stable ICU 4.4
+ */
+U_STABLE UBool U_EXPORT2
+unorm2_hasBoundaryBefore(const UNormalizer2 *norm2, UChar32 c);
+
+/**
+ * Tests if the character always has a normalization boundary after it,
+ * regardless of context.
+ * For details see the Normalizer2 base class documentation.
+ * @param norm2 UNormalizer2 instance
+ * @param c character to test
+ * @return TRUE if c has a normalization boundary after it
+ * @stable ICU 4.4
+ */
+U_STABLE UBool U_EXPORT2
+unorm2_hasBoundaryAfter(const UNormalizer2 *norm2, UChar32 c);
+
+/**
+ * Tests if the character is normalization-inert.
+ * For details see the Normalizer2 base class documentation.
+ * @param norm2 UNormalizer2 instance
+ * @param c character to test
+ * @return TRUE if c is normalization-inert
+ * @stable ICU 4.4
+ */
+U_STABLE UBool U_EXPORT2
+unorm2_isInert(const UNormalizer2 *norm2, UChar32 c);
+
+#endif /* !UCONFIG_NO_NORMALIZATION */
+#endif /* __UNORM2_H__ */
diff --git a/Source/JavaScriptCore/icu/unicode/urename.h b/Source/JavaScriptCore/icu/unicode/urename.h
index 55625921f..468bdbd0f 100644
--- a/Source/JavaScriptCore/icu/unicode/urename.h
+++ b/Source/JavaScriptCore/icu/unicode/urename.h
@@ -1,6 +1,6 @@
/*
*******************************************************************************
-* Copyright (C) 2002-2004, International Business Machines
+* Copyright (C) 2002-2010, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*
@@ -27,1438 +27,2211 @@
#if !U_DISABLE_RENAMING
+/* We need the U_ICU_ENTRY_POINT_RENAME definition. There's a default one in unicode/uvernum.h we can use, but we will give
+ the platform a chance to define it first.
+ Normally (if utypes.h or umachine.h was included first) this will not be necessary as it will already be defined.
+ */
+#ifndef U_ICU_ENTRY_POINT_RENAME
+#include "unicode/umachine.h"
+#endif
+
+/* If we still don't have U_ICU_ENTRY_POINT_RENAME use the default. */
+#ifndef U_ICU_ENTRY_POINT_RENAME
+#include "unicode/uvernum.h"
+#endif
+
+/* Error out before the following defines cause very strange and unexpected code breakage */
+#ifndef U_ICU_ENTRY_POINT_RENAME
+#error U_ICU_ENTRY_POINT_RENAME is not defined - cannot continue. Consider defining U_DISABLE_RENAMING if renaming should not be used.
+#endif
+
+
/* C exports renaming data */
-#define T_CString_int64ToString T_CString_int64ToString_3_2
-#define T_CString_integerToString T_CString_integerToString_3_2
-#define T_CString_stricmp T_CString_stricmp_3_2
-#define T_CString_stringToInteger T_CString_stringToInteger_3_2
-#define T_CString_strnicmp T_CString_strnicmp_3_2
-#define T_CString_toLowerCase T_CString_toLowerCase_3_2
-#define T_CString_toUpperCase T_CString_toUpperCase_3_2
-#define T_FileStream_close T_FileStream_close_3_2
-#define T_FileStream_eof T_FileStream_eof_3_2
-#define T_FileStream_error T_FileStream_error_3_2
-#define T_FileStream_file_exists T_FileStream_file_exists_3_2
-#define T_FileStream_getc T_FileStream_getc_3_2
-#define T_FileStream_open T_FileStream_open_3_2
-#define T_FileStream_peek T_FileStream_peek_3_2
-#define T_FileStream_putc T_FileStream_putc_3_2
-#define T_FileStream_read T_FileStream_read_3_2
-#define T_FileStream_readLine T_FileStream_readLine_3_2
-#define T_FileStream_remove T_FileStream_remove_3_2
-#define T_FileStream_rewind T_FileStream_rewind_3_2
-#define T_FileStream_size T_FileStream_size_3_2
-#define T_FileStream_stderr T_FileStream_stderr_3_2
-#define T_FileStream_stdin T_FileStream_stdin_3_2
-#define T_FileStream_stdout T_FileStream_stdout_3_2
-#define T_FileStream_ungetc T_FileStream_ungetc_3_2
-#define T_FileStream_write T_FileStream_write_3_2
-#define T_FileStream_writeLine T_FileStream_writeLine_3_2
-#define UCNV_FROM_U_CALLBACK_ESCAPE UCNV_FROM_U_CALLBACK_ESCAPE_3_2
-#define UCNV_FROM_U_CALLBACK_SKIP UCNV_FROM_U_CALLBACK_SKIP_3_2
-#define UCNV_FROM_U_CALLBACK_STOP UCNV_FROM_U_CALLBACK_STOP_3_2
-#define UCNV_FROM_U_CALLBACK_SUBSTITUTE UCNV_FROM_U_CALLBACK_SUBSTITUTE_3_2
-#define UCNV_TO_U_CALLBACK_ESCAPE UCNV_TO_U_CALLBACK_ESCAPE_3_2
-#define UCNV_TO_U_CALLBACK_SKIP UCNV_TO_U_CALLBACK_SKIP_3_2
-#define UCNV_TO_U_CALLBACK_STOP UCNV_TO_U_CALLBACK_STOP_3_2
-#define UCNV_TO_U_CALLBACK_SUBSTITUTE UCNV_TO_U_CALLBACK_SUBSTITUTE_3_2
-#define UDataMemory_createNewInstance UDataMemory_createNewInstance_3_2
-#define UDataMemory_init UDataMemory_init_3_2
-#define UDataMemory_isLoaded UDataMemory_isLoaded_3_2
-#define UDataMemory_normalizeDataPointer UDataMemory_normalizeDataPointer_3_2
-#define UDataMemory_setData UDataMemory_setData_3_2
-#define UDatamemory_assign UDatamemory_assign_3_2
-#define _ASCIIData _ASCIIData_3_2
-#define _Bocu1Data _Bocu1Data_3_2
-#define _CESU8Data _CESU8Data_3_2
-#define _HZData _HZData_3_2
-#define _IMAPData _IMAPData_3_2
-#define _ISCIIData _ISCIIData_3_2
-#define _ISO2022Data _ISO2022Data_3_2
-#define _LMBCSData1 _LMBCSData1_3_2
-#define _LMBCSData11 _LMBCSData11_3_2
-#define _LMBCSData16 _LMBCSData16_3_2
-#define _LMBCSData17 _LMBCSData17_3_2
-#define _LMBCSData18 _LMBCSData18_3_2
-#define _LMBCSData19 _LMBCSData19_3_2
-#define _LMBCSData2 _LMBCSData2_3_2
-#define _LMBCSData3 _LMBCSData3_3_2
-#define _LMBCSData4 _LMBCSData4_3_2
-#define _LMBCSData5 _LMBCSData5_3_2
-#define _LMBCSData6 _LMBCSData6_3_2
-#define _LMBCSData8 _LMBCSData8_3_2
-#define _Latin1Data _Latin1Data_3_2
-#define _MBCSData _MBCSData_3_2
-#define _SCSUData _SCSUData_3_2
-#define _UTF16BEData _UTF16BEData_3_2
-#define _UTF16Data _UTF16Data_3_2
-#define _UTF16LEData _UTF16LEData_3_2
-#define _UTF32BEData _UTF32BEData_3_2
-#define _UTF32Data _UTF32Data_3_2
-#define _UTF32LEData _UTF32LEData_3_2
-#define _UTF7Data _UTF7Data_3_2
-#define _UTF8Data _UTF8Data_3_2
-#define cmemory_cleanup cmemory_cleanup_3_2
-#define cmemory_inUse cmemory_inUse_3_2
-#define locale_getKeywords locale_getKeywords_3_2
-#define locale_get_default locale_get_default_3_2
-#define locale_set_default locale_set_default_3_2
-#define res_countArrayItems res_countArrayItems_3_2
-#define res_findResource res_findResource_3_2
-#define res_getAlias res_getAlias_3_2
-#define res_getArrayItem res_getArrayItem_3_2
-#define res_getBinary res_getBinary_3_2
-#define res_getIntVector res_getIntVector_3_2
-#define res_getResource res_getResource_3_2
-#define res_getString res_getString_3_2
-#define res_getTableItemByIndex res_getTableItemByIndex_3_2
-#define res_getTableItemByKey res_getTableItemByKey_3_2
-#define res_load res_load_3_2
-#define res_unload res_unload_3_2
-#define transliterator_cleanup transliterator_cleanup_3_2
-#define u_UCharsToChars u_UCharsToChars_3_2
-#define u_austrcpy u_austrcpy_3_2
-#define u_austrncpy u_austrncpy_3_2
-#define u_catclose u_catclose_3_2
-#define u_catgets u_catgets_3_2
-#define u_catopen u_catopen_3_2
-#define u_charAge u_charAge_3_2
-#define u_charDigitValue u_charDigitValue_3_2
-#define u_charDirection u_charDirection_3_2
-#define u_charFromName u_charFromName_3_2
-#define u_charMirror u_charMirror_3_2
-#define u_charName u_charName_3_2
-#define u_charType u_charType_3_2
-#define u_charsToUChars u_charsToUChars_3_2
-#define u_cleanup u_cleanup_3_2
-#define u_countChar32 u_countChar32_3_2
-#define u_digit u_digit_3_2
-#define u_enumCharNames u_enumCharNames_3_2
-#define u_enumCharTypes u_enumCharTypes_3_2
-#define u_errorName u_errorName_3_2
-#define u_fclose u_fclose_3_2
-#define u_feof u_feof_3_2
-#define u_fflush u_fflush_3_2
-#define u_fgetConverter u_fgetConverter_3_2
-#define u_fgetc u_fgetc_3_2
-#define u_fgetcodepage u_fgetcodepage_3_2
-#define u_fgetcx u_fgetcx_3_2
-#define u_fgetfile u_fgetfile_3_2
-#define u_fgetlocale u_fgetlocale_3_2
-#define u_fgets u_fgets_3_2
-#define u_file_read u_file_read_3_2
-#define u_file_write u_file_write_3_2
-#define u_file_write_flush u_file_write_flush_3_2
-#define u_finit u_finit_3_2
-#define u_foldCase u_foldCase_3_2
-#define u_fopen u_fopen_3_2
-#define u_forDigit u_forDigit_3_2
-#define u_formatMessage u_formatMessage_3_2
-#define u_formatMessageWithError u_formatMessageWithError_3_2
-#define u_fprintf u_fprintf_3_2
-#define u_fprintf_u u_fprintf_u_3_2
-#define u_fputc u_fputc_3_2
-#define u_fputs u_fputs_3_2
-#define u_frewind u_frewind_3_2
-#define u_fscanf u_fscanf_3_2
-#define u_fscanf_u u_fscanf_u_3_2
-#define u_fsetcodepage u_fsetcodepage_3_2
-#define u_fsetlocale u_fsetlocale_3_2
-#define u_fsettransliterator u_fsettransliterator_3_2
-#define u_fstropen u_fstropen_3_2
-#define u_fungetc u_fungetc_3_2
-#define u_getCombiningClass u_getCombiningClass_3_2
-#define u_getDataDirectory u_getDataDirectory_3_2
-#define u_getDefaultConverter u_getDefaultConverter_3_2
-#define u_getFC_NFKC_Closure u_getFC_NFKC_Closure_3_2
-#define u_getISOComment u_getISOComment_3_2
-#define u_getIntPropertyMaxValue u_getIntPropertyMaxValue_3_2
-#define u_getIntPropertyMinValue u_getIntPropertyMinValue_3_2
-#define u_getIntPropertyValue u_getIntPropertyValue_3_2
-#define u_getNumericValue u_getNumericValue_3_2
-#define u_getPropertyEnum u_getPropertyEnum_3_2
-#define u_getPropertyName u_getPropertyName_3_2
-#define u_getPropertyValueEnum u_getPropertyValueEnum_3_2
-#define u_getPropertyValueName u_getPropertyValueName_3_2
-#define u_getUnicodeProperties u_getUnicodeProperties_3_2
-#define u_getUnicodeVersion u_getUnicodeVersion_3_2
-#define u_getVersion u_getVersion_3_2
-#define u_growBufferFromStatic u_growBufferFromStatic_3_2
-#define u_hasBinaryProperty u_hasBinaryProperty_3_2
-#define u_init u_init_3_2
-#define u_isIDIgnorable u_isIDIgnorable_3_2
-#define u_isIDPart u_isIDPart_3_2
-#define u_isIDStart u_isIDStart_3_2
-#define u_isISOControl u_isISOControl_3_2
-#define u_isJavaIDPart u_isJavaIDPart_3_2
-#define u_isJavaIDStart u_isJavaIDStart_3_2
-#define u_isJavaSpaceChar u_isJavaSpaceChar_3_2
-#define u_isMirrored u_isMirrored_3_2
-#define u_isUAlphabetic u_isUAlphabetic_3_2
-#define u_isULowercase u_isULowercase_3_2
-#define u_isUUppercase u_isUUppercase_3_2
-#define u_isUWhiteSpace u_isUWhiteSpace_3_2
-#define u_isWhitespace u_isWhitespace_3_2
-#define u_isalnum u_isalnum_3_2
-#define u_isalpha u_isalpha_3_2
-#define u_isbase u_isbase_3_2
-#define u_isblank u_isblank_3_2
-#define u_iscntrl u_iscntrl_3_2
-#define u_isdefined u_isdefined_3_2
-#define u_isdigit u_isdigit_3_2
-#define u_isgraph u_isgraph_3_2
-#define u_islower u_islower_3_2
-#define u_isprint u_isprint_3_2
-#define u_ispunct u_ispunct_3_2
-#define u_isspace u_isspace_3_2
-#define u_istitle u_istitle_3_2
-#define u_isupper u_isupper_3_2
-#define u_isxdigit u_isxdigit_3_2
-#define u_lengthOfIdenticalLevelRun u_lengthOfIdenticalLevelRun_3_2
-#define u_locbund_close u_locbund_close_3_2
-#define u_locbund_getNumberFormat u_locbund_getNumberFormat_3_2
-#define u_locbund_init u_locbund_init_3_2
-#define u_memcasecmp u_memcasecmp_3_2
-#define u_memchr u_memchr_3_2
-#define u_memchr32 u_memchr32_3_2
-#define u_memcmp u_memcmp_3_2
-#define u_memcmpCodePointOrder u_memcmpCodePointOrder_3_2
-#define u_memcpy u_memcpy_3_2
-#define u_memmove u_memmove_3_2
-#define u_memrchr u_memrchr_3_2
-#define u_memrchr32 u_memrchr32_3_2
-#define u_memset u_memset_3_2
-#define u_parseMessage u_parseMessage_3_2
-#define u_parseMessageWithError u_parseMessageWithError_3_2
-#define u_printf_parse u_printf_parse_3_2
-#define u_releaseDefaultConverter u_releaseDefaultConverter_3_2
-#define u_scanf_parse u_scanf_parse_3_2
-#define u_setAtomicIncDecFunctions u_setAtomicIncDecFunctions_3_2
-#define u_setDataDirectory u_setDataDirectory_3_2
-#define u_setMemoryFunctions u_setMemoryFunctions_3_2
-#define u_setMutexFunctions u_setMutexFunctions_3_2
-#define u_shapeArabic u_shapeArabic_3_2
-#define u_snprintf u_snprintf_3_2
-#define u_snprintf_u u_snprintf_u_3_2
-#define u_sprintf u_sprintf_3_2
-#define u_sprintf_u u_sprintf_u_3_2
-#define u_sscanf u_sscanf_3_2
-#define u_sscanf_u u_sscanf_u_3_2
-#define u_strCaseCompare u_strCaseCompare_3_2
-#define u_strCompare u_strCompare_3_2
-#define u_strCompareIter u_strCompareIter_3_2
-#define u_strFindFirst u_strFindFirst_3_2
-#define u_strFindLast u_strFindLast_3_2
-#define u_strFoldCase u_strFoldCase_3_2
-#define u_strFromPunycode u_strFromPunycode_3_2
-#define u_strFromUTF32 u_strFromUTF32_3_2
-#define u_strFromUTF8 u_strFromUTF8_3_2
-#define u_strFromWCS u_strFromWCS_3_2
-#define u_strHasMoreChar32Than u_strHasMoreChar32Than_3_2
-#define u_strToLower u_strToLower_3_2
-#define u_strToPunycode u_strToPunycode_3_2
-#define u_strToTitle u_strToTitle_3_2
-#define u_strToUTF32 u_strToUTF32_3_2
-#define u_strToUTF8 u_strToUTF8_3_2
-#define u_strToUpper u_strToUpper_3_2
-#define u_strToWCS u_strToWCS_3_2
-#define u_strcasecmp u_strcasecmp_3_2
-#define u_strcat u_strcat_3_2
-#define u_strchr u_strchr_3_2
-#define u_strchr32 u_strchr32_3_2
-#define u_strcmp u_strcmp_3_2
-#define u_strcmpCodePointOrder u_strcmpCodePointOrder_3_2
-#define u_strcmpFold u_strcmpFold_3_2
-#define u_strcpy u_strcpy_3_2
-#define u_strcspn u_strcspn_3_2
-#define u_strlen u_strlen_3_2
-#define u_strncasecmp u_strncasecmp_3_2
-#define u_strncat u_strncat_3_2
-#define u_strncmp u_strncmp_3_2
-#define u_strncmpCodePointOrder u_strncmpCodePointOrder_3_2
-#define u_strncpy u_strncpy_3_2
-#define u_strpbrk u_strpbrk_3_2
-#define u_strrchr u_strrchr_3_2
-#define u_strrchr32 u_strrchr32_3_2
-#define u_strrstr u_strrstr_3_2
-#define u_strspn u_strspn_3_2
-#define u_strstr u_strstr_3_2
-#define u_strtok_r u_strtok_r_3_2
-#define u_terminateChars u_terminateChars_3_2
-#define u_terminateUChar32s u_terminateUChar32s_3_2
-#define u_terminateUChars u_terminateUChars_3_2
-#define u_terminateWChars u_terminateWChars_3_2
-#define u_tolower u_tolower_3_2
-#define u_totitle u_totitle_3_2
-#define u_toupper u_toupper_3_2
-#define u_uastrcpy u_uastrcpy_3_2
-#define u_uastrncpy u_uastrncpy_3_2
-#define u_unescape u_unescape_3_2
-#define u_unescapeAt u_unescapeAt_3_2
-#define u_versionFromString u_versionFromString_3_2
-#define u_versionToString u_versionToString_3_2
-#define u_vformatMessage u_vformatMessage_3_2
-#define u_vformatMessageWithError u_vformatMessageWithError_3_2
-#define u_vfprintf u_vfprintf_3_2
-#define u_vfprintf_u u_vfprintf_u_3_2
-#define u_vfscanf u_vfscanf_3_2
-#define u_vfscanf_u u_vfscanf_u_3_2
-#define u_vparseMessage u_vparseMessage_3_2
-#define u_vparseMessageWithError u_vparseMessageWithError_3_2
-#define u_vsnprintf u_vsnprintf_3_2
-#define u_vsnprintf_u u_vsnprintf_u_3_2
-#define u_vsprintf u_vsprintf_3_2
-#define u_vsprintf_u u_vsprintf_u_3_2
-#define u_vsscanf u_vsscanf_3_2
-#define u_vsscanf_u u_vsscanf_u_3_2
-#define u_writeDiff u_writeDiff_3_2
-#define u_writeIdenticalLevelRun u_writeIdenticalLevelRun_3_2
-#define u_writeIdenticalLevelRunTwoChars u_writeIdenticalLevelRunTwoChars_3_2
-#define ubidi_close ubidi_close_3_2
-#define ubidi_countRuns ubidi_countRuns_3_2
-#define ubidi_getDirection ubidi_getDirection_3_2
-#define ubidi_getLength ubidi_getLength_3_2
-#define ubidi_getLevelAt ubidi_getLevelAt_3_2
-#define ubidi_getLevels ubidi_getLevels_3_2
-#define ubidi_getLogicalIndex ubidi_getLogicalIndex_3_2
-#define ubidi_getLogicalMap ubidi_getLogicalMap_3_2
-#define ubidi_getLogicalRun ubidi_getLogicalRun_3_2
-#define ubidi_getMemory ubidi_getMemory_3_2
-#define ubidi_getParaLevel ubidi_getParaLevel_3_2
-#define ubidi_getRuns ubidi_getRuns_3_2
-#define ubidi_getText ubidi_getText_3_2
-#define ubidi_getVisualIndex ubidi_getVisualIndex_3_2
-#define ubidi_getVisualMap ubidi_getVisualMap_3_2
-#define ubidi_getVisualRun ubidi_getVisualRun_3_2
-#define ubidi_invertMap ubidi_invertMap_3_2
-#define ubidi_isInverse ubidi_isInverse_3_2
-#define ubidi_open ubidi_open_3_2
-#define ubidi_openSized ubidi_openSized_3_2
-#define ubidi_reorderLogical ubidi_reorderLogical_3_2
-#define ubidi_reorderVisual ubidi_reorderVisual_3_2
-#define ubidi_setInverse ubidi_setInverse_3_2
-#define ubidi_setLine ubidi_setLine_3_2
-#define ubidi_setPara ubidi_setPara_3_2
-#define ubidi_writeReordered ubidi_writeReordered_3_2
-#define ubidi_writeReverse ubidi_writeReverse_3_2
-#define ublock_getCode ublock_getCode_3_2
-#define ubrk_close ubrk_close_3_2
-#define ubrk_countAvailable ubrk_countAvailable_3_2
-#define ubrk_current ubrk_current_3_2
-#define ubrk_first ubrk_first_3_2
-#define ubrk_following ubrk_following_3_2
-#define ubrk_getAvailable ubrk_getAvailable_3_2
-#define ubrk_getLocaleByType ubrk_getLocaleByType_3_2
-#define ubrk_getRuleStatus ubrk_getRuleStatus_3_2
-#define ubrk_getRuleStatusVec ubrk_getRuleStatusVec_3_2
-#define ubrk_isBoundary ubrk_isBoundary_3_2
-#define ubrk_last ubrk_last_3_2
-#define ubrk_next ubrk_next_3_2
-#define ubrk_open ubrk_open_3_2
-#define ubrk_openRules ubrk_openRules_3_2
-#define ubrk_preceding ubrk_preceding_3_2
-#define ubrk_previous ubrk_previous_3_2
-#define ubrk_safeClone ubrk_safeClone_3_2
-#define ubrk_setText ubrk_setText_3_2
-#define ubrk_swap ubrk_swap_3_2
-#define ucal_add ucal_add_3_2
-#define ucal_clear ucal_clear_3_2
-#define ucal_clearField ucal_clearField_3_2
-#define ucal_close ucal_close_3_2
-#define ucal_countAvailable ucal_countAvailable_3_2
-#define ucal_equivalentTo ucal_equivalentTo_3_2
-#define ucal_get ucal_get_3_2
-#define ucal_getAttribute ucal_getAttribute_3_2
-#define ucal_getAvailable ucal_getAvailable_3_2
-#define ucal_getDSTSavings ucal_getDSTSavings_3_2
-#define ucal_getDefaultTimeZone ucal_getDefaultTimeZone_3_2
-#define ucal_getLimit ucal_getLimit_3_2
-#define ucal_getLocaleByType ucal_getLocaleByType_3_2
-#define ucal_getMillis ucal_getMillis_3_2
-#define ucal_getNow ucal_getNow_3_2
-#define ucal_getTimeZoneDisplayName ucal_getTimeZoneDisplayName_3_2
-#define ucal_inDaylightTime ucal_inDaylightTime_3_2
-#define ucal_isSet ucal_isSet_3_2
-#define ucal_open ucal_open_3_2
-#define ucal_openCountryTimeZones ucal_openCountryTimeZones_3_2
-#define ucal_openTimeZones ucal_openTimeZones_3_2
-#define ucal_roll ucal_roll_3_2
-#define ucal_set ucal_set_3_2
-#define ucal_setAttribute ucal_setAttribute_3_2
-#define ucal_setDate ucal_setDate_3_2
-#define ucal_setDateTime ucal_setDateTime_3_2
-#define ucal_setDefaultTimeZone ucal_setDefaultTimeZone_3_2
-#define ucal_setMillis ucal_setMillis_3_2
-#define ucal_setTimeZone ucal_setTimeZone_3_2
-#define ucase_addPropertyStarts ucase_addPropertyStarts_3_2
-#define ucase_close ucase_close_3_2
-#define ucase_fold ucase_fold_3_2
-#define ucase_getSingleton ucase_getSingleton_3_2
-#define ucase_getType ucase_getType_3_2
-#define ucase_getTypeOrIgnorable ucase_getTypeOrIgnorable_3_2
-#define ucase_isCaseSensitive ucase_isCaseSensitive_3_2
-#define ucase_isSoftDotted ucase_isSoftDotted_3_2
-#define ucase_open ucase_open_3_2
-#define ucase_openBinary ucase_openBinary_3_2
-#define ucase_swap ucase_swap_3_2
-#define ucase_toFullFolding ucase_toFullFolding_3_2
-#define ucase_toFullLower ucase_toFullLower_3_2
-#define ucase_toFullTitle ucase_toFullTitle_3_2
-#define ucase_toFullUpper ucase_toFullUpper_3_2
-#define ucase_tolower ucase_tolower_3_2
-#define ucase_totitle ucase_totitle_3_2
-#define ucase_toupper ucase_toupper_3_2
-#define uchar_addPropertyStarts uchar_addPropertyStarts_3_2
-#define uchar_getHST uchar_getHST_3_2
-#define uchar_swapNames uchar_swapNames_3_2
-#define ucln_common_lib_cleanup ucln_common_lib_cleanup_3_2
-#define ucln_common_registerCleanup ucln_common_registerCleanup_3_2
-#define ucln_i18n_registerCleanup ucln_i18n_registerCleanup_3_2
-#define ucln_registerCleanup ucln_registerCleanup_3_2
-#define ucmp8_close ucmp8_close_3_2
-#define ucmp8_compact ucmp8_compact_3_2
-#define ucmp8_expand ucmp8_expand_3_2
-#define ucmp8_flattenMem ucmp8_flattenMem_3_2
-#define ucmp8_getArray ucmp8_getArray_3_2
-#define ucmp8_getCount ucmp8_getCount_3_2
-#define ucmp8_getIndex ucmp8_getIndex_3_2
-#define ucmp8_getkBlockCount ucmp8_getkBlockCount_3_2
-#define ucmp8_getkUnicodeCount ucmp8_getkUnicodeCount_3_2
-#define ucmp8_init ucmp8_init_3_2
-#define ucmp8_initAdopt ucmp8_initAdopt_3_2
-#define ucmp8_initAlias ucmp8_initAlias_3_2
-#define ucmp8_initBogus ucmp8_initBogus_3_2
-#define ucmp8_initFromData ucmp8_initFromData_3_2
-#define ucmp8_isBogus ucmp8_isBogus_3_2
-#define ucmp8_open ucmp8_open_3_2
-#define ucmp8_openAdopt ucmp8_openAdopt_3_2
-#define ucmp8_openAlias ucmp8_openAlias_3_2
-#define ucmp8_set ucmp8_set_3_2
-#define ucmp8_setRange ucmp8_setRange_3_2
-#define ucnv_MBCSFromUChar32 ucnv_MBCSFromUChar32_3_2
-#define ucnv_MBCSFromUnicodeWithOffsets ucnv_MBCSFromUnicodeWithOffsets_3_2
-#define ucnv_MBCSGetType ucnv_MBCSGetType_3_2
-#define ucnv_MBCSGetUnicodeSetForBytes ucnv_MBCSGetUnicodeSetForBytes_3_2
-#define ucnv_MBCSGetUnicodeSetForUnicode ucnv_MBCSGetUnicodeSetForUnicode_3_2
-#define ucnv_MBCSIsLeadByte ucnv_MBCSIsLeadByte_3_2
-#define ucnv_MBCSSimpleGetNextUChar ucnv_MBCSSimpleGetNextUChar_3_2
-#define ucnv_MBCSToUnicodeWithOffsets ucnv_MBCSToUnicodeWithOffsets_3_2
-#define ucnv_cbFromUWriteBytes ucnv_cbFromUWriteBytes_3_2
-#define ucnv_cbFromUWriteSub ucnv_cbFromUWriteSub_3_2
-#define ucnv_cbFromUWriteUChars ucnv_cbFromUWriteUChars_3_2
-#define ucnv_cbToUWriteSub ucnv_cbToUWriteSub_3_2
-#define ucnv_cbToUWriteUChars ucnv_cbToUWriteUChars_3_2
-#define ucnv_close ucnv_close_3_2
-#define ucnv_compareNames ucnv_compareNames_3_2
-#define ucnv_convert ucnv_convert_3_2
-#define ucnv_convertEx ucnv_convertEx_3_2
-#define ucnv_copyPlatformString ucnv_copyPlatformString_3_2
-#define ucnv_countAliases ucnv_countAliases_3_2
-#define ucnv_countAvailable ucnv_countAvailable_3_2
-#define ucnv_countStandards ucnv_countStandards_3_2
-#define ucnv_createAlgorithmicConverter ucnv_createAlgorithmicConverter_3_2
-#define ucnv_createConverter ucnv_createConverter_3_2
-#define ucnv_createConverterFromPackage ucnv_createConverterFromPackage_3_2
-#define ucnv_createConverterFromSharedData ucnv_createConverterFromSharedData_3_2
-#define ucnv_detectUnicodeSignature ucnv_detectUnicodeSignature_3_2
-#define ucnv_extContinueMatchFromU ucnv_extContinueMatchFromU_3_2
-#define ucnv_extContinueMatchToU ucnv_extContinueMatchToU_3_2
-#define ucnv_extGetUnicodeSet ucnv_extGetUnicodeSet_3_2
-#define ucnv_extInitialMatchFromU ucnv_extInitialMatchFromU_3_2
-#define ucnv_extInitialMatchToU ucnv_extInitialMatchToU_3_2
-#define ucnv_extSimpleMatchFromU ucnv_extSimpleMatchFromU_3_2
-#define ucnv_extSimpleMatchToU ucnv_extSimpleMatchToU_3_2
-#define ucnv_fixFileSeparator ucnv_fixFileSeparator_3_2
-#define ucnv_flushCache ucnv_flushCache_3_2
-#define ucnv_fromAlgorithmic ucnv_fromAlgorithmic_3_2
-#define ucnv_fromUChars ucnv_fromUChars_3_2
-#define ucnv_fromUWriteBytes ucnv_fromUWriteBytes_3_2
-#define ucnv_fromUnicode ucnv_fromUnicode_3_2
-#define ucnv_fromUnicode_UTF8 ucnv_fromUnicode_UTF8_3_2
-#define ucnv_fromUnicode_UTF8_OFFSETS_LOGIC ucnv_fromUnicode_UTF8_OFFSETS_LOGIC_3_2
-#define ucnv_getAlias ucnv_getAlias_3_2
-#define ucnv_getAliases ucnv_getAliases_3_2
-#define ucnv_getAvailableName ucnv_getAvailableName_3_2
-#define ucnv_getCCSID ucnv_getCCSID_3_2
-#define ucnv_getCanonicalName ucnv_getCanonicalName_3_2
-#define ucnv_getCompleteUnicodeSet ucnv_getCompleteUnicodeSet_3_2
-#define ucnv_getDefaultName ucnv_getDefaultName_3_2
-#define ucnv_getDisplayName ucnv_getDisplayName_3_2
-#define ucnv_getFromUCallBack ucnv_getFromUCallBack_3_2
-#define ucnv_getInvalidChars ucnv_getInvalidChars_3_2
-#define ucnv_getInvalidUChars ucnv_getInvalidUChars_3_2
-#define ucnv_getMaxCharSize ucnv_getMaxCharSize_3_2
-#define ucnv_getMinCharSize ucnv_getMinCharSize_3_2
-#define ucnv_getName ucnv_getName_3_2
-#define ucnv_getNextUChar ucnv_getNextUChar_3_2
-#define ucnv_getNonSurrogateUnicodeSet ucnv_getNonSurrogateUnicodeSet_3_2
-#define ucnv_getPlatform ucnv_getPlatform_3_2
-#define ucnv_getStandard ucnv_getStandard_3_2
-#define ucnv_getStandardName ucnv_getStandardName_3_2
-#define ucnv_getStarters ucnv_getStarters_3_2
-#define ucnv_getSubstChars ucnv_getSubstChars_3_2
-#define ucnv_getToUCallBack ucnv_getToUCallBack_3_2
-#define ucnv_getType ucnv_getType_3_2
-#define ucnv_getUnicodeSet ucnv_getUnicodeSet_3_2
-#define ucnv_incrementRefCount ucnv_incrementRefCount_3_2
-#define ucnv_io_countAliases ucnv_io_countAliases_3_2
-#define ucnv_io_countAvailableAliases ucnv_io_countAvailableAliases_3_2
-#define ucnv_io_countAvailableConverters ucnv_io_countAvailableConverters_3_2
-#define ucnv_io_countStandards ucnv_io_countStandards_3_2
-#define ucnv_io_flushAvailableConverterCache ucnv_io_flushAvailableConverterCache_3_2
-#define ucnv_io_getAlias ucnv_io_getAlias_3_2
-#define ucnv_io_getAliases ucnv_io_getAliases_3_2
-#define ucnv_io_getAvailableConverter ucnv_io_getAvailableConverter_3_2
-#define ucnv_io_getConverterName ucnv_io_getConverterName_3_2
-#define ucnv_io_getDefaultConverterName ucnv_io_getDefaultConverterName_3_2
-#define ucnv_io_setDefaultConverterName ucnv_io_setDefaultConverterName_3_2
-#define ucnv_io_stripASCIIForCompare ucnv_io_stripASCIIForCompare_3_2
-#define ucnv_io_stripEBCDICForCompare ucnv_io_stripEBCDICForCompare_3_2
-#define ucnv_isAmbiguous ucnv_isAmbiguous_3_2
-#define ucnv_load ucnv_load_3_2
-#define ucnv_loadSharedData ucnv_loadSharedData_3_2
-#define ucnv_open ucnv_open_3_2
-#define ucnv_openAllNames ucnv_openAllNames_3_2
-#define ucnv_openCCSID ucnv_openCCSID_3_2
-#define ucnv_openPackage ucnv_openPackage_3_2
-#define ucnv_openStandardNames ucnv_openStandardNames_3_2
-#define ucnv_openU ucnv_openU_3_2
-#define ucnv_reset ucnv_reset_3_2
-#define ucnv_resetFromUnicode ucnv_resetFromUnicode_3_2
-#define ucnv_resetToUnicode ucnv_resetToUnicode_3_2
-#define ucnv_safeClone ucnv_safeClone_3_2
-#define ucnv_setDefaultName ucnv_setDefaultName_3_2
-#define ucnv_setFallback ucnv_setFallback_3_2
-#define ucnv_setFromUCallBack ucnv_setFromUCallBack_3_2
-#define ucnv_setSubstChars ucnv_setSubstChars_3_2
-#define ucnv_setToUCallBack ucnv_setToUCallBack_3_2
-#define ucnv_swap ucnv_swap_3_2
-#define ucnv_swapAliases ucnv_swapAliases_3_2
-#define ucnv_toAlgorithmic ucnv_toAlgorithmic_3_2
-#define ucnv_toUChars ucnv_toUChars_3_2
-#define ucnv_toUWriteCodePoint ucnv_toUWriteCodePoint_3_2
-#define ucnv_toUWriteUChars ucnv_toUWriteUChars_3_2
-#define ucnv_toUnicode ucnv_toUnicode_3_2
-#define ucnv_unload ucnv_unload_3_2
-#define ucnv_unloadSharedDataIfReady ucnv_unloadSharedDataIfReady_3_2
-#define ucnv_usesFallback ucnv_usesFallback_3_2
-#define ucol_allocWeights ucol_allocWeights_3_2
-#define ucol_assembleTailoringTable ucol_assembleTailoringTable_3_2
-#define ucol_calcSortKey ucol_calcSortKey_3_2
-#define ucol_calcSortKeySimpleTertiary ucol_calcSortKeySimpleTertiary_3_2
-#define ucol_cloneBinary ucol_cloneBinary_3_2
-#define ucol_cloneRuleData ucol_cloneRuleData_3_2
-#define ucol_close ucol_close_3_2
-#define ucol_closeElements ucol_closeElements_3_2
-#define ucol_collatorToIdentifier ucol_collatorToIdentifier_3_2
-#define ucol_countAvailable ucol_countAvailable_3_2
-#define ucol_createElements ucol_createElements_3_2
-#define ucol_doCE ucol_doCE_3_2
-#define ucol_equal ucol_equal_3_2
-#define ucol_equals ucol_equals_3_2
-#define ucol_getAttribute ucol_getAttribute_3_2
-#define ucol_getAttributeOrDefault ucol_getAttributeOrDefault_3_2
-#define ucol_getAvailable ucol_getAvailable_3_2
-#define ucol_getBound ucol_getBound_3_2
-#define ucol_getCEGenerator ucol_getCEGenerator_3_2
-#define ucol_getCEStrengthDifference ucol_getCEStrengthDifference_3_2
-#define ucol_getContractions ucol_getContractions_3_2
-#define ucol_getDisplayName ucol_getDisplayName_3_2
-#define ucol_getFirstCE ucol_getFirstCE_3_2
-#define ucol_getFunctionalEquivalent ucol_getFunctionalEquivalent_3_2
-#define ucol_getKeywordValues ucol_getKeywordValues_3_2
-#define ucol_getKeywords ucol_getKeywords_3_2
-#define ucol_getLocale ucol_getLocale_3_2
-#define ucol_getLocaleByType ucol_getLocaleByType_3_2
-#define ucol_getMaxExpansion ucol_getMaxExpansion_3_2
-#define ucol_getNextCE ucol_getNextCE_3_2
-#define ucol_getNextGenerated ucol_getNextGenerated_3_2
-#define ucol_getOffset ucol_getOffset_3_2
-#define ucol_getPrevCE ucol_getPrevCE_3_2
-#define ucol_getRules ucol_getRules_3_2
-#define ucol_getRulesEx ucol_getRulesEx_3_2
-#define ucol_getShortDefinitionString ucol_getShortDefinitionString_3_2
-#define ucol_getSimpleCEGenerator ucol_getSimpleCEGenerator_3_2
-#define ucol_getSortKey ucol_getSortKey_3_2
-#define ucol_getSortKeySize ucol_getSortKeySize_3_2
-#define ucol_getSortKeyWithAllocation ucol_getSortKeyWithAllocation_3_2
-#define ucol_getStrength ucol_getStrength_3_2
-#define ucol_getTailoredSet ucol_getTailoredSet_3_2
-#define ucol_getUCAVersion ucol_getUCAVersion_3_2
-#define ucol_getUnsafeSet ucol_getUnsafeSet_3_2
-#define ucol_getVariableTop ucol_getVariableTop_3_2
-#define ucol_getVersion ucol_getVersion_3_2
-#define ucol_greater ucol_greater_3_2
-#define ucol_greaterOrEqual ucol_greaterOrEqual_3_2
-#define ucol_identifierToShortString ucol_identifierToShortString_3_2
-#define ucol_initBuffers ucol_initBuffers_3_2
-#define ucol_initCollator ucol_initCollator_3_2
-#define ucol_initInverseUCA ucol_initInverseUCA_3_2
-#define ucol_initUCA ucol_initUCA_3_2
-#define ucol_inv_getGapPositions ucol_inv_getGapPositions_3_2
-#define ucol_inv_getNextCE ucol_inv_getNextCE_3_2
-#define ucol_inv_getPrevCE ucol_inv_getPrevCE_3_2
-#define ucol_isTailored ucol_isTailored_3_2
-#define ucol_keyHashCode ucol_keyHashCode_3_2
-#define ucol_mergeSortkeys ucol_mergeSortkeys_3_2
-#define ucol_next ucol_next_3_2
-#define ucol_nextSortKeyPart ucol_nextSortKeyPart_3_2
-#define ucol_nextWeight ucol_nextWeight_3_2
-#define ucol_normalizeShortDefinitionString ucol_normalizeShortDefinitionString_3_2
-#define ucol_open ucol_open_3_2
-#define ucol_openAvailableLocales ucol_openAvailableLocales_3_2
-#define ucol_openBinary ucol_openBinary_3_2
-#define ucol_openElements ucol_openElements_3_2
-#define ucol_openFromIdentifier ucol_openFromIdentifier_3_2
-#define ucol_openFromShortString ucol_openFromShortString_3_2
-#define ucol_openRules ucol_openRules_3_2
-#define ucol_open_internal ucol_open_internal_3_2
-#define ucol_previous ucol_previous_3_2
-#define ucol_primaryOrder ucol_primaryOrder_3_2
-#define ucol_prv_getSpecialCE ucol_prv_getSpecialCE_3_2
-#define ucol_prv_getSpecialPrevCE ucol_prv_getSpecialPrevCE_3_2
-#define ucol_reset ucol_reset_3_2
-#define ucol_restoreVariableTop ucol_restoreVariableTop_3_2
-#define ucol_safeClone ucol_safeClone_3_2
-#define ucol_secondaryOrder ucol_secondaryOrder_3_2
-#define ucol_setAttribute ucol_setAttribute_3_2
-#define ucol_setOffset ucol_setOffset_3_2
-#define ucol_setOptionsFromHeader ucol_setOptionsFromHeader_3_2
-#define ucol_setReqValidLocales ucol_setReqValidLocales_3_2
-#define ucol_setStrength ucol_setStrength_3_2
-#define ucol_setText ucol_setText_3_2
-#define ucol_setVariableTop ucol_setVariableTop_3_2
-#define ucol_shortStringToIdentifier ucol_shortStringToIdentifier_3_2
-#define ucol_sortKeyToString ucol_sortKeyToString_3_2
-#define ucol_strcoll ucol_strcoll_3_2
-#define ucol_strcollIter ucol_strcollIter_3_2
-#define ucol_swap ucol_swap_3_2
-#define ucol_swapBinary ucol_swapBinary_3_2
-#define ucol_swapInverseUCA ucol_swapInverseUCA_3_2
-#define ucol_tertiaryOrder ucol_tertiaryOrder_3_2
-#define ucol_tok_assembleTokenList ucol_tok_assembleTokenList_3_2
-#define ucol_tok_closeTokenList ucol_tok_closeTokenList_3_2
-#define ucol_tok_getNextArgument ucol_tok_getNextArgument_3_2
-#define ucol_tok_initTokenList ucol_tok_initTokenList_3_2
-#define ucol_tok_parseNextToken ucol_tok_parseNextToken_3_2
-#define ucol_updateInternalState ucol_updateInternalState_3_2
-#define ucurr_forLocale ucurr_forLocale_3_2
-#define ucurr_getDefaultFractionDigits ucurr_getDefaultFractionDigits_3_2
-#define ucurr_getName ucurr_getName_3_2
-#define ucurr_getRoundingIncrement ucurr_getRoundingIncrement_3_2
-#define ucurr_register ucurr_register_3_2
-#define ucurr_unregister ucurr_unregister_3_2
-#define udat_applyPattern udat_applyPattern_3_2
-#define udat_clone udat_clone_3_2
-#define udat_close udat_close_3_2
-#define udat_countAvailable udat_countAvailable_3_2
-#define udat_countSymbols udat_countSymbols_3_2
-#define udat_format udat_format_3_2
-#define udat_get2DigitYearStart udat_get2DigitYearStart_3_2
-#define udat_getAvailable udat_getAvailable_3_2
-#define udat_getCalendar udat_getCalendar_3_2
-#define udat_getLocaleByType udat_getLocaleByType_3_2
-#define udat_getNumberFormat udat_getNumberFormat_3_2
-#define udat_getSymbols udat_getSymbols_3_2
-#define udat_isLenient udat_isLenient_3_2
-#define udat_open udat_open_3_2
-#define udat_parse udat_parse_3_2
-#define udat_parseCalendar udat_parseCalendar_3_2
-#define udat_set2DigitYearStart udat_set2DigitYearStart_3_2
-#define udat_setCalendar udat_setCalendar_3_2
-#define udat_setLenient udat_setLenient_3_2
-#define udat_setNumberFormat udat_setNumberFormat_3_2
-#define udat_setSymbols udat_setSymbols_3_2
-#define udat_toPattern udat_toPattern_3_2
-#define udata_checkCommonData udata_checkCommonData_3_2
-#define udata_close udata_close_3_2
-#define udata_closeSwapper udata_closeSwapper_3_2
-#define udata_getHeaderSize udata_getHeaderSize_3_2
-#define udata_getInfo udata_getInfo_3_2
-#define udata_getInfoSize udata_getInfoSize_3_2
-#define udata_getLength udata_getLength_3_2
-#define udata_getMemory udata_getMemory_3_2
-#define udata_getRawMemory udata_getRawMemory_3_2
-#define udata_open udata_open_3_2
-#define udata_openChoice udata_openChoice_3_2
-#define udata_openSwapper udata_openSwapper_3_2
-#define udata_openSwapperForInputData udata_openSwapperForInputData_3_2
-#define udata_printError udata_printError_3_2
-#define udata_readInt16 udata_readInt16_3_2
-#define udata_readInt32 udata_readInt32_3_2
-#define udata_setAppData udata_setAppData_3_2
-#define udata_setCommonData udata_setCommonData_3_2
-#define udata_swapDataHeader udata_swapDataHeader_3_2
-#define udata_swapInvStringBlock udata_swapInvStringBlock_3_2
-#define uenum_close uenum_close_3_2
-#define uenum_count uenum_count_3_2
-#define uenum_next uenum_next_3_2
-#define uenum_nextDefault uenum_nextDefault_3_2
-#define uenum_openCharStringsEnumeration uenum_openCharStringsEnumeration_3_2
-#define uenum_openStringEnumeration uenum_openStringEnumeration_3_2
-#define uenum_reset uenum_reset_3_2
-#define uenum_unext uenum_unext_3_2
-#define uenum_unextDefault uenum_unextDefault_3_2
-#define ufile_close_translit ufile_close_translit_3_2
-#define ufile_fill_uchar_buffer ufile_fill_uchar_buffer_3_2
-#define ufile_flush_translit ufile_flush_translit_3_2
-#define ufile_getch ufile_getch_3_2
-#define ufile_getch32 ufile_getch32_3_2
-#define ufmt_64tou ufmt_64tou_3_2
-#define ufmt_defaultCPToUnicode ufmt_defaultCPToUnicode_3_2
-#define ufmt_digitvalue ufmt_digitvalue_3_2
-#define ufmt_isdigit ufmt_isdigit_3_2
-#define ufmt_ptou ufmt_ptou_3_2
-#define ufmt_uto64 ufmt_uto64_3_2
-#define ufmt_utop ufmt_utop_3_2
-#define uhash_close uhash_close_3_2
-#define uhash_compareCaselessUnicodeString uhash_compareCaselessUnicodeString_3_2
-#define uhash_compareChars uhash_compareChars_3_2
-#define uhash_compareIChars uhash_compareIChars_3_2
-#define uhash_compareLong uhash_compareLong_3_2
-#define uhash_compareUChars uhash_compareUChars_3_2
-#define uhash_compareUnicodeString uhash_compareUnicodeString_3_2
-#define uhash_count uhash_count_3_2
-#define uhash_deleteHashtable uhash_deleteHashtable_3_2
-#define uhash_deleteUVector uhash_deleteUVector_3_2
-#define uhash_deleteUnicodeString uhash_deleteUnicodeString_3_2
-#define uhash_find uhash_find_3_2
-#define uhash_freeBlock uhash_freeBlock_3_2
-#define uhash_get uhash_get_3_2
-#define uhash_geti uhash_geti_3_2
-#define uhash_hashCaselessUnicodeString uhash_hashCaselessUnicodeString_3_2
-#define uhash_hashChars uhash_hashChars_3_2
-#define uhash_hashIChars uhash_hashIChars_3_2
-#define uhash_hashLong uhash_hashLong_3_2
-#define uhash_hashUChars uhash_hashUChars_3_2
-#define uhash_hashUCharsN uhash_hashUCharsN_3_2
-#define uhash_hashUnicodeString uhash_hashUnicodeString_3_2
-#define uhash_iget uhash_iget_3_2
-#define uhash_igeti uhash_igeti_3_2
-#define uhash_iput uhash_iput_3_2
-#define uhash_iputi uhash_iputi_3_2
-#define uhash_iremove uhash_iremove_3_2
-#define uhash_iremovei uhash_iremovei_3_2
-#define uhash_nextElement uhash_nextElement_3_2
-#define uhash_open uhash_open_3_2
-#define uhash_openSize uhash_openSize_3_2
-#define uhash_put uhash_put_3_2
-#define uhash_puti uhash_puti_3_2
-#define uhash_remove uhash_remove_3_2
-#define uhash_removeAll uhash_removeAll_3_2
-#define uhash_removeElement uhash_removeElement_3_2
-#define uhash_removei uhash_removei_3_2
-#define uhash_setKeyComparator uhash_setKeyComparator_3_2
-#define uhash_setKeyDeleter uhash_setKeyDeleter_3_2
-#define uhash_setKeyHasher uhash_setKeyHasher_3_2
-#define uhash_setResizePolicy uhash_setResizePolicy_3_2
-#define uhash_setValueDeleter uhash_setValueDeleter_3_2
-#define uhash_toki uhash_toki_3_2
-#define uhash_tokp uhash_tokp_3_2
-#define uhst_addPropertyStarts uhst_addPropertyStarts_3_2
-#define uidna_IDNToASCII uidna_IDNToASCII_3_2
-#define uidna_IDNToUnicode uidna_IDNToUnicode_3_2
-#define uidna_compare uidna_compare_3_2
-#define uidna_toASCII uidna_toASCII_3_2
-#define uidna_toUnicode uidna_toUnicode_3_2
-#define uiter_current32 uiter_current32_3_2
-#define uiter_getState uiter_getState_3_2
-#define uiter_next32 uiter_next32_3_2
-#define uiter_previous32 uiter_previous32_3_2
-#define uiter_setCharacterIterator uiter_setCharacterIterator_3_2
-#define uiter_setReplaceable uiter_setReplaceable_3_2
-#define uiter_setState uiter_setState_3_2
-#define uiter_setString uiter_setString_3_2
-#define uiter_setUTF16BE uiter_setUTF16BE_3_2
-#define uiter_setUTF8 uiter_setUTF8_3_2
-#define uloc_acceptLanguage uloc_acceptLanguage_3_2
-#define uloc_acceptLanguageFromHTTP uloc_acceptLanguageFromHTTP_3_2
-#define uloc_canonicalize uloc_canonicalize_3_2
-#define uloc_countAvailable uloc_countAvailable_3_2
-#define uloc_getAvailable uloc_getAvailable_3_2
-#define uloc_getBaseName uloc_getBaseName_3_2
-#define uloc_getCountry uloc_getCountry_3_2
-#define uloc_getDefault uloc_getDefault_3_2
-#define uloc_getDisplayCountry uloc_getDisplayCountry_3_2
-#define uloc_getDisplayKeyword uloc_getDisplayKeyword_3_2
-#define uloc_getDisplayKeywordValue uloc_getDisplayKeywordValue_3_2
-#define uloc_getDisplayLanguage uloc_getDisplayLanguage_3_2
-#define uloc_getDisplayName uloc_getDisplayName_3_2
-#define uloc_getDisplayScript uloc_getDisplayScript_3_2
-#define uloc_getDisplayVariant uloc_getDisplayVariant_3_2
-#define uloc_getISO3Country uloc_getISO3Country_3_2
-#define uloc_getISO3Language uloc_getISO3Language_3_2
-#define uloc_getISOCountries uloc_getISOCountries_3_2
-#define uloc_getISOLanguages uloc_getISOLanguages_3_2
-#define uloc_getKeywordValue uloc_getKeywordValue_3_2
-#define uloc_getLCID uloc_getLCID_3_2
-#define uloc_getLanguage uloc_getLanguage_3_2
-#define uloc_getName uloc_getName_3_2
-#define uloc_getParent uloc_getParent_3_2
-#define uloc_getScript uloc_getScript_3_2
-#define uloc_getVariant uloc_getVariant_3_2
-#define uloc_openKeywordList uloc_openKeywordList_3_2
-#define uloc_openKeywords uloc_openKeywords_3_2
-#define uloc_setDefault uloc_setDefault_3_2
-#define uloc_setKeywordValue uloc_setKeywordValue_3_2
-#define ulocdata_getExemplarSet ulocdata_getExemplarSet_3_2
-#define ulocdata_getMeasurementSystem ulocdata_getMeasurementSystem_3_2
-#define ulocdata_getPaperSize ulocdata_getPaperSize_3_2
-#define umsg_applyPattern umsg_applyPattern_3_2
-#define umsg_clone umsg_clone_3_2
-#define umsg_close umsg_close_3_2
-#define umsg_format umsg_format_3_2
-#define umsg_getLocale umsg_getLocale_3_2
-#define umsg_getLocaleByType umsg_getLocaleByType_3_2
-#define umsg_open umsg_open_3_2
-#define umsg_parse umsg_parse_3_2
-#define umsg_setLocale umsg_setLocale_3_2
-#define umsg_toPattern umsg_toPattern_3_2
-#define umsg_vformat umsg_vformat_3_2
-#define umsg_vparse umsg_vparse_3_2
-#define umtx_atomic_dec umtx_atomic_dec_3_2
-#define umtx_atomic_inc umtx_atomic_inc_3_2
-#define umtx_cleanup umtx_cleanup_3_2
-#define umtx_destroy umtx_destroy_3_2
-#define umtx_init umtx_init_3_2
-#define umtx_lock umtx_lock_3_2
-#define umtx_unlock umtx_unlock_3_2
-#define unorm_addPropertyStarts unorm_addPropertyStarts_3_2
-#define unorm_closeIter unorm_closeIter_3_2
-#define unorm_compare unorm_compare_3_2
-#define unorm_compose unorm_compose_3_2
-#define unorm_concatenate unorm_concatenate_3_2
-#define unorm_decompose unorm_decompose_3_2
-#define unorm_getCanonStartSet unorm_getCanonStartSet_3_2
-#define unorm_getCanonicalDecomposition unorm_getCanonicalDecomposition_3_2
-#define unorm_getDecomposition unorm_getDecomposition_3_2
-#define unorm_getFCD16FromCodePoint unorm_getFCD16FromCodePoint_3_2
-#define unorm_getFCDTrie unorm_getFCDTrie_3_2
-#define unorm_getNX unorm_getNX_3_2
-#define unorm_getQuickCheck unorm_getQuickCheck_3_2
-#define unorm_getUnicodeVersion unorm_getUnicodeVersion_3_2
-#define unorm_haveData unorm_haveData_3_2
-#define unorm_internalIsFullCompositionExclusion unorm_internalIsFullCompositionExclusion_3_2
-#define unorm_internalNormalize unorm_internalNormalize_3_2
-#define unorm_internalNormalizeWithNX unorm_internalNormalizeWithNX_3_2
-#define unorm_internalQuickCheck unorm_internalQuickCheck_3_2
-#define unorm_isCanonSafeStart unorm_isCanonSafeStart_3_2
-#define unorm_isNFSkippable unorm_isNFSkippable_3_2
-#define unorm_isNormalized unorm_isNormalized_3_2
-#define unorm_isNormalizedWithOptions unorm_isNormalizedWithOptions_3_2
-#define unorm_next unorm_next_3_2
-#define unorm_normalize unorm_normalize_3_2
-#define unorm_openIter unorm_openIter_3_2
-#define unorm_previous unorm_previous_3_2
-#define unorm_quickCheck unorm_quickCheck_3_2
-#define unorm_quickCheckWithOptions unorm_quickCheckWithOptions_3_2
-#define unorm_setIter unorm_setIter_3_2
-#define unorm_swap unorm_swap_3_2
-#define unum_applyPattern unum_applyPattern_3_2
-#define unum_clone unum_clone_3_2
-#define unum_close unum_close_3_2
-#define unum_countAvailable unum_countAvailable_3_2
-#define unum_format unum_format_3_2
-#define unum_formatDouble unum_formatDouble_3_2
-#define unum_formatDoubleCurrency unum_formatDoubleCurrency_3_2
-#define unum_formatInt64 unum_formatInt64_3_2
-#define unum_getAttribute unum_getAttribute_3_2
-#define unum_getAvailable unum_getAvailable_3_2
-#define unum_getDoubleAttribute unum_getDoubleAttribute_3_2
-#define unum_getLocaleByType unum_getLocaleByType_3_2
-#define unum_getSymbol unum_getSymbol_3_2
-#define unum_getTextAttribute unum_getTextAttribute_3_2
-#define unum_open unum_open_3_2
-#define unum_parse unum_parse_3_2
-#define unum_parseDouble unum_parseDouble_3_2
-#define unum_parseDoubleCurrency unum_parseDoubleCurrency_3_2
-#define unum_parseInt64 unum_parseInt64_3_2
-#define unum_setAttribute unum_setAttribute_3_2
-#define unum_setDoubleAttribute unum_setDoubleAttribute_3_2
-#define unum_setSymbol unum_setSymbol_3_2
-#define unum_setTextAttribute unum_setTextAttribute_3_2
-#define unum_toPattern unum_toPattern_3_2
-#define upname_swap upname_swap_3_2
-#define uprops_getSource uprops_getSource_3_2
-#define uprops_swap uprops_swap_3_2
-#define uprv_asciiFromEbcdic uprv_asciiFromEbcdic_3_2
-#define uprv_asciitolower uprv_asciitolower_3_2
-#define uprv_ceil uprv_ceil_3_2
-#define uprv_cnttab_addContraction uprv_cnttab_addContraction_3_2
-#define uprv_cnttab_changeContraction uprv_cnttab_changeContraction_3_2
-#define uprv_cnttab_changeLastCE uprv_cnttab_changeLastCE_3_2
-#define uprv_cnttab_clone uprv_cnttab_clone_3_2
-#define uprv_cnttab_close uprv_cnttab_close_3_2
-#define uprv_cnttab_constructTable uprv_cnttab_constructTable_3_2
-#define uprv_cnttab_findCE uprv_cnttab_findCE_3_2
-#define uprv_cnttab_findCP uprv_cnttab_findCP_3_2
-#define uprv_cnttab_getCE uprv_cnttab_getCE_3_2
-#define uprv_cnttab_insertContraction uprv_cnttab_insertContraction_3_2
-#define uprv_cnttab_isTailored uprv_cnttab_isTailored_3_2
-#define uprv_cnttab_open uprv_cnttab_open_3_2
-#define uprv_cnttab_setContraction uprv_cnttab_setContraction_3_2
-#define uprv_compareASCIIPropertyNames uprv_compareASCIIPropertyNames_3_2
-#define uprv_compareEBCDICPropertyNames uprv_compareEBCDICPropertyNames_3_2
-#define uprv_compareInvAscii uprv_compareInvAscii_3_2
-#define uprv_compareInvEbcdic uprv_compareInvEbcdic_3_2
-#define uprv_convertToLCID uprv_convertToLCID_3_2
-#define uprv_convertToPosix uprv_convertToPosix_3_2
-#define uprv_copyAscii uprv_copyAscii_3_2
-#define uprv_copyEbcdic uprv_copyEbcdic_3_2
-#define uprv_dtostr uprv_dtostr_3_2
-#define uprv_ebcdicFromAscii uprv_ebcdicFromAscii_3_2
-#define uprv_ebcdictolower uprv_ebcdictolower_3_2
-#define uprv_fabs uprv_fabs_3_2
-#define uprv_floor uprv_floor_3_2
-#define uprv_fmax uprv_fmax_3_2
-#define uprv_fmin uprv_fmin_3_2
-#define uprv_fmod uprv_fmod_3_2
-#define uprv_free uprv_free_3_2
-#define uprv_getCharNameCharacters uprv_getCharNameCharacters_3_2
-#define uprv_getDefaultCodepage uprv_getDefaultCodepage_3_2
-#define uprv_getDefaultLocaleID uprv_getDefaultLocaleID_3_2
-#define uprv_getInfinity uprv_getInfinity_3_2
-#define uprv_getMaxCharNameLength uprv_getMaxCharNameLength_3_2
-#define uprv_getMaxValues uprv_getMaxValues_3_2
-#define uprv_getNaN uprv_getNaN_3_2
-#define uprv_getStaticCurrencyName uprv_getStaticCurrencyName_3_2
-#define uprv_getUTCtime uprv_getUTCtime_3_2
-#define uprv_haveProperties uprv_haveProperties_3_2
-#define uprv_init_collIterate uprv_init_collIterate_3_2
-#define uprv_int32Comparator uprv_int32Comparator_3_2
-#define uprv_isInfinite uprv_isInfinite_3_2
-#define uprv_isInvariantString uprv_isInvariantString_3_2
-#define uprv_isInvariantUString uprv_isInvariantUString_3_2
-#define uprv_isNaN uprv_isNaN_3_2
-#define uprv_isNegativeInfinity uprv_isNegativeInfinity_3_2
-#define uprv_isPositiveInfinity uprv_isPositiveInfinity_3_2
-#define uprv_isRuleWhiteSpace uprv_isRuleWhiteSpace_3_2
-#define uprv_itou uprv_itou_3_2
-#define uprv_loadPropsData uprv_loadPropsData_3_2
-#define uprv_log uprv_log_3_2
-#define uprv_log10 uprv_log10_3_2
-#define uprv_malloc uprv_malloc_3_2
-#define uprv_mapFile uprv_mapFile_3_2
-#define uprv_max uprv_max_3_2
-#define uprv_maxMantissa uprv_maxMantissa_3_2
-#define uprv_min uprv_min_3_2
-#define uprv_modf uprv_modf_3_2
-#define uprv_openRuleWhiteSpaceSet uprv_openRuleWhiteSpaceSet_3_2
-#define uprv_pathIsAbsolute uprv_pathIsAbsolute_3_2
-#define uprv_pow uprv_pow_3_2
-#define uprv_pow10 uprv_pow10_3_2
-#define uprv_realloc uprv_realloc_3_2
-#define uprv_round uprv_round_3_2
-#define uprv_sortArray uprv_sortArray_3_2
-#define uprv_strCompare uprv_strCompare_3_2
-#define uprv_strdup uprv_strdup_3_2
-#define uprv_strndup uprv_strndup_3_2
-#define uprv_syntaxError uprv_syntaxError_3_2
-#define uprv_timezone uprv_timezone_3_2
-#define uprv_toupper uprv_toupper_3_2
-#define uprv_trunc uprv_trunc_3_2
-#define uprv_tzname uprv_tzname_3_2
-#define uprv_tzset uprv_tzset_3_2
-#define uprv_uca_addAnElement uprv_uca_addAnElement_3_2
-#define uprv_uca_assembleTable uprv_uca_assembleTable_3_2
-#define uprv_uca_canonicalClosure uprv_uca_canonicalClosure_3_2
-#define uprv_uca_cloneTempTable uprv_uca_cloneTempTable_3_2
-#define uprv_uca_closeTempTable uprv_uca_closeTempTable_3_2
-#define uprv_uca_getCodePointFromRaw uprv_uca_getCodePointFromRaw_3_2
-#define uprv_uca_getImplicitFromRaw uprv_uca_getImplicitFromRaw_3_2
-#define uprv_uca_getImplicitPrimary uprv_uca_getImplicitPrimary_3_2
-#define uprv_uca_getRawFromCodePoint uprv_uca_getRawFromCodePoint_3_2
-#define uprv_uca_getRawFromImplicit uprv_uca_getRawFromImplicit_3_2
-#define uprv_uca_initImplicitConstants uprv_uca_initImplicitConstants_3_2
-#define uprv_uca_initTempTable uprv_uca_initTempTable_3_2
-#define uprv_uint16Comparator uprv_uint16Comparator_3_2
-#define uprv_uint32Comparator uprv_uint32Comparator_3_2
-#define uprv_unmapFile uprv_unmapFile_3_2
-#define uregex_appendReplacement uregex_appendReplacement_3_2
-#define uregex_appendTail uregex_appendTail_3_2
-#define uregex_clone uregex_clone_3_2
-#define uregex_close uregex_close_3_2
-#define uregex_end uregex_end_3_2
-#define uregex_find uregex_find_3_2
-#define uregex_findNext uregex_findNext_3_2
-#define uregex_flags uregex_flags_3_2
-#define uregex_getText uregex_getText_3_2
-#define uregex_group uregex_group_3_2
-#define uregex_groupCount uregex_groupCount_3_2
-#define uregex_lookingAt uregex_lookingAt_3_2
-#define uregex_matches uregex_matches_3_2
-#define uregex_open uregex_open_3_2
-#define uregex_openC uregex_openC_3_2
-#define uregex_pattern uregex_pattern_3_2
-#define uregex_replaceAll uregex_replaceAll_3_2
-#define uregex_replaceFirst uregex_replaceFirst_3_2
-#define uregex_reset uregex_reset_3_2
-#define uregex_setText uregex_setText_3_2
-#define uregex_split uregex_split_3_2
-#define uregex_start uregex_start_3_2
-#define ures_appendResPath ures_appendResPath_3_2
-#define ures_close ures_close_3_2
-#define ures_copyResb ures_copyResb_3_2
-#define ures_countArrayItems ures_countArrayItems_3_2
-#define ures_findResource ures_findResource_3_2
-#define ures_findSubResource ures_findSubResource_3_2
-#define ures_freeResPath ures_freeResPath_3_2
-#define ures_getBinary ures_getBinary_3_2
-#define ures_getByIndex ures_getByIndex_3_2
-#define ures_getByKey ures_getByKey_3_2
-#define ures_getByKeyWithFallback ures_getByKeyWithFallback_3_2
-#define ures_getFunctionalEquivalent ures_getFunctionalEquivalent_3_2
-#define ures_getInt ures_getInt_3_2
-#define ures_getIntVector ures_getIntVector_3_2
-#define ures_getKey ures_getKey_3_2
-#define ures_getKeywordValues ures_getKeywordValues_3_2
-#define ures_getLocale ures_getLocale_3_2
-#define ures_getLocaleByType ures_getLocaleByType_3_2
-#define ures_getName ures_getName_3_2
-#define ures_getNextResource ures_getNextResource_3_2
-#define ures_getNextString ures_getNextString_3_2
-#define ures_getPath ures_getPath_3_2
-#define ures_getSize ures_getSize_3_2
-#define ures_getString ures_getString_3_2
-#define ures_getStringByIndex ures_getStringByIndex_3_2
-#define ures_getStringByKey ures_getStringByKey_3_2
-#define ures_getType ures_getType_3_2
-#define ures_getUInt ures_getUInt_3_2
-#define ures_getVersion ures_getVersion_3_2
-#define ures_getVersionNumber ures_getVersionNumber_3_2
-#define ures_hasNext ures_hasNext_3_2
-#define ures_initStackObject ures_initStackObject_3_2
-#define ures_open ures_open_3_2
-#define ures_openAvailableLocales ures_openAvailableLocales_3_2
-#define ures_openDirect ures_openDirect_3_2
-#define ures_openFillIn ures_openFillIn_3_2
-#define ures_openU ures_openU_3_2
-#define ures_resetIterator ures_resetIterator_3_2
-#define ures_swap ures_swap_3_2
-#define uscript_closeRun uscript_closeRun_3_2
-#define uscript_getCode uscript_getCode_3_2
-#define uscript_getName uscript_getName_3_2
-#define uscript_getScript uscript_getScript_3_2
-#define uscript_getShortName uscript_getShortName_3_2
-#define uscript_nextRun uscript_nextRun_3_2
-#define uscript_openRun uscript_openRun_3_2
-#define uscript_resetRun uscript_resetRun_3_2
-#define uscript_setRunText uscript_setRunText_3_2
-#define usearch_close usearch_close_3_2
-#define usearch_first usearch_first_3_2
-#define usearch_following usearch_following_3_2
-#define usearch_getAttribute usearch_getAttribute_3_2
-#define usearch_getBreakIterator usearch_getBreakIterator_3_2
-#define usearch_getCollator usearch_getCollator_3_2
-#define usearch_getMatchedLength usearch_getMatchedLength_3_2
-#define usearch_getMatchedStart usearch_getMatchedStart_3_2
-#define usearch_getMatchedText usearch_getMatchedText_3_2
-#define usearch_getOffset usearch_getOffset_3_2
-#define usearch_getPattern usearch_getPattern_3_2
-#define usearch_getText usearch_getText_3_2
-#define usearch_handleNextCanonical usearch_handleNextCanonical_3_2
-#define usearch_handleNextExact usearch_handleNextExact_3_2
-#define usearch_handlePreviousCanonical usearch_handlePreviousCanonical_3_2
-#define usearch_handlePreviousExact usearch_handlePreviousExact_3_2
-#define usearch_last usearch_last_3_2
-#define usearch_next usearch_next_3_2
-#define usearch_open usearch_open_3_2
-#define usearch_openFromCollator usearch_openFromCollator_3_2
-#define usearch_preceding usearch_preceding_3_2
-#define usearch_previous usearch_previous_3_2
-#define usearch_reset usearch_reset_3_2
-#define usearch_setAttribute usearch_setAttribute_3_2
-#define usearch_setBreakIterator usearch_setBreakIterator_3_2
-#define usearch_setCollator usearch_setCollator_3_2
-#define usearch_setOffset usearch_setOffset_3_2
-#define usearch_setPattern usearch_setPattern_3_2
-#define usearch_setText usearch_setText_3_2
-#define userv_deleteStringPair userv_deleteStringPair_3_2
-#define uset_add uset_add_3_2
-#define uset_addAll uset_addAll_3_2
-#define uset_addRange uset_addRange_3_2
-#define uset_addString uset_addString_3_2
-#define uset_applyIntPropertyValue uset_applyIntPropertyValue_3_2
-#define uset_applyPattern uset_applyPattern_3_2
-#define uset_applyPropertyAlias uset_applyPropertyAlias_3_2
-#define uset_charAt uset_charAt_3_2
-#define uset_clear uset_clear_3_2
-#define uset_close uset_close_3_2
-#define uset_compact uset_compact_3_2
-#define uset_complement uset_complement_3_2
-#define uset_complementAll uset_complementAll_3_2
-#define uset_contains uset_contains_3_2
-#define uset_containsAll uset_containsAll_3_2
-#define uset_containsNone uset_containsNone_3_2
-#define uset_containsRange uset_containsRange_3_2
-#define uset_containsSome uset_containsSome_3_2
-#define uset_containsString uset_containsString_3_2
-#define uset_equals uset_equals_3_2
-#define uset_getItem uset_getItem_3_2
-#define uset_getItemCount uset_getItemCount_3_2
-#define uset_getSerializedRange uset_getSerializedRange_3_2
-#define uset_getSerializedRangeCount uset_getSerializedRangeCount_3_2
-#define uset_getSerializedSet uset_getSerializedSet_3_2
-#define uset_indexOf uset_indexOf_3_2
-#define uset_isEmpty uset_isEmpty_3_2
-#define uset_open uset_open_3_2
-#define uset_openPattern uset_openPattern_3_2
-#define uset_openPatternOptions uset_openPatternOptions_3_2
-#define uset_remove uset_remove_3_2
-#define uset_removeAll uset_removeAll_3_2
-#define uset_removeRange uset_removeRange_3_2
-#define uset_removeString uset_removeString_3_2
-#define uset_resemblesPattern uset_resemblesPattern_3_2
-#define uset_retain uset_retain_3_2
-#define uset_retainAll uset_retainAll_3_2
-#define uset_serialize uset_serialize_3_2
-#define uset_serializedContains uset_serializedContains_3_2
-#define uset_set uset_set_3_2
-#define uset_setSerializedToOne uset_setSerializedToOne_3_2
-#define uset_size uset_size_3_2
-#define uset_toPattern uset_toPattern_3_2
-#define usprep_close usprep_close_3_2
-#define usprep_open usprep_open_3_2
-#define usprep_prepare usprep_prepare_3_2
-#define usprep_swap usprep_swap_3_2
-#define ustr_foldCase ustr_foldCase_3_2
-#define ustr_toLower ustr_toLower_3_2
-#define ustr_toTitle ustr_toTitle_3_2
-#define ustr_toUpper ustr_toUpper_3_2
-#define utf8_appendCharSafeBody utf8_appendCharSafeBody_3_2
-#define utf8_back1SafeBody utf8_back1SafeBody_3_2
-#define utf8_countTrailBytes utf8_countTrailBytes_3_2
-#define utf8_nextCharSafeBody utf8_nextCharSafeBody_3_2
-#define utf8_prevCharSafeBody utf8_prevCharSafeBody_3_2
-#define utmscale_fromInt64 utmscale_fromInt64_3_2
-#define utmscale_getTimeScaleValue utmscale_getTimeScaleValue_3_2
-#define utmscale_toInt64 utmscale_toInt64_3_2
-#define utrace_cleanup utrace_cleanup_3_2
-#define utrace_data utrace_data_3_2
-#define utrace_entry utrace_entry_3_2
-#define utrace_exit utrace_exit_3_2
-#define utrace_format utrace_format_3_2
-#define utrace_functionName utrace_functionName_3_2
-#define utrace_getFunctions utrace_getFunctions_3_2
-#define utrace_getLevel utrace_getLevel_3_2
-#define utrace_level utrace_level_3_2
-#define utrace_setFunctions utrace_setFunctions_3_2
-#define utrace_setLevel utrace_setLevel_3_2
-#define utrace_vformat utrace_vformat_3_2
-#define utrans_clone utrans_clone_3_2
-#define utrans_close utrans_close_3_2
-#define utrans_countAvailableIDs utrans_countAvailableIDs_3_2
-#define utrans_getAvailableID utrans_getAvailableID_3_2
-#define utrans_getID utrans_getID_3_2
-#define utrans_getUnicodeID utrans_getUnicodeID_3_2
-#define utrans_open utrans_open_3_2
-#define utrans_openIDs utrans_openIDs_3_2
-#define utrans_openInverse utrans_openInverse_3_2
-#define utrans_openU utrans_openU_3_2
-#define utrans_register utrans_register_3_2
-#define utrans_rep_caseContextIterator utrans_rep_caseContextIterator_3_2
-#define utrans_setFilter utrans_setFilter_3_2
-#define utrans_trans utrans_trans_3_2
-#define utrans_transIncremental utrans_transIncremental_3_2
-#define utrans_transIncrementalUChars utrans_transIncrementalUChars_3_2
-#define utrans_transUChars utrans_transUChars_3_2
-#define utrans_unregister utrans_unregister_3_2
-#define utrans_unregisterID utrans_unregisterID_3_2
-#define utrie_clone utrie_clone_3_2
-#define utrie_close utrie_close_3_2
-#define utrie_enum utrie_enum_3_2
-#define utrie_get32 utrie_get32_3_2
-#define utrie_getData utrie_getData_3_2
-#define utrie_open utrie_open_3_2
-#define utrie_serialize utrie_serialize_3_2
-#define utrie_set32 utrie_set32_3_2
-#define utrie_setRange32 utrie_setRange32_3_2
-#define utrie_swap utrie_swap_3_2
-#define utrie_unserialize utrie_unserialize_3_2
+#define DECPOWERS U_ICU_ENTRY_POINT_RENAME(DECPOWERS)
+#define DECSTICKYTAB U_ICU_ENTRY_POINT_RENAME(DECSTICKYTAB)
+#define LNnn U_ICU_ENTRY_POINT_RENAME(LNnn)
+#define T_CString_int64ToString U_ICU_ENTRY_POINT_RENAME(T_CString_int64ToString)
+#define T_CString_integerToString U_ICU_ENTRY_POINT_RENAME(T_CString_integerToString)
+#define T_CString_stricmp U_ICU_ENTRY_POINT_RENAME(T_CString_stricmp)
+#define T_CString_stringToInteger U_ICU_ENTRY_POINT_RENAME(T_CString_stringToInteger)
+#define T_CString_strnicmp U_ICU_ENTRY_POINT_RENAME(T_CString_strnicmp)
+#define T_CString_toLowerCase U_ICU_ENTRY_POINT_RENAME(T_CString_toLowerCase)
+#define T_CString_toUpperCase U_ICU_ENTRY_POINT_RENAME(T_CString_toUpperCase)
+#define UCNV_FROM_U_CALLBACK_ESCAPE U_ICU_ENTRY_POINT_RENAME(UCNV_FROM_U_CALLBACK_ESCAPE)
+#define UCNV_FROM_U_CALLBACK_SKIP U_ICU_ENTRY_POINT_RENAME(UCNV_FROM_U_CALLBACK_SKIP)
+#define UCNV_FROM_U_CALLBACK_STOP U_ICU_ENTRY_POINT_RENAME(UCNV_FROM_U_CALLBACK_STOP)
+#define UCNV_FROM_U_CALLBACK_SUBSTITUTE U_ICU_ENTRY_POINT_RENAME(UCNV_FROM_U_CALLBACK_SUBSTITUTE)
+#define UCNV_TO_U_CALLBACK_ESCAPE U_ICU_ENTRY_POINT_RENAME(UCNV_TO_U_CALLBACK_ESCAPE)
+#define UCNV_TO_U_CALLBACK_SKIP U_ICU_ENTRY_POINT_RENAME(UCNV_TO_U_CALLBACK_SKIP)
+#define UCNV_TO_U_CALLBACK_STOP U_ICU_ENTRY_POINT_RENAME(UCNV_TO_U_CALLBACK_STOP)
+#define UCNV_TO_U_CALLBACK_SUBSTITUTE U_ICU_ENTRY_POINT_RENAME(UCNV_TO_U_CALLBACK_SUBSTITUTE)
+#define UDataMemory_createNewInstance U_ICU_ENTRY_POINT_RENAME(UDataMemory_createNewInstance)
+#define UDataMemory_init U_ICU_ENTRY_POINT_RENAME(UDataMemory_init)
+#define UDataMemory_isLoaded U_ICU_ENTRY_POINT_RENAME(UDataMemory_isLoaded)
+#define UDataMemory_normalizeDataPointer U_ICU_ENTRY_POINT_RENAME(UDataMemory_normalizeDataPointer)
+#define UDataMemory_setData U_ICU_ENTRY_POINT_RENAME(UDataMemory_setData)
+#define UDatamemory_assign U_ICU_ENTRY_POINT_RENAME(UDatamemory_assign)
+#define _ASCIIData U_ICU_ENTRY_POINT_RENAME(_ASCIIData)
+#define _Bocu1Data U_ICU_ENTRY_POINT_RENAME(_Bocu1Data)
+#define _CESU8Data U_ICU_ENTRY_POINT_RENAME(_CESU8Data)
+#define _HZData U_ICU_ENTRY_POINT_RENAME(_HZData)
+#define _IMAPData U_ICU_ENTRY_POINT_RENAME(_IMAPData)
+#define _ISCIIData U_ICU_ENTRY_POINT_RENAME(_ISCIIData)
+#define _ISO2022Data U_ICU_ENTRY_POINT_RENAME(_ISO2022Data)
+#define _LMBCSData1 U_ICU_ENTRY_POINT_RENAME(_LMBCSData1)
+#define _LMBCSData11 U_ICU_ENTRY_POINT_RENAME(_LMBCSData11)
+#define _LMBCSData16 U_ICU_ENTRY_POINT_RENAME(_LMBCSData16)
+#define _LMBCSData17 U_ICU_ENTRY_POINT_RENAME(_LMBCSData17)
+#define _LMBCSData18 U_ICU_ENTRY_POINT_RENAME(_LMBCSData18)
+#define _LMBCSData19 U_ICU_ENTRY_POINT_RENAME(_LMBCSData19)
+#define _LMBCSData2 U_ICU_ENTRY_POINT_RENAME(_LMBCSData2)
+#define _LMBCSData3 U_ICU_ENTRY_POINT_RENAME(_LMBCSData3)
+#define _LMBCSData4 U_ICU_ENTRY_POINT_RENAME(_LMBCSData4)
+#define _LMBCSData5 U_ICU_ENTRY_POINT_RENAME(_LMBCSData5)
+#define _LMBCSData6 U_ICU_ENTRY_POINT_RENAME(_LMBCSData6)
+#define _LMBCSData8 U_ICU_ENTRY_POINT_RENAME(_LMBCSData8)
+#define _Latin1Data U_ICU_ENTRY_POINT_RENAME(_Latin1Data)
+#define _MBCSData U_ICU_ENTRY_POINT_RENAME(_MBCSData)
+#define _SCSUData U_ICU_ENTRY_POINT_RENAME(_SCSUData)
+#define _UTF16BEData U_ICU_ENTRY_POINT_RENAME(_UTF16BEData)
+#define _UTF16Data U_ICU_ENTRY_POINT_RENAME(_UTF16Data)
+#define _UTF16LEData U_ICU_ENTRY_POINT_RENAME(_UTF16LEData)
+#define _UTF32BEData U_ICU_ENTRY_POINT_RENAME(_UTF32BEData)
+#define _UTF32Data U_ICU_ENTRY_POINT_RENAME(_UTF32Data)
+#define _UTF32LEData U_ICU_ENTRY_POINT_RENAME(_UTF32LEData)
+#define _UTF7Data U_ICU_ENTRY_POINT_RENAME(_UTF7Data)
+#define _UTF8Data U_ICU_ENTRY_POINT_RENAME(_UTF8Data)
+#define bms_close U_ICU_ENTRY_POINT_RENAME(bms_close)
+#define bms_empty U_ICU_ENTRY_POINT_RENAME(bms_empty)
+#define bms_getData U_ICU_ENTRY_POINT_RENAME(bms_getData)
+#define bms_open U_ICU_ENTRY_POINT_RENAME(bms_open)
+#define bms_search U_ICU_ENTRY_POINT_RENAME(bms_search)
+#define bms_setTargetString U_ICU_ENTRY_POINT_RENAME(bms_setTargetString)
+#define buildWSConfusableData U_ICU_ENTRY_POINT_RENAME(buildWSConfusableData)
+#define cmemory_cleanup U_ICU_ENTRY_POINT_RENAME(cmemory_cleanup)
+#define cmemory_inUse U_ICU_ENTRY_POINT_RENAME(cmemory_inUse)
+#define d2utable U_ICU_ENTRY_POINT_RENAME(d2utable)
+#define deleteCEList U_ICU_ENTRY_POINT_RENAME(deleteCEList)
+#define deleteChars U_ICU_ENTRY_POINT_RENAME(deleteChars)
+#define deleteCollDataCacheEntry U_ICU_ENTRY_POINT_RENAME(deleteCollDataCacheEntry)
+#define deleteStringList U_ICU_ENTRY_POINT_RENAME(deleteStringList)
+#define deleteUnicodeStringKey U_ICU_ENTRY_POINT_RENAME(deleteUnicodeStringKey)
+#define izrule_clone U_ICU_ENTRY_POINT_RENAME(izrule_clone)
+#define izrule_close U_ICU_ENTRY_POINT_RENAME(izrule_close)
+#define izrule_equals U_ICU_ENTRY_POINT_RENAME(izrule_equals)
+#define izrule_getDSTSavings U_ICU_ENTRY_POINT_RENAME(izrule_getDSTSavings)
+#define izrule_getDynamicClassID U_ICU_ENTRY_POINT_RENAME(izrule_getDynamicClassID)
+#define izrule_getFinalStart U_ICU_ENTRY_POINT_RENAME(izrule_getFinalStart)
+#define izrule_getFirstStart U_ICU_ENTRY_POINT_RENAME(izrule_getFirstStart)
+#define izrule_getName U_ICU_ENTRY_POINT_RENAME(izrule_getName)
+#define izrule_getNextStart U_ICU_ENTRY_POINT_RENAME(izrule_getNextStart)
+#define izrule_getPreviousStart U_ICU_ENTRY_POINT_RENAME(izrule_getPreviousStart)
+#define izrule_getRawOffset U_ICU_ENTRY_POINT_RENAME(izrule_getRawOffset)
+#define izrule_getStaticClassID U_ICU_ENTRY_POINT_RENAME(izrule_getStaticClassID)
+#define izrule_isEquivalentTo U_ICU_ENTRY_POINT_RENAME(izrule_isEquivalentTo)
+#define izrule_open U_ICU_ENTRY_POINT_RENAME(izrule_open)
+#define le_close U_ICU_ENTRY_POINT_RENAME(le_close)
+#define le_create U_ICU_ENTRY_POINT_RENAME(le_create)
+#define le_getCharIndices U_ICU_ENTRY_POINT_RENAME(le_getCharIndices)
+#define le_getCharIndicesWithBase U_ICU_ENTRY_POINT_RENAME(le_getCharIndicesWithBase)
+#define le_getGlyphCount U_ICU_ENTRY_POINT_RENAME(le_getGlyphCount)
+#define le_getGlyphPosition U_ICU_ENTRY_POINT_RENAME(le_getGlyphPosition)
+#define le_getGlyphPositions U_ICU_ENTRY_POINT_RENAME(le_getGlyphPositions)
+#define le_getGlyphs U_ICU_ENTRY_POINT_RENAME(le_getGlyphs)
+#define le_layoutChars U_ICU_ENTRY_POINT_RENAME(le_layoutChars)
+#define le_reset U_ICU_ENTRY_POINT_RENAME(le_reset)
+#define locale_getKeywords U_ICU_ENTRY_POINT_RENAME(locale_getKeywords)
+#define locale_getKeywordsStart U_ICU_ENTRY_POINT_RENAME(locale_getKeywordsStart)
+#define locale_get_default U_ICU_ENTRY_POINT_RENAME(locale_get_default)
+#define locale_set_default U_ICU_ENTRY_POINT_RENAME(locale_set_default)
+#define pl_addFontRun U_ICU_ENTRY_POINT_RENAME(pl_addFontRun)
+#define pl_addLocaleRun U_ICU_ENTRY_POINT_RENAME(pl_addLocaleRun)
+#define pl_addValueRun U_ICU_ENTRY_POINT_RENAME(pl_addValueRun)
+#define pl_close U_ICU_ENTRY_POINT_RENAME(pl_close)
+#define pl_closeFontRuns U_ICU_ENTRY_POINT_RENAME(pl_closeFontRuns)
+#define pl_closeLine U_ICU_ENTRY_POINT_RENAME(pl_closeLine)
+#define pl_closeLocaleRuns U_ICU_ENTRY_POINT_RENAME(pl_closeLocaleRuns)
+#define pl_closeValueRuns U_ICU_ENTRY_POINT_RENAME(pl_closeValueRuns)
+#define pl_countLineRuns U_ICU_ENTRY_POINT_RENAME(pl_countLineRuns)
+#define pl_create U_ICU_ENTRY_POINT_RENAME(pl_create)
+#define pl_getAscent U_ICU_ENTRY_POINT_RENAME(pl_getAscent)
+#define pl_getDescent U_ICU_ENTRY_POINT_RENAME(pl_getDescent)
+#define pl_getFontRunCount U_ICU_ENTRY_POINT_RENAME(pl_getFontRunCount)
+#define pl_getFontRunFont U_ICU_ENTRY_POINT_RENAME(pl_getFontRunFont)
+#define pl_getFontRunLastLimit U_ICU_ENTRY_POINT_RENAME(pl_getFontRunLastLimit)
+#define pl_getFontRunLimit U_ICU_ENTRY_POINT_RENAME(pl_getFontRunLimit)
+#define pl_getLeading U_ICU_ENTRY_POINT_RENAME(pl_getLeading)
+#define pl_getLineAscent U_ICU_ENTRY_POINT_RENAME(pl_getLineAscent)
+#define pl_getLineDescent U_ICU_ENTRY_POINT_RENAME(pl_getLineDescent)
+#define pl_getLineLeading U_ICU_ENTRY_POINT_RENAME(pl_getLineLeading)
+#define pl_getLineVisualRun U_ICU_ENTRY_POINT_RENAME(pl_getLineVisualRun)
+#define pl_getLineWidth U_ICU_ENTRY_POINT_RENAME(pl_getLineWidth)
+#define pl_getLocaleRunCount U_ICU_ENTRY_POINT_RENAME(pl_getLocaleRunCount)
+#define pl_getLocaleRunLastLimit U_ICU_ENTRY_POINT_RENAME(pl_getLocaleRunLastLimit)
+#define pl_getLocaleRunLimit U_ICU_ENTRY_POINT_RENAME(pl_getLocaleRunLimit)
+#define pl_getLocaleRunLocale U_ICU_ENTRY_POINT_RENAME(pl_getLocaleRunLocale)
+#define pl_getParagraphLevel U_ICU_ENTRY_POINT_RENAME(pl_getParagraphLevel)
+#define pl_getTextDirection U_ICU_ENTRY_POINT_RENAME(pl_getTextDirection)
+#define pl_getValueRunCount U_ICU_ENTRY_POINT_RENAME(pl_getValueRunCount)
+#define pl_getValueRunLastLimit U_ICU_ENTRY_POINT_RENAME(pl_getValueRunLastLimit)
+#define pl_getValueRunLimit U_ICU_ENTRY_POINT_RENAME(pl_getValueRunLimit)
+#define pl_getValueRunValue U_ICU_ENTRY_POINT_RENAME(pl_getValueRunValue)
+#define pl_getVisualRunAscent U_ICU_ENTRY_POINT_RENAME(pl_getVisualRunAscent)
+#define pl_getVisualRunDescent U_ICU_ENTRY_POINT_RENAME(pl_getVisualRunDescent)
+#define pl_getVisualRunDirection U_ICU_ENTRY_POINT_RENAME(pl_getVisualRunDirection)
+#define pl_getVisualRunFont U_ICU_ENTRY_POINT_RENAME(pl_getVisualRunFont)
+#define pl_getVisualRunGlyphCount U_ICU_ENTRY_POINT_RENAME(pl_getVisualRunGlyphCount)
+#define pl_getVisualRunGlyphToCharMap U_ICU_ENTRY_POINT_RENAME(pl_getVisualRunGlyphToCharMap)
+#define pl_getVisualRunGlyphs U_ICU_ENTRY_POINT_RENAME(pl_getVisualRunGlyphs)
+#define pl_getVisualRunLeading U_ICU_ENTRY_POINT_RENAME(pl_getVisualRunLeading)
+#define pl_getVisualRunPositions U_ICU_ENTRY_POINT_RENAME(pl_getVisualRunPositions)
+#define pl_isComplex U_ICU_ENTRY_POINT_RENAME(pl_isComplex)
+#define pl_nextLine U_ICU_ENTRY_POINT_RENAME(pl_nextLine)
+#define pl_openEmptyFontRuns U_ICU_ENTRY_POINT_RENAME(pl_openEmptyFontRuns)
+#define pl_openEmptyLocaleRuns U_ICU_ENTRY_POINT_RENAME(pl_openEmptyLocaleRuns)
+#define pl_openEmptyValueRuns U_ICU_ENTRY_POINT_RENAME(pl_openEmptyValueRuns)
+#define pl_openFontRuns U_ICU_ENTRY_POINT_RENAME(pl_openFontRuns)
+#define pl_openLocaleRuns U_ICU_ENTRY_POINT_RENAME(pl_openLocaleRuns)
+#define pl_openValueRuns U_ICU_ENTRY_POINT_RENAME(pl_openValueRuns)
+#define pl_reflow U_ICU_ENTRY_POINT_RENAME(pl_reflow)
+#define pl_resetFontRuns U_ICU_ENTRY_POINT_RENAME(pl_resetFontRuns)
+#define pl_resetLocaleRuns U_ICU_ENTRY_POINT_RENAME(pl_resetLocaleRuns)
+#define pl_resetValueRuns U_ICU_ENTRY_POINT_RENAME(pl_resetValueRuns)
+#define res_countArrayItems U_ICU_ENTRY_POINT_RENAME(res_countArrayItems)
+#define res_findResource U_ICU_ENTRY_POINT_RENAME(res_findResource)
+#define res_getAlias U_ICU_ENTRY_POINT_RENAME(res_getAlias)
+#define res_getArrayItem U_ICU_ENTRY_POINT_RENAME(res_getArrayItem)
+#define res_getBinary U_ICU_ENTRY_POINT_RENAME(res_getBinary)
+#define res_getIntVector U_ICU_ENTRY_POINT_RENAME(res_getIntVector)
+#define res_getPublicType U_ICU_ENTRY_POINT_RENAME(res_getPublicType)
+#define res_getResource U_ICU_ENTRY_POINT_RENAME(res_getResource)
+#define res_getString U_ICU_ENTRY_POINT_RENAME(res_getString)
+#define res_getTableItemByIndex U_ICU_ENTRY_POINT_RENAME(res_getTableItemByIndex)
+#define res_getTableItemByKey U_ICU_ENTRY_POINT_RENAME(res_getTableItemByKey)
+#define res_load U_ICU_ENTRY_POINT_RENAME(res_load)
+#define res_read U_ICU_ENTRY_POINT_RENAME(res_read)
+#define res_unload U_ICU_ENTRY_POINT_RENAME(res_unload)
+#define tmutfmtHashTableValueComparator U_ICU_ENTRY_POINT_RENAME(tmutfmtHashTableValueComparator)
+#define triedict_swap U_ICU_ENTRY_POINT_RENAME(triedict_swap)
+#define u_UCharsToChars U_ICU_ENTRY_POINT_RENAME(u_UCharsToChars)
+#define u_austrcpy U_ICU_ENTRY_POINT_RENAME(u_austrcpy)
+#define u_austrncpy U_ICU_ENTRY_POINT_RENAME(u_austrncpy)
+#define u_catclose U_ICU_ENTRY_POINT_RENAME(u_catclose)
+#define u_catgets U_ICU_ENTRY_POINT_RENAME(u_catgets)
+#define u_catopen U_ICU_ENTRY_POINT_RENAME(u_catopen)
+#define u_charAge U_ICU_ENTRY_POINT_RENAME(u_charAge)
+#define u_charDigitValue U_ICU_ENTRY_POINT_RENAME(u_charDigitValue)
+#define u_charDirection U_ICU_ENTRY_POINT_RENAME(u_charDirection)
+#define u_charFromName U_ICU_ENTRY_POINT_RENAME(u_charFromName)
+#define u_charMirror U_ICU_ENTRY_POINT_RENAME(u_charMirror)
+#define u_charName U_ICU_ENTRY_POINT_RENAME(u_charName)
+#define u_charType U_ICU_ENTRY_POINT_RENAME(u_charType)
+#define u_charsToUChars U_ICU_ENTRY_POINT_RENAME(u_charsToUChars)
+#define u_cleanup U_ICU_ENTRY_POINT_RENAME(u_cleanup)
+#define u_countChar32 U_ICU_ENTRY_POINT_RENAME(u_countChar32)
+#define u_digit U_ICU_ENTRY_POINT_RENAME(u_digit)
+#define u_enumCharNames U_ICU_ENTRY_POINT_RENAME(u_enumCharNames)
+#define u_enumCharTypes U_ICU_ENTRY_POINT_RENAME(u_enumCharTypes)
+#define u_errorName U_ICU_ENTRY_POINT_RENAME(u_errorName)
+#define u_fadopt U_ICU_ENTRY_POINT_RENAME(u_fadopt)
+#define u_fclose U_ICU_ENTRY_POINT_RENAME(u_fclose)
+#define u_feof U_ICU_ENTRY_POINT_RENAME(u_feof)
+#define u_fflush U_ICU_ENTRY_POINT_RENAME(u_fflush)
+#define u_fgetConverter U_ICU_ENTRY_POINT_RENAME(u_fgetConverter)
+#define u_fgetc U_ICU_ENTRY_POINT_RENAME(u_fgetc)
+#define u_fgetcodepage U_ICU_ENTRY_POINT_RENAME(u_fgetcodepage)
+#define u_fgetcx U_ICU_ENTRY_POINT_RENAME(u_fgetcx)
+#define u_fgetfile U_ICU_ENTRY_POINT_RENAME(u_fgetfile)
+#define u_fgetlocale U_ICU_ENTRY_POINT_RENAME(u_fgetlocale)
+#define u_fgets U_ICU_ENTRY_POINT_RENAME(u_fgets)
+#define u_file_read U_ICU_ENTRY_POINT_RENAME(u_file_read)
+#define u_file_write U_ICU_ENTRY_POINT_RENAME(u_file_write)
+#define u_file_write_flush U_ICU_ENTRY_POINT_RENAME(u_file_write_flush)
+#define u_finit U_ICU_ENTRY_POINT_RENAME(u_finit)
+#define u_flushDefaultConverter U_ICU_ENTRY_POINT_RENAME(u_flushDefaultConverter)
+#define u_foldCase U_ICU_ENTRY_POINT_RENAME(u_foldCase)
+#define u_fopen U_ICU_ENTRY_POINT_RENAME(u_fopen)
+#define u_forDigit U_ICU_ENTRY_POINT_RENAME(u_forDigit)
+#define u_formatMessage U_ICU_ENTRY_POINT_RENAME(u_formatMessage)
+#define u_formatMessageWithError U_ICU_ENTRY_POINT_RENAME(u_formatMessageWithError)
+#define u_fprintf U_ICU_ENTRY_POINT_RENAME(u_fprintf)
+#define u_fprintf_u U_ICU_ENTRY_POINT_RENAME(u_fprintf_u)
+#define u_fputc U_ICU_ENTRY_POINT_RENAME(u_fputc)
+#define u_fputs U_ICU_ENTRY_POINT_RENAME(u_fputs)
+#define u_frewind U_ICU_ENTRY_POINT_RENAME(u_frewind)
+#define u_fscanf U_ICU_ENTRY_POINT_RENAME(u_fscanf)
+#define u_fscanf_u U_ICU_ENTRY_POINT_RENAME(u_fscanf_u)
+#define u_fsetcodepage U_ICU_ENTRY_POINT_RENAME(u_fsetcodepage)
+#define u_fsetlocale U_ICU_ENTRY_POINT_RENAME(u_fsetlocale)
+#define u_fsettransliterator U_ICU_ENTRY_POINT_RENAME(u_fsettransliterator)
+#define u_fstropen U_ICU_ENTRY_POINT_RENAME(u_fstropen)
+#define u_fungetc U_ICU_ENTRY_POINT_RENAME(u_fungetc)
+#define u_getCombiningClass U_ICU_ENTRY_POINT_RENAME(u_getCombiningClass)
+#define u_getDataDirectory U_ICU_ENTRY_POINT_RENAME(u_getDataDirectory)
+#define u_getDataVersion U_ICU_ENTRY_POINT_RENAME(u_getDataVersion)
+#define u_getDefaultConverter U_ICU_ENTRY_POINT_RENAME(u_getDefaultConverter)
+#define u_getFC_NFKC_Closure U_ICU_ENTRY_POINT_RENAME(u_getFC_NFKC_Closure)
+#define u_getISOComment U_ICU_ENTRY_POINT_RENAME(u_getISOComment)
+#define u_getIntPropertyMaxValue U_ICU_ENTRY_POINT_RENAME(u_getIntPropertyMaxValue)
+#define u_getIntPropertyMinValue U_ICU_ENTRY_POINT_RENAME(u_getIntPropertyMinValue)
+#define u_getIntPropertyValue U_ICU_ENTRY_POINT_RENAME(u_getIntPropertyValue)
+#define u_getNumericValue U_ICU_ENTRY_POINT_RENAME(u_getNumericValue)
+#define u_getPropertyEnum U_ICU_ENTRY_POINT_RENAME(u_getPropertyEnum)
+#define u_getPropertyName U_ICU_ENTRY_POINT_RENAME(u_getPropertyName)
+#define u_getPropertyValueEnum U_ICU_ENTRY_POINT_RENAME(u_getPropertyValueEnum)
+#define u_getPropertyValueName U_ICU_ENTRY_POINT_RENAME(u_getPropertyValueName)
+#define u_getUnicodeProperties U_ICU_ENTRY_POINT_RENAME(u_getUnicodeProperties)
+#define u_getUnicodeVersion U_ICU_ENTRY_POINT_RENAME(u_getUnicodeVersion)
+#define u_getVersion U_ICU_ENTRY_POINT_RENAME(u_getVersion)
+#define u_hasBinaryProperty U_ICU_ENTRY_POINT_RENAME(u_hasBinaryProperty)
+#define u_init U_ICU_ENTRY_POINT_RENAME(u_init)
+#define u_isDataOlder U_ICU_ENTRY_POINT_RENAME(u_isDataOlder)
+#define u_isIDIgnorable U_ICU_ENTRY_POINT_RENAME(u_isIDIgnorable)
+#define u_isIDPart U_ICU_ENTRY_POINT_RENAME(u_isIDPart)
+#define u_isIDStart U_ICU_ENTRY_POINT_RENAME(u_isIDStart)
+#define u_isISOControl U_ICU_ENTRY_POINT_RENAME(u_isISOControl)
+#define u_isJavaIDPart U_ICU_ENTRY_POINT_RENAME(u_isJavaIDPart)
+#define u_isJavaIDStart U_ICU_ENTRY_POINT_RENAME(u_isJavaIDStart)
+#define u_isJavaSpaceChar U_ICU_ENTRY_POINT_RENAME(u_isJavaSpaceChar)
+#define u_isMirrored U_ICU_ENTRY_POINT_RENAME(u_isMirrored)
+#define u_isUAlphabetic U_ICU_ENTRY_POINT_RENAME(u_isUAlphabetic)
+#define u_isULowercase U_ICU_ENTRY_POINT_RENAME(u_isULowercase)
+#define u_isUUppercase U_ICU_ENTRY_POINT_RENAME(u_isUUppercase)
+#define u_isUWhiteSpace U_ICU_ENTRY_POINT_RENAME(u_isUWhiteSpace)
+#define u_isWhitespace U_ICU_ENTRY_POINT_RENAME(u_isWhitespace)
+#define u_isalnum U_ICU_ENTRY_POINT_RENAME(u_isalnum)
+#define u_isalnumPOSIX U_ICU_ENTRY_POINT_RENAME(u_isalnumPOSIX)
+#define u_isalpha U_ICU_ENTRY_POINT_RENAME(u_isalpha)
+#define u_isbase U_ICU_ENTRY_POINT_RENAME(u_isbase)
+#define u_isblank U_ICU_ENTRY_POINT_RENAME(u_isblank)
+#define u_iscntrl U_ICU_ENTRY_POINT_RENAME(u_iscntrl)
+#define u_isdefined U_ICU_ENTRY_POINT_RENAME(u_isdefined)
+#define u_isdigit U_ICU_ENTRY_POINT_RENAME(u_isdigit)
+#define u_isgraph U_ICU_ENTRY_POINT_RENAME(u_isgraph)
+#define u_isgraphPOSIX U_ICU_ENTRY_POINT_RENAME(u_isgraphPOSIX)
+#define u_islower U_ICU_ENTRY_POINT_RENAME(u_islower)
+#define u_isprint U_ICU_ENTRY_POINT_RENAME(u_isprint)
+#define u_isprintPOSIX U_ICU_ENTRY_POINT_RENAME(u_isprintPOSIX)
+#define u_ispunct U_ICU_ENTRY_POINT_RENAME(u_ispunct)
+#define u_isspace U_ICU_ENTRY_POINT_RENAME(u_isspace)
+#define u_istitle U_ICU_ENTRY_POINT_RENAME(u_istitle)
+#define u_isupper U_ICU_ENTRY_POINT_RENAME(u_isupper)
+#define u_isxdigit U_ICU_ENTRY_POINT_RENAME(u_isxdigit)
+#define u_lengthOfIdenticalLevelRun U_ICU_ENTRY_POINT_RENAME(u_lengthOfIdenticalLevelRun)
+#define u_locbund_close U_ICU_ENTRY_POINT_RENAME(u_locbund_close)
+#define u_locbund_getNumberFormat U_ICU_ENTRY_POINT_RENAME(u_locbund_getNumberFormat)
+#define u_locbund_init U_ICU_ENTRY_POINT_RENAME(u_locbund_init)
+#define u_memcasecmp U_ICU_ENTRY_POINT_RENAME(u_memcasecmp)
+#define u_memchr U_ICU_ENTRY_POINT_RENAME(u_memchr)
+#define u_memchr32 U_ICU_ENTRY_POINT_RENAME(u_memchr32)
+#define u_memcmp U_ICU_ENTRY_POINT_RENAME(u_memcmp)
+#define u_memcmpCodePointOrder U_ICU_ENTRY_POINT_RENAME(u_memcmpCodePointOrder)
+#define u_memcpy U_ICU_ENTRY_POINT_RENAME(u_memcpy)
+#define u_memmove U_ICU_ENTRY_POINT_RENAME(u_memmove)
+#define u_memrchr U_ICU_ENTRY_POINT_RENAME(u_memrchr)
+#define u_memrchr32 U_ICU_ENTRY_POINT_RENAME(u_memrchr32)
+#define u_memset U_ICU_ENTRY_POINT_RENAME(u_memset)
+#define u_parseMessage U_ICU_ENTRY_POINT_RENAME(u_parseMessage)
+#define u_parseMessageWithError U_ICU_ENTRY_POINT_RENAME(u_parseMessageWithError)
+#define u_printf_parse U_ICU_ENTRY_POINT_RENAME(u_printf_parse)
+#define u_releaseDefaultConverter U_ICU_ENTRY_POINT_RENAME(u_releaseDefaultConverter)
+#define u_scanf_parse U_ICU_ENTRY_POINT_RENAME(u_scanf_parse)
+#define u_setAtomicIncDecFunctions U_ICU_ENTRY_POINT_RENAME(u_setAtomicIncDecFunctions)
+#define u_setDataDirectory U_ICU_ENTRY_POINT_RENAME(u_setDataDirectory)
+#define u_setMemoryFunctions U_ICU_ENTRY_POINT_RENAME(u_setMemoryFunctions)
+#define u_setMutexFunctions U_ICU_ENTRY_POINT_RENAME(u_setMutexFunctions)
+#define u_shapeArabic U_ICU_ENTRY_POINT_RENAME(u_shapeArabic)
+#define u_snprintf U_ICU_ENTRY_POINT_RENAME(u_snprintf)
+#define u_snprintf_u U_ICU_ENTRY_POINT_RENAME(u_snprintf_u)
+#define u_sprintf U_ICU_ENTRY_POINT_RENAME(u_sprintf)
+#define u_sprintf_u U_ICU_ENTRY_POINT_RENAME(u_sprintf_u)
+#define u_sscanf U_ICU_ENTRY_POINT_RENAME(u_sscanf)
+#define u_sscanf_u U_ICU_ENTRY_POINT_RENAME(u_sscanf_u)
+#define u_strCaseCompare U_ICU_ENTRY_POINT_RENAME(u_strCaseCompare)
+#define u_strCompare U_ICU_ENTRY_POINT_RENAME(u_strCompare)
+#define u_strCompareIter U_ICU_ENTRY_POINT_RENAME(u_strCompareIter)
+#define u_strFindFirst U_ICU_ENTRY_POINT_RENAME(u_strFindFirst)
+#define u_strFindLast U_ICU_ENTRY_POINT_RENAME(u_strFindLast)
+#define u_strFoldCase U_ICU_ENTRY_POINT_RENAME(u_strFoldCase)
+#define u_strFromJavaModifiedUTF8WithSub U_ICU_ENTRY_POINT_RENAME(u_strFromJavaModifiedUTF8WithSub)
+#define u_strFromPunycode U_ICU_ENTRY_POINT_RENAME(u_strFromPunycode)
+#define u_strFromUTF32 U_ICU_ENTRY_POINT_RENAME(u_strFromUTF32)
+#define u_strFromUTF32WithSub U_ICU_ENTRY_POINT_RENAME(u_strFromUTF32WithSub)
+#define u_strFromUTF8 U_ICU_ENTRY_POINT_RENAME(u_strFromUTF8)
+#define u_strFromUTF8Lenient U_ICU_ENTRY_POINT_RENAME(u_strFromUTF8Lenient)
+#define u_strFromUTF8WithSub U_ICU_ENTRY_POINT_RENAME(u_strFromUTF8WithSub)
+#define u_strFromWCS U_ICU_ENTRY_POINT_RENAME(u_strFromWCS)
+#define u_strHasMoreChar32Than U_ICU_ENTRY_POINT_RENAME(u_strHasMoreChar32Than)
+#define u_strToJavaModifiedUTF8 U_ICU_ENTRY_POINT_RENAME(u_strToJavaModifiedUTF8)
+#define u_strToLower U_ICU_ENTRY_POINT_RENAME(u_strToLower)
+#define u_strToPunycode U_ICU_ENTRY_POINT_RENAME(u_strToPunycode)
+#define u_strToTitle U_ICU_ENTRY_POINT_RENAME(u_strToTitle)
+#define u_strToUTF32 U_ICU_ENTRY_POINT_RENAME(u_strToUTF32)
+#define u_strToUTF32WithSub U_ICU_ENTRY_POINT_RENAME(u_strToUTF32WithSub)
+#define u_strToUTF8 U_ICU_ENTRY_POINT_RENAME(u_strToUTF8)
+#define u_strToUTF8WithSub U_ICU_ENTRY_POINT_RENAME(u_strToUTF8WithSub)
+#define u_strToUpper U_ICU_ENTRY_POINT_RENAME(u_strToUpper)
+#define u_strToWCS U_ICU_ENTRY_POINT_RENAME(u_strToWCS)
+#define u_strcasecmp U_ICU_ENTRY_POINT_RENAME(u_strcasecmp)
+#define u_strcat U_ICU_ENTRY_POINT_RENAME(u_strcat)
+#define u_strchr U_ICU_ENTRY_POINT_RENAME(u_strchr)
+#define u_strchr32 U_ICU_ENTRY_POINT_RENAME(u_strchr32)
+#define u_strcmp U_ICU_ENTRY_POINT_RENAME(u_strcmp)
+#define u_strcmpCodePointOrder U_ICU_ENTRY_POINT_RENAME(u_strcmpCodePointOrder)
+#define u_strcmpFold U_ICU_ENTRY_POINT_RENAME(u_strcmpFold)
+#define u_strcpy U_ICU_ENTRY_POINT_RENAME(u_strcpy)
+#define u_strcspn U_ICU_ENTRY_POINT_RENAME(u_strcspn)
+#define u_strlen U_ICU_ENTRY_POINT_RENAME(u_strlen)
+#define u_strncasecmp U_ICU_ENTRY_POINT_RENAME(u_strncasecmp)
+#define u_strncat U_ICU_ENTRY_POINT_RENAME(u_strncat)
+#define u_strncmp U_ICU_ENTRY_POINT_RENAME(u_strncmp)
+#define u_strncmpCodePointOrder U_ICU_ENTRY_POINT_RENAME(u_strncmpCodePointOrder)
+#define u_strncpy U_ICU_ENTRY_POINT_RENAME(u_strncpy)
+#define u_strpbrk U_ICU_ENTRY_POINT_RENAME(u_strpbrk)
+#define u_strrchr U_ICU_ENTRY_POINT_RENAME(u_strrchr)
+#define u_strrchr32 U_ICU_ENTRY_POINT_RENAME(u_strrchr32)
+#define u_strrstr U_ICU_ENTRY_POINT_RENAME(u_strrstr)
+#define u_strspn U_ICU_ENTRY_POINT_RENAME(u_strspn)
+#define u_strstr U_ICU_ENTRY_POINT_RENAME(u_strstr)
+#define u_strtok_r U_ICU_ENTRY_POINT_RENAME(u_strtok_r)
+#define u_terminateChars U_ICU_ENTRY_POINT_RENAME(u_terminateChars)
+#define u_terminateUChar32s U_ICU_ENTRY_POINT_RENAME(u_terminateUChar32s)
+#define u_terminateUChars U_ICU_ENTRY_POINT_RENAME(u_terminateUChars)
+#define u_terminateWChars U_ICU_ENTRY_POINT_RENAME(u_terminateWChars)
+#define u_tolower U_ICU_ENTRY_POINT_RENAME(u_tolower)
+#define u_totitle U_ICU_ENTRY_POINT_RENAME(u_totitle)
+#define u_toupper U_ICU_ENTRY_POINT_RENAME(u_toupper)
+#define u_uastrcpy U_ICU_ENTRY_POINT_RENAME(u_uastrcpy)
+#define u_uastrncpy U_ICU_ENTRY_POINT_RENAME(u_uastrncpy)
+#define u_unescape U_ICU_ENTRY_POINT_RENAME(u_unescape)
+#define u_unescapeAt U_ICU_ENTRY_POINT_RENAME(u_unescapeAt)
+#define u_versionFromString U_ICU_ENTRY_POINT_RENAME(u_versionFromString)
+#define u_versionFromUString U_ICU_ENTRY_POINT_RENAME(u_versionFromUString)
+#define u_versionToString U_ICU_ENTRY_POINT_RENAME(u_versionToString)
+#define u_vformatMessage U_ICU_ENTRY_POINT_RENAME(u_vformatMessage)
+#define u_vformatMessageWithError U_ICU_ENTRY_POINT_RENAME(u_vformatMessageWithError)
+#define u_vfprintf U_ICU_ENTRY_POINT_RENAME(u_vfprintf)
+#define u_vfprintf_u U_ICU_ENTRY_POINT_RENAME(u_vfprintf_u)
+#define u_vfscanf U_ICU_ENTRY_POINT_RENAME(u_vfscanf)
+#define u_vfscanf_u U_ICU_ENTRY_POINT_RENAME(u_vfscanf_u)
+#define u_vparseMessage U_ICU_ENTRY_POINT_RENAME(u_vparseMessage)
+#define u_vparseMessageWithError U_ICU_ENTRY_POINT_RENAME(u_vparseMessageWithError)
+#define u_vsnprintf U_ICU_ENTRY_POINT_RENAME(u_vsnprintf)
+#define u_vsnprintf_u U_ICU_ENTRY_POINT_RENAME(u_vsnprintf_u)
+#define u_vsprintf U_ICU_ENTRY_POINT_RENAME(u_vsprintf)
+#define u_vsprintf_u U_ICU_ENTRY_POINT_RENAME(u_vsprintf_u)
+#define u_vsscanf U_ICU_ENTRY_POINT_RENAME(u_vsscanf)
+#define u_vsscanf_u U_ICU_ENTRY_POINT_RENAME(u_vsscanf_u)
+#define u_writeDiff U_ICU_ENTRY_POINT_RENAME(u_writeDiff)
+#define u_writeIdenticalLevelRun U_ICU_ENTRY_POINT_RENAME(u_writeIdenticalLevelRun)
+#define u_writeIdenticalLevelRunTwoChars U_ICU_ENTRY_POINT_RENAME(u_writeIdenticalLevelRunTwoChars)
+#define ubidi_addPropertyStarts U_ICU_ENTRY_POINT_RENAME(ubidi_addPropertyStarts)
+#define ubidi_close U_ICU_ENTRY_POINT_RENAME(ubidi_close)
+#define ubidi_countParagraphs U_ICU_ENTRY_POINT_RENAME(ubidi_countParagraphs)
+#define ubidi_countRuns U_ICU_ENTRY_POINT_RENAME(ubidi_countRuns)
+#define ubidi_getBaseDirection U_ICU_ENTRY_POINT_RENAME(ubidi_getBaseDirection)
+#define ubidi_getClass U_ICU_ENTRY_POINT_RENAME(ubidi_getClass)
+#define ubidi_getClassCallback U_ICU_ENTRY_POINT_RENAME(ubidi_getClassCallback)
+#define ubidi_getCustomizedClass U_ICU_ENTRY_POINT_RENAME(ubidi_getCustomizedClass)
+#define ubidi_getDirection U_ICU_ENTRY_POINT_RENAME(ubidi_getDirection)
+#define ubidi_getJoiningGroup U_ICU_ENTRY_POINT_RENAME(ubidi_getJoiningGroup)
+#define ubidi_getJoiningType U_ICU_ENTRY_POINT_RENAME(ubidi_getJoiningType)
+#define ubidi_getLength U_ICU_ENTRY_POINT_RENAME(ubidi_getLength)
+#define ubidi_getLevelAt U_ICU_ENTRY_POINT_RENAME(ubidi_getLevelAt)
+#define ubidi_getLevels U_ICU_ENTRY_POINT_RENAME(ubidi_getLevels)
+#define ubidi_getLogicalIndex U_ICU_ENTRY_POINT_RENAME(ubidi_getLogicalIndex)
+#define ubidi_getLogicalMap U_ICU_ENTRY_POINT_RENAME(ubidi_getLogicalMap)
+#define ubidi_getLogicalRun U_ICU_ENTRY_POINT_RENAME(ubidi_getLogicalRun)
+#define ubidi_getMaxValue U_ICU_ENTRY_POINT_RENAME(ubidi_getMaxValue)
+#define ubidi_getMemory U_ICU_ENTRY_POINT_RENAME(ubidi_getMemory)
+#define ubidi_getMirror U_ICU_ENTRY_POINT_RENAME(ubidi_getMirror)
+#define ubidi_getParaLevel U_ICU_ENTRY_POINT_RENAME(ubidi_getParaLevel)
+#define ubidi_getParagraph U_ICU_ENTRY_POINT_RENAME(ubidi_getParagraph)
+#define ubidi_getParagraphByIndex U_ICU_ENTRY_POINT_RENAME(ubidi_getParagraphByIndex)
+#define ubidi_getProcessedLength U_ICU_ENTRY_POINT_RENAME(ubidi_getProcessedLength)
+#define ubidi_getReorderingMode U_ICU_ENTRY_POINT_RENAME(ubidi_getReorderingMode)
+#define ubidi_getReorderingOptions U_ICU_ENTRY_POINT_RENAME(ubidi_getReorderingOptions)
+#define ubidi_getResultLength U_ICU_ENTRY_POINT_RENAME(ubidi_getResultLength)
+#define ubidi_getRuns U_ICU_ENTRY_POINT_RENAME(ubidi_getRuns)
+#define ubidi_getSingleton U_ICU_ENTRY_POINT_RENAME(ubidi_getSingleton)
+#define ubidi_getText U_ICU_ENTRY_POINT_RENAME(ubidi_getText)
+#define ubidi_getVisualIndex U_ICU_ENTRY_POINT_RENAME(ubidi_getVisualIndex)
+#define ubidi_getVisualMap U_ICU_ENTRY_POINT_RENAME(ubidi_getVisualMap)
+#define ubidi_getVisualRun U_ICU_ENTRY_POINT_RENAME(ubidi_getVisualRun)
+#define ubidi_invertMap U_ICU_ENTRY_POINT_RENAME(ubidi_invertMap)
+#define ubidi_isBidiControl U_ICU_ENTRY_POINT_RENAME(ubidi_isBidiControl)
+#define ubidi_isInverse U_ICU_ENTRY_POINT_RENAME(ubidi_isInverse)
+#define ubidi_isJoinControl U_ICU_ENTRY_POINT_RENAME(ubidi_isJoinControl)
+#define ubidi_isMirrored U_ICU_ENTRY_POINT_RENAME(ubidi_isMirrored)
+#define ubidi_isOrderParagraphsLTR U_ICU_ENTRY_POINT_RENAME(ubidi_isOrderParagraphsLTR)
+#define ubidi_open U_ICU_ENTRY_POINT_RENAME(ubidi_open)
+#define ubidi_openSized U_ICU_ENTRY_POINT_RENAME(ubidi_openSized)
+#define ubidi_orderParagraphsLTR U_ICU_ENTRY_POINT_RENAME(ubidi_orderParagraphsLTR)
+#define ubidi_reorderLogical U_ICU_ENTRY_POINT_RENAME(ubidi_reorderLogical)
+#define ubidi_reorderVisual U_ICU_ENTRY_POINT_RENAME(ubidi_reorderVisual)
+#define ubidi_setClassCallback U_ICU_ENTRY_POINT_RENAME(ubidi_setClassCallback)
+#define ubidi_setInverse U_ICU_ENTRY_POINT_RENAME(ubidi_setInverse)
+#define ubidi_setLine U_ICU_ENTRY_POINT_RENAME(ubidi_setLine)
+#define ubidi_setPara U_ICU_ENTRY_POINT_RENAME(ubidi_setPara)
+#define ubidi_setReorderingMode U_ICU_ENTRY_POINT_RENAME(ubidi_setReorderingMode)
+#define ubidi_setReorderingOptions U_ICU_ENTRY_POINT_RENAME(ubidi_setReorderingOptions)
+#define ubidi_writeReordered U_ICU_ENTRY_POINT_RENAME(ubidi_writeReordered)
+#define ubidi_writeReverse U_ICU_ENTRY_POINT_RENAME(ubidi_writeReverse)
+#define ublock_getCode U_ICU_ENTRY_POINT_RENAME(ublock_getCode)
+#define ubrk_close U_ICU_ENTRY_POINT_RENAME(ubrk_close)
+#define ubrk_countAvailable U_ICU_ENTRY_POINT_RENAME(ubrk_countAvailable)
+#define ubrk_current U_ICU_ENTRY_POINT_RENAME(ubrk_current)
+#define ubrk_first U_ICU_ENTRY_POINT_RENAME(ubrk_first)
+#define ubrk_following U_ICU_ENTRY_POINT_RENAME(ubrk_following)
+#define ubrk_getAvailable U_ICU_ENTRY_POINT_RENAME(ubrk_getAvailable)
+#define ubrk_getLocaleByType U_ICU_ENTRY_POINT_RENAME(ubrk_getLocaleByType)
+#define ubrk_getRuleStatus U_ICU_ENTRY_POINT_RENAME(ubrk_getRuleStatus)
+#define ubrk_getRuleStatusVec U_ICU_ENTRY_POINT_RENAME(ubrk_getRuleStatusVec)
+#define ubrk_isBoundary U_ICU_ENTRY_POINT_RENAME(ubrk_isBoundary)
+#define ubrk_last U_ICU_ENTRY_POINT_RENAME(ubrk_last)
+#define ubrk_next U_ICU_ENTRY_POINT_RENAME(ubrk_next)
+#define ubrk_open U_ICU_ENTRY_POINT_RENAME(ubrk_open)
+#define ubrk_openRules U_ICU_ENTRY_POINT_RENAME(ubrk_openRules)
+#define ubrk_preceding U_ICU_ENTRY_POINT_RENAME(ubrk_preceding)
+#define ubrk_previous U_ICU_ENTRY_POINT_RENAME(ubrk_previous)
+#define ubrk_safeClone U_ICU_ENTRY_POINT_RENAME(ubrk_safeClone)
+#define ubrk_setText U_ICU_ENTRY_POINT_RENAME(ubrk_setText)
+#define ubrk_setUText U_ICU_ENTRY_POINT_RENAME(ubrk_setUText)
+#define ubrk_swap U_ICU_ENTRY_POINT_RENAME(ubrk_swap)
+#define ucal_add U_ICU_ENTRY_POINT_RENAME(ucal_add)
+#define ucal_clear U_ICU_ENTRY_POINT_RENAME(ucal_clear)
+#define ucal_clearField U_ICU_ENTRY_POINT_RENAME(ucal_clearField)
+#define ucal_clone U_ICU_ENTRY_POINT_RENAME(ucal_clone)
+#define ucal_close U_ICU_ENTRY_POINT_RENAME(ucal_close)
+#define ucal_countAvailable U_ICU_ENTRY_POINT_RENAME(ucal_countAvailable)
+#define ucal_equivalentTo U_ICU_ENTRY_POINT_RENAME(ucal_equivalentTo)
+#define ucal_get U_ICU_ENTRY_POINT_RENAME(ucal_get)
+#define ucal_getAttribute U_ICU_ENTRY_POINT_RENAME(ucal_getAttribute)
+#define ucal_getAvailable U_ICU_ENTRY_POINT_RENAME(ucal_getAvailable)
+#define ucal_getCanonicalTimeZoneID U_ICU_ENTRY_POINT_RENAME(ucal_getCanonicalTimeZoneID)
+#define ucal_getDSTSavings U_ICU_ENTRY_POINT_RENAME(ucal_getDSTSavings)
+#define ucal_getDayOfWeekType U_ICU_ENTRY_POINT_RENAME(ucal_getDayOfWeekType)
+#define ucal_getDefaultTimeZone U_ICU_ENTRY_POINT_RENAME(ucal_getDefaultTimeZone)
+#define ucal_getGregorianChange U_ICU_ENTRY_POINT_RENAME(ucal_getGregorianChange)
+#define ucal_getKeywordValuesForLocale U_ICU_ENTRY_POINT_RENAME(ucal_getKeywordValuesForLocale)
+#define ucal_getLimit U_ICU_ENTRY_POINT_RENAME(ucal_getLimit)
+#define ucal_getLocaleByType U_ICU_ENTRY_POINT_RENAME(ucal_getLocaleByType)
+#define ucal_getMillis U_ICU_ENTRY_POINT_RENAME(ucal_getMillis)
+#define ucal_getNow U_ICU_ENTRY_POINT_RENAME(ucal_getNow)
+#define ucal_getTZDataVersion U_ICU_ENTRY_POINT_RENAME(ucal_getTZDataVersion)
+#define ucal_getTimeZoneDisplayName U_ICU_ENTRY_POINT_RENAME(ucal_getTimeZoneDisplayName)
+#define ucal_getType U_ICU_ENTRY_POINT_RENAME(ucal_getType)
+#define ucal_getWeekendTransition U_ICU_ENTRY_POINT_RENAME(ucal_getWeekendTransition)
+#define ucal_inDaylightTime U_ICU_ENTRY_POINT_RENAME(ucal_inDaylightTime)
+#define ucal_isSet U_ICU_ENTRY_POINT_RENAME(ucal_isSet)
+#define ucal_isWeekend U_ICU_ENTRY_POINT_RENAME(ucal_isWeekend)
+#define ucal_open U_ICU_ENTRY_POINT_RENAME(ucal_open)
+#define ucal_openCountryTimeZones U_ICU_ENTRY_POINT_RENAME(ucal_openCountryTimeZones)
+#define ucal_openTimeZones U_ICU_ENTRY_POINT_RENAME(ucal_openTimeZones)
+#define ucal_roll U_ICU_ENTRY_POINT_RENAME(ucal_roll)
+#define ucal_set U_ICU_ENTRY_POINT_RENAME(ucal_set)
+#define ucal_setAttribute U_ICU_ENTRY_POINT_RENAME(ucal_setAttribute)
+#define ucal_setDate U_ICU_ENTRY_POINT_RENAME(ucal_setDate)
+#define ucal_setDateTime U_ICU_ENTRY_POINT_RENAME(ucal_setDateTime)
+#define ucal_setDefaultTimeZone U_ICU_ENTRY_POINT_RENAME(ucal_setDefaultTimeZone)
+#define ucal_setGregorianChange U_ICU_ENTRY_POINT_RENAME(ucal_setGregorianChange)
+#define ucal_setMillis U_ICU_ENTRY_POINT_RENAME(ucal_setMillis)
+#define ucal_setTimeZone U_ICU_ENTRY_POINT_RENAME(ucal_setTimeZone)
+#define ucase_addCaseClosure U_ICU_ENTRY_POINT_RENAME(ucase_addCaseClosure)
+#define ucase_addPropertyStarts U_ICU_ENTRY_POINT_RENAME(ucase_addPropertyStarts)
+#define ucase_addStringCaseClosure U_ICU_ENTRY_POINT_RENAME(ucase_addStringCaseClosure)
+#define ucase_fold U_ICU_ENTRY_POINT_RENAME(ucase_fold)
+#define ucase_getCaseLocale U_ICU_ENTRY_POINT_RENAME(ucase_getCaseLocale)
+#define ucase_getSingleton U_ICU_ENTRY_POINT_RENAME(ucase_getSingleton)
+#define ucase_getType U_ICU_ENTRY_POINT_RENAME(ucase_getType)
+#define ucase_getTypeOrIgnorable U_ICU_ENTRY_POINT_RENAME(ucase_getTypeOrIgnorable)
+#define ucase_hasBinaryProperty U_ICU_ENTRY_POINT_RENAME(ucase_hasBinaryProperty)
+#define ucase_isCaseSensitive U_ICU_ENTRY_POINT_RENAME(ucase_isCaseSensitive)
+#define ucase_isSoftDotted U_ICU_ENTRY_POINT_RENAME(ucase_isSoftDotted)
+#define ucase_toFullFolding U_ICU_ENTRY_POINT_RENAME(ucase_toFullFolding)
+#define ucase_toFullLower U_ICU_ENTRY_POINT_RENAME(ucase_toFullLower)
+#define ucase_toFullTitle U_ICU_ENTRY_POINT_RENAME(ucase_toFullTitle)
+#define ucase_toFullUpper U_ICU_ENTRY_POINT_RENAME(ucase_toFullUpper)
+#define ucase_tolower U_ICU_ENTRY_POINT_RENAME(ucase_tolower)
+#define ucase_totitle U_ICU_ENTRY_POINT_RENAME(ucase_totitle)
+#define ucase_toupper U_ICU_ENTRY_POINT_RENAME(ucase_toupper)
+#define ucasemap_close U_ICU_ENTRY_POINT_RENAME(ucasemap_close)
+#define ucasemap_getBreakIterator U_ICU_ENTRY_POINT_RENAME(ucasemap_getBreakIterator)
+#define ucasemap_getLocale U_ICU_ENTRY_POINT_RENAME(ucasemap_getLocale)
+#define ucasemap_getOptions U_ICU_ENTRY_POINT_RENAME(ucasemap_getOptions)
+#define ucasemap_open U_ICU_ENTRY_POINT_RENAME(ucasemap_open)
+#define ucasemap_setBreakIterator U_ICU_ENTRY_POINT_RENAME(ucasemap_setBreakIterator)
+#define ucasemap_setLocale U_ICU_ENTRY_POINT_RENAME(ucasemap_setLocale)
+#define ucasemap_setOptions U_ICU_ENTRY_POINT_RENAME(ucasemap_setOptions)
+#define ucasemap_toTitle U_ICU_ENTRY_POINT_RENAME(ucasemap_toTitle)
+#define ucasemap_utf8FoldCase U_ICU_ENTRY_POINT_RENAME(ucasemap_utf8FoldCase)
+#define ucasemap_utf8ToLower U_ICU_ENTRY_POINT_RENAME(ucasemap_utf8ToLower)
+#define ucasemap_utf8ToTitle U_ICU_ENTRY_POINT_RENAME(ucasemap_utf8ToTitle)
+#define ucasemap_utf8ToUpper U_ICU_ENTRY_POINT_RENAME(ucasemap_utf8ToUpper)
+#define ucd_close U_ICU_ENTRY_POINT_RENAME(ucd_close)
+#define ucd_flushCache U_ICU_ENTRY_POINT_RENAME(ucd_flushCache)
+#define ucd_freeCache U_ICU_ENTRY_POINT_RENAME(ucd_freeCache)
+#define ucd_getCollator U_ICU_ENTRY_POINT_RENAME(ucd_getCollator)
+#define ucd_open U_ICU_ENTRY_POINT_RENAME(ucd_open)
+#define uchar_addPropertyStarts U_ICU_ENTRY_POINT_RENAME(uchar_addPropertyStarts)
+#define uchar_swapNames U_ICU_ENTRY_POINT_RENAME(uchar_swapNames)
+#define ucln_cleanupOne U_ICU_ENTRY_POINT_RENAME(ucln_cleanupOne)
+#define ucln_common_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_common_registerCleanup)
+#define ucln_i18n_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_i18n_registerCleanup)
+#define ucln_io_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_io_registerCleanup)
+#define ucln_lib_cleanup U_ICU_ENTRY_POINT_RENAME(ucln_lib_cleanup)
+#define ucln_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_registerCleanup)
+#define ucnv_MBCSFromUChar32 U_ICU_ENTRY_POINT_RENAME(ucnv_MBCSFromUChar32)
+#define ucnv_MBCSFromUnicodeWithOffsets U_ICU_ENTRY_POINT_RENAME(ucnv_MBCSFromUnicodeWithOffsets)
+#define ucnv_MBCSGetFilteredUnicodeSetForUnicode U_ICU_ENTRY_POINT_RENAME(ucnv_MBCSGetFilteredUnicodeSetForUnicode)
+#define ucnv_MBCSGetType U_ICU_ENTRY_POINT_RENAME(ucnv_MBCSGetType)
+#define ucnv_MBCSGetUnicodeSetForUnicode U_ICU_ENTRY_POINT_RENAME(ucnv_MBCSGetUnicodeSetForUnicode)
+#define ucnv_MBCSIsLeadByte U_ICU_ENTRY_POINT_RENAME(ucnv_MBCSIsLeadByte)
+#define ucnv_MBCSSimpleGetNextUChar U_ICU_ENTRY_POINT_RENAME(ucnv_MBCSSimpleGetNextUChar)
+#define ucnv_MBCSToUnicodeWithOffsets U_ICU_ENTRY_POINT_RENAME(ucnv_MBCSToUnicodeWithOffsets)
+#define ucnv_bld_countAvailableConverters U_ICU_ENTRY_POINT_RENAME(ucnv_bld_countAvailableConverters)
+#define ucnv_bld_getAvailableConverter U_ICU_ENTRY_POINT_RENAME(ucnv_bld_getAvailableConverter)
+#define ucnv_canCreateConverter U_ICU_ENTRY_POINT_RENAME(ucnv_canCreateConverter)
+#define ucnv_cbFromUWriteBytes U_ICU_ENTRY_POINT_RENAME(ucnv_cbFromUWriteBytes)
+#define ucnv_cbFromUWriteSub U_ICU_ENTRY_POINT_RENAME(ucnv_cbFromUWriteSub)
+#define ucnv_cbFromUWriteUChars U_ICU_ENTRY_POINT_RENAME(ucnv_cbFromUWriteUChars)
+#define ucnv_cbToUWriteSub U_ICU_ENTRY_POINT_RENAME(ucnv_cbToUWriteSub)
+#define ucnv_cbToUWriteUChars U_ICU_ENTRY_POINT_RENAME(ucnv_cbToUWriteUChars)
+#define ucnv_close U_ICU_ENTRY_POINT_RENAME(ucnv_close)
+#define ucnv_compareNames U_ICU_ENTRY_POINT_RENAME(ucnv_compareNames)
+#define ucnv_convert U_ICU_ENTRY_POINT_RENAME(ucnv_convert)
+#define ucnv_convertEx U_ICU_ENTRY_POINT_RENAME(ucnv_convertEx)
+#define ucnv_countAliases U_ICU_ENTRY_POINT_RENAME(ucnv_countAliases)
+#define ucnv_countAvailable U_ICU_ENTRY_POINT_RENAME(ucnv_countAvailable)
+#define ucnv_countStandards U_ICU_ENTRY_POINT_RENAME(ucnv_countStandards)
+#define ucnv_createAlgorithmicConverter U_ICU_ENTRY_POINT_RENAME(ucnv_createAlgorithmicConverter)
+#define ucnv_createConverter U_ICU_ENTRY_POINT_RENAME(ucnv_createConverter)
+#define ucnv_createConverterFromPackage U_ICU_ENTRY_POINT_RENAME(ucnv_createConverterFromPackage)
+#define ucnv_createConverterFromSharedData U_ICU_ENTRY_POINT_RENAME(ucnv_createConverterFromSharedData)
+#define ucnv_detectUnicodeSignature U_ICU_ENTRY_POINT_RENAME(ucnv_detectUnicodeSignature)
+#define ucnv_extContinueMatchFromU U_ICU_ENTRY_POINT_RENAME(ucnv_extContinueMatchFromU)
+#define ucnv_extContinueMatchToU U_ICU_ENTRY_POINT_RENAME(ucnv_extContinueMatchToU)
+#define ucnv_extGetUnicodeSet U_ICU_ENTRY_POINT_RENAME(ucnv_extGetUnicodeSet)
+#define ucnv_extInitialMatchFromU U_ICU_ENTRY_POINT_RENAME(ucnv_extInitialMatchFromU)
+#define ucnv_extInitialMatchToU U_ICU_ENTRY_POINT_RENAME(ucnv_extInitialMatchToU)
+#define ucnv_extSimpleMatchFromU U_ICU_ENTRY_POINT_RENAME(ucnv_extSimpleMatchFromU)
+#define ucnv_extSimpleMatchToU U_ICU_ENTRY_POINT_RENAME(ucnv_extSimpleMatchToU)
+#define ucnv_fixFileSeparator U_ICU_ENTRY_POINT_RENAME(ucnv_fixFileSeparator)
+#define ucnv_flushCache U_ICU_ENTRY_POINT_RENAME(ucnv_flushCache)
+#define ucnv_fromAlgorithmic U_ICU_ENTRY_POINT_RENAME(ucnv_fromAlgorithmic)
+#define ucnv_fromUChars U_ICU_ENTRY_POINT_RENAME(ucnv_fromUChars)
+#define ucnv_fromUCountPending U_ICU_ENTRY_POINT_RENAME(ucnv_fromUCountPending)
+#define ucnv_fromUWriteBytes U_ICU_ENTRY_POINT_RENAME(ucnv_fromUWriteBytes)
+#define ucnv_fromUnicode U_ICU_ENTRY_POINT_RENAME(ucnv_fromUnicode)
+#define ucnv_fromUnicode_UTF8 U_ICU_ENTRY_POINT_RENAME(ucnv_fromUnicode_UTF8)
+#define ucnv_fromUnicode_UTF8_OFFSETS_LOGIC U_ICU_ENTRY_POINT_RENAME(ucnv_fromUnicode_UTF8_OFFSETS_LOGIC)
+#define ucnv_getAlias U_ICU_ENTRY_POINT_RENAME(ucnv_getAlias)
+#define ucnv_getAliases U_ICU_ENTRY_POINT_RENAME(ucnv_getAliases)
+#define ucnv_getAvailableName U_ICU_ENTRY_POINT_RENAME(ucnv_getAvailableName)
+#define ucnv_getCCSID U_ICU_ENTRY_POINT_RENAME(ucnv_getCCSID)
+#define ucnv_getCanonicalName U_ICU_ENTRY_POINT_RENAME(ucnv_getCanonicalName)
+#define ucnv_getCompleteUnicodeSet U_ICU_ENTRY_POINT_RENAME(ucnv_getCompleteUnicodeSet)
+#define ucnv_getDefaultName U_ICU_ENTRY_POINT_RENAME(ucnv_getDefaultName)
+#define ucnv_getDisplayName U_ICU_ENTRY_POINT_RENAME(ucnv_getDisplayName)
+#define ucnv_getFromUCallBack U_ICU_ENTRY_POINT_RENAME(ucnv_getFromUCallBack)
+#define ucnv_getInvalidChars U_ICU_ENTRY_POINT_RENAME(ucnv_getInvalidChars)
+#define ucnv_getInvalidUChars U_ICU_ENTRY_POINT_RENAME(ucnv_getInvalidUChars)
+#define ucnv_getMaxCharSize U_ICU_ENTRY_POINT_RENAME(ucnv_getMaxCharSize)
+#define ucnv_getMinCharSize U_ICU_ENTRY_POINT_RENAME(ucnv_getMinCharSize)
+#define ucnv_getName U_ICU_ENTRY_POINT_RENAME(ucnv_getName)
+#define ucnv_getNextUChar U_ICU_ENTRY_POINT_RENAME(ucnv_getNextUChar)
+#define ucnv_getNonSurrogateUnicodeSet U_ICU_ENTRY_POINT_RENAME(ucnv_getNonSurrogateUnicodeSet)
+#define ucnv_getPlatform U_ICU_ENTRY_POINT_RENAME(ucnv_getPlatform)
+#define ucnv_getStandard U_ICU_ENTRY_POINT_RENAME(ucnv_getStandard)
+#define ucnv_getStandardName U_ICU_ENTRY_POINT_RENAME(ucnv_getStandardName)
+#define ucnv_getStarters U_ICU_ENTRY_POINT_RENAME(ucnv_getStarters)
+#define ucnv_getSubstChars U_ICU_ENTRY_POINT_RENAME(ucnv_getSubstChars)
+#define ucnv_getToUCallBack U_ICU_ENTRY_POINT_RENAME(ucnv_getToUCallBack)
+#define ucnv_getType U_ICU_ENTRY_POINT_RENAME(ucnv_getType)
+#define ucnv_getUnicodeSet U_ICU_ENTRY_POINT_RENAME(ucnv_getUnicodeSet)
+#define ucnv_incrementRefCount U_ICU_ENTRY_POINT_RENAME(ucnv_incrementRefCount)
+#define ucnv_io_countKnownConverters U_ICU_ENTRY_POINT_RENAME(ucnv_io_countKnownConverters)
+#define ucnv_io_getConverterName U_ICU_ENTRY_POINT_RENAME(ucnv_io_getConverterName)
+#define ucnv_io_stripASCIIForCompare U_ICU_ENTRY_POINT_RENAME(ucnv_io_stripASCIIForCompare)
+#define ucnv_io_stripEBCDICForCompare U_ICU_ENTRY_POINT_RENAME(ucnv_io_stripEBCDICForCompare)
+#define ucnv_isAmbiguous U_ICU_ENTRY_POINT_RENAME(ucnv_isAmbiguous)
+#define ucnv_load U_ICU_ENTRY_POINT_RENAME(ucnv_load)
+#define ucnv_loadSharedData U_ICU_ENTRY_POINT_RENAME(ucnv_loadSharedData)
+#define ucnv_open U_ICU_ENTRY_POINT_RENAME(ucnv_open)
+#define ucnv_openAllNames U_ICU_ENTRY_POINT_RENAME(ucnv_openAllNames)
+#define ucnv_openCCSID U_ICU_ENTRY_POINT_RENAME(ucnv_openCCSID)
+#define ucnv_openPackage U_ICU_ENTRY_POINT_RENAME(ucnv_openPackage)
+#define ucnv_openStandardNames U_ICU_ENTRY_POINT_RENAME(ucnv_openStandardNames)
+#define ucnv_openU U_ICU_ENTRY_POINT_RENAME(ucnv_openU)
+#define ucnv_reset U_ICU_ENTRY_POINT_RENAME(ucnv_reset)
+#define ucnv_resetFromUnicode U_ICU_ENTRY_POINT_RENAME(ucnv_resetFromUnicode)
+#define ucnv_resetToUnicode U_ICU_ENTRY_POINT_RENAME(ucnv_resetToUnicode)
+#define ucnv_safeClone U_ICU_ENTRY_POINT_RENAME(ucnv_safeClone)
+#define ucnv_setDefaultName U_ICU_ENTRY_POINT_RENAME(ucnv_setDefaultName)
+#define ucnv_setFallback U_ICU_ENTRY_POINT_RENAME(ucnv_setFallback)
+#define ucnv_setFromUCallBack U_ICU_ENTRY_POINT_RENAME(ucnv_setFromUCallBack)
+#define ucnv_setSubstChars U_ICU_ENTRY_POINT_RENAME(ucnv_setSubstChars)
+#define ucnv_setSubstString U_ICU_ENTRY_POINT_RENAME(ucnv_setSubstString)
+#define ucnv_setToUCallBack U_ICU_ENTRY_POINT_RENAME(ucnv_setToUCallBack)
+#define ucnv_swap U_ICU_ENTRY_POINT_RENAME(ucnv_swap)
+#define ucnv_swapAliases U_ICU_ENTRY_POINT_RENAME(ucnv_swapAliases)
+#define ucnv_toAlgorithmic U_ICU_ENTRY_POINT_RENAME(ucnv_toAlgorithmic)
+#define ucnv_toUChars U_ICU_ENTRY_POINT_RENAME(ucnv_toUChars)
+#define ucnv_toUCountPending U_ICU_ENTRY_POINT_RENAME(ucnv_toUCountPending)
+#define ucnv_toUWriteCodePoint U_ICU_ENTRY_POINT_RENAME(ucnv_toUWriteCodePoint)
+#define ucnv_toUWriteUChars U_ICU_ENTRY_POINT_RENAME(ucnv_toUWriteUChars)
+#define ucnv_toUnicode U_ICU_ENTRY_POINT_RENAME(ucnv_toUnicode)
+#define ucnv_unload U_ICU_ENTRY_POINT_RENAME(ucnv_unload)
+#define ucnv_unloadSharedDataIfReady U_ICU_ENTRY_POINT_RENAME(ucnv_unloadSharedDataIfReady)
+#define ucnv_usesFallback U_ICU_ENTRY_POINT_RENAME(ucnv_usesFallback)
+#define ucnvsel_close U_ICU_ENTRY_POINT_RENAME(ucnvsel_close)
+#define ucnvsel_open U_ICU_ENTRY_POINT_RENAME(ucnvsel_open)
+#define ucnvsel_openFromSerialized U_ICU_ENTRY_POINT_RENAME(ucnvsel_openFromSerialized)
+#define ucnvsel_selectForString U_ICU_ENTRY_POINT_RENAME(ucnvsel_selectForString)
+#define ucnvsel_selectForUTF8 U_ICU_ENTRY_POINT_RENAME(ucnvsel_selectForUTF8)
+#define ucnvsel_serialize U_ICU_ENTRY_POINT_RENAME(ucnvsel_serialize)
+#define ucol_allocWeights U_ICU_ENTRY_POINT_RENAME(ucol_allocWeights)
+#define ucol_assembleTailoringTable U_ICU_ENTRY_POINT_RENAME(ucol_assembleTailoringTable)
+#define ucol_buildPermutationTable U_ICU_ENTRY_POINT_RENAME(ucol_buildPermutationTable)
+#define ucol_calcSortKey U_ICU_ENTRY_POINT_RENAME(ucol_calcSortKey)
+#define ucol_calcSortKeySimpleTertiary U_ICU_ENTRY_POINT_RENAME(ucol_calcSortKeySimpleTertiary)
+#define ucol_cloneBinary U_ICU_ENTRY_POINT_RENAME(ucol_cloneBinary)
+#define ucol_cloneRuleData U_ICU_ENTRY_POINT_RENAME(ucol_cloneRuleData)
+#define ucol_close U_ICU_ENTRY_POINT_RENAME(ucol_close)
+#define ucol_closeElements U_ICU_ENTRY_POINT_RENAME(ucol_closeElements)
+#define ucol_countAvailable U_ICU_ENTRY_POINT_RENAME(ucol_countAvailable)
+#define ucol_createElements U_ICU_ENTRY_POINT_RENAME(ucol_createElements)
+#define ucol_doCE U_ICU_ENTRY_POINT_RENAME(ucol_doCE)
+#define ucol_equal U_ICU_ENTRY_POINT_RENAME(ucol_equal)
+#define ucol_equals U_ICU_ENTRY_POINT_RENAME(ucol_equals)
+#define ucol_findReorderingEntry U_ICU_ENTRY_POINT_RENAME(ucol_findReorderingEntry)
+#define ucol_forceHanImplicit U_ICU_ENTRY_POINT_RENAME(ucol_forceHanImplicit)
+#define ucol_forgetUCA U_ICU_ENTRY_POINT_RENAME(ucol_forgetUCA)
+#define ucol_freeOffsetBuffer U_ICU_ENTRY_POINT_RENAME(ucol_freeOffsetBuffer)
+#define ucol_getAttribute U_ICU_ENTRY_POINT_RENAME(ucol_getAttribute)
+#define ucol_getAttributeOrDefault U_ICU_ENTRY_POINT_RENAME(ucol_getAttributeOrDefault)
+#define ucol_getAvailable U_ICU_ENTRY_POINT_RENAME(ucol_getAvailable)
+#define ucol_getBound U_ICU_ENTRY_POINT_RENAME(ucol_getBound)
+#define ucol_getCEStrengthDifference U_ICU_ENTRY_POINT_RENAME(ucol_getCEStrengthDifference)
+#define ucol_getContractions U_ICU_ENTRY_POINT_RENAME(ucol_getContractions)
+#define ucol_getContractionsAndExpansions U_ICU_ENTRY_POINT_RENAME(ucol_getContractionsAndExpansions)
+#define ucol_getDisplayName U_ICU_ENTRY_POINT_RENAME(ucol_getDisplayName)
+#define ucol_getFirstCE U_ICU_ENTRY_POINT_RENAME(ucol_getFirstCE)
+#define ucol_getFunctionalEquivalent U_ICU_ENTRY_POINT_RENAME(ucol_getFunctionalEquivalent)
+#define ucol_getKeywordValues U_ICU_ENTRY_POINT_RENAME(ucol_getKeywordValues)
+#define ucol_getKeywordValuesForLocale U_ICU_ENTRY_POINT_RENAME(ucol_getKeywordValuesForLocale)
+#define ucol_getKeywords U_ICU_ENTRY_POINT_RENAME(ucol_getKeywords)
+#define ucol_getLeadBytesForReorderCode U_ICU_ENTRY_POINT_RENAME(ucol_getLeadBytesForReorderCode)
+#define ucol_getLocale U_ICU_ENTRY_POINT_RENAME(ucol_getLocale)
+#define ucol_getLocaleByType U_ICU_ENTRY_POINT_RENAME(ucol_getLocaleByType)
+#define ucol_getMaxExpansion U_ICU_ENTRY_POINT_RENAME(ucol_getMaxExpansion)
+#define ucol_getNextCE U_ICU_ENTRY_POINT_RENAME(ucol_getNextCE)
+#define ucol_getOffset U_ICU_ENTRY_POINT_RENAME(ucol_getOffset)
+#define ucol_getPrevCE U_ICU_ENTRY_POINT_RENAME(ucol_getPrevCE)
+#define ucol_getReorderCodes U_ICU_ENTRY_POINT_RENAME(ucol_getReorderCodes)
+#define ucol_getReorderCodesForLeadByte U_ICU_ENTRY_POINT_RENAME(ucol_getReorderCodesForLeadByte)
+#define ucol_getRules U_ICU_ENTRY_POINT_RENAME(ucol_getRules)
+#define ucol_getRulesEx U_ICU_ENTRY_POINT_RENAME(ucol_getRulesEx)
+#define ucol_getShortDefinitionString U_ICU_ENTRY_POINT_RENAME(ucol_getShortDefinitionString)
+#define ucol_getSortKey U_ICU_ENTRY_POINT_RENAME(ucol_getSortKey)
+#define ucol_getSortKeySize U_ICU_ENTRY_POINT_RENAME(ucol_getSortKeySize)
+#define ucol_getSortKeyWithAllocation U_ICU_ENTRY_POINT_RENAME(ucol_getSortKeyWithAllocation)
+#define ucol_getStrength U_ICU_ENTRY_POINT_RENAME(ucol_getStrength)
+#define ucol_getTailoredSet U_ICU_ENTRY_POINT_RENAME(ucol_getTailoredSet)
+#define ucol_getUCAVersion U_ICU_ENTRY_POINT_RENAME(ucol_getUCAVersion)
+#define ucol_getUnsafeSet U_ICU_ENTRY_POINT_RENAME(ucol_getUnsafeSet)
+#define ucol_getVariableTop U_ICU_ENTRY_POINT_RENAME(ucol_getVariableTop)
+#define ucol_getVersion U_ICU_ENTRY_POINT_RENAME(ucol_getVersion)
+#define ucol_greater U_ICU_ENTRY_POINT_RENAME(ucol_greater)
+#define ucol_greaterOrEqual U_ICU_ENTRY_POINT_RENAME(ucol_greaterOrEqual)
+#define ucol_initBuffers U_ICU_ENTRY_POINT_RENAME(ucol_initBuffers)
+#define ucol_initCollator U_ICU_ENTRY_POINT_RENAME(ucol_initCollator)
+#define ucol_initInverseUCA U_ICU_ENTRY_POINT_RENAME(ucol_initInverseUCA)
+#define ucol_initUCA U_ICU_ENTRY_POINT_RENAME(ucol_initUCA)
+#define ucol_inv_getNextCE U_ICU_ENTRY_POINT_RENAME(ucol_inv_getNextCE)
+#define ucol_inv_getPrevCE U_ICU_ENTRY_POINT_RENAME(ucol_inv_getPrevCE)
+#define ucol_isTailored U_ICU_ENTRY_POINT_RENAME(ucol_isTailored)
+#define ucol_keyHashCode U_ICU_ENTRY_POINT_RENAME(ucol_keyHashCode)
+#define ucol_looksLikeCollationBinary U_ICU_ENTRY_POINT_RENAME(ucol_looksLikeCollationBinary)
+#define ucol_mergeSortkeys U_ICU_ENTRY_POINT_RENAME(ucol_mergeSortkeys)
+#define ucol_next U_ICU_ENTRY_POINT_RENAME(ucol_next)
+#define ucol_nextProcessed U_ICU_ENTRY_POINT_RENAME(ucol_nextProcessed)
+#define ucol_nextSortKeyPart U_ICU_ENTRY_POINT_RENAME(ucol_nextSortKeyPart)
+#define ucol_nextWeight U_ICU_ENTRY_POINT_RENAME(ucol_nextWeight)
+#define ucol_normalizeShortDefinitionString U_ICU_ENTRY_POINT_RENAME(ucol_normalizeShortDefinitionString)
+#define ucol_open U_ICU_ENTRY_POINT_RENAME(ucol_open)
+#define ucol_openAvailableLocales U_ICU_ENTRY_POINT_RENAME(ucol_openAvailableLocales)
+#define ucol_openBinary U_ICU_ENTRY_POINT_RENAME(ucol_openBinary)
+#define ucol_openElements U_ICU_ENTRY_POINT_RENAME(ucol_openElements)
+#define ucol_openFromShortString U_ICU_ENTRY_POINT_RENAME(ucol_openFromShortString)
+#define ucol_openRules U_ICU_ENTRY_POINT_RENAME(ucol_openRules)
+#define ucol_openRulesForImport U_ICU_ENTRY_POINT_RENAME(ucol_openRulesForImport)
+#define ucol_open_internal U_ICU_ENTRY_POINT_RENAME(ucol_open_internal)
+#define ucol_prepareShortStringOpen U_ICU_ENTRY_POINT_RENAME(ucol_prepareShortStringOpen)
+#define ucol_previous U_ICU_ENTRY_POINT_RENAME(ucol_previous)
+#define ucol_previousProcessed U_ICU_ENTRY_POINT_RENAME(ucol_previousProcessed)
+#define ucol_primaryOrder U_ICU_ENTRY_POINT_RENAME(ucol_primaryOrder)
+#define ucol_prv_getSpecialCE U_ICU_ENTRY_POINT_RENAME(ucol_prv_getSpecialCE)
+#define ucol_prv_getSpecialPrevCE U_ICU_ENTRY_POINT_RENAME(ucol_prv_getSpecialPrevCE)
+#define ucol_reset U_ICU_ENTRY_POINT_RENAME(ucol_reset)
+#define ucol_restoreVariableTop U_ICU_ENTRY_POINT_RENAME(ucol_restoreVariableTop)
+#define ucol_safeClone U_ICU_ENTRY_POINT_RENAME(ucol_safeClone)
+#define ucol_secondaryOrder U_ICU_ENTRY_POINT_RENAME(ucol_secondaryOrder)
+#define ucol_setAttribute U_ICU_ENTRY_POINT_RENAME(ucol_setAttribute)
+#define ucol_setOffset U_ICU_ENTRY_POINT_RENAME(ucol_setOffset)
+#define ucol_setOptionsFromHeader U_ICU_ENTRY_POINT_RENAME(ucol_setOptionsFromHeader)
+#define ucol_setReorderCodes U_ICU_ENTRY_POINT_RENAME(ucol_setReorderCodes)
+#define ucol_setReqValidLocales U_ICU_ENTRY_POINT_RENAME(ucol_setReqValidLocales)
+#define ucol_setStrength U_ICU_ENTRY_POINT_RENAME(ucol_setStrength)
+#define ucol_setText U_ICU_ENTRY_POINT_RENAME(ucol_setText)
+#define ucol_setVariableTop U_ICU_ENTRY_POINT_RENAME(ucol_setVariableTop)
+#define ucol_strcoll U_ICU_ENTRY_POINT_RENAME(ucol_strcoll)
+#define ucol_strcollIter U_ICU_ENTRY_POINT_RENAME(ucol_strcollIter)
+#define ucol_swap U_ICU_ENTRY_POINT_RENAME(ucol_swap)
+#define ucol_swapBinary U_ICU_ENTRY_POINT_RENAME(ucol_swapBinary)
+#define ucol_swapInverseUCA U_ICU_ENTRY_POINT_RENAME(ucol_swapInverseUCA)
+#define ucol_tertiaryOrder U_ICU_ENTRY_POINT_RENAME(ucol_tertiaryOrder)
+#define ucol_tok_assembleTokenList U_ICU_ENTRY_POINT_RENAME(ucol_tok_assembleTokenList)
+#define ucol_tok_closeTokenList U_ICU_ENTRY_POINT_RENAME(ucol_tok_closeTokenList)
+#define ucol_tok_getNextArgument U_ICU_ENTRY_POINT_RENAME(ucol_tok_getNextArgument)
+#define ucol_tok_getRulesFromBundle U_ICU_ENTRY_POINT_RENAME(ucol_tok_getRulesFromBundle)
+#define ucol_tok_initTokenList U_ICU_ENTRY_POINT_RENAME(ucol_tok_initTokenList)
+#define ucol_tok_parseNextToken U_ICU_ENTRY_POINT_RENAME(ucol_tok_parseNextToken)
+#define ucol_updateInternalState U_ICU_ENTRY_POINT_RENAME(ucol_updateInternalState)
+#define ucsdet_close U_ICU_ENTRY_POINT_RENAME(ucsdet_close)
+#define ucsdet_detect U_ICU_ENTRY_POINT_RENAME(ucsdet_detect)
+#define ucsdet_detectAll U_ICU_ENTRY_POINT_RENAME(ucsdet_detectAll)
+#define ucsdet_enableInputFilter U_ICU_ENTRY_POINT_RENAME(ucsdet_enableInputFilter)
+#define ucsdet_getAllDetectableCharsets U_ICU_ENTRY_POINT_RENAME(ucsdet_getAllDetectableCharsets)
+#define ucsdet_getConfidence U_ICU_ENTRY_POINT_RENAME(ucsdet_getConfidence)
+#define ucsdet_getLanguage U_ICU_ENTRY_POINT_RENAME(ucsdet_getLanguage)
+#define ucsdet_getName U_ICU_ENTRY_POINT_RENAME(ucsdet_getName)
+#define ucsdet_getUChars U_ICU_ENTRY_POINT_RENAME(ucsdet_getUChars)
+#define ucsdet_isInputFilterEnabled U_ICU_ENTRY_POINT_RENAME(ucsdet_isInputFilterEnabled)
+#define ucsdet_open U_ICU_ENTRY_POINT_RENAME(ucsdet_open)
+#define ucsdet_setDeclaredEncoding U_ICU_ENTRY_POINT_RENAME(ucsdet_setDeclaredEncoding)
+#define ucsdet_setText U_ICU_ENTRY_POINT_RENAME(ucsdet_setText)
+#define ucurr_countCurrencies U_ICU_ENTRY_POINT_RENAME(ucurr_countCurrencies)
+#define ucurr_forLocale U_ICU_ENTRY_POINT_RENAME(ucurr_forLocale)
+#define ucurr_forLocaleAndDate U_ICU_ENTRY_POINT_RENAME(ucurr_forLocaleAndDate)
+#define ucurr_getDefaultFractionDigits U_ICU_ENTRY_POINT_RENAME(ucurr_getDefaultFractionDigits)
+#define ucurr_getKeywordValuesForLocale U_ICU_ENTRY_POINT_RENAME(ucurr_getKeywordValuesForLocale)
+#define ucurr_getName U_ICU_ENTRY_POINT_RENAME(ucurr_getName)
+#define ucurr_getPluralName U_ICU_ENTRY_POINT_RENAME(ucurr_getPluralName)
+#define ucurr_getRoundingIncrement U_ICU_ENTRY_POINT_RENAME(ucurr_getRoundingIncrement)
+#define ucurr_openISOCurrencies U_ICU_ENTRY_POINT_RENAME(ucurr_openISOCurrencies)
+#define ucurr_register U_ICU_ENTRY_POINT_RENAME(ucurr_register)
+#define ucurr_unregister U_ICU_ENTRY_POINT_RENAME(ucurr_unregister)
+#define udat_applyPattern U_ICU_ENTRY_POINT_RENAME(udat_applyPattern)
+#define udat_applyPatternRelative U_ICU_ENTRY_POINT_RENAME(udat_applyPatternRelative)
+#define udat_clone U_ICU_ENTRY_POINT_RENAME(udat_clone)
+#define udat_close U_ICU_ENTRY_POINT_RENAME(udat_close)
+#define udat_countAvailable U_ICU_ENTRY_POINT_RENAME(udat_countAvailable)
+#define udat_countSymbols U_ICU_ENTRY_POINT_RENAME(udat_countSymbols)
+#define udat_format U_ICU_ENTRY_POINT_RENAME(udat_format)
+#define udat_get2DigitYearStart U_ICU_ENTRY_POINT_RENAME(udat_get2DigitYearStart)
+#define udat_getAvailable U_ICU_ENTRY_POINT_RENAME(udat_getAvailable)
+#define udat_getCalendar U_ICU_ENTRY_POINT_RENAME(udat_getCalendar)
+#define udat_getLocaleByType U_ICU_ENTRY_POINT_RENAME(udat_getLocaleByType)
+#define udat_getNumberFormat U_ICU_ENTRY_POINT_RENAME(udat_getNumberFormat)
+#define udat_getSymbols U_ICU_ENTRY_POINT_RENAME(udat_getSymbols)
+#define udat_isLenient U_ICU_ENTRY_POINT_RENAME(udat_isLenient)
+#define udat_open U_ICU_ENTRY_POINT_RENAME(udat_open)
+#define udat_parse U_ICU_ENTRY_POINT_RENAME(udat_parse)
+#define udat_parseCalendar U_ICU_ENTRY_POINT_RENAME(udat_parseCalendar)
+#define udat_set2DigitYearStart U_ICU_ENTRY_POINT_RENAME(udat_set2DigitYearStart)
+#define udat_setCalendar U_ICU_ENTRY_POINT_RENAME(udat_setCalendar)
+#define udat_setLenient U_ICU_ENTRY_POINT_RENAME(udat_setLenient)
+#define udat_setNumberFormat U_ICU_ENTRY_POINT_RENAME(udat_setNumberFormat)
+#define udat_setSymbols U_ICU_ENTRY_POINT_RENAME(udat_setSymbols)
+#define udat_toCalendarDateField U_ICU_ENTRY_POINT_RENAME(udat_toCalendarDateField)
+#define udat_toPattern U_ICU_ENTRY_POINT_RENAME(udat_toPattern)
+#define udat_toPatternRelativeDate U_ICU_ENTRY_POINT_RENAME(udat_toPatternRelativeDate)
+#define udat_toPatternRelativeTime U_ICU_ENTRY_POINT_RENAME(udat_toPatternRelativeTime)
+#define udata_checkCommonData U_ICU_ENTRY_POINT_RENAME(udata_checkCommonData)
+#define udata_close U_ICU_ENTRY_POINT_RENAME(udata_close)
+#define udata_closeSwapper U_ICU_ENTRY_POINT_RENAME(udata_closeSwapper)
+#define udata_getHeaderSize U_ICU_ENTRY_POINT_RENAME(udata_getHeaderSize)
+#define udata_getInfo U_ICU_ENTRY_POINT_RENAME(udata_getInfo)
+#define udata_getInfoSize U_ICU_ENTRY_POINT_RENAME(udata_getInfoSize)
+#define udata_getLength U_ICU_ENTRY_POINT_RENAME(udata_getLength)
+#define udata_getMemory U_ICU_ENTRY_POINT_RENAME(udata_getMemory)
+#define udata_getRawMemory U_ICU_ENTRY_POINT_RENAME(udata_getRawMemory)
+#define udata_open U_ICU_ENTRY_POINT_RENAME(udata_open)
+#define udata_openChoice U_ICU_ENTRY_POINT_RENAME(udata_openChoice)
+#define udata_openSwapper U_ICU_ENTRY_POINT_RENAME(udata_openSwapper)
+#define udata_openSwapperForInputData U_ICU_ENTRY_POINT_RENAME(udata_openSwapperForInputData)
+#define udata_printError U_ICU_ENTRY_POINT_RENAME(udata_printError)
+#define udata_readInt16 U_ICU_ENTRY_POINT_RENAME(udata_readInt16)
+#define udata_readInt32 U_ICU_ENTRY_POINT_RENAME(udata_readInt32)
+#define udata_setAppData U_ICU_ENTRY_POINT_RENAME(udata_setAppData)
+#define udata_setCommonData U_ICU_ENTRY_POINT_RENAME(udata_setCommonData)
+#define udata_setFileAccess U_ICU_ENTRY_POINT_RENAME(udata_setFileAccess)
+#define udata_swapDataHeader U_ICU_ENTRY_POINT_RENAME(udata_swapDataHeader)
+#define udata_swapInvStringBlock U_ICU_ENTRY_POINT_RENAME(udata_swapInvStringBlock)
+#define udatpg_addPattern U_ICU_ENTRY_POINT_RENAME(udatpg_addPattern)
+#define udatpg_clone U_ICU_ENTRY_POINT_RENAME(udatpg_clone)
+#define udatpg_close U_ICU_ENTRY_POINT_RENAME(udatpg_close)
+#define udatpg_getAppendItemFormat U_ICU_ENTRY_POINT_RENAME(udatpg_getAppendItemFormat)
+#define udatpg_getAppendItemName U_ICU_ENTRY_POINT_RENAME(udatpg_getAppendItemName)
+#define udatpg_getBaseSkeleton U_ICU_ENTRY_POINT_RENAME(udatpg_getBaseSkeleton)
+#define udatpg_getBestPattern U_ICU_ENTRY_POINT_RENAME(udatpg_getBestPattern)
+#define udatpg_getBestPatternWithOptions U_ICU_ENTRY_POINT_RENAME(udatpg_getBestPatternWithOptions)
+#define udatpg_getDateTimeFormat U_ICU_ENTRY_POINT_RENAME(udatpg_getDateTimeFormat)
+#define udatpg_getDecimal U_ICU_ENTRY_POINT_RENAME(udatpg_getDecimal)
+#define udatpg_getPatternForSkeleton U_ICU_ENTRY_POINT_RENAME(udatpg_getPatternForSkeleton)
+#define udatpg_getSkeleton U_ICU_ENTRY_POINT_RENAME(udatpg_getSkeleton)
+#define udatpg_open U_ICU_ENTRY_POINT_RENAME(udatpg_open)
+#define udatpg_openBaseSkeletons U_ICU_ENTRY_POINT_RENAME(udatpg_openBaseSkeletons)
+#define udatpg_openEmpty U_ICU_ENTRY_POINT_RENAME(udatpg_openEmpty)
+#define udatpg_openSkeletons U_ICU_ENTRY_POINT_RENAME(udatpg_openSkeletons)
+#define udatpg_replaceFieldTypes U_ICU_ENTRY_POINT_RENAME(udatpg_replaceFieldTypes)
+#define udatpg_replaceFieldTypesWithOptions U_ICU_ENTRY_POINT_RENAME(udatpg_replaceFieldTypesWithOptions)
+#define udatpg_setAppendItemFormat U_ICU_ENTRY_POINT_RENAME(udatpg_setAppendItemFormat)
+#define udatpg_setAppendItemName U_ICU_ENTRY_POINT_RENAME(udatpg_setAppendItemName)
+#define udatpg_setDateTimeFormat U_ICU_ENTRY_POINT_RENAME(udatpg_setDateTimeFormat)
+#define udatpg_setDecimal U_ICU_ENTRY_POINT_RENAME(udatpg_setDecimal)
+#define uenum_close U_ICU_ENTRY_POINT_RENAME(uenum_close)
+#define uenum_count U_ICU_ENTRY_POINT_RENAME(uenum_count)
+#define uenum_next U_ICU_ENTRY_POINT_RENAME(uenum_next)
+#define uenum_nextDefault U_ICU_ENTRY_POINT_RENAME(uenum_nextDefault)
+#define uenum_openCharStringsEnumeration U_ICU_ENTRY_POINT_RENAME(uenum_openCharStringsEnumeration)
+#define uenum_openFromStringEnumeration U_ICU_ENTRY_POINT_RENAME(uenum_openFromStringEnumeration)
+#define uenum_reset U_ICU_ENTRY_POINT_RENAME(uenum_reset)
+#define uenum_unext U_ICU_ENTRY_POINT_RENAME(uenum_unext)
+#define uenum_unextDefault U_ICU_ENTRY_POINT_RENAME(uenum_unextDefault)
+#define ufile_close_translit U_ICU_ENTRY_POINT_RENAME(ufile_close_translit)
+#define ufile_fill_uchar_buffer U_ICU_ENTRY_POINT_RENAME(ufile_fill_uchar_buffer)
+#define ufile_flush_io U_ICU_ENTRY_POINT_RENAME(ufile_flush_io)
+#define ufile_flush_translit U_ICU_ENTRY_POINT_RENAME(ufile_flush_translit)
+#define ufile_getch U_ICU_ENTRY_POINT_RENAME(ufile_getch)
+#define ufile_getch32 U_ICU_ENTRY_POINT_RENAME(ufile_getch32)
+#define ufmt_64tou U_ICU_ENTRY_POINT_RENAME(ufmt_64tou)
+#define ufmt_defaultCPToUnicode U_ICU_ENTRY_POINT_RENAME(ufmt_defaultCPToUnicode)
+#define ufmt_digitvalue U_ICU_ENTRY_POINT_RENAME(ufmt_digitvalue)
+#define ufmt_isdigit U_ICU_ENTRY_POINT_RENAME(ufmt_isdigit)
+#define ufmt_ptou U_ICU_ENTRY_POINT_RENAME(ufmt_ptou)
+#define ufmt_uto64 U_ICU_ENTRY_POINT_RENAME(ufmt_uto64)
+#define ufmt_utop U_ICU_ENTRY_POINT_RENAME(ufmt_utop)
+#define uhash_close U_ICU_ENTRY_POINT_RENAME(uhash_close)
+#define uhash_compareCaselessUnicodeString U_ICU_ENTRY_POINT_RENAME(uhash_compareCaselessUnicodeString)
+#define uhash_compareChars U_ICU_ENTRY_POINT_RENAME(uhash_compareChars)
+#define uhash_compareIChars U_ICU_ENTRY_POINT_RENAME(uhash_compareIChars)
+#define uhash_compareLong U_ICU_ENTRY_POINT_RENAME(uhash_compareLong)
+#define uhash_compareUChars U_ICU_ENTRY_POINT_RENAME(uhash_compareUChars)
+#define uhash_compareUnicodeString U_ICU_ENTRY_POINT_RENAME(uhash_compareUnicodeString)
+#define uhash_count U_ICU_ENTRY_POINT_RENAME(uhash_count)
+#define uhash_deleteHashtable U_ICU_ENTRY_POINT_RENAME(uhash_deleteHashtable)
+#define uhash_deleteUObject U_ICU_ENTRY_POINT_RENAME(uhash_deleteUObject)
+#define uhash_deleteUnicodeString U_ICU_ENTRY_POINT_RENAME(uhash_deleteUnicodeString)
+#define uhash_equals U_ICU_ENTRY_POINT_RENAME(uhash_equals)
+#define uhash_find U_ICU_ENTRY_POINT_RENAME(uhash_find)
+#define uhash_freeBlock U_ICU_ENTRY_POINT_RENAME(uhash_freeBlock)
+#define uhash_get U_ICU_ENTRY_POINT_RENAME(uhash_get)
+#define uhash_geti U_ICU_ENTRY_POINT_RENAME(uhash_geti)
+#define uhash_hashCaselessUnicodeString U_ICU_ENTRY_POINT_RENAME(uhash_hashCaselessUnicodeString)
+#define uhash_hashChars U_ICU_ENTRY_POINT_RENAME(uhash_hashChars)
+#define uhash_hashIChars U_ICU_ENTRY_POINT_RENAME(uhash_hashIChars)
+#define uhash_hashLong U_ICU_ENTRY_POINT_RENAME(uhash_hashLong)
+#define uhash_hashUChars U_ICU_ENTRY_POINT_RENAME(uhash_hashUChars)
+#define uhash_hashUCharsN U_ICU_ENTRY_POINT_RENAME(uhash_hashUCharsN)
+#define uhash_hashUnicodeString U_ICU_ENTRY_POINT_RENAME(uhash_hashUnicodeString)
+#define uhash_iget U_ICU_ENTRY_POINT_RENAME(uhash_iget)
+#define uhash_igeti U_ICU_ENTRY_POINT_RENAME(uhash_igeti)
+#define uhash_init U_ICU_ENTRY_POINT_RENAME(uhash_init)
+#define uhash_iput U_ICU_ENTRY_POINT_RENAME(uhash_iput)
+#define uhash_iputi U_ICU_ENTRY_POINT_RENAME(uhash_iputi)
+#define uhash_iremove U_ICU_ENTRY_POINT_RENAME(uhash_iremove)
+#define uhash_iremovei U_ICU_ENTRY_POINT_RENAME(uhash_iremovei)
+#define uhash_nextElement U_ICU_ENTRY_POINT_RENAME(uhash_nextElement)
+#define uhash_open U_ICU_ENTRY_POINT_RENAME(uhash_open)
+#define uhash_openSize U_ICU_ENTRY_POINT_RENAME(uhash_openSize)
+#define uhash_put U_ICU_ENTRY_POINT_RENAME(uhash_put)
+#define uhash_puti U_ICU_ENTRY_POINT_RENAME(uhash_puti)
+#define uhash_remove U_ICU_ENTRY_POINT_RENAME(uhash_remove)
+#define uhash_removeAll U_ICU_ENTRY_POINT_RENAME(uhash_removeAll)
+#define uhash_removeElement U_ICU_ENTRY_POINT_RENAME(uhash_removeElement)
+#define uhash_removei U_ICU_ENTRY_POINT_RENAME(uhash_removei)
+#define uhash_setKeyComparator U_ICU_ENTRY_POINT_RENAME(uhash_setKeyComparator)
+#define uhash_setKeyDeleter U_ICU_ENTRY_POINT_RENAME(uhash_setKeyDeleter)
+#define uhash_setKeyHasher U_ICU_ENTRY_POINT_RENAME(uhash_setKeyHasher)
+#define uhash_setResizePolicy U_ICU_ENTRY_POINT_RENAME(uhash_setResizePolicy)
+#define uhash_setValueComparator U_ICU_ENTRY_POINT_RENAME(uhash_setValueComparator)
+#define uhash_setValueDeleter U_ICU_ENTRY_POINT_RENAME(uhash_setValueDeleter)
+#define uidna_IDNToASCII U_ICU_ENTRY_POINT_RENAME(uidna_IDNToASCII)
+#define uidna_IDNToUnicode U_ICU_ENTRY_POINT_RENAME(uidna_IDNToUnicode)
+#define uidna_close U_ICU_ENTRY_POINT_RENAME(uidna_close)
+#define uidna_compare U_ICU_ENTRY_POINT_RENAME(uidna_compare)
+#define uidna_labelToASCII U_ICU_ENTRY_POINT_RENAME(uidna_labelToASCII)
+#define uidna_labelToASCII_UTF8 U_ICU_ENTRY_POINT_RENAME(uidna_labelToASCII_UTF8)
+#define uidna_labelToUnicode U_ICU_ENTRY_POINT_RENAME(uidna_labelToUnicode)
+#define uidna_labelToUnicodeUTF8 U_ICU_ENTRY_POINT_RENAME(uidna_labelToUnicodeUTF8)
+#define uidna_nameToASCII U_ICU_ENTRY_POINT_RENAME(uidna_nameToASCII)
+#define uidna_nameToASCII_UTF8 U_ICU_ENTRY_POINT_RENAME(uidna_nameToASCII_UTF8)
+#define uidna_nameToUnicode U_ICU_ENTRY_POINT_RENAME(uidna_nameToUnicode)
+#define uidna_nameToUnicodeUTF8 U_ICU_ENTRY_POINT_RENAME(uidna_nameToUnicodeUTF8)
+#define uidna_openUTS46 U_ICU_ENTRY_POINT_RENAME(uidna_openUTS46)
+#define uidna_toASCII U_ICU_ENTRY_POINT_RENAME(uidna_toASCII)
+#define uidna_toUnicode U_ICU_ENTRY_POINT_RENAME(uidna_toUnicode)
+#define uiter_current32 U_ICU_ENTRY_POINT_RENAME(uiter_current32)
+#define uiter_getState U_ICU_ENTRY_POINT_RENAME(uiter_getState)
+#define uiter_next32 U_ICU_ENTRY_POINT_RENAME(uiter_next32)
+#define uiter_previous32 U_ICU_ENTRY_POINT_RENAME(uiter_previous32)
+#define uiter_setCharacterIterator U_ICU_ENTRY_POINT_RENAME(uiter_setCharacterIterator)
+#define uiter_setReplaceable U_ICU_ENTRY_POINT_RENAME(uiter_setReplaceable)
+#define uiter_setState U_ICU_ENTRY_POINT_RENAME(uiter_setState)
+#define uiter_setString U_ICU_ENTRY_POINT_RENAME(uiter_setString)
+#define uiter_setUTF16BE U_ICU_ENTRY_POINT_RENAME(uiter_setUTF16BE)
+#define uiter_setUTF8 U_ICU_ENTRY_POINT_RENAME(uiter_setUTF8)
+#define uldn_close U_ICU_ENTRY_POINT_RENAME(uldn_close)
+#define uldn_getDialectHandling U_ICU_ENTRY_POINT_RENAME(uldn_getDialectHandling)
+#define uldn_getLocale U_ICU_ENTRY_POINT_RENAME(uldn_getLocale)
+#define uldn_keyDisplayName U_ICU_ENTRY_POINT_RENAME(uldn_keyDisplayName)
+#define uldn_keyValueDisplayName U_ICU_ENTRY_POINT_RENAME(uldn_keyValueDisplayName)
+#define uldn_languageDisplayName U_ICU_ENTRY_POINT_RENAME(uldn_languageDisplayName)
+#define uldn_localeDisplayName U_ICU_ENTRY_POINT_RENAME(uldn_localeDisplayName)
+#define uldn_open U_ICU_ENTRY_POINT_RENAME(uldn_open)
+#define uldn_regionDisplayName U_ICU_ENTRY_POINT_RENAME(uldn_regionDisplayName)
+#define uldn_scriptCodeDisplayName U_ICU_ENTRY_POINT_RENAME(uldn_scriptCodeDisplayName)
+#define uldn_scriptDisplayName U_ICU_ENTRY_POINT_RENAME(uldn_scriptDisplayName)
+#define uldn_variantDisplayName U_ICU_ENTRY_POINT_RENAME(uldn_variantDisplayName)
+#define ulist_addItemBeginList U_ICU_ENTRY_POINT_RENAME(ulist_addItemBeginList)
+#define ulist_addItemEndList U_ICU_ENTRY_POINT_RENAME(ulist_addItemEndList)
+#define ulist_close_keyword_values_iterator U_ICU_ENTRY_POINT_RENAME(ulist_close_keyword_values_iterator)
+#define ulist_containsString U_ICU_ENTRY_POINT_RENAME(ulist_containsString)
+#define ulist_count_keyword_values U_ICU_ENTRY_POINT_RENAME(ulist_count_keyword_values)
+#define ulist_createEmptyList U_ICU_ENTRY_POINT_RENAME(ulist_createEmptyList)
+#define ulist_deleteList U_ICU_ENTRY_POINT_RENAME(ulist_deleteList)
+#define ulist_getListFromEnum U_ICU_ENTRY_POINT_RENAME(ulist_getListFromEnum)
+#define ulist_getListSize U_ICU_ENTRY_POINT_RENAME(ulist_getListSize)
+#define ulist_getNext U_ICU_ENTRY_POINT_RENAME(ulist_getNext)
+#define ulist_next_keyword_value U_ICU_ENTRY_POINT_RENAME(ulist_next_keyword_value)
+#define ulist_resetList U_ICU_ENTRY_POINT_RENAME(ulist_resetList)
+#define ulist_reset_keyword_values_iterator U_ICU_ENTRY_POINT_RENAME(ulist_reset_keyword_values_iterator)
+#define uloc_acceptLanguage U_ICU_ENTRY_POINT_RENAME(uloc_acceptLanguage)
+#define uloc_acceptLanguageFromHTTP U_ICU_ENTRY_POINT_RENAME(uloc_acceptLanguageFromHTTP)
+#define uloc_addLikelySubtags U_ICU_ENTRY_POINT_RENAME(uloc_addLikelySubtags)
+#define uloc_canonicalize U_ICU_ENTRY_POINT_RENAME(uloc_canonicalize)
+#define uloc_countAvailable U_ICU_ENTRY_POINT_RENAME(uloc_countAvailable)
+#define uloc_forLanguageTag U_ICU_ENTRY_POINT_RENAME(uloc_forLanguageTag)
+#define uloc_getAvailable U_ICU_ENTRY_POINT_RENAME(uloc_getAvailable)
+#define uloc_getBaseName U_ICU_ENTRY_POINT_RENAME(uloc_getBaseName)
+#define uloc_getCharacterOrientation U_ICU_ENTRY_POINT_RENAME(uloc_getCharacterOrientation)
+#define uloc_getCountry U_ICU_ENTRY_POINT_RENAME(uloc_getCountry)
+#define uloc_getCurrentCountryID U_ICU_ENTRY_POINT_RENAME(uloc_getCurrentCountryID)
+#define uloc_getCurrentLanguageID U_ICU_ENTRY_POINT_RENAME(uloc_getCurrentLanguageID)
+#define uloc_getDefault U_ICU_ENTRY_POINT_RENAME(uloc_getDefault)
+#define uloc_getDisplayCountry U_ICU_ENTRY_POINT_RENAME(uloc_getDisplayCountry)
+#define uloc_getDisplayKeyword U_ICU_ENTRY_POINT_RENAME(uloc_getDisplayKeyword)
+#define uloc_getDisplayKeywordValue U_ICU_ENTRY_POINT_RENAME(uloc_getDisplayKeywordValue)
+#define uloc_getDisplayLanguage U_ICU_ENTRY_POINT_RENAME(uloc_getDisplayLanguage)
+#define uloc_getDisplayName U_ICU_ENTRY_POINT_RENAME(uloc_getDisplayName)
+#define uloc_getDisplayScript U_ICU_ENTRY_POINT_RENAME(uloc_getDisplayScript)
+#define uloc_getDisplayVariant U_ICU_ENTRY_POINT_RENAME(uloc_getDisplayVariant)
+#define uloc_getISO3Country U_ICU_ENTRY_POINT_RENAME(uloc_getISO3Country)
+#define uloc_getISO3Language U_ICU_ENTRY_POINT_RENAME(uloc_getISO3Language)
+#define uloc_getISOCountries U_ICU_ENTRY_POINT_RENAME(uloc_getISOCountries)
+#define uloc_getISOLanguages U_ICU_ENTRY_POINT_RENAME(uloc_getISOLanguages)
+#define uloc_getKeywordValue U_ICU_ENTRY_POINT_RENAME(uloc_getKeywordValue)
+#define uloc_getLCID U_ICU_ENTRY_POINT_RENAME(uloc_getLCID)
+#define uloc_getLanguage U_ICU_ENTRY_POINT_RENAME(uloc_getLanguage)
+#define uloc_getLineOrientation U_ICU_ENTRY_POINT_RENAME(uloc_getLineOrientation)
+#define uloc_getLocaleForLCID U_ICU_ENTRY_POINT_RENAME(uloc_getLocaleForLCID)
+#define uloc_getName U_ICU_ENTRY_POINT_RENAME(uloc_getName)
+#define uloc_getParent U_ICU_ENTRY_POINT_RENAME(uloc_getParent)
+#define uloc_getScript U_ICU_ENTRY_POINT_RENAME(uloc_getScript)
+#define uloc_getTableStringWithFallback U_ICU_ENTRY_POINT_RENAME(uloc_getTableStringWithFallback)
+#define uloc_getVariant U_ICU_ENTRY_POINT_RENAME(uloc_getVariant)
+#define uloc_minimizeSubtags U_ICU_ENTRY_POINT_RENAME(uloc_minimizeSubtags)
+#define uloc_openKeywordList U_ICU_ENTRY_POINT_RENAME(uloc_openKeywordList)
+#define uloc_openKeywords U_ICU_ENTRY_POINT_RENAME(uloc_openKeywords)
+#define uloc_setDefault U_ICU_ENTRY_POINT_RENAME(uloc_setDefault)
+#define uloc_setKeywordValue U_ICU_ENTRY_POINT_RENAME(uloc_setKeywordValue)
+#define uloc_toLanguageTag U_ICU_ENTRY_POINT_RENAME(uloc_toLanguageTag)
+#define ulocdata_close U_ICU_ENTRY_POINT_RENAME(ulocdata_close)
+#define ulocdata_getCLDRVersion U_ICU_ENTRY_POINT_RENAME(ulocdata_getCLDRVersion)
+#define ulocdata_getDelimiter U_ICU_ENTRY_POINT_RENAME(ulocdata_getDelimiter)
+#define ulocdata_getExemplarSet U_ICU_ENTRY_POINT_RENAME(ulocdata_getExemplarSet)
+#define ulocdata_getLocaleDisplayPattern U_ICU_ENTRY_POINT_RENAME(ulocdata_getLocaleDisplayPattern)
+#define ulocdata_getLocaleSeparator U_ICU_ENTRY_POINT_RENAME(ulocdata_getLocaleSeparator)
+#define ulocdata_getMeasurementSystem U_ICU_ENTRY_POINT_RENAME(ulocdata_getMeasurementSystem)
+#define ulocdata_getNoSubstitute U_ICU_ENTRY_POINT_RENAME(ulocdata_getNoSubstitute)
+#define ulocdata_getPaperSize U_ICU_ENTRY_POINT_RENAME(ulocdata_getPaperSize)
+#define ulocdata_open U_ICU_ENTRY_POINT_RENAME(ulocdata_open)
+#define ulocdata_setNoSubstitute U_ICU_ENTRY_POINT_RENAME(ulocdata_setNoSubstitute)
+#define ulocimp_getCountry U_ICU_ENTRY_POINT_RENAME(ulocimp_getCountry)
+#define ulocimp_getLanguage U_ICU_ENTRY_POINT_RENAME(ulocimp_getLanguage)
+#define ulocimp_getScript U_ICU_ENTRY_POINT_RENAME(ulocimp_getScript)
+#define umsg_applyPattern U_ICU_ENTRY_POINT_RENAME(umsg_applyPattern)
+#define umsg_autoQuoteApostrophe U_ICU_ENTRY_POINT_RENAME(umsg_autoQuoteApostrophe)
+#define umsg_clone U_ICU_ENTRY_POINT_RENAME(umsg_clone)
+#define umsg_close U_ICU_ENTRY_POINT_RENAME(umsg_close)
+#define umsg_format U_ICU_ENTRY_POINT_RENAME(umsg_format)
+#define umsg_getLocale U_ICU_ENTRY_POINT_RENAME(umsg_getLocale)
+#define umsg_open U_ICU_ENTRY_POINT_RENAME(umsg_open)
+#define umsg_parse U_ICU_ENTRY_POINT_RENAME(umsg_parse)
+#define umsg_setLocale U_ICU_ENTRY_POINT_RENAME(umsg_setLocale)
+#define umsg_toPattern U_ICU_ENTRY_POINT_RENAME(umsg_toPattern)
+#define umsg_vformat U_ICU_ENTRY_POINT_RENAME(umsg_vformat)
+#define umsg_vparse U_ICU_ENTRY_POINT_RENAME(umsg_vparse)
+#define umtx_atomic_dec U_ICU_ENTRY_POINT_RENAME(umtx_atomic_dec)
+#define umtx_atomic_inc U_ICU_ENTRY_POINT_RENAME(umtx_atomic_inc)
+#define umtx_cleanup U_ICU_ENTRY_POINT_RENAME(umtx_cleanup)
+#define umtx_destroy U_ICU_ENTRY_POINT_RENAME(umtx_destroy)
+#define umtx_init U_ICU_ENTRY_POINT_RENAME(umtx_init)
+#define umtx_lock U_ICU_ENTRY_POINT_RENAME(umtx_lock)
+#define umtx_unlock U_ICU_ENTRY_POINT_RENAME(umtx_unlock)
+#define uniset_getUnicode32Instance U_ICU_ENTRY_POINT_RENAME(uniset_getUnicode32Instance)
+#define unorm2_append U_ICU_ENTRY_POINT_RENAME(unorm2_append)
+#define unorm2_close U_ICU_ENTRY_POINT_RENAME(unorm2_close)
+#define unorm2_getDecomposition U_ICU_ENTRY_POINT_RENAME(unorm2_getDecomposition)
+#define unorm2_getInstance U_ICU_ENTRY_POINT_RENAME(unorm2_getInstance)
+#define unorm2_hasBoundaryAfter U_ICU_ENTRY_POINT_RENAME(unorm2_hasBoundaryAfter)
+#define unorm2_hasBoundaryBefore U_ICU_ENTRY_POINT_RENAME(unorm2_hasBoundaryBefore)
+#define unorm2_isInert U_ICU_ENTRY_POINT_RENAME(unorm2_isInert)
+#define unorm2_isNormalized U_ICU_ENTRY_POINT_RENAME(unorm2_isNormalized)
+#define unorm2_normalize U_ICU_ENTRY_POINT_RENAME(unorm2_normalize)
+#define unorm2_normalizeSecondAndAppend U_ICU_ENTRY_POINT_RENAME(unorm2_normalizeSecondAndAppend)
+#define unorm2_openFiltered U_ICU_ENTRY_POINT_RENAME(unorm2_openFiltered)
+#define unorm2_quickCheck U_ICU_ENTRY_POINT_RENAME(unorm2_quickCheck)
+#define unorm2_spanQuickCheckYes U_ICU_ENTRY_POINT_RENAME(unorm2_spanQuickCheckYes)
+#define unorm2_swap U_ICU_ENTRY_POINT_RENAME(unorm2_swap)
+#define unorm_closeIter U_ICU_ENTRY_POINT_RENAME(unorm_closeIter)
+#define unorm_compare U_ICU_ENTRY_POINT_RENAME(unorm_compare)
+#define unorm_concatenate U_ICU_ENTRY_POINT_RENAME(unorm_concatenate)
+#define unorm_getFCDTrieIndex U_ICU_ENTRY_POINT_RENAME(unorm_getFCDTrieIndex)
+#define unorm_getQuickCheck U_ICU_ENTRY_POINT_RENAME(unorm_getQuickCheck)
+#define unorm_isNormalized U_ICU_ENTRY_POINT_RENAME(unorm_isNormalized)
+#define unorm_isNormalizedWithOptions U_ICU_ENTRY_POINT_RENAME(unorm_isNormalizedWithOptions)
+#define unorm_next U_ICU_ENTRY_POINT_RENAME(unorm_next)
+#define unorm_normalize U_ICU_ENTRY_POINT_RENAME(unorm_normalize)
+#define unorm_openIter U_ICU_ENTRY_POINT_RENAME(unorm_openIter)
+#define unorm_previous U_ICU_ENTRY_POINT_RENAME(unorm_previous)
+#define unorm_quickCheck U_ICU_ENTRY_POINT_RENAME(unorm_quickCheck)
+#define unorm_quickCheckWithOptions U_ICU_ENTRY_POINT_RENAME(unorm_quickCheckWithOptions)
+#define unorm_setIter U_ICU_ENTRY_POINT_RENAME(unorm_setIter)
+#define unum_applyPattern U_ICU_ENTRY_POINT_RENAME(unum_applyPattern)
+#define unum_clone U_ICU_ENTRY_POINT_RENAME(unum_clone)
+#define unum_close U_ICU_ENTRY_POINT_RENAME(unum_close)
+#define unum_countAvailable U_ICU_ENTRY_POINT_RENAME(unum_countAvailable)
+#define unum_format U_ICU_ENTRY_POINT_RENAME(unum_format)
+#define unum_formatDecimal U_ICU_ENTRY_POINT_RENAME(unum_formatDecimal)
+#define unum_formatDouble U_ICU_ENTRY_POINT_RENAME(unum_formatDouble)
+#define unum_formatDoubleCurrency U_ICU_ENTRY_POINT_RENAME(unum_formatDoubleCurrency)
+#define unum_formatInt64 U_ICU_ENTRY_POINT_RENAME(unum_formatInt64)
+#define unum_getAttribute U_ICU_ENTRY_POINT_RENAME(unum_getAttribute)
+#define unum_getAvailable U_ICU_ENTRY_POINT_RENAME(unum_getAvailable)
+#define unum_getDoubleAttribute U_ICU_ENTRY_POINT_RENAME(unum_getDoubleAttribute)
+#define unum_getLocaleByType U_ICU_ENTRY_POINT_RENAME(unum_getLocaleByType)
+#define unum_getSymbol U_ICU_ENTRY_POINT_RENAME(unum_getSymbol)
+#define unum_getTextAttribute U_ICU_ENTRY_POINT_RENAME(unum_getTextAttribute)
+#define unum_open U_ICU_ENTRY_POINT_RENAME(unum_open)
+#define unum_parse U_ICU_ENTRY_POINT_RENAME(unum_parse)
+#define unum_parseDecimal U_ICU_ENTRY_POINT_RENAME(unum_parseDecimal)
+#define unum_parseDouble U_ICU_ENTRY_POINT_RENAME(unum_parseDouble)
+#define unum_parseDoubleCurrency U_ICU_ENTRY_POINT_RENAME(unum_parseDoubleCurrency)
+#define unum_parseInt64 U_ICU_ENTRY_POINT_RENAME(unum_parseInt64)
+#define unum_setAttribute U_ICU_ENTRY_POINT_RENAME(unum_setAttribute)
+#define unum_setDoubleAttribute U_ICU_ENTRY_POINT_RENAME(unum_setDoubleAttribute)
+#define unum_setSymbol U_ICU_ENTRY_POINT_RENAME(unum_setSymbol)
+#define unum_setTextAttribute U_ICU_ENTRY_POINT_RENAME(unum_setTextAttribute)
+#define unum_toPattern U_ICU_ENTRY_POINT_RENAME(unum_toPattern)
+#define uplug_closeLibrary U_ICU_ENTRY_POINT_RENAME(uplug_closeLibrary)
+#define uplug_findLibrary U_ICU_ENTRY_POINT_RENAME(uplug_findLibrary)
+#define uplug_getConfiguration U_ICU_ENTRY_POINT_RENAME(uplug_getConfiguration)
+#define uplug_getContext U_ICU_ENTRY_POINT_RENAME(uplug_getContext)
+#define uplug_getCurrentLevel U_ICU_ENTRY_POINT_RENAME(uplug_getCurrentLevel)
+#define uplug_getLibrary U_ICU_ENTRY_POINT_RENAME(uplug_getLibrary)
+#define uplug_getLibraryName U_ICU_ENTRY_POINT_RENAME(uplug_getLibraryName)
+#define uplug_getPlugInternal U_ICU_ENTRY_POINT_RENAME(uplug_getPlugInternal)
+#define uplug_getPlugLevel U_ICU_ENTRY_POINT_RENAME(uplug_getPlugLevel)
+#define uplug_getPlugLoadStatus U_ICU_ENTRY_POINT_RENAME(uplug_getPlugLoadStatus)
+#define uplug_getPlugName U_ICU_ENTRY_POINT_RENAME(uplug_getPlugName)
+#define uplug_getPluginFile U_ICU_ENTRY_POINT_RENAME(uplug_getPluginFile)
+#define uplug_getSymbolName U_ICU_ENTRY_POINT_RENAME(uplug_getSymbolName)
+#define uplug_init U_ICU_ENTRY_POINT_RENAME(uplug_init)
+#define uplug_loadPlugFromEntrypoint U_ICU_ENTRY_POINT_RENAME(uplug_loadPlugFromEntrypoint)
+#define uplug_loadPlugFromLibrary U_ICU_ENTRY_POINT_RENAME(uplug_loadPlugFromLibrary)
+#define uplug_nextPlug U_ICU_ENTRY_POINT_RENAME(uplug_nextPlug)
+#define uplug_openLibrary U_ICU_ENTRY_POINT_RENAME(uplug_openLibrary)
+#define uplug_removePlug U_ICU_ENTRY_POINT_RENAME(uplug_removePlug)
+#define uplug_setContext U_ICU_ENTRY_POINT_RENAME(uplug_setContext)
+#define uplug_setPlugLevel U_ICU_ENTRY_POINT_RENAME(uplug_setPlugLevel)
+#define uplug_setPlugName U_ICU_ENTRY_POINT_RENAME(uplug_setPlugName)
+#define uplug_setPlugNoUnload U_ICU_ENTRY_POINT_RENAME(uplug_setPlugNoUnload)
+#define upname_swap U_ICU_ENTRY_POINT_RENAME(upname_swap)
+#define uprops_getSource U_ICU_ENTRY_POINT_RENAME(uprops_getSource)
+#define upropsvec_addPropertyStarts U_ICU_ENTRY_POINT_RENAME(upropsvec_addPropertyStarts)
+#define uprv_aestrncpy U_ICU_ENTRY_POINT_RENAME(uprv_aestrncpy)
+#define uprv_asciiFromEbcdic U_ICU_ENTRY_POINT_RENAME(uprv_asciiFromEbcdic)
+#define uprv_asciitolower U_ICU_ENTRY_POINT_RENAME(uprv_asciitolower)
+#define uprv_ceil U_ICU_ENTRY_POINT_RENAME(uprv_ceil)
+#define uprv_cnttab_addContraction U_ICU_ENTRY_POINT_RENAME(uprv_cnttab_addContraction)
+#define uprv_cnttab_changeContraction U_ICU_ENTRY_POINT_RENAME(uprv_cnttab_changeContraction)
+#define uprv_cnttab_changeLastCE U_ICU_ENTRY_POINT_RENAME(uprv_cnttab_changeLastCE)
+#define uprv_cnttab_clone U_ICU_ENTRY_POINT_RENAME(uprv_cnttab_clone)
+#define uprv_cnttab_close U_ICU_ENTRY_POINT_RENAME(uprv_cnttab_close)
+#define uprv_cnttab_constructTable U_ICU_ENTRY_POINT_RENAME(uprv_cnttab_constructTable)
+#define uprv_cnttab_findCE U_ICU_ENTRY_POINT_RENAME(uprv_cnttab_findCE)
+#define uprv_cnttab_findCP U_ICU_ENTRY_POINT_RENAME(uprv_cnttab_findCP)
+#define uprv_cnttab_getCE U_ICU_ENTRY_POINT_RENAME(uprv_cnttab_getCE)
+#define uprv_cnttab_insertContraction U_ICU_ENTRY_POINT_RENAME(uprv_cnttab_insertContraction)
+#define uprv_cnttab_isTailored U_ICU_ENTRY_POINT_RENAME(uprv_cnttab_isTailored)
+#define uprv_cnttab_open U_ICU_ENTRY_POINT_RENAME(uprv_cnttab_open)
+#define uprv_cnttab_setContraction U_ICU_ENTRY_POINT_RENAME(uprv_cnttab_setContraction)
+#define uprv_collIterateAtEnd U_ICU_ENTRY_POINT_RENAME(uprv_collIterateAtEnd)
+#define uprv_compareASCIIPropertyNames U_ICU_ENTRY_POINT_RENAME(uprv_compareASCIIPropertyNames)
+#define uprv_compareEBCDICPropertyNames U_ICU_ENTRY_POINT_RENAME(uprv_compareEBCDICPropertyNames)
+#define uprv_compareInvAscii U_ICU_ENTRY_POINT_RENAME(uprv_compareInvAscii)
+#define uprv_compareInvEbcdic U_ICU_ENTRY_POINT_RENAME(uprv_compareInvEbcdic)
+#define uprv_compareInvEbcdicAsAscii U_ICU_ENTRY_POINT_RENAME(uprv_compareInvEbcdicAsAscii)
+#define uprv_convertToLCID U_ICU_ENTRY_POINT_RENAME(uprv_convertToLCID)
+#define uprv_convertToPosix U_ICU_ENTRY_POINT_RENAME(uprv_convertToPosix)
+#define uprv_copyAscii U_ICU_ENTRY_POINT_RENAME(uprv_copyAscii)
+#define uprv_copyEbcdic U_ICU_ENTRY_POINT_RENAME(uprv_copyEbcdic)
+#define uprv_decContextClearStatus U_ICU_ENTRY_POINT_RENAME(uprv_decContextClearStatus)
+#define uprv_decContextDefault U_ICU_ENTRY_POINT_RENAME(uprv_decContextDefault)
+#define uprv_decContextGetRounding U_ICU_ENTRY_POINT_RENAME(uprv_decContextGetRounding)
+#define uprv_decContextGetStatus U_ICU_ENTRY_POINT_RENAME(uprv_decContextGetStatus)
+#define uprv_decContextRestoreStatus U_ICU_ENTRY_POINT_RENAME(uprv_decContextRestoreStatus)
+#define uprv_decContextSaveStatus U_ICU_ENTRY_POINT_RENAME(uprv_decContextSaveStatus)
+#define uprv_decContextSetRounding U_ICU_ENTRY_POINT_RENAME(uprv_decContextSetRounding)
+#define uprv_decContextSetStatus U_ICU_ENTRY_POINT_RENAME(uprv_decContextSetStatus)
+#define uprv_decContextSetStatusFromString U_ICU_ENTRY_POINT_RENAME(uprv_decContextSetStatusFromString)
+#define uprv_decContextSetStatusFromStringQuiet U_ICU_ENTRY_POINT_RENAME(uprv_decContextSetStatusFromStringQuiet)
+#define uprv_decContextSetStatusQuiet U_ICU_ENTRY_POINT_RENAME(uprv_decContextSetStatusQuiet)
+#define uprv_decContextStatusToString U_ICU_ENTRY_POINT_RENAME(uprv_decContextStatusToString)
+#define uprv_decContextTestEndian U_ICU_ENTRY_POINT_RENAME(uprv_decContextTestEndian)
+#define uprv_decContextTestSavedStatus U_ICU_ENTRY_POINT_RENAME(uprv_decContextTestSavedStatus)
+#define uprv_decContextTestStatus U_ICU_ENTRY_POINT_RENAME(uprv_decContextTestStatus)
+#define uprv_decContextZeroStatus U_ICU_ENTRY_POINT_RENAME(uprv_decContextZeroStatus)
+#define uprv_decNumberAbs U_ICU_ENTRY_POINT_RENAME(uprv_decNumberAbs)
+#define uprv_decNumberAdd U_ICU_ENTRY_POINT_RENAME(uprv_decNumberAdd)
+#define uprv_decNumberAnd U_ICU_ENTRY_POINT_RENAME(uprv_decNumberAnd)
+#define uprv_decNumberClass U_ICU_ENTRY_POINT_RENAME(uprv_decNumberClass)
+#define uprv_decNumberClassToString U_ICU_ENTRY_POINT_RENAME(uprv_decNumberClassToString)
+#define uprv_decNumberCompare U_ICU_ENTRY_POINT_RENAME(uprv_decNumberCompare)
+#define uprv_decNumberCompareSignal U_ICU_ENTRY_POINT_RENAME(uprv_decNumberCompareSignal)
+#define uprv_decNumberCompareTotal U_ICU_ENTRY_POINT_RENAME(uprv_decNumberCompareTotal)
+#define uprv_decNumberCompareTotalMag U_ICU_ENTRY_POINT_RENAME(uprv_decNumberCompareTotalMag)
+#define uprv_decNumberCopy U_ICU_ENTRY_POINT_RENAME(uprv_decNumberCopy)
+#define uprv_decNumberCopyAbs U_ICU_ENTRY_POINT_RENAME(uprv_decNumberCopyAbs)
+#define uprv_decNumberCopyNegate U_ICU_ENTRY_POINT_RENAME(uprv_decNumberCopyNegate)
+#define uprv_decNumberCopySign U_ICU_ENTRY_POINT_RENAME(uprv_decNumberCopySign)
+#define uprv_decNumberDivide U_ICU_ENTRY_POINT_RENAME(uprv_decNumberDivide)
+#define uprv_decNumberDivideInteger U_ICU_ENTRY_POINT_RENAME(uprv_decNumberDivideInteger)
+#define uprv_decNumberExp U_ICU_ENTRY_POINT_RENAME(uprv_decNumberExp)
+#define uprv_decNumberFMA U_ICU_ENTRY_POINT_RENAME(uprv_decNumberFMA)
+#define uprv_decNumberFromInt32 U_ICU_ENTRY_POINT_RENAME(uprv_decNumberFromInt32)
+#define uprv_decNumberFromString U_ICU_ENTRY_POINT_RENAME(uprv_decNumberFromString)
+#define uprv_decNumberFromUInt32 U_ICU_ENTRY_POINT_RENAME(uprv_decNumberFromUInt32)
+#define uprv_decNumberGetBCD U_ICU_ENTRY_POINT_RENAME(uprv_decNumberGetBCD)
+#define uprv_decNumberInvert U_ICU_ENTRY_POINT_RENAME(uprv_decNumberInvert)
+#define uprv_decNumberIsNormal U_ICU_ENTRY_POINT_RENAME(uprv_decNumberIsNormal)
+#define uprv_decNumberIsSubnormal U_ICU_ENTRY_POINT_RENAME(uprv_decNumberIsSubnormal)
+#define uprv_decNumberLn U_ICU_ENTRY_POINT_RENAME(uprv_decNumberLn)
+#define uprv_decNumberLog10 U_ICU_ENTRY_POINT_RENAME(uprv_decNumberLog10)
+#define uprv_decNumberLogB U_ICU_ENTRY_POINT_RENAME(uprv_decNumberLogB)
+#define uprv_decNumberMax U_ICU_ENTRY_POINT_RENAME(uprv_decNumberMax)
+#define uprv_decNumberMaxMag U_ICU_ENTRY_POINT_RENAME(uprv_decNumberMaxMag)
+#define uprv_decNumberMin U_ICU_ENTRY_POINT_RENAME(uprv_decNumberMin)
+#define uprv_decNumberMinMag U_ICU_ENTRY_POINT_RENAME(uprv_decNumberMinMag)
+#define uprv_decNumberMinus U_ICU_ENTRY_POINT_RENAME(uprv_decNumberMinus)
+#define uprv_decNumberMultiply U_ICU_ENTRY_POINT_RENAME(uprv_decNumberMultiply)
+#define uprv_decNumberNextMinus U_ICU_ENTRY_POINT_RENAME(uprv_decNumberNextMinus)
+#define uprv_decNumberNextPlus U_ICU_ENTRY_POINT_RENAME(uprv_decNumberNextPlus)
+#define uprv_decNumberNextToward U_ICU_ENTRY_POINT_RENAME(uprv_decNumberNextToward)
+#define uprv_decNumberNormalize U_ICU_ENTRY_POINT_RENAME(uprv_decNumberNormalize)
+#define uprv_decNumberOr U_ICU_ENTRY_POINT_RENAME(uprv_decNumberOr)
+#define uprv_decNumberPlus U_ICU_ENTRY_POINT_RENAME(uprv_decNumberPlus)
+#define uprv_decNumberPower U_ICU_ENTRY_POINT_RENAME(uprv_decNumberPower)
+#define uprv_decNumberQuantize U_ICU_ENTRY_POINT_RENAME(uprv_decNumberQuantize)
+#define uprv_decNumberReduce U_ICU_ENTRY_POINT_RENAME(uprv_decNumberReduce)
+#define uprv_decNumberRemainder U_ICU_ENTRY_POINT_RENAME(uprv_decNumberRemainder)
+#define uprv_decNumberRemainderNear U_ICU_ENTRY_POINT_RENAME(uprv_decNumberRemainderNear)
+#define uprv_decNumberRescale U_ICU_ENTRY_POINT_RENAME(uprv_decNumberRescale)
+#define uprv_decNumberRotate U_ICU_ENTRY_POINT_RENAME(uprv_decNumberRotate)
+#define uprv_decNumberSameQuantum U_ICU_ENTRY_POINT_RENAME(uprv_decNumberSameQuantum)
+#define uprv_decNumberScaleB U_ICU_ENTRY_POINT_RENAME(uprv_decNumberScaleB)
+#define uprv_decNumberSetBCD U_ICU_ENTRY_POINT_RENAME(uprv_decNumberSetBCD)
+#define uprv_decNumberShift U_ICU_ENTRY_POINT_RENAME(uprv_decNumberShift)
+#define uprv_decNumberSquareRoot U_ICU_ENTRY_POINT_RENAME(uprv_decNumberSquareRoot)
+#define uprv_decNumberSubtract U_ICU_ENTRY_POINT_RENAME(uprv_decNumberSubtract)
+#define uprv_decNumberToEngString U_ICU_ENTRY_POINT_RENAME(uprv_decNumberToEngString)
+#define uprv_decNumberToInt32 U_ICU_ENTRY_POINT_RENAME(uprv_decNumberToInt32)
+#define uprv_decNumberToIntegralExact U_ICU_ENTRY_POINT_RENAME(uprv_decNumberToIntegralExact)
+#define uprv_decNumberToIntegralValue U_ICU_ENTRY_POINT_RENAME(uprv_decNumberToIntegralValue)
+#define uprv_decNumberToString U_ICU_ENTRY_POINT_RENAME(uprv_decNumberToString)
+#define uprv_decNumberToUInt32 U_ICU_ENTRY_POINT_RENAME(uprv_decNumberToUInt32)
+#define uprv_decNumberTrim U_ICU_ENTRY_POINT_RENAME(uprv_decNumberTrim)
+#define uprv_decNumberVersion U_ICU_ENTRY_POINT_RENAME(uprv_decNumberVersion)
+#define uprv_decNumberXor U_ICU_ENTRY_POINT_RENAME(uprv_decNumberXor)
+#define uprv_decNumberZero U_ICU_ENTRY_POINT_RENAME(uprv_decNumberZero)
+#define uprv_delete_collIterate U_ICU_ENTRY_POINT_RENAME(uprv_delete_collIterate)
+#define uprv_dl_close U_ICU_ENTRY_POINT_RENAME(uprv_dl_close)
+#define uprv_dl_open U_ICU_ENTRY_POINT_RENAME(uprv_dl_open)
+#define uprv_dl_sym U_ICU_ENTRY_POINT_RENAME(uprv_dl_sym)
+#define uprv_eastrncpy U_ICU_ENTRY_POINT_RENAME(uprv_eastrncpy)
+#define uprv_ebcdicFromAscii U_ICU_ENTRY_POINT_RENAME(uprv_ebcdicFromAscii)
+#define uprv_ebcdictolower U_ICU_ENTRY_POINT_RENAME(uprv_ebcdictolower)
+#define uprv_fabs U_ICU_ENTRY_POINT_RENAME(uprv_fabs)
+#define uprv_floor U_ICU_ENTRY_POINT_RENAME(uprv_floor)
+#define uprv_fmax U_ICU_ENTRY_POINT_RENAME(uprv_fmax)
+#define uprv_fmin U_ICU_ENTRY_POINT_RENAME(uprv_fmin)
+#define uprv_fmod U_ICU_ENTRY_POINT_RENAME(uprv_fmod)
+#define uprv_free U_ICU_ENTRY_POINT_RENAME(uprv_free)
+#define uprv_getCharNameCharacters U_ICU_ENTRY_POINT_RENAME(uprv_getCharNameCharacters)
+#define uprv_getDefaultCodepage U_ICU_ENTRY_POINT_RENAME(uprv_getDefaultCodepage)
+#define uprv_getDefaultLocaleID U_ICU_ENTRY_POINT_RENAME(uprv_getDefaultLocaleID)
+#define uprv_getInfinity U_ICU_ENTRY_POINT_RENAME(uprv_getInfinity)
+#define uprv_getMaxCharNameLength U_ICU_ENTRY_POINT_RENAME(uprv_getMaxCharNameLength)
+#define uprv_getMaxValues U_ICU_ENTRY_POINT_RENAME(uprv_getMaxValues)
+#define uprv_getNaN U_ICU_ENTRY_POINT_RENAME(uprv_getNaN)
+#define uprv_getRawUTCtime U_ICU_ENTRY_POINT_RENAME(uprv_getRawUTCtime)
+#define uprv_getStaticCurrencyName U_ICU_ENTRY_POINT_RENAME(uprv_getStaticCurrencyName)
+#define uprv_getUTCtime U_ICU_ENTRY_POINT_RENAME(uprv_getUTCtime)
+#define uprv_haveProperties U_ICU_ENTRY_POINT_RENAME(uprv_haveProperties)
+#define uprv_init_collIterate U_ICU_ENTRY_POINT_RENAME(uprv_init_collIterate)
+#define uprv_init_pce U_ICU_ENTRY_POINT_RENAME(uprv_init_pce)
+#define uprv_int32Comparator U_ICU_ENTRY_POINT_RENAME(uprv_int32Comparator)
+#define uprv_isInfinite U_ICU_ENTRY_POINT_RENAME(uprv_isInfinite)
+#define uprv_isInvariantString U_ICU_ENTRY_POINT_RENAME(uprv_isInvariantString)
+#define uprv_isInvariantUString U_ICU_ENTRY_POINT_RENAME(uprv_isInvariantUString)
+#define uprv_isNaN U_ICU_ENTRY_POINT_RENAME(uprv_isNaN)
+#define uprv_isNegativeInfinity U_ICU_ENTRY_POINT_RENAME(uprv_isNegativeInfinity)
+#define uprv_isPositiveInfinity U_ICU_ENTRY_POINT_RENAME(uprv_isPositiveInfinity)
+#define uprv_isRuleWhiteSpace U_ICU_ENTRY_POINT_RENAME(uprv_isRuleWhiteSpace)
+#define uprv_itou U_ICU_ENTRY_POINT_RENAME(uprv_itou)
+#define uprv_log U_ICU_ENTRY_POINT_RENAME(uprv_log)
+#define uprv_malloc U_ICU_ENTRY_POINT_RENAME(uprv_malloc)
+#define uprv_mapFile U_ICU_ENTRY_POINT_RENAME(uprv_mapFile)
+#define uprv_max U_ICU_ENTRY_POINT_RENAME(uprv_max)
+#define uprv_maxMantissa U_ICU_ENTRY_POINT_RENAME(uprv_maxMantissa)
+#define uprv_maximumPtr U_ICU_ENTRY_POINT_RENAME(uprv_maximumPtr)
+#define uprv_min U_ICU_ENTRY_POINT_RENAME(uprv_min)
+#define uprv_modf U_ICU_ENTRY_POINT_RENAME(uprv_modf)
+#define uprv_new_collIterate U_ICU_ENTRY_POINT_RENAME(uprv_new_collIterate)
+#define uprv_openRuleWhiteSpaceSet U_ICU_ENTRY_POINT_RENAME(uprv_openRuleWhiteSpaceSet)
+#define uprv_parseCurrency U_ICU_ENTRY_POINT_RENAME(uprv_parseCurrency)
+#define uprv_pathIsAbsolute U_ICU_ENTRY_POINT_RENAME(uprv_pathIsAbsolute)
+#define uprv_pow U_ICU_ENTRY_POINT_RENAME(uprv_pow)
+#define uprv_pow10 U_ICU_ENTRY_POINT_RENAME(uprv_pow10)
+#define uprv_realloc U_ICU_ENTRY_POINT_RENAME(uprv_realloc)
+#define uprv_round U_ICU_ENTRY_POINT_RENAME(uprv_round)
+#define uprv_sortArray U_ICU_ENTRY_POINT_RENAME(uprv_sortArray)
+#define uprv_strCompare U_ICU_ENTRY_POINT_RENAME(uprv_strCompare)
+#define uprv_strdup U_ICU_ENTRY_POINT_RENAME(uprv_strdup)
+#define uprv_strndup U_ICU_ENTRY_POINT_RENAME(uprv_strndup)
+#define uprv_syntaxError U_ICU_ENTRY_POINT_RENAME(uprv_syntaxError)
+#define uprv_timezone U_ICU_ENTRY_POINT_RENAME(uprv_timezone)
+#define uprv_toupper U_ICU_ENTRY_POINT_RENAME(uprv_toupper)
+#define uprv_trunc U_ICU_ENTRY_POINT_RENAME(uprv_trunc)
+#define uprv_tzname U_ICU_ENTRY_POINT_RENAME(uprv_tzname)
+#define uprv_tzset U_ICU_ENTRY_POINT_RENAME(uprv_tzset)
+#define uprv_uca_addAnElement U_ICU_ENTRY_POINT_RENAME(uprv_uca_addAnElement)
+#define uprv_uca_assembleTable U_ICU_ENTRY_POINT_RENAME(uprv_uca_assembleTable)
+#define uprv_uca_canonicalClosure U_ICU_ENTRY_POINT_RENAME(uprv_uca_canonicalClosure)
+#define uprv_uca_closeTempTable U_ICU_ENTRY_POINT_RENAME(uprv_uca_closeTempTable)
+#define uprv_uca_getCodePointFromRaw U_ICU_ENTRY_POINT_RENAME(uprv_uca_getCodePointFromRaw)
+#define uprv_uca_getImplicitFromRaw U_ICU_ENTRY_POINT_RENAME(uprv_uca_getImplicitFromRaw)
+#define uprv_uca_getRawFromCodePoint U_ICU_ENTRY_POINT_RENAME(uprv_uca_getRawFromCodePoint)
+#define uprv_uca_getRawFromImplicit U_ICU_ENTRY_POINT_RENAME(uprv_uca_getRawFromImplicit)
+#define uprv_uca_initImplicitConstants U_ICU_ENTRY_POINT_RENAME(uprv_uca_initImplicitConstants)
+#define uprv_uca_initTempTable U_ICU_ENTRY_POINT_RENAME(uprv_uca_initTempTable)
+#define uprv_uint16Comparator U_ICU_ENTRY_POINT_RENAME(uprv_uint16Comparator)
+#define uprv_uint32Comparator U_ICU_ENTRY_POINT_RENAME(uprv_uint32Comparator)
+#define uprv_unmapFile U_ICU_ENTRY_POINT_RENAME(uprv_unmapFile)
+#define upvec_cloneArray U_ICU_ENTRY_POINT_RENAME(upvec_cloneArray)
+#define upvec_close U_ICU_ENTRY_POINT_RENAME(upvec_close)
+#define upvec_compact U_ICU_ENTRY_POINT_RENAME(upvec_compact)
+#define upvec_compactToUTrie2Handler U_ICU_ENTRY_POINT_RENAME(upvec_compactToUTrie2Handler)
+#define upvec_compactToUTrie2WithRowIndexes U_ICU_ENTRY_POINT_RENAME(upvec_compactToUTrie2WithRowIndexes)
+#define upvec_getArray U_ICU_ENTRY_POINT_RENAME(upvec_getArray)
+#define upvec_getRow U_ICU_ENTRY_POINT_RENAME(upvec_getRow)
+#define upvec_getValue U_ICU_ENTRY_POINT_RENAME(upvec_getValue)
+#define upvec_open U_ICU_ENTRY_POINT_RENAME(upvec_open)
+#define upvec_setValue U_ICU_ENTRY_POINT_RENAME(upvec_setValue)
+#define uregex_appendReplacement U_ICU_ENTRY_POINT_RENAME(uregex_appendReplacement)
+#define uregex_appendReplacementUText U_ICU_ENTRY_POINT_RENAME(uregex_appendReplacementUText)
+#define uregex_appendTail U_ICU_ENTRY_POINT_RENAME(uregex_appendTail)
+#define uregex_appendTailUText U_ICU_ENTRY_POINT_RENAME(uregex_appendTailUText)
+#define uregex_clone U_ICU_ENTRY_POINT_RENAME(uregex_clone)
+#define uregex_close U_ICU_ENTRY_POINT_RENAME(uregex_close)
+#define uregex_end U_ICU_ENTRY_POINT_RENAME(uregex_end)
+#define uregex_end64 U_ICU_ENTRY_POINT_RENAME(uregex_end64)
+#define uregex_find U_ICU_ENTRY_POINT_RENAME(uregex_find)
+#define uregex_find64 U_ICU_ENTRY_POINT_RENAME(uregex_find64)
+#define uregex_findNext U_ICU_ENTRY_POINT_RENAME(uregex_findNext)
+#define uregex_flags U_ICU_ENTRY_POINT_RENAME(uregex_flags)
+#define uregex_getFindProgressCallback U_ICU_ENTRY_POINT_RENAME(uregex_getFindProgressCallback)
+#define uregex_getMatchCallback U_ICU_ENTRY_POINT_RENAME(uregex_getMatchCallback)
+#define uregex_getStackLimit U_ICU_ENTRY_POINT_RENAME(uregex_getStackLimit)
+#define uregex_getText U_ICU_ENTRY_POINT_RENAME(uregex_getText)
+#define uregex_getTimeLimit U_ICU_ENTRY_POINT_RENAME(uregex_getTimeLimit)
+#define uregex_getUText U_ICU_ENTRY_POINT_RENAME(uregex_getUText)
+#define uregex_group U_ICU_ENTRY_POINT_RENAME(uregex_group)
+#define uregex_groupCount U_ICU_ENTRY_POINT_RENAME(uregex_groupCount)
+#define uregex_groupUText U_ICU_ENTRY_POINT_RENAME(uregex_groupUText)
+#define uregex_groupUTextDeep U_ICU_ENTRY_POINT_RENAME(uregex_groupUTextDeep)
+#define uregex_hasAnchoringBounds U_ICU_ENTRY_POINT_RENAME(uregex_hasAnchoringBounds)
+#define uregex_hasTransparentBounds U_ICU_ENTRY_POINT_RENAME(uregex_hasTransparentBounds)
+#define uregex_hitEnd U_ICU_ENTRY_POINT_RENAME(uregex_hitEnd)
+#define uregex_lookingAt U_ICU_ENTRY_POINT_RENAME(uregex_lookingAt)
+#define uregex_lookingAt64 U_ICU_ENTRY_POINT_RENAME(uregex_lookingAt64)
+#define uregex_matches U_ICU_ENTRY_POINT_RENAME(uregex_matches)
+#define uregex_matches64 U_ICU_ENTRY_POINT_RENAME(uregex_matches64)
+#define uregex_open U_ICU_ENTRY_POINT_RENAME(uregex_open)
+#define uregex_openC U_ICU_ENTRY_POINT_RENAME(uregex_openC)
+#define uregex_openUText U_ICU_ENTRY_POINT_RENAME(uregex_openUText)
+#define uregex_pattern U_ICU_ENTRY_POINT_RENAME(uregex_pattern)
+#define uregex_patternUText U_ICU_ENTRY_POINT_RENAME(uregex_patternUText)
+#define uregex_regionEnd U_ICU_ENTRY_POINT_RENAME(uregex_regionEnd)
+#define uregex_regionEnd64 U_ICU_ENTRY_POINT_RENAME(uregex_regionEnd64)
+#define uregex_regionStart U_ICU_ENTRY_POINT_RENAME(uregex_regionStart)
+#define uregex_regionStart64 U_ICU_ENTRY_POINT_RENAME(uregex_regionStart64)
+#define uregex_replaceAll U_ICU_ENTRY_POINT_RENAME(uregex_replaceAll)
+#define uregex_replaceAllUText U_ICU_ENTRY_POINT_RENAME(uregex_replaceAllUText)
+#define uregex_replaceFirst U_ICU_ENTRY_POINT_RENAME(uregex_replaceFirst)
+#define uregex_replaceFirstUText U_ICU_ENTRY_POINT_RENAME(uregex_replaceFirstUText)
+#define uregex_requireEnd U_ICU_ENTRY_POINT_RENAME(uregex_requireEnd)
+#define uregex_reset U_ICU_ENTRY_POINT_RENAME(uregex_reset)
+#define uregex_reset64 U_ICU_ENTRY_POINT_RENAME(uregex_reset64)
+#define uregex_setFindProgressCallback U_ICU_ENTRY_POINT_RENAME(uregex_setFindProgressCallback)
+#define uregex_setMatchCallback U_ICU_ENTRY_POINT_RENAME(uregex_setMatchCallback)
+#define uregex_setRegion U_ICU_ENTRY_POINT_RENAME(uregex_setRegion)
+#define uregex_setRegion64 U_ICU_ENTRY_POINT_RENAME(uregex_setRegion64)
+#define uregex_setRegionAndStart U_ICU_ENTRY_POINT_RENAME(uregex_setRegionAndStart)
+#define uregex_setStackLimit U_ICU_ENTRY_POINT_RENAME(uregex_setStackLimit)
+#define uregex_setText U_ICU_ENTRY_POINT_RENAME(uregex_setText)
+#define uregex_setTimeLimit U_ICU_ENTRY_POINT_RENAME(uregex_setTimeLimit)
+#define uregex_setUText U_ICU_ENTRY_POINT_RENAME(uregex_setUText)
+#define uregex_split U_ICU_ENTRY_POINT_RENAME(uregex_split)
+#define uregex_splitUText U_ICU_ENTRY_POINT_RENAME(uregex_splitUText)
+#define uregex_start U_ICU_ENTRY_POINT_RENAME(uregex_start)
+#define uregex_start64 U_ICU_ENTRY_POINT_RENAME(uregex_start64)
+#define uregex_ucstr_unescape_charAt U_ICU_ENTRY_POINT_RENAME(uregex_ucstr_unescape_charAt)
+#define uregex_useAnchoringBounds U_ICU_ENTRY_POINT_RENAME(uregex_useAnchoringBounds)
+#define uregex_useTransparentBounds U_ICU_ENTRY_POINT_RENAME(uregex_useTransparentBounds)
+#define uregex_utext_unescape_charAt U_ICU_ENTRY_POINT_RENAME(uregex_utext_unescape_charAt)
+#define ures_close U_ICU_ENTRY_POINT_RENAME(ures_close)
+#define ures_copyResb U_ICU_ENTRY_POINT_RENAME(ures_copyResb)
+#define ures_countArrayItems U_ICU_ENTRY_POINT_RENAME(ures_countArrayItems)
+#define ures_findResource U_ICU_ENTRY_POINT_RENAME(ures_findResource)
+#define ures_findSubResource U_ICU_ENTRY_POINT_RENAME(ures_findSubResource)
+#define ures_getBinary U_ICU_ENTRY_POINT_RENAME(ures_getBinary)
+#define ures_getByIndex U_ICU_ENTRY_POINT_RENAME(ures_getByIndex)
+#define ures_getByKey U_ICU_ENTRY_POINT_RENAME(ures_getByKey)
+#define ures_getByKeyWithFallback U_ICU_ENTRY_POINT_RENAME(ures_getByKeyWithFallback)
+#define ures_getFunctionalEquivalent U_ICU_ENTRY_POINT_RENAME(ures_getFunctionalEquivalent)
+#define ures_getInt U_ICU_ENTRY_POINT_RENAME(ures_getInt)
+#define ures_getIntVector U_ICU_ENTRY_POINT_RENAME(ures_getIntVector)
+#define ures_getKey U_ICU_ENTRY_POINT_RENAME(ures_getKey)
+#define ures_getKeywordValues U_ICU_ENTRY_POINT_RENAME(ures_getKeywordValues)
+#define ures_getLocale U_ICU_ENTRY_POINT_RENAME(ures_getLocale)
+#define ures_getLocaleByType U_ICU_ENTRY_POINT_RENAME(ures_getLocaleByType)
+#define ures_getLocaleInternal U_ICU_ENTRY_POINT_RENAME(ures_getLocaleInternal)
+#define ures_getName U_ICU_ENTRY_POINT_RENAME(ures_getName)
+#define ures_getNextResource U_ICU_ENTRY_POINT_RENAME(ures_getNextResource)
+#define ures_getNextString U_ICU_ENTRY_POINT_RENAME(ures_getNextString)
+#define ures_getSize U_ICU_ENTRY_POINT_RENAME(ures_getSize)
+#define ures_getString U_ICU_ENTRY_POINT_RENAME(ures_getString)
+#define ures_getStringByIndex U_ICU_ENTRY_POINT_RENAME(ures_getStringByIndex)
+#define ures_getStringByKey U_ICU_ENTRY_POINT_RENAME(ures_getStringByKey)
+#define ures_getStringByKeyWithFallback U_ICU_ENTRY_POINT_RENAME(ures_getStringByKeyWithFallback)
+#define ures_getType U_ICU_ENTRY_POINT_RENAME(ures_getType)
+#define ures_getUInt U_ICU_ENTRY_POINT_RENAME(ures_getUInt)
+#define ures_getUTF8String U_ICU_ENTRY_POINT_RENAME(ures_getUTF8String)
+#define ures_getUTF8StringByIndex U_ICU_ENTRY_POINT_RENAME(ures_getUTF8StringByIndex)
+#define ures_getUTF8StringByKey U_ICU_ENTRY_POINT_RENAME(ures_getUTF8StringByKey)
+#define ures_getVersion U_ICU_ENTRY_POINT_RENAME(ures_getVersion)
+#define ures_getVersionByKey U_ICU_ENTRY_POINT_RENAME(ures_getVersionByKey)
+#define ures_getVersionNumber U_ICU_ENTRY_POINT_RENAME(ures_getVersionNumber)
+#define ures_getVersionNumberInternal U_ICU_ENTRY_POINT_RENAME(ures_getVersionNumberInternal)
+#define ures_hasNext U_ICU_ENTRY_POINT_RENAME(ures_hasNext)
+#define ures_initStackObject U_ICU_ENTRY_POINT_RENAME(ures_initStackObject)
+#define ures_open U_ICU_ENTRY_POINT_RENAME(ures_open)
+#define ures_openAvailableLocales U_ICU_ENTRY_POINT_RENAME(ures_openAvailableLocales)
+#define ures_openDirect U_ICU_ENTRY_POINT_RENAME(ures_openDirect)
+#define ures_openFillIn U_ICU_ENTRY_POINT_RENAME(ures_openFillIn)
+#define ures_openU U_ICU_ENTRY_POINT_RENAME(ures_openU)
+#define ures_resetIterator U_ICU_ENTRY_POINT_RENAME(ures_resetIterator)
+#define ures_swap U_ICU_ENTRY_POINT_RENAME(ures_swap)
+#define uscript_closeRun U_ICU_ENTRY_POINT_RENAME(uscript_closeRun)
+#define uscript_getCode U_ICU_ENTRY_POINT_RENAME(uscript_getCode)
+#define uscript_getName U_ICU_ENTRY_POINT_RENAME(uscript_getName)
+#define uscript_getScript U_ICU_ENTRY_POINT_RENAME(uscript_getScript)
+#define uscript_getScriptExtensions U_ICU_ENTRY_POINT_RENAME(uscript_getScriptExtensions)
+#define uscript_getShortName U_ICU_ENTRY_POINT_RENAME(uscript_getShortName)
+#define uscript_hasScript U_ICU_ENTRY_POINT_RENAME(uscript_hasScript)
+#define uscript_nextRun U_ICU_ENTRY_POINT_RENAME(uscript_nextRun)
+#define uscript_openRun U_ICU_ENTRY_POINT_RENAME(uscript_openRun)
+#define uscript_resetRun U_ICU_ENTRY_POINT_RENAME(uscript_resetRun)
+#define uscript_setRunText U_ICU_ENTRY_POINT_RENAME(uscript_setRunText)
+#define usearch_close U_ICU_ENTRY_POINT_RENAME(usearch_close)
+#define usearch_first U_ICU_ENTRY_POINT_RENAME(usearch_first)
+#define usearch_following U_ICU_ENTRY_POINT_RENAME(usearch_following)
+#define usearch_getAttribute U_ICU_ENTRY_POINT_RENAME(usearch_getAttribute)
+#define usearch_getBreakIterator U_ICU_ENTRY_POINT_RENAME(usearch_getBreakIterator)
+#define usearch_getCollator U_ICU_ENTRY_POINT_RENAME(usearch_getCollator)
+#define usearch_getMatchedLength U_ICU_ENTRY_POINT_RENAME(usearch_getMatchedLength)
+#define usearch_getMatchedStart U_ICU_ENTRY_POINT_RENAME(usearch_getMatchedStart)
+#define usearch_getMatchedText U_ICU_ENTRY_POINT_RENAME(usearch_getMatchedText)
+#define usearch_getOffset U_ICU_ENTRY_POINT_RENAME(usearch_getOffset)
+#define usearch_getPattern U_ICU_ENTRY_POINT_RENAME(usearch_getPattern)
+#define usearch_getText U_ICU_ENTRY_POINT_RENAME(usearch_getText)
+#define usearch_handleNextCanonical U_ICU_ENTRY_POINT_RENAME(usearch_handleNextCanonical)
+#define usearch_handleNextExact U_ICU_ENTRY_POINT_RENAME(usearch_handleNextExact)
+#define usearch_handlePreviousCanonical U_ICU_ENTRY_POINT_RENAME(usearch_handlePreviousCanonical)
+#define usearch_handlePreviousExact U_ICU_ENTRY_POINT_RENAME(usearch_handlePreviousExact)
+#define usearch_last U_ICU_ENTRY_POINT_RENAME(usearch_last)
+#define usearch_next U_ICU_ENTRY_POINT_RENAME(usearch_next)
+#define usearch_open U_ICU_ENTRY_POINT_RENAME(usearch_open)
+#define usearch_openFromCollator U_ICU_ENTRY_POINT_RENAME(usearch_openFromCollator)
+#define usearch_preceding U_ICU_ENTRY_POINT_RENAME(usearch_preceding)
+#define usearch_previous U_ICU_ENTRY_POINT_RENAME(usearch_previous)
+#define usearch_reset U_ICU_ENTRY_POINT_RENAME(usearch_reset)
+#define usearch_search U_ICU_ENTRY_POINT_RENAME(usearch_search)
+#define usearch_searchBackwards U_ICU_ENTRY_POINT_RENAME(usearch_searchBackwards)
+#define usearch_setAttribute U_ICU_ENTRY_POINT_RENAME(usearch_setAttribute)
+#define usearch_setBreakIterator U_ICU_ENTRY_POINT_RENAME(usearch_setBreakIterator)
+#define usearch_setCollator U_ICU_ENTRY_POINT_RENAME(usearch_setCollator)
+#define usearch_setOffset U_ICU_ENTRY_POINT_RENAME(usearch_setOffset)
+#define usearch_setPattern U_ICU_ENTRY_POINT_RENAME(usearch_setPattern)
+#define usearch_setText U_ICU_ENTRY_POINT_RENAME(usearch_setText)
+#define uset_add U_ICU_ENTRY_POINT_RENAME(uset_add)
+#define uset_addAll U_ICU_ENTRY_POINT_RENAME(uset_addAll)
+#define uset_addAllCodePoints U_ICU_ENTRY_POINT_RENAME(uset_addAllCodePoints)
+#define uset_addRange U_ICU_ENTRY_POINT_RENAME(uset_addRange)
+#define uset_addString U_ICU_ENTRY_POINT_RENAME(uset_addString)
+#define uset_applyIntPropertyValue U_ICU_ENTRY_POINT_RENAME(uset_applyIntPropertyValue)
+#define uset_applyPattern U_ICU_ENTRY_POINT_RENAME(uset_applyPattern)
+#define uset_applyPropertyAlias U_ICU_ENTRY_POINT_RENAME(uset_applyPropertyAlias)
+#define uset_charAt U_ICU_ENTRY_POINT_RENAME(uset_charAt)
+#define uset_clear U_ICU_ENTRY_POINT_RENAME(uset_clear)
+#define uset_clone U_ICU_ENTRY_POINT_RENAME(uset_clone)
+#define uset_cloneAsThawed U_ICU_ENTRY_POINT_RENAME(uset_cloneAsThawed)
+#define uset_close U_ICU_ENTRY_POINT_RENAME(uset_close)
+#define uset_closeOver U_ICU_ENTRY_POINT_RENAME(uset_closeOver)
+#define uset_compact U_ICU_ENTRY_POINT_RENAME(uset_compact)
+#define uset_complement U_ICU_ENTRY_POINT_RENAME(uset_complement)
+#define uset_complementAll U_ICU_ENTRY_POINT_RENAME(uset_complementAll)
+#define uset_contains U_ICU_ENTRY_POINT_RENAME(uset_contains)
+#define uset_containsAll U_ICU_ENTRY_POINT_RENAME(uset_containsAll)
+#define uset_containsAllCodePoints U_ICU_ENTRY_POINT_RENAME(uset_containsAllCodePoints)
+#define uset_containsNone U_ICU_ENTRY_POINT_RENAME(uset_containsNone)
+#define uset_containsRange U_ICU_ENTRY_POINT_RENAME(uset_containsRange)
+#define uset_containsSome U_ICU_ENTRY_POINT_RENAME(uset_containsSome)
+#define uset_containsString U_ICU_ENTRY_POINT_RENAME(uset_containsString)
+#define uset_equals U_ICU_ENTRY_POINT_RENAME(uset_equals)
+#define uset_freeze U_ICU_ENTRY_POINT_RENAME(uset_freeze)
+#define uset_getItem U_ICU_ENTRY_POINT_RENAME(uset_getItem)
+#define uset_getItemCount U_ICU_ENTRY_POINT_RENAME(uset_getItemCount)
+#define uset_getSerializedRange U_ICU_ENTRY_POINT_RENAME(uset_getSerializedRange)
+#define uset_getSerializedRangeCount U_ICU_ENTRY_POINT_RENAME(uset_getSerializedRangeCount)
+#define uset_getSerializedSet U_ICU_ENTRY_POINT_RENAME(uset_getSerializedSet)
+#define uset_indexOf U_ICU_ENTRY_POINT_RENAME(uset_indexOf)
+#define uset_isEmpty U_ICU_ENTRY_POINT_RENAME(uset_isEmpty)
+#define uset_isFrozen U_ICU_ENTRY_POINT_RENAME(uset_isFrozen)
+#define uset_open U_ICU_ENTRY_POINT_RENAME(uset_open)
+#define uset_openEmpty U_ICU_ENTRY_POINT_RENAME(uset_openEmpty)
+#define uset_openPattern U_ICU_ENTRY_POINT_RENAME(uset_openPattern)
+#define uset_openPatternOptions U_ICU_ENTRY_POINT_RENAME(uset_openPatternOptions)
+#define uset_remove U_ICU_ENTRY_POINT_RENAME(uset_remove)
+#define uset_removeAll U_ICU_ENTRY_POINT_RENAME(uset_removeAll)
+#define uset_removeAllStrings U_ICU_ENTRY_POINT_RENAME(uset_removeAllStrings)
+#define uset_removeRange U_ICU_ENTRY_POINT_RENAME(uset_removeRange)
+#define uset_removeString U_ICU_ENTRY_POINT_RENAME(uset_removeString)
+#define uset_resemblesPattern U_ICU_ENTRY_POINT_RENAME(uset_resemblesPattern)
+#define uset_retain U_ICU_ENTRY_POINT_RENAME(uset_retain)
+#define uset_retainAll U_ICU_ENTRY_POINT_RENAME(uset_retainAll)
+#define uset_serialize U_ICU_ENTRY_POINT_RENAME(uset_serialize)
+#define uset_serializedContains U_ICU_ENTRY_POINT_RENAME(uset_serializedContains)
+#define uset_set U_ICU_ENTRY_POINT_RENAME(uset_set)
+#define uset_setSerializedToOne U_ICU_ENTRY_POINT_RENAME(uset_setSerializedToOne)
+#define uset_size U_ICU_ENTRY_POINT_RENAME(uset_size)
+#define uset_span U_ICU_ENTRY_POINT_RENAME(uset_span)
+#define uset_spanBack U_ICU_ENTRY_POINT_RENAME(uset_spanBack)
+#define uset_spanBackUTF8 U_ICU_ENTRY_POINT_RENAME(uset_spanBackUTF8)
+#define uset_spanUTF8 U_ICU_ENTRY_POINT_RENAME(uset_spanUTF8)
+#define uset_toPattern U_ICU_ENTRY_POINT_RENAME(uset_toPattern)
+#define uspoof_areConfusable U_ICU_ENTRY_POINT_RENAME(uspoof_areConfusable)
+#define uspoof_areConfusableUTF8 U_ICU_ENTRY_POINT_RENAME(uspoof_areConfusableUTF8)
+#define uspoof_areConfusableUnicodeString U_ICU_ENTRY_POINT_RENAME(uspoof_areConfusableUnicodeString)
+#define uspoof_check U_ICU_ENTRY_POINT_RENAME(uspoof_check)
+#define uspoof_checkUTF8 U_ICU_ENTRY_POINT_RENAME(uspoof_checkUTF8)
+#define uspoof_checkUnicodeString U_ICU_ENTRY_POINT_RENAME(uspoof_checkUnicodeString)
+#define uspoof_clone U_ICU_ENTRY_POINT_RENAME(uspoof_clone)
+#define uspoof_close U_ICU_ENTRY_POINT_RENAME(uspoof_close)
+#define uspoof_getAllowedChars U_ICU_ENTRY_POINT_RENAME(uspoof_getAllowedChars)
+#define uspoof_getAllowedLocales U_ICU_ENTRY_POINT_RENAME(uspoof_getAllowedLocales)
+#define uspoof_getAllowedUnicodeSet U_ICU_ENTRY_POINT_RENAME(uspoof_getAllowedUnicodeSet)
+#define uspoof_getChecks U_ICU_ENTRY_POINT_RENAME(uspoof_getChecks)
+#define uspoof_getSkeleton U_ICU_ENTRY_POINT_RENAME(uspoof_getSkeleton)
+#define uspoof_getSkeletonUTF8 U_ICU_ENTRY_POINT_RENAME(uspoof_getSkeletonUTF8)
+#define uspoof_getSkeletonUnicodeString U_ICU_ENTRY_POINT_RENAME(uspoof_getSkeletonUnicodeString)
+#define uspoof_open U_ICU_ENTRY_POINT_RENAME(uspoof_open)
+#define uspoof_openFromSerialized U_ICU_ENTRY_POINT_RENAME(uspoof_openFromSerialized)
+#define uspoof_openFromSource U_ICU_ENTRY_POINT_RENAME(uspoof_openFromSource)
+#define uspoof_serialize U_ICU_ENTRY_POINT_RENAME(uspoof_serialize)
+#define uspoof_setAllowedChars U_ICU_ENTRY_POINT_RENAME(uspoof_setAllowedChars)
+#define uspoof_setAllowedLocales U_ICU_ENTRY_POINT_RENAME(uspoof_setAllowedLocales)
+#define uspoof_setAllowedUnicodeSet U_ICU_ENTRY_POINT_RENAME(uspoof_setAllowedUnicodeSet)
+#define uspoof_setChecks U_ICU_ENTRY_POINT_RENAME(uspoof_setChecks)
+#define uspoof_swap U_ICU_ENTRY_POINT_RENAME(uspoof_swap)
+#define usprep_close U_ICU_ENTRY_POINT_RENAME(usprep_close)
+#define usprep_open U_ICU_ENTRY_POINT_RENAME(usprep_open)
+#define usprep_openByType U_ICU_ENTRY_POINT_RENAME(usprep_openByType)
+#define usprep_prepare U_ICU_ENTRY_POINT_RENAME(usprep_prepare)
+#define usprep_swap U_ICU_ENTRY_POINT_RENAME(usprep_swap)
+#define ustr_foldCase U_ICU_ENTRY_POINT_RENAME(ustr_foldCase)
+#define ustr_toLower U_ICU_ENTRY_POINT_RENAME(ustr_toLower)
+#define ustr_toTitle U_ICU_ENTRY_POINT_RENAME(ustr_toTitle)
+#define ustr_toUpper U_ICU_ENTRY_POINT_RENAME(ustr_toUpper)
+#define utext_caseCompare U_ICU_ENTRY_POINT_RENAME(utext_caseCompare)
+#define utext_caseCompareNativeLimit U_ICU_ENTRY_POINT_RENAME(utext_caseCompareNativeLimit)
+#define utext_char32At U_ICU_ENTRY_POINT_RENAME(utext_char32At)
+#define utext_clone U_ICU_ENTRY_POINT_RENAME(utext_clone)
+#define utext_close U_ICU_ENTRY_POINT_RENAME(utext_close)
+#define utext_compare U_ICU_ENTRY_POINT_RENAME(utext_compare)
+#define utext_compareNativeLimit U_ICU_ENTRY_POINT_RENAME(utext_compareNativeLimit)
+#define utext_copy U_ICU_ENTRY_POINT_RENAME(utext_copy)
+#define utext_current32 U_ICU_ENTRY_POINT_RENAME(utext_current32)
+#define utext_equals U_ICU_ENTRY_POINT_RENAME(utext_equals)
+#define utext_extract U_ICU_ENTRY_POINT_RENAME(utext_extract)
+#define utext_freeze U_ICU_ENTRY_POINT_RENAME(utext_freeze)
+#define utext_getNativeIndex U_ICU_ENTRY_POINT_RENAME(utext_getNativeIndex)
+#define utext_getPreviousNativeIndex U_ICU_ENTRY_POINT_RENAME(utext_getPreviousNativeIndex)
+#define utext_hasMetaData U_ICU_ENTRY_POINT_RENAME(utext_hasMetaData)
+#define utext_isLengthExpensive U_ICU_ENTRY_POINT_RENAME(utext_isLengthExpensive)
+#define utext_isWritable U_ICU_ENTRY_POINT_RENAME(utext_isWritable)
+#define utext_moveIndex32 U_ICU_ENTRY_POINT_RENAME(utext_moveIndex32)
+#define utext_nativeLength U_ICU_ENTRY_POINT_RENAME(utext_nativeLength)
+#define utext_next32 U_ICU_ENTRY_POINT_RENAME(utext_next32)
+#define utext_next32From U_ICU_ENTRY_POINT_RENAME(utext_next32From)
+#define utext_openCharacterIterator U_ICU_ENTRY_POINT_RENAME(utext_openCharacterIterator)
+#define utext_openConstUnicodeString U_ICU_ENTRY_POINT_RENAME(utext_openConstUnicodeString)
+#define utext_openReplaceable U_ICU_ENTRY_POINT_RENAME(utext_openReplaceable)
+#define utext_openUChars U_ICU_ENTRY_POINT_RENAME(utext_openUChars)
+#define utext_openUTF8 U_ICU_ENTRY_POINT_RENAME(utext_openUTF8)
+#define utext_openUnicodeString U_ICU_ENTRY_POINT_RENAME(utext_openUnicodeString)
+#define utext_previous32 U_ICU_ENTRY_POINT_RENAME(utext_previous32)
+#define utext_previous32From U_ICU_ENTRY_POINT_RENAME(utext_previous32From)
+#define utext_replace U_ICU_ENTRY_POINT_RENAME(utext_replace)
+#define utext_setNativeIndex U_ICU_ENTRY_POINT_RENAME(utext_setNativeIndex)
+#define utext_setup U_ICU_ENTRY_POINT_RENAME(utext_setup)
+#define utf8_appendCharSafeBody U_ICU_ENTRY_POINT_RENAME(utf8_appendCharSafeBody)
+#define utf8_back1SafeBody U_ICU_ENTRY_POINT_RENAME(utf8_back1SafeBody)
+#define utf8_countTrailBytes U_ICU_ENTRY_POINT_RENAME(utf8_countTrailBytes)
+#define utf8_nextCharSafeBody U_ICU_ENTRY_POINT_RENAME(utf8_nextCharSafeBody)
+#define utf8_prevCharSafeBody U_ICU_ENTRY_POINT_RENAME(utf8_prevCharSafeBody)
+#define utmscale_fromInt64 U_ICU_ENTRY_POINT_RENAME(utmscale_fromInt64)
+#define utmscale_getTimeScaleValue U_ICU_ENTRY_POINT_RENAME(utmscale_getTimeScaleValue)
+#define utmscale_toInt64 U_ICU_ENTRY_POINT_RENAME(utmscale_toInt64)
+#define utrace_cleanup U_ICU_ENTRY_POINT_RENAME(utrace_cleanup)
+#define utrace_data U_ICU_ENTRY_POINT_RENAME(utrace_data)
+#define utrace_entry U_ICU_ENTRY_POINT_RENAME(utrace_entry)
+#define utrace_exit U_ICU_ENTRY_POINT_RENAME(utrace_exit)
+#define utrace_format U_ICU_ENTRY_POINT_RENAME(utrace_format)
+#define utrace_functionName U_ICU_ENTRY_POINT_RENAME(utrace_functionName)
+#define utrace_getFunctions U_ICU_ENTRY_POINT_RENAME(utrace_getFunctions)
+#define utrace_getLevel U_ICU_ENTRY_POINT_RENAME(utrace_getLevel)
+#define utrace_level U_ICU_ENTRY_POINT_RENAME(utrace_level)
+#define utrace_setFunctions U_ICU_ENTRY_POINT_RENAME(utrace_setFunctions)
+#define utrace_setLevel U_ICU_ENTRY_POINT_RENAME(utrace_setLevel)
+#define utrace_vformat U_ICU_ENTRY_POINT_RENAME(utrace_vformat)
+#define utrans_clone U_ICU_ENTRY_POINT_RENAME(utrans_clone)
+#define utrans_close U_ICU_ENTRY_POINT_RENAME(utrans_close)
+#define utrans_countAvailableIDs U_ICU_ENTRY_POINT_RENAME(utrans_countAvailableIDs)
+#define utrans_getAvailableID U_ICU_ENTRY_POINT_RENAME(utrans_getAvailableID)
+#define utrans_getID U_ICU_ENTRY_POINT_RENAME(utrans_getID)
+#define utrans_getUnicodeID U_ICU_ENTRY_POINT_RENAME(utrans_getUnicodeID)
+#define utrans_open U_ICU_ENTRY_POINT_RENAME(utrans_open)
+#define utrans_openIDs U_ICU_ENTRY_POINT_RENAME(utrans_openIDs)
+#define utrans_openInverse U_ICU_ENTRY_POINT_RENAME(utrans_openInverse)
+#define utrans_openU U_ICU_ENTRY_POINT_RENAME(utrans_openU)
+#define utrans_register U_ICU_ENTRY_POINT_RENAME(utrans_register)
+#define utrans_rep_caseContextIterator U_ICU_ENTRY_POINT_RENAME(utrans_rep_caseContextIterator)
+#define utrans_setFilter U_ICU_ENTRY_POINT_RENAME(utrans_setFilter)
+#define utrans_stripRules U_ICU_ENTRY_POINT_RENAME(utrans_stripRules)
+#define utrans_trans U_ICU_ENTRY_POINT_RENAME(utrans_trans)
+#define utrans_transIncremental U_ICU_ENTRY_POINT_RENAME(utrans_transIncremental)
+#define utrans_transIncrementalUChars U_ICU_ENTRY_POINT_RENAME(utrans_transIncrementalUChars)
+#define utrans_transUChars U_ICU_ENTRY_POINT_RENAME(utrans_transUChars)
+#define utrans_transliterator_cleanup U_ICU_ENTRY_POINT_RENAME(utrans_transliterator_cleanup)
+#define utrans_unregister U_ICU_ENTRY_POINT_RENAME(utrans_unregister)
+#define utrans_unregisterID U_ICU_ENTRY_POINT_RENAME(utrans_unregisterID)
+#define utrie2_clone U_ICU_ENTRY_POINT_RENAME(utrie2_clone)
+#define utrie2_cloneAsThawed U_ICU_ENTRY_POINT_RENAME(utrie2_cloneAsThawed)
+#define utrie2_close U_ICU_ENTRY_POINT_RENAME(utrie2_close)
+#define utrie2_enum U_ICU_ENTRY_POINT_RENAME(utrie2_enum)
+#define utrie2_enumForLeadSurrogate U_ICU_ENTRY_POINT_RENAME(utrie2_enumForLeadSurrogate)
+#define utrie2_freeze U_ICU_ENTRY_POINT_RENAME(utrie2_freeze)
+#define utrie2_fromUTrie U_ICU_ENTRY_POINT_RENAME(utrie2_fromUTrie)
+#define utrie2_get32 U_ICU_ENTRY_POINT_RENAME(utrie2_get32)
+#define utrie2_get32FromLeadSurrogateCodeUnit U_ICU_ENTRY_POINT_RENAME(utrie2_get32FromLeadSurrogateCodeUnit)
+#define utrie2_getVersion U_ICU_ENTRY_POINT_RENAME(utrie2_getVersion)
+#define utrie2_internalU8NextIndex U_ICU_ENTRY_POINT_RENAME(utrie2_internalU8NextIndex)
+#define utrie2_internalU8PrevIndex U_ICU_ENTRY_POINT_RENAME(utrie2_internalU8PrevIndex)
+#define utrie2_isFrozen U_ICU_ENTRY_POINT_RENAME(utrie2_isFrozen)
+#define utrie2_open U_ICU_ENTRY_POINT_RENAME(utrie2_open)
+#define utrie2_openDummy U_ICU_ENTRY_POINT_RENAME(utrie2_openDummy)
+#define utrie2_openFromSerialized U_ICU_ENTRY_POINT_RENAME(utrie2_openFromSerialized)
+#define utrie2_serialize U_ICU_ENTRY_POINT_RENAME(utrie2_serialize)
+#define utrie2_set32 U_ICU_ENTRY_POINT_RENAME(utrie2_set32)
+#define utrie2_set32ForLeadSurrogateCodeUnit U_ICU_ENTRY_POINT_RENAME(utrie2_set32ForLeadSurrogateCodeUnit)
+#define utrie2_setRange32 U_ICU_ENTRY_POINT_RENAME(utrie2_setRange32)
+#define utrie2_swap U_ICU_ENTRY_POINT_RENAME(utrie2_swap)
+#define utrie2_swapAnyVersion U_ICU_ENTRY_POINT_RENAME(utrie2_swapAnyVersion)
+#define utrie_clone U_ICU_ENTRY_POINT_RENAME(utrie_clone)
+#define utrie_close U_ICU_ENTRY_POINT_RENAME(utrie_close)
+#define utrie_defaultGetFoldingOffset U_ICU_ENTRY_POINT_RENAME(utrie_defaultGetFoldingOffset)
+#define utrie_enum U_ICU_ENTRY_POINT_RENAME(utrie_enum)
+#define utrie_get32 U_ICU_ENTRY_POINT_RENAME(utrie_get32)
+#define utrie_getData U_ICU_ENTRY_POINT_RENAME(utrie_getData)
+#define utrie_open U_ICU_ENTRY_POINT_RENAME(utrie_open)
+#define utrie_serialize U_ICU_ENTRY_POINT_RENAME(utrie_serialize)
+#define utrie_set32 U_ICU_ENTRY_POINT_RENAME(utrie_set32)
+#define utrie_setRange32 U_ICU_ENTRY_POINT_RENAME(utrie_setRange32)
+#define utrie_swap U_ICU_ENTRY_POINT_RENAME(utrie_swap)
+#define utrie_unserialize U_ICU_ENTRY_POINT_RENAME(utrie_unserialize)
+#define utrie_unserializeDummy U_ICU_ENTRY_POINT_RENAME(utrie_unserializeDummy)
+#define vzone_clone U_ICU_ENTRY_POINT_RENAME(vzone_clone)
+#define vzone_close U_ICU_ENTRY_POINT_RENAME(vzone_close)
+#define vzone_countTransitionRules U_ICU_ENTRY_POINT_RENAME(vzone_countTransitionRules)
+#define vzone_equals U_ICU_ENTRY_POINT_RENAME(vzone_equals)
+#define vzone_getDynamicClassID U_ICU_ENTRY_POINT_RENAME(vzone_getDynamicClassID)
+#define vzone_getLastModified U_ICU_ENTRY_POINT_RENAME(vzone_getLastModified)
+#define vzone_getNextTransition U_ICU_ENTRY_POINT_RENAME(vzone_getNextTransition)
+#define vzone_getOffset U_ICU_ENTRY_POINT_RENAME(vzone_getOffset)
+#define vzone_getOffset2 U_ICU_ENTRY_POINT_RENAME(vzone_getOffset2)
+#define vzone_getOffset3 U_ICU_ENTRY_POINT_RENAME(vzone_getOffset3)
+#define vzone_getPreviousTransition U_ICU_ENTRY_POINT_RENAME(vzone_getPreviousTransition)
+#define vzone_getRawOffset U_ICU_ENTRY_POINT_RENAME(vzone_getRawOffset)
+#define vzone_getStaticClassID U_ICU_ENTRY_POINT_RENAME(vzone_getStaticClassID)
+#define vzone_getTZURL U_ICU_ENTRY_POINT_RENAME(vzone_getTZURL)
+#define vzone_hasSameRules U_ICU_ENTRY_POINT_RENAME(vzone_hasSameRules)
+#define vzone_inDaylightTime U_ICU_ENTRY_POINT_RENAME(vzone_inDaylightTime)
+#define vzone_openData U_ICU_ENTRY_POINT_RENAME(vzone_openData)
+#define vzone_openID U_ICU_ENTRY_POINT_RENAME(vzone_openID)
+#define vzone_setLastModified U_ICU_ENTRY_POINT_RENAME(vzone_setLastModified)
+#define vzone_setRawOffset U_ICU_ENTRY_POINT_RENAME(vzone_setRawOffset)
+#define vzone_setTZURL U_ICU_ENTRY_POINT_RENAME(vzone_setTZURL)
+#define vzone_useDaylightTime U_ICU_ENTRY_POINT_RENAME(vzone_useDaylightTime)
+#define vzone_write U_ICU_ENTRY_POINT_RENAME(vzone_write)
+#define vzone_writeFromStart U_ICU_ENTRY_POINT_RENAME(vzone_writeFromStart)
+#define vzone_writeSimple U_ICU_ENTRY_POINT_RENAME(vzone_writeSimple)
+#define zrule_close U_ICU_ENTRY_POINT_RENAME(zrule_close)
+#define zrule_equals U_ICU_ENTRY_POINT_RENAME(zrule_equals)
+#define zrule_getDSTSavings U_ICU_ENTRY_POINT_RENAME(zrule_getDSTSavings)
+#define zrule_getName U_ICU_ENTRY_POINT_RENAME(zrule_getName)
+#define zrule_getRawOffset U_ICU_ENTRY_POINT_RENAME(zrule_getRawOffset)
+#define zrule_isEquivalentTo U_ICU_ENTRY_POINT_RENAME(zrule_isEquivalentTo)
+#define ztrans_adoptFrom U_ICU_ENTRY_POINT_RENAME(ztrans_adoptFrom)
+#define ztrans_adoptTo U_ICU_ENTRY_POINT_RENAME(ztrans_adoptTo)
+#define ztrans_clone U_ICU_ENTRY_POINT_RENAME(ztrans_clone)
+#define ztrans_close U_ICU_ENTRY_POINT_RENAME(ztrans_close)
+#define ztrans_equals U_ICU_ENTRY_POINT_RENAME(ztrans_equals)
+#define ztrans_getDynamicClassID U_ICU_ENTRY_POINT_RENAME(ztrans_getDynamicClassID)
+#define ztrans_getFrom U_ICU_ENTRY_POINT_RENAME(ztrans_getFrom)
+#define ztrans_getStaticClassID U_ICU_ENTRY_POINT_RENAME(ztrans_getStaticClassID)
+#define ztrans_getTime U_ICU_ENTRY_POINT_RENAME(ztrans_getTime)
+#define ztrans_getTo U_ICU_ENTRY_POINT_RENAME(ztrans_getTo)
+#define ztrans_open U_ICU_ENTRY_POINT_RENAME(ztrans_open)
+#define ztrans_openEmpty U_ICU_ENTRY_POINT_RENAME(ztrans_openEmpty)
+#define ztrans_setFrom U_ICU_ENTRY_POINT_RENAME(ztrans_setFrom)
+#define ztrans_setTime U_ICU_ENTRY_POINT_RENAME(ztrans_setTime)
+#define ztrans_setTo U_ICU_ENTRY_POINT_RENAME(ztrans_setTo)
+
+
/* C++ class names renaming defines */
#ifdef XP_CPLUSPLUS
#if !U_HAVE_NAMESPACE
-#define AbsoluteValueSubstitution AbsoluteValueSubstitution_3_2
-#define AlternateSubstitutionSubtable AlternateSubstitutionSubtable_3_2
-#define AnchorTable AnchorTable_3_2
-#define AnyTransliterator AnyTransliterator_3_2
-#define ArabicOpenTypeLayoutEngine ArabicOpenTypeLayoutEngine_3_2
-#define ArabicShaping ArabicShaping_3_2
-#define BasicCalendarFactory BasicCalendarFactory_3_2
-#define BinarySearchLookupTable BinarySearchLookupTable_3_2
-#define BreakDictionary BreakDictionary_3_2
-#define BreakIterator BreakIterator_3_2
-#define BuddhistCalendar BuddhistCalendar_3_2
-#define CFactory CFactory_3_2
-#define Calendar Calendar_3_2
-#define CalendarAstronomer CalendarAstronomer_3_2
-#define CalendarCache CalendarCache_3_2
-#define CalendarData CalendarData_3_2
-#define CalendarService CalendarService_3_2
-#define CanonShaping CanonShaping_3_2
-#define CanonicalIterator CanonicalIterator_3_2
-#define CaseMapTransliterator CaseMapTransliterator_3_2
-#define ChainingContextualSubstitutionFormat1Subtable ChainingContextualSubstitutionFormat1Subtable_3_2
-#define ChainingContextualSubstitutionFormat2Subtable ChainingContextualSubstitutionFormat2Subtable_3_2
-#define ChainingContextualSubstitutionFormat3Subtable ChainingContextualSubstitutionFormat3Subtable_3_2
-#define ChainingContextualSubstitutionSubtable ChainingContextualSubstitutionSubtable_3_2
-#define CharSubstitutionFilter CharSubstitutionFilter_3_2
-#define CharacterIterator CharacterIterator_3_2
-#define ChoiceFormat ChoiceFormat_3_2
-#define ClassDefFormat1Table ClassDefFormat1Table_3_2
-#define ClassDefFormat2Table ClassDefFormat2Table_3_2
-#define ClassDefinitionTable ClassDefinitionTable_3_2
-#define CollationElementIterator CollationElementIterator_3_2
-#define CollationKey CollationKey_3_2
-#define Collator Collator_3_2
-#define CollatorFactory CollatorFactory_3_2
-#define CompoundTransliterator CompoundTransliterator_3_2
-#define ContextualGlyphSubstitutionProcessor ContextualGlyphSubstitutionProcessor_3_2
-#define ContextualSubstitutionBase ContextualSubstitutionBase_3_2
-#define ContextualSubstitutionFormat1Subtable ContextualSubstitutionFormat1Subtable_3_2
-#define ContextualSubstitutionFormat2Subtable ContextualSubstitutionFormat2Subtable_3_2
-#define ContextualSubstitutionFormat3Subtable ContextualSubstitutionFormat3Subtable_3_2
-#define ContextualSubstitutionSubtable ContextualSubstitutionSubtable_3_2
-#define CoverageFormat1Table CoverageFormat1Table_3_2
-#define CoverageFormat2Table CoverageFormat2Table_3_2
-#define CoverageTable CoverageTable_3_2
-#define CurrencyAmount CurrencyAmount_3_2
-#define CurrencyFormat CurrencyFormat_3_2
-#define CurrencyUnit CurrencyUnit_3_2
-#define CursiveAttachmentSubtable CursiveAttachmentSubtable_3_2
-#define DateFormat DateFormat_3_2
-#define DateFormatSymbols DateFormatSymbols_3_2
-#define DecimalFormat DecimalFormat_3_2
-#define DecimalFormatSymbols DecimalFormatSymbols_3_2
-#define DefaultCalendarFactory DefaultCalendarFactory_3_2
-#define DefaultCharMapper DefaultCharMapper_3_2
-#define DeviceTable DeviceTable_3_2
-#define DictionaryBasedBreakIterator DictionaryBasedBreakIterator_3_2
-#define DictionaryBasedBreakIteratorTables DictionaryBasedBreakIteratorTables_3_2
-#define DigitList DigitList_3_2
-#define Entry Entry_3_2
-#define EnumToOffset EnumToOffset_3_2
-#define EscapeTransliterator EscapeTransliterator_3_2
-#define EventListener EventListener_3_2
-#define ExtensionSubtable ExtensionSubtable_3_2
-#define FeatureListTable FeatureListTable_3_2
-#define FieldPosition FieldPosition_3_2
-#define FontRuns FontRuns_3_2
-#define Format Format_3_2
-#define Format1AnchorTable Format1AnchorTable_3_2
-#define Format2AnchorTable Format2AnchorTable_3_2
-#define Format3AnchorTable Format3AnchorTable_3_2
-#define Formattable Formattable_3_2
-#define ForwardCharacterIterator ForwardCharacterIterator_3_2
-#define FractionalPartSubstitution FractionalPartSubstitution_3_2
-#define FunctionReplacer FunctionReplacer_3_2
-#define GDEFMarkFilter GDEFMarkFilter_3_2
-#define GXLayoutEngine GXLayoutEngine_3_2
-#define GlyphDefinitionTableHeader GlyphDefinitionTableHeader_3_2
-#define GlyphIterator GlyphIterator_3_2
-#define GlyphLookupTableHeader GlyphLookupTableHeader_3_2
-#define GlyphPositioningLookupProcessor GlyphPositioningLookupProcessor_3_2
-#define GlyphPositioningTableHeader GlyphPositioningTableHeader_3_2
-#define GlyphSubstitutionLookupProcessor GlyphSubstitutionLookupProcessor_3_2
-#define GlyphSubstitutionTableHeader GlyphSubstitutionTableHeader_3_2
-#define Grego Grego_3_2
-#define GregorianCalendar GregorianCalendar_3_2
-#define HanOpenTypeLayoutEngine HanOpenTypeLayoutEngine_3_2
-#define HebrewCalendar HebrewCalendar_3_2
-#define ICUBreakIteratorFactory ICUBreakIteratorFactory_3_2
-#define ICUBreakIteratorService ICUBreakIteratorService_3_2
-#define ICUCollatorFactory ICUCollatorFactory_3_2
-#define ICUCollatorService ICUCollatorService_3_2
-#define ICULayoutEngine ICULayoutEngine_3_2
-#define ICULocaleService ICULocaleService_3_2
-#define ICUNotifier ICUNotifier_3_2
-#define ICUNumberFormatFactory ICUNumberFormatFactory_3_2
-#define ICUNumberFormatService ICUNumberFormatService_3_2
-#define ICUResourceBundleFactory ICUResourceBundleFactory_3_2
-#define ICUService ICUService_3_2
-#define ICUServiceFactory ICUServiceFactory_3_2
-#define ICUServiceKey ICUServiceKey_3_2
-#define ICU_Utility ICU_Utility_3_2
-#define IndicClassTable IndicClassTable_3_2
-#define IndicOpenTypeLayoutEngine IndicOpenTypeLayoutEngine_3_2
-#define IndicRearrangementProcessor IndicRearrangementProcessor_3_2
-#define IndicReordering IndicReordering_3_2
-#define IntegralPartSubstitution IntegralPartSubstitution_3_2
-#define IslamicCalendar IslamicCalendar_3_2
-#define JapaneseCalendar JapaneseCalendar_3_2
-#define KeywordEnumeration KeywordEnumeration_3_2
-#define LECharMapper LECharMapper_3_2
-#define LEFontInstance LEFontInstance_3_2
-#define LEGlyphFilter LEGlyphFilter_3_2
-#define LEGlyphStorage LEGlyphStorage_3_2
-#define LEInsertionCallback LEInsertionCallback_3_2
-#define LEInsertionList LEInsertionList_3_2
-#define LXUtilities LXUtilities_3_2
-#define LayoutEngine LayoutEngine_3_2
-#define LigatureSubstitutionProcessor LigatureSubstitutionProcessor_3_2
-#define LigatureSubstitutionSubtable LigatureSubstitutionSubtable_3_2
-#define LocDataParser LocDataParser_3_2
-#define Locale Locale_3_2
-#define LocaleBased LocaleBased_3_2
-#define LocaleKey LocaleKey_3_2
-#define LocaleKeyFactory LocaleKeyFactory_3_2
-#define LocaleRuns LocaleRuns_3_2
-#define LocaleUtility LocaleUtility_3_2
-#define LocalizationInfo LocalizationInfo_3_2
-#define LookupListTable LookupListTable_3_2
-#define LookupProcessor LookupProcessor_3_2
-#define LookupSubtable LookupSubtable_3_2
-#define LookupTable LookupTable_3_2
-#define LowercaseTransliterator LowercaseTransliterator_3_2
-#define MPreFixups MPreFixups_3_2
-#define MarkArray MarkArray_3_2
-#define MarkToBasePositioningSubtable MarkToBasePositioningSubtable_3_2
-#define MarkToLigaturePositioningSubtable MarkToLigaturePositioningSubtable_3_2
-#define MarkToMarkPositioningSubtable MarkToMarkPositioningSubtable_3_2
-#define Math Math_3_2
-#define Measure Measure_3_2
-#define MeasureFormat MeasureFormat_3_2
-#define MeasureUnit MeasureUnit_3_2
-#define MessageFormat MessageFormat_3_2
-#define MessageFormatAdapter MessageFormatAdapter_3_2
-#define ModulusSubstitution ModulusSubstitution_3_2
-#define MoonRiseSetCoordFunc MoonRiseSetCoordFunc_3_2
-#define MoonTimeAngleFunc MoonTimeAngleFunc_3_2
-#define MorphSubtableHeader MorphSubtableHeader_3_2
-#define MorphTableHeader MorphTableHeader_3_2
-#define MultipleSubstitutionSubtable MultipleSubstitutionSubtable_3_2
-#define MultiplierSubstitution MultiplierSubstitution_3_2
-#define NFFactory NFFactory_3_2
-#define NFRule NFRule_3_2
-#define NFRuleSet NFRuleSet_3_2
-#define NFSubstitution NFSubstitution_3_2
-#define NameToEnum NameToEnum_3_2
-#define NameUnicodeTransliterator NameUnicodeTransliterator_3_2
-#define NonContextualGlyphSubstitutionProcessor NonContextualGlyphSubstitutionProcessor_3_2
-#define NonContiguousEnumToOffset NonContiguousEnumToOffset_3_2
-#define NormalizationTransliterator NormalizationTransliterator_3_2
-#define Normalizer Normalizer_3_2
-#define NullSubstitution NullSubstitution_3_2
-#define NullTransliterator NullTransliterator_3_2
-#define NumberFormat NumberFormat_3_2
-#define NumberFormatFactory NumberFormatFactory_3_2
-#define NumeratorSubstitution NumeratorSubstitution_3_2
-#define OlsonTimeZone OlsonTimeZone_3_2
-#define OpenTypeLayoutEngine OpenTypeLayoutEngine_3_2
-#define OpenTypeUtilities OpenTypeUtilities_3_2
-#define PairPositioningFormat1Subtable PairPositioningFormat1Subtable_3_2
-#define PairPositioningFormat2Subtable PairPositioningFormat2Subtable_3_2
-#define PairPositioningSubtable PairPositioningSubtable_3_2
-#define ParagraphLayout ParagraphLayout_3_2
-#define ParseData ParseData_3_2
-#define ParsePosition ParsePosition_3_2
-#define PropertyAliases PropertyAliases_3_2
-#define Quantifier Quantifier_3_2
-#define RBBIDataWrapper RBBIDataWrapper_3_2
-#define RBBINode RBBINode_3_2
-#define RBBIRuleBuilder RBBIRuleBuilder_3_2
-#define RBBIRuleScanner RBBIRuleScanner_3_2
-#define RBBISetBuilder RBBISetBuilder_3_2
-#define RBBIStateDescriptor RBBIStateDescriptor_3_2
-#define RBBISymbolTable RBBISymbolTable_3_2
-#define RBBISymbolTableEntry RBBISymbolTableEntry_3_2
-#define RBBITableBuilder RBBITableBuilder_3_2
-#define RangeDescriptor RangeDescriptor_3_2
-#define RegexCompile RegexCompile_3_2
-#define RegexMatcher RegexMatcher_3_2
-#define RegexPattern RegexPattern_3_2
-#define RegexStaticSets RegexStaticSets_3_2
-#define RemoveTransliterator RemoveTransliterator_3_2
-#define Replaceable Replaceable_3_2
-#define ReplaceableGlue ReplaceableGlue_3_2
-#define ResourceBundle ResourceBundle_3_2
-#define RiseSetCoordFunc RiseSetCoordFunc_3_2
-#define RuleBasedBreakIterator RuleBasedBreakIterator_3_2
-#define RuleBasedCollator RuleBasedCollator_3_2
-#define RuleBasedNumberFormat RuleBasedNumberFormat_3_2
-#define RuleBasedTransliterator RuleBasedTransliterator_3_2
-#define RuleCharacterIterator RuleCharacterIterator_3_2
-#define RuleHalf RuleHalf_3_2
-#define RunArray RunArray_3_2
-#define SameValueSubstitution SameValueSubstitution_3_2
-#define ScriptListTable ScriptListTable_3_2
-#define ScriptRunIterator ScriptRunIterator_3_2
-#define ScriptTable ScriptTable_3_2
-#define SearchIterator SearchIterator_3_2
-#define SegmentArrayProcessor SegmentArrayProcessor_3_2
-#define SegmentSingleProcessor SegmentSingleProcessor_3_2
-#define ServiceEnumeration ServiceEnumeration_3_2
-#define ServiceListener ServiceListener_3_2
-#define SimpleArrayProcessor SimpleArrayProcessor_3_2
-#define SimpleDateFormat SimpleDateFormat_3_2
-#define SimpleFactory SimpleFactory_3_2
-#define SimpleLocaleKeyFactory SimpleLocaleKeyFactory_3_2
-#define SimpleNumberFormatFactory SimpleNumberFormatFactory_3_2
-#define SimpleTimeZone SimpleTimeZone_3_2
-#define SinglePositioningFormat1Subtable SinglePositioningFormat1Subtable_3_2
-#define SinglePositioningFormat2Subtable SinglePositioningFormat2Subtable_3_2
-#define SinglePositioningSubtable SinglePositioningSubtable_3_2
-#define SingleSubstitutionFormat1Subtable SingleSubstitutionFormat1Subtable_3_2
-#define SingleSubstitutionFormat2Subtable SingleSubstitutionFormat2Subtable_3_2
-#define SingleSubstitutionSubtable SingleSubstitutionSubtable_3_2
-#define SingleTableProcessor SingleTableProcessor_3_2
-#define Spec Spec_3_2
-#define StateTableProcessor StateTableProcessor_3_2
-#define StringCharacterIterator StringCharacterIterator_3_2
-#define StringEnumeration StringEnumeration_3_2
-#define StringLocalizationInfo StringLocalizationInfo_3_2
-#define StringMatcher StringMatcher_3_2
-#define StringPair StringPair_3_2
-#define StringReplacer StringReplacer_3_2
-#define StringSearch StringSearch_3_2
-#define StyleRuns StyleRuns_3_2
-#define SubstitutionLookup SubstitutionLookup_3_2
-#define SubtableProcessor SubtableProcessor_3_2
-#define SunTimeAngleFunc SunTimeAngleFunc_3_2
-#define SymbolTable SymbolTable_3_2
-#define TZEnumeration TZEnumeration_3_2
-#define ThaiLayoutEngine ThaiLayoutEngine_3_2
-#define ThaiShaping ThaiShaping_3_2
-#define TimeZone TimeZone_3_2
-#define TitlecaseTransliterator TitlecaseTransliterator_3_2
-#define TransliterationRule TransliterationRule_3_2
-#define TransliterationRuleData TransliterationRuleData_3_2
-#define TransliterationRuleSet TransliterationRuleSet_3_2
-#define Transliterator Transliterator_3_2
-#define TransliteratorAlias TransliteratorAlias_3_2
-#define TransliteratorIDParser TransliteratorIDParser_3_2
-#define TransliteratorParser TransliteratorParser_3_2
-#define TransliteratorRegistry TransliteratorRegistry_3_2
-#define TrimmedArrayProcessor TrimmedArrayProcessor_3_2
-#define UCharCharacterIterator UCharCharacterIterator_3_2
-#define UMemory UMemory_3_2
-#define UObject UObject_3_2
-#define UStack UStack_3_2
-#define UStringEnumeration UStringEnumeration_3_2
-#define UVector UVector_3_2
-#define UVector32 UVector32_3_2
-#define UnescapeTransliterator UnescapeTransliterator_3_2
-#define UnicodeArabicOpenTypeLayoutEngine UnicodeArabicOpenTypeLayoutEngine_3_2
-#define UnicodeFilter UnicodeFilter_3_2
-#define UnicodeFunctor UnicodeFunctor_3_2
-#define UnicodeMatcher UnicodeMatcher_3_2
-#define UnicodeNameTransliterator UnicodeNameTransliterator_3_2
-#define UnicodeReplacer UnicodeReplacer_3_2
-#define UnicodeSet UnicodeSet_3_2
-#define UnicodeSetIterator UnicodeSetIterator_3_2
-#define UnicodeString UnicodeString_3_2
-#define UppercaseTransliterator UppercaseTransliterator_3_2
-#define ValueRecord ValueRecord_3_2
-#define ValueRuns ValueRuns_3_2
-#define locale_set_default_internal locale_set_default_internal_3_2
-#define uprv_parseCurrency uprv_parseCurrency_3_2
-#define util64_fromDouble util64_fromDouble_3_2
-#define util64_pow util64_pow_3_2
-#define util64_tou util64_tou_3_2
-#define util64_utoi util64_utoi_3_2
+#define AbsoluteValueSubstitution U_ICU_ENTRY_POINT_RENAME(AbsoluteValueSubstitution)
+#define AlternateSubstitutionSubtable U_ICU_ENTRY_POINT_RENAME(AlternateSubstitutionSubtable)
+#define AnchorTable U_ICU_ENTRY_POINT_RENAME(AnchorTable)
+#define AndConstraint U_ICU_ENTRY_POINT_RENAME(AndConstraint)
+#define AnnualTimeZoneRule U_ICU_ENTRY_POINT_RENAME(AnnualTimeZoneRule)
+#define AnyTransliterator U_ICU_ENTRY_POINT_RENAME(AnyTransliterator)
+#define ArabicOpenTypeLayoutEngine U_ICU_ENTRY_POINT_RENAME(ArabicOpenTypeLayoutEngine)
+#define ArabicShaping U_ICU_ENTRY_POINT_RENAME(ArabicShaping)
+#define ArgExtractor U_ICU_ENTRY_POINT_RENAME(ArgExtractor)
+#define BMPSet U_ICU_ENTRY_POINT_RENAME(BMPSet)
+#define BackwardUTrie2StringIterator U_ICU_ENTRY_POINT_RENAME(BackwardUTrie2StringIterator)
+#define BadCharacterTable U_ICU_ENTRY_POINT_RENAME(BadCharacterTable)
+#define BasicCalendarFactory U_ICU_ENTRY_POINT_RENAME(BasicCalendarFactory)
+#define BasicTimeZone U_ICU_ENTRY_POINT_RENAME(BasicTimeZone)
+#define BinarySearchLookupTable U_ICU_ENTRY_POINT_RENAME(BinarySearchLookupTable)
+#define BoyerMooreSearch U_ICU_ENTRY_POINT_RENAME(BoyerMooreSearch)
+#define BreakIterator U_ICU_ENTRY_POINT_RENAME(BreakIterator)
+#define BreakTransliterator U_ICU_ENTRY_POINT_RENAME(BreakTransliterator)
+#define BuddhistCalendar U_ICU_ENTRY_POINT_RENAME(BuddhistCalendar)
+#define BuildCompactTrieHorizontalNode U_ICU_ENTRY_POINT_RENAME(BuildCompactTrieHorizontalNode)
+#define BuildCompactTrieNode U_ICU_ENTRY_POINT_RENAME(BuildCompactTrieNode)
+#define BuildCompactTrieVerticalNode U_ICU_ENTRY_POINT_RENAME(BuildCompactTrieVerticalNode)
+#define BuilderScriptSet U_ICU_ENTRY_POINT_RENAME(BuilderScriptSet)
+#define ByteSink U_ICU_ENTRY_POINT_RENAME(ByteSink)
+#define CEBuffer U_ICU_ENTRY_POINT_RENAME(CEBuffer)
+#define CECalendar U_ICU_ENTRY_POINT_RENAME(CECalendar)
+#define CEList U_ICU_ENTRY_POINT_RENAME(CEList)
+#define CEToStringsMap U_ICU_ENTRY_POINT_RENAME(CEToStringsMap)
+#define CFactory U_ICU_ENTRY_POINT_RENAME(CFactory)
+#define Calendar U_ICU_ENTRY_POINT_RENAME(Calendar)
+#define CalendarAstronomer U_ICU_ENTRY_POINT_RENAME(CalendarAstronomer)
+#define CalendarCache U_ICU_ENTRY_POINT_RENAME(CalendarCache)
+#define CalendarData U_ICU_ENTRY_POINT_RENAME(CalendarData)
+#define CalendarService U_ICU_ENTRY_POINT_RENAME(CalendarService)
+#define CanonIterData U_ICU_ENTRY_POINT_RENAME(CanonIterData)
+#define CanonIterDataSingleton U_ICU_ENTRY_POINT_RENAME(CanonIterDataSingleton)
+#define CanonMarkFilter U_ICU_ENTRY_POINT_RENAME(CanonMarkFilter)
+#define CanonShaping U_ICU_ENTRY_POINT_RENAME(CanonShaping)
+#define CanonicalIterator U_ICU_ENTRY_POINT_RENAME(CanonicalIterator)
+#define CaseMapTransliterator U_ICU_ENTRY_POINT_RENAME(CaseMapTransliterator)
+#define ChainingContextualSubstitutionFormat1Subtable U_ICU_ENTRY_POINT_RENAME(ChainingContextualSubstitutionFormat1Subtable)
+#define ChainingContextualSubstitutionFormat2Subtable U_ICU_ENTRY_POINT_RENAME(ChainingContextualSubstitutionFormat2Subtable)
+#define ChainingContextualSubstitutionFormat3Subtable U_ICU_ENTRY_POINT_RENAME(ChainingContextualSubstitutionFormat3Subtable)
+#define ChainingContextualSubstitutionSubtable U_ICU_ENTRY_POINT_RENAME(ChainingContextualSubstitutionSubtable)
+#define CharString U_ICU_ENTRY_POINT_RENAME(CharString)
+#define CharSubstitutionFilter U_ICU_ENTRY_POINT_RENAME(CharSubstitutionFilter)
+#define CharacterIterator U_ICU_ENTRY_POINT_RENAME(CharacterIterator)
+#define CharacterNode U_ICU_ENTRY_POINT_RENAME(CharacterNode)
+#define CharsetDetector U_ICU_ENTRY_POINT_RENAME(CharsetDetector)
+#define CharsetMatch U_ICU_ENTRY_POINT_RENAME(CharsetMatch)
+#define CharsetRecog_2022 U_ICU_ENTRY_POINT_RENAME(CharsetRecog_2022)
+#define CharsetRecog_2022CN U_ICU_ENTRY_POINT_RENAME(CharsetRecog_2022CN)
+#define CharsetRecog_2022JP U_ICU_ENTRY_POINT_RENAME(CharsetRecog_2022JP)
+#define CharsetRecog_2022KR U_ICU_ENTRY_POINT_RENAME(CharsetRecog_2022KR)
+#define CharsetRecog_8859_1 U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_1)
+#define CharsetRecog_8859_1_da U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_1_da)
+#define CharsetRecog_8859_1_de U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_1_de)
+#define CharsetRecog_8859_1_en U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_1_en)
+#define CharsetRecog_8859_1_es U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_1_es)
+#define CharsetRecog_8859_1_fr U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_1_fr)
+#define CharsetRecog_8859_1_it U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_1_it)
+#define CharsetRecog_8859_1_nl U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_1_nl)
+#define CharsetRecog_8859_1_no U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_1_no)
+#define CharsetRecog_8859_1_pt U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_1_pt)
+#define CharsetRecog_8859_1_sv U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_1_sv)
+#define CharsetRecog_8859_2 U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_2)
+#define CharsetRecog_8859_2_cs U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_2_cs)
+#define CharsetRecog_8859_2_hu U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_2_hu)
+#define CharsetRecog_8859_2_pl U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_2_pl)
+#define CharsetRecog_8859_2_ro U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_2_ro)
+#define CharsetRecog_8859_5 U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_5)
+#define CharsetRecog_8859_5_ru U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_5_ru)
+#define CharsetRecog_8859_6 U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_6)
+#define CharsetRecog_8859_6_ar U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_6_ar)
+#define CharsetRecog_8859_7 U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_7)
+#define CharsetRecog_8859_7_el U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_7_el)
+#define CharsetRecog_8859_8 U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_8)
+#define CharsetRecog_8859_8_I_he U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_8_I_he)
+#define CharsetRecog_8859_8_he U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_8_he)
+#define CharsetRecog_8859_9 U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_9)
+#define CharsetRecog_8859_9_tr U_ICU_ENTRY_POINT_RENAME(CharsetRecog_8859_9_tr)
+#define CharsetRecog_IBM420_ar U_ICU_ENTRY_POINT_RENAME(CharsetRecog_IBM420_ar)
+#define CharsetRecog_IBM420_ar_ltr U_ICU_ENTRY_POINT_RENAME(CharsetRecog_IBM420_ar_ltr)
+#define CharsetRecog_IBM420_ar_rtl U_ICU_ENTRY_POINT_RENAME(CharsetRecog_IBM420_ar_rtl)
+#define CharsetRecog_IBM424_he U_ICU_ENTRY_POINT_RENAME(CharsetRecog_IBM424_he)
+#define CharsetRecog_IBM424_he_ltr U_ICU_ENTRY_POINT_RENAME(CharsetRecog_IBM424_he_ltr)
+#define CharsetRecog_IBM424_he_rtl U_ICU_ENTRY_POINT_RENAME(CharsetRecog_IBM424_he_rtl)
+#define CharsetRecog_KOI8_R U_ICU_ENTRY_POINT_RENAME(CharsetRecog_KOI8_R)
+#define CharsetRecog_UTF8 U_ICU_ENTRY_POINT_RENAME(CharsetRecog_UTF8)
+#define CharsetRecog_UTF_16_BE U_ICU_ENTRY_POINT_RENAME(CharsetRecog_UTF_16_BE)
+#define CharsetRecog_UTF_16_LE U_ICU_ENTRY_POINT_RENAME(CharsetRecog_UTF_16_LE)
+#define CharsetRecog_UTF_32 U_ICU_ENTRY_POINT_RENAME(CharsetRecog_UTF_32)
+#define CharsetRecog_UTF_32_BE U_ICU_ENTRY_POINT_RENAME(CharsetRecog_UTF_32_BE)
+#define CharsetRecog_UTF_32_LE U_ICU_ENTRY_POINT_RENAME(CharsetRecog_UTF_32_LE)
+#define CharsetRecog_Unicode U_ICU_ENTRY_POINT_RENAME(CharsetRecog_Unicode)
+#define CharsetRecog_big5 U_ICU_ENTRY_POINT_RENAME(CharsetRecog_big5)
+#define CharsetRecog_euc U_ICU_ENTRY_POINT_RENAME(CharsetRecog_euc)
+#define CharsetRecog_euc_jp U_ICU_ENTRY_POINT_RENAME(CharsetRecog_euc_jp)
+#define CharsetRecog_euc_kr U_ICU_ENTRY_POINT_RENAME(CharsetRecog_euc_kr)
+#define CharsetRecog_gb_18030 U_ICU_ENTRY_POINT_RENAME(CharsetRecog_gb_18030)
+#define CharsetRecog_mbcs U_ICU_ENTRY_POINT_RENAME(CharsetRecog_mbcs)
+#define CharsetRecog_sbcs U_ICU_ENTRY_POINT_RENAME(CharsetRecog_sbcs)
+#define CharsetRecog_sjis U_ICU_ENTRY_POINT_RENAME(CharsetRecog_sjis)
+#define CharsetRecog_windows_1251 U_ICU_ENTRY_POINT_RENAME(CharsetRecog_windows_1251)
+#define CharsetRecog_windows_1256 U_ICU_ENTRY_POINT_RENAME(CharsetRecog_windows_1256)
+#define CharsetRecognizer U_ICU_ENTRY_POINT_RENAME(CharsetRecognizer)
+#define CheckedArrayByteSink U_ICU_ENTRY_POINT_RENAME(CheckedArrayByteSink)
+#define ChineseCalendar U_ICU_ENTRY_POINT_RENAME(ChineseCalendar)
+#define ChoiceFormat U_ICU_ENTRY_POINT_RENAME(ChoiceFormat)
+#define ClassDefFormat1Table U_ICU_ENTRY_POINT_RENAME(ClassDefFormat1Table)
+#define ClassDefFormat2Table U_ICU_ENTRY_POINT_RENAME(ClassDefFormat2Table)
+#define ClassDefinitionTable U_ICU_ENTRY_POINT_RENAME(ClassDefinitionTable)
+#define ClockMath U_ICU_ENTRY_POINT_RENAME(ClockMath)
+#define CollData U_ICU_ENTRY_POINT_RENAME(CollData)
+#define CollDataCache U_ICU_ENTRY_POINT_RENAME(CollDataCache)
+#define CollDataCacheEntry U_ICU_ENTRY_POINT_RENAME(CollDataCacheEntry)
+#define CollationElementIterator U_ICU_ENTRY_POINT_RENAME(CollationElementIterator)
+#define CollationKey U_ICU_ENTRY_POINT_RENAME(CollationKey)
+#define CollationLocaleListEnumeration U_ICU_ENTRY_POINT_RENAME(CollationLocaleListEnumeration)
+#define Collator U_ICU_ENTRY_POINT_RENAME(Collator)
+#define CollatorFactory U_ICU_ENTRY_POINT_RENAME(CollatorFactory)
+#define CompactTrieDictionary U_ICU_ENTRY_POINT_RENAME(CompactTrieDictionary)
+#define CompactTrieEnumeration U_ICU_ENTRY_POINT_RENAME(CompactTrieEnumeration)
+#define ComposeNormalizer2 U_ICU_ENTRY_POINT_RENAME(ComposeNormalizer2)
+#define CompoundTransliterator U_ICU_ENTRY_POINT_RENAME(CompoundTransliterator)
+#define ConfusabledataBuilder U_ICU_ENTRY_POINT_RENAME(ConfusabledataBuilder)
+#define ContextualGlyphSubstitutionProcessor U_ICU_ENTRY_POINT_RENAME(ContextualGlyphSubstitutionProcessor)
+#define ContextualSubstitutionBase U_ICU_ENTRY_POINT_RENAME(ContextualSubstitutionBase)
+#define ContextualSubstitutionFormat1Subtable U_ICU_ENTRY_POINT_RENAME(ContextualSubstitutionFormat1Subtable)
+#define ContextualSubstitutionFormat2Subtable U_ICU_ENTRY_POINT_RENAME(ContextualSubstitutionFormat2Subtable)
+#define ContextualSubstitutionFormat3Subtable U_ICU_ENTRY_POINT_RENAME(ContextualSubstitutionFormat3Subtable)
+#define ContextualSubstitutionSubtable U_ICU_ENTRY_POINT_RENAME(ContextualSubstitutionSubtable)
+#define CopticCalendar U_ICU_ENTRY_POINT_RENAME(CopticCalendar)
+#define CoverageFormat1Table U_ICU_ENTRY_POINT_RENAME(CoverageFormat1Table)
+#define CoverageFormat2Table U_ICU_ENTRY_POINT_RENAME(CoverageFormat2Table)
+#define CoverageTable U_ICU_ENTRY_POINT_RENAME(CoverageTable)
+#define CurrencyAmount U_ICU_ENTRY_POINT_RENAME(CurrencyAmount)
+#define CurrencyFormat U_ICU_ENTRY_POINT_RENAME(CurrencyFormat)
+#define CurrencyPluralInfo U_ICU_ENTRY_POINT_RENAME(CurrencyPluralInfo)
+#define CurrencyUnit U_ICU_ENTRY_POINT_RENAME(CurrencyUnit)
+#define CursiveAttachmentSubtable U_ICU_ENTRY_POINT_RENAME(CursiveAttachmentSubtable)
+#define DTRedundantEnumeration U_ICU_ENTRY_POINT_RENAME(DTRedundantEnumeration)
+#define DTSkeletonEnumeration U_ICU_ENTRY_POINT_RENAME(DTSkeletonEnumeration)
+#define DateFormat U_ICU_ENTRY_POINT_RENAME(DateFormat)
+#define DateFormatSymbols U_ICU_ENTRY_POINT_RENAME(DateFormatSymbols)
+#define DateInterval U_ICU_ENTRY_POINT_RENAME(DateInterval)
+#define DateIntervalFormat U_ICU_ENTRY_POINT_RENAME(DateIntervalFormat)
+#define DateIntervalInfo U_ICU_ENTRY_POINT_RENAME(DateIntervalInfo)
+#define DateTimeMatcher U_ICU_ENTRY_POINT_RENAME(DateTimeMatcher)
+#define DateTimePatternGenerator U_ICU_ENTRY_POINT_RENAME(DateTimePatternGenerator)
+#define DateTimeRule U_ICU_ENTRY_POINT_RENAME(DateTimeRule)
+#define DecimalFormat U_ICU_ENTRY_POINT_RENAME(DecimalFormat)
+#define DecimalFormatSymbols U_ICU_ENTRY_POINT_RENAME(DecimalFormatSymbols)
+#define DecomposeNormalizer2 U_ICU_ENTRY_POINT_RENAME(DecomposeNormalizer2)
+#define DefaultCalendarFactory U_ICU_ENTRY_POINT_RENAME(DefaultCalendarFactory)
+#define DefaultCharMapper U_ICU_ENTRY_POINT_RENAME(DefaultCharMapper)
+#define DeviceTable U_ICU_ENTRY_POINT_RENAME(DeviceTable)
+#define DictionaryBreakEngine U_ICU_ENTRY_POINT_RENAME(DictionaryBreakEngine)
+#define DigitList U_ICU_ENTRY_POINT_RENAME(DigitList)
+#define DistanceInfo U_ICU_ENTRY_POINT_RENAME(DistanceInfo)
+#define EnumToOffset U_ICU_ENTRY_POINT_RENAME(EnumToOffset)
+#define ErrorCode U_ICU_ENTRY_POINT_RENAME(ErrorCode)
+#define EscapeTransliterator U_ICU_ENTRY_POINT_RENAME(EscapeTransliterator)
+#define EthiopicCalendar U_ICU_ENTRY_POINT_RENAME(EthiopicCalendar)
+#define EventListener U_ICU_ENTRY_POINT_RENAME(EventListener)
+#define ExtensionSubtable U_ICU_ENTRY_POINT_RENAME(ExtensionSubtable)
+#define FCDNormalizer2 U_ICU_ENTRY_POINT_RENAME(FCDNormalizer2)
+#define FCDTrieSingleton U_ICU_ENTRY_POINT_RENAME(FCDTrieSingleton)
+#define FeatureListTable U_ICU_ENTRY_POINT_RENAME(FeatureListTable)
+#define FieldPosition U_ICU_ENTRY_POINT_RENAME(FieldPosition)
+#define FieldPositionHandler U_ICU_ENTRY_POINT_RENAME(FieldPositionHandler)
+#define FieldPositionIterator U_ICU_ENTRY_POINT_RENAME(FieldPositionIterator)
+#define FieldPositionIteratorHandler U_ICU_ENTRY_POINT_RENAME(FieldPositionIteratorHandler)
+#define FieldPositionOnlyHandler U_ICU_ENTRY_POINT_RENAME(FieldPositionOnlyHandler)
+#define FilteredNormalizer2 U_ICU_ENTRY_POINT_RENAME(FilteredNormalizer2)
+#define FontRuns U_ICU_ENTRY_POINT_RENAME(FontRuns)
+#define Format U_ICU_ENTRY_POINT_RENAME(Format)
+#define Format1AnchorTable U_ICU_ENTRY_POINT_RENAME(Format1AnchorTable)
+#define Format2AnchorTable U_ICU_ENTRY_POINT_RENAME(Format2AnchorTable)
+#define Format3AnchorTable U_ICU_ENTRY_POINT_RENAME(Format3AnchorTable)
+#define FormatNameEnumeration U_ICU_ENTRY_POINT_RENAME(FormatNameEnumeration)
+#define FormatParser U_ICU_ENTRY_POINT_RENAME(FormatParser)
+#define Formattable U_ICU_ENTRY_POINT_RENAME(Formattable)
+#define ForwardCharacterIterator U_ICU_ENTRY_POINT_RENAME(ForwardCharacterIterator)
+#define ForwardUTrie2StringIterator U_ICU_ENTRY_POINT_RENAME(ForwardUTrie2StringIterator)
+#define FractionalPartSubstitution U_ICU_ENTRY_POINT_RENAME(FractionalPartSubstitution)
+#define FunctionReplacer U_ICU_ENTRY_POINT_RENAME(FunctionReplacer)
+#define GDEFMarkFilter U_ICU_ENTRY_POINT_RENAME(GDEFMarkFilter)
+#define GXLayoutEngine U_ICU_ENTRY_POINT_RENAME(GXLayoutEngine)
+#define GlyphDefinitionTableHeader U_ICU_ENTRY_POINT_RENAME(GlyphDefinitionTableHeader)
+#define GlyphIterator U_ICU_ENTRY_POINT_RENAME(GlyphIterator)
+#define GlyphLookupTableHeader U_ICU_ENTRY_POINT_RENAME(GlyphLookupTableHeader)
+#define GlyphPositionAdjustments U_ICU_ENTRY_POINT_RENAME(GlyphPositionAdjustments)
+#define GlyphPositioningLookupProcessor U_ICU_ENTRY_POINT_RENAME(GlyphPositioningLookupProcessor)
+#define GlyphPositioningTableHeader U_ICU_ENTRY_POINT_RENAME(GlyphPositioningTableHeader)
+#define GlyphSubstitutionLookupProcessor U_ICU_ENTRY_POINT_RENAME(GlyphSubstitutionLookupProcessor)
+#define GlyphSubstitutionTableHeader U_ICU_ENTRY_POINT_RENAME(GlyphSubstitutionTableHeader)
+#define GoodSuffixTable U_ICU_ENTRY_POINT_RENAME(GoodSuffixTable)
+#define Grego U_ICU_ENTRY_POINT_RENAME(Grego)
+#define GregorianCalendar U_ICU_ENTRY_POINT_RENAME(GregorianCalendar)
+#define HanOpenTypeLayoutEngine U_ICU_ENTRY_POINT_RENAME(HanOpenTypeLayoutEngine)
+#define HangulOpenTypeLayoutEngine U_ICU_ENTRY_POINT_RENAME(HangulOpenTypeLayoutEngine)
+#define HebrewCalendar U_ICU_ENTRY_POINT_RENAME(HebrewCalendar)
+#define ICUBreakIteratorFactory U_ICU_ENTRY_POINT_RENAME(ICUBreakIteratorFactory)
+#define ICUBreakIteratorService U_ICU_ENTRY_POINT_RENAME(ICUBreakIteratorService)
+#define ICUCollatorFactory U_ICU_ENTRY_POINT_RENAME(ICUCollatorFactory)
+#define ICUCollatorService U_ICU_ENTRY_POINT_RENAME(ICUCollatorService)
+#define ICUDataTable U_ICU_ENTRY_POINT_RENAME(ICUDataTable)
+#define ICULanguageBreakFactory U_ICU_ENTRY_POINT_RENAME(ICULanguageBreakFactory)
+#define ICULocaleService U_ICU_ENTRY_POINT_RENAME(ICULocaleService)
+#define ICUNotifier U_ICU_ENTRY_POINT_RENAME(ICUNotifier)
+#define ICUNumberFormatFactory U_ICU_ENTRY_POINT_RENAME(ICUNumberFormatFactory)
+#define ICUNumberFormatService U_ICU_ENTRY_POINT_RENAME(ICUNumberFormatService)
+#define ICUResourceBundleFactory U_ICU_ENTRY_POINT_RENAME(ICUResourceBundleFactory)
+#define ICUService U_ICU_ENTRY_POINT_RENAME(ICUService)
+#define ICUServiceFactory U_ICU_ENTRY_POINT_RENAME(ICUServiceFactory)
+#define ICUServiceKey U_ICU_ENTRY_POINT_RENAME(ICUServiceKey)
+#define ICU_Utility U_ICU_ENTRY_POINT_RENAME(ICU_Utility)
+#define IDNA U_ICU_ENTRY_POINT_RENAME(IDNA)
+#define IndianCalendar U_ICU_ENTRY_POINT_RENAME(IndianCalendar)
+#define IndicClassTable U_ICU_ENTRY_POINT_RENAME(IndicClassTable)
+#define IndicOpenTypeLayoutEngine U_ICU_ENTRY_POINT_RENAME(IndicOpenTypeLayoutEngine)
+#define IndicRearrangementProcessor U_ICU_ENTRY_POINT_RENAME(IndicRearrangementProcessor)
+#define IndicReordering U_ICU_ENTRY_POINT_RENAME(IndicReordering)
+#define InitialTimeZoneRule U_ICU_ENTRY_POINT_RENAME(InitialTimeZoneRule)
+#define InputText U_ICU_ENTRY_POINT_RENAME(InputText)
+#define IntegralPartSubstitution U_ICU_ENTRY_POINT_RENAME(IntegralPartSubstitution)
+#define IslamicCalendar U_ICU_ENTRY_POINT_RENAME(IslamicCalendar)
+#define IteratedChar U_ICU_ENTRY_POINT_RENAME(IteratedChar)
+#define JapaneseCalendar U_ICU_ENTRY_POINT_RENAME(JapaneseCalendar)
+#define KernTable U_ICU_ENTRY_POINT_RENAME(KernTable)
+#define KeywordEnumeration U_ICU_ENTRY_POINT_RENAME(KeywordEnumeration)
+#define KhmerClassTable U_ICU_ENTRY_POINT_RENAME(KhmerClassTable)
+#define KhmerOpenTypeLayoutEngine U_ICU_ENTRY_POINT_RENAME(KhmerOpenTypeLayoutEngine)
+#define KhmerReordering U_ICU_ENTRY_POINT_RENAME(KhmerReordering)
+#define LECharMapper U_ICU_ENTRY_POINT_RENAME(LECharMapper)
+#define LEFontInstance U_ICU_ENTRY_POINT_RENAME(LEFontInstance)
+#define LEGlyphFilter U_ICU_ENTRY_POINT_RENAME(LEGlyphFilter)
+#define LEGlyphStorage U_ICU_ENTRY_POINT_RENAME(LEGlyphStorage)
+#define LEInsertionCallback U_ICU_ENTRY_POINT_RENAME(LEInsertionCallback)
+#define LEInsertionList U_ICU_ENTRY_POINT_RENAME(LEInsertionList)
+#define LXUtilities U_ICU_ENTRY_POINT_RENAME(LXUtilities)
+#define LanguageBreakEngine U_ICU_ENTRY_POINT_RENAME(LanguageBreakEngine)
+#define LanguageBreakFactory U_ICU_ENTRY_POINT_RENAME(LanguageBreakFactory)
+#define LayoutEngine U_ICU_ENTRY_POINT_RENAME(LayoutEngine)
+#define LigatureSubstitutionProcessor U_ICU_ENTRY_POINT_RENAME(LigatureSubstitutionProcessor)
+#define LigatureSubstitutionSubtable U_ICU_ENTRY_POINT_RENAME(LigatureSubstitutionSubtable)
+#define LocDataParser U_ICU_ENTRY_POINT_RENAME(LocDataParser)
+#define Locale U_ICU_ENTRY_POINT_RENAME(Locale)
+#define LocaleBased U_ICU_ENTRY_POINT_RENAME(LocaleBased)
+#define LocaleDisplayNames U_ICU_ENTRY_POINT_RENAME(LocaleDisplayNames)
+#define LocaleDisplayNamesImpl U_ICU_ENTRY_POINT_RENAME(LocaleDisplayNamesImpl)
+#define LocaleKey U_ICU_ENTRY_POINT_RENAME(LocaleKey)
+#define LocaleKeyFactory U_ICU_ENTRY_POINT_RENAME(LocaleKeyFactory)
+#define LocaleRuns U_ICU_ENTRY_POINT_RENAME(LocaleRuns)
+#define LocaleUtility U_ICU_ENTRY_POINT_RENAME(LocaleUtility)
+#define LocalizationInfo U_ICU_ENTRY_POINT_RENAME(LocalizationInfo)
+#define LookupListTable U_ICU_ENTRY_POINT_RENAME(LookupListTable)
+#define LookupProcessor U_ICU_ENTRY_POINT_RENAME(LookupProcessor)
+#define LookupSubtable U_ICU_ENTRY_POINT_RENAME(LookupSubtable)
+#define LookupTable U_ICU_ENTRY_POINT_RENAME(LookupTable)
+#define LowercaseTransliterator U_ICU_ENTRY_POINT_RENAME(LowercaseTransliterator)
+#define MPreFixups U_ICU_ENTRY_POINT_RENAME(MPreFixups)
+#define MarkArray U_ICU_ENTRY_POINT_RENAME(MarkArray)
+#define MarkToBasePositioningSubtable U_ICU_ENTRY_POINT_RENAME(MarkToBasePositioningSubtable)
+#define MarkToLigaturePositioningSubtable U_ICU_ENTRY_POINT_RENAME(MarkToLigaturePositioningSubtable)
+#define MarkToMarkPositioningSubtable U_ICU_ENTRY_POINT_RENAME(MarkToMarkPositioningSubtable)
+#define Measure U_ICU_ENTRY_POINT_RENAME(Measure)
+#define MeasureFormat U_ICU_ENTRY_POINT_RENAME(MeasureFormat)
+#define MeasureUnit U_ICU_ENTRY_POINT_RENAME(MeasureUnit)
+#define MessageFormat U_ICU_ENTRY_POINT_RENAME(MessageFormat)
+#define MessageFormatAdapter U_ICU_ENTRY_POINT_RENAME(MessageFormatAdapter)
+#define ModulusSubstitution U_ICU_ENTRY_POINT_RENAME(ModulusSubstitution)
+#define MoonRiseSetCoordFunc U_ICU_ENTRY_POINT_RENAME(MoonRiseSetCoordFunc)
+#define MoonTimeAngleFunc U_ICU_ENTRY_POINT_RENAME(MoonTimeAngleFunc)
+#define MorphSubtableHeader U_ICU_ENTRY_POINT_RENAME(MorphSubtableHeader)
+#define MorphTableHeader U_ICU_ENTRY_POINT_RENAME(MorphTableHeader)
+#define MultipleSubstitutionSubtable U_ICU_ENTRY_POINT_RENAME(MultipleSubstitutionSubtable)
+#define MultiplierSubstitution U_ICU_ENTRY_POINT_RENAME(MultiplierSubstitution)
+#define MutableTrieDictionary U_ICU_ENTRY_POINT_RENAME(MutableTrieDictionary)
+#define MutableTrieEnumeration U_ICU_ENTRY_POINT_RENAME(MutableTrieEnumeration)
+#define NFFactory U_ICU_ENTRY_POINT_RENAME(NFFactory)
+#define NFKDBuffer U_ICU_ENTRY_POINT_RENAME(NFKDBuffer)
+#define NFRule U_ICU_ENTRY_POINT_RENAME(NFRule)
+#define NFRuleSet U_ICU_ENTRY_POINT_RENAME(NFRuleSet)
+#define NFSubstitution U_ICU_ENTRY_POINT_RENAME(NFSubstitution)
+#define NGramParser U_ICU_ENTRY_POINT_RENAME(NGramParser)
+#define NameToEnum U_ICU_ENTRY_POINT_RENAME(NameToEnum)
+#define NameUnicodeTransliterator U_ICU_ENTRY_POINT_RENAME(NameUnicodeTransliterator)
+#define NonContextualGlyphSubstitutionProcessor U_ICU_ENTRY_POINT_RENAME(NonContextualGlyphSubstitutionProcessor)
+#define NonContiguousEnumToOffset U_ICU_ENTRY_POINT_RENAME(NonContiguousEnumToOffset)
+#define NoopNormalizer2 U_ICU_ENTRY_POINT_RENAME(NoopNormalizer2)
+#define Norm2AllModes U_ICU_ENTRY_POINT_RENAME(Norm2AllModes)
+#define NormalizationTransliterator U_ICU_ENTRY_POINT_RENAME(NormalizationTransliterator)
+#define Normalizer U_ICU_ENTRY_POINT_RENAME(Normalizer)
+#define Normalizer2 U_ICU_ENTRY_POINT_RENAME(Normalizer2)
+#define Normalizer2Factory U_ICU_ENTRY_POINT_RENAME(Normalizer2Factory)
+#define Normalizer2Impl U_ICU_ENTRY_POINT_RENAME(Normalizer2Impl)
+#define Normalizer2WithImpl U_ICU_ENTRY_POINT_RENAME(Normalizer2WithImpl)
+#define NullSubstitution U_ICU_ENTRY_POINT_RENAME(NullSubstitution)
+#define NullTransliterator U_ICU_ENTRY_POINT_RENAME(NullTransliterator)
+#define NumberFormat U_ICU_ENTRY_POINT_RENAME(NumberFormat)
+#define NumberFormatFactory U_ICU_ENTRY_POINT_RENAME(NumberFormatFactory)
+#define NumberingSystem U_ICU_ENTRY_POINT_RENAME(NumberingSystem)
+#define NumeratorSubstitution U_ICU_ENTRY_POINT_RENAME(NumeratorSubstitution)
+#define OlsonTimeZone U_ICU_ENTRY_POINT_RENAME(OlsonTimeZone)
+#define OpenTypeLayoutEngine U_ICU_ENTRY_POINT_RENAME(OpenTypeLayoutEngine)
+#define OpenTypeUtilities U_ICU_ENTRY_POINT_RENAME(OpenTypeUtilities)
+#define OrConstraint U_ICU_ENTRY_POINT_RENAME(OrConstraint)
+#define PCEBuffer U_ICU_ENTRY_POINT_RENAME(PCEBuffer)
+#define PairPositioningFormat1Subtable U_ICU_ENTRY_POINT_RENAME(PairPositioningFormat1Subtable)
+#define PairPositioningFormat2Subtable U_ICU_ENTRY_POINT_RENAME(PairPositioningFormat2Subtable)
+#define PairPositioningSubtable U_ICU_ENTRY_POINT_RENAME(PairPositioningSubtable)
+#define ParagraphLayout U_ICU_ENTRY_POINT_RENAME(ParagraphLayout)
+#define ParseData U_ICU_ENTRY_POINT_RENAME(ParseData)
+#define ParsePosition U_ICU_ENTRY_POINT_RENAME(ParsePosition)
+#define PatternMap U_ICU_ENTRY_POINT_RENAME(PatternMap)
+#define PatternMapIterator U_ICU_ENTRY_POINT_RENAME(PatternMapIterator)
+#define PersianCalendar U_ICU_ENTRY_POINT_RENAME(PersianCalendar)
+#define PluralFormat U_ICU_ENTRY_POINT_RENAME(PluralFormat)
+#define PluralKeywordEnumeration U_ICU_ENTRY_POINT_RENAME(PluralKeywordEnumeration)
+#define PluralRules U_ICU_ENTRY_POINT_RENAME(PluralRules)
+#define PropertyAliases U_ICU_ENTRY_POINT_RENAME(PropertyAliases)
+#define PtnElem U_ICU_ENTRY_POINT_RENAME(PtnElem)
+#define PtnSkeleton U_ICU_ENTRY_POINT_RENAME(PtnSkeleton)
+#define Quantifier U_ICU_ENTRY_POINT_RENAME(Quantifier)
+#define RBBIDataWrapper U_ICU_ENTRY_POINT_RENAME(RBBIDataWrapper)
+#define RBBINode U_ICU_ENTRY_POINT_RENAME(RBBINode)
+#define RBBIRuleBuilder U_ICU_ENTRY_POINT_RENAME(RBBIRuleBuilder)
+#define RBBIRuleScanner U_ICU_ENTRY_POINT_RENAME(RBBIRuleScanner)
+#define RBBISetBuilder U_ICU_ENTRY_POINT_RENAME(RBBISetBuilder)
+#define RBBIStateDescriptor U_ICU_ENTRY_POINT_RENAME(RBBIStateDescriptor)
+#define RBBISymbolTable U_ICU_ENTRY_POINT_RENAME(RBBISymbolTable)
+#define RBBISymbolTableEntry U_ICU_ENTRY_POINT_RENAME(RBBISymbolTableEntry)
+#define RBBITableBuilder U_ICU_ENTRY_POINT_RENAME(RBBITableBuilder)
+#define RCEBuffer U_ICU_ENTRY_POINT_RENAME(RCEBuffer)
+#define RangeDescriptor U_ICU_ENTRY_POINT_RENAME(RangeDescriptor)
+#define RegexCompile U_ICU_ENTRY_POINT_RENAME(RegexCompile)
+#define RegexMatcher U_ICU_ENTRY_POINT_RENAME(RegexMatcher)
+#define RegexPattern U_ICU_ENTRY_POINT_RENAME(RegexPattern)
+#define RegexStaticSets U_ICU_ENTRY_POINT_RENAME(RegexStaticSets)
+#define RegularExpression U_ICU_ENTRY_POINT_RENAME(RegularExpression)
+#define RelativeDateFormat U_ICU_ENTRY_POINT_RENAME(RelativeDateFormat)
+#define RemoveTransliterator U_ICU_ENTRY_POINT_RENAME(RemoveTransliterator)
+#define ReorderingBuffer U_ICU_ENTRY_POINT_RENAME(ReorderingBuffer)
+#define Replaceable U_ICU_ENTRY_POINT_RENAME(Replaceable)
+#define ReplaceableGlue U_ICU_ENTRY_POINT_RENAME(ReplaceableGlue)
+#define ResourceBundle U_ICU_ENTRY_POINT_RENAME(ResourceBundle)
+#define RiseSetCoordFunc U_ICU_ENTRY_POINT_RENAME(RiseSetCoordFunc)
+#define RuleBasedBreakIterator U_ICU_ENTRY_POINT_RENAME(RuleBasedBreakIterator)
+#define RuleBasedCollator U_ICU_ENTRY_POINT_RENAME(RuleBasedCollator)
+#define RuleBasedNumberFormat U_ICU_ENTRY_POINT_RENAME(RuleBasedNumberFormat)
+#define RuleBasedTimeZone U_ICU_ENTRY_POINT_RENAME(RuleBasedTimeZone)
+#define RuleBasedTransliterator U_ICU_ENTRY_POINT_RENAME(RuleBasedTransliterator)
+#define RuleChain U_ICU_ENTRY_POINT_RENAME(RuleChain)
+#define RuleCharacterIterator U_ICU_ENTRY_POINT_RENAME(RuleCharacterIterator)
+#define RuleHalf U_ICU_ENTRY_POINT_RENAME(RuleHalf)
+#define RuleParser U_ICU_ENTRY_POINT_RENAME(RuleParser)
+#define RunArray U_ICU_ENTRY_POINT_RENAME(RunArray)
+#define SPUString U_ICU_ENTRY_POINT_RENAME(SPUString)
+#define SPUStringPool U_ICU_ENTRY_POINT_RENAME(SPUStringPool)
+#define SafeZoneStringFormatPtr U_ICU_ENTRY_POINT_RENAME(SafeZoneStringFormatPtr)
+#define SameValueSubstitution U_ICU_ENTRY_POINT_RENAME(SameValueSubstitution)
+#define ScriptListTable U_ICU_ENTRY_POINT_RENAME(ScriptListTable)
+#define ScriptRunIterator U_ICU_ENTRY_POINT_RENAME(ScriptRunIterator)
+#define ScriptSet U_ICU_ENTRY_POINT_RENAME(ScriptSet)
+#define ScriptTable U_ICU_ENTRY_POINT_RENAME(ScriptTable)
+#define SearchIterator U_ICU_ENTRY_POINT_RENAME(SearchIterator)
+#define SegmentArrayProcessor U_ICU_ENTRY_POINT_RENAME(SegmentArrayProcessor)
+#define SegmentSingleProcessor U_ICU_ENTRY_POINT_RENAME(SegmentSingleProcessor)
+#define SelectFormat U_ICU_ENTRY_POINT_RENAME(SelectFormat)
+#define ServiceEnumeration U_ICU_ENTRY_POINT_RENAME(ServiceEnumeration)
+#define ServiceListener U_ICU_ENTRY_POINT_RENAME(ServiceListener)
+#define SimpleArrayProcessor U_ICU_ENTRY_POINT_RENAME(SimpleArrayProcessor)
+#define SimpleDateFormat U_ICU_ENTRY_POINT_RENAME(SimpleDateFormat)
+#define SimpleFactory U_ICU_ENTRY_POINT_RENAME(SimpleFactory)
+#define SimpleLocaleKeyFactory U_ICU_ENTRY_POINT_RENAME(SimpleLocaleKeyFactory)
+#define SimpleNumberFormatFactory U_ICU_ENTRY_POINT_RENAME(SimpleNumberFormatFactory)
+#define SimpleSingleton U_ICU_ENTRY_POINT_RENAME(SimpleSingleton)
+#define SimpleTimeZone U_ICU_ENTRY_POINT_RENAME(SimpleTimeZone)
+#define SinglePositioningFormat1Subtable U_ICU_ENTRY_POINT_RENAME(SinglePositioningFormat1Subtable)
+#define SinglePositioningFormat2Subtable U_ICU_ENTRY_POINT_RENAME(SinglePositioningFormat2Subtable)
+#define SinglePositioningSubtable U_ICU_ENTRY_POINT_RENAME(SinglePositioningSubtable)
+#define SingleSubstitutionFormat1Subtable U_ICU_ENTRY_POINT_RENAME(SingleSubstitutionFormat1Subtable)
+#define SingleSubstitutionFormat2Subtable U_ICU_ENTRY_POINT_RENAME(SingleSubstitutionFormat2Subtable)
+#define SingleSubstitutionSubtable U_ICU_ENTRY_POINT_RENAME(SingleSubstitutionSubtable)
+#define SingleTableProcessor U_ICU_ENTRY_POINT_RENAME(SingleTableProcessor)
+#define SpoofData U_ICU_ENTRY_POINT_RENAME(SpoofData)
+#define SpoofImpl U_ICU_ENTRY_POINT_RENAME(SpoofImpl)
+#define StateTableProcessor U_ICU_ENTRY_POINT_RENAME(StateTableProcessor)
+#define StringCharacterIterator U_ICU_ENTRY_POINT_RENAME(StringCharacterIterator)
+#define StringEnumeration U_ICU_ENTRY_POINT_RENAME(StringEnumeration)
+#define StringList U_ICU_ENTRY_POINT_RENAME(StringList)
+#define StringLocalizationInfo U_ICU_ENTRY_POINT_RENAME(StringLocalizationInfo)
+#define StringMatcher U_ICU_ENTRY_POINT_RENAME(StringMatcher)
+#define StringPair U_ICU_ENTRY_POINT_RENAME(StringPair)
+#define StringPiece U_ICU_ENTRY_POINT_RENAME(StringPiece)
+#define StringReplacer U_ICU_ENTRY_POINT_RENAME(StringReplacer)
+#define StringSearch U_ICU_ENTRY_POINT_RENAME(StringSearch)
+#define StringToCEsMap U_ICU_ENTRY_POINT_RENAME(StringToCEsMap)
+#define StyleRuns U_ICU_ENTRY_POINT_RENAME(StyleRuns)
+#define SubstitutionLookup U_ICU_ENTRY_POINT_RENAME(SubstitutionLookup)
+#define SubtableProcessor U_ICU_ENTRY_POINT_RENAME(SubtableProcessor)
+#define SunTimeAngleFunc U_ICU_ENTRY_POINT_RENAME(SunTimeAngleFunc)
+#define SymbolTable U_ICU_ENTRY_POINT_RENAME(SymbolTable)
+#define TZEnumeration U_ICU_ENTRY_POINT_RENAME(TZEnumeration)
+#define TaiwanCalendar U_ICU_ENTRY_POINT_RENAME(TaiwanCalendar)
+#define Target U_ICU_ENTRY_POINT_RENAME(Target)
+#define TernaryNode U_ICU_ENTRY_POINT_RENAME(TernaryNode)
+#define TextTrieMap U_ICU_ENTRY_POINT_RENAME(TextTrieMap)
+#define TextTrieMapSearchResultHandler U_ICU_ENTRY_POINT_RENAME(TextTrieMapSearchResultHandler)
+#define ThaiBreakEngine U_ICU_ENTRY_POINT_RENAME(ThaiBreakEngine)
+#define ThaiLayoutEngine U_ICU_ENTRY_POINT_RENAME(ThaiLayoutEngine)
+#define ThaiShaping U_ICU_ENTRY_POINT_RENAME(ThaiShaping)
+#define TibetanClassTable U_ICU_ENTRY_POINT_RENAME(TibetanClassTable)
+#define TibetanOpenTypeLayoutEngine U_ICU_ENTRY_POINT_RENAME(TibetanOpenTypeLayoutEngine)
+#define TibetanReordering U_ICU_ENTRY_POINT_RENAME(TibetanReordering)
+#define TimeArrayTimeZoneRule U_ICU_ENTRY_POINT_RENAME(TimeArrayTimeZoneRule)
+#define TimeUnit U_ICU_ENTRY_POINT_RENAME(TimeUnit)
+#define TimeUnitAmount U_ICU_ENTRY_POINT_RENAME(TimeUnitAmount)
+#define TimeUnitFormat U_ICU_ENTRY_POINT_RENAME(TimeUnitFormat)
+#define TimeZone U_ICU_ENTRY_POINT_RENAME(TimeZone)
+#define TimeZoneRule U_ICU_ENTRY_POINT_RENAME(TimeZoneRule)
+#define TimeZoneTransition U_ICU_ENTRY_POINT_RENAME(TimeZoneTransition)
+#define TitlecaseTransliterator U_ICU_ENTRY_POINT_RENAME(TitlecaseTransliterator)
+#define TransliterationRule U_ICU_ENTRY_POINT_RENAME(TransliterationRule)
+#define TransliterationRuleData U_ICU_ENTRY_POINT_RENAME(TransliterationRuleData)
+#define TransliterationRuleSet U_ICU_ENTRY_POINT_RENAME(TransliterationRuleSet)
+#define Transliterator U_ICU_ENTRY_POINT_RENAME(Transliterator)
+#define TransliteratorAlias U_ICU_ENTRY_POINT_RENAME(TransliteratorAlias)
+#define TransliteratorEntry U_ICU_ENTRY_POINT_RENAME(TransliteratorEntry)
+#define TransliteratorIDParser U_ICU_ENTRY_POINT_RENAME(TransliteratorIDParser)
+#define TransliteratorParser U_ICU_ENTRY_POINT_RENAME(TransliteratorParser)
+#define TransliteratorRegistry U_ICU_ENTRY_POINT_RENAME(TransliteratorRegistry)
+#define TransliteratorSpec U_ICU_ENTRY_POINT_RENAME(TransliteratorSpec)
+#define TriStateSingleton U_ICU_ENTRY_POINT_RENAME(TriStateSingleton)
+#define TrieWordDictionary U_ICU_ENTRY_POINT_RENAME(TrieWordDictionary)
+#define TrimmedArrayProcessor U_ICU_ENTRY_POINT_RENAME(TrimmedArrayProcessor)
+#define UCharCharacterIterator U_ICU_ENTRY_POINT_RENAME(UCharCharacterIterator)
+#define UCollationPCE U_ICU_ENTRY_POINT_RENAME(UCollationPCE)
+#define UDataPathIterator U_ICU_ENTRY_POINT_RENAME(UDataPathIterator)
+#define ULocRuns U_ICU_ENTRY_POINT_RENAME(ULocRuns)
+#define UMemory U_ICU_ENTRY_POINT_RENAME(UMemory)
+#define UObject U_ICU_ENTRY_POINT_RENAME(UObject)
+#define UStack U_ICU_ENTRY_POINT_RENAME(UStack)
+#define UStringEnumeration U_ICU_ENTRY_POINT_RENAME(UStringEnumeration)
+#define UTS46 U_ICU_ENTRY_POINT_RENAME(UTS46)
+#define UTrie2Singleton U_ICU_ENTRY_POINT_RENAME(UTrie2Singleton)
+#define UVector U_ICU_ENTRY_POINT_RENAME(UVector)
+#define UVector32 U_ICU_ENTRY_POINT_RENAME(UVector32)
+#define UVector64 U_ICU_ENTRY_POINT_RENAME(UVector64)
+#define UnescapeTransliterator U_ICU_ENTRY_POINT_RENAME(UnescapeTransliterator)
+#define UnhandledEngine U_ICU_ENTRY_POINT_RENAME(UnhandledEngine)
+#define UnicodeArabicOpenTypeLayoutEngine U_ICU_ENTRY_POINT_RENAME(UnicodeArabicOpenTypeLayoutEngine)
+#define UnicodeFilter U_ICU_ENTRY_POINT_RENAME(UnicodeFilter)
+#define UnicodeFunctor U_ICU_ENTRY_POINT_RENAME(UnicodeFunctor)
+#define UnicodeMatcher U_ICU_ENTRY_POINT_RENAME(UnicodeMatcher)
+#define UnicodeNameTransliterator U_ICU_ENTRY_POINT_RENAME(UnicodeNameTransliterator)
+#define UnicodeReplacer U_ICU_ENTRY_POINT_RENAME(UnicodeReplacer)
+#define UnicodeSet U_ICU_ENTRY_POINT_RENAME(UnicodeSet)
+#define UnicodeSetIterator U_ICU_ENTRY_POINT_RENAME(UnicodeSetIterator)
+#define UnicodeSetStringSpan U_ICU_ENTRY_POINT_RENAME(UnicodeSetStringSpan)
+#define UnicodeString U_ICU_ENTRY_POINT_RENAME(UnicodeString)
+#define UppercaseTransliterator U_ICU_ENTRY_POINT_RENAME(UppercaseTransliterator)
+#define VTZReader U_ICU_ENTRY_POINT_RENAME(VTZReader)
+#define VTZWriter U_ICU_ENTRY_POINT_RENAME(VTZWriter)
+#define VTimeZone U_ICU_ENTRY_POINT_RENAME(VTimeZone)
+#define ValueRecord U_ICU_ENTRY_POINT_RENAME(ValueRecord)
+#define ValueRuns U_ICU_ENTRY_POINT_RENAME(ValueRuns)
+#define ZSFCache U_ICU_ENTRY_POINT_RENAME(ZSFCache)
+#define ZSFCacheEntry U_ICU_ENTRY_POINT_RENAME(ZSFCacheEntry)
+#define ZSFStringPool U_ICU_ENTRY_POINT_RENAME(ZSFStringPool)
+#define ZSFStringPoolChunk U_ICU_ENTRY_POINT_RENAME(ZSFStringPoolChunk)
+#define ZoneMeta U_ICU_ENTRY_POINT_RENAME(ZoneMeta)
+#define ZoneStringFormat U_ICU_ENTRY_POINT_RENAME(ZoneStringFormat)
+#define ZoneStringInfo U_ICU_ENTRY_POINT_RENAME(ZoneStringInfo)
+#define ZoneStringSearchResultHandler U_ICU_ENTRY_POINT_RENAME(ZoneStringSearchResultHandler)
+#define ZoneStrings U_ICU_ENTRY_POINT_RENAME(ZoneStrings)
+#define collIterate U_ICU_ENTRY_POINT_RENAME(collIterate)
+#define locale_set_default_internal U_ICU_ENTRY_POINT_RENAME(locale_set_default_internal)
+#define util64_fromDouble U_ICU_ENTRY_POINT_RENAME(util64_fromDouble)
+#define util64_pow U_ICU_ENTRY_POINT_RENAME(util64_pow)
+#define util64_tou U_ICU_ENTRY_POINT_RENAME(util64_tou)
#endif
#endif
diff --git a/Source/JavaScriptCore/icu/unicode/uscript.h b/Source/JavaScriptCore/icu/unicode/uscript.h
index 16375447d..ee21c740d 100644
--- a/Source/JavaScriptCore/icu/unicode/uscript.h
+++ b/Source/JavaScriptCore/icu/unicode/uscript.h
@@ -1,17 +1,18 @@
/*
-**********************************************************************
-* Copyright (C) 1997-2006, International Business Machines
-* Corporation and others. All Rights Reserved.
-**********************************************************************
-*
-* File USCRIPT.H
-*
-* Modification History:
-*
-* Date Name Description
-* 07/06/2001 Ram Creation.
-******************************************************************************
-*/
+ **********************************************************************
+ * Copyright (C) 1997-2010, International Business Machines
+ * Corporation and others. All Rights Reserved.
+ **********************************************************************
+ *
+ * File USCRIPT.H
+ *
+ * Modification History:
+ *
+ * Date Name Description
+ * 07/06/2001 Ram Creation.
+ ******************************************************************************
+ */
+
#ifndef USCRIPT_H
#define USCRIPT_H
#include "unicode/utypes.h"
@@ -44,8 +45,8 @@
*/
typedef enum UScriptCode {
USCRIPT_INVALID_CODE = -1,
- USCRIPT_COMMON = 0 , /* Zyyy */
- USCRIPT_INHERITED = 1, /* Qaai */
+ USCRIPT_COMMON = 0, /* Zyyy */
+ USCRIPT_INHERITED = 1, /* Zinh */ /* "Code for inherited script", for non-spacing combining marks; also Qaai */
USCRIPT_ARABIC = 2, /* Arab */
USCRIPT_ARMENIAN = 3, /* Armn */
USCRIPT_BENGALI = 4, /* Beng */
@@ -106,9 +107,8 @@ typedef enum UScriptCode {
/** New script code in Unicode 4.0.1 @stable ICU 3.0 */
USCRIPT_KATAKANA_OR_HIRAGANA = 54,/*Hrkt */
-
-#ifndef U_HIDE_DRAFT_API
- /* New scripts in Unicode 4.1 @draft ICU 3.4 */
+
+ /* New scripts in Unicode 4.1 @stable ICU 3.4 */
USCRIPT_BUGINESE = 55, /* Bugi */
USCRIPT_GLAGOLITIC = 56, /* Glag */
USCRIPT_KHAROSHTHI = 57, /* Khar */
@@ -117,7 +117,7 @@ typedef enum UScriptCode {
USCRIPT_TIFINAGH = 60, /* Tfng */
USCRIPT_OLD_PERSIAN = 61, /* Xpeo */
- /* New script codes from ISO 15924 @draft ICU 3.6 */
+ /* New script codes from ISO 15924 @stable ICU 3.6 */
USCRIPT_BALINESE = 62, /* Bali */
USCRIPT_BATAK = 63, /* Batk */
USCRIPT_BLISSYMBOLS = 64, /* Blis */
@@ -140,9 +140,15 @@ typedef enum UScriptCode {
USCRIPT_LATIN_GAELIC = 81, /* Latg */
USCRIPT_LEPCHA = 82, /* Lepc */
USCRIPT_LINEAR_A = 83, /* Lina */
- USCRIPT_MANDAEAN = 84, /* Mand */
+ /** @stable ICU 4.6 */
+ USCRIPT_MANDAIC = 84, /* Mand */
+ /** @stable ICU 3.6 */
+ USCRIPT_MANDAEAN = USCRIPT_MANDAIC,
USCRIPT_MAYAN_HIEROGLYPHS = 85, /* Maya */
- USCRIPT_MEROITIC = 86, /* Mero */
+ /** @stable ICU 4.6 */
+ USCRIPT_MEROITIC_HIEROGLYPHS = 86, /* Mero */
+ /** @stable ICU 3.6 */
+ USCRIPT_MEROITIC = USCRIPT_MEROITIC_HIEROGLYPHS,
USCRIPT_NKO = 87, /* Nkoo */
USCRIPT_ORKHON = 88, /* Orkh */
USCRIPT_OLD_PERMIC = 89, /* Perm */
@@ -156,13 +162,64 @@ typedef enum UScriptCode {
USCRIPT_EASTERN_SYRIAC = 97, /* Syrn */
USCRIPT_TENGWAR = 98, /* Teng */
USCRIPT_VAI = 99, /* Vaii */
- USCRIPT_VISIBLE_SPEECH = 100, /* Visp */
+ USCRIPT_VISIBLE_SPEECH = 100,/* Visp */
USCRIPT_CUNEIFORM = 101,/* Xsux */
USCRIPT_UNWRITTEN_LANGUAGES = 102,/* Zxxx */
USCRIPT_UNKNOWN = 103,/* Zzzz */ /* Unknown="Code for uncoded script", for unassigned code points */
- /* Private use codes from Qaaa - Qabx are not supported*/
-#endif /* U_HIDE_DRAFT_API */
- USCRIPT_CODE_LIMIT = 104
+
+ /* New script codes from ISO 15924 @stable ICU 3.8 */
+ USCRIPT_CARIAN = 104,/* Cari */
+ USCRIPT_JAPANESE = 105,/* Jpan */
+ USCRIPT_LANNA = 106,/* Lana */
+ USCRIPT_LYCIAN = 107,/* Lyci */
+ USCRIPT_LYDIAN = 108,/* Lydi */
+ USCRIPT_OL_CHIKI = 109,/* Olck */
+ USCRIPT_REJANG = 110,/* Rjng */
+ USCRIPT_SAURASHTRA = 111,/* Saur */
+ USCRIPT_SIGN_WRITING = 112,/* Sgnw */
+ USCRIPT_SUNDANESE = 113,/* Sund */
+ USCRIPT_MOON = 114,/* Moon */
+ USCRIPT_MEITEI_MAYEK = 115,/* Mtei */
+
+ /* New script codes from ISO 15924 @stable ICU 4.0 */
+ USCRIPT_IMPERIAL_ARAMAIC = 116,/* Armi */
+ USCRIPT_AVESTAN = 117,/* Avst */
+ USCRIPT_CHAKMA = 118,/* Cakm */
+ USCRIPT_KOREAN = 119,/* Kore */
+ USCRIPT_KAITHI = 120,/* Kthi */
+ USCRIPT_MANICHAEAN = 121,/* Mani */
+ USCRIPT_INSCRIPTIONAL_PAHLAVI = 122,/* Phli */
+ USCRIPT_PSALTER_PAHLAVI = 123,/* Phlp */
+ USCRIPT_BOOK_PAHLAVI = 124,/* Phlv */
+ USCRIPT_INSCRIPTIONAL_PARTHIAN = 125,/* Prti */
+ USCRIPT_SAMARITAN = 126,/* Samr */
+ USCRIPT_TAI_VIET = 127,/* Tavt */
+ USCRIPT_MATHEMATICAL_NOTATION = 128,/* Zmth */
+ USCRIPT_SYMBOLS = 129,/* Zsym */
+
+ /* New script codes from ISO 15924 @stable ICU 4.4 */
+ USCRIPT_BAMUM = 130,/* Bamu */
+ USCRIPT_LISU = 131,/* Lisu */
+ USCRIPT_NAKHI_GEBA = 132,/* Nkgb */
+ USCRIPT_OLD_SOUTH_ARABIAN = 133,/* Sarb */
+
+ /* New script codes from ISO 15924 @stable ICU 4.6 */
+ USCRIPT_BASSA_VAH = 134,/* Bass */
+ USCRIPT_DUPLOYAN_SHORTAND = 135,/* Dupl */
+ USCRIPT_ELBASAN = 136,/* Elba */
+ USCRIPT_GRANTHA = 137,/* Gran */
+ USCRIPT_KPELLE = 138,/* Kpel */
+ USCRIPT_LOMA = 139,/* Loma */
+ USCRIPT_MENDE = 140,/* Mend */
+ USCRIPT_MEROITIC_CURSIVE = 141,/* Merc */
+ USCRIPT_OLD_NORTH_ARABIAN = 142,/* Narb */
+ USCRIPT_NABATAEAN = 143,/* Nbat */
+ USCRIPT_PALMYRENE = 144,/* Palm */
+ USCRIPT_SINDHI = 145,/* Sind */
+ USCRIPT_WARANG_CITI = 146,/* Wara */
+
+ /* Private use codes from Qaaa - Qabx are not supported */
+ USCRIPT_CODE_LIMIT = 147
} UScriptCode;
/**
@@ -208,7 +265,7 @@ uscript_getName(UScriptCode scriptCode);
U_STABLE const char* U_EXPORT2
uscript_getShortName(UScriptCode scriptCode);
-/**
+/**
* Gets the script code associated with the given codepoint.
* Returns USCRIPT_MALAYALAM given 0x0D02
* @param codepoint UChar32 codepoint
@@ -219,4 +276,51 @@ uscript_getShortName(UScriptCode scriptCode);
U_STABLE UScriptCode U_EXPORT2
uscript_getScript(UChar32 codepoint, UErrorCode *err);
+/**
+ * Is code point c used in script sc?
+ * That is, does code point c have the Script property value sc,
+ * or do code point c's Script_Extensions include script code sc?
+ *
+ * Some characters are commonly used in multiple scripts.
+ * For more information, see UAX #24: http://www.unicode.org/reports/tr24/.
+ *
+ * The Script_Extensions property is provisional. It may be modified or removed
+ * in future versions of the Unicode Standard, and thus in ICU.
+ * @param c code point
+ * @param sc script code
+ * @return TRUE if Script(c)==sc or sc is in Script_Extensions(c)
+ * @draft ICU 4.6
+ */
+U_DRAFT UBool U_EXPORT2
+uscript_hasScript(UChar32 c, UScriptCode sc);
+
+/**
+ * Writes code point c's Script_Extensions as a list of UScriptCode values
+ * to the output scripts array.
+ *
+ * Some characters are commonly used in multiple scripts.
+ * For more information, see UAX #24: http://www.unicode.org/reports/tr24/.
+ *
+ * If there are more than capacity script codes to be written, then
+ * U_BUFFER_OVERFLOW_ERROR is set and the number of Script_Extensions is returned.
+ * (Usual ICU buffer handling behavior.)
+ *
+ * The Script_Extensions property is provisional. It may be modified or removed
+ * in future versions of the Unicode Standard, and thus in ICU.
+ * @param c code point
+ * @param scripts output script code array
+ * @param capacity capacity of the scripts array
+ * @param errorCode Standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return number of script codes in c's Script_Extensions,
+ * written to scripts unless U_BUFFER_OVERFLOW_ERROR indicates insufficient capacity
+ * @draft ICU 4.6
+ */
+U_DRAFT int32_t U_EXPORT2
+uscript_getScriptExtensions(UChar32 c,
+ UScriptCode *scripts, int32_t capacity,
+ UErrorCode *pErrorCode);
+
#endif
diff --git a/Source/JavaScriptCore/icu/unicode/uset.h b/Source/JavaScriptCore/icu/unicode/uset.h
index b82ceb8ff..77ab06342 100644
--- a/Source/JavaScriptCore/icu/unicode/uset.h
+++ b/Source/JavaScriptCore/icu/unicode/uset.h
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2002-2004, International Business Machines
+* Copyright (C) 2002-2010, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -29,6 +29,7 @@
#include "unicode/utypes.h"
#include "unicode/uchar.h"
+#include "unicode/localpointer.h"
#ifndef UCNV_H
struct USet;
@@ -57,27 +58,39 @@ enum {
* will match 'a', 'A', 'b', and 'B'. "[^ab]" with this flag will
* match all except 'a', 'A', 'b', and 'B'. This performs a full
* closure over case mappings, e.g. U+017F for s.
+ *
+ * The resulting set is a superset of the input for the code points but
+ * not for the strings.
+ * It performs a case mapping closure of the code points and adds
+ * full case folding strings for the code points, and reduces strings of
+ * the original set to their full case folding equivalents.
+ *
+ * This is designed for case-insensitive matches, for example
+ * in regular expressions. The full code point case closure allows checking of
+ * an input character directly against the closure set.
+ * Strings are matched by comparing the case-folded form from the closure
+ * set with an incremental case folding of the string in question.
+ *
+ * The closure set will also contain single code points if the original
+ * set contained case-equivalent strings (like U+00DF for "ss" or "Ss" etc.).
+ * This is not necessary (that is, redundant) for the above matching method
+ * but results in the same closure sets regardless of whether the original
+ * set contained the code point or a string.
+ *
* @stable ICU 2.4
*/
USET_CASE_INSENSITIVE = 2,
/**
- * Bitmask for UnicodeSet::closeOver() indicating letter case.
- * This may be ORed together with other selectors.
- * @internal
- */
- USET_CASE = 2,
-
- /**
* Enable case insensitive matching. E.g., "[ab]" with this flag
* will match 'a', 'A', 'b', and 'B'. "[^ab]" with this flag will
* match all except 'a', 'A', 'b', and 'B'. This adds the lower-,
* title-, and uppercase mappings as well as the case folding
* of each existing element in the set.
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
USET_ADD_CASE_MAPPINGS = 4,
-
+
/**
* Enough for any single-code point set
* @internal
@@ -86,6 +99,115 @@ enum {
};
/**
+ * Argument values for whether span() and similar functions continue while
+ * the current character is contained vs. not contained in the set.
+ *
+ * The functionality is straightforward for sets with only single code points,
+ * without strings (which is the common case):
+ * - USET_SPAN_CONTAINED and USET_SPAN_SIMPLE
+ * work the same.
+ * - span() and spanBack() partition any string the same way when
+ * alternating between span(USET_SPAN_NOT_CONTAINED) and
+ * span(either "contained" condition).
+ * - Using a complemented (inverted) set and the opposite span conditions
+ * yields the same results.
+ *
+ * When a set contains multi-code point strings, then these statements may not
+ * be true, depending on the strings in the set (for example, whether they
+ * overlap with each other) and the string that is processed.
+ * For a set with strings:
+ * - The complement of the set contains the opposite set of code points,
+ * but the same set of strings.
+ * Therefore, complementing both the set and the span conditions
+ * may yield different results.
+ * - When starting spans at different positions in a string
+ * (span(s, ...) vs. span(s+1, ...)) the ends of the spans may be different
+ * because a set string may start before the later position.
+ * - span(USET_SPAN_SIMPLE) may be shorter than
+ * span(USET_SPAN_CONTAINED) because it will not recursively try
+ * all possible paths.
+ * For example, with a set which contains the three strings "xy", "xya" and "ax",
+ * span("xyax", USET_SPAN_CONTAINED) will return 4 but
+ * span("xyax", USET_SPAN_SIMPLE) will return 3.
+ * span(USET_SPAN_SIMPLE) will never be longer than
+ * span(USET_SPAN_CONTAINED).
+ * - With either "contained" condition, span() and spanBack() may partition
+ * a string in different ways.
+ * For example, with a set which contains the two strings "ab" and "ba",
+ * and when processing the string "aba",
+ * span() will yield contained/not-contained boundaries of { 0, 2, 3 }
+ * while spanBack() will yield boundaries of { 0, 1, 3 }.
+ *
+ * Note: If it is important to get the same boundaries whether iterating forward
+ * or backward through a string, then either only span() should be used and
+ * the boundaries cached for backward operation, or an ICU BreakIterator
+ * could be used.
+ *
+ * Note: Unpaired surrogates are treated like surrogate code points.
+ * Similarly, set strings match only on code point boundaries,
+ * never in the middle of a surrogate pair.
+ * Illegal UTF-8 sequences are treated like U+FFFD.
+ * When processing UTF-8 strings, malformed set strings
+ * (strings with unpaired surrogates which cannot be converted to UTF-8)
+ * are ignored.
+ *
+ * @stable ICU 3.8
+ */
+typedef enum USetSpanCondition {
+ /**
+ * Continue a span() while there is no set element at the current position.
+ * Stops before the first set element (character or string).
+ * (For code points only, this is like while contains(current)==FALSE).
+ *
+ * When span() returns, the substring between where it started and the position
+ * it returned consists only of characters that are not in the set,
+ * and none of its strings overlap with the span.
+ *
+ * @stable ICU 3.8
+ */
+ USET_SPAN_NOT_CONTAINED = 0,
+ /**
+ * Continue a span() while there is a set element at the current position.
+ * (For characters only, this is like while contains(current)==TRUE).
+ *
+ * When span() returns, the substring between where it started and the position
+ * it returned consists only of set elements (characters or strings) that are in the set.
+ *
+ * If a set contains strings, then the span will be the longest substring
+ * matching any of the possible concatenations of set elements (characters or strings).
+ * (There must be a single, non-overlapping concatenation of characters or strings.)
+ * This is equivalent to a POSIX regular expression for (OR of each set element)*.
+ *
+ * @stable ICU 3.8
+ */
+ USET_SPAN_CONTAINED = 1,
+ /**
+ * Continue a span() while there is a set element at the current position.
+ * (For characters only, this is like while contains(current)==TRUE).
+ *
+ * When span() returns, the substring between where it started and the position
+ * it returned consists only of set elements (characters or strings) that are in the set.
+ *
+ * If a set only contains single characters, then this is the same
+ * as USET_SPAN_CONTAINED.
+ *
+ * If a set contains strings, then the span will be the longest substring
+ * with a match at each position with the longest single set element (character or string).
+ *
+ * Use this span condition together with other longest-match algorithms,
+ * such as ICU converters (ucnv_getUnicodeSet()).
+ *
+ * @stable ICU 3.8
+ */
+ USET_SPAN_SIMPLE = 2,
+ /**
+ * One more than the last span condition.
+ * @stable ICU 3.8
+ */
+ USET_SPAN_CONDITION_COUNT
+} USetSpanCondition;
+
+/**
* A serialized form of a Unicode set. Limited manipulations are
* possible directly on a serialized set. See below.
* @stable ICU 2.4
@@ -118,8 +240,19 @@ typedef struct USerializedSet {
*********************************************************************/
/**
+ * Create an empty USet object.
+ * Equivalent to uset_open(1, 0).
+ * @return a newly created USet. The caller must call uset_close() on
+ * it when done.
+ * @stable ICU 4.2
+ */
+U_STABLE USet* U_EXPORT2
+uset_openEmpty();
+
+/**
* Creates a USet object that contains the range of characters
- * start..end, inclusive.
+ * start..end, inclusive. If <code>start > end</code>
+ * then an empty set is created (same as using uset_openEmpty()).
* @param start first character of the range, inclusive
* @param end last character of the range, inclusive
* @return a newly created USet. The caller must call uset_close() on
@@ -167,15 +300,89 @@ uset_openPatternOptions(const UChar* pattern, int32_t patternLength,
U_STABLE void U_EXPORT2
uset_close(USet* set);
+#if U_SHOW_CPLUSPLUS_API
+
+U_NAMESPACE_BEGIN
+
+/**
+ * \class LocalUSetPointer
+ * "Smart pointer" class, closes a USet via uset_close().
+ * For most methods see the LocalPointerBase base class.
+ *
+ * @see LocalPointerBase
+ * @see LocalPointer
+ * @stable ICU 4.4
+ */
+U_DEFINE_LOCAL_OPEN_POINTER(LocalUSetPointer, USet, uset_close);
+
+U_NAMESPACE_END
+
+#endif
+
+/**
+ * Returns a copy of this object.
+ * If this set is frozen, then the clone will be frozen as well.
+ * Use uset_cloneAsThawed() for a mutable clone of a frozen set.
+ * @param set the original set
+ * @return the newly allocated copy of the set
+ * @see uset_cloneAsThawed
+ * @stable ICU 3.8
+ */
+U_STABLE USet * U_EXPORT2
+uset_clone(const USet *set);
+
+/**
+ * Determines whether the set has been frozen (made immutable) or not.
+ * See the ICU4J Freezable interface for details.
+ * @param set the set
+ * @return TRUE/FALSE for whether the set has been frozen
+ * @see uset_freeze
+ * @see uset_cloneAsThawed
+ * @stable ICU 3.8
+ */
+U_STABLE UBool U_EXPORT2
+uset_isFrozen(const USet *set);
+
+/**
+ * Freeze the set (make it immutable).
+ * Once frozen, it cannot be unfrozen and is therefore thread-safe
+ * until it is deleted.
+ * See the ICU4J Freezable interface for details.
+ * Freezing the set may also make some operations faster, for example
+ * uset_contains() and uset_span().
+ * A frozen set will not be modified. (It remains frozen.)
+ * @param set the set
+ * @return the same set, now frozen
+ * @see uset_isFrozen
+ * @see uset_cloneAsThawed
+ * @stable ICU 3.8
+ */
+U_STABLE void U_EXPORT2
+uset_freeze(USet *set);
+
+/**
+ * Clone the set and make the clone mutable.
+ * See the ICU4J Freezable interface for details.
+ * @param set the set
+ * @return the mutable clone
+ * @see uset_freeze
+ * @see uset_isFrozen
+ * @see uset_clone
+ * @stable ICU 3.8
+ */
+U_STABLE USet * U_EXPORT2
+uset_cloneAsThawed(const USet *set);
+
/**
* Causes the USet object to represent the range <code>start - end</code>.
* If <code>start > end</code> then this USet is set to an empty range.
+ * A frozen set will not be modified.
* @param set the object to set to the given range
* @param start first character in the set, inclusive
* @param end last character in the set, inclusive
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
uset_set(USet* set,
UChar32 start, UChar32 end);
@@ -184,6 +391,7 @@ uset_set(USet* set,
* pattern. See the UnicodeSet class description for the syntax of
* the pattern language. See also the User Guide chapter about UnicodeSet.
* <em>Empties the set passed before applying the pattern.</em>
+ * A frozen set will not be modified.
* @param set The set to which the pattern is to be applied.
* @param pattern A pointer to UChar string specifying what characters are in the set.
* The character at pattern[0] must be a '['.
@@ -196,10 +404,10 @@ uset_set(USet* set,
* of the parsed pattern.
* If the status code indicates failure, then the return value
* is the index of the error in the source.
- *
- * @draft ICU 2.8
+ *
+ * @stable ICU 2.8
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uset_applyPattern(USet *set,
const UChar *pattern, int32_t patternLength,
uint32_t options,
@@ -209,6 +417,7 @@ uset_applyPattern(USet *set,
* Modifies the set to contain those code points which have the given value
* for the given binary or enumerated property, as returned by
* u_getIntPropertyValue. Prior contents of this set are lost.
+ * A frozen set will not be modified.
*
* @param set the object to contain the code points defined by the property
*
@@ -224,9 +433,9 @@ uset_applyPattern(USet *set,
*
* @param ec error code input/output parameter
*
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
uset_applyIntPropertyValue(USet* set,
UProperty prop, int32_t value, UErrorCode* ec);
@@ -234,6 +443,7 @@ uset_applyIntPropertyValue(USet* set,
* Modifies the set to contain those code points which have the
* given value for the given property. Prior contents of this
* set are lost.
+ * A frozen set will not be modified.
*
* @param set the object to contain the code points defined by the given
* property and value alias
@@ -246,7 +456,8 @@ uset_applyIntPropertyValue(USet* set,
* matched loosely and correspond to the following sets:
*
* "ANY" = [\\u0000-\\U0010FFFF],
- * "ASCII" = [\\u0000-\\u007F].
+ * "ASCII" = [\\u0000-\\u007F],
+ * "Assigned" = [:^Cn:].
*
* @param propLength the length of the prop, or -1 if NULL
*
@@ -261,9 +472,9 @@ uset_applyIntPropertyValue(USet* set,
*
* @param ec error code input/output parameter
*
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
uset_applyPropertyAlias(USet* set,
const UChar *prop, int32_t propLength,
const UChar *value, int32_t valueLength,
@@ -276,9 +487,9 @@ uset_applyPropertyAlias(USet* set,
* @param pattern a string specifying the pattern
* @param patternLength the length of the pattern, or -1 if NULL
* @param pos the given position
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
-U_DRAFT UBool U_EXPORT2
+U_STABLE UBool U_EXPORT2
uset_resemblesPattern(const UChar *pattern, int32_t patternLength,
int32_t pos);
@@ -306,6 +517,7 @@ uset_toPattern(const USet* set,
/**
* Adds the given character to the given USet. After this call,
* uset_contains(set, c) will return TRUE.
+ * A frozen set will not be modified.
* @param set the object to which to add the character
* @param c the character to add
* @stable ICU 2.4
@@ -319,6 +531,7 @@ uset_add(USet* set, UChar32 c);
* modifies this set so that its value is the <i>union</i> of the two
* sets. The behavior of this operation is unspecified if the specified
* collection is modified while the operation is in progress.
+ * A frozen set will not be modified.
*
* @param set the object to which to add the set
* @param additionalSet the source set whose elements are to be added to this set.
@@ -330,6 +543,7 @@ uset_addAll(USet* set, const USet *additionalSet);
/**
* Adds the given range of characters to the given USet. After this call,
* uset_contains(set, start, end) will return TRUE.
+ * A frozen set will not be modified.
* @param set the object to which to add the character
* @param start the first character of the range to add, inclusive
* @param end the last character of the range to add, inclusive
@@ -341,6 +555,7 @@ uset_addRange(USet* set, UChar32 start, UChar32 end);
/**
* Adds the given string to the given USet. After this call,
* uset_containsString(set, str, strLen) will return TRUE.
+ * A frozen set will not be modified.
* @param set the object to which to add the character
* @param str the string to add
* @param strLen the length of the string or -1 if null terminated.
@@ -350,8 +565,21 @@ U_STABLE void U_EXPORT2
uset_addString(USet* set, const UChar* str, int32_t strLen);
/**
+ * Adds each of the characters in this string to the set. Thus "ch" => {"c", "h"}
+ * If this set already any particular character, it has no effect on that character.
+ * A frozen set will not be modified.
+ * @param set the object to which to add the character
+ * @param str the source string
+ * @param strLen the length of the string or -1 if null terminated.
+ * @stable ICU 3.4
+ */
+U_STABLE void U_EXPORT2
+uset_addAllCodePoints(USet* set, const UChar *str, int32_t strLen);
+
+/**
* Removes the given character from the given USet. After this call,
* uset_contains(set, c) will return FALSE.
+ * A frozen set will not be modified.
* @param set the object from which to remove the character
* @param c the character to remove
* @stable ICU 2.4
@@ -362,6 +590,7 @@ uset_remove(USet* set, UChar32 c);
/**
* Removes the given range of characters from the given USet. After this call,
* uset_contains(set, start, end) will return FALSE.
+ * A frozen set will not be modified.
* @param set the object to which to add the character
* @param start the first character of the range to remove, inclusive
* @param end the last character of the range to remove, inclusive
@@ -373,6 +602,7 @@ uset_removeRange(USet* set, UChar32 start, UChar32 end);
/**
* Removes the given string to the given USet. After this call,
* uset_containsString(set, str, strLen) will return FALSE.
+ * A frozen set will not be modified.
* @param set the object to which to add the character
* @param str the string to remove
* @param strLen the length of the string or -1 if null terminated.
@@ -386,12 +616,13 @@ uset_removeString(USet* set, const UChar* str, int32_t strLen);
* specified set. This operation effectively modifies this
* set so that its value is the <i>asymmetric set difference</i> of
* the two sets.
+ * A frozen set will not be modified.
* @param set the object from which the elements are to be removed
* @param removeSet the object that defines which elements will be
* removed from this set
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
uset_removeAll(USet* set, const USet* removeSet);
/**
@@ -399,15 +630,16 @@ uset_removeAll(USet* set, const USet* removeSet);
* specified range. If <code>start > end</code> then an empty range is
* retained, leaving the set empty. This is equivalent to
* a boolean logic AND, or a set INTERSECTION.
+ * A frozen set will not be modified.
*
* @param set the object for which to retain only the specified range
* @param start first character, inclusive, of range to be retained
* to this set.
* @param end last character, inclusive, of range to be retained
* to this set.
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
uset_retain(USet* set, UChar32 start, UChar32 end);
/**
@@ -416,28 +648,31 @@ uset_retain(USet* set, UChar32 start, UChar32 end);
* its elements that are not contained in the specified set. This
* operation effectively modifies this set so that its value is
* the <i>intersection</i> of the two sets.
+ * A frozen set will not be modified.
*
* @param set the object on which to perform the retain
* @param retain set that defines which elements this set will retain
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
uset_retainAll(USet* set, const USet* retain);
/**
* Reallocate this objects internal structures to take up the least
* possible space, without changing this object's value.
+ * A frozen set will not be modified.
*
* @param set the object on which to perfrom the compact
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
uset_compact(USet* set);
/**
* Inverts this set. This operation modifies this set so that
* its value is its complement. This operation does not affect
* the multicharacter strings, if any.
+ * A frozen set will not be modified.
* @param set the set
* @stable ICU 2.4
*/
@@ -448,18 +683,20 @@ uset_complement(USet* set);
* Complements in this set all elements contained in the specified
* set. Any character in the other set will be removed if it is
* in this set, or will be added if it is not in this set.
+ * A frozen set will not be modified.
*
* @param set the set with which to complement
* @param complement set that defines which elements will be xor'ed
* from this set.
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
uset_complementAll(USet* set, const USet* complement);
/**
* Removes all of the elements from this set. This set will be
* empty after this call returns.
+ * A frozen set will not be modified.
* @param set the set
* @stable ICU 2.4
*/
@@ -467,6 +704,44 @@ U_STABLE void U_EXPORT2
uset_clear(USet* set);
/**
+ * Close this set over the given attribute. For the attribute
+ * USET_CASE, the result is to modify this set so that:
+ *
+ * 1. For each character or string 'a' in this set, all strings or
+ * characters 'b' such that foldCase(a) == foldCase(b) are added
+ * to this set.
+ *
+ * 2. For each string 'e' in the resulting set, if e !=
+ * foldCase(e), 'e' will be removed.
+ *
+ * Example: [aq\\u00DF{Bc}{bC}{Fi}] => [aAqQ\\u00DF\\uFB01{ss}{bc}{fi}]
+ *
+ * (Here foldCase(x) refers to the operation u_strFoldCase, and a
+ * == b denotes that the contents are the same, not pointer
+ * comparison.)
+ *
+ * A frozen set will not be modified.
+ *
+ * @param set the set
+ *
+ * @param attributes bitmask for attributes to close over.
+ * Currently only the USET_CASE bit is supported. Any undefined bits
+ * are ignored.
+ * @stable ICU 4.2
+ */
+U_STABLE void U_EXPORT2
+uset_closeOver(USet* set, int32_t attributes);
+
+/**
+ * Remove all strings from this set.
+ *
+ * @param set the set
+ * @stable ICU 4.2
+ */
+U_STABLE void U_EXPORT2
+uset_removeAllStrings(USet* set);
+
+/**
* Returns TRUE if the given USet contains no characters and no
* strings.
* @param set the set
@@ -478,6 +753,7 @@ uset_isEmpty(const USet* set);
/**
* Returns TRUE if the given USet contains the given character.
+ * This function works faster with a frozen set.
* @param set the set
* @param c The codepoint to check for within the set
* @return true if set contains c
@@ -517,9 +793,9 @@ uset_containsString(const USet* set, const UChar* str, int32_t strLen);
* @param set the set
* @param c the character to obtain the index for
* @return an index from 0..size()-1, or -1
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uset_indexOf(const USet* set, UChar32 c);
/**
@@ -528,12 +804,12 @@ uset_indexOf(const USet* set, UChar32 c);
* out of range, return (UChar32)-1. The inverse of this method is
* <code>indexOf()</code>.
* @param set the set
- * @param index an index from 0..size()-1 to obtain the char for
+ * @param charIndex an index from 0..size()-1 to obtain the char for
* @return the character at the given index, or (UChar32)-1.
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
-U_DRAFT UChar32 U_EXPORT2
-uset_charAt(const USet* set, int32_t index);
+U_STABLE UChar32 U_EXPORT2
+uset_charAt(const USet* set, int32_t charIndex);
/**
* Returns the number of characters and strings contained in the given
@@ -583,24 +859,37 @@ uset_getItem(const USet* set, int32_t itemIndex,
/**
* Returns true if set1 contains all the characters and strings
- * of set2. It answers the question, 'Is set1 a subset of set2?'
+ * of set2. It answers the question, 'Is set1 a superset of set2?'
* @param set1 set to be checked for containment
* @param set2 set to be checked for containment
* @return true if the test condition is met
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
-U_DRAFT UBool U_EXPORT2
+U_STABLE UBool U_EXPORT2
uset_containsAll(const USet* set1, const USet* set2);
/**
+ * Returns true if this set contains all the characters
+ * of the given string. This is does not check containment of grapheme
+ * clusters, like uset_containsString.
+ * @param set set of characters to be checked for containment
+ * @param str string containing codepoints to be checked for containment
+ * @param strLen the length of the string or -1 if null terminated.
+ * @return true if the test condition is met
+ * @stable ICU 3.4
+ */
+U_STABLE UBool U_EXPORT2
+uset_containsAllCodePoints(const USet* set, const UChar *str, int32_t strLen);
+
+/**
* Returns true if set1 contains none of the characters and strings
* of set2. It answers the question, 'Is set1 a disjoint set of set2?'
* @param set1 set to be checked for containment
* @param set2 set to be checked for containment
* @return true if the test condition is met
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
-U_DRAFT UBool U_EXPORT2
+U_STABLE UBool U_EXPORT2
uset_containsNone(const USet* set1, const USet* set2);
/**
@@ -609,20 +898,106 @@ uset_containsNone(const USet* set1, const USet* set2);
* @param set1 set to be checked for containment
* @param set2 set to be checked for containment
* @return true if the test condition is met
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
-U_DRAFT UBool U_EXPORT2
+U_STABLE UBool U_EXPORT2
uset_containsSome(const USet* set1, const USet* set2);
/**
+ * Returns the length of the initial substring of the input string which
+ * consists only of characters and strings that are contained in this set
+ * (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE),
+ * or only of characters and strings that are not contained
+ * in this set (USET_SPAN_NOT_CONTAINED).
+ * See USetSpanCondition for details.
+ * Similar to the strspn() C library function.
+ * Unpaired surrogates are treated according to contains() of their surrogate code points.
+ * This function works faster with a frozen set and with a non-negative string length argument.
+ * @param set the set
+ * @param s start of the string
+ * @param length of the string; can be -1 for NUL-terminated
+ * @param spanCondition specifies the containment condition
+ * @return the length of the initial substring according to the spanCondition;
+ * 0 if the start of the string does not fit the spanCondition
+ * @stable ICU 3.8
+ * @see USetSpanCondition
+ */
+U_STABLE int32_t U_EXPORT2
+uset_span(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
+
+/**
+ * Returns the start of the trailing substring of the input string which
+ * consists only of characters and strings that are contained in this set
+ * (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE),
+ * or only of characters and strings that are not contained
+ * in this set (USET_SPAN_NOT_CONTAINED).
+ * See USetSpanCondition for details.
+ * Unpaired surrogates are treated according to contains() of their surrogate code points.
+ * This function works faster with a frozen set and with a non-negative string length argument.
+ * @param set the set
+ * @param s start of the string
+ * @param length of the string; can be -1 for NUL-terminated
+ * @param spanCondition specifies the containment condition
+ * @return the start of the trailing substring according to the spanCondition;
+ * the string length if the end of the string does not fit the spanCondition
+ * @stable ICU 3.8
+ * @see USetSpanCondition
+ */
+U_STABLE int32_t U_EXPORT2
+uset_spanBack(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition);
+
+/**
+ * Returns the length of the initial substring of the input string which
+ * consists only of characters and strings that are contained in this set
+ * (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE),
+ * or only of characters and strings that are not contained
+ * in this set (USET_SPAN_NOT_CONTAINED).
+ * See USetSpanCondition for details.
+ * Similar to the strspn() C library function.
+ * Malformed byte sequences are treated according to contains(0xfffd).
+ * This function works faster with a frozen set and with a non-negative string length argument.
+ * @param set the set
+ * @param s start of the string (UTF-8)
+ * @param length of the string; can be -1 for NUL-terminated
+ * @param spanCondition specifies the containment condition
+ * @return the length of the initial substring according to the spanCondition;
+ * 0 if the start of the string does not fit the spanCondition
+ * @stable ICU 3.8
+ * @see USetSpanCondition
+ */
+U_STABLE int32_t U_EXPORT2
+uset_spanUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
+
+/**
+ * Returns the start of the trailing substring of the input string which
+ * consists only of characters and strings that are contained in this set
+ * (USET_SPAN_CONTAINED, USET_SPAN_SIMPLE),
+ * or only of characters and strings that are not contained
+ * in this set (USET_SPAN_NOT_CONTAINED).
+ * See USetSpanCondition for details.
+ * Malformed byte sequences are treated according to contains(0xfffd).
+ * This function works faster with a frozen set and with a non-negative string length argument.
+ * @param set the set
+ * @param s start of the string (UTF-8)
+ * @param length of the string; can be -1 for NUL-terminated
+ * @param spanCondition specifies the containment condition
+ * @return the start of the trailing substring according to the spanCondition;
+ * the string length if the end of the string does not fit the spanCondition
+ * @stable ICU 3.8
+ * @see USetSpanCondition
+ */
+U_STABLE int32_t U_EXPORT2
+uset_spanBackUTF8(const USet *set, const char *s, int32_t length, USetSpanCondition spanCondition);
+
+/**
* Returns true if set1 contains all of the characters and strings
* of set2, and vis versa. It answers the question, 'Is set1 equal to set2?'
* @param set1 set to be checked for containment
* @param set2 set to be checked for containment
* @return true if the test condition is met
- * @draft ICU 3.2
+ * @stable ICU 3.2
*/
-U_DRAFT UBool U_EXPORT2
+U_STABLE UBool U_EXPORT2
uset_equals(const USet* set1, const USet* set2);
/*********************************************************************
diff --git a/Source/JavaScriptCore/icu/unicode/ustring.h b/Source/JavaScriptCore/icu/unicode/ustring.h
index 6ebb6fbec..2ee16e99c 100644
--- a/Source/JavaScriptCore/icu/unicode/ustring.h
+++ b/Source/JavaScriptCore/icu/unicode/ustring.h
@@ -1,6 +1,6 @@
/*
**********************************************************************
-* Copyright (C) 1998-2004, International Business Machines
+* Copyright (C) 1998-2010, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
*
@@ -23,7 +23,7 @@
/** Simple declaration for u_strToTitle() to avoid including unicode/ubrk.h. @stable ICU 2.1*/
#ifndef UBRK_TYPEDEF_UBREAK_ITERATOR
# define UBRK_TYPEDEF_UBREAK_ITERATOR
- typedef void UBreakIterator;
+ typedef struct UBreakIterator UBreakIterator;
#endif
/**
@@ -65,12 +65,17 @@
* their occurrence is rare. Almost all characters in modern use require only
* a single UChar code unit (i.e., their code point values are <=0xffff).
*
- * For more details see the User Guide Strings chapter (http://oss.software.ibm.com/icu/userguide/strings.html).
+ * For more details see the User Guide Strings chapter (http://icu-project.org/userguide/strings.html).
* For a discussion of the handling of unpaired surrogates see also
* Jitterbug 2145 and its icu mailing list proposal on 2002-sep-18.
*/
/**
+ * \defgroup ustring_ustrlen String Length
+ * \ingroup ustring_strlen
+ */
+/*@{*/
+/**
* Determine the length of an array of UChar.
*
* @param s The array of UChars, NULL (U+0000) terminated.
@@ -79,6 +84,7 @@
*/
U_STABLE int32_t U_EXPORT2
u_strlen(const UChar *s);
+/*@}*/
/**
* Count Unicode code points in the length UChar code units of the string.
@@ -141,7 +147,7 @@ u_strcat(UChar *dst,
*
* @param dst The destination string.
* @param src The source string.
- * @param n The maximum number of characters to compare.
+ * @param n The maximum number of characters to append.
* @return A pointer to <code>dst</code>.
* @stable ICU 2.0
*/
@@ -898,23 +904,41 @@ u_memrchr32(const UChar *s, UChar32 c, int32_t count);
*
* Usage:
* <pre>
- * &#32; U_STRING_DECL(ustringVar1, "Quick-Fox 2", 11);
- * &#32; U_STRING_DECL(ustringVar2, "jumps 5%", 8);
- * &#32; static UBool didInit=FALSE;
- * &#32;
- * &#32; int32_t function() {
- * &#32; if(!didInit) {
- * &#32; U_STRING_INIT(ustringVar1, "Quick-Fox 2", 11);
- * &#32; U_STRING_INIT(ustringVar2, "jumps 5%", 8);
- * &#32; didInit=TRUE;
- * &#32; }
- * &#32; return u_strcmp(ustringVar1, ustringVar2);
- * &#32; }
+ * U_STRING_DECL(ustringVar1, "Quick-Fox 2", 11);
+ * U_STRING_DECL(ustringVar2, "jumps 5%", 8);
+ * static UBool didInit=FALSE;
+ *
+ * int32_t function() {
+ * if(!didInit) {
+ * U_STRING_INIT(ustringVar1, "Quick-Fox 2", 11);
+ * U_STRING_INIT(ustringVar2, "jumps 5%", 8);
+ * didInit=TRUE;
+ * }
+ * return u_strcmp(ustringVar1, ustringVar2);
+ * }
+ * </pre>
+ *
+ * Note that the macros will NOT consistently work if their argument is another #define.
+ * The following will not work on all platforms, don't use it.
+ *
+ * <pre>
+ * #define GLUCK "Mr. Gluck"
+ * U_STRING_DECL(var, GLUCK, 9)
+ * U_STRING_INIT(var, GLUCK, 9)
* </pre>
+ *
+ * Instead, use the string literal "Mr. Gluck" as the argument to both macro
+ * calls.
+ *
+ *
* @stable ICU 2.0
*/
-#if U_SIZEOF_WCHAR_T==U_SIZEOF_UCHAR && U_CHARSET_FAMILY==U_ASCII_FAMILY
-# define U_STRING_DECL(var, cs, length) static const wchar_t var[(length)+1]={ L ## cs }
+#if defined(U_DECLARE_UTF16)
+# define U_STRING_DECL(var, cs, length) static const UChar var[(length)+1]=U_DECLARE_UTF16(cs)
+ /**@stable ICU 2.0 */
+# define U_STRING_INIT(var, cs, length)
+#elif U_SIZEOF_WCHAR_T==U_SIZEOF_UCHAR && (U_CHARSET_FAMILY==U_ASCII_FAMILY || (U_SIZEOF_UCHAR == 2 && defined(U_WCHAR_IS_UTF16)))
+# define U_STRING_DECL(var, cs, length) static const UChar var[(length)+1]=L ## cs
/**@stable ICU 2.0 */
# define U_STRING_INIT(var, cs, length)
#elif U_SIZEOF_UCHAR==1 && U_CHARSET_FAMILY==U_ASCII_FAMILY
@@ -943,7 +967,7 @@ u_memrchr32(const UChar *s, UChar32 c, int32_t count);
*
* \\a => U+0007, \\b => U+0008, \\t => U+0009, \\n => U+000A,
* \\v => U+000B, \\f => U+000C, \\r => U+000D, \\e => U+001B,
- * \\" => U+0022, \\' => U+0027, \\? => U+003F, \\\\ => U+005C
+ * \\&quot; => U+0022, \\' => U+0027, \\? => U+003F, \\\\ => U+005C
*
* Anything else following a backslash is generically escaped. For
* example, "[a\\-z]" returns "[a-z]".
@@ -1096,7 +1120,7 @@ u_strToLower(UChar *dest, int32_t destCapacity,
* The standard titlecase iterator for the root locale implements the
* algorithm of Unicode TR 21.
*
- * This function uses only the first() and next() methods of the
+ * This function uses only the setText(), first() and next() methods of the
* provided break iterator.
*
* The result may be longer or shorter than the original.
@@ -1157,8 +1181,12 @@ u_strFoldCase(UChar *dest, int32_t destCapacity,
uint32_t options,
UErrorCode *pErrorCode);
+#if defined(U_WCHAR_IS_UTF16) || defined(U_WCHAR_IS_UTF32) || !UCONFIG_NO_CONVERSION
/**
- * Converts a sequence of UChars to wchar_t units.
+ * Convert a UTF-16 string to a wchar_t string.
+ * If it is known at compile time that wchar_t strings are in UTF-16 or UTF-32, then
+ * this function simply calls the fast, dedicated function for that.
+ * Otherwise, two conversions UTF-16 -> default charset -> wchar_t* are performed.
*
* @param dest A buffer for the result string. The result will be zero-terminated if
* the buffer is large enough.
@@ -1184,7 +1212,10 @@ u_strToWCS(wchar_t *dest,
int32_t srcLength,
UErrorCode *pErrorCode);
/**
- * Converts a sequence of wchar_t units to UChars
+ * Convert a wchar_t string to UTF-16.
+ * If it is known at compile time that wchar_t strings are in UTF-16 or UTF-32, then
+ * this function simply calls the fast, dedicated function for that.
+ * Otherwise, two conversions wchar_t* -> default charset -> UTF-16 are performed.
*
* @param dest A buffer for the result string. The result will be zero-terminated if
* the buffer is large enough.
@@ -1209,8 +1240,11 @@ u_strFromWCS(UChar *dest,
const wchar_t *src,
int32_t srcLength,
UErrorCode *pErrorCode);
+#endif /* defined(U_WCHAR_IS_UTF16) || defined(U_WCHAR_IS_UTF32) || !UCONFIG_NO_CONVERSION */
+
/**
- * Converts a sequence of UChars (UTF-16) to UTF-8 bytes
+ * Convert a UTF-16 string to UTF-8.
+ * If the input string is not well-formed, then the U_INVALID_CHAR_FOUND error code is set.
*
* @param dest A buffer for the result string. The result will be zero-terminated if
* the buffer is large enough.
@@ -1227,6 +1261,8 @@ u_strFromWCS(UChar *dest,
* which must not indicate a failure before the function call.
* @return The pointer to destination buffer.
* @stable ICU 2.0
+ * @see u_strToUTF8WithSub
+ * @see u_strFromUTF8
*/
U_STABLE char* U_EXPORT2
u_strToUTF8(char *dest,
@@ -1237,7 +1273,8 @@ u_strToUTF8(char *dest,
UErrorCode *pErrorCode);
/**
- * Converts a sequence of UTF-8 bytes to UChars (UTF-16).
+ * Convert a UTF-8 string to UTF-16.
+ * If the input string is not well-formed, then the U_INVALID_CHAR_FOUND error code is set.
*
* @param dest A buffer for the result string. The result will be zero-terminated if
* the buffer is large enough.
@@ -1254,6 +1291,8 @@ u_strToUTF8(char *dest,
* which must not indicate a failure before the function call.
* @return The pointer to destination buffer.
* @stable ICU 2.0
+ * @see u_strFromUTF8WithSub
+ * @see u_strFromUTF8Lenient
*/
U_STABLE UChar* U_EXPORT2
u_strFromUTF8(UChar *dest,
@@ -1264,7 +1303,158 @@ u_strFromUTF8(UChar *dest,
UErrorCode *pErrorCode);
/**
- * Converts a sequence of UChars (UTF-16) to UTF32 units.
+ * Convert a UTF-16 string to UTF-8.
+ * If the input string is not well-formed, then the U_INVALID_CHAR_FOUND error code is set.
+ *
+ * Same as u_strToUTF8() except for the additional subchar which is output for
+ * illegal input sequences, instead of stopping with the U_INVALID_CHAR_FOUND error code.
+ * With subchar==U_SENTINEL, this function behaves exactly like u_strToUTF8().
+ *
+ * @param dest A buffer for the result string. The result will be zero-terminated if
+ * the buffer is large enough.
+ * @param destCapacity The size of the buffer (number of chars). If it is 0, then
+ * dest may be NULL and the function will only return the length of the
+ * result without writing any of the result string (pre-flighting).
+ * @param pDestLength A pointer to receive the number of units written to the destination. If
+ * pDestLength!=NULL then *pDestLength is always set to the
+ * number of output units corresponding to the transformation of
+ * all the input units, even in case of a buffer overflow.
+ * @param src The original source string
+ * @param srcLength The length of the original string. If -1, then src must be zero-terminated.
+ * @param subchar The substitution character to use in place of an illegal input sequence,
+ * or U_SENTINEL if the function is to return with U_INVALID_CHAR_FOUND instead.
+ * A substitution character can be any valid Unicode code point (up to U+10FFFF)
+ * except for surrogate code points (U+D800..U+DFFF).
+ * The recommended value is U+FFFD "REPLACEMENT CHARACTER".
+ * @param pNumSubstitutions Output parameter receiving the number of substitutions if subchar>=0.
+ * Set to 0 if no substitutions occur or subchar<0.
+ * pNumSubstitutions can be NULL.
+ * @param pErrorCode Pointer to a standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return The pointer to destination buffer.
+ * @see u_strToUTF8
+ * @see u_strFromUTF8WithSub
+ * @stable ICU 3.6
+ */
+U_STABLE char* U_EXPORT2
+u_strToUTF8WithSub(char *dest,
+ int32_t destCapacity,
+ int32_t *pDestLength,
+ const UChar *src,
+ int32_t srcLength,
+ UChar32 subchar, int32_t *pNumSubstitutions,
+ UErrorCode *pErrorCode);
+
+/**
+ * Convert a UTF-8 string to UTF-16.
+ * If the input string is not well-formed, then the U_INVALID_CHAR_FOUND error code is set.
+ *
+ * Same as u_strFromUTF8() except for the additional subchar which is output for
+ * illegal input sequences, instead of stopping with the U_INVALID_CHAR_FOUND error code.
+ * With subchar==U_SENTINEL, this function behaves exactly like u_strFromUTF8().
+ *
+ * @param dest A buffer for the result string. The result will be zero-terminated if
+ * the buffer is large enough.
+ * @param destCapacity The size of the buffer (number of UChars). If it is 0, then
+ * dest may be NULL and the function will only return the length of the
+ * result without writing any of the result string (pre-flighting).
+ * @param pDestLength A pointer to receive the number of units written to the destination. If
+ * pDestLength!=NULL then *pDestLength is always set to the
+ * number of output units corresponding to the transformation of
+ * all the input units, even in case of a buffer overflow.
+ * @param src The original source string
+ * @param srcLength The length of the original string. If -1, then src must be zero-terminated.
+ * @param subchar The substitution character to use in place of an illegal input sequence,
+ * or U_SENTINEL if the function is to return with U_INVALID_CHAR_FOUND instead.
+ * A substitution character can be any valid Unicode code point (up to U+10FFFF)
+ * except for surrogate code points (U+D800..U+DFFF).
+ * The recommended value is U+FFFD "REPLACEMENT CHARACTER".
+ * @param pNumSubstitutions Output parameter receiving the number of substitutions if subchar>=0.
+ * Set to 0 if no substitutions occur or subchar<0.
+ * pNumSubstitutions can be NULL.
+ * @param pErrorCode Pointer to a standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return The pointer to destination buffer.
+ * @see u_strFromUTF8
+ * @see u_strFromUTF8Lenient
+ * @see u_strToUTF8WithSub
+ * @stable ICU 3.6
+ */
+U_STABLE UChar* U_EXPORT2
+u_strFromUTF8WithSub(UChar *dest,
+ int32_t destCapacity,
+ int32_t *pDestLength,
+ const char *src,
+ int32_t srcLength,
+ UChar32 subchar, int32_t *pNumSubstitutions,
+ UErrorCode *pErrorCode);
+
+/**
+ * Convert a UTF-8 string to UTF-16.
+ *
+ * Same as u_strFromUTF8() except that this function is designed to be very fast,
+ * which it achieves by being lenient about malformed UTF-8 sequences.
+ * This function is intended for use in environments where UTF-8 text is
+ * expected to be well-formed.
+ *
+ * Its semantics are:
+ * - Well-formed UTF-8 text is correctly converted to well-formed UTF-16 text.
+ * - The function will not read beyond the input string, nor write beyond
+ * the destCapacity.
+ * - Malformed UTF-8 results in "garbage" 16-bit Unicode strings which may not
+ * be well-formed UTF-16.
+ * The function will resynchronize to valid code point boundaries
+ * within a small number of code points after an illegal sequence.
+ * - Non-shortest forms are not detected and will result in "spoofing" output.
+ *
+ * For further performance improvement, if srcLength is given (>=0),
+ * then it must be destCapacity>=srcLength.
+ *
+ * There is no inverse u_strToUTF8Lenient() function because there is practically
+ * no performance gain from not checking that a UTF-16 string is well-formed.
+ *
+ * @param dest A buffer for the result string. The result will be zero-terminated if
+ * the buffer is large enough.
+ * @param destCapacity The size of the buffer (number of UChars). If it is 0, then
+ * dest may be NULL and the function will only return the length of the
+ * result without writing any of the result string (pre-flighting).
+ * Unlike for other ICU functions, if srcLength>=0 then it
+ * must be destCapacity>=srcLength.
+ * @param pDestLength A pointer to receive the number of units written to the destination. If
+ * pDestLength!=NULL then *pDestLength is always set to the
+ * number of output units corresponding to the transformation of
+ * all the input units, even in case of a buffer overflow.
+ * Unlike for other ICU functions, if srcLength>=0 but
+ * destCapacity<srcLength, then *pDestLength will be set to srcLength
+ * (and U_BUFFER_OVERFLOW_ERROR will be set)
+ * regardless of the actual result length.
+ * @param src The original source string
+ * @param srcLength The length of the original string. If -1, then src must be zero-terminated.
+ * @param pErrorCode Pointer to a standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return The pointer to destination buffer.
+ * @see u_strFromUTF8
+ * @see u_strFromUTF8WithSub
+ * @see u_strToUTF8WithSub
+ * @stable ICU 3.6
+ */
+U_STABLE UChar * U_EXPORT2
+u_strFromUTF8Lenient(UChar *dest,
+ int32_t destCapacity,
+ int32_t *pDestLength,
+ const char *src,
+ int32_t srcLength,
+ UErrorCode *pErrorCode);
+
+/**
+ * Convert a UTF-16 string to UTF-32.
+ * If the input string is not well-formed, then the U_INVALID_CHAR_FOUND error code is set.
*
* @param dest A buffer for the result string. The result will be zero-terminated if
* the buffer is large enough.
@@ -1280,6 +1470,8 @@ u_strFromUTF8(UChar *dest,
* @param pErrorCode Must be a valid pointer to an error code value,
* which must not indicate a failure before the function call.
* @return The pointer to destination buffer.
+ * @see u_strToUTF32WithSub
+ * @see u_strFromUTF32
* @stable ICU 2.0
*/
U_STABLE UChar32* U_EXPORT2
@@ -1291,7 +1483,8 @@ u_strToUTF32(UChar32 *dest,
UErrorCode *pErrorCode);
/**
- * Converts a sequence of UTF32 units to UChars (UTF-16)
+ * Convert a UTF-32 string to UTF-16.
+ * If the input string is not well-formed, then the U_INVALID_CHAR_FOUND error code is set.
*
* @param dest A buffer for the result string. The result will be zero-terminated if
* the buffer is large enough.
@@ -1307,6 +1500,8 @@ u_strToUTF32(UChar32 *dest,
* @param pErrorCode Must be a valid pointer to an error code value,
* which must not indicate a failure before the function call.
* @return The pointer to destination buffer.
+ * @see u_strFromUTF32WithSub
+ * @see u_strToUTF32
* @stable ICU 2.0
*/
U_STABLE UChar* U_EXPORT2
@@ -1317,4 +1512,185 @@ u_strFromUTF32(UChar *dest,
int32_t srcLength,
UErrorCode *pErrorCode);
+/**
+ * Convert a UTF-16 string to UTF-32.
+ * If the input string is not well-formed, then the U_INVALID_CHAR_FOUND error code is set.
+ *
+ * Same as u_strToUTF32() except for the additional subchar which is output for
+ * illegal input sequences, instead of stopping with the U_INVALID_CHAR_FOUND error code.
+ * With subchar==U_SENTINEL, this function behaves exactly like u_strToUTF32().
+ *
+ * @param dest A buffer for the result string. The result will be zero-terminated if
+ * the buffer is large enough.
+ * @param destCapacity The size of the buffer (number of UChar32s). If it is 0, then
+ * dest may be NULL and the function will only return the length of the
+ * result without writing any of the result string (pre-flighting).
+ * @param pDestLength A pointer to receive the number of units written to the destination. If
+ * pDestLength!=NULL then *pDestLength is always set to the
+ * number of output units corresponding to the transformation of
+ * all the input units, even in case of a buffer overflow.
+ * @param src The original source string
+ * @param srcLength The length of the original string. If -1, then src must be zero-terminated.
+ * @param subchar The substitution character to use in place of an illegal input sequence,
+ * or U_SENTINEL if the function is to return with U_INVALID_CHAR_FOUND instead.
+ * A substitution character can be any valid Unicode code point (up to U+10FFFF)
+ * except for surrogate code points (U+D800..U+DFFF).
+ * The recommended value is U+FFFD "REPLACEMENT CHARACTER".
+ * @param pNumSubstitutions Output parameter receiving the number of substitutions if subchar>=0.
+ * Set to 0 if no substitutions occur or subchar<0.
+ * pNumSubstitutions can be NULL.
+ * @param pErrorCode Pointer to a standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return The pointer to destination buffer.
+ * @see u_strToUTF32
+ * @see u_strFromUTF32WithSub
+ * @stable ICU 4.2
+ */
+U_STABLE UChar32* U_EXPORT2
+u_strToUTF32WithSub(UChar32 *dest,
+ int32_t destCapacity,
+ int32_t *pDestLength,
+ const UChar *src,
+ int32_t srcLength,
+ UChar32 subchar, int32_t *pNumSubstitutions,
+ UErrorCode *pErrorCode);
+
+/**
+ * Convert a UTF-32 string to UTF-16.
+ * If the input string is not well-formed, then the U_INVALID_CHAR_FOUND error code is set.
+ *
+ * Same as u_strFromUTF32() except for the additional subchar which is output for
+ * illegal input sequences, instead of stopping with the U_INVALID_CHAR_FOUND error code.
+ * With subchar==U_SENTINEL, this function behaves exactly like u_strFromUTF32().
+ *
+ * @param dest A buffer for the result string. The result will be zero-terminated if
+ * the buffer is large enough.
+ * @param destCapacity The size of the buffer (number of UChars). If it is 0, then
+ * dest may be NULL and the function will only return the length of the
+ * result without writing any of the result string (pre-flighting).
+ * @param pDestLength A pointer to receive the number of units written to the destination. If
+ * pDestLength!=NULL then *pDestLength is always set to the
+ * number of output units corresponding to the transformation of
+ * all the input units, even in case of a buffer overflow.
+ * @param src The original source string
+ * @param srcLength The length of the original string. If -1, then src must be zero-terminated.
+ * @param subchar The substitution character to use in place of an illegal input sequence,
+ * or U_SENTINEL if the function is to return with U_INVALID_CHAR_FOUND instead.
+ * A substitution character can be any valid Unicode code point (up to U+10FFFF)
+ * except for surrogate code points (U+D800..U+DFFF).
+ * The recommended value is U+FFFD "REPLACEMENT CHARACTER".
+ * @param pNumSubstitutions Output parameter receiving the number of substitutions if subchar>=0.
+ * Set to 0 if no substitutions occur or subchar<0.
+ * pNumSubstitutions can be NULL.
+ * @param pErrorCode Pointer to a standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return The pointer to destination buffer.
+ * @see u_strFromUTF32
+ * @see u_strToUTF32WithSub
+ * @stable ICU 4.2
+ */
+U_STABLE UChar* U_EXPORT2
+u_strFromUTF32WithSub(UChar *dest,
+ int32_t destCapacity,
+ int32_t *pDestLength,
+ const UChar32 *src,
+ int32_t srcLength,
+ UChar32 subchar, int32_t *pNumSubstitutions,
+ UErrorCode *pErrorCode);
+
+/**
+ * Convert a 16-bit Unicode string to Java Modified UTF-8.
+ * See http://java.sun.com/javase/6/docs/api/java/io/DataInput.html#modified-utf-8
+ *
+ * This function behaves according to the documentation for Java DataOutput.writeUTF()
+ * except that it does not encode the output length in the destination buffer
+ * and does not have an output length restriction.
+ * See http://java.sun.com/javase/6/docs/api/java/io/DataOutput.html#writeUTF(java.lang.String)
+ *
+ * The input string need not be well-formed UTF-16.
+ * (Therefore there is no subchar parameter.)
+ *
+ * @param dest A buffer for the result string. The result will be zero-terminated if
+ * the buffer is large enough.
+ * @param destCapacity The size of the buffer (number of chars). If it is 0, then
+ * dest may be NULL and the function will only return the length of the
+ * result without writing any of the result string (pre-flighting).
+ * @param pDestLength A pointer to receive the number of units written to the destination. If
+ * pDestLength!=NULL then *pDestLength is always set to the
+ * number of output units corresponding to the transformation of
+ * all the input units, even in case of a buffer overflow.
+ * @param src The original source string
+ * @param srcLength The length of the original string. If -1, then src must be zero-terminated.
+ * @param pErrorCode Pointer to a standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return The pointer to destination buffer.
+ * @stable ICU 4.4
+ * @see u_strToUTF8WithSub
+ * @see u_strFromJavaModifiedUTF8WithSub
+ */
+U_STABLE char* U_EXPORT2
+u_strToJavaModifiedUTF8(
+ char *dest,
+ int32_t destCapacity,
+ int32_t *pDestLength,
+ const UChar *src,
+ int32_t srcLength,
+ UErrorCode *pErrorCode);
+
+/**
+ * Convert a Java Modified UTF-8 string to a 16-bit Unicode string.
+ * If the input string is not well-formed, then the U_INVALID_CHAR_FOUND error code is set.
+ *
+ * This function behaves according to the documentation for Java DataInput.readUTF()
+ * except that it takes a length parameter rather than
+ * interpreting the first two input bytes as the length.
+ * See http://java.sun.com/javase/6/docs/api/java/io/DataInput.html#readUTF()
+ *
+ * The output string may not be well-formed UTF-16.
+ *
+ * @param dest A buffer for the result string. The result will be zero-terminated if
+ * the buffer is large enough.
+ * @param destCapacity The size of the buffer (number of UChars). If it is 0, then
+ * dest may be NULL and the function will only return the length of the
+ * result without writing any of the result string (pre-flighting).
+ * @param pDestLength A pointer to receive the number of units written to the destination. If
+ * pDestLength!=NULL then *pDestLength is always set to the
+ * number of output units corresponding to the transformation of
+ * all the input units, even in case of a buffer overflow.
+ * @param src The original source string
+ * @param srcLength The length of the original string. If -1, then src must be zero-terminated.
+ * @param subchar The substitution character to use in place of an illegal input sequence,
+ * or U_SENTINEL if the function is to return with U_INVALID_CHAR_FOUND instead.
+ * A substitution character can be any valid Unicode code point (up to U+10FFFF)
+ * except for surrogate code points (U+D800..U+DFFF).
+ * The recommended value is U+FFFD "REPLACEMENT CHARACTER".
+ * @param pNumSubstitutions Output parameter receiving the number of substitutions if subchar>=0.
+ * Set to 0 if no substitutions occur or subchar<0.
+ * pNumSubstitutions can be NULL.
+ * @param pErrorCode Pointer to a standard ICU error code. Its input value must
+ * pass the U_SUCCESS() test, or else the function returns
+ * immediately. Check for U_FAILURE() on output or use with
+ * function chaining. (See User Guide for details.)
+ * @return The pointer to destination buffer.
+ * @see u_strFromUTF8WithSub
+ * @see u_strFromUTF8Lenient
+ * @see u_strToJavaModifiedUTF8
+ * @stable ICU 4.4
+ */
+U_STABLE UChar* U_EXPORT2
+u_strFromJavaModifiedUTF8WithSub(
+ UChar *dest,
+ int32_t destCapacity,
+ int32_t *pDestLength,
+ const char *src,
+ int32_t srcLength,
+ UChar32 subchar, int32_t *pNumSubstitutions,
+ UErrorCode *pErrorCode);
+
#endif
diff --git a/Source/JavaScriptCore/icu/unicode/utf.h b/Source/JavaScriptCore/icu/unicode/utf.h
index 201691d09..f79479935 100644
--- a/Source/JavaScriptCore/icu/unicode/utf.h
+++ b/Source/JavaScriptCore/icu/unicode/utf.h
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1999-2004, International Business Machines
+* Copyright (C) 1999-2010, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -63,6 +63,14 @@
* malformed sequences can be expressed unambiguously with a distinct subrange
* of Unicode code points.)
*
+ * The regular "safe" macros require that the initial, passed-in string index
+ * is within bounds. They only check the index when they read more than one
+ * code unit. This is usually done with code similar to the following loop:
+ * <pre>while(i<length) {
+ * U16_NEXT(s, i, length, c);
+ * // use c
+ * }</pre>
+ *
* When it is safe to assume that text is well-formed UTF-16
* (does not contain single, unpaired surrogates), then one can use
* U16_..._UNSAFE macros.
@@ -80,12 +88,14 @@
* The unsafe UTF-8 macros are entirely implemented inside the macro definitions
* and are fast, while the safe UTF-8 macros call functions for all but the
* trivial (ASCII) cases.
+ * (ICU 3.6 optimizes U8_NEXT() and U8_APPEND() to handle most other common
+ * characters inline as well.)
*
* Unlike with UTF-16, malformed sequences cannot be expressed with distinct
* code point values (0..U+10ffff). They are indicated with negative values instead.
*
* For more information see the ICU User Guide Strings chapter
- * (http://oss.software.ibm.com/icu/userguide/).
+ * (http://icu-project.org/userguide/strings.html).
*
* <em>Usage:</em>
* ICU coding guidelines for if() statements should be followed when using these macros.
@@ -157,13 +167,11 @@
(uint32_t)(c)<=0x10ffff && \
!U_IS_UNICODE_NONCHAR(c)))
-#ifndef U_HIDE_DRAFT_API
-
/**
* Is this code point a BMP code point (U+0000..U+ffff)?
* @param c 32-bit code point
* @return TRUE or FALSE
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
#define U_IS_BMP(c) ((uint32_t)(c)<=0xffff)
@@ -171,11 +179,9 @@
* Is this code point a supplementary code point (U+10000..U+10ffff)?
* @param c 32-bit code point
* @return TRUE or FALSE
- * @draft ICU 2.8
+ * @stable ICU 2.8
*/
#define U_IS_SUPPLEMENTARY(c) ((uint32_t)((c)-0x10000)<=0xfffff)
-
-#endif /*U_HIDE_DRAFT_API*/
/**
* Is this code point a lead surrogate (U+d800..U+dbff)?
@@ -210,6 +216,15 @@
*/
#define U_IS_SURROGATE_LEAD(c) (((c)&0x400)==0)
+/**
+ * Assuming c is a surrogate code point (U_IS_SURROGATE(c)),
+ * is it a trail surrogate?
+ * @param c 32-bit code point
+ * @return TRUE or FALSE
+ * @stable ICU 4.2
+ */
+#define U_IS_SURROGATE_TRAIL(c) (((c)&0x400)!=0)
+
/* include the utfXX.h ------------------------------------------------------ */
#include "unicode/utf8.h"
diff --git a/Source/JavaScriptCore/icu/unicode/utf16.h b/Source/JavaScriptCore/icu/unicode/utf16.h
index 7bf387207..5079c1146 100644
--- a/Source/JavaScriptCore/icu/unicode/utf16.h
+++ b/Source/JavaScriptCore/icu/unicode/utf16.h
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1999-2004, International Business Machines
+* Copyright (C) 1999-2010, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -23,7 +23,7 @@
* and some common definitions.
*
* For more information see utf.h and the ICU User Guide Strings chapter
- * (http://oss.software.ibm.com/icu/userguide/).
+ * (http://icu-project.org/userguide/strings.html).
*
* <em>Usage:</em>
* ICU coding guidelines for if() statements should be followed when using these macros.
@@ -83,6 +83,15 @@
#define U16_IS_SURROGATE_LEAD(c) (((c)&0x400)==0)
/**
+ * Assuming c is a surrogate code point (U16_IS_SURROGATE(c)),
+ * is it a trail surrogate?
+ * @param c 16-bit code unit
+ * @return TRUE or FALSE
+ * @stable ICU 4.2
+ */
+#define U16_IS_SURROGATE_TRAIL(c) (((c)&0x400)!=0)
+
+/**
* Helper constant for U16_GET_SUPPLEMENTARY.
* @internal
*/
@@ -179,7 +188,7 @@
*
* @param s const UChar * string
* @param start starting string offset (usually 0)
- * @param i string offset, start<=i<length
+ * @param i string offset, must be start<=i<length
* @param length string length
* @param c output UChar32 variable
* @see U16_GET_UNSAFE
@@ -194,7 +203,7 @@
(c)=U16_GET_SUPPLEMENTARY((c), __c2); \
} \
} else { \
- if((i)-1>=(start) && U16_IS_LEAD(__c2=(s)[(i)-1])) { \
+ if((i)>(start) && U16_IS_LEAD(__c2=(s)[(i)-1])) { \
(c)=U16_GET_SUPPLEMENTARY(__c2, (c)); \
} \
} \
@@ -243,7 +252,7 @@
* will be returned as the code point.
*
* @param s const UChar * string
- * @param i string offset, i<length
+ * @param i string offset, must be i<length
* @param length string length
* @param c output UChar32 variable
* @see U16_NEXT_UNSAFE
@@ -292,7 +301,7 @@
* then isError is set to TRUE.
*
* @param s const UChar * string buffer
- * @param i string offset, i<length
+ * @param i string offset, must be i<capacity
* @param capacity size of the string buffer
* @param c code point to append
* @param isError output UBool set to TRUE if an error occurs, otherwise not modified
@@ -332,7 +341,7 @@
* "Safe" macro, handles unpaired surrogates and checks for string boundaries.
*
* @param s const UChar * string
- * @param i string offset, i<length
+ * @param i string offset, must be i<length
* @param length string length
* @see U16_FWD_1_UNSAFE
* @stable ICU 2.4
@@ -370,7 +379,7 @@
* "Safe" macro, handles unpaired surrogates and checks for string boundaries.
*
* @param s const UChar * string
- * @param i string offset, i<length
+ * @param i string offset, must be i<length
* @param length string length
* @param n number of code points to skip
* @see U16_FWD_N_UNSAFE
@@ -413,7 +422,7 @@
*
* @param s const UChar * string
* @param start starting string offset (usually 0)
- * @param i string offset, start<=i
+ * @param i string offset, must be start<=i
* @see U16_SET_CP_START_UNSAFE
* @stable ICU 2.4
*/
@@ -468,7 +477,7 @@
*
* @param s const UChar * string
* @param start starting string offset (usually 0)
- * @param i string offset, start<=i
+ * @param i string offset, must be start<i
* @param c output UChar32 variable
* @see U16_PREV_UNSAFE
* @stable ICU 2.4
@@ -509,7 +518,7 @@
*
* @param s const UChar * string
* @param start starting string offset (usually 0)
- * @param i string offset, start<=i
+ * @param i string offset, must be start<i
* @see U16_BACK_1_UNSAFE
* @stable ICU 2.4
*/
@@ -549,7 +558,7 @@
*
* @param s const UChar * string
* @param start start of string
- * @param i string offset, i<length
+ * @param i string offset, must be start<i
* @param n number of code points to skip
* @see U16_BACK_N_UNSAFE
* @stable ICU 2.4
diff --git a/Source/JavaScriptCore/icu/unicode/utf8.h b/Source/JavaScriptCore/icu/unicode/utf8.h
index f83662bad..6405795a5 100644
--- a/Source/JavaScriptCore/icu/unicode/utf8.h
+++ b/Source/JavaScriptCore/icu/unicode/utf8.h
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 1999-2004, International Business Machines
+* Copyright (C) 1999-2009, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -23,7 +23,7 @@
* and some common definitions.
*
* For more information see utf.h and the ICU User Guide Strings chapter
- * (http://oss.software.ibm.com/icu/userguide/).
+ * (http://icu-project.org/userguide/strings.html).
*
* <em>Usage:</em>
* ICU coding guidelines for if() statements should be followed when using these macros.
@@ -45,11 +45,16 @@
* \var utf8_countTrailBytes
* Internal array with numbers of trail bytes for any given byte used in
* lead byte position.
+ *
+ * This is internal since it is not meant to be called directly by external clients;
+ * however it is called by public macros in this file and thus must remain stable,
+ * and should not be hidden when other internal functions are hidden (otherwise
+ * public macros would fail to compile).
* @internal
*/
#ifdef U_UTF8_IMPL
-U_INTERNAL const uint8_t
-#elif defined(U_STATIC_IMPLEMENTATION)
+U_EXPORT const uint8_t
+#elif defined(U_STATIC_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION)
U_CFUNC const uint8_t
#else
U_CFUNC U_IMPORT const uint8_t /* U_IMPORT2? */ /*U_IMPORT*/
@@ -58,42 +63,68 @@ utf8_countTrailBytes[256];
/**
* Count the trail bytes for a UTF-8 lead byte.
+ *
+ * This is internal since it is not meant to be called directly by external clients;
+ * however it is called by public macros in this file and thus must remain stable.
* @internal
*/
#define U8_COUNT_TRAIL_BYTES(leadByte) (utf8_countTrailBytes[(uint8_t)leadByte])
/**
* Mask a UTF-8 lead byte, leave only the lower bits that form part of the code point value.
+ *
+ * This is internal since it is not meant to be called directly by external clients;
+ * however it is called by public macros in this file and thus must remain stable.
* @internal
*/
#define U8_MASK_LEAD_BYTE(leadByte, countTrailBytes) ((leadByte)&=(1<<(6-(countTrailBytes)))-1)
/**
* Function for handling "next code point" with error-checking.
+ *
+ * This is internal since it is not meant to be called directly by external clients;
+ * however it is U_STABLE (not U_INTERNAL) since it is called by public macros in this
+ * file and thus must remain stable, and should not be hidden when other internal
+ * functions are hidden (otherwise public macros would fail to compile).
* @internal
*/
-U_INTERNAL UChar32 U_EXPORT2
+U_STABLE UChar32 U_EXPORT2
utf8_nextCharSafeBody(const uint8_t *s, int32_t *pi, int32_t length, UChar32 c, UBool strict);
/**
* Function for handling "append code point" with error-checking.
+ *
+ * This is internal since it is not meant to be called directly by external clients;
+ * however it is U_STABLE (not U_INTERNAL) since it is called by public macros in this
+ * file and thus must remain stable, and should not be hidden when other internal
+ * functions are hidden (otherwise public macros would fail to compile).
* @internal
*/
-U_INTERNAL int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
utf8_appendCharSafeBody(uint8_t *s, int32_t i, int32_t length, UChar32 c, UBool *pIsError);
/**
* Function for handling "previous code point" with error-checking.
+ *
+ * This is internal since it is not meant to be called directly by external clients;
+ * however it is U_STABLE (not U_INTERNAL) since it is called by public macros in this
+ * file and thus must remain stable, and should not be hidden when other internal
+ * functions are hidden (otherwise public macros would fail to compile).
* @internal
*/
-U_INTERNAL UChar32 U_EXPORT2
+U_STABLE UChar32 U_EXPORT2
utf8_prevCharSafeBody(const uint8_t *s, int32_t start, int32_t *pi, UChar32 c, UBool strict);
/**
* Function for handling "skip backward one code point" with error-checking.
+ *
+ * This is internal since it is not meant to be called directly by external clients;
+ * however it is U_STABLE (not U_INTERNAL) since it is called by public macros in this
+ * file and thus must remain stable, and should not be hidden when other internal
+ * functions are hidden (otherwise public macros would fail to compile).
* @internal
*/
-U_INTERNAL int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i);
/* single-code point definitions -------------------------------------------- */
@@ -181,7 +212,7 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i);
*
* @param s const uint8_t * string
* @param start starting string offset
- * @param i string offset, start<=i<length
+ * @param i string offset, must be start<=i<length
* @param length string length
* @param c output UChar32 variable, set to <0 in case of an error
* @see U8_GET_UNSAFE
@@ -213,7 +244,7 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i);
* @stable ICU 2.4
*/
#define U8_NEXT_UNSAFE(s, i, c) { \
- (c)=(s)[(i)++]; \
+ (c)=(uint8_t)(s)[(i)++]; \
if((uint8_t)((c)-0xc0)<0x35) { \
uint8_t __count=U8_COUNT_TRAIL_BYTES(c); \
U8_MASK_LEAD_BYTE(c, __count); \
@@ -243,16 +274,34 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i);
* c is set to a negative value.
*
* @param s const uint8_t * string
- * @param i string offset, i<length
+ * @param i string offset, must be i<length
* @param length string length
* @param c output UChar32 variable, set to <0 in case of an error
* @see U8_NEXT_UNSAFE
* @stable ICU 2.4
*/
#define U8_NEXT(s, i, length, c) { \
- (c)=(s)[(i)++]; \
- if(((uint8_t)(c))>=0x80) { \
- if(U8_IS_LEAD(c)) { \
+ (c)=(uint8_t)(s)[(i)++]; \
+ if((c)>=0x80) { \
+ uint8_t __t1, __t2; \
+ if( /* handle U+1000..U+CFFF inline */ \
+ (0xe0<(c) && (c)<=0xec) && \
+ (((i)+1)<(length)) && \
+ (__t1=(uint8_t)((s)[i]-0x80))<=0x3f && \
+ (__t2=(uint8_t)((s)[(i)+1]-0x80))<= 0x3f \
+ ) { \
+ /* no need for (c&0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */ \
+ (c)=(UChar)(((c)<<12)|(__t1<<6)|__t2); \
+ (i)+=2; \
+ } else if( /* handle U+0080..U+07FF inline */ \
+ ((c)<0xe0 && (c)>=0xc2) && \
+ ((i)<(length)) && \
+ (__t1=(uint8_t)((s)[i]-0x80))<=0x3f \
+ ) { \
+ (c)=(UChar)((((c)&0x1f)<<6)|__t1); \
+ ++(i); \
+ } else if(U8_IS_LEAD(c)) { \
+ /* function call for "complicated" and error cases */ \
(c)=utf8_nextCharSafeBody((const uint8_t *)s, &(i), (int32_t)(length), c, -1); \
} else { \
(c)=U_SENTINEL; \
@@ -293,7 +342,7 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i);
}
/**
- * Append a code point to a string, overwriting 1 or 2 code units.
+ * Append a code point to a string, overwriting 1 to 4 bytes.
* The offset points to the current end of the string contents
* and is advanced (post-increment).
* "Safe" macro, checks for a valid code point.
@@ -302,18 +351,25 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i);
* then isError is set to TRUE.
*
* @param s const uint8_t * string buffer
- * @param i string offset, i<length
- * @param length size of the string buffer
+ * @param i string offset, must be i<capacity
+ * @param capacity size of the string buffer
* @param c code point to append
* @param isError output UBool set to TRUE if an error occurs, otherwise not modified
* @see U8_APPEND_UNSAFE
* @stable ICU 2.4
*/
-#define U8_APPEND(s, i, length, c, isError) { \
+#define U8_APPEND(s, i, capacity, c, isError) { \
if((uint32_t)(c)<=0x7f) { \
(s)[(i)++]=(uint8_t)(c); \
+ } else if((uint32_t)(c)<=0x7ff && (i)+1<(capacity)) { \
+ (s)[(i)++]=(uint8_t)(((c)>>6)|0xc0); \
+ (s)[(i)++]=(uint8_t)(((c)&0x3f)|0x80); \
+ } else if((uint32_t)(c)<=0xd7ff && (i)+2<(capacity)) { \
+ (s)[(i)++]=(uint8_t)(((c)>>12)|0xe0); \
+ (s)[(i)++]=(uint8_t)((((c)>>6)&0x3f)|0x80); \
+ (s)[(i)++]=(uint8_t)(((c)&0x3f)|0x80); \
} else { \
- (i)=utf8_appendCharSafeBody(s, (int32_t)(i), (int32_t)(length), c, &(isError)); \
+ (i)=utf8_appendCharSafeBody(s, (int32_t)(i), (int32_t)(capacity), c, &(isError)); \
} \
}
@@ -337,13 +393,13 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i);
* "Safe" macro, checks for illegal sequences and for string boundaries.
*
* @param s const uint8_t * string
- * @param i string offset, i<length
+ * @param i string offset, must be i<length
* @param length string length
* @see U8_FWD_1_UNSAFE
* @stable ICU 2.4
*/
#define U8_FWD_1(s, i, length) { \
- uint8_t __b=(s)[(i)++]; \
+ uint8_t __b=(uint8_t)(s)[(i)++]; \
if(U8_IS_LEAD(__b)) { \
uint8_t __count=U8_COUNT_TRAIL_BYTES(__b); \
if((i)+__count>(length)) { \
@@ -383,7 +439,7 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i);
* "Safe" macro, checks for illegal sequences and for string boundaries.
*
* @param s const uint8_t * string
- * @param i string offset, i<length
+ * @param i string offset, must be i<length
* @param length string length
* @param n number of code points to skip
* @see U8_FWD_N_UNSAFE
@@ -424,7 +480,7 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i);
*
* @param s const uint8_t * string
* @param start starting string offset (usually 0)
- * @param i string offset, start<=i
+ * @param i string offset, must be start<=i
* @see U8_SET_CP_START_UNSAFE
* @stable ICU 2.4
*/
@@ -456,14 +512,14 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i);
* @stable ICU 2.4
*/
#define U8_PREV_UNSAFE(s, i, c) { \
- (c)=(s)[--(i)]; \
+ (c)=(uint8_t)(s)[--(i)]; \
if(U8_IS_TRAIL(c)) { \
uint8_t __b, __count=1, __shift=6; \
\
/* c is a trail byte */ \
(c)&=0x3f; \
for(;;) { \
- __b=(s)[--(i)]; \
+ __b=(uint8_t)(s)[--(i)]; \
if(__b>=0xc0) { \
U8_MASK_LEAD_BYTE(__b, __count); \
(c)|=(UChar32)__b<<__shift; \
@@ -492,16 +548,16 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i);
*
* @param s const uint8_t * string
* @param start starting string offset (usually 0)
- * @param i string offset, start<=i
+ * @param i string offset, must be start<i
* @param c output UChar32 variable, set to <0 in case of an error
* @see U8_PREV_UNSAFE
* @stable ICU 2.4
*/
#define U8_PREV(s, start, i, c) { \
- (c)=(s)[--(i)]; \
+ (c)=(uint8_t)(s)[--(i)]; \
if((c)>=0x80) { \
if((c)<=0xbf) { \
- (c)=utf8_prevCharSafeBody(s, start, &(i), c, -1); \
+ (c)=utf8_prevCharSafeBody((const uint8_t *)s, start, &(i), c, -1); \
} else { \
(c)=U_SENTINEL; \
} \
@@ -531,7 +587,7 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i);
*
* @param s const uint8_t * string
* @param start starting string offset (usually 0)
- * @param i string offset, start<=i
+ * @param i string offset, must be start<i
* @see U8_BACK_1_UNSAFE
* @stable ICU 2.4
*/
@@ -571,7 +627,7 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i);
*
* @param s const uint8_t * string
* @param start index of the start of the string
- * @param i string offset, i<length
+ * @param i string offset, must be start<i
* @param n number of code points to skip
* @see U8_BACK_N_UNSAFE
* @stable ICU 2.4
@@ -612,7 +668,7 @@ utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i);
*
* @param s const uint8_t * string
* @param start starting string offset (usually 0)
- * @param i string offset, start<=i<=length
+ * @param i string offset, must be start<=i<=length
* @param length string length
* @see U8_SET_CP_LIMIT_UNSAFE
* @stable ICU 2.4
diff --git a/Source/JavaScriptCore/icu/unicode/utypes.h b/Source/JavaScriptCore/icu/unicode/utypes.h
index e20cd7933..00bf14ce8 100644
--- a/Source/JavaScriptCore/icu/unicode/utypes.h
+++ b/Source/JavaScriptCore/icu/unicode/utypes.h
@@ -1,6 +1,6 @@
/*
**********************************************************************
-* Copyright (C) 1996-2004, International Business Machines
+* Copyright (C) 1996-2010, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
*
@@ -38,6 +38,43 @@
#include "unicode/uversion.h"
#include "unicode/uconfig.h"
+/*!
+ * \file
+ * \brief Basic definitions for ICU, for both C and C++ APIs
+ *
+ * This file defines basic types, constants, and enumerations directly or
+ * indirectly by including other header files, especially utf.h for the
+ * basic character and string definitions and umachine.h for consistent
+ * integer and other types.
+ */
+
+
+/**
+ * \def U_SHOW_CPLUSPLUS_API
+ * @internal
+ */
+#ifdef XP_CPLUSPLUS
+# ifndef U_SHOW_CPLUSPLUS_API
+# define U_SHOW_CPLUSPLUS_API 1
+# endif
+#else
+# undef U_SHOW_CPLUSPLUS_API
+# define U_SHOW_CPLUSPLUS_API 0
+#endif
+
+/** @{ API visibility control */
+
+/**
+ * \def U_HIDE_DRAFT_API
+ * Define this to 1 to request that draft API be "hidden"
+ */
+#if !U_DEFAULT_SHOW_DRAFT && !defined(U_SHOW_DRAFT_API)
+#define U_HIDE_DRAFT_API 1
+#endif
+#if !U_DEFAULT_SHOW_DRAFT && !defined(U_SHOW_INTERNAL_API)
+#define U_HIDE_INTERNAL_API 1
+#endif
+
#ifdef U_HIDE_DRAFT_API
#include "unicode/udraft.h"
#endif
@@ -50,16 +87,16 @@
#include "unicode/uobslete.h"
#endif
+#ifdef U_HIDE_INTERNAL_API
+#include "unicode/uintrnal.h"
+#endif
+
+#ifdef U_HIDE_SYSTEM_API
+#include "unicode/usystem.h"
+#endif
+
+/** @} */
-/*!
- * \file
- * \brief Basic definitions for ICU, for both C and C++ APIs
- *
- * This file defines basic types, constants, and enumerations directly or
- * indirectly by including other header files, especially utf.h for the
- * basic character and string definitions and umachine.h for consistent
- * integer and other types.
- */
/*===========================================================================*/
/* char Character set family */
@@ -124,6 +161,30 @@
# define U_CHARSET_FAMILY 0
#endif
+/**
+ * \def U_CHARSET_IS_UTF8
+ *
+ * Hardcode the default charset to UTF-8.
+ *
+ * If this is set to 1, then
+ * - ICU will assume that all non-invariant char*, StringPiece, std::string etc.
+ * contain UTF-8 text, regardless of what the system API uses
+ * - some ICU code will use fast functions like u_strFromUTF8()
+ * rather than the more general and more heavy-weight conversion API (ucnv.h)
+ * - ucnv_getDefaultName() always returns "UTF-8"
+ * - ucnv_setDefaultName() is disabled and will not change the default charset
+ * - static builds of ICU are smaller
+ * - more functionality is available with the UCONFIG_NO_CONVERSION build-time
+ * configuration option (see unicode/uconfig.h)
+ * - the UCONFIG_NO_CONVERSION build option in uconfig.h is more usable
+ *
+ * @stable ICU 4.2
+ * @see UCONFIG_NO_CONVERSION
+ */
+#ifndef U_CHARSET_IS_UTF8
+# define U_CHARSET_IS_UTF8 0
+#endif
+
/*===========================================================================*/
/* ICUDATA naming scheme */
/*===========================================================================*/
@@ -171,29 +232,36 @@
* ICU 1.8.x on EBCDIC, etc..
* @stable ICU 2.0
*/
-#define U_ICUDATA_NAME "icudt" U_ICU_VERSION_SHORT U_ICUDATA_TYPE_LETTER
-
+#define U_ICUDATA_NAME "icudt" U_ICU_VERSION_SHORT U_ICUDATA_TYPE_LETTER /**< @internal */
+#define U_USRDATA_NAME "usrdt" U_ICU_VERSION_SHORT U_ICUDATA_TYPE_LETTER /**< @internal */
+#define U_USE_USRDATA 0 /**< @internal */
/**
* U_ICU_ENTRY_POINT is the name of the DLL entry point to the ICU data library.
* Defined as a literal, not a string.
* Tricky Preprocessor use - ## operator replaces macro paramters with the literal string
* from the corresponding macro invocation, _before_ other macro substitutions.
- * Need a nested #defines to get the actual version numbers rather than
+ * Need a nested \#defines to get the actual version numbers rather than
* the literal text U_ICU_VERSION_MAJOR_NUM into the name.
* The net result will be something of the form
- * #define U_ICU_ENTRY_POINT icudt19_dat
+ * \#define U_ICU_ENTRY_POINT icudt19_dat
* @stable ICU 2.4
*/
#define U_ICUDATA_ENTRY_POINT U_DEF2_ICUDATA_ENTRY_POINT(U_ICU_VERSION_MAJOR_NUM, U_ICU_VERSION_MINOR_NUM)
+
/**
+ * Do not use.
* @internal
*/
#define U_DEF2_ICUDATA_ENTRY_POINT(major, minor) U_DEF_ICUDATA_ENTRY_POINT(major, minor)
/**
+ * Do not use.
* @internal
*/
+#ifndef U_DEF_ICUDATA_ENTRY_POINT
+/* affected by symbol renaming. See platform.h */
#define U_DEF_ICUDATA_ENTRY_POINT(major, minor) icudt##major##minor##_dat
+#endif
/**
* \def U_CALLCONV
@@ -206,7 +274,7 @@
* you must use the U_CAPI and U_EXPORT2 qualifiers.
* @stable ICU 2.0
*/
-#if defined(OS390) && (__COMPILER_VER__ < 0x41020000) && defined(XP_CPLUSPLUS)
+#if defined(OS390) && defined(XP_CPLUSPLUS)
# define U_CALLCONV __cdecl
#else
# define U_CALLCONV U_EXPORT2
@@ -318,7 +386,7 @@ typedef void* UClassID;
* \def U_DATA_API
* Set to export library symbols from inside the stubdata library,
* and to import them from outside.
- * @draft ICU 3.0
+ * @stable ICU 3.0
*/
/**
@@ -356,6 +424,13 @@ typedef void* UClassID;
* @stable ICU 2.0
*/
+/**
+ * \def U_TOOLUTIL_API
+ * Set to export library symbols from inside the toolutil library,
+ * and to import them from outside.
+ * @stable ICU 3.4
+ */
+
#if defined(U_COMBINED_IMPLEMENTATION)
#define U_DATA_API U_EXPORT
#define U_COMMON_API U_EXPORT
@@ -363,6 +438,7 @@ typedef void* UClassID;
#define U_LAYOUT_API U_EXPORT
#define U_LAYOUTEX_API U_EXPORT
#define U_IO_API U_EXPORT
+#define U_TOOLUTIL_API U_EXPORT
#elif defined(U_STATIC_IMPLEMENTATION)
#define U_DATA_API
#define U_COMMON_API
@@ -370,6 +446,7 @@ typedef void* UClassID;
#define U_LAYOUT_API
#define U_LAYOUTEX_API
#define U_IO_API
+#define U_TOOLUTIL_API
#elif defined(U_COMMON_IMPLEMENTATION)
#define U_DATA_API U_IMPORT
#define U_COMMON_API U_EXPORT
@@ -377,6 +454,7 @@ typedef void* UClassID;
#define U_LAYOUT_API U_IMPORT
#define U_LAYOUTEX_API U_IMPORT
#define U_IO_API U_IMPORT
+#define U_TOOLUTIL_API U_IMPORT
#elif defined(U_I18N_IMPLEMENTATION)
#define U_DATA_API U_IMPORT
#define U_COMMON_API U_IMPORT
@@ -384,6 +462,7 @@ typedef void* UClassID;
#define U_LAYOUT_API U_IMPORT
#define U_LAYOUTEX_API U_IMPORT
#define U_IO_API U_IMPORT
+#define U_TOOLUTIL_API U_IMPORT
#elif defined(U_LAYOUT_IMPLEMENTATION)
#define U_DATA_API U_IMPORT
#define U_COMMON_API U_IMPORT
@@ -391,6 +470,7 @@ typedef void* UClassID;
#define U_LAYOUT_API U_EXPORT
#define U_LAYOUTEX_API U_IMPORT
#define U_IO_API U_IMPORT
+#define U_TOOLUTIL_API U_IMPORT
#elif defined(U_LAYOUTEX_IMPLEMENTATION)
#define U_DATA_API U_IMPORT
#define U_COMMON_API U_IMPORT
@@ -398,6 +478,7 @@ typedef void* UClassID;
#define U_LAYOUT_API U_IMPORT
#define U_LAYOUTEX_API U_EXPORT
#define U_IO_API U_IMPORT
+#define U_TOOLUTIL_API U_IMPORT
#elif defined(U_IO_IMPLEMENTATION)
#define U_DATA_API U_IMPORT
#define U_COMMON_API U_IMPORT
@@ -405,6 +486,15 @@ typedef void* UClassID;
#define U_LAYOUT_API U_IMPORT
#define U_LAYOUTEX_API U_IMPORT
#define U_IO_API U_EXPORT
+#define U_TOOLUTIL_API U_IMPORT
+#elif defined(U_TOOLUTIL_IMPLEMENTATION)
+#define U_DATA_API U_IMPORT
+#define U_COMMON_API U_IMPORT
+#define U_I18N_API U_IMPORT
+#define U_LAYOUT_API U_IMPORT
+#define U_LAYOUTEX_API U_IMPORT
+#define U_IO_API U_IMPORT
+#define U_TOOLUTIL_API U_EXPORT
#else
#define U_DATA_API U_IMPORT
#define U_COMMON_API U_IMPORT
@@ -412,6 +502,7 @@ typedef void* UClassID;
#define U_LAYOUT_API U_IMPORT
#define U_LAYOUTEX_API U_IMPORT
#define U_IO_API U_IMPORT
+#define U_TOOLUTIL_API U_IMPORT
#endif
/**
@@ -449,10 +540,11 @@ typedef void* UClassID;
*
* Note: This is currently only done on Windows because
* some Linux/Unix compilers have problems with defining global new/delete.
- * On Windows, WIN32 is defined, and it is _MSC_Ver>=1200 for MSVC 6.0 and higher.
+ * On Windows, U_WINDOWS is defined, and it is _MSC_VER>=1200 for MSVC 6.0 and higher.
*/
-#if defined(XP_CPLUSPLUS) && defined(WIN32) && (_MSC_Ver>=1200) && (defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || defined(U_LAYOUT_IMPLEMENTATION) || defined(U_USTDIO_IMPLEMENTATION))
+#if defined(XP_CPLUSPLUS) && defined(WIN32) && U_DEBUG && U_OVERRIDE_CXX_ALLOCATION && (_MSC_VER>=1200) && !defined(U_STATIC_IMPLEMENTATION) && (defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION) || defined(U_LAYOUT_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION))
+#ifndef U_HIDE_INTERNAL_API
/**
* Global operator new, defined only inside ICU4C, must not be used.
* Crashes intentionally.
@@ -465,6 +557,10 @@ operator new(size_t /*size*/) {
return q;
}
+#ifdef _Ret_bytecap_
+/* This is only needed to suppress a Visual C++ 2008 warning for operator new[]. */
+_Ret_bytecap_(_Size)
+#endif
/**
* Global operator new[], defined only inside ICU4C, must not be used.
* Crashes intentionally.
@@ -499,6 +595,7 @@ operator delete[](void * /*p*/) {
*q=5; /* break it */
}
+#endif /* U_HIDE_INTERNAL_API */
#endif
/*===========================================================================*/
@@ -542,6 +639,8 @@ typedef enum UErrorCode {
U_AMBIGUOUS_ALIAS_WARNING = -122, /**< This converter alias can go to different converter implementations */
U_DIFFERENT_UCA_VERSION = -121, /**< ucol_open encountered a mismatch between UCA version and collator image version, so the collator was constructed from rules. No impact to further function */
+
+ U_PLUGIN_CHANGED_LEVEL_WARNING = -120, /**< A plugin caused a level change. May not be an error, but later plugins may not load. */
U_ERROR_WARNING_LIMIT, /**< This must always be the last warning value to indicate the limit for UErrorCode warnings (last warning code +1) */
@@ -559,7 +658,7 @@ typedef enum UErrorCode {
U_PARSE_ERROR = 9, /**< Equivalent to Java ParseException */
U_INVALID_CHAR_FOUND = 10, /**< Character conversion: Unmappable input sequence. In other APIs: Invalid character. */
U_TRUNCATED_CHAR_FOUND = 11, /**< Character conversion: Incomplete input sequence. */
- U_ILLEGAL_CHAR_FOUND = 12, /**< Character conversion: Illegal input sequence/combination of input units.. */
+ U_ILLEGAL_CHAR_FOUND = 12, /**< Character conversion: Illegal input sequence/combination of input units. */
U_INVALID_TABLE_FORMAT = 13, /**< Conversion table file found, but corrupted */
U_INVALID_TABLE_FILE = 14, /**< Conversion table file not found */
U_BUFFER_OVERFLOW_ERROR = 15, /**< A result would not fit in the supplied buffer */
@@ -578,6 +677,7 @@ typedef enum UErrorCode {
U_INVALID_STATE_ERROR = 27, /**< Requested operation can not be completed with ICU in its current state */
U_COLLATOR_VERSION_MISMATCH = 28, /**< Collator version is not compatible with the base version */
U_USELESS_COLLATOR_ERROR = 29, /**< Collator is options only and no base is specified */
+ U_NO_WRITE_PERMISSION = 30, /**< Attempt to modify read-only or constant data. */
U_STANDARD_ERROR_LIMIT, /**< This must always be the last value to indicate the limit for standard errors */
/*
@@ -638,13 +738,18 @@ typedef enum UErrorCode {
U_UNMATCHED_BRACES, /**< Braces do not match in message pattern */
U_UNSUPPORTED_PROPERTY, /**< UNUSED as of ICU 2.4 */
U_UNSUPPORTED_ATTRIBUTE, /**< UNUSED as of ICU 2.4 */
+ U_ARGUMENT_TYPE_MISMATCH, /**< Argument name and argument index mismatch in MessageFormat functions */
+ U_DUPLICATE_KEYWORD, /**< Duplicate keyword in PluralFormat */
+ U_UNDEFINED_KEYWORD, /**< Undefined Plural keyword */
+ U_DEFAULT_KEYWORD_MISSING, /**< Missing DEFAULT rule in plural rules */
+ U_DECIMAL_NUMBER_SYNTAX_ERROR, /**< Decimal number syntax error */
U_FMT_PARSE_ERROR_LIMIT, /**< The limit for format library errors */
/*
* the error code range 0x10200 0x102ff are reserved for Break Iterator related error
*/
+ U_BRK_INTERNAL_ERROR=0x10200, /**< An internal error (bug) was detected. */
U_BRK_ERROR_START=0x10200, /**< Start of codes indicating Break Iterator failures */
- U_BRK_INTERNAL_ERROR, /**< An internal error (bug) was detected. */
U_BRK_HEX_DIGITS_EXPECTED, /**< Hex digits expected as part of a escaped char in a rule. */
U_BRK_SEMICOLON_EXPECTED, /**< Missing ';' at the end of a RBBI rule. */
U_BRK_RULE_SYNTAX, /**< Syntax error in RBBI rule. */
@@ -663,8 +768,8 @@ typedef enum UErrorCode {
/*
* The error codes in the range 0x10300-0x103ff are reserved for regular expression related errrs
*/
+ U_REGEX_INTERNAL_ERROR=0x10300, /**< An internal error (bug) was detected. */
U_REGEX_ERROR_START=0x10300, /**< Start of codes indicating Regexp failures */
- U_REGEX_INTERNAL_ERROR, /**< An internal error (bug) was detected. */
U_REGEX_RULE_SYNTAX, /**< Syntax error in regexp pattern. */
U_REGEX_INVALID_STATE, /**< RegexMatcher in invalid state for requested operation */
U_REGEX_BAD_ESCAPE_SEQUENCE, /**< Unrecognized backslash escape sequence in pattern */
@@ -678,19 +783,27 @@ typedef enum UErrorCode {
U_REGEX_INVALID_FLAG, /**< Invalid value for match mode flags. */
U_REGEX_LOOK_BEHIND_LIMIT, /**< Look-Behind pattern matches must have a bounded maximum length. */
U_REGEX_SET_CONTAINS_STRING, /**< Regexps cannot have UnicodeSets containing strings.*/
+ U_REGEX_OCTAL_TOO_BIG, /**< Octal character constants must be <= 0377. */
+ U_REGEX_MISSING_CLOSE_BRACKET, /**< Missing closing bracket on a bracket expression. */
+ U_REGEX_INVALID_RANGE, /**< In a character range [x-y], x is greater than y. */
+ U_REGEX_STACK_OVERFLOW, /**< Regular expression backtrack stack overflow. */
+ U_REGEX_TIME_OUT, /**< Maximum allowed match time exceeded */
+ U_REGEX_STOPPED_BY_CALLER, /**< Matching operation aborted by user callback fn. */
U_REGEX_ERROR_LIMIT, /**< This must always be the last value to indicate the limit for regexp errors */
/*
* The error code in the range 0x10400-0x104ff are reserved for IDNA related error codes
*/
+ U_IDNA_PROHIBITED_ERROR=0x10400,
U_IDNA_ERROR_START=0x10400,
- U_IDNA_PROHIBITED_ERROR,
U_IDNA_UNASSIGNED_ERROR,
U_IDNA_CHECK_BIDI_ERROR,
U_IDNA_STD3_ASCII_RULES_ERROR,
U_IDNA_ACE_PREFIX_ERROR,
U_IDNA_VERIFICATION_ERROR,
U_IDNA_LABEL_TOO_LONG_ERROR,
+ U_IDNA_ZERO_LENGTH_LABEL_ERROR,
+ U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR,
U_IDNA_ERROR_LIMIT,
/*
* Aliases for StringPrep
@@ -698,9 +811,16 @@ typedef enum UErrorCode {
U_STRINGPREP_PROHIBITED_ERROR = U_IDNA_PROHIBITED_ERROR,
U_STRINGPREP_UNASSIGNED_ERROR = U_IDNA_UNASSIGNED_ERROR,
U_STRINGPREP_CHECK_BIDI_ERROR = U_IDNA_CHECK_BIDI_ERROR,
+
+ /*
+ * The error code in the range 0x10500-0x105ff are reserved for Plugin related error codes
+ */
+ U_PLUGIN_ERROR_START=0x10500, /**< Start of codes indicating plugin failures */
+ U_PLUGIN_TOO_HIGH=0x10500, /**< The plugin's level is too high to be loaded right now. */
+ U_PLUGIN_DIDNT_SET_LEVEL, /**< The plugin didn't call uplug_setPlugLevel in response to a QUERY */
+ U_PLUGIN_ERROR_LIMIT, /**< This must always be the last value to indicate the limit for plugin errors */
-
- U_ERROR_LIMIT=U_IDNA_ERROR_LIMIT /**< This must always be the last value to indicate the limit for UErrorCode (last error code +1) */
+ U_ERROR_LIMIT=U_PLUGIN_ERROR_LIMIT /**< This must always be the last value to indicate the limit for UErrorCode (last error code +1) */
} UErrorCode;
/* Use the following to determine if an UErrorCode represents */
diff --git a/Source/JavaScriptCore/icu/unicode/uvernum.h b/Source/JavaScriptCore/icu/unicode/uvernum.h
new file mode 100644
index 000000000..722161292
--- /dev/null
+++ b/Source/JavaScriptCore/icu/unicode/uvernum.h
@@ -0,0 +1,138 @@
+/*
+*******************************************************************************
+* Copyright (C) 2000-2011, International Business Machines
+* Corporation and others. All Rights Reserved.
+*******************************************************************************
+*
+* file name: uvernum.h
+* encoding: US-ASCII
+* tab size: 8 (not used)
+* indentation:4
+*
+* Created by: Vladimir Weinstein
+* Updated by: Steven R. Loomis
+*
+* Gets included by uversion.h and other files.
+*
+* IMPORTANT: When updating version, the following things need to be done:
+* source/common/unicode/uvernum.h - this file: update major, minor,
+* patchlevel, suffix, version, short version constants, namespace,
+* renaming macro, and copyright
+*
+* The following files need to be updated as well, which can be done
+* by running the UNIX makefile target 'update-windows-makefiles' in icu/source.
+*
+*
+* source/common/common.vcproj - update 'Output file name' on the link tab so
+* that it contains the new major/minor combination
+* source/i18n/i18n.vcproj - same as for the common.vcproj
+* source/layout/layout.vcproj - same as for the common.vcproj
+* source/layoutex/layoutex.vcproj - same
+* source/stubdata/stubdata.vcproj - same as for the common.vcproj
+* source/io/io.vcproj - same as for the common.vcproj
+* source/data/makedata.mak - change U_ICUDATA_NAME so that it contains
+* the new major/minor combination and the Unicode version.
+*/
+
+#ifndef UVERNUM_H
+#define UVERNUM_H
+
+/** The standard copyright notice that gets compiled into each library.
+ * This value will change in the subsequent releases of ICU
+ * @stable ICU 2.4
+ */
+#define U_COPYRIGHT_STRING \
+ " Copyright (C) 2011, International Business Machines Corporation and others. All Rights Reserved. "
+
+/** The current ICU major version as an integer.
+ * This value will change in the subsequent releases of ICU
+ * @stable ICU 2.4
+ */
+#define U_ICU_VERSION_MAJOR_NUM 4
+
+/** The current ICU minor version as an integer.
+ * This value will change in the subsequent releases of ICU
+ * @stable ICU 2.6
+ */
+#define U_ICU_VERSION_MINOR_NUM 6
+
+/** The current ICU patchlevel version as an integer.
+ * This value will change in the subsequent releases of ICU
+ * @stable ICU 2.4
+ */
+#define U_ICU_VERSION_PATCHLEVEL_NUM 1
+
+/** The current ICU build level version as an integer.
+ * This value is for use by ICU clients. It defaults to 0.
+ * @stable ICU 4.0
+ */
+#ifndef U_ICU_VERSION_BUILDLEVEL_NUM
+#define U_ICU_VERSION_BUILDLEVEL_NUM 0
+#endif
+
+/** Glued version suffix for renamers
+ * This value will change in the subsequent releases of ICU
+ * @stable ICU 2.6
+ */
+#define U_ICU_VERSION_SUFFIX _46
+
+/** Glued version suffix function for renamers
+ * This value will change in the subsequent releases of ICU.
+ * If a custom suffix (such as matching library suffixes) is desired, this can be modified.
+ * Note that if present, platform.h may contain an earlier definition of this macro.
+ * @stable ICU 4.2
+ */
+#ifndef U_ICU_ENTRY_POINT_RENAME
+#define U_ICU_ENTRY_POINT_RENAME(x) x ## _46
+#endif
+
+/** The current ICU library version as a dotted-decimal string. The patchlevel
+ * only appears in this string if it non-zero.
+ * This value will change in the subsequent releases of ICU
+ * @stable ICU 2.4
+ */
+#define U_ICU_VERSION "4.6.1"
+
+/** The current ICU library major/minor version as a string without dots, for library name suffixes.
+ * This value will change in the subsequent releases of ICU
+ * @stable ICU 2.6
+ */
+#define U_ICU_VERSION_SHORT "46"
+
+/** Data version in ICU4C.
+ * @internal ICU 4.4 Internal Use Only
+ **/
+#define U_ICU_DATA_VERSION "4.6"
+
+/*===========================================================================
+ * ICU collation framework version information
+ * Version info that can be obtained from a collator is affected by these
+ * numbers in a secret and magic way. Please use collator version as whole
+ *===========================================================================
+ */
+
+/**
+ * Collation runtime version (sort key generator, strcoll).
+ * If the version is different, sort keys for the same string could be different.
+ * This value may change in subsequent releases of ICU.
+ * @stable ICU 2.4
+ */
+#define UCOL_RUNTIME_VERSION 7
+
+/**
+ * Collation builder code version.
+ * When this is different, the same tailoring might result
+ * in assigning different collation elements to code points.
+ * This value may change in subsequent releases of ICU.
+ * @stable ICU 2.4
+ */
+#define UCOL_BUILDER_VERSION 8
+
+/**
+ * This is the version of collation tailorings.
+ * This value may change in subsequent releases of ICU.
+ * @stable ICU 2.4
+ */
+#define UCOL_TAILORINGS_VERSION 1
+
+#endif
diff --git a/Source/JavaScriptCore/icu/unicode/uversion.h b/Source/JavaScriptCore/icu/unicode/uversion.h
index f9a7755b9..e54cd55a6 100644
--- a/Source/JavaScriptCore/icu/unicode/uversion.h
+++ b/Source/JavaScriptCore/icu/unicode/uversion.h
@@ -1,6 +1,6 @@
/*
*******************************************************************************
-* Copyright (C) 2000-2004, International Business Machines
+* Copyright (C) 2000-2010, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*
@@ -11,10 +11,13 @@
*
* Created by: Vladimir Weinstein
*
-* Contains all the important version numbers for ICU.
* Gets included by utypes.h and Windows .rc files
*/
+/**
+ * \file
+ * \brief C API: API for accessing ICU version numbers.
+ */
/*===========================================================================*/
/* Main ICU version information */
/*===========================================================================*/
@@ -22,72 +25,16 @@
#ifndef UVERSION_H
#define UVERSION_H
-/** IMPORTANT: When updating version, the following things need to be done: */
-/** source/common/unicode/uversion.h - this file: update major, minor, */
-/** patchlevel, suffix, version, short version constants, namespace, */
-/** and copyright */
-/** source/common/common.dsp - update 'Output file name' on the link tab so */
-/** that it contains the new major/minor combination */
-/** source/i18n/i18n.dsp - same as for the common.dsp */
-/** source/layout/layout.dsp - same as for the common.dsp */
-/** source/stubdata/stubdata.dsp - same as for the common.dsp */
-/** source/extra/ustdio/ustdio.dsp - same as for the common.dsp */
-/** source/data/makedata.mak - change U_ICUDATA_NAME so that it contains */
-/** the new major/minor combination */
-/** source/tools/genren/genren.pl - use this script according to the README */
-/** in that folder */
-
#include "unicode/umachine.h"
-/** The standard copyright notice that gets compiled into each library.
- * This value will change in the subsequent releases of ICU
- * @stable ICU 2.4
- */
-#define U_COPYRIGHT_STRING \
- " Copyright (C) 2004, International Business Machines Corporation and others. All Rights Reserved. "
+/* Actual version info lives in uvernum.h */
+#include "unicode/uvernum.h"
/** Maximum length of the copyright string.
* @stable ICU 2.4
*/
#define U_COPYRIGHT_STRING_LENGTH 128
-/** The current ICU major version as an integer.
- * This value will change in the subsequent releases of ICU
- * @stable ICU 2.4
- */
-#define U_ICU_VERSION_MAJOR_NUM 3
-
-/** The current ICU minor version as an integer.
- * This value will change in the subsequent releases of ICU
- * @stable ICU 2.6
- */
-#define U_ICU_VERSION_MINOR_NUM 2
-
-/** The current ICU patchlevel version as an integer.
- * This value will change in the subsequent releases of ICU
- * @stable ICU 2.4
- */
-#define U_ICU_VERSION_PATCHLEVEL_NUM 0
-
-/** Glued version suffix for renamers
- * This value will change in the subsequent releases of ICU
- * @stable ICU 2.6
- */
-#define U_ICU_VERSION_SUFFIX _3_2
-
-/** The current ICU library version as a dotted-decimal string. The patchlevel
- * only appears in this string if it non-zero.
- * This value will change in the subsequent releases of ICU
- * @stable ICU 2.4
- */
-#define U_ICU_VERSION "3.2"
-
-/** The current ICU library major/minor version as a string without dots, for library name suffixes.
- * This value will change in the subsequent releases of ICU
- * @stable ICU 2.6
- */
-#define U_ICU_VERSION_SHORT "32"
-
/** An ICU version consists of up to 4 numbers from 0..255.
* @stable ICU 2.4
*/
@@ -104,23 +51,89 @@
#define U_MAX_VERSION_STRING_LENGTH 20
/** The binary form of a version on ICU APIs is an array of 4 uint8_t.
+ * To compare two versions, use memcmp(v1,v2,sizeof(UVersionInfo)).
* @stable ICU 2.4
*/
typedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH];
-#if U_HAVE_NAMESPACE && defined(XP_CPLUSPLUS)
-#if U_DISABLE_RENAMING
-#define U_ICU_NAMESPACE icu
-namespace U_ICU_NAMESPACE { }
+/*===========================================================================*/
+/* C++ namespace if supported. Versioned unless versioning is disabled. */
+/*===========================================================================*/
+
+/**
+ * \def U_NAMESPACE_BEGIN
+ * This is used to begin a declaration of a public ICU C++ API.
+ * When not compiling for C++, it does nothing.
+ * When compiling for C++, it begins an extern "C++" linkage block (to protect
+ * against cases in which an external client includes ICU header files inside
+ * an extern "C" linkage block).
+ * If the C++ compiler supports namespaces, it also begins a namespace block.
+ * @stable ICU 2.4
+ */
+
+/**
+ * \def U_NAMESPACE_END
+ * This is used to end a declaration of a public ICU C++ API.
+ * When not compiling for C++, it does nothing.
+ * When compiling for C++, it ends the extern "C++" block begun by
+ * U_NAMESPACE_BEGIN.
+ * If the C++ compiler supports namespaces, it also ends the namespace block
+ * begun by U_NAMESPACE_BEGIN.
+ * @stable ICU 2.4
+ */
+
+/**
+ * \def U_NAMESPACE_USE
+ * This is used to specify that the rest of the code uses the
+ * public ICU C++ API namespace.
+ * If the compiler doesn't support namespaces, this does nothing.
+ * @stable ICU 2.4
+ */
+
+/**
+ * \def U_NAMESPACE_QUALIFIER
+ * This is used to qualify that a function or class is part of
+ * the public ICU C++ API namespace.
+ * If the compiler doesn't support namespaces, this does nothing.
+ * @stable ICU 2.4
+ */
+
+/* Define namespace symbols if the compiler supports it. */
+#ifdef XP_CPLUSPLUS
+#if U_HAVE_NAMESPACE
+# if U_DISABLE_RENAMING
+# define U_ICU_NAMESPACE icu
+ namespace U_ICU_NAMESPACE { }
+# else
+# define U_ICU_NAMESPACE U_ICU_ENTRY_POINT_RENAME(icu)
+ namespace U_ICU_NAMESPACE { }
+ namespace icu = U_ICU_NAMESPACE;
+# endif
+
+# define U_NAMESPACE_BEGIN extern "C++" { namespace U_ICU_NAMESPACE {
+# define U_NAMESPACE_END } }
+# define U_NAMESPACE_USE using namespace U_ICU_NAMESPACE;
+# define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE::
+
+# ifndef U_USING_ICU_NAMESPACE
+# define U_USING_ICU_NAMESPACE 1
+# endif
+# if U_USING_ICU_NAMESPACE
+ U_NAMESPACE_USE
+# endif
#else
-#define U_ICU_NAMESPACE icu_3_2
-namespace U_ICU_NAMESPACE { }
-namespace icu = U_ICU_NAMESPACE;
+# define U_NAMESPACE_BEGIN extern "C++" {
+# define U_NAMESPACE_END }
+# define U_NAMESPACE_USE
+# define U_NAMESPACE_QUALIFIER
#endif
-U_NAMESPACE_USE
+#else
+# define U_NAMESPACE_BEGIN
+# define U_NAMESPACE_END
+# define U_NAMESPACE_USE
+# define U_NAMESPACE_QUALIFIER
#endif
-
/*===========================================================================*/
/* General version helper functions. Definitions in putil.c */
/*===========================================================================*/
@@ -140,6 +153,21 @@ U_STABLE void U_EXPORT2
u_versionFromString(UVersionInfo versionArray, const char *versionString);
/**
+ * Parse a Unicode string with dotted-decimal version information and
+ * fill in a UVersionInfo structure with the result.
+ * Definition of this function lives in putil.c
+ *
+ * @param versionArray The destination structure for the version information.
+ * @param versionString A Unicode string with dotted-decimal version
+ * information, with up to four non-negative number
+ * fields with values of up to 255 each.
+ * @stable ICU 4.2
+ */
+U_STABLE void U_EXPORT2
+u_versionFromUString(UVersionInfo versionArray, const UChar *versionString);
+
+
+/**
* Write a string with dotted-decimal version information according
* to the input UVersionInfo.
* Definition of this function lives in putil.c
@@ -164,53 +192,4 @@ u_versionToString(UVersionInfo versionArray, char *versionString);
*/
U_STABLE void U_EXPORT2
u_getVersion(UVersionInfo versionArray);
-
-
-/*===========================================================================
- * ICU collation framework version information
- * Version info that can be obtained from a collator is affected by these
- * numbers in a secret and magic way. Please use collator version as whole
- *===========================================================================
- */
-
-/** Collation runtime version (sort key generator, strcoll).
- * If the version is different, sortkeys for the same string could be different
- * version 2 was in ICU 1.8.1. changed is: compression intervals, French secondary
- * compression, generating quad level always when strength is quad or more
- * version 4 - ICU 2.2 - tracking UCA changes, ignore completely ignorables
- * in contractions, ignore primary ignorables after shifted
- * version 5 - ICU 2.8 - changed implicit generation code
- * This value may change in the subsequent releases of ICU
- * @stable ICU 2.4
- */
-#define UCOL_RUNTIME_VERSION 5
-
-/** Builder code version. When this is different, same tailoring might result
- * in assigning different collation elements to code points
- * version 2 was in ICU 1.8.1. added support for prefixes, tweaked canonical
- * closure. However, the tailorings should probably get same CEs assigned
- * version 5 - ICU 2.2 - fixed some bugs, renamed some indirect values.
- * version 6 - ICU 2.8 - fixed bug in builder that allowed 0xFF in primary values
- * Backward compatible with the old rules.
- * This value may change in the subsequent releases of ICU
- * @stable ICU 2.4
- */
-#define UCOL_BUILDER_VERSION 6
-
-/** *** Removed *** Instead we use the data we read from FractionalUCA.txt
- * This is the version of FractionalUCA.txt tailoring rules
- * Version 1 was in ICU 1.8.1. Version two contains canonical closure for
- * supplementary code points
- * Version 4 in ICU 2.2, following UCA=3.1.1d6, UCD=3.2.0
- * This value may change in the subsequent releases of ICU
- * @stable ICU 2.4
- */
-/*#define UCOL_FRACTIONAL_UCA_VERSION 4*/
-
-/** This is the version of the tailorings
- * This value may change in the subsequent releases of ICU
- * @stable ICU 2.4
- */
-#define UCOL_TAILORINGS_VERSION 1
-
#endif
diff --git a/Source/JavaScriptCore/interpreter/CallFrame.h b/Source/JavaScriptCore/interpreter/CallFrame.h
index 0db485214..94b37bfc3 100644
--- a/Source/JavaScriptCore/interpreter/CallFrame.h
+++ b/Source/JavaScriptCore/interpreter/CallFrame.h
@@ -190,8 +190,8 @@ namespace JSC {
// Access to arguments.
size_t argumentCount() const { return argumentCountIncludingThis() - 1; }
size_t argumentCountIncludingThis() const { return this[RegisterFile::ArgumentCount].payload(); }
- static int argumentOffset(size_t argument) { return s_firstArgumentOffset - argument; }
- static int argumentOffsetIncludingThis(size_t argument) { return s_thisArgumentOffset - argument; }
+ static int argumentOffset(int argument) { return s_firstArgumentOffset - argument; }
+ static int argumentOffsetIncludingThis(int argument) { return s_thisArgumentOffset - argument; }
JSValue argument(size_t argument)
{
diff --git a/Source/JavaScriptCore/interpreter/Interpreter.cpp b/Source/JavaScriptCore/interpreter/Interpreter.cpp
index 358a24096..739d6022f 100644
--- a/Source/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/Source/JavaScriptCore/interpreter/Interpreter.cpp
@@ -463,23 +463,20 @@ NEVER_INLINE bool Interpreter::unwindCallFrame(CallFrame*& callFrame, JSValue ex
debugger->didExecuteProgram(debuggerCallFrame, codeBlock->ownerExecutable()->sourceID(), codeBlock->ownerExecutable()->lastLine(), 0);
}
- // If this call frame created an activation or an 'arguments' object, tear it off.
- if (oldCodeBlock->codeType() == FunctionCode && oldCodeBlock->needsFullScopeChain()) {
- if (!callFrame->uncheckedR(oldCodeBlock->activationRegister()).jsValue()) {
- oldCodeBlock->createActivation(callFrame);
- scope = callFrame->scope();
- }
- while (!scope->inherits(&JSActivation::s_info))
- scope = scope->next();
+ JSValue activation;
+ if (oldCodeBlock->codeType() == FunctionCode && oldCodeBlock->needsActivation()) {
+ activation = callFrame->uncheckedR(oldCodeBlock->activationRegister()).jsValue();
+ if (activation)
+ jsCast<JSActivation*>(activation)->tearOff(*scope->globalData());
+ }
- callFrame->setScope(scope);
- JSActivation* activation = asActivation(scope);
- activation->tearOff(*scope->globalData());
- if (JSValue arguments = callFrame->uncheckedR(unmodifiedArgumentsRegister(oldCodeBlock->argumentsRegister())).jsValue())
- asArguments(arguments)->didTearOffActivation(callFrame->globalData(), activation);
- } else if (oldCodeBlock->usesArguments() && !oldCodeBlock->isStrictMode()) {
- if (JSValue arguments = callFrame->uncheckedR(unmodifiedArgumentsRegister(oldCodeBlock->argumentsRegister())).jsValue())
- asArguments(arguments)->tearOff(callFrame);
+ if (oldCodeBlock->codeType() == FunctionCode && oldCodeBlock->usesArguments()) {
+ if (JSValue arguments = callFrame->uncheckedR(unmodifiedArgumentsRegister(oldCodeBlock->argumentsRegister())).jsValue()) {
+ if (activation)
+ jsCast<Arguments*>(arguments)->didTearOffActivation(callFrame->globalData(), jsCast<JSActivation*>(activation));
+ else
+ jsCast<Arguments*>(arguments)->tearOff(callFrame);
+ }
}
CallFrame* callerFrame = callFrame->callerFrame();
@@ -528,7 +525,8 @@ static void appendSourceToError(CallFrame* callFrame, ErrorInstance* exception,
int expressionStart = divotPoint - startOffset;
int expressionStop = divotPoint + endOffset;
- if (!expressionStop || expressionStart > codeBlock->source()->length())
+ const String& sourceString = codeBlock->source()->source();
+ if (!expressionStop || expressionStart > static_cast<int>(sourceString.length()))
return;
JSGlobalData* globalData = &callFrame->globalData();
@@ -542,8 +540,8 @@ static void appendSourceToError(CallFrame* callFrame, ErrorInstance* exception,
message = makeString(message, " (evaluating '", codeBlock->source()->getRange(expressionStart, expressionStop), "')");
else {
// No range information, so give a few characters of context
- const StringImpl* data = codeBlock->source()->data();
- int dataLength = codeBlock->source()->length();
+ const StringImpl* data = sourceString.impl();
+ int dataLength = sourceString.length();
int start = expressionStart;
int stop = expressionStart;
// Get up to 20 characters of context to the left and right of the divot, clamping to the line.
@@ -2683,6 +2681,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
vPC += OPCODE_LENGTH(op_get_global_var_watchable);
NEXT_INSTRUCTION();
}
+ DEFINE_OPCODE(op_init_global_const)
DEFINE_OPCODE(op_put_global_var) {
/* put_global_var globalObject(c) registerPointer(n) value(r)
@@ -2697,6 +2696,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
vPC += OPCODE_LENGTH(op_put_global_var);
NEXT_INSTRUCTION();
}
+ DEFINE_OPCODE(op_init_global_const_check)
DEFINE_OPCODE(op_put_global_var_check) {
/* put_global_var_check globalObject(c) registerPointer(n) value(r)
diff --git a/Source/JavaScriptCore/jit/JIT.cpp b/Source/JavaScriptCore/jit/JIT.cpp
index 6083a66e4..bf5ac88dd 100644
--- a/Source/JavaScriptCore/jit/JIT.cpp
+++ b/Source/JavaScriptCore/jit/JIT.cpp
@@ -256,6 +256,7 @@ void JIT::privateCompileMainPass()
DEFINE_OP(op_eq)
DEFINE_OP(op_eq_null)
case op_get_by_id_out_of_line:
+ case op_get_array_length:
DEFINE_OP(op_get_by_id)
DEFINE_OP(op_get_arguments_length)
DEFINE_OP(op_get_by_val)
@@ -329,7 +330,9 @@ void JIT::privateCompileMainPass()
DEFINE_OP(op_put_by_index)
DEFINE_OP(op_put_by_val)
DEFINE_OP(op_put_getter_setter)
+ case op_init_global_const:
DEFINE_OP(op_put_global_var)
+ case op_init_global_const_check:
DEFINE_OP(op_put_global_var_check)
DEFINE_OP(op_put_scoped_var)
DEFINE_OP(op_resolve)
@@ -358,7 +361,6 @@ void JIT::privateCompileMainPass()
DEFINE_OP(op_to_jsnumber)
DEFINE_OP(op_to_primitive)
- case op_get_array_length:
case op_get_by_id_chain:
case op_get_by_id_generic:
case op_get_by_id_proto:
@@ -446,6 +448,7 @@ void JIT::privateCompileSlowCases()
DEFINE_SLOWCASE_OP(op_div)
DEFINE_SLOWCASE_OP(op_eq)
case op_get_by_id_out_of_line:
+ case op_get_array_length:
DEFINE_SLOWCASE_OP(op_get_by_id)
DEFINE_SLOWCASE_OP(op_get_arguments_length)
DEFINE_SLOWCASE_OP(op_get_by_val)
@@ -490,6 +493,7 @@ void JIT::privateCompileSlowCases()
case op_put_by_id_transition_normal_out_of_line:
DEFINE_SLOWCASE_OP(op_put_by_id)
DEFINE_SLOWCASE_OP(op_put_by_val)
+ case op_init_global_const_check:
DEFINE_SLOWCASE_OP(op_put_global_var_check);
DEFINE_SLOWCASE_OP(op_resolve_global)
DEFINE_SLOWCASE_OP(op_resolve_global_dynamic)
diff --git a/Source/JavaScriptCore/jit/JIT.h b/Source/JavaScriptCore/jit/JIT.h
index beb4cc060..ce70b40a7 100644
--- a/Source/JavaScriptCore/jit/JIT.h
+++ b/Source/JavaScriptCore/jit/JIT.h
@@ -435,7 +435,7 @@ namespace JSC {
void emitWriteBarrier(JSCell* owner, RegisterID value, RegisterID scratch, WriteBarrierMode, WriteBarrierUseKind);
template<typename ClassType, bool destructor, typename StructureType> void emitAllocateBasicJSObject(StructureType, RegisterID result, RegisterID storagePtr);
- void emitAllocateBasicStorage(size_t, RegisterID result);
+ void emitAllocateBasicStorage(size_t, ptrdiff_t offsetFromBase, RegisterID result);
template<typename T> void emitAllocateJSFinalObject(T structure, RegisterID result, RegisterID storagePtr);
void emitAllocateJSArray(unsigned valuesRegister, unsigned length, RegisterID cellResult, RegisterID storageResult, RegisterID storagePtr);
diff --git a/Source/JavaScriptCore/jit/JITInlineMethods.h b/Source/JavaScriptCore/jit/JITInlineMethods.h
index 3f32597fa..35ac44b23 100644
--- a/Source/JavaScriptCore/jit/JITInlineMethods.h
+++ b/Source/JavaScriptCore/jit/JITInlineMethods.h
@@ -423,7 +423,7 @@ template <typename ClassType, bool destructor, typename StructureType> inline vo
storePtr(structure, Address(result, JSCell::structureOffset()));
// initialize the object's property storage pointer
- storePtr(TrustedImmPtr(0), Address(result, ClassType::offsetOfOutOfLineStorage()));
+ storePtr(TrustedImmPtr(0), Address(result, JSObject::butterflyOffset()));
}
template <typename T> inline void JIT::emitAllocateJSFinalObject(T structure, RegisterID result, RegisterID scratch)
@@ -431,7 +431,7 @@ template <typename T> inline void JIT::emitAllocateJSFinalObject(T structure, Re
emitAllocateBasicJSObject<JSFinalObject, false, T>(structure, result, scratch);
}
-inline void JIT::emitAllocateBasicStorage(size_t size, RegisterID result)
+inline void JIT::emitAllocateBasicStorage(size_t size, ptrdiff_t offsetFromBase, RegisterID result)
{
CopiedAllocator* allocator = &m_globalData->heap.storageAllocator();
@@ -440,37 +440,32 @@ inline void JIT::emitAllocateBasicStorage(size_t size, RegisterID result)
storePtr(result, &allocator->m_currentRemaining);
negPtr(result);
addPtr(AbsoluteAddress(&allocator->m_currentPayloadEnd), result);
- subPtr(TrustedImm32(size), result);
+ subPtr(TrustedImm32(size - offsetFromBase), result);
}
inline void JIT::emitAllocateJSArray(unsigned valuesRegister, unsigned length, RegisterID cellResult, RegisterID storageResult, RegisterID storagePtr)
{
unsigned initialLength = std::max(length, 4U);
- size_t initialStorage = JSArray::storageSize(initialLength);
+ size_t initialStorage = Butterfly::totalSize(0, 0, true, ArrayStorage::sizeFor(initialLength));
// We allocate the backing store first to ensure that garbage collection
// doesn't happen during JSArray initialization.
- emitAllocateBasicStorage(initialStorage, storageResult);
+ emitAllocateBasicStorage(initialStorage, sizeof(IndexingHeader), storageResult);
// Allocate the cell for the array.
emitAllocateBasicJSObject<JSArray, false>(TrustedImmPtr(m_codeBlock->globalObject()->arrayStructure()), cellResult, storagePtr);
// Store all the necessary info in the ArrayStorage.
- storePtr(storageResult, Address(storageResult, ArrayStorage::allocBaseOffset()));
store32(Imm32(length), Address(storageResult, ArrayStorage::lengthOffset()));
store32(Imm32(length), Address(storageResult, ArrayStorage::numValuesInVectorOffset()));
+ store32(Imm32(initialLength), Address(storageResult, ArrayStorage::vectorLengthOffset()));
+ store32(TrustedImm32(0), Address(storageResult, ArrayStorage::indexBiasOffset()));
+ storePtr(TrustedImmPtr(0), Address(storageResult, ArrayStorage::sparseMapOffset()));
// Store the newly allocated ArrayStorage.
- storePtr(storageResult, Address(cellResult, JSArray::storageOffset()));
+ storePtr(storageResult, Address(cellResult, JSObject::butterflyOffset()));
- // Store the vector length and index bias.
- store32(Imm32(initialLength), Address(cellResult, JSArray::vectorLengthOffset()));
- store32(TrustedImm32(0), Address(cellResult, JSArray::indexBiasOffset()));
-
- // Initialize the sparse value map.
- storePtr(TrustedImmPtr(0), Address(cellResult, JSArray::sparseValueMapOffset()));
-
- // Store the values we have.
+ // Store the values we have.
for (unsigned i = 0; i < length; i++) {
#if USE(JSVALUE64)
loadPtr(Address(callFrameRegister, (valuesRegister + i) * sizeof(Register)), storagePtr);
@@ -482,16 +477,6 @@ inline void JIT::emitAllocateJSArray(unsigned valuesRegister, unsigned length, R
store32(storagePtr, Address(storageResult, ArrayStorage::vectorOffset() + sizeof(WriteBarrier<Unknown>) * i + sizeof(uint32_t)));
#endif
}
-
- // Zero out the remaining slots.
- for (unsigned i = length; i < initialLength; i++) {
-#if USE(JSVALUE64)
- storePtr(TrustedImmPtr(0), Address(storageResult, ArrayStorage::vectorOffset() + sizeof(WriteBarrier<Unknown>) * i));
-#else
- store32(TrustedImm32(static_cast<int>(JSValue::EmptyValueTag)), Address(storageResult, ArrayStorage::vectorOffset() + sizeof(WriteBarrier<Unknown>) * i + OBJECT_OFFSETOF(JSValue, u.asBits.tag)));
- store32(TrustedImm32(0), Address(storageResult, ArrayStorage::vectorOffset() + sizeof(WriteBarrier<Unknown>) * i + OBJECT_OFFSETOF(JSValue, u.asBits.payload)));
-#endif
- }
}
#if ENABLE(VALUE_PROFILER)
diff --git a/Source/JavaScriptCore/jit/JITOpcodes.cpp b/Source/JavaScriptCore/jit/JITOpcodes.cpp
index f859f8b93..486be6bf9 100644
--- a/Source/JavaScriptCore/jit/JITOpcodes.cpp
+++ b/Source/JavaScriptCore/jit/JITOpcodes.cpp
@@ -1666,7 +1666,7 @@ void JIT::emit_op_new_func_exp(Instruction* currentInstruction)
void JIT::emit_op_new_array(Instruction* currentInstruction)
{
int length = currentInstruction[3].u.operand;
- if (CopiedSpace::isOversize(JSArray::storageSize(length))) {
+ if (CopiedSpace::isOversize(Butterfly::totalSize(0, 0, true, ArrayStorage::sizeFor(length)))) {
JITStubCall stubCall(this, cti_op_new_array);
stubCall.addArgument(TrustedImm32(currentInstruction[2].u.operand));
stubCall.addArgument(TrustedImm32(currentInstruction[3].u.operand));
@@ -1685,7 +1685,7 @@ void JIT::emitSlow_op_new_array(Instruction* currentInstruction, Vector<SlowCase
// If the allocation would be oversize, we will already make the proper stub call above in
// emit_op_new_array.
int length = currentInstruction[3].u.operand;
- if (CopiedSpace::isOversize(JSArray::storageSize(length)))
+ if (CopiedSpace::isOversize(Butterfly::totalSize(0, 0, true, ArrayStorage::sizeFor(length))))
return;
linkSlowCase(iter); // Not enough space in CopiedSpace for storage.
linkSlowCase(iter); // Not enough space in MarkedSpace for cell.
diff --git a/Source/JavaScriptCore/jit/JITPropertyAccess.cpp b/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
index ada862a53..bca68f0b4 100644
--- a/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
+++ b/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
@@ -114,10 +114,10 @@ void JIT::emit_op_get_by_val(Instruction* currentInstruction)
#if ENABLE(VALUE_PROFILER)
storePtr(regT2, currentInstruction[4].u.arrayProfile->addressOfLastSeenStructure());
#endif
- addSlowCase(branchPtr(NotEqual, Address(regT2, Structure::classInfoOffset()), TrustedImmPtr(&JSArray::s_info)));
+ addSlowCase(branchTest8(Zero, Address(regT2, Structure::indexingTypeOffset()), TrustedImm32(HasArrayStorage)));
- loadPtr(Address(regT0, JSArray::storageOffset()), regT2);
- addSlowCase(branch32(AboveOrEqual, regT1, Address(regT0, JSArray::vectorLengthOffset())));
+ loadPtr(Address(regT0, JSObject::butterflyOffset()), regT2);
+ addSlowCase(branch32(AboveOrEqual, regT1, Address(regT2, ArrayStorage::vectorLengthOffset())));
loadPtr(BaseIndex(regT2, regT1, ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), regT0);
addSlowCase(branchTestPtr(Zero, regT0));
@@ -162,7 +162,7 @@ void JIT::compileGetDirectOffset(RegisterID base, RegisterID result, RegisterID
if (finalObjectMode == MayBeFinal) {
Jump isInline = branch32(LessThan, offset, TrustedImm32(inlineStorageCapacity));
- loadPtr(Address(base, JSObject::offsetOfOutOfLineStorage()), scratch);
+ loadPtr(Address(base, JSObject::butterflyOffset()), scratch);
neg32(offset);
Jump done = jump();
isInline.link(this);
@@ -174,7 +174,7 @@ void JIT::compileGetDirectOffset(RegisterID base, RegisterID result, RegisterID
breakpoint();
isOutOfLine.link(this);
#endif
- loadPtr(Address(base, JSObject::offsetOfOutOfLineStorage()), scratch);
+ loadPtr(Address(base, JSObject::butterflyOffset()), scratch);
neg32(offset);
}
signExtend32ToPtr(offset, offset);
@@ -239,10 +239,10 @@ void JIT::emit_op_put_by_val(Instruction* currentInstruction)
#if ENABLE(VALUE_PROFILER)
storePtr(regT2, currentInstruction[4].u.arrayProfile->addressOfLastSeenStructure());
#endif
- addSlowCase(branchPtr(NotEqual, Address(regT2, Structure::classInfoOffset()), TrustedImmPtr(&JSArray::s_info)));
- addSlowCase(branch32(AboveOrEqual, regT1, Address(regT0, JSArray::vectorLengthOffset())));
+ addSlowCase(branchTest8(Zero, Address(regT2, Structure::indexingTypeOffset()), TrustedImm32(HasArrayStorage)));
+ loadPtr(Address(regT0, JSObject::butterflyOffset()), regT2);
+ addSlowCase(branch32(AboveOrEqual, regT1, Address(regT2, ArrayStorage::vectorLengthOffset())));
- loadPtr(Address(regT0, JSArray::storageOffset()), regT2);
Jump empty = branchTestPtr(Zero, BaseIndex(regT2, regT1, ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
Label storeResult(this);
@@ -252,10 +252,10 @@ void JIT::emit_op_put_by_val(Instruction* currentInstruction)
empty.link(this);
add32(TrustedImm32(1), Address(regT2, OBJECT_OFFSETOF(ArrayStorage, m_numValuesInVector)));
- branch32(Below, regT1, Address(regT2, OBJECT_OFFSETOF(ArrayStorage, m_length))).linkTo(storeResult, this);
+ branch32(Below, regT1, Address(regT2, ArrayStorage::lengthOffset())).linkTo(storeResult, this);
add32(TrustedImm32(1), regT1);
- store32(regT1, Address(regT2, OBJECT_OFFSETOF(ArrayStorage, m_length)));
+ store32(regT1, Address(regT2, ArrayStorage::lengthOffset()));
sub32(TrustedImm32(1), regT1);
jump().linkTo(storeResult, this);
@@ -403,7 +403,7 @@ void JIT::compileGetByIdHotPath(int baseVReg, Identifier*)
PatchableJump structureCheck = patchableBranchPtrWithPatch(NotEqual, Address(regT0, JSCell::structureOffset()), structureToCompare, TrustedImmPtr(reinterpret_cast<void*>(patchGetByIdDefaultStructure)));
addSlowCase(structureCheck);
- ConvertibleLoadLabel propertyStorageLoad = convertibleLoadPtr(Address(regT0, JSObject::offsetOfOutOfLineStorage()), regT0);
+ ConvertibleLoadLabel propertyStorageLoad = convertibleLoadPtr(Address(regT0, JSObject::butterflyOffset()), regT0);
DataLabelCompact displacementLabel = loadPtrWithCompactAddressOffsetPatch(Address(regT0, patchGetByIdDefaultOffset), regT0);
Label putResult(this);
@@ -470,7 +470,7 @@ void JIT::emit_op_put_by_id(Instruction* currentInstruction)
DataLabelPtr structureToCompare;
addSlowCase(branchPtrWithPatch(NotEqual, Address(regT0, JSCell::structureOffset()), structureToCompare, TrustedImmPtr(reinterpret_cast<void*>(patchGetByIdDefaultStructure))));
- ConvertibleLoadLabel propertyStorageLoad = convertibleLoadPtr(Address(regT0, JSObject::offsetOfOutOfLineStorage()), regT2);
+ ConvertibleLoadLabel propertyStorageLoad = convertibleLoadPtr(Address(regT0, JSObject::butterflyOffset()), regT2);
DataLabel32 displacementLabel = storePtrWithAddressOffsetPatch(regT1, Address(regT2, patchPutByIdDefaultOffset));
END_UNINTERRUPTED_SEQUENCE(sequencePutById);
@@ -509,8 +509,8 @@ void JIT::compilePutDirectOffset(RegisterID base, RegisterID value, PropertyOffs
return;
}
- loadPtr(Address(base, JSObject::offsetOfOutOfLineStorage()), base);
- storePtr(value, Address(base, sizeof(JSValue) * offsetInOutOfLineStorage(cachedOffset)));
+ loadPtr(Address(base, JSObject::butterflyOffset()), base);
+ storePtr(value, Address(base, sizeof(JSValue) * offsetInButterfly(cachedOffset)));
}
// Compile a load from an object's property storage. May overwrite base.
@@ -521,8 +521,8 @@ void JIT::compileGetDirectOffset(RegisterID base, RegisterID result, PropertyOff
return;
}
- loadPtr(Address(base, JSObject::offsetOfOutOfLineStorage()), result);
- loadPtr(Address(result, sizeof(JSValue) * offsetInOutOfLineStorage(cachedOffset)), result);
+ loadPtr(Address(base, JSObject::butterflyOffset()), result);
+ loadPtr(Address(result, sizeof(JSValue) * offsetInButterfly(cachedOffset)), result);
}
void JIT::compileGetDirectOffset(JSObject* base, RegisterID result, PropertyOffset cachedOffset)
@@ -532,8 +532,8 @@ void JIT::compileGetDirectOffset(JSObject* base, RegisterID result, PropertyOffs
return;
}
- loadPtr(base->addressOfOutOfLineStorage(), result);
- loadPtr(Address(result, offsetInOutOfLineStorage(cachedOffset) * sizeof(WriteBarrier<Unknown>)), result);
+ loadPtr(base->butterflyAddress(), result);
+ loadPtr(Address(result, offsetInButterfly(cachedOffset) * sizeof(WriteBarrier<Unknown>)), result);
}
void JIT::privateCompilePutByIdTransition(StructureStubInfo* stubInfo, Structure* oldStructure, Structure* newStructure, PropertyOffset cachedOffset, StructureChain* chain, ReturnAddressPtr returnAddress, bool direct)
@@ -660,12 +660,14 @@ void JIT::privateCompilePatchGetArrayLength(ReturnAddressPtr returnAddress)
#if ENABLE(VALUE_PROFILER)
storePtr(regT3, m_codeBlock->getOrAddArrayProfile(stubInfo->bytecodeIndex)->addressOfLastSeenStructure());
#endif
- Jump failureCases1 = branchPtr(NotEqual, Address(regT3, Structure::classInfoOffset()), TrustedImmPtr(&JSArray::s_info));
+ load8(Address(regT3, Structure::indexingTypeOffset()), regT3);
+ Jump failureCases1 = branchTest32(Zero, regT3, TrustedImm32(IsArray));
+ Jump failureCases2 = branchTest32(Zero, regT3, TrustedImm32(HasArrayStorage));
// Checks out okay! - get the length from the storage
- loadPtr(Address(regT0, JSArray::storageOffset()), regT3);
- load32(Address(regT3, OBJECT_OFFSETOF(ArrayStorage, m_length)), regT2);
- Jump failureCases2 = branch32(LessThan, regT2, TrustedImm32(0));
+ loadPtr(Address(regT0, JSObject::butterflyOffset()), regT3);
+ load32(Address(regT3, ArrayStorage::lengthOffset()), regT2);
+ Jump failureCases3 = branch32(LessThan, regT2, TrustedImm32(0));
emitFastArithIntToImmNoCheck(regT2, regT0);
Jump success = jump();
@@ -676,6 +678,7 @@ void JIT::privateCompilePatchGetArrayLength(ReturnAddressPtr returnAddress)
CodeLocationLabel slowCaseBegin = stubInfo->callReturnLocation.labelAtOffset(-stubInfo->patch.baseline.u.get.coldPathBegin);
patchBuffer.link(failureCases1, slowCaseBegin);
patchBuffer.link(failureCases2, slowCaseBegin);
+ patchBuffer.link(failureCases3, slowCaseBegin);
// On success return back to the hot patch code, at a point it will perform the store to dest for us.
patchBuffer.link(success, stubInfo->hotPathBegin.labelAtOffset(stubInfo->patch.baseline.u.get.putResult));
diff --git a/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp b/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
index f3c79a985..04d7c3815 100644
--- a/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
+++ b/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
@@ -213,10 +213,10 @@ void JIT::emit_op_get_by_val(Instruction* currentInstruction)
#if ENABLE(VALUE_PROFILER)
storePtr(regT1, currentInstruction[4].u.arrayProfile->addressOfLastSeenStructure());
#endif
- addSlowCase(branchPtr(NotEqual, Address(regT1, Structure::classInfoOffset()), TrustedImmPtr(&JSArray::s_info)));
+ addSlowCase(branchTest8(Zero, Address(regT1, Structure::indexingTypeOffset()), TrustedImm32(HasArrayStorage)));
- loadPtr(Address(regT0, JSArray::storageOffset()), regT3);
- addSlowCase(branch32(AboveOrEqual, regT2, Address(regT0, JSArray::vectorLengthOffset())));
+ loadPtr(Address(regT0, JSObject::butterflyOffset()), regT3);
+ addSlowCase(branch32(AboveOrEqual, regT2, Address(regT3, ArrayStorage::vectorLengthOffset())));
load32(BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT1); // tag
load32(BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0); // payload
@@ -272,11 +272,11 @@ void JIT::emit_op_put_by_val(Instruction* currentInstruction)
#if ENABLE(VALUE_PROFILER)
storePtr(regT1, currentInstruction[4].u.arrayProfile->addressOfLastSeenStructure());
#endif
- addSlowCase(branchPtr(NotEqual, Address(regT1, Structure::classInfoOffset()), TrustedImmPtr(&JSArray::s_info)));
- addSlowCase(branch32(AboveOrEqual, regT2, Address(regT0, JSArray::vectorLengthOffset())));
+ addSlowCase(branchTest8(Zero, Address(regT1, Structure::indexingTypeOffset()), TrustedImm32(HasArrayStorage)));
+ loadPtr(Address(regT0, JSObject::butterflyOffset()), regT3);
+ addSlowCase(branch32(AboveOrEqual, regT2, Address(regT3, ArrayStorage::vectorLengthOffset())));
emitWriteBarrier(regT0, regT1, regT1, regT3, UnconditionalWriteBarrier, WriteBarrierForPropertyAccess);
- loadPtr(Address(regT0, JSArray::storageOffset()), regT3);
Jump empty = branch32(Equal, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), TrustedImm32(JSValue::EmptyValueTag));
@@ -288,10 +288,10 @@ void JIT::emit_op_put_by_val(Instruction* currentInstruction)
empty.link(this);
add32(TrustedImm32(1), Address(regT3, OBJECT_OFFSETOF(ArrayStorage, m_numValuesInVector)));
- branch32(Below, regT2, Address(regT3, OBJECT_OFFSETOF(ArrayStorage, m_length))).linkTo(storeResult, this);
+ branch32(Below, regT2, Address(regT3, ArrayStorage::lengthOffset())).linkTo(storeResult, this);
add32(TrustedImm32(1), regT2, regT0);
- store32(regT0, Address(regT3, OBJECT_OFFSETOF(ArrayStorage, m_length)));
+ store32(regT0, Address(regT3, ArrayStorage::lengthOffset()));
jump().linkTo(storeResult, this);
end.link(this);
@@ -343,7 +343,7 @@ void JIT::compileGetByIdHotPath()
PatchableJump structureCheck = patchableBranchPtrWithPatch(NotEqual, Address(regT0, JSCell::structureOffset()), structureToCompare, TrustedImmPtr(reinterpret_cast<void*>(patchGetByIdDefaultStructure)));
addSlowCase(structureCheck);
- ConvertibleLoadLabel propertyStorageLoad = convertibleLoadPtr(Address(regT0, JSObject::offsetOfOutOfLineStorage()), regT2);
+ ConvertibleLoadLabel propertyStorageLoad = convertibleLoadPtr(Address(regT0, JSObject::butterflyOffset()), regT2);
DataLabelCompact displacementLabel1 = loadPtrWithCompactAddressOffsetPatch(Address(regT2, patchGetByIdDefaultOffset), regT0); // payload
DataLabelCompact displacementLabel2 = loadPtrWithCompactAddressOffsetPatch(Address(regT2, patchGetByIdDefaultOffset), regT1); // tag
@@ -409,7 +409,7 @@ void JIT::emit_op_put_by_id(Instruction* currentInstruction)
DataLabelPtr structureToCompare;
addSlowCase(branchPtrWithPatch(NotEqual, Address(regT0, JSCell::structureOffset()), structureToCompare, TrustedImmPtr(reinterpret_cast<void*>(patchGetByIdDefaultStructure))));
- ConvertibleLoadLabel propertyStorageLoad = convertibleLoadPtr(Address(regT0, JSObject::offsetOfOutOfLineStorage()), regT1);
+ ConvertibleLoadLabel propertyStorageLoad = convertibleLoadPtr(Address(regT0, JSObject::butterflyOffset()), regT1);
DataLabel32 displacementLabel1 = storePtrWithAddressOffsetPatch(regT2, Address(regT1, patchPutByIdDefaultOffset)); // payload
DataLabel32 displacementLabel2 = storePtrWithAddressOffsetPatch(regT3, Address(regT1, patchPutByIdDefaultOffset)); // tag
@@ -443,7 +443,7 @@ void JIT::emitSlow_op_put_by_id(Instruction* currentInstruction, Vector<SlowCase
void JIT::compilePutDirectOffset(RegisterID base, RegisterID valueTag, RegisterID valuePayload, PropertyOffset cachedOffset)
{
if (isOutOfLineOffset(cachedOffset))
- loadPtr(Address(base, JSObject::offsetOfOutOfLineStorage()), base);
+ loadPtr(Address(base, JSObject::butterflyOffset()), base);
emitStore(indexRelativeToBase(cachedOffset), valueTag, valuePayload, base);
}
@@ -456,7 +456,7 @@ void JIT::compileGetDirectOffset(RegisterID base, RegisterID resultTag, Register
}
RegisterID temp = resultPayload;
- loadPtr(Address(base, JSObject::offsetOfOutOfLineStorage()), temp);
+ loadPtr(Address(base, JSObject::butterflyOffset()), temp);
emitLoad(indexRelativeToBase(cachedOffset), resultTag, resultPayload, temp);
}
@@ -469,9 +469,9 @@ void JIT::compileGetDirectOffset(JSObject* base, RegisterID resultTag, RegisterI
return;
}
- loadPtr(base->addressOfOutOfLineStorage(), resultTag);
- load32(Address(resultTag, offsetInOutOfLineStorage(cachedOffset) * sizeof(WriteBarrier<Unknown>) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), resultPayload);
- load32(Address(resultTag, offsetInOutOfLineStorage(cachedOffset) * sizeof(WriteBarrier<Unknown>) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), resultTag);
+ loadPtr(base->butterflyAddress(), resultTag);
+ load32(Address(resultTag, offsetInButterfly(cachedOffset) * sizeof(WriteBarrier<Unknown>) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), resultPayload);
+ load32(Address(resultTag, offsetInButterfly(cachedOffset) * sizeof(WriteBarrier<Unknown>) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), resultTag);
}
void JIT::privateCompilePutByIdTransition(StructureStubInfo* stubInfo, Structure* oldStructure, Structure* newStructure, PropertyOffset cachedOffset, StructureChain* chain, ReturnAddressPtr returnAddress, bool direct)
@@ -620,13 +620,15 @@ void JIT::privateCompilePatchGetArrayLength(ReturnAddressPtr returnAddress)
#if ENABLE(VALUE_PROFILER)
storePtr(regT2, m_codeBlock->getOrAddArrayProfile(stubInfo->bytecodeIndex)->addressOfLastSeenStructure());
#endif
- Jump failureCases1 = branchPtr(NotEqual, Address(regT2, Structure::classInfoOffset()), TrustedImmPtr(&JSArray::s_info));
+ load8(Address(regT2, Structure::indexingTypeOffset()), regT3);
+ Jump failureCases1 = branchTest32(Zero, regT2, TrustedImm32(IsArray));
+ Jump failureCases2 = branchTest32(Zero, regT2, TrustedImm32(HasArrayStorage));
// Checks out okay! - get the length from the storage
- loadPtr(Address(regT0, JSArray::storageOffset()), regT2);
- load32(Address(regT2, OBJECT_OFFSETOF(ArrayStorage, m_length)), regT2);
+ loadPtr(Address(regT0, JSArray::butterflyOffset()), regT2);
+ load32(Address(regT2, ArrayStorage::lengthOffset()), regT2);
- Jump failureCases2 = branch32(Above, regT2, TrustedImm32(INT_MAX));
+ Jump failureCases3 = branch32(Above, regT2, TrustedImm32(INT_MAX));
move(regT2, regT0);
move(TrustedImm32(JSValue::Int32Tag), regT1);
Jump success = jump();
@@ -637,6 +639,7 @@ void JIT::privateCompilePatchGetArrayLength(ReturnAddressPtr returnAddress)
CodeLocationLabel slowCaseBegin = stubInfo->callReturnLocation.labelAtOffset(-stubInfo->patch.baseline.u.get.coldPathBegin);
patchBuffer.link(failureCases1, slowCaseBegin);
patchBuffer.link(failureCases2, slowCaseBegin);
+ patchBuffer.link(failureCases3, slowCaseBegin);
// On success return back to the hot patch code, at a point it will perform the store to dest for us.
patchBuffer.link(success, stubInfo->hotPathBegin.labelAtOffset(stubInfo->patch.baseline.u.get.putResult));
@@ -1029,7 +1032,7 @@ void JIT::compileGetDirectOffset(RegisterID base, RegisterID resultTag, Register
if (finalObjectMode == MayBeFinal) {
Jump isInline = branch32(LessThan, offset, TrustedImm32(inlineStorageCapacity));
- loadPtr(Address(base, JSObject::offsetOfOutOfLineStorage()), base);
+ loadPtr(Address(base, JSObject::butterflyOffset()), base);
neg32(offset);
Jump done = jump();
isInline.link(this);
@@ -1041,7 +1044,7 @@ void JIT::compileGetDirectOffset(RegisterID base, RegisterID resultTag, Register
breakpoint();
isOutOfLine.link(this);
#endif
- loadPtr(Address(base, JSObject::offsetOfOutOfLineStorage()), base);
+ loadPtr(Address(base, JSObject::butterflyOffset()), base);
neg32(offset);
}
load32(BaseIndex(base, offset, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload) + (inlineStorageCapacity - 2) * sizeof(EncodedJSValue)), resultPayload);
diff --git a/Source/JavaScriptCore/jit/JITStubs.cpp b/Source/JavaScriptCore/jit/JITStubs.cpp
index 5fad9c8d7..40d653b5d 100644
--- a/Source/JavaScriptCore/jit/JITStubs.cpp
+++ b/Source/JavaScriptCore/jit/JITStubs.cpp
@@ -1504,8 +1504,8 @@ DEFINE_STUB_FUNCTION(JSObject*, op_put_by_id_transition_realloc)
ASSERT(baseValue.isObject());
JSObject* base = asObject(baseValue);
JSGlobalData& globalData = *stackFrame.globalData;
- PropertyStorage newStorage = base->growOutOfLineStorage(globalData, oldSize, newSize);
- base->setOutOfLineStorage(globalData, newStorage, newStructure);
+ Butterfly* butterfly = base->growOutOfLineStorage(globalData, oldSize, newSize);
+ base->setButterfly(globalData, butterfly, newStructure);
return base;
}
@@ -2415,7 +2415,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_val)
JSValue baseValue = stackFrame.args[0].jsValue();
JSValue subscript = stackFrame.args[1].jsValue();
-
+
if (LIKELY(baseValue.isCell() && subscript.isString())) {
if (JSValue result = baseValue.asCell()->fastGetOwnProperty(callFrame, asString(subscript)->value(callFrame))) {
CHECK_FOR_EXCEPTION();
@@ -2508,12 +2508,12 @@ DEFINE_STUB_FUNCTION(void, op_put_by_val)
if (LIKELY(subscript.isUInt32())) {
uint32_t i = subscript.asUInt32();
- if (isJSArray(baseValue)) {
- JSArray* jsArray = asArray(baseValue);
- if (jsArray->canSetIndex(i))
- jsArray->setIndex(*globalData, i, value);
+ if (baseValue.isObject()) {
+ JSObject* object = asObject(baseValue);
+ if (object->canSetIndexQuickly(i))
+ object->setIndexQuickly(*globalData, i, value);
else
- JSArray::putByIndex(jsArray, callFrame, i, value, callFrame->codeBlock()->isStrictMode());
+ object->methodTable()->putByIndex(object, callFrame, i, value, callFrame->codeBlock()->isStrictMode());
} else
baseValue.putByIndex(callFrame, i, value, callFrame->codeBlock()->isStrictMode());
} else if (isName(subscript)) {
@@ -3368,7 +3368,7 @@ DEFINE_STUB_FUNCTION(void, op_put_getter_setter)
accessor->setGetter(callFrame->globalData(), asObject(getter));
if (!setter.isUndefined())
accessor->setSetter(callFrame->globalData(), asObject(setter));
- baseObj->putDirectAccessor(callFrame->globalData(), stackFrame.args[1].identifier(), accessor, Accessor);
+ baseObj->putDirectAccessor(callFrame, stackFrame.args[1].identifier(), accessor, Accessor);
}
DEFINE_STUB_FUNCTION(void, op_throw_reference_error)
diff --git a/Source/JavaScriptCore/jsc.cpp b/Source/JavaScriptCore/jsc.cpp
index b044d5706..e5e891e04 100644
--- a/Source/JavaScriptCore/jsc.cpp
+++ b/Source/JavaScriptCore/jsc.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserved.
* Copyright (C) 2006 Bjoern Graf (bjoern.graf@gmail.com)
*
* This library is free software; you can redistribute it and/or
@@ -22,8 +22,10 @@
#include "config.h"
+#include "ButterflyInlineMethods.h"
#include "BytecodeGenerator.h"
#include "Completion.h"
+#include "CopiedSpaceInlineMethods.h"
#include "ExceptionHelpers.h"
#include "InitializeThreading.h"
#include "Interpreter.h"
diff --git a/Source/JavaScriptCore/jsc.pro b/Source/JavaScriptCore/jsc.pro
index 123362faa..f226bde40 100644
--- a/Source/JavaScriptCore/jsc.pro
+++ b/Source/JavaScriptCore/jsc.pro
@@ -23,7 +23,7 @@ mac {
LIBS_PRIVATE += -framework AppKit
}
-win* {
+win32-* {
LIBS += -ladvapi32
}
diff --git a/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp b/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
index fa50fedb6..b0441e80b 100644
--- a/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
+++ b/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
@@ -858,7 +858,7 @@ LLINT_SLOW_PATH_DECL(slow_path_get_by_id)
JSValue result = baseValue.get(exec, ident, slot);
LLINT_CHECK_EXCEPTION();
LLINT_OP(1) = result;
-
+
if (!LLINT_ALWAYS_ACCESS_SLOW
&& baseValue.isCell()
&& slot.isCacheable()
@@ -877,11 +877,22 @@ LLINT_SLOW_PATH_DECL(slow_path_get_by_id)
pc[5].u.operand = offsetInInlineStorage(slot.cachedOffset()) * sizeof(JSValue) + JSObject::offsetOfInlineStorage();
} else {
pc[0].u.opcode = LLInt::getOpcode(llint_op_get_by_id_out_of_line);
- pc[5].u.operand = offsetInOutOfLineStorage(slot.cachedOffset()) * sizeof(JSValue);
+ pc[5].u.operand = offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue);
}
}
}
+ if (!LLINT_ALWAYS_ACCESS_SLOW
+ && isJSArray(baseValue)
+ && ident == exec->propertyNames().length) {
+ pc[0].u.opcode = LLInt::getOpcode(llint_op_get_array_length);
+#if ENABLE(VALUE_PROFILER)
+ ArrayProfile* arrayProfile = codeBlock->getOrAddArrayProfile(pc - codeBlock->instructions().begin());
+ arrayProfile->observeStructure(baseValue.asCell()->structure());
+ pc[4].u.arrayProfile = arrayProfile;
+#endif
+ }
+
#if ENABLE(VALUE_PROFILER)
pc[OPCODE_LENGTH(op_get_by_id) - 1].u.profile->m_buckets[0] = JSValue::encode(result);
#endif
@@ -939,7 +950,7 @@ LLINT_SLOW_PATH_DECL(slow_path_put_by_id)
if (isInlineOffset(slot.cachedOffset()))
pc[5].u.operand = offsetInInlineStorage(slot.cachedOffset()) * sizeof(JSValue) + JSObject::offsetOfInlineStorage();
else
- pc[5].u.operand = offsetInOutOfLineStorage(slot.cachedOffset()) * sizeof(JSValue);
+ pc[5].u.operand = offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue);
pc[6].u.structure.set(
globalData, codeBlock->ownerExecutable(), structure);
StructureChain* chain = structure->prototypeChain(exec);
@@ -967,7 +978,7 @@ LLINT_SLOW_PATH_DECL(slow_path_put_by_id)
pc[5].u.operand = offsetInInlineStorage(slot.cachedOffset()) * sizeof(JSValue) + JSObject::offsetOfInlineStorage();
} else {
pc[0].u.opcode = LLInt::getOpcode(llint_op_put_by_id_out_of_line);
- pc[5].u.operand = offsetInOutOfLineStorage(slot.cachedOffset()) * sizeof(JSValue);
+ pc[5].u.operand = offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue);
}
}
}
@@ -1046,12 +1057,12 @@ LLINT_SLOW_PATH_DECL(slow_path_put_by_val)
if (LIKELY(subscript.isUInt32())) {
uint32_t i = subscript.asUInt32();
- if (isJSArray(baseValue)) {
- JSArray* jsArray = asArray(baseValue);
- if (jsArray->canSetIndex(i))
- jsArray->setIndex(globalData, i, value);
+ if (baseValue.isObject()) {
+ JSObject* object = asObject(baseValue);
+ if (object->canSetIndexQuickly(i))
+ object->setIndexQuickly(globalData, i, value);
else
- JSArray::putByIndex(jsArray, exec, i, value, exec->codeBlock()->isStrictMode());
+ object->methodTable()->putByIndex(object, exec, i, value, exec->codeBlock()->isStrictMode());
LLINT_END();
}
baseValue.putByIndex(exec, i, value, exec->codeBlock()->isStrictMode());
@@ -1128,7 +1139,7 @@ LLINT_SLOW_PATH_DECL(slow_path_put_getter_setter)
if (!setter.isUndefined())
accessor->setSetter(globalData, asObject(setter));
baseObj->putDirectAccessor(
- globalData,
+ exec,
exec->codeBlock()->identifier(pc[2].u.operand),
accessor, Accessor);
LLINT_END();
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
index 4c590a1c3..6f5460aa7 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
@@ -61,6 +61,11 @@ else
const PayloadOffset = 0
end
+# Constant for reasoning about butterflies.
+const IsArray = 1
+const HasArrayStorage = 8
+const AllArrayTypes = 15
+
# Type constants.
const StringType = 5
const ObjectType = 13
@@ -339,7 +344,7 @@ macro allocateBasicJSObject(sizeClassIndex, structure, result, scratch1, scratch
# Initialize the object.
storep structure, JSCell::m_structure[result]
- storep 0, JSObject::m_outOfLineStorage[result]
+ storep 0, JSObject::m_butterfly[result]
end
end
@@ -514,7 +519,7 @@ macro withInlineStorage(object, propertyStorage, continuation)
end
macro withOutOfLineStorage(object, propertyStorage, continuation)
- loadp JSObject::m_outOfLineStorage[object], propertyStorage
+ loadp JSObject::m_butterfly[object], propertyStorage
# Indicate that the propertyStorage register now points to the
# property storage, and that the object register may be reused
# if the object pointer is not needed anymore.
@@ -845,9 +850,6 @@ macro notSupported()
end
end
-_llint_op_get_array_length:
- notSupported()
-
_llint_op_get_by_id_chain:
notSupported()
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter.h b/Source/JavaScriptCore/llint/LowLevelInterpreter.h
index 76c950a8c..f45a07303 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter.h
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter.h
@@ -36,39 +36,16 @@
namespace JSC {
-// The following is a minimal set of alias for the opcode names. This is needed
+// The following is a set of alias for the opcode names. This is needed
// because there is code (e.g. in GetByIdStatus.cpp and PutByIdStatus.cpp)
// which refers to the opcodes expecting them to be prefixed with "llint_".
// In the CLoop implementation, the 2 are equivalent. Hence, we set up this
// alias here.
-//
-// Note: we don't just do this for all opcodes because we only need a few,
-// and currently, FOR_EACH_OPCODE_ID() includes the llint and JIT opcode
-// extensions which we definitely don't want to add an alias for. With some
-// minor refactoring, we can use FOR_EACH_OPCODE_ID() to automatically
-// generate a llint_ alias for all opcodes, but that is not needed at this
-// time.
-const OpcodeID llint_op_call = op_call;
-const OpcodeID llint_op_call_eval = op_call_eval;
-const OpcodeID llint_op_call_varargs = op_call_varargs;
-const OpcodeID llint_op_construct = op_construct;
-const OpcodeID llint_op_catch = op_catch;
-const OpcodeID llint_op_get_by_id = op_get_by_id;
-const OpcodeID llint_op_get_by_id_out_of_line = op_get_by_id_out_of_line;
-const OpcodeID llint_op_put_by_id = op_put_by_id;
-const OpcodeID llint_op_put_by_id_out_of_line = op_put_by_id_out_of_line;
-
-const OpcodeID llint_op_put_by_id_transition_direct =
- op_put_by_id_transition_direct;
-const OpcodeID llint_op_put_by_id_transition_direct_out_of_line =
- op_put_by_id_transition_direct_out_of_line;
-const OpcodeID llint_op_put_by_id_transition_normal =
- op_put_by_id_transition_normal;
-const OpcodeID llint_op_put_by_id_transition_normal_out_of_line =
- op_put_by_id_transition_normal_out_of_line;
-
-const OpcodeID llint_op_method_check = op_method_check;
+#define LLINT_OPCODE_ALIAS(opcode, length) \
+ const OpcodeID llint_##opcode = opcode;
+FOR_EACH_CORE_OPCODE_ID(LLINT_OPCODE_ALIAS)
+#undef LLINT_OPCODE_ALIAS
} // namespace JSC
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
index 103a3f978..0e37a4099 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
@@ -947,21 +947,21 @@ _llint_op_is_string:
macro loadPropertyAtVariableOffsetKnownNotFinal(propertyOffset, objectAndStorage, tag, payload)
assert(macro (ok) bigteq propertyOffset, InlineStorageCapacity, ok end)
negi propertyOffset
- loadp JSObject::m_outOfLineStorage[objectAndStorage], objectAndStorage
- loadi TagOffset + (InlineStorageCapacity - 2) * 8[objectAndStorage, propertyOffset, 8], tag
- loadi PayloadOffset + (InlineStorageCapacity - 2) * 8[objectAndStorage, propertyOffset, 8], payload
+ loadp JSObject::m_butterfly[objectAndStorage], objectAndStorage
+ loadi TagOffset + (InlineStorageCapacity - 1) * 8 - sizeof IndexingHeader[objectAndStorage, propertyOffset, 8], tag
+ loadi PayloadOffset + (InlineStorageCapacity - 1) * 8 - sizeof IndexingHeader[objectAndStorage, propertyOffset, 8], payload
end
macro loadPropertyAtVariableOffset(propertyOffset, objectAndStorage, tag, payload)
bilt propertyOffset, InlineStorageCapacity, .isInline
- loadp JSObject::m_outOfLineStorage[objectAndStorage], objectAndStorage
+ loadp JSObject::m_butterfly[objectAndStorage], objectAndStorage
negi propertyOffset
jmp .ready
.isInline:
- addp JSFinalObject::m_inlineStorage - (InlineStorageCapacity - 2) * 8, objectAndStorage
+ addp JSFinalObject::m_inlineStorage - (InlineStorageCapacity - 1) * 8 + sizeof IndexingHeader, objectAndStorage
.ready:
- loadi TagOffset + (InlineStorageCapacity - 2) * 8[objectAndStorage, propertyOffset, 8], tag
- loadi PayloadOffset + (InlineStorageCapacity - 2) * 8[objectAndStorage, propertyOffset, 8], payload
+ loadi TagOffset + (InlineStorageCapacity - 1) * 8 - sizeof IndexingHeader[objectAndStorage, propertyOffset, 8], tag
+ loadi PayloadOffset + (InlineStorageCapacity - 1) * 8 - sizeof IndexingHeader[objectAndStorage, propertyOffset, 8], payload
end
macro resolveGlobal(size, slow)
@@ -1101,6 +1101,7 @@ _llint_op_get_global_var_watchable:
getGlobalVar(5)
+_llint_op_init_global_const:
_llint_op_put_global_var:
traceExecution()
loadi 8[PC], t1
@@ -1112,6 +1113,7 @@ _llint_op_put_global_var:
dispatch(3)
+_llint_op_init_global_const_check:
_llint_op_put_global_var_check:
traceExecution()
loadp 12[PC], t2
@@ -1168,6 +1170,33 @@ _llint_op_get_by_id_out_of_line:
getById(withOutOfLineStorage)
+_llint_op_get_array_length:
+ traceExecution()
+ loadi 8[PC], t0
+ loadp 16[PC], t1
+ loadConstantOrVariablePayload(t0, CellTag, t3, .opGetArrayLengthSlow)
+ loadp JSCell::m_structure[t3], t2
+ if VALUE_PROFILER
+ storep t2, ArrayProfile::m_lastSeenStructure[t1]
+ end
+ loadb Structure::m_indexingType[t2], t1
+ btiz t1, IsArray, .opGetArrayLengthSlow
+ btiz t1, HasArrayStorage, .opGetArrayLengthSlow
+ loadi 4[PC], t1
+ loadp 32[PC], t2
+ loadp JSObject::m_butterfly[t3], t0
+ loadi -sizeof IndexingHeader + IndexingHeader::m_publicLength[t0], t0
+ bilt t0, 0, .opGetArrayLengthSlow
+ valueProfile(Int32Tag, t0, t2)
+ storep t0, PayloadOffset[cfr, t1, 8]
+ storep Int32Tag, TagOffset[cfr, t1, 8]
+ dispatch(9)
+
+.opGetArrayLengthSlow:
+ callSlowPath(_llint_slow_path_get_by_id)
+ dispatch(9)
+
+
_llint_op_get_arguments_length:
traceExecution()
loadi 8[PC], t0
@@ -1287,12 +1316,9 @@ _llint_op_get_by_val:
if VALUE_PROFILER
storep t3, ArrayProfile::m_lastSeenStructure[t2]
end
- loadp CodeBlock[cfr], t2
- loadp CodeBlock::m_globalData[t2], t2
- loadp JSGlobalData::jsArrayClassInfo[t2], t2
- bpneq Structure::m_classInfo[t3], t2, .opGetByValSlow
- loadp JSArray::m_storage[t0], t3
- biaeq t1, JSArray::m_vectorLength[t0], .opGetByValSlow
+ btpz Structure::m_indexingType[t3], HasArrayStorage, .opGetByValSlow
+ loadp JSObject::m_butterfly[t0], t3
+ biaeq t1, -sizeof IndexingHeader + IndexingHeader::m_vectorLength[t0], .opGetByValSlow
loadi 4[PC], t0
loadi ArrayStorage::m_vector + TagOffset[t3, t1, 8], t2
loadi ArrayStorage::m_vector + PayloadOffset[t3, t1, 8], t1
@@ -1373,12 +1399,9 @@ _llint_op_put_by_val:
if VALUE_PROFILER
storep t3, ArrayProfile::m_lastSeenStructure[t0]
end
- loadp CodeBlock[cfr], t0
- loadp CodeBlock::m_globalData[t0], t0
- loadp JSGlobalData::jsArrayClassInfo[t0], t0
- bpneq Structure::m_classInfo[t3], t0, .opPutByValSlow
- biaeq t2, JSArray::m_vectorLength[t1], .opPutByValSlow
- loadp JSArray::m_storage[t1], t0
+ btpz Structure::m_indexingType[t3], HasArrayStorage, .opPutByValSlow
+ loadp JSObject::m_butterfly[t1], t0
+ biaeq t2, -sizeof IndexingHeader + IndexingHeader::m_vectorLength[t0], .opPutByValSlow
bieq ArrayStorage::m_vector + TagOffset[t0, t2, 8], EmptyValueTag, .opPutByValEmpty
.opPutByValStoreResult:
loadi 12[PC], t3
@@ -1390,9 +1413,9 @@ _llint_op_put_by_val:
.opPutByValEmpty:
addi 1, ArrayStorage::m_numValuesInVector[t0]
- bib t2, ArrayStorage::m_length[t0], .opPutByValStoreResult
+ bib t2, -sizeof IndexingHeader + IndexingHeader::m_publicLength[t0], .opPutByValStoreResult
addi 1, t2, t1
- storei t1, ArrayStorage::m_length[t0]
+ storei t1, -sizeof IndexingHeader + IndexingHeader::m_publicLength[t0]
jmp .opPutByValStoreResult
.opPutByValSlow:
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
index 4bb7b8e1c..7dfcb6728 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
@@ -806,20 +806,20 @@ _llint_op_is_string:
macro loadPropertyAtVariableOffsetKnownNotFinal(propertyOffsetAsPointer, objectAndStorage, value)
assert(macro (ok) bigteq propertyOffsetAsPointer, InlineStorageCapacity, ok end)
negp propertyOffsetAsPointer
- loadp JSObject::m_outOfLineStorage[objectAndStorage], objectAndStorage
- loadp (InlineStorageCapacity - 2) * 8[objectAndStorage, propertyOffsetAsPointer, 8], value
+ loadp JSObject::m_butterfly[objectAndStorage], objectAndStorage
+ loadp (InlineStorageCapacity - 1) * 8 - sizeof IndexingHeader[objectAndStorage, propertyOffsetAsPointer, 8], value
end
macro loadPropertyAtVariableOffset(propertyOffsetAsInt, objectAndStorage, value)
bilt propertyOffsetAsInt, InlineStorageCapacity, .isInline
- loadp JSObject::m_outOfLineStorage[objectAndStorage], objectAndStorage
+ loadp JSObject::m_butterfly[objectAndStorage], objectAndStorage
negi propertyOffsetAsInt
sxi2p propertyOffsetAsInt, propertyOffsetAsInt
jmp .ready
.isInline:
- addp JSFinalObject::m_inlineStorage - (InlineStorageCapacity - 2) * 8, objectAndStorage
+ addp JSFinalObject::m_inlineStorage - (InlineStorageCapacity - 1) * 8 + sizeof IndexingHeader, objectAndStorage
.ready:
- loadp (InlineStorageCapacity - 2) * 8[objectAndStorage, propertyOffsetAsInt, 8], value
+ loadp (InlineStorageCapacity - 1) * 8 - sizeof IndexingHeader[objectAndStorage, propertyOffsetAsInt, 8], value
end
macro resolveGlobal(size, slow)
@@ -953,6 +953,7 @@ _llint_op_get_global_var_watchable:
getGlobalVar(5)
+_llint_op_init_global_const:
_llint_op_put_global_var:
traceExecution()
loadis 16[PB, PC, 8], t1
@@ -963,6 +964,7 @@ _llint_op_put_global_var:
dispatch(3)
+_llint_op_init_global_const_check:
_llint_op_put_global_var_check:
traceExecution()
loadp 24[PB, PC, 8], t2
@@ -1015,6 +1017,33 @@ _llint_op_get_by_id_out_of_line:
getById(withOutOfLineStorage)
+_llint_op_get_array_length:
+ traceExecution()
+ loadis 16[PB, PC, 8], t0
+ loadp 32[PB, PC, 8], t1
+ loadConstantOrVariableCell(t0, t3, .opGetArrayLengthSlow)
+ loadp JSCell::m_structure[t3], t2
+ if VALUE_PROFILER
+ storep t2, ArrayProfile::m_lastSeenStructure[t1]
+ end
+ loadb Structure::m_indexingType[t2], t1
+ btiz t1, IsArray, .opGetArrayLengthSlow
+ btiz t1, HasArrayStorage, .opGetArrayLengthSlow
+ loadis 8[PB, PC, 8], t1
+ loadp 64[PB, PC, 8], t2
+ loadp JSObject::m_butterfly[t3], t0
+ loadi -sizeof IndexingHeader + IndexingHeader::m_publicLength[t0], t0
+ bilt t0, 0, .opGetArrayLengthSlow
+ orp tagTypeNumber, t0
+ valueProfile(t0, t2)
+ storep t0, [cfr, t1, 8]
+ dispatch(9)
+
+.opGetArrayLengthSlow:
+ callSlowPath(_llint_slow_path_get_by_id)
+ dispatch(9)
+
+
_llint_op_get_arguments_length:
traceExecution()
loadis 16[PB, PC, 8], t0
@@ -1132,12 +1161,9 @@ _llint_op_get_by_val:
if VALUE_PROFILER
storep t3, ArrayProfile::m_lastSeenStructure[t2]
end
- loadp CodeBlock[cfr], t2
- loadp CodeBlock::m_globalData[t2], t2
- loadp JSGlobalData::jsArrayClassInfo[t2], t2
- bpneq Structure::m_classInfo[t3], t2, .opGetByValSlow
- loadp JSArray::m_storage[t0], t3
- biaeq t1, JSArray::m_vectorLength[t0], .opGetByValSlow
+ btbz Structure::m_indexingType[t3], HasArrayStorage, .opGetByValSlow
+ loadp JSObject::m_butterfly[t0], t3
+ biaeq t1, -sizeof IndexingHeader + IndexingHeader::m_vectorLength[t3], .opGetByValSlow
loadis 8[PB, PC, 8], t0
loadp ArrayStorage::m_vector[t3, t1, 8], t2
btpz t2, .opGetByValSlow
@@ -1217,12 +1243,9 @@ _llint_op_put_by_val:
if VALUE_PROFILER
storep t3, ArrayProfile::m_lastSeenStructure[t0]
end
- loadp CodeBlock[cfr], t0
- loadp CodeBlock::m_globalData[t0], t0
- loadp JSGlobalData::jsArrayClassInfo[t0], t0
- bpneq Structure::m_classInfo[t3], t0, .opPutByValSlow
- biaeq t2, JSArray::m_vectorLength[t1], .opPutByValSlow
- loadp JSArray::m_storage[t1], t0
+ btbz Structure::m_indexingType[t3], HasArrayStorage, .opPutByValSlow
+ loadp JSObject::m_butterfly[t1], t0
+ biaeq t2, -sizeof IndexingHeader + IndexingHeader::m_vectorLength[t0], .opPutByValSlow
btpz ArrayStorage::m_vector[t0, t2, 8], .opPutByValEmpty
.opPutByValStoreResult:
loadis 24[PB, PC, 8], t3
@@ -1233,9 +1256,9 @@ _llint_op_put_by_val:
.opPutByValEmpty:
addi 1, ArrayStorage::m_numValuesInVector[t0]
- bib t2, ArrayStorage::m_length[t0], .opPutByValStoreResult
+ bib t2, -sizeof IndexingHeader + IndexingHeader::m_publicLength[t0], .opPutByValStoreResult
addi 1, t2, t1
- storei t1, ArrayStorage::m_length[t0]
+ storei t1, -sizeof IndexingHeader + IndexingHeader::m_publicLength[t0]
jmp .opPutByValStoreResult
.opPutByValSlow:
diff --git a/Source/JavaScriptCore/parser/Lexer.cpp b/Source/JavaScriptCore/parser/Lexer.cpp
index 063168be1..8c9eaa12c 100644
--- a/Source/JavaScriptCore/parser/Lexer.cpp
+++ b/Source/JavaScriptCore/parser/Lexer.cpp
@@ -405,10 +405,10 @@ void Lexer<T>::setCode(const SourceCode& source, ParserArena* arena)
m_lineNumber = source.firstLine();
m_lastToken = -1;
- const StringImpl* sourceString = source.provider()->data();
+ const String& sourceString = source.provider()->source();
- if (sourceString)
- setCodeStart(sourceString);
+ if (!sourceString.isNull())
+ setCodeStart(sourceString.impl());
else
m_codeStart = 0;
@@ -1689,8 +1689,8 @@ void Lexer<T>::clear()
template <typename T>
SourceCode Lexer<T>::sourceCode(int openBrace, int closeBrace, int firstLine)
{
- ASSERT((*m_source->provider()->data())[openBrace] == '{');
- ASSERT((*m_source->provider()->data())[closeBrace] == '}');
+ ASSERT(m_source->provider()->source()[openBrace] == '{');
+ ASSERT(m_source->provider()->source()[closeBrace] == '}');
return SourceCode(m_source->provider(), openBrace, closeBrace + 1, firstLine);
}
diff --git a/Source/JavaScriptCore/parser/NodeConstructors.h b/Source/JavaScriptCore/parser/NodeConstructors.h
index 1678bf7ea..274491960 100644
--- a/Source/JavaScriptCore/parser/NodeConstructors.h
+++ b/Source/JavaScriptCore/parser/NodeConstructors.h
@@ -812,7 +812,6 @@ namespace JSC {
, m_lexpr(l)
, m_expr(expr)
, m_statement(statement)
- , m_identIsVarDecl(false)
{
}
@@ -822,7 +821,6 @@ namespace JSC {
, m_lexpr(new (globalData) ResolveNode(location, ident, divot - startOffset))
, m_expr(expr)
, m_statement(statement)
- , m_identIsVarDecl(true)
{
if (in) {
AssignResolveNode* node = new (globalData) AssignResolveNode(location, ident, in);
diff --git a/Source/JavaScriptCore/parser/Nodes.h b/Source/JavaScriptCore/parser/Nodes.h
index 475689ce9..509d36d1a 100644
--- a/Source/JavaScriptCore/parser/Nodes.h
+++ b/Source/JavaScriptCore/parser/Nodes.h
@@ -1204,7 +1204,6 @@ namespace JSC {
ExpressionNode* m_lexpr;
ExpressionNode* m_expr;
StatementNode* m_statement;
- bool m_identIsVarDecl;
};
class ContinueNode : public StatementNode, public ThrowableExpressionData {
diff --git a/Source/JavaScriptCore/parser/Parser.h b/Source/JavaScriptCore/parser/Parser.h
index 3a61da1a8..e657e12cd 100644
--- a/Source/JavaScriptCore/parser/Parser.h
+++ b/Source/JavaScriptCore/parser/Parser.h
@@ -1029,9 +1029,9 @@ PassRefPtr<ParsedNode> parse(JSGlobalData* globalData, JSGlobalObject* lexicalGl
{
SamplingRegion samplingRegion("Parsing");
- ASSERT(source.provider()->data());
+ ASSERT(!source.provider()->source().isNull());
- if (source.provider()->data()->is8Bit()) {
+ if (source.provider()->source().is8Bit()) {
Parser< Lexer<LChar> > parser(globalData, source, parameters, name, strictness, parserMode);
return parser.parse<ParsedNode>(lexicalGlobalObject, debugger, execState, exception);
}
diff --git a/Source/JavaScriptCore/parser/SourceCode.h b/Source/JavaScriptCore/parser/SourceCode.h
index bda91b3c8..a094469a2 100644
--- a/Source/JavaScriptCore/parser/SourceCode.h
+++ b/Source/JavaScriptCore/parser/SourceCode.h
@@ -47,7 +47,7 @@ namespace JSC {
SourceCode(PassRefPtr<SourceProvider> provider, int firstLine = 1)
: m_provider(provider)
, m_startChar(0)
- , m_endChar(m_provider->length())
+ , m_endChar(m_provider->source().length())
, m_firstLine(std::max(firstLine, 1))
{
}
@@ -97,8 +97,8 @@ namespace JSC {
inline SourceCode SourceCode::subExpression(unsigned openBrace, unsigned closeBrace, int firstLine)
{
- ASSERT((*provider()->data())[openBrace] == '{');
- ASSERT((*provider()->data())[closeBrace] == '}');
+ ASSERT(provider()->source()[openBrace] == '{');
+ ASSERT(provider()->source()[closeBrace] == '}');
return SourceCode(provider(), openBrace, closeBrace + 1, firstLine);
}
diff --git a/Source/JavaScriptCore/parser/SourceProvider.h b/Source/JavaScriptCore/parser/SourceProvider.h
index 7f2e8d995..145b2dd16 100644
--- a/Source/JavaScriptCore/parser/SourceProvider.h
+++ b/Source/JavaScriptCore/parser/SourceProvider.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2009, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -56,10 +56,12 @@ namespace JSC {
delete m_cache;
}
- virtual String getRange(int start, int end) const = 0;
- virtual const StringImpl* data() const = 0;
- virtual int length() const = 0;
-
+ virtual const String& source() const = 0;
+ String getRange(int start, int end) const
+ {
+ return source().substringSharingImpl(start, end - start);
+ }
+
const String& url() { return m_url; }
TextPosition startPosition() const { return m_startPosition; }
intptr_t asID()
@@ -93,12 +95,10 @@ namespace JSC {
return adoptRef(new StringSourceProvider(source, url, startPosition));
}
- virtual String getRange(int start, int end) const OVERRIDE
+ virtual const String& source() const OVERRIDE
{
- return m_source.substringSharingImpl(start, end - start);
+ return m_source;
}
- const StringImpl* data() const { return m_source.impl(); }
- int length() const { return m_source.length(); }
private:
StringSourceProvider(const String& source, const String& url, const TextPosition& startPosition)
diff --git a/Source/JavaScriptCore/runtime/Arguments.cpp b/Source/JavaScriptCore/runtime/Arguments.cpp
index fe79f740e..47795edb2 100644
--- a/Source/JavaScriptCore/runtime/Arguments.cpp
+++ b/Source/JavaScriptCore/runtime/Arguments.cpp
@@ -255,7 +255,7 @@ bool Arguments::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned i)
}
}
- return JSObject::deleteProperty(thisObject, exec, Identifier(exec, String::number(i)));
+ return JSObject::deletePropertyByIndex(thisObject, exec, i);
}
bool Arguments::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName)
@@ -308,7 +308,7 @@ bool Arguments::defineOwnProperty(JSObject* object, ExecState* exec, PropertyNam
// If the property is not yet present on the object, and is not yet marked as deleted, then add it now.
PropertySlot slot;
if ((!thisObject->d->deletedArguments || !thisObject->d->deletedArguments[i]) && !JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot))
- object->putDirect(exec->globalData(), propertyName, thisObject->argument(i).get(), 0);
+ object->putDirectMayBeIndex(exec, propertyName, thisObject->argument(i).get());
if (!Base::defineOwnProperty(object, exec, propertyName, descriptor, shouldThrow))
return false;
diff --git a/Source/JavaScriptCore/runtime/Arguments.h b/Source/JavaScriptCore/runtime/Arguments.h
index 1d0bffd6b..c3d25f962 100644
--- a/Source/JavaScriptCore/runtime/Arguments.h
+++ b/Source/JavaScriptCore/runtime/Arguments.h
@@ -110,7 +110,6 @@ namespace JSC {
d->activation.set(globalData, this, activation);
d->registers = &activation->registerAt(0);
}
- void setRegisters(WriteBarrierBase<Unknown>* registers) { d->registers = registers; }
static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
{
diff --git a/Source/JavaScriptCore/runtime/ArrayConstructor.cpp b/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
index c9a6dc600..eda35e146 100644
--- a/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
+++ b/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
@@ -25,6 +25,8 @@
#include "ArrayConstructor.h"
#include "ArrayPrototype.h"
+#include "ButterflyInlineMethods.h"
+#include "CopiedSpaceInlineMethods.h"
#include "Error.h"
#include "ExceptionHelpers.h"
#include "JSArray.h"
diff --git a/Source/JavaScriptCore/runtime/ArrayConventions.h b/Source/JavaScriptCore/runtime/ArrayConventions.h
new file mode 100644
index 000000000..af98e15fa
--- /dev/null
+++ b/Source/JavaScriptCore/runtime/ArrayConventions.h
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
+ * Copyright (C) 2003, 2007, 2008, 2009, 2012 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifndef ArrayConventions_h
+#define ArrayConventions_h
+
+#include "IndexingHeader.h"
+#include "WriteBarrier.h"
+
+namespace JSC {
+
+#define CHECK_ARRAY_CONSISTENCY 0
+
+// Overview of JSArray
+//
+// Properties of JSArray objects may be stored in one of three locations:
+// * The regular JSObject property map.
+// * A storage vector.
+// * A sparse map of array entries.
+//
+// Properties with non-numeric identifiers, with identifiers that are not representable
+// as an unsigned integer, or where the value is greater than MAX_ARRAY_INDEX
+// (specifically, this is only one property - the value 0xFFFFFFFFU as an unsigned 32-bit
+// integer) are not considered array indices and will be stored in the JSObject property map.
+//
+// All properties with a numeric identifer, representable as an unsigned integer i,
+// where (i <= MAX_ARRAY_INDEX), are an array index and will be stored in either the
+// storage vector or the sparse map. An array index i will be handled in the following
+// fashion:
+//
+// * Where (i < MIN_SPARSE_ARRAY_INDEX) the value will be stored in the storage vector,
+// unless the array is in SparseMode in which case all properties go into the map.
+// * Where (MIN_SPARSE_ARRAY_INDEX <= i <= MAX_STORAGE_VECTOR_INDEX) the value will either
+// be stored in the storage vector or in the sparse array, depending on the density of
+// data that would be stored in the vector (a vector being used where at least
+// (1 / minDensityMultiplier) of the entries would be populated).
+// * Where (MAX_STORAGE_VECTOR_INDEX < i <= MAX_ARRAY_INDEX) the value will always be stored
+// in the sparse array.
+
+// Define the maximum storage vector length to be 2^32 / sizeof(JSValue) / 2 to ensure that
+// there is no risk of overflow.
+#define MAX_STORAGE_VECTOR_LENGTH (static_cast<unsigned>(IndexingHeader::maximumLength))
+
+// These values have to be macros to be used in max() and min() without introducing
+// a PIC branch in Mach-O binaries, see <rdar://problem/5971391>.
+#define MIN_SPARSE_ARRAY_INDEX 10000U
+#define MAX_STORAGE_VECTOR_INDEX (MAX_STORAGE_VECTOR_LENGTH - 1)
+// 0xFFFFFFFF is a bit weird -- is not an array index even though it's an integer.
+#define MAX_ARRAY_INDEX 0xFFFFFFFEU
+
+// The value BASE_VECTOR_LEN is the maximum number of vector elements we'll allocate
+// for an array that was created with a sepcified length (e.g. a = new Array(123))
+#define BASE_VECTOR_LEN 4U
+
+// The upper bound to the size we'll grow a zero length array when the first element
+// is added.
+#define FIRST_VECTOR_GROW 4U
+
+// Our policy for when to use a vector and when to use a sparse map.
+// For all array indices under MIN_SPARSE_ARRAY_INDEX, we always use a vector.
+// When indices greater than MIN_SPARSE_ARRAY_INDEX are involved, we use a vector
+// as long as it is 1/8 full. If more sparse than that, we use a map.
+static const unsigned minDensityMultiplier = 8;
+
+inline bool isDenseEnoughForVector(unsigned length, unsigned numValues)
+{
+ return length <= MIN_SPARSE_ARRAY_INDEX || length / minDensityMultiplier <= numValues;
+}
+
+inline IndexingHeader indexingHeaderForArray(unsigned length, unsigned vectorLength)
+{
+ IndexingHeader result;
+ result.setPublicLength(length);
+ result.setVectorLength(vectorLength);
+ return result;
+}
+
+inline IndexingHeader baseIndexingHeaderForArray(unsigned length)
+{
+ return indexingHeaderForArray(length, BASE_VECTOR_LEN);
+}
+
+} // namespace JSC
+
+#endif // ArrayConventions_h
+
diff --git a/Source/JavaScriptCore/runtime/ArrayPrototype.cpp b/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
index 4b13f993c..503aecda8 100644
--- a/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
@@ -24,8 +24,10 @@
#include "config.h"
#include "ArrayPrototype.h"
+#include "ButterflyInlineMethods.h"
#include "CachedCall.h"
#include "CodeBlock.h"
+#include "CopiedSpaceInlineMethods.h"
#include "Interpreter.h"
#include "JIT.h"
#include "JSStringBuilder.h"
@@ -114,9 +116,17 @@ const ClassInfo ArrayPrototype::s_info = {"Array", &JSArray::s_info, 0, ExecStat
@end
*/
+ArrayPrototype* ArrayPrototype::create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
+{
+ Butterfly* butterfly = createArrayButterfly(exec->globalData(), 0);
+ ArrayPrototype* prototype = new (NotNull, allocateCell<ArrayPrototype>(*exec->heap())) ArrayPrototype(globalObject, structure, butterfly);
+ prototype->finishCreation(globalObject);
+ return prototype;
+}
+
// ECMA 15.4.4
-ArrayPrototype::ArrayPrototype(JSGlobalObject* globalObject, Structure* structure)
- : JSArray(globalObject->globalData(), structure)
+ArrayPrototype::ArrayPrototype(JSGlobalObject* globalObject, Structure* structure, Butterfly* butterfly)
+ : JSArray(globalObject->globalData(), structure, butterfly)
{
}
@@ -292,8 +302,8 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncToString(ExecState* exec)
for (unsigned k = 0; k < length; k++) {
JSValue element;
- if (thisObj->canGetIndex(k))
- element = thisObj->getIndex(k);
+ if (thisObj->canGetIndexQuickly(k))
+ element = thisObj->getIndexQuickly(k);
else
element = thisObj->get(exec, k);
@@ -413,10 +423,10 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncJoin(ExecState* exec)
JSArray* array = asArray(thisObj);
for (; k < length; k++) {
- if (!array->canGetIndex(k))
+ if (!array->canGetIndexQuickly(k))
break;
- JSValue element = array->getIndex(k);
+ JSValue element = array->getIndexQuickly(k);
if (!element.isUndefinedOrNull())
stringJoiner.append(element.toWTFStringInline(exec));
else
@@ -628,7 +638,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncSort(ExecState* exec)
CallData callData;
CallType callType = getCallData(function, callData);
- if (thisObj->classInfo() == &JSArray::s_info && !asArray(thisObj)->inSparseMode()) {
+ if (thisObj->classInfo() == &JSArray::s_info && !asArray(thisObj)->inSparseIndexingMode()) {
if (isNumericCompareFunction(exec, callType, callData))
asArray(thisObj)->sortNumeric(exec, function, callType, callData);
else if (callType != CallTypeNone)
@@ -788,9 +798,9 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncFilter(ExecState* exec)
JSArray* array = asArray(thisObj);
CachedCall cachedCall(exec, f, 3);
for (; k < length && !exec->hadException(); ++k) {
- if (!array->canGetIndex(k))
+ if (!array->canGetIndexQuickly(k))
break;
- JSValue v = array->getIndex(k);
+ JSValue v = array->getIndexQuickly(k);
cachedCall.setThis(applyThis);
cachedCall.setArgument(0, v);
cachedCall.setArgument(1, jsNumber(k));
@@ -846,11 +856,11 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncMap(ExecState* exec)
JSArray* array = asArray(thisObj);
CachedCall cachedCall(exec, f, 3);
for (; k < length && !exec->hadException(); ++k) {
- if (UNLIKELY(!array->canGetIndex(k)))
+ if (UNLIKELY(!array->canGetIndexQuickly(k)))
break;
cachedCall.setThis(applyThis);
- cachedCall.setArgument(0, array->getIndex(k));
+ cachedCall.setArgument(0, array->getIndexQuickly(k));
cachedCall.setArgument(1, jsNumber(k));
cachedCall.setArgument(2, thisObj);
@@ -909,11 +919,11 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncEvery(ExecState* exec)
JSArray* array = asArray(thisObj);
CachedCall cachedCall(exec, f, 3);
for (; k < length && !exec->hadException(); ++k) {
- if (UNLIKELY(!array->canGetIndex(k)))
+ if (UNLIKELY(!array->canGetIndexQuickly(k)))
break;
cachedCall.setThis(applyThis);
- cachedCall.setArgument(0, array->getIndex(k));
+ cachedCall.setArgument(0, array->getIndexQuickly(k));
cachedCall.setArgument(1, jsNumber(k));
cachedCall.setArgument(2, thisObj);
JSValue result = cachedCall.call();
@@ -965,11 +975,11 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncForEach(ExecState* exec)
JSArray* array = asArray(thisObj);
CachedCall cachedCall(exec, f, 3);
for (; k < length && !exec->hadException(); ++k) {
- if (UNLIKELY(!array->canGetIndex(k)))
+ if (UNLIKELY(!array->canGetIndexQuickly(k)))
break;
cachedCall.setThis(applyThis);
- cachedCall.setArgument(0, array->getIndex(k));
+ cachedCall.setArgument(0, array->getIndexQuickly(k));
cachedCall.setArgument(1, jsNumber(k));
cachedCall.setArgument(2, thisObj);
@@ -1017,11 +1027,11 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncSome(ExecState* exec)
JSArray* array = asArray(thisObj);
CachedCall cachedCall(exec, f, 3);
for (; k < length && !exec->hadException(); ++k) {
- if (UNLIKELY(!array->canGetIndex(k)))
+ if (UNLIKELY(!array->canGetIndexQuickly(k)))
break;
cachedCall.setThis(applyThis);
- cachedCall.setArgument(0, array->getIndex(k));
+ cachedCall.setArgument(0, array->getIndexQuickly(k));
cachedCall.setArgument(1, jsNumber(k));
cachedCall.setArgument(2, thisObj);
JSValue result = cachedCall.call();
@@ -1075,8 +1085,8 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncReduce(ExecState* exec)
if (exec->argumentCount() >= 2)
rv = exec->argument(1);
- else if (array && array->canGetIndex(0)){
- rv = array->getIndex(0);
+ else if (array && array->canGetIndexQuickly(0)) {
+ rv = array->getIndexQuickly(0);
i = 1;
} else {
for (i = 0; i < length; i++) {
@@ -1097,8 +1107,8 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncReduce(ExecState* exec)
cachedCall.setThis(jsUndefined());
cachedCall.setArgument(0, rv);
JSValue v;
- if (LIKELY(array->canGetIndex(i)))
- v = array->getIndex(i);
+ if (LIKELY(array->canGetIndexQuickly(i)))
+ v = array->getIndexQuickly(i);
else
break; // length has been made unsafe while we enumerate fallback to slow path
cachedCall.setArgument(1, v);
@@ -1152,8 +1162,8 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncReduceRight(ExecState* exec)
if (exec->argumentCount() >= 2)
rv = exec->argument(1);
- else if (array && array->canGetIndex(length - 1)){
- rv = array->getIndex(length - 1);
+ else if (array && array->canGetIndexQuickly(length - 1)) {
+ rv = array->getIndexQuickly(length - 1);
i = 1;
} else {
for (i = 0; i < length; i++) {
@@ -1174,9 +1184,9 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncReduceRight(ExecState* exec)
unsigned idx = length - i - 1;
cachedCall.setThis(jsUndefined());
cachedCall.setArgument(0, rv);
- if (UNLIKELY(!array->canGetIndex(idx)))
+ if (UNLIKELY(!array->canGetIndexQuickly(idx)))
break; // length has been made unsafe while we enumerate fallback to slow path
- cachedCall.setArgument(1, array->getIndex(idx));
+ cachedCall.setArgument(1, array->getIndexQuickly(idx));
cachedCall.setArgument(2, jsNumber(idx));
cachedCall.setArgument(3, array);
rv = cachedCall.call();
diff --git a/Source/JavaScriptCore/runtime/ArrayPrototype.h b/Source/JavaScriptCore/runtime/ArrayPrototype.h
index 4f52fb61f..b33021121 100644
--- a/Source/JavaScriptCore/runtime/ArrayPrototype.h
+++ b/Source/JavaScriptCore/runtime/ArrayPrototype.h
@@ -28,17 +28,12 @@ namespace JSC {
class ArrayPrototype : public JSArray {
private:
- ArrayPrototype(JSGlobalObject*, Structure*);
+ ArrayPrototype(JSGlobalObject*, Structure*, Butterfly*);
public:
typedef JSArray Base;
- static ArrayPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
- {
- ArrayPrototype* prototype = new (NotNull, allocateCell<ArrayPrototype>(*exec->heap())) ArrayPrototype(globalObject, structure);
- prototype->finishCreation(globalObject);
- return prototype;
- }
+ static ArrayPrototype* create(ExecState*, JSGlobalObject*, Structure*);
static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
@@ -47,7 +42,7 @@ namespace JSC {
static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
{
- return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info);
+ return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info, ArrayWithArrayStorage);
}
protected:
diff --git a/Source/JavaScriptCore/runtime/ArrayStorage.h b/Source/JavaScriptCore/runtime/ArrayStorage.h
new file mode 100644
index 000000000..d967d0b5a
--- /dev/null
+++ b/Source/JavaScriptCore/runtime/ArrayStorage.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2012 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 ArrayStorage_h
+#define ArrayStorage_h
+
+#include "ArrayConventions.h"
+#include "Butterfly.h"
+#include "IndexingHeader.h"
+#include "SparseArrayValueMap.h"
+#include "WriteBarrier.h"
+#include <wtf/Noncopyable.h>
+#include <wtf/Platform.h>
+
+namespace JSC {
+
+// This struct holds the actual data values of an array. A JSArray object points to its contained ArrayStorage
+// struct by pointing to m_vector. To access the contained ArrayStorage struct, use the getStorage() and
+// setStorage() methods. It is important to note that there may be space before the ArrayStorage that
+// is used to quick unshift / shift operation. The actual allocated pointer is available by using:
+// getStorage() - m_indexBias * sizeof(JSValue)
+struct ArrayStorage {
+ WTF_MAKE_NONCOPYABLE(ArrayStorage);
+private:
+ ArrayStorage() { } // Not directly instantiable. Can only be created as part of a Butterfly.
+public:
+
+ static ArrayStorage* from(Butterfly* butterfly) { return reinterpret_cast<ArrayStorage*>(butterfly); }
+ static ArrayStorage* from(IndexingHeader* indexingHeader) { return indexingHeader->arrayStorage(); }
+
+ Butterfly* butterfly() { return reinterpret_cast<Butterfly*>(this); }
+ IndexingHeader* indexingHeader() { return IndexingHeader::from(this); }
+
+ // We steal two fields from the indexing header: vectorLength and length.
+ unsigned length() { return indexingHeader()->publicLength(); }
+ void setLength(unsigned length) { indexingHeader()->setPublicLength(length); }
+ unsigned vectorLength() { return indexingHeader()->vectorLength(); }
+ void setVectorLength(unsigned length) { indexingHeader()->setVectorLength(length); }
+
+ ALWAYS_INLINE void copyHeaderFromDuringGC(const ArrayStorage& other)
+ {
+ m_sparseMap.copyFrom(other.m_sparseMap);
+ m_indexBias = other.m_indexBias;
+ m_numValuesInVector = other.m_numValuesInVector;
+#if CHECK_ARRAY_CONSISTENCY
+ m_initializationIndex = other.m_initializationIndex;
+ m_inCompactInitialization = other.m_inCompactInitialization;
+#endif
+ }
+
+ bool inSparseMode()
+ {
+ return m_sparseMap && m_sparseMap->sparseMode();
+ }
+
+ WriteBarrier<SparseArrayValueMap> m_sparseMap;
+ unsigned m_indexBias;
+ unsigned m_numValuesInVector;
+#if CHECK_ARRAY_CONSISTENCY
+ // Needs to be a uintptr_t for alignment purposes.
+ uintptr_t m_initializationIndex;
+ uintptr_t m_inCompactInitialization;
+#elif USE(JSVALUE32_64)
+ uintptr_t m_padding;
+#endif
+ WriteBarrier<Unknown> m_vector[1];
+
+ static ptrdiff_t lengthOffset() { return Butterfly::offsetOfPublicLength(); }
+ static ptrdiff_t vectorLengthOffset() { return Butterfly::offsetOfVectorLength(); }
+ static ptrdiff_t numValuesInVectorOffset() { return OBJECT_OFFSETOF(ArrayStorage, m_numValuesInVector); }
+ static ptrdiff_t vectorOffset() { return OBJECT_OFFSETOF(ArrayStorage, m_vector); }
+ static ptrdiff_t indexBiasOffset() { return OBJECT_OFFSETOF(ArrayStorage, m_indexBias); }
+ static ptrdiff_t sparseMapOffset() { return OBJECT_OFFSETOF(ArrayStorage, m_sparseMap); }
+
+ static size_t sizeFor(unsigned vectorLength)
+ {
+ return ArrayStorage::vectorOffset() + vectorLength * sizeof(WriteBarrier<Unknown>);
+ }
+};
+
+} // namespace JSC
+
+#endif // ArrayStorage_h
+
diff --git a/Source/JavaScriptCore/runtime/Butterfly.h b/Source/JavaScriptCore/runtime/Butterfly.h
new file mode 100644
index 000000000..1926169ba
--- /dev/null
+++ b/Source/JavaScriptCore/runtime/Butterfly.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2012 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 Butterfly_h
+#define Butterfly_h
+
+#include "IndexingHeader.h"
+#include "PropertyOffset.h"
+#include "PropertyStorage.h"
+#include <wtf/Noncopyable.h>
+#include <wtf/Platform.h>
+
+namespace JSC {
+
+class JSGlobalData;
+class SlotVisitor;
+struct ArrayStorage;
+
+class Butterfly {
+ WTF_MAKE_NONCOPYABLE(Butterfly);
+private:
+ Butterfly() { } // Not instantiable.
+public:
+
+ static size_t totalSize(size_t preCapacity, size_t propertyCapacity, bool hasIndexingHeader, size_t indexingPayloadSizeInBytes)
+ {
+ ASSERT(indexingPayloadSizeInBytes ? hasIndexingHeader : true);
+ ASSERT(sizeof(EncodedJSValue) == sizeof(IndexingHeader));
+ return (preCapacity + propertyCapacity) * sizeof(EncodedJSValue) + (hasIndexingHeader ? sizeof(IndexingHeader) : 0) + indexingPayloadSizeInBytes;
+ }
+
+ static Butterfly* fromBase(void* base, size_t preCapacity, size_t propertyCapacity)
+ {
+ return reinterpret_cast<Butterfly*>(static_cast<EncodedJSValue*>(base) + preCapacity + propertyCapacity + 1);
+ }
+
+ static ptrdiff_t offsetOfIndexingHeader() { return IndexingHeader::offsetOfIndexingHeader(); }
+ static ptrdiff_t offsetOfPublicLength() { return offsetOfIndexingHeader() + IndexingHeader::offsetOfPublicLength(); }
+ static ptrdiff_t offsetOfVectorLength() { return offsetOfIndexingHeader() + IndexingHeader::offsetOfVectorLength(); }
+
+ static Butterfly* createUninitialized(JSGlobalData&, size_t preCapacity, size_t propertyCapacity, bool hasIndexingHeader, size_t indexingPayloadSizeInBytes);
+
+ static Butterfly* create(JSGlobalData&, size_t preCapacity, size_t propertyCapacity, bool hasIndexingHeader, const IndexingHeader&, size_t indexingPayloadSizeInBytes);
+ static Butterfly* create(JSGlobalData&, Structure*);
+ static Butterfly* createUninitializedDuringCollection(SlotVisitor&, size_t preCapacity, size_t propertyCapacity, bool hasIndexingHeader, size_t indexingPayloadSizeInBytes);
+
+ IndexingHeader* indexingHeader() { return IndexingHeader::from(this); }
+ const IndexingHeader* indexingHeader() const { return IndexingHeader::from(this); }
+ PropertyStorage propertyStorage() { return indexingHeader()->propertyStorage(); }
+ ConstPropertyStorage propertyStorage() const { return indexingHeader()->propertyStorage(); }
+ template<typename T>
+ T* indexingPayload() { return reinterpret_cast<T*>(this); }
+ ArrayStorage* arrayStorage() { return indexingPayload<ArrayStorage>(); }
+
+ static ptrdiff_t offsetOfPropertyStorage() { return -static_cast<ptrdiff_t>(sizeof(IndexingHeader)); }
+ static int indexOfPropertyStorage()
+ {
+ ASSERT(sizeof(IndexingHeader) == sizeof(EncodedJSValue));
+ return -1;
+ }
+
+ void* base(size_t preCapacity, size_t propertyCapacity) { return propertyStorage() - propertyCapacity - preCapacity; }
+ void* base(Structure*);
+
+ // The butterfly reallocation methods perform the reallocation itself but do not change any
+ // of the meta-data to reflect that the reallocation occurred. Note that this set of
+ // methods is not exhaustive and is not intended to encapsulate all possible allocation
+ // modes of butterflies - there are code paths that allocate butterflies by calling
+ // directly into Heap::tryAllocateStorage.
+ Butterfly* growPropertyStorage(JSGlobalData&, size_t preCapacity, size_t oldPropertyCapacity, bool hasIndexingHeader, size_t indexingPayloadSizeInBytes, size_t newPropertyCapacity);
+ Butterfly* growPropertyStorage(JSGlobalData&, Structure* oldStructure, size_t oldPropertyCapacity, size_t newPropertyCapacity);
+ Butterfly* growPropertyStorage(JSGlobalData&, Structure* oldStructure, size_t newPropertyCapacity);
+ Butterfly* growArrayRight(JSGlobalData&, Structure* oldStructure, size_t propertyCapacity, bool hadIndexingHeader, size_t oldIndexingPayloadSizeInBytes, size_t newIndexingPayloadSizeInBytes); // Assumes that preCapacity is zero, and asserts as much.
+ Butterfly* growArrayRight(JSGlobalData&, Structure*, size_t newIndexingPayloadSizeInBytes);
+ Butterfly* resizeArray(JSGlobalData&, size_t propertyCapacity, bool oldHasIndexingHeader, size_t oldIndexingPayloadSizeInBytes, size_t newPreCapacity, bool newHasIndexingHeader, size_t newIndexingPayloadSizeInBytes);
+ Butterfly* resizeArray(JSGlobalData&, Structure*, size_t newPreCapacity, size_t newIndexingPayloadSizeInBytes); // Assumes that you're not changing whether or not the object has an indexing header.
+ Butterfly* unshift(Structure*, size_t numberOfSlots);
+ Butterfly* shift(Structure*, size_t numberOfSlots);
+};
+
+} // namespace JSC
+
+#endif // Butterfly_h
+
diff --git a/Source/JavaScriptCore/runtime/ButterflyInlineMethods.h b/Source/JavaScriptCore/runtime/ButterflyInlineMethods.h
new file mode 100644
index 000000000..049350342
--- /dev/null
+++ b/Source/JavaScriptCore/runtime/ButterflyInlineMethods.h
@@ -0,0 +1,179 @@
+/*
+ * Copyright (C) 2012 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 ButterflyInlineMethods_h
+#define ButterflyInlineMethods_h
+
+#include "ArrayStorage.h"
+#include "Butterfly.h"
+#include "CopiedSpaceInlineMethods.h"
+#include "JSGlobalData.h"
+#include "SlotVisitor.h"
+#include "Structure.h"
+
+namespace JSC {
+
+inline Butterfly* Butterfly::createUninitialized(JSGlobalData& globalData, size_t preCapacity, size_t propertyCapacity, bool hasIndexingHeader, size_t indexingPayloadSizeInBytes)
+{
+ void* temp;
+ size_t size = totalSize(preCapacity, propertyCapacity, hasIndexingHeader, indexingPayloadSizeInBytes);
+ if (!globalData.heap.tryAllocateStorage(size, &temp))
+ CRASH();
+ Butterfly* result = fromBase(temp, preCapacity, propertyCapacity);
+ return result;
+}
+
+inline Butterfly* Butterfly::create(JSGlobalData& globalData, size_t preCapacity, size_t propertyCapacity, bool hasIndexingHeader, const IndexingHeader& indexingHeader, size_t indexingPayloadSizeInBytes)
+{
+ Butterfly* result = createUninitialized(
+ globalData, preCapacity, propertyCapacity, hasIndexingHeader, indexingPayloadSizeInBytes);
+ if (hasIndexingHeader)
+ *result->indexingHeader() = indexingHeader;
+ return result;
+}
+
+inline Butterfly* Butterfly::create(JSGlobalData& globalData, Structure* structure)
+{
+ return create(globalData, 0, structure->outOfLineCapacity(), hasIndexingHeader(structure->indexingType()), IndexingHeader(), 0);
+}
+
+inline Butterfly* Butterfly::createUninitializedDuringCollection(SlotVisitor& visitor, size_t preCapacity, size_t propertyCapacity, bool hasIndexingHeader, size_t indexingPayloadSizeInBytes)
+{
+ Butterfly* result = fromBase(
+ visitor.allocateNewSpace(totalSize(preCapacity, propertyCapacity, hasIndexingHeader, indexingPayloadSizeInBytes)),
+ preCapacity, propertyCapacity);
+ return result;
+}
+
+inline void* Butterfly::base(Structure* structure)
+{
+ return base(indexingHeader()->preCapacity(structure), structure->outOfLineCapacity());
+}
+
+inline Butterfly* Butterfly::growPropertyStorage(JSGlobalData& globalData, size_t preCapacity, size_t oldPropertyCapacity, bool hasIndexingHeader, size_t indexingPayloadSizeInBytes, size_t newPropertyCapacity)
+{
+ ASSERT(newPropertyCapacity > oldPropertyCapacity);
+ Butterfly* result = createUninitialized(
+ globalData, preCapacity, newPropertyCapacity, hasIndexingHeader, indexingPayloadSizeInBytes);
+ memcpy(
+ result->propertyStorage() - oldPropertyCapacity,
+ propertyStorage() - oldPropertyCapacity,
+ totalSize(0, oldPropertyCapacity, hasIndexingHeader, indexingPayloadSizeInBytes));
+ return result;
+}
+
+inline Butterfly* Butterfly::growPropertyStorage(JSGlobalData& globalData, Structure* structure, size_t oldPropertyCapacity, size_t newPropertyCapacity)
+{
+ return growPropertyStorage(
+ globalData, indexingHeader()->preCapacity(structure), oldPropertyCapacity,
+ hasIndexingHeader(structure->indexingType()),
+ indexingHeader()->indexingPayloadSizeInBytes(structure), newPropertyCapacity);
+}
+
+inline Butterfly* Butterfly::growPropertyStorage(JSGlobalData& globalData, Structure* oldStructure, size_t newPropertyCapacity)
+{
+ return growPropertyStorage(
+ globalData, oldStructure, oldStructure->outOfLineCapacity(), newPropertyCapacity);
+}
+
+inline Butterfly* Butterfly::growArrayRight(JSGlobalData& globalData, Structure* oldStructure, size_t propertyCapacity, bool hadIndexingHeader, size_t oldIndexingPayloadSizeInBytes, size_t newIndexingPayloadSizeInBytes)
+{
+ ASSERT_UNUSED(oldStructure, !indexingHeader()->preCapacity(oldStructure));
+ ASSERT_UNUSED(oldStructure, hadIndexingHeader == hasIndexingHeader(oldStructure->indexingType()));
+ void* theBase = base(0, propertyCapacity);
+ size_t oldSize = totalSize(0, propertyCapacity, hadIndexingHeader, oldIndexingPayloadSizeInBytes);
+ size_t newSize = totalSize(0, propertyCapacity, true, newIndexingPayloadSizeInBytes);
+ if (!globalData.heap.tryReallocateStorage(&theBase, oldSize, newSize))
+ return 0;
+ return fromBase(theBase, 0, propertyCapacity);
+}
+
+inline Butterfly* Butterfly::growArrayRight(JSGlobalData& globalData, Structure* oldStructure, size_t newIndexingPayloadSizeInBytes)
+{
+ return growArrayRight(
+ globalData, oldStructure, oldStructure->outOfLineCapacity(),
+ hasIndexingHeader(oldStructure->indexingType()),
+ indexingHeader()->indexingPayloadSizeInBytes(oldStructure), newIndexingPayloadSizeInBytes);
+}
+
+inline Butterfly* Butterfly::resizeArray(JSGlobalData& globalData, size_t propertyCapacity, bool oldHasIndexingHeader, size_t oldIndexingPayloadSizeInBytes, size_t newPreCapacity, bool newHasIndexingHeader, size_t newIndexingPayloadSizeInBytes)
+{
+ Butterfly* result = createUninitialized(
+ globalData, newPreCapacity, propertyCapacity, newHasIndexingHeader, newIndexingPayloadSizeInBytes);
+ // FIXME: This could be made much more efficient if we used the property size,
+ // not the capacity.
+ void* to = result->propertyStorage() - propertyCapacity;
+ void* from = propertyStorage() - propertyCapacity;
+ size_t size = std::min(
+ totalSize(0, propertyCapacity, oldHasIndexingHeader, oldIndexingPayloadSizeInBytes),
+ totalSize(0, propertyCapacity, newHasIndexingHeader, newIndexingPayloadSizeInBytes));
+ memcpy(to, from, size);
+ return result;
+}
+
+inline Butterfly* Butterfly::resizeArray(JSGlobalData& globalData, Structure* structure, size_t newPreCapacity, size_t newIndexingPayloadSizeInBytes)
+{
+ bool hasIndexingHeader = JSC::hasIndexingHeader(structure->indexingType());
+ return resizeArray(
+ globalData, structure->outOfLineCapacity(), hasIndexingHeader,
+ indexingHeader()->indexingPayloadSizeInBytes(structure), newPreCapacity,
+ hasIndexingHeader, newIndexingPayloadSizeInBytes);
+}
+
+inline Butterfly* Butterfly::unshift(Structure* structure, size_t numberOfSlots)
+{
+ ASSERT(hasIndexingHeader(structure->indexingType()));
+ ASSERT(numberOfSlots <= indexingHeader()->preCapacity(structure));
+ unsigned propertyCapacity = structure->outOfLineCapacity();
+ // FIXME: It would probably be wise to rewrite this as a loop since (1) we know in which
+ // direction we're moving memory so we don't need the extra check of memmove and (2) we're
+ // moving a small amount of memory in the common case so the throughput of memmove won't
+ // amortize the overhead of calling it. And no, we cannot rely on the C++ compiler to
+ // inline memmove (particularly since the size argument is likely to be variable), nor can
+ // we rely on the compiler to recognize the ordering of the pointer arguments (since
+ // propertyCapacity is variable and could cause wrap-around as far as the compiler knows).
+ memmove(
+ propertyStorage() - numberOfSlots - propertyCapacity,
+ propertyStorage() - propertyCapacity,
+ sizeof(EncodedJSValue) * propertyCapacity + sizeof(IndexingHeader) + ArrayStorage::sizeFor(0));
+ return IndexingHeader::fromEndOf(propertyStorage() - numberOfSlots)->butterfly();
+}
+
+inline Butterfly* Butterfly::shift(Structure* structure, size_t numberOfSlots)
+{
+ ASSERT(hasIndexingHeader(structure->indexingType()));
+ unsigned propertyCapacity = structure->outOfLineCapacity();
+ // FIXME: See comment in unshift(), above.
+ memmove(
+ propertyStorage() - propertyCapacity + numberOfSlots,
+ propertyStorage() - propertyCapacity,
+ sizeof(EncodedJSValue) * propertyCapacity + sizeof(IndexingHeader) + ArrayStorage::sizeFor(0));
+ return IndexingHeader::fromEndOf(propertyStorage() + numberOfSlots)->butterfly();
+}
+
+} // namespace JSC
+
+#endif // ButterflyInlineMethods_h
+
diff --git a/Source/JavaScriptCore/runtime/ClassInfo.h b/Source/JavaScriptCore/runtime/ClassInfo.h
index 4c72f3ed1..0e1747b24 100644
--- a/Source/JavaScriptCore/runtime/ClassInfo.h
+++ b/Source/JavaScriptCore/runtime/ClassInfo.h
@@ -72,6 +72,9 @@ namespace JSC {
typedef void (*GetOwnPropertyNamesFunctionPtr)(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
GetOwnPropertyNamesFunctionPtr getOwnPropertyNames;
+ typedef void (*GetOwnNonIndexPropertyNamesFunctionPtr)(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
+ GetOwnNonIndexPropertyNamesFunctionPtr getOwnNonIndexPropertyNames;
+
typedef void (*GetPropertyNamesFunctionPtr)(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
GetPropertyNamesFunctionPtr getPropertyNames;
@@ -124,6 +127,7 @@ struct MemberCheck##member { \
&ClassName::toThisObject, \
&ClassName::defaultValue, \
&ClassName::getOwnPropertyNames, \
+ &ClassName::getOwnNonIndexPropertyNames, \
&ClassName::getPropertyNames, \
&ClassName::className, \
&ClassName::hasInstance, \
diff --git a/Source/JavaScriptCore/runtime/Executable.h b/Source/JavaScriptCore/runtime/Executable.h
index f63cc7f99..76ed21d8b 100644
--- a/Source/JavaScriptCore/runtime/Executable.h
+++ b/Source/JavaScriptCore/runtime/Executable.h
@@ -31,6 +31,7 @@
#include "HandlerInfo.h"
#include "JSFunction.h"
#include "Interpreter.h"
+#include "JSGlobalObject.h"
#include "LLIntCLoop.h"
#include "Nodes.h"
#include "SamplingTool.h"
@@ -754,6 +755,13 @@ namespace JSC {
WriteBarrier<SharedSymbolTable> m_symbolTable;
};
+ inline JSFunction::JSFunction(JSGlobalData& globalData, FunctionExecutable* executable, JSScope* scope)
+ : Base(globalData, scope->globalObject()->functionStructure())
+ , m_executable(globalData, this, executable)
+ , m_scope(globalData, this, scope)
+ {
+ }
+
inline FunctionExecutable* JSFunction::jsExecutable() const
{
ASSERT(!isHostFunctionNonInline());
diff --git a/Source/JavaScriptCore/runtime/IndexingHeader.h b/Source/JavaScriptCore/runtime/IndexingHeader.h
new file mode 100644
index 000000000..caa18183a
--- /dev/null
+++ b/Source/JavaScriptCore/runtime/IndexingHeader.h
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2012 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 IndexingHeader_h
+#define IndexingHeader_h
+
+#include "PropertyStorage.h"
+#include <wtf/Platform.h>
+
+namespace JSC {
+
+class Butterfly;
+class LLIntOffsetsExtractor;
+class Structure;
+struct ArrayStorage;
+
+class IndexingHeader {
+public:
+ // Define the maximum storage vector length to be 2^32 / sizeof(JSValue) / 2 to ensure that
+ // there is no risk of overflow.
+ enum { maximumLength = 0x10000000 };
+
+ static ptrdiff_t offsetOfIndexingHeader() { return -static_cast<ptrdiff_t>(sizeof(IndexingHeader)); }
+
+ static ptrdiff_t offsetOfPublicLength() { return OBJECT_OFFSETOF(IndexingHeader, m_publicLength); }
+ static ptrdiff_t offsetOfVectorLength() { return OBJECT_OFFSETOF(IndexingHeader, m_vectorLength); }
+
+ IndexingHeader()
+ : m_publicLength(0)
+ , m_vectorLength(0)
+ {
+ }
+
+ uint32_t vectorLength() const { return m_vectorLength; }
+
+ void setVectorLength(uint32_t length)
+ {
+ ASSERT(length <= maximumLength);
+ m_vectorLength = length;
+ }
+
+ uint32_t publicLength() { return m_publicLength; }
+ void setPublicLength(uint32_t auxWord) { m_publicLength = auxWord; }
+
+ static IndexingHeader* from(Butterfly* butterfly)
+ {
+ return reinterpret_cast<IndexingHeader*>(butterfly) - 1;
+ }
+
+ static const IndexingHeader* from(const Butterfly* butterfly)
+ {
+ return reinterpret_cast<const IndexingHeader*>(butterfly) - 1;
+ }
+
+ static IndexingHeader* from(ArrayStorage* arrayStorage)
+ {
+ return reinterpret_cast<IndexingHeader*>(arrayStorage) - 1;
+ }
+
+ static IndexingHeader* fromEndOf(PropertyStorage propertyStorage)
+ {
+ return reinterpret_cast<IndexingHeader*>(propertyStorage);
+ }
+
+ PropertyStorage propertyStorage()
+ {
+ return reinterpret_cast<PropertyStorage>(this);
+ }
+
+ ConstPropertyStorage propertyStorage() const
+ {
+ return reinterpret_cast<ConstPropertyStorage>(this);
+ }
+
+ ArrayStorage* arrayStorage()
+ {
+ return reinterpret_cast<ArrayStorage*>(this + 1);
+ }
+
+ Butterfly* butterfly()
+ {
+ return reinterpret_cast<Butterfly*>(this + 1);
+ }
+
+ // These methods are not standalone in the sense that they cannot be
+ // used on a copy of the IndexingHeader.
+ size_t preCapacity(Structure*);
+ size_t indexingPayloadSizeInBytes(Structure*);
+
+private:
+ friend class LLIntOffsetsExtractor;
+
+ uint32_t m_publicLength; // The meaning of this field depends on the array type, but for all JSArrays we rely on this being the publicly visible length (array.length).
+ uint32_t m_vectorLength; // The length of the indexed property storage. The actual size of the storage depends on this, and the type.
+};
+
+} // namespace JSC
+
+#endif // IndexingHeader_h
+
diff --git a/Source/JavaScriptCore/runtime/IndexingHeaderInlineMethods.h b/Source/JavaScriptCore/runtime/IndexingHeaderInlineMethods.h
new file mode 100644
index 000000000..8d6e08256
--- /dev/null
+++ b/Source/JavaScriptCore/runtime/IndexingHeaderInlineMethods.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2012 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 IndexingHeaderInlineMethods_h
+#define IndexingHeaderInlineMethods_h
+
+#include "ArrayStorage.h"
+#include "IndexingHeader.h"
+#include "Structure.h"
+
+namespace JSC {
+
+inline size_t IndexingHeader::preCapacity(Structure* structure)
+{
+ if (LIKELY(!(structure->indexingType() & HasArrayStorage)))
+ return 0;
+
+ return arrayStorage()->m_indexBias;
+}
+
+inline size_t IndexingHeader::indexingPayloadSizeInBytes(Structure* structure)
+{
+ if (LIKELY(!(structure->indexingType() & HasArrayStorage)))
+ return 0;
+
+ return ArrayStorage::sizeFor(arrayStorage()->vectorLength());
+}
+
+} // namespace JSC
+
+#endif // IndexingHeaderInlineMethods_h
+
diff --git a/Source/JavaScriptCore/runtime/IndexingType.h b/Source/JavaScriptCore/runtime/IndexingType.h
new file mode 100644
index 000000000..cd8d71dfe
--- /dev/null
+++ b/Source/JavaScriptCore/runtime/IndexingType.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2012 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 IndexingType_h
+#define IndexingType_h
+
+namespace JSC {
+
+typedef uint8_t IndexingType;
+
+// Flags for testing the presence of capabilities.
+static const IndexingType IsArray = 1;
+static const IndexingType HasArrayStorage = 8;
+
+// Additional flags for tracking the history of the type. These are usually
+// masked off unless you ask for them directly.
+static const IndexingType HadArrayStorage = 16; // Means that this object did have array storage in the past.
+
+// List of acceptable array types.
+static const IndexingType NonArray = 0;
+static const IndexingType NonArrayWithArrayStorage = HasArrayStorage;
+static const IndexingType ArrayClass = IsArray; // I'd want to call this "Array" but this would lead to disastrous namespace pollution.
+static const IndexingType ArrayWithArrayStorage = IsArray | HasArrayStorage;
+
+// Mask of all possible types.
+static const IndexingType AllArrayTypes = 15;
+
+// Mask of all possible types including the history.
+static const IndexingType AllArrayTypesAndHistory = 31;
+
+inline bool hasIndexingHeader(IndexingType type)
+{
+ return !!(type & HasArrayStorage);
+}
+
+} // namespace JSC
+
+#endif // IndexingType_h
+
diff --git a/Source/JavaScriptCore/runtime/JSActivation.cpp b/Source/JavaScriptCore/runtime/JSActivation.cpp
index ae403ce46..dc061bc57 100644
--- a/Source/JavaScriptCore/runtime/JSActivation.cpp
+++ b/Source/JavaScriptCore/runtime/JSActivation.cpp
@@ -41,28 +41,6 @@ ASSERT_CLASS_FITS_IN_CELL(JSActivation);
const ClassInfo JSActivation::s_info = { "JSActivation", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSActivation) };
-JSActivation::JSActivation(CallFrame* callFrame, FunctionExecutable* functionExecutable)
- : Base(
- callFrame->globalData(),
- callFrame->lexicalGlobalObject()->activationStructure(),
- callFrame->registers(),
- callFrame->scope()
- )
- , m_registerArray(callFrame->globalData(), this, 0)
- , m_numCapturedArgs(max(callFrame->argumentCount(), functionExecutable->parameterCount()))
- , m_numCapturedVars(functionExecutable->capturedVariableCount())
- , m_isTornOff(false)
- , m_requiresDynamicChecks(functionExecutable->usesEval() && !functionExecutable->isStrictMode())
- , m_argumentsRegister(functionExecutable->generatedBytecode().argumentsRegister())
-{
-}
-
-void JSActivation::finishCreation(CallFrame* callFrame, FunctionExecutable* functionExecutable)
-{
- Base::finishCreation(callFrame->globalData(), functionExecutable->symbolTable());
- ASSERT(inherits(&s_info));
-}
-
void JSActivation::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
JSActivation* thisObject = jsCast<JSActivation*>(cell);
@@ -72,18 +50,11 @@ void JSActivation::visitChildren(JSCell* cell, SlotVisitor& visitor)
Base::visitChildren(thisObject, visitor);
// No need to mark our registers if they're still in the RegisterFile.
- PropertyStorage registerArray = thisObject->m_registerArray.get();
- if (!registerArray)
+ if (!thisObject->isTornOff())
return;
- visitor.copyAndAppend(bitwise_cast<void**>(&registerArray), thisObject->registerArraySizeInBytes(), reinterpret_cast<JSValue*>(registerArray), thisObject->registerArraySize());
- thisObject->m_registerArray.set(registerArray, StorageBarrier::Unchecked);
- thisObject->m_registers = registerArray + thisObject->registerOffset();
-
- // Update the arguments object, since it points at our buffer.
- CallFrame* callFrame = CallFrame::create(reinterpret_cast<Register*>(thisObject->m_registers));
- if (JSValue v = callFrame->uncheckedR(unmodifiedArgumentsRegister(thisObject->m_argumentsRegister)).jsValue())
- jsCast<Arguments*>(v)->setRegisters(thisObject->m_registers);
+ for (size_t i = 0; i < thisObject->storageSize(); ++i)
+ visitor.append(&thisObject->storage()[i]);
}
inline bool JSActivation::symbolTableGet(PropertyName propertyName, PropertySlot& slot)
@@ -93,7 +64,7 @@ inline bool JSActivation::symbolTableGet(PropertyName propertyName, PropertySlot
return false;
// Defend against the inspector asking for a var after it has been optimized out.
- if (m_isTornOff && entry.getIndex() >= m_numCapturedVars)
+ if (isTornOff() && !isValid(entry))
return false;
slot.setValue(registerAt(entry.getIndex()).get());
@@ -107,7 +78,7 @@ inline bool JSActivation::symbolTableGet(PropertyName propertyName, PropertyDesc
return false;
// Defend against the inspector asking for a var after it has been optimized out.
- if (m_isTornOff && entry.getIndex() >= m_numCapturedVars)
+ if (isTornOff() && !isValid(entry))
return false;
descriptor.setDescriptor(registerAt(entry.getIndex()).get(), entry.getAttributes());
@@ -129,30 +100,30 @@ inline bool JSActivation::symbolTablePut(ExecState* exec, PropertyName propertyN
}
// Defend against the inspector asking for a var after it has been optimized out.
- if (m_isTornOff && entry.getIndex() >= m_numCapturedVars)
+ if (isTornOff() && !isValid(entry))
return false;
registerAt(entry.getIndex()).set(globalData, this, value);
return true;
}
-void JSActivation::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
+void JSActivation::getOwnNonIndexPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
JSActivation* thisObject = jsCast<JSActivation*>(object);
- if (mode == IncludeDontEnumProperties)
+ if (mode == IncludeDontEnumProperties && !thisObject->isTornOff())
propertyNames.add(exec->propertyNames().arguments);
SymbolTable::const_iterator end = thisObject->symbolTable()->end();
for (SymbolTable::const_iterator it = thisObject->symbolTable()->begin(); it != end; ++it) {
if (it->second.getAttributes() & DontEnum && mode != IncludeDontEnumProperties)
continue;
- if (it->second.getIndex() >= thisObject->m_numCapturedVars)
+ if (!thisObject->isValid(it->second))
continue;
propertyNames.add(Identifier(exec, it->first.get()));
}
- // Skip the JSVariableObject implementation of getOwnPropertyNames
- JSObject::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
+ // Skip the JSVariableObject implementation of getOwnNonIndexPropertyNames
+ JSObject::getOwnNonIndexPropertyNames(thisObject, exec, propertyNames, mode);
}
inline bool JSActivation::symbolTablePutWithAttributes(JSGlobalData& globalData, PropertyName propertyName, JSValue value, unsigned attributes)
@@ -164,7 +135,7 @@ inline bool JSActivation::symbolTablePutWithAttributes(JSGlobalData& globalData,
return false;
SymbolTableEntry& entry = iter->second;
ASSERT(!entry.isNull());
- if (entry.getIndex() >= m_numCapturedVars)
+ if (!isValid(entry))
return false;
entry.setAttributes(attributes);
@@ -178,7 +149,7 @@ bool JSActivation::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyNam
if (propertyName == exec->propertyNames().arguments) {
// Defend against the inspector asking for the arguments object after it has been optimized out.
- if (!thisObject->m_isTornOff) {
+ if (!thisObject->isTornOff()) {
slot.setCustom(thisObject, thisObject->getArgumentsGetter());
return true;
}
@@ -205,7 +176,7 @@ bool JSActivation::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, P
if (propertyName == exec->propertyNames().arguments) {
// Defend against the inspector asking for the arguments object after it has been optimized out.
- if (!thisObject->m_isTornOff) {
+ if (!thisObject->isTornOff()) {
PropertySlot slot;
JSActivation::getOwnPropertySlot(thisObject, exec, propertyName, slot);
descriptor.setDescriptor(slot.getValue(exec, propertyName), DontEnum);
@@ -265,9 +236,12 @@ JSObject* JSActivation::toThisObject(JSCell*, ExecState* exec)
JSValue JSActivation::argumentsGetter(ExecState*, JSValue slotBase, PropertyName)
{
- JSActivation* activation = asActivation(slotBase);
+ JSActivation* activation = jsCast<JSActivation*>(slotBase);
+ if (activation->isTornOff())
+ return jsUndefined();
+
CallFrame* callFrame = CallFrame::create(reinterpret_cast<Register*>(activation->m_registers));
- int argumentsRegister = activation->m_argumentsRegister;
+ int argumentsRegister = callFrame->codeBlock()->argumentsRegister();
if (JSValue arguments = callFrame->uncheckedR(argumentsRegister).jsValue())
return arguments;
int realArgumentsRegister = unmodifiedArgumentsRegister(argumentsRegister);
diff --git a/Source/JavaScriptCore/runtime/JSActivation.h b/Source/JavaScriptCore/runtime/JSActivation.h
index 3abe5f54b..df59c3d94 100644
--- a/Source/JavaScriptCore/runtime/JSActivation.h
+++ b/Source/JavaScriptCore/runtime/JSActivation.h
@@ -37,20 +37,26 @@
namespace JSC {
- class Arguments;
class Register;
class JSActivation : public JSVariableObject {
private:
- JSActivation(CallFrame*, FunctionExecutable*);
+ JSActivation(JSGlobalData& globalData, CallFrame*, SharedSymbolTable*, size_t storageSize);
public:
typedef JSVariableObject Base;
- static JSActivation* create(JSGlobalData& globalData, CallFrame* callFrame, FunctionExecutable* funcExec)
+ static JSActivation* create(JSGlobalData& globalData, CallFrame* callFrame, FunctionExecutable* functionExecutable)
{
- JSActivation* activation = new (NotNull, allocateCell<JSActivation>(globalData.heap)) JSActivation(callFrame, funcExec);
- activation->finishCreation(callFrame, funcExec);
+ size_t storageSize = JSActivation::storageSize(callFrame, functionExecutable->symbolTable());
+ JSActivation* activation = new (
+ NotNull,
+ allocateCell<JSActivation>(
+ globalData.heap,
+ allocationSize(storageSize)
+ )
+ ) JSActivation(globalData, callFrame, functionExecutable->symbolTable(), storageSize);
+ activation->finishCreation(globalData);
return activation;
}
@@ -59,7 +65,7 @@ namespace JSC {
bool isDynamicScope(bool& requiresDynamicChecks) const;
static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
- static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
+ static void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
JS_EXPORT_PRIVATE static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
@@ -75,10 +81,10 @@ namespace JSC {
static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue proto) { return Structure::create(globalData, globalObject, proto, TypeInfo(ActivationObjectType, StructureFlags), &s_info); }
- bool isValidScopedLookup(int index) { return index < m_numCapturedVars; }
+ bool isValid(const SymbolTableEntry&);
+ bool isTornOff();
protected:
- void finishCreation(CallFrame*, FunctionExecutable*);
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | OverridesGetPropertyNames | Base::StructureFlags;
private:
@@ -91,18 +97,32 @@ namespace JSC {
static JSValue argumentsGetter(ExecState*, JSValue, PropertyName);
NEVER_INLINE PropertySlot::GetValueFunc getArgumentsGetter();
- size_t registerOffset();
- size_t registerArraySize();
- size_t registerArraySizeInBytes();
+ static size_t allocationSize(size_t storageSize);
+ static size_t storageSize(CallFrame*, SharedSymbolTable*);
+ static int captureStart(CallFrame*, SharedSymbolTable*);
- StorageBarrier m_registerArray; // Independent copy of registers, used when a variable object copies its registers out of the register file.
- int m_numCapturedArgs;
- int m_numCapturedVars : 30;
- bool m_isTornOff : 1;
- bool m_requiresDynamicChecks : 1;
- int m_argumentsRegister;
+ int registerOffset();
+ size_t storageSize();
+ WriteBarrier<Unknown>* storage(); // storageSize() number of registers.
};
+ extern int activationCount;
+ extern int allTheThingsCount;
+
+ inline JSActivation::JSActivation(JSGlobalData& globalData, CallFrame* callFrame, SharedSymbolTable* symbolTable, size_t storageSize)
+ : Base(
+ globalData,
+ callFrame->lexicalGlobalObject()->activationStructure(),
+ callFrame->registers(),
+ callFrame->scope(),
+ symbolTable
+ )
+ {
+ WriteBarrier<Unknown>* storage = this->storage();
+ for (size_t i = 0; i < storageSize; ++i)
+ new(&storage[i]) WriteBarrier<Unknown>;
+ }
+
JSActivation* asActivation(JSValue);
inline JSActivation* asActivation(JSValue value)
@@ -118,55 +138,89 @@ namespace JSC {
inline bool JSActivation::isDynamicScope(bool& requiresDynamicChecks) const
{
- requiresDynamicChecks = m_requiresDynamicChecks;
+ requiresDynamicChecks = symbolTable()->usesNonStrictEval();
return false;
}
- inline size_t JSActivation::registerOffset()
+ inline int JSActivation::captureStart(CallFrame* callFrame, SharedSymbolTable* symbolTable)
{
- if (!m_numCapturedArgs)
- return 0;
+ if (symbolTable->captureMode() == SharedSymbolTable::AllOfTheThings)
+ return -CallFrame::offsetFor(std::max<size_t>(callFrame->argumentCountIncludingThis(), symbolTable->parameterCountIncludingThis()));
+ return symbolTable->captureStart();
+ }
- size_t capturedArgumentCountIncludingThis = m_numCapturedArgs + 1;
- return CallFrame::offsetFor(capturedArgumentCountIncludingThis);
+ inline size_t JSActivation::storageSize(CallFrame* callFrame, SharedSymbolTable* symbolTable)
+ {
+ return symbolTable->captureEnd() - captureStart(callFrame, symbolTable);
}
- inline size_t JSActivation::registerArraySize()
+ inline int JSActivation::registerOffset()
{
- return registerOffset() + m_numCapturedVars;
+ return -captureStart(CallFrame::create(reinterpret_cast<Register*>(m_registers)), symbolTable());
}
- inline size_t JSActivation::registerArraySizeInBytes()
+ inline size_t JSActivation::storageSize()
{
- return registerArraySize() * sizeof(WriteBarrierBase<Unknown>);
+ return storageSize(CallFrame::create(reinterpret_cast<Register*>(m_registers)), symbolTable());
}
inline void JSActivation::tearOff(JSGlobalData& globalData)
{
- ASSERT(!m_registerArray);
- ASSERT(m_numCapturedVars + m_numCapturedArgs);
-
- void* allocation = 0;
- if (!globalData.heap.tryAllocateStorage(registerArraySizeInBytes(), &allocation))
- CRASH();
- PropertyStorage registerArray = static_cast<PropertyStorage>(allocation);
- PropertyStorage registers = registerArray + registerOffset();
-
- // arguments
- int from = CallFrame::argumentOffset(m_numCapturedArgs - 1);
- int to = CallFrame::thisArgumentOffset(); // Skip 'this' because it's not lexically accessible.
- for (int i = from; i < to; ++i)
- registers[i].set(globalData, this, m_registers[i].get());
-
- // vars
- from = 0;
- to = m_numCapturedVars;
- for (int i = from; i < to; ++i)
- registers[i].set(globalData, this, m_registers[i].get());
-
- m_registerArray.set(globalData, this, registerArray);
- m_registers = registers;
- m_isTornOff = true;
+ ASSERT(!isTornOff());
+
+ int registerOffset = this->registerOffset();
+ WriteBarrierBase<Unknown>* dst = storage() + registerOffset;
+ WriteBarrierBase<Unknown>* src = m_registers;
+
+ if (symbolTable()->captureMode() == SharedSymbolTable::AllOfTheThings) {
+ int from = -registerOffset;
+ int to = CallFrame::thisArgumentOffset(); // Skip 'this' because it's not lexically accessible.
+ for (int i = from; i < to; ++i)
+ dst[i].set(globalData, this, src[i].get());
+
+ dst[RegisterFile::ArgumentCount].set(globalData, this, JSValue(
+ CallFrame::create(reinterpret_cast<Register*>(src))->argumentCountIncludingThis()));
+
+ int captureEnd = symbolTable()->captureEnd();
+ for (int i = 0; i < captureEnd; ++i)
+ dst[i].set(globalData, this, src[i].get());
+ } else {
+ int captureEnd = symbolTable()->captureEnd();
+ for (int i = symbolTable()->captureStart(); i < captureEnd; ++i)
+ dst[i].set(globalData, this, src[i].get());
+ }
+
+ m_registers = dst;
+ ASSERT(isTornOff());
+ }
+
+ inline bool JSActivation::isTornOff()
+ {
+ return m_registers == storage() + registerOffset();
+ }
+
+ inline WriteBarrier<Unknown>* JSActivation::storage()
+ {
+ return reinterpret_cast<WriteBarrier<Unknown>*>(
+ reinterpret_cast<char*>(this) +
+ WTF::roundUpToMultipleOf<sizeof(WriteBarrier<Unknown>)>(sizeof(JSActivation))
+ );
+ }
+
+ inline size_t JSActivation::allocationSize(size_t storageSize)
+ {
+ size_t objectSizeInBytes = WTF::roundUpToMultipleOf<sizeof(WriteBarrier<Unknown>)>(sizeof(JSActivation));
+ size_t storageSizeInBytes = storageSize * sizeof(WriteBarrier<Unknown>);
+ return objectSizeInBytes + storageSizeInBytes;
+ }
+
+ inline bool JSActivation::isValid(const SymbolTableEntry& entry)
+ {
+ if (entry.getIndex() < captureStart(CallFrame::create(reinterpret_cast<Register*>(m_registers)), symbolTable()))
+ return false;
+ if (entry.getIndex() >= symbolTable()->captureEnd())
+ return false;
+ return true;
}
} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/JSArray.cpp b/Source/JavaScriptCore/runtime/JSArray.cpp
index 8e1606fd8..241049dce 100644
--- a/Source/JavaScriptCore/runtime/JSArray.cpp
+++ b/Source/JavaScriptCore/runtime/JSArray.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
- * Copyright (C) 2003, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2007, 2008, 2009, 2012 Apple Inc. All rights reserved.
* Copyright (C) 2003 Peter Kelly (pmk@post.com)
* Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
*
@@ -24,13 +24,17 @@
#include "JSArray.h"
#include "ArrayPrototype.h"
+#include "ButterflyInlineMethods.h"
#include "CopiedSpace.h"
#include "CopiedSpaceInlineMethods.h"
#include "CachedCall.h"
#include "Error.h"
#include "Executable.h"
#include "GetterSetter.h"
+#include "IndexingHeaderInlineMethods.h"
#include "PropertyNameArray.h"
+#include "Reject.h"
+#include "SparseArrayValueMapInlineMethods.h"
#include <wtf/AVLTree.h>
#include <wtf/Assertions.h>
#include <wtf/OwnPtr.h>
@@ -45,480 +49,23 @@ namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(JSArray);
ASSERT_HAS_TRIVIAL_DESTRUCTOR(JSArray);
-// Overview of JSArray
-//
-// Properties of JSArray objects may be stored in one of three locations:
-// * The regular JSObject property map.
-// * A storage vector.
-// * A sparse map of array entries.
-//
-// Properties with non-numeric identifiers, with identifiers that are not representable
-// as an unsigned integer, or where the value is greater than MAX_ARRAY_INDEX
-// (specifically, this is only one property - the value 0xFFFFFFFFU as an unsigned 32-bit
-// integer) are not considered array indices and will be stored in the JSObject property map.
-//
-// All properties with a numeric identifer, representable as an unsigned integer i,
-// where (i <= MAX_ARRAY_INDEX), are an array index and will be stored in either the
-// storage vector or the sparse map. An array index i will be handled in the following
-// fashion:
-//
-// * Where (i < MIN_SPARSE_ARRAY_INDEX) the value will be stored in the storage vector,
-// unless the array is in SparseMode in which case all properties go into the map.
-// * Where (MIN_SPARSE_ARRAY_INDEX <= i <= MAX_STORAGE_VECTOR_INDEX) the value will either
-// be stored in the storage vector or in the sparse array, depending on the density of
-// data that would be stored in the vector (a vector being used where at least
-// (1 / minDensityMultiplier) of the entries would be populated).
-// * Where (MAX_STORAGE_VECTOR_INDEX < i <= MAX_ARRAY_INDEX) the value will always be stored
-// in the sparse array.
-
-// The definition of MAX_STORAGE_VECTOR_LENGTH is dependant on the definition storageSize
-// function below - the MAX_STORAGE_VECTOR_LENGTH limit is defined such that the storage
-// size calculation cannot overflow. (sizeof(ArrayStorage) - sizeof(WriteBarrier<Unknown>)) +
-// (vectorLength * sizeof(WriteBarrier<Unknown>)) must be <= 0xFFFFFFFFU (which is maximum value of size_t).
-#define MAX_STORAGE_VECTOR_LENGTH static_cast<unsigned>((0xFFFFFFFFU - (sizeof(ArrayStorage) - sizeof(WriteBarrier<Unknown>))) / sizeof(WriteBarrier<Unknown>))
-
-// These values have to be macros to be used in max() and min() without introducing
-// a PIC branch in Mach-O binaries, see <rdar://problem/5971391>.
-#define MIN_SPARSE_ARRAY_INDEX 10000U
-#define MAX_STORAGE_VECTOR_INDEX (MAX_STORAGE_VECTOR_LENGTH - 1)
-// 0xFFFFFFFF is a bit weird -- is not an array index even though it's an integer.
-#define MAX_ARRAY_INDEX 0xFFFFFFFEU
-
-// The value BASE_VECTOR_LEN is the maximum number of vector elements we'll allocate
-// for an array that was created with a sepcified length (e.g. a = new Array(123))
-#define BASE_VECTOR_LEN 4U
-
-// The upper bound to the size we'll grow a zero length array when the first element
-// is added.
-#define FIRST_VECTOR_GROW 4U
-
-// Our policy for when to use a vector and when to use a sparse map.
-// For all array indices under MIN_SPARSE_ARRAY_INDEX, we always use a vector.
-// When indices greater than MIN_SPARSE_ARRAY_INDEX are involved, we use a vector
-// as long as it is 1/8 full. If more sparse than that, we use a map.
-static const unsigned minDensityMultiplier = 8;
-
const ClassInfo JSArray::s_info = {"Array", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSArray)};
-// We keep track of the size of the last array after it was grown. We use this
-// as a simple heuristic for as the value to grow the next array from size 0.
-// This value is capped by the constant FIRST_VECTOR_GROW defined above.
-static unsigned lastArraySize = 0;
-
-static inline bool isDenseEnoughForVector(unsigned length, unsigned numValues)
-{
- return length <= MIN_SPARSE_ARRAY_INDEX || length / minDensityMultiplier <= numValues;
-}
-
-static bool reject(ExecState* exec, bool throwException, const char* message)
-{
- if (throwException)
- throwTypeError(exec, ASCIILiteral(message));
- return false;
-}
-
-#if !CHECK_ARRAY_CONSISTENCY
-
-inline void JSArray::checkConsistency(ConsistencyCheckType)
-{
-}
-
-#endif
-
-void JSArray::finishCreation(JSGlobalData& globalData, unsigned initialLength)
-{
- Base::finishCreation(globalData);
- ASSERT(inherits(&s_info));
-
- unsigned initialVectorLength = BASE_VECTOR_LEN;
- unsigned initialStorageSize = storageSize(initialVectorLength);
-
- void* newStorage = 0;
- if (!globalData.heap.tryAllocateStorage(initialStorageSize, &newStorage))
- CRASH();
-
- m_storage = static_cast<ArrayStorage*>(newStorage);
- m_storage->m_allocBase = m_storage;
- m_storage->m_length = initialLength;
- m_vectorLength = initialVectorLength;
- m_storage->m_numValuesInVector = 0;
-#if CHECK_ARRAY_CONSISTENCY
- m_storage->m_inCompactInitialization = false;
-#endif
-
- checkConsistency();
-}
-
-JSArray* JSArray::tryFinishCreationUninitialized(JSGlobalData& globalData, unsigned initialLength)
+Butterfly* createArrayButterflyInDictionaryIndexingMode(JSGlobalData& globalData, unsigned initialLength)
{
- Base::finishCreation(globalData);
- ASSERT(inherits(&s_info));
-
- // Check for lengths larger than we can handle with a vector.
- if (initialLength > MAX_STORAGE_VECTOR_LENGTH)
- return 0;
-
- unsigned initialVectorLength = max(initialLength, BASE_VECTOR_LEN);
- unsigned initialStorageSize = storageSize(initialVectorLength);
-
- void* newStorage = 0;
- if (!globalData.heap.tryAllocateStorage(initialStorageSize, &newStorage))
- CRASH();
-
- m_storage = static_cast<ArrayStorage*>(newStorage);
- m_storage->m_allocBase = m_storage;
- m_storage->m_length = initialLength;
- m_vectorLength = initialVectorLength;
- m_storage->m_numValuesInVector = initialLength;
-
+ Butterfly* butterfly = Butterfly::create(
+ globalData, 0, 0, true, IndexingHeader(), ArrayStorage::sizeFor(0));
+ ArrayStorage* storage = butterfly->arrayStorage();
+ storage->setLength(initialLength);
+ storage->setVectorLength(0);
+ storage->m_indexBias = 0;
+ storage->m_sparseMap.clear();
+ storage->m_numValuesInVector = 0;
#if CHECK_ARRAY_CONSISTENCY
- m_storage->m_initializationIndex = 0;
- m_storage->m_inCompactInitialization = true;
+ storage->m_initializationIndex = 0;
+ storage->m_inCompactInitialization = 0;
#endif
-
- return this;
-}
-
-// This function can be called multiple times on the same object.
-void JSArray::finalize(JSCell* cell)
-{
- JSArray* thisObject = jsCast<JSArray*>(cell);
- thisObject->checkConsistency(DestructorConsistencyCheck);
- thisObject->deallocateSparseMap();
-}
-
-inline SparseArrayValueMap::AddResult SparseArrayValueMap::add(JSArray* array, unsigned i)
-{
- SparseArrayEntry entry;
- entry.setWithoutWriteBarrier(jsUndefined());
-
- AddResult result = m_map.add(i, entry);
- size_t capacity = m_map.capacity();
- if (capacity != m_reportedCapacity) {
- Heap::heap(array)->reportExtraMemoryCost((capacity - m_reportedCapacity) * (sizeof(unsigned) + sizeof(WriteBarrier<Unknown>)));
- m_reportedCapacity = capacity;
- }
- return result;
-}
-
-inline void SparseArrayValueMap::put(ExecState* exec, JSArray* array, unsigned i, JSValue value, bool shouldThrow)
-{
- AddResult result = add(array, i);
- SparseArrayEntry& entry = result.iterator->second;
-
- // To save a separate find & add, we first always add to the sparse map.
- // In the uncommon case that this is a new property, and the array is not
- // extensible, this is not the right thing to have done - so remove again.
- if (result.isNewEntry && !array->isExtensible()) {
- remove(result.iterator);
- if (shouldThrow)
- throwTypeError(exec, ASCIILiteral(StrictModeReadonlyPropertyWriteError));
- return;
- }
-
- if (!(entry.attributes & Accessor)) {
- if (entry.attributes & ReadOnly) {
- if (shouldThrow)
- throwTypeError(exec, ASCIILiteral(StrictModeReadonlyPropertyWriteError));
- return;
- }
-
- entry.set(exec->globalData(), array, value);
- return;
- }
-
- JSValue accessor = entry.Base::get();
- ASSERT(accessor.isGetterSetter());
- JSObject* setter = asGetterSetter(accessor)->setter();
-
- if (!setter) {
- if (shouldThrow)
- throwTypeError(exec, ASCIILiteral(StrictModeReadonlyPropertyWriteError));
- return;
- }
-
- CallData callData;
- CallType callType = setter->methodTable()->getCallData(setter, callData);
- MarkedArgumentBuffer args;
- args.append(value);
- call(exec, setter, callType, callData, array, args);
-}
-
-inline bool SparseArrayValueMap::putDirect(ExecState* exec, JSArray* array, unsigned i, JSValue value, PutDirectIndexMode mode)
-{
- AddResult result = add(array, i);
- SparseArrayEntry& entry = result.iterator->second;
-
- // To save a separate find & add, we first always add to the sparse map.
- // In the uncommon case that this is a new property, and the array is not
- // extensible, this is not the right thing to have done - so remove again.
- if (mode != PutDirectIndexLikePutDirect && result.isNewEntry && !array->isExtensible()) {
- remove(result.iterator);
- return reject(exec, mode == PutDirectIndexShouldThrow, "Attempting to define property on object that is not extensible.");
- }
-
- entry.attributes = 0;
- entry.set(exec->globalData(), array, value);
- return true;
-}
-
-inline void SparseArrayEntry::get(PropertySlot& slot) const
-{
- JSValue value = Base::get();
- ASSERT(value);
-
- if (LIKELY(!value.isGetterSetter())) {
- slot.setValue(value);
- return;
- }
-
- JSObject* getter = asGetterSetter(value)->getter();
- if (!getter) {
- slot.setUndefined();
- return;
- }
-
- slot.setGetterSlot(getter);
-}
-
-inline void SparseArrayEntry::get(PropertyDescriptor& descriptor) const
-{
- descriptor.setDescriptor(Base::get(), attributes);
-}
-
-inline JSValue SparseArrayEntry::get(ExecState* exec, JSArray* array) const
-{
- JSValue result = Base::get();
- ASSERT(result);
-
- if (LIKELY(!result.isGetterSetter()))
- return result;
-
- JSObject* getter = asGetterSetter(result)->getter();
- if (!getter)
- return jsUndefined();
-
- CallData callData;
- CallType callType = getter->methodTable()->getCallData(getter, callData);
- return call(exec, getter, callType, callData, array, exec->emptyList());
-}
-
-inline JSValue SparseArrayEntry::getNonSparseMode() const
-{
- ASSERT(!attributes);
- return Base::get();
-}
-
-inline void SparseArrayValueMap::visitChildren(SlotVisitor& visitor)
-{
- iterator end = m_map.end();
- for (iterator it = m_map.begin(); it != end; ++it)
- visitor.append(&it->second);
-}
-
-void JSArray::allocateSparseMap(JSGlobalData& globalData)
-{
- m_sparseValueMap = new SparseArrayValueMap;
- globalData.heap.addFinalizer(this, finalize);
-}
-
-void JSArray::deallocateSparseMap()
-{
- delete m_sparseValueMap;
- m_sparseValueMap = 0;
-}
-
-void JSArray::enterDictionaryMode(JSGlobalData& globalData)
-{
- ArrayStorage* storage = m_storage;
- SparseArrayValueMap* map = m_sparseValueMap;
-
- if (!map) {
- allocateSparseMap(globalData);
- map = m_sparseValueMap;
- }
-
- if (map->sparseMode())
- return;
-
- map->setSparseMode();
-
- unsigned usedVectorLength = min(storage->m_length, m_vectorLength);
- for (unsigned i = 0; i < usedVectorLength; ++i) {
- JSValue value = storage->m_vector[i].get();
- // This will always be a new entry in the map, so no need to check we can write,
- // and attributes are default so no need to set them.
- if (value)
- map->add(this, i).iterator->second.set(globalData, this, value);
- }
-
- void* newRawStorage = 0;
- if (!globalData.heap.tryAllocateStorage(storageSize(0), &newRawStorage))
- CRASH();
-
- ArrayStorage* newStorage = static_cast<ArrayStorage*>(newRawStorage);
- memcpy(newStorage, m_storage, storageSize(0));
- newStorage->m_allocBase = newStorage;
- m_storage = newStorage;
- m_indexBias = 0;
- m_vectorLength = 0;
-}
-
-void JSArray::putDescriptor(ExecState* exec, SparseArrayEntry* entryInMap, PropertyDescriptor& descriptor, PropertyDescriptor& oldDescriptor)
-{
- if (descriptor.isDataDescriptor()) {
- if (descriptor.value())
- entryInMap->set(exec->globalData(), this, descriptor.value());
- else if (oldDescriptor.isAccessorDescriptor())
- entryInMap->set(exec->globalData(), this, jsUndefined());
- entryInMap->attributes = descriptor.attributesOverridingCurrent(oldDescriptor) & ~Accessor;
- return;
- }
-
- if (descriptor.isAccessorDescriptor()) {
- JSObject* getter = 0;
- if (descriptor.getterPresent())
- getter = descriptor.getterObject();
- else if (oldDescriptor.isAccessorDescriptor())
- getter = oldDescriptor.getterObject();
- JSObject* setter = 0;
- if (descriptor.setterPresent())
- setter = descriptor.setterObject();
- else if (oldDescriptor.isAccessorDescriptor())
- setter = oldDescriptor.setterObject();
-
- GetterSetter* accessor = GetterSetter::create(exec);
- if (getter)
- accessor->setGetter(exec->globalData(), getter);
- if (setter)
- accessor->setSetter(exec->globalData(), setter);
-
- entryInMap->set(exec->globalData(), this, accessor);
- entryInMap->attributes = descriptor.attributesOverridingCurrent(oldDescriptor) & ~ReadOnly;
- return;
- }
-
- ASSERT(descriptor.isGenericDescriptor());
- entryInMap->attributes = descriptor.attributesOverridingCurrent(oldDescriptor);
-}
-
-// Defined in ES5.1 8.12.9
-bool JSArray::defineOwnNumericProperty(ExecState* exec, unsigned index, PropertyDescriptor& descriptor, bool throwException)
-{
- ASSERT(index != 0xFFFFFFFF);
-
- if (!inSparseMode()) {
- // Fast case: we're putting a regular property to a regular array
- // FIXME: this will pessimistically assume that if attributes are missing then they'll default to false
- // – however if the property currently exists missing attributes will override from their current 'true'
- // state (i.e. defineOwnProperty could be used to set a value without needing to entering 'SparseMode').
- if (!descriptor.attributes()) {
- ASSERT(!descriptor.isAccessorDescriptor());
- return putDirectIndex(exec, index, descriptor.value(), throwException ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
- }
-
- enterDictionaryMode(exec->globalData());
- }
-
- SparseArrayValueMap* map = m_sparseValueMap;
- ASSERT(map);
-
- // 1. Let current be the result of calling the [[GetOwnProperty]] internal method of O with property name P.
- SparseArrayValueMap::AddResult result = map->add(this, index);
- SparseArrayEntry* entryInMap = &result.iterator->second;
-
- // 2. Let extensible be the value of the [[Extensible]] internal property of O.
- // 3. If current is undefined and extensible is false, then Reject.
- // 4. If current is undefined and extensible is true, then
- if (result.isNewEntry) {
- if (!isExtensible()) {
- map->remove(result.iterator);
- return reject(exec, throwException, "Attempting to define property on object that is not extensible.");
- }
-
- // 4.a. If IsGenericDescriptor(Desc) or IsDataDescriptor(Desc) is true, then create an own data property
- // named P of object O whose [[Value]], [[Writable]], [[Enumerable]] and [[Configurable]] attribute values
- // are described by Desc. If the value of an attribute field of Desc is absent, the attribute of the newly
- // created property is set to its default value.
- // 4.b. Else, Desc must be an accessor Property Descriptor so, create an own accessor property named P of
- // object O whose [[Get]], [[Set]], [[Enumerable]] and [[Configurable]] attribute values are described by
- // Desc. If the value of an attribute field of Desc is absent, the attribute of the newly created property
- // is set to its default value.
- // 4.c. Return true.
-
- PropertyDescriptor defaults;
- entryInMap->setWithoutWriteBarrier(jsUndefined());
- entryInMap->attributes = DontDelete | DontEnum | ReadOnly;
- entryInMap->get(defaults);
-
- putDescriptor(exec, entryInMap, descriptor, defaults);
- if (index >= m_storage->m_length)
- m_storage->m_length = index + 1;
- return true;
- }
-
- // 5. Return true, if every field in Desc is absent.
- // 6. Return true, if every field in Desc also occurs in current and the value of every field in Desc is the same value as the corresponding field in current when compared using the SameValue algorithm (9.12).
- PropertyDescriptor current;
- entryInMap->get(current);
- if (descriptor.isEmpty() || descriptor.equalTo(exec, current))
- return true;
-
- // 7. If the [[Configurable]] field of current is false then
- if (!current.configurable()) {
- // 7.a. Reject, if the [[Configurable]] field of Desc is true.
- if (descriptor.configurablePresent() && descriptor.configurable())
- return reject(exec, throwException, "Attempting to change configurable attribute of unconfigurable property.");
- // 7.b. Reject, if the [[Enumerable]] field of Desc is present and the [[Enumerable]] fields of current and Desc are the Boolean negation of each other.
- if (descriptor.enumerablePresent() && current.enumerable() != descriptor.enumerable())
- return reject(exec, throwException, "Attempting to change enumerable attribute of unconfigurable property.");
- }
-
- // 8. If IsGenericDescriptor(Desc) is true, then no further validation is required.
- if (!descriptor.isGenericDescriptor()) {
- // 9. Else, if IsDataDescriptor(current) and IsDataDescriptor(Desc) have different results, then
- if (current.isDataDescriptor() != descriptor.isDataDescriptor()) {
- // 9.a. Reject, if the [[Configurable]] field of current is false.
- if (!current.configurable())
- return reject(exec, throwException, "Attempting to change access mechanism for an unconfigurable property.");
- // 9.b. If IsDataDescriptor(current) is true, then convert the property named P of object O from a
- // data property to an accessor property. Preserve the existing values of the converted property‘s
- // [[Configurable]] and [[Enumerable]] attributes and set the rest of the property‘s attributes to
- // their default values.
- // 9.c. Else, convert the property named P of object O from an accessor property to a data property.
- // Preserve the existing values of the converted property‘s [[Configurable]] and [[Enumerable]]
- // attributes and set the rest of the property‘s attributes to their default values.
- } else if (current.isDataDescriptor() && descriptor.isDataDescriptor()) {
- // 10. Else, if IsDataDescriptor(current) and IsDataDescriptor(Desc) are both true, then
- // 10.a. If the [[Configurable]] field of current is false, then
- if (!current.configurable() && !current.writable()) {
- // 10.a.i. Reject, if the [[Writable]] field of current is false and the [[Writable]] field of Desc is true.
- if (descriptor.writable())
- return reject(exec, throwException, "Attempting to change writable attribute of unconfigurable property.");
- // 10.a.ii. If the [[Writable]] field of current is false, then
- // 10.a.ii.1. Reject, if the [[Value]] field of Desc is present and SameValue(Desc.[[Value]], current.[[Value]]) is false.
- if (descriptor.value() && !sameValue(exec, descriptor.value(), current.value()))
- return reject(exec, throwException, "Attempting to change value of a readonly property.");
- }
- // 10.b. else, the [[Configurable]] field of current is true, so any change is acceptable.
- } else {
- ASSERT(current.isAccessorDescriptor() && current.getterPresent() && current.setterPresent());
- // 11. Else, IsAccessorDescriptor(current) and IsAccessorDescriptor(Desc) are both true so, if the [[Configurable]] field of current is false, then
- if (!current.configurable()) {
- // 11.i. Reject, if the [[Set]] field of Desc is present and SameValue(Desc.[[Set]], current.[[Set]]) is false.
- if (descriptor.setterPresent() && descriptor.setter() != current.setter())
- return reject(exec, throwException, "Attempting to change the setter of an unconfigurable property.");
- // 11.ii. Reject, if the [[Get]] field of Desc is present and SameValue(Desc.[[Get]], current.[[Get]]) is false.
- if (descriptor.getterPresent() && descriptor.getter() != current.getter())
- return reject(exec, throwException, "Attempting to change the getter of an unconfigurable property.");
- }
- }
- }
-
- // 12. For each attribute field of Desc that is present, set the correspondingly named attribute of the property named P of object O to the value of the field.
- putDescriptor(exec, entryInMap, descriptor, current);
- // 13. Return true.
- return true;
+ return butterfly;
}
void JSArray::setLengthWritable(ExecState* exec, bool writable)
@@ -527,9 +74,9 @@ void JSArray::setLengthWritable(ExecState* exec, bool writable)
if (!isLengthWritable() || writable)
return;
- enterDictionaryMode(exec->globalData());
+ enterDictionaryIndexingMode(exec->globalData());
- SparseArrayValueMap* map = m_sparseValueMap;
+ SparseArrayValueMap* map = arrayStorage()->m_sparseMap.get();
ASSERT(map);
map->setLengthIsReadOnly();
}
@@ -630,38 +177,10 @@ bool JSArray::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName
// e.i. Set oldLenDesc.[[Value]] to index + 1.
// e.ii. Call the default [[DefineOwnProperty]] internal method (8.12.9) on A passing "length", oldLenDesc, and false as arguments. This call will always return true.
// f. Return true.
- return array->defineOwnNumericProperty(exec, index, descriptor, throwException);
- }
-
- return JSObject::defineOwnProperty(object, exec, propertyName, descriptor, throwException);
-}
-
-bool JSArray::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned i, PropertySlot& slot)
-{
- JSArray* thisObject = jsCast<JSArray*>(cell);
- ArrayStorage* storage = thisObject->m_storage;
-
- if (i >= storage->m_length) {
- if (i > MAX_ARRAY_INDEX)
- return thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, Identifier::from(exec, i), slot);
- return false;
+ return array->defineOwnIndexedProperty(exec, index, descriptor, throwException);
}
- if (i < thisObject->m_vectorLength) {
- JSValue value = storage->m_vector[i].get();
- if (value) {
- slot.setValue(value);
- return true;
- }
- } else if (SparseArrayValueMap* map = thisObject->m_sparseValueMap) {
- SparseArrayValueMap::iterator it = map->find(i);
- if (it != map->notFound()) {
- it->second.get(slot);
- return true;
- }
- }
-
- return JSObject::getOwnPropertySlot(thisObject, exec, Identifier::from(exec, i), slot);
+ return array->JSObject::defineOwnNonIndexProperty(exec, propertyName, descriptor, throwException);
}
bool JSArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
@@ -672,10 +191,6 @@ bool JSArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName pro
return true;
}
- unsigned i = propertyName.asIndex();
- if (i != PropertyName::NotAnIndex)
- return JSArray::getOwnPropertySlotByIndex(thisObject, exec, i, slot);
-
return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot);
}
@@ -687,26 +202,6 @@ bool JSArray::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, Proper
return true;
}
- ArrayStorage* storage = thisObject->m_storage;
-
- unsigned i = propertyName.asIndex();
- if (i != PropertyName::NotAnIndex) {
- if (i >= storage->m_length)
- return false;
- if (i < thisObject->m_vectorLength) {
- WriteBarrier<Unknown>& value = storage->m_vector[i];
- if (value) {
- descriptor.setDescriptor(value.get(), 0);
- return true;
- }
- } else if (SparseArrayValueMap* map = thisObject->m_sparseValueMap) {
- SparseArrayValueMap::iterator it = map->find(i);
- if (it != map->notFound()) {
- it->second.get(descriptor);
- return true;
- }
- }
- }
return JSObject::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
}
@@ -714,11 +209,6 @@ bool JSArray::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, Proper
void JSArray::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
{
JSArray* thisObject = jsCast<JSArray*>(cell);
- unsigned i = propertyName.asIndex();
- if (i != PropertyName::NotAnIndex) {
- putByIndex(thisObject, exec, i, value, slot.isStrictMode());
- return;
- }
if (propertyName == exec->propertyNames().length) {
unsigned newLength = value.toUInt32(exec);
@@ -733,196 +223,9 @@ void JSArray::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSVa
JSObject::put(thisObject, exec, propertyName, value, slot);
}
-void JSArray::putByIndex(JSCell* cell, ExecState* exec, unsigned i, JSValue value, bool shouldThrow)
-{
- JSArray* thisObject = jsCast<JSArray*>(cell);
- thisObject->checkConsistency();
-
- ArrayStorage* storage = thisObject->m_storage;
-
- // Fast case - store to the vector.
- if (i < thisObject->m_vectorLength) {
- WriteBarrier<Unknown>& valueSlot = storage->m_vector[i];
- unsigned length = storage->m_length;
-
- // Update m_length & m_numValuesInVector as necessary.
- if (i >= length) {
- length = i + 1;
- storage->m_length = length;
- ++storage->m_numValuesInVector;
- } else if (!valueSlot)
- ++storage->m_numValuesInVector;
-
- valueSlot.set(exec->globalData(), thisObject, value);
- thisObject->checkConsistency();
- return;
- }
-
- // Handle 2^32-1 - this is not an array index (see ES5.1 15.4), and is treated as a regular property.
- if (UNLIKELY(i > MAX_ARRAY_INDEX)) {
- PutPropertySlot slot(shouldThrow);
- thisObject->methodTable()->put(thisObject, exec, Identifier::from(exec, i), value, slot);
- return;
- }
-
- // For all other cases, call putByIndexBeyondVectorLength.
- thisObject->putByIndexBeyondVectorLength(exec, i, value, shouldThrow);
- thisObject->checkConsistency();
-}
-
-void JSArray::putByIndexBeyondVectorLength(ExecState* exec, unsigned i, JSValue value, bool shouldThrow)
-{
- JSGlobalData& globalData = exec->globalData();
-
- // i should be a valid array index that is outside of the current vector.
- ASSERT(i >= m_vectorLength);
- ASSERT(i <= MAX_ARRAY_INDEX);
-
- ArrayStorage* storage = m_storage;
- SparseArrayValueMap* map = m_sparseValueMap;
-
- // First, handle cases where we don't currently have a sparse map.
- if (LIKELY(!map)) {
- // If the array is not extensible, we should have entered dictionary mode, and created the spare map.
- ASSERT(isExtensible());
-
- // Update m_length if necessary.
- if (i >= storage->m_length)
- storage->m_length = i + 1;
-
- // Check that it is sensible to still be using a vector, and then try to grow the vector.
- if (LIKELY((isDenseEnoughForVector(i, storage->m_numValuesInVector)) && increaseVectorLength(globalData, i + 1))) {
- // success! - reread m_storage since it has likely been reallocated, and store to the vector.
- storage = m_storage;
- storage->m_vector[i].set(globalData, this, value);
- ++storage->m_numValuesInVector;
- return;
- }
- // We don't want to, or can't use a vector to hold this property - allocate a sparse map & add the value.
- allocateSparseMap(exec->globalData());
- map = m_sparseValueMap;
- map->put(exec, this, i, value, shouldThrow);
- return;
- }
-
- // Update m_length if necessary.
- unsigned length = storage->m_length;
- if (i >= length) {
- // Prohibit growing the array if length is not writable.
- if (map->lengthIsReadOnly() || !isExtensible()) {
- if (shouldThrow)
- throwTypeError(exec, ASCIILiteral(StrictModeReadonlyPropertyWriteError));
- return;
- }
- length = i + 1;
- storage->m_length = length;
- }
-
- // We are currently using a map - check whether we still want to be doing so.
- // We will continue to use a sparse map if SparseMode is set, a vector would be too sparse, or if allocation fails.
- unsigned numValuesInArray = storage->m_numValuesInVector + map->size();
- if (map->sparseMode() || !isDenseEnoughForVector(length, numValuesInArray) || !increaseVectorLength(exec->globalData(), length)) {
- map->put(exec, this, i, value, shouldThrow);
- return;
- }
-
- // Reread m_storage afterincreaseVectorLength, update m_numValuesInVector.
- storage = m_storage;
- storage->m_numValuesInVector = numValuesInArray;
-
- // Copy all values from the map into the vector, and delete the map.
- WriteBarrier<Unknown>* vector = storage->m_vector;
- SparseArrayValueMap::const_iterator end = map->end();
- for (SparseArrayValueMap::const_iterator it = map->begin(); it != end; ++it)
- vector[it->first].set(globalData, this, it->second.getNonSparseMode());
- deallocateSparseMap();
-
- // Store the new property into the vector.
- WriteBarrier<Unknown>& valueSlot = vector[i];
- if (!valueSlot)
- ++storage->m_numValuesInVector;
- valueSlot.set(globalData, this, value);
-}
-
-bool JSArray::putDirectIndexBeyondVectorLength(ExecState* exec, unsigned i, JSValue value, PutDirectIndexMode mode)
-{
- JSGlobalData& globalData = exec->globalData();
-
- // i should be a valid array index that is outside of the current vector.
- ASSERT(i >= m_vectorLength);
- ASSERT(i <= MAX_ARRAY_INDEX);
-
- ArrayStorage* storage = m_storage;
- SparseArrayValueMap* map = m_sparseValueMap;
-
- // First, handle cases where we don't currently have a sparse map.
- if (LIKELY(!map)) {
- // If the array is not extensible, we should have entered dictionary mode, and created the spare map.
- ASSERT(isExtensible());
-
- // Update m_length if necessary.
- if (i >= storage->m_length)
- storage->m_length = i + 1;
-
- // Check that it is sensible to still be using a vector, and then try to grow the vector.
- if (LIKELY((isDenseEnoughForVector(i, storage->m_numValuesInVector)) && increaseVectorLength(globalData, i + 1))) {
- // success! - reread m_storage since it has likely been reallocated, and store to the vector.
- storage = m_storage;
- storage->m_vector[i].set(globalData, this, value);
- ++storage->m_numValuesInVector;
- return true;
- }
- // We don't want to, or can't use a vector to hold this property - allocate a sparse map & add the value.
- allocateSparseMap(exec->globalData());
- map = m_sparseValueMap;
- return map->putDirect(exec, this, i, value, mode);
- }
-
- // Update m_length if necessary.
- unsigned length = storage->m_length;
- if (i >= length) {
- // Prohibit growing the array if length is not writable.
- if (mode != PutDirectIndexLikePutDirect) {
- if (map->lengthIsReadOnly())
- return reject(exec, mode == PutDirectIndexShouldThrow, StrictModeReadonlyPropertyWriteError);
- if (!isExtensible())
- return reject(exec, mode == PutDirectIndexShouldThrow, "Attempting to define property on object that is not extensible.");
- }
- length = i + 1;
- storage->m_length = length;
- }
-
- // We are currently using a map - check whether we still want to be doing so.
- // We will continue to use a sparse map if SparseMode is set, a vector would be too sparse, or if allocation fails.
- unsigned numValuesInArray = storage->m_numValuesInVector + map->size();
- if (map->sparseMode() || !isDenseEnoughForVector(length, numValuesInArray) || !increaseVectorLength(exec->globalData(), length))
- return map->putDirect(exec, this, i, value, mode);
-
- // Reread m_storage afterincreaseVectorLength, update m_numValuesInVector.
- storage = m_storage;
- storage->m_numValuesInVector = numValuesInArray;
-
- // Copy all values from the map into the vector, and delete the map.
- WriteBarrier<Unknown>* vector = storage->m_vector;
- SparseArrayValueMap::const_iterator end = map->end();
- for (SparseArrayValueMap::const_iterator it = map->begin(); it != end; ++it)
- vector[it->first].set(globalData, this, it->second.getNonSparseMode());
- deallocateSparseMap();
-
- // Store the new property into the vector.
- WriteBarrier<Unknown>& valueSlot = vector[i];
- if (!valueSlot)
- ++storage->m_numValuesInVector;
- valueSlot.set(globalData, this, value);
- return true;
-}
-
bool JSArray::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName)
{
JSArray* thisObject = jsCast<JSArray*>(cell);
- unsigned i = propertyName.asIndex();
- if (i != PropertyName::NotAnIndex)
- return thisObject->methodTable()->deletePropertyByIndex(thisObject, exec, i);
if (propertyName == exec->propertyNames().length)
return false;
@@ -930,35 +233,6 @@ bool JSArray::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propert
return JSObject::deleteProperty(thisObject, exec, propertyName);
}
-bool JSArray::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned i)
-{
- JSArray* thisObject = jsCast<JSArray*>(cell);
- thisObject->checkConsistency();
-
- if (i > MAX_ARRAY_INDEX)
- return thisObject->methodTable()->deleteProperty(thisObject, exec, Identifier::from(exec, i));
-
- ArrayStorage* storage = thisObject->m_storage;
-
- if (i < thisObject->m_vectorLength) {
- WriteBarrier<Unknown>& valueSlot = storage->m_vector[i];
- if (valueSlot) {
- valueSlot.clear();
- --storage->m_numValuesInVector;
- }
- } else if (SparseArrayValueMap* map = thisObject->m_sparseValueMap) {
- SparseArrayValueMap::iterator it = map->find(i);
- if (it != map->notFound()) {
- if (it->second.attributes & DontDelete)
- return false;
- map->remove(it);
- }
- }
-
- thisObject->checkConsistency();
- return true;
-}
-
static int compareKeysForQSort(const void* a, const void* b)
{
unsigned da = *static_cast<const unsigned*>(a);
@@ -966,127 +240,26 @@ static int compareKeysForQSort(const void* a, const void* b)
return (da > db) - (da < db);
}
-void JSArray::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
+void JSArray::getOwnNonIndexPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
JSArray* thisObject = jsCast<JSArray*>(object);
- // FIXME: Filling PropertyNameArray with an identifier for every integer
- // is incredibly inefficient for large arrays. We need a different approach,
- // which almost certainly means a different structure for PropertyNameArray.
-
- ArrayStorage* storage = thisObject->m_storage;
-
- unsigned usedVectorLength = min(storage->m_length, thisObject->m_vectorLength);
- for (unsigned i = 0; i < usedVectorLength; ++i) {
- if (storage->m_vector[i])
- propertyNames.add(Identifier::from(exec, i));
- }
-
- if (SparseArrayValueMap* map = thisObject->m_sparseValueMap) {
- Vector<unsigned> keys;
- keys.reserveCapacity(map->size());
-
- SparseArrayValueMap::const_iterator end = map->end();
- for (SparseArrayValueMap::const_iterator it = map->begin(); it != end; ++it) {
- if (mode == IncludeDontEnumProperties || !(it->second.attributes & DontEnum))
- keys.append(static_cast<unsigned>(it->first));
- }
-
- qsort(keys.begin(), keys.size(), sizeof(unsigned), compareKeysForQSort);
- for (unsigned i = 0; i < keys.size(); ++i)
- propertyNames.add(Identifier::from(exec, keys[i]));
- }
if (mode == IncludeDontEnumProperties)
propertyNames.add(exec->propertyNames().length);
- JSObject::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
-}
-
-ALWAYS_INLINE unsigned JSArray::getNewVectorLength(unsigned desiredLength)
-{
- ASSERT(desiredLength <= MAX_STORAGE_VECTOR_LENGTH);
-
- unsigned increasedLength;
- unsigned maxInitLength = min(m_storage->m_length, 100000U);
-
- if (desiredLength < maxInitLength)
- increasedLength = maxInitLength;
- else if (!m_vectorLength)
- increasedLength = max(desiredLength, lastArraySize);
- else {
- // Mathematically equivalent to:
- // increasedLength = (newLength * 3 + 1) / 2;
- // or:
- // increasedLength = (unsigned)ceil(newLength * 1.5));
- // This form is not prone to internal overflow.
- increasedLength = desiredLength + (desiredLength >> 1) + (desiredLength & 1);
- }
-
- ASSERT(increasedLength >= desiredLength);
-
- lastArraySize = min(increasedLength, FIRST_VECTOR_GROW);
-
- return min(increasedLength, MAX_STORAGE_VECTOR_LENGTH);
-}
-
-bool JSArray::increaseVectorLength(JSGlobalData& globalData, unsigned newLength)
-{
- // This function leaves the array in an internally inconsistent state, because it does not move any values from sparse value map
- // to the vector. Callers have to account for that, because they can do it more efficiently.
- if (newLength > MAX_STORAGE_VECTOR_LENGTH)
- return false;
-
- ArrayStorage* storage = m_storage;
-
- unsigned vectorLength = m_vectorLength;
- ASSERT(newLength > vectorLength);
- unsigned newVectorLength = getNewVectorLength(newLength);
-
- // Fast case - there is no precapacity. In these cases a realloc makes sense.
- if (LIKELY(!m_indexBias)) {
- void* newStorage = storage->m_allocBase;
- if (!globalData.heap.tryReallocateStorage(&newStorage, storageSize(vectorLength), storageSize(newVectorLength)))
- return false;
-
- storage = m_storage = reinterpret_cast_ptr<ArrayStorage*>(static_cast<char*>(newStorage));
- m_storage->m_allocBase = newStorage;
- ASSERT(m_storage->m_allocBase);
-
- m_vectorLength = newVectorLength;
-
- return true;
- }
-
- // Remove some, but not all of the precapacity. Atomic decay, & capped to not overflow array length.
- unsigned newIndexBias = min(m_indexBias >> 1, MAX_STORAGE_VECTOR_LENGTH - newVectorLength);
- // Calculate new stoarge capcity, allowing room for the pre-capacity.
- unsigned newStorageCapacity = newVectorLength + newIndexBias;
- void* newAllocBase = 0;
- if (!globalData.heap.tryAllocateStorage(storageSize(newStorageCapacity), &newAllocBase))
- return false;
- // The sum of m_vectorLength and m_indexBias will never exceed MAX_STORAGE_VECTOR_LENGTH.
- ASSERT(m_vectorLength <= MAX_STORAGE_VECTOR_LENGTH && (MAX_STORAGE_VECTOR_LENGTH - m_vectorLength) >= m_indexBias);
-
- m_vectorLength = newVectorLength;
- m_indexBias = newIndexBias;
- m_storage = reinterpret_cast_ptr<ArrayStorage*>(reinterpret_cast<WriteBarrier<Unknown>*>(newAllocBase) + m_indexBias);
-
- // Copy the ArrayStorage header & current contents of the vector.
- memmove(m_storage, storage, storageSize(vectorLength));
-
- // Free the old allocation, update m_allocBase.
- m_storage->m_allocBase = newAllocBase;
-
- return true;
+ JSObject::getOwnNonIndexPropertyNames(thisObject, exec, propertyNames, mode);
}
// This method makes room in the vector, but leaves the new space uncleared.
bool JSArray::unshiftCountSlowCase(JSGlobalData& globalData, unsigned count)
{
- // If not, we should have handled this on the fast path.
- ASSERT(count > m_indexBias);
+ ArrayStorage* storage = ensureArrayStorage(globalData);
+ Butterfly* butterfly = storage->butterfly();
+ unsigned propertyCapacity = structure()->outOfLineCapacity();
+ unsigned propertySize = structure()->outOfLineSize();
- ArrayStorage* storage = m_storage;
+ // If not, we should have handled this on the fast path.
+ ASSERT(count > storage->m_indexBias);
// Step 1:
// Gather 4 key metrics:
@@ -1095,8 +268,8 @@ bool JSArray::unshiftCountSlowCase(JSGlobalData& globalData, unsigned count)
// * currentCapacity - what is the current size of the vector, including any pre-capacity.
// * desiredCapacity - how large should we like to grow the vector to - based on 2x requiredVectorLength.
- unsigned length = storage->m_length;
- unsigned usedVectorLength = min(m_vectorLength, length);
+ unsigned length = storage->length();
+ unsigned usedVectorLength = min(storage->vectorLength(), length);
ASSERT(usedVectorLength <= MAX_STORAGE_VECTOR_LENGTH);
// Check that required vector length is possible, in an overflow-safe fashion.
if (count > MAX_STORAGE_VECTOR_LENGTH - usedVectorLength)
@@ -1104,8 +277,8 @@ bool JSArray::unshiftCountSlowCase(JSGlobalData& globalData, unsigned count)
unsigned requiredVectorLength = usedVectorLength + count;
ASSERT(requiredVectorLength <= MAX_STORAGE_VECTOR_LENGTH);
// The sum of m_vectorLength and m_indexBias will never exceed MAX_STORAGE_VECTOR_LENGTH.
- ASSERT(m_vectorLength <= MAX_STORAGE_VECTOR_LENGTH && (MAX_STORAGE_VECTOR_LENGTH - m_vectorLength) >= m_indexBias);
- unsigned currentCapacity = m_vectorLength + m_indexBias;
+ ASSERT(storage->vectorLength() <= MAX_STORAGE_VECTOR_LENGTH && (MAX_STORAGE_VECTOR_LENGTH - storage->vectorLength()) >= storage->m_indexBias);
+ unsigned currentCapacity = storage->vectorLength() + storage->m_indexBias;
// The calculation of desiredCapacity won't overflow, due to the range of MAX_STORAGE_VECTOR_LENGTH.
unsigned desiredCapacity = min(MAX_STORAGE_VECTOR_LENGTH, max(BASE_VECTOR_LEN, requiredVectorLength) << 1);
@@ -1116,10 +289,11 @@ bool JSArray::unshiftCountSlowCase(JSGlobalData& globalData, unsigned count)
unsigned newStorageCapacity;
// If the current storage array is sufficiently large (but not too large!) then just keep using it.
if (currentCapacity > desiredCapacity && isDenseEnoughForVector(currentCapacity, requiredVectorLength)) {
- newAllocBase = storage->m_allocBase;
+ newAllocBase = butterfly->base(structure());
newStorageCapacity = currentCapacity;
} else {
- if (!globalData.heap.tryAllocateStorage(storageSize(desiredCapacity), &newAllocBase))
+ size_t newSize = Butterfly::totalSize(0, propertyCapacity, true, ArrayStorage::sizeFor(desiredCapacity));
+ if (!globalData.heap.tryAllocateStorage(newSize, &newAllocBase))
return false;
newStorageCapacity = desiredCapacity;
}
@@ -1132,45 +306,40 @@ bool JSArray::unshiftCountSlowCase(JSGlobalData& globalData, unsigned count)
// If it did, we calculate the amount that will remain based on an atomic decay - leave the
// vector with half the post-capacity it had previously.
unsigned postCapacity = 0;
- if (length < m_vectorLength) {
+ if (length < storage->vectorLength()) {
// Atomic decay, + the post-capacity cannot be greater than what is available.
- postCapacity = min((m_vectorLength - length) >> 1, newStorageCapacity - requiredVectorLength);
+ postCapacity = min((storage->vectorLength() - length) >> 1, newStorageCapacity - requiredVectorLength);
// If we're moving contents within the same allocation, the post-capacity is being reduced.
- ASSERT(newAllocBase != storage->m_allocBase || postCapacity < m_vectorLength - length);
+ ASSERT(newAllocBase != butterfly->base(structure()) || postCapacity < storage->vectorLength() - length);
}
+
+ unsigned newVectorLength = requiredVectorLength + postCapacity;
+ unsigned newIndexBias = newStorageCapacity - newVectorLength;
- m_vectorLength = requiredVectorLength + postCapacity;
- m_indexBias = newStorageCapacity - m_vectorLength;
- m_storage = reinterpret_cast_ptr<ArrayStorage*>(reinterpret_cast<WriteBarrier<Unknown>*>(newAllocBase) + m_indexBias);
-
- // Step 4:
- // Copy array data / header into their new locations, clear post-capacity & free any old allocation.
-
- // If this is being moved within the existing buffer of memory, we are always shifting data
- // to the right (since count > m_indexBias). As such this memmove cannot trample the header.
- memmove(m_storage->m_vector + count, storage->m_vector, sizeof(WriteBarrier<Unknown>) * usedVectorLength);
- memmove(m_storage, storage, storageSize(0));
-
- // Are we copying into a new allocation?
- if (newAllocBase != m_storage->m_allocBase) {
- // Free the old allocation, update m_allocBase.
- m_storage->m_allocBase = newAllocBase;
- }
+ Butterfly* newButterfly = Butterfly::fromBase(newAllocBase, newIndexBias, propertyCapacity);
+
+ memmove(newButterfly->arrayStorage()->m_vector + count, storage->m_vector, sizeof(JSValue) * usedVectorLength);
+ memmove(newButterfly->propertyStorage() - propertySize, butterfly->propertyStorage() - propertySize, sizeof(JSValue) * propertySize + sizeof(IndexingHeader) + ArrayStorage::sizeFor(0));
+
+ newButterfly->arrayStorage()->setVectorLength(newVectorLength);
+ newButterfly->arrayStorage()->m_indexBias = newIndexBias;
+
+ m_butterfly = newButterfly;
return true;
}
bool JSArray::setLength(ExecState* exec, unsigned newLength, bool throwException)
{
- checkConsistency();
+ checkIndexingConsistency();
- ArrayStorage* storage = m_storage;
- unsigned length = storage->m_length;
+ ArrayStorage* storage = ensureArrayStorage(exec->globalData());
+ unsigned length = storage->length();
// If the length is read only then we enter sparse mode, so should enter the following 'if'.
- ASSERT(isLengthWritable() || m_sparseValueMap);
+ ASSERT(isLengthWritable() || storage->m_sparseMap);
- if (SparseArrayValueMap* map = m_sparseValueMap) {
+ if (SparseArrayValueMap* map = storage->m_sparseMap.get()) {
// Fail if the length is not writable.
if (map->lengthIsReadOnly())
return reject(exec, throwException, StrictModeReadonlyPropertyWriteError);
@@ -1197,7 +366,7 @@ bool JSArray::setLength(ExecState* exec, unsigned newLength, bool throwException
SparseArrayValueMap::iterator it = map->find(index);
ASSERT(it != map->notFound());
if (it->second.attributes & DontDelete) {
- storage->m_length = index + 1;
+ storage->setLength(index + 1);
return reject(exec, throwException, "Unable to delete property.");
}
map->remove(it);
@@ -1206,14 +375,14 @@ bool JSArray::setLength(ExecState* exec, unsigned newLength, bool throwException
for (unsigned i = 0; i < keys.size(); ++i)
map->remove(keys[i]);
if (map->isEmpty())
- deallocateSparseMap();
+ deallocateSparseIndexMap();
}
}
}
if (newLength < length) {
// Delete properties from the vector.
- unsigned usedVectorLength = min(length, m_vectorLength);
+ unsigned usedVectorLength = min(length, storage->vectorLength());
for (unsigned i = newLength; i < usedVectorLength; ++i) {
WriteBarrier<Unknown>& valueSlot = storage->m_vector[i];
bool hadValue = valueSlot;
@@ -1222,53 +391,65 @@ bool JSArray::setLength(ExecState* exec, unsigned newLength, bool throwException
}
}
- storage->m_length = newLength;
+ storage->setLength(newLength);
- checkConsistency();
+ checkIndexingConsistency();
return true;
}
JSValue JSArray::pop(ExecState* exec)
{
- checkConsistency();
- ArrayStorage* storage = m_storage;
+ checkIndexingConsistency();
- unsigned length = storage->m_length;
- if (!length) {
- if (!isLengthWritable())
- throwTypeError(exec, ASCIILiteral(StrictModeReadonlyPropertyWriteError));
+ switch (structure()->indexingType()) {
+ case ArrayClass:
return jsUndefined();
- }
+
+ case ArrayWithArrayStorage: {
+ ArrayStorage* storage = m_butterfly->arrayStorage();
+
+ unsigned length = storage->length();
+ if (!length) {
+ if (!isLengthWritable())
+ throwTypeError(exec, StrictModeReadonlyPropertyWriteError);
+ return jsUndefined();
+ }
- unsigned index = length - 1;
- if (index < m_vectorLength) {
- WriteBarrier<Unknown>& valueSlot = storage->m_vector[index];
- if (valueSlot) {
- --storage->m_numValuesInVector;
- JSValue element = valueSlot.get();
- valueSlot.clear();
+ unsigned index = length - 1;
+ if (index < storage->vectorLength()) {
+ WriteBarrier<Unknown>& valueSlot = storage->m_vector[index];
+ if (valueSlot) {
+ --storage->m_numValuesInVector;
+ JSValue element = valueSlot.get();
+ valueSlot.clear();
- ASSERT(isLengthWritable());
- storage->m_length = index;
- checkConsistency();
- return element;
+ ASSERT(isLengthWritable());
+ storage->setLength(index);
+ checkIndexingConsistency();
+ return element;
+ }
}
- }
- // Let element be the result of calling the [[Get]] internal method of O with argument indx.
- JSValue element = get(exec, index);
- if (exec->hadException())
- return jsUndefined();
- // Call the [[Delete]] internal method of O with arguments indx and true.
- if (!deletePropertyByIndex(this, exec, index)) {
- throwTypeError(exec, ASCIILiteral("Unable to delete property."));
- return jsUndefined();
+ // Let element be the result of calling the [[Get]] internal method of O with argument indx.
+ JSValue element = get(exec, index);
+ if (exec->hadException())
+ return jsUndefined();
+ // Call the [[Delete]] internal method of O with arguments indx and true.
+ if (!deletePropertyByIndex(this, exec, index)) {
+ throwTypeError(exec, "Unable to delete property.");
+ return jsUndefined();
+ }
+ // Call the [[Put]] internal method of O with arguments "length", indx, and true.
+ setLength(exec, index, true);
+ // Return element.
+ checkIndexingConsistency();
+ return element;
+ }
+
+ default:
+ ASSERT_NOT_REACHED();
+ return JSValue();
}
- // Call the [[Put]] internal method of O with arguments "length", indx, and true.
- setLength(exec, index, true);
- // Return element.
- checkConsistency();
- return element;
}
// Push & putIndex are almost identical, with two small differences.
@@ -1276,63 +457,77 @@ JSValue JSArray::pop(ExecState* exec)
// - pushing to an array of length 2^32-1 stores the property, but throws a range error.
void JSArray::push(ExecState* exec, JSValue value)
{
- checkConsistency();
- ArrayStorage* storage = m_storage;
-
- // Fast case - push within vector, always update m_length & m_numValuesInVector.
- unsigned length = storage->m_length;
- if (length < m_vectorLength) {
- storage->m_vector[length].set(exec->globalData(), this, value);
- storage->m_length = length + 1;
- ++storage->m_numValuesInVector;
- checkConsistency();
- return;
+ checkIndexingConsistency();
+
+ switch (structure()->indexingType()) {
+ case ArrayClass: {
+ putByIndexBeyondVectorLengthWithArrayStorage(exec, 0, value, true, createInitialArrayStorage(exec->globalData()));
+ break;
}
+
+ case ArrayWithArrayStorage: {
+ ArrayStorage* storage = m_butterfly->arrayStorage();
+
+ // Fast case - push within vector, always update m_length & m_numValuesInVector.
+ unsigned length = storage->length();
+ if (length < storage->vectorLength()) {
+ storage->m_vector[length].set(exec->globalData(), this, value);
+ storage->setLength(length + 1);
+ ++storage->m_numValuesInVector;
+ checkIndexingConsistency();
+ return;
+ }
- // Pushing to an array of length 2^32-1 stores the property, but throws a range error.
- if (UNLIKELY(storage->m_length == 0xFFFFFFFFu)) {
- methodTable()->putByIndex(this, exec, storage->m_length, value, true);
- // Per ES5.1 15.4.4.7 step 6 & 15.4.5.1 step 3.d.
- if (!exec->hadException())
- throwError(exec, createRangeError(exec, ASCIILiteral("Invalid array length")));
- return;
- }
+ // Pushing to an array of length 2^32-1 stores the property, but throws a range error.
+ if (UNLIKELY(storage->length() == 0xFFFFFFFFu)) {
+ methodTable()->putByIndex(this, exec, storage->length(), value, true);
+ // Per ES5.1 15.4.4.7 step 6 & 15.4.5.1 step 3.d.
+ if (!exec->hadException())
+ throwError(exec, createRangeError(exec, "Invalid array length"));
+ return;
+ }
- // Handled the same as putIndex.
- putByIndexBeyondVectorLength(exec, storage->m_length, value, true);
- checkConsistency();
+ // Handled the same as putIndex.
+ putByIndexBeyondVectorLengthWithArrayStorage(exec, storage->length(), value, true, storage);
+ checkIndexingConsistency();
+ break;
+ }
+
+ default:
+ ASSERT_NOT_REACHED();
+ }
}
-bool JSArray::shiftCount(ExecState*, unsigned count)
+bool JSArray::shiftCount(ExecState* exec, unsigned count)
{
ASSERT(count > 0);
- ArrayStorage* storage = m_storage;
+ ArrayStorage* storage = ensureArrayStorage(exec->globalData());
- unsigned oldLength = storage->m_length;
+ unsigned oldLength = storage->length();
// If the array contains holes or is otherwise in an abnormal state,
// use the generic algorithm in ArrayPrototype.
- if (oldLength != storage->m_numValuesInVector || inSparseMode())
+ if (oldLength != storage->m_numValuesInVector || inSparseIndexingMode())
return false;
if (!oldLength)
return true;
storage->m_numValuesInVector -= count;
- storage->m_length -= count;
+ storage->setLength(oldLength - count);
- if (m_vectorLength) {
- count = min(m_vectorLength, (unsigned)count);
+ unsigned vectorLength = storage->vectorLength();
+ if (vectorLength) {
+ count = min(vectorLength, (unsigned)count);
- m_vectorLength -= count;
+ vectorLength -= count;
+ storage->setVectorLength(vectorLength);
- if (m_vectorLength) {
- char* newBaseStorage = reinterpret_cast<char*>(storage) + count * sizeof(WriteBarrier<Unknown>);
- memmove(newBaseStorage, storage, storageSize(0));
- m_storage = reinterpret_cast_ptr<ArrayStorage*>(newBaseStorage);
-
- m_indexBias += count;
+ if (vectorLength) {
+ m_butterfly = m_butterfly->shift(structure(), count);
+ storage = m_butterfly->arrayStorage();
+ storage->m_indexBias += count;
}
}
return true;
@@ -1341,59 +536,30 @@ bool JSArray::shiftCount(ExecState*, unsigned count)
// Returns true if the unshift can be handled, false to fallback.
bool JSArray::unshiftCount(ExecState* exec, unsigned count)
{
- ArrayStorage* storage = m_storage;
- unsigned length = storage->m_length;
+ ArrayStorage* storage = ensureArrayStorage(exec->globalData());
+ unsigned length = storage->length();
// If the array contains holes or is otherwise in an abnormal state,
// use the generic algorithm in ArrayPrototype.
- if (length != storage->m_numValuesInVector || inSparseMode())
+ if (length != storage->m_numValuesInVector || storage->inSparseMode())
return false;
- if (m_indexBias >= count) {
- m_indexBias -= count;
- char* newBaseStorage = reinterpret_cast<char*>(storage) - count * sizeof(WriteBarrier<Unknown>);
- memmove(newBaseStorage, storage, storageSize(0));
- m_storage = reinterpret_cast_ptr<ArrayStorage*>(newBaseStorage);
- m_vectorLength += count;
+ if (storage->m_indexBias >= count) {
+ m_butterfly = storage->butterfly()->unshift(structure(), count);
+ storage = m_butterfly->arrayStorage();
+ storage->m_indexBias -= count;
+ storage->setVectorLength(storage->vectorLength() + count);
} else if (!unshiftCountSlowCase(exec->globalData(), count)) {
throwOutOfMemoryError(exec);
return true;
}
- WriteBarrier<Unknown>* vector = m_storage->m_vector;
+ WriteBarrier<Unknown>* vector = storage->m_vector;
for (unsigned i = 0; i < count; i++)
vector[i].clear();
return true;
}
-void JSArray::visitChildren(JSCell* cell, SlotVisitor& visitor)
-{
- JSArray* thisObject = jsCast<JSArray*>(cell);
- ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
- COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
- ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
-
- JSNonFinalObject::visitChildren(thisObject, visitor);
-
- if (thisObject->m_storage) {
- MARK_LOG_MESSAGE1("[%u]: ", thisObject->length());
-
- ArrayStorage* storage = thisObject->m_storage;
- void* baseStorage = storage->m_allocBase;
-
- visitor.copyAndAppend(reinterpret_cast<void**>(&baseStorage), storageSize(thisObject->m_vectorLength + thisObject->m_indexBias), storage->m_vector->slot(), thisObject->m_vectorLength);
-
- if (baseStorage != thisObject->m_storage->m_allocBase) {
- thisObject->m_storage = reinterpret_cast_ptr<ArrayStorage*>(static_cast<char*>(baseStorage) + sizeof(JSValue) * thisObject->m_indexBias);
- thisObject->m_storage->m_allocBase = baseStorage;
- ASSERT(thisObject->m_storage->m_allocBase);
- }
- }
-
- if (SparseArrayValueMap* map = thisObject->m_sparseValueMap)
- map->visitChildren(visitor);
-}
-
static int compareNumbersForQSort(const void* a, const void* b)
{
double da = static_cast<const JSValue*>(a)->asNumber();
@@ -1410,112 +576,137 @@ static int compareByStringPairForQSort(const void* a, const void* b)
void JSArray::sortNumeric(ExecState* exec, JSValue compareFunction, CallType callType, const CallData& callData)
{
- ASSERT(!inSparseMode());
-
- ArrayStorage* storage = m_storage;
-
- unsigned lengthNotIncludingUndefined = compactForSorting(exec->globalData());
- if (m_sparseValueMap) {
- throwOutOfMemoryError(exec);
- return;
- }
+ ASSERT(!inSparseIndexingMode());
- if (!lengthNotIncludingUndefined)
+ switch (structure()->indexingType()) {
+ case ArrayClass:
return;
- bool allValuesAreNumbers = true;
- size_t size = storage->m_numValuesInVector;
- for (size_t i = 0; i < size; ++i) {
- if (!storage->m_vector[i].isNumber()) {
- allValuesAreNumbers = false;
- break;
+ case ArrayWithArrayStorage: {
+ unsigned lengthNotIncludingUndefined = compactForSorting(exec->globalData());
+ ArrayStorage* storage = m_butterfly->arrayStorage();
+
+ if (storage->m_sparseMap.get()) {
+ throwOutOfMemoryError(exec);
+ return;
}
+
+ if (!lengthNotIncludingUndefined)
+ return;
+
+ bool allValuesAreNumbers = true;
+ size_t size = storage->m_numValuesInVector;
+ for (size_t i = 0; i < size; ++i) {
+ if (!storage->m_vector[i].isNumber()) {
+ allValuesAreNumbers = false;
+ break;
+ }
+ }
+
+ if (!allValuesAreNumbers)
+ return sort(exec, compareFunction, callType, callData);
+
+ // For numeric comparison, which is fast, qsort is faster than mergesort. We
+ // also don't require mergesort's stability, since there's no user visible
+ // side-effect from swapping the order of equal primitive values.
+ qsort(storage->m_vector, size, sizeof(WriteBarrier<Unknown>), compareNumbersForQSort);
+
+ checkIndexingConsistency(SortConsistencyCheck);
+ return;
+ }
+
+ default:
+ ASSERT_NOT_REACHED();
}
-
- if (!allValuesAreNumbers)
- return sort(exec, compareFunction, callType, callData);
-
- // For numeric comparison, which is fast, qsort is faster than mergesort. We
- // also don't require mergesort's stability, since there's no user visible
- // side-effect from swapping the order of equal primitive values.
- qsort(storage->m_vector, size, sizeof(WriteBarrier<Unknown>), compareNumbersForQSort);
-
- checkConsistency(SortConsistencyCheck);
}
void JSArray::sort(ExecState* exec)
{
- ASSERT(!inSparseMode());
-
- unsigned lengthNotIncludingUndefined = compactForSorting(exec->globalData());
- if (m_sparseValueMap) {
- throwOutOfMemoryError(exec);
- return;
- }
-
- if (!lengthNotIncludingUndefined)
- return;
-
- // Converting JavaScript values to strings can be expensive, so we do it once up front and sort based on that.
- // This is a considerable improvement over doing it twice per comparison, though it requires a large temporary
- // buffer. Besides, this protects us from crashing if some objects have custom toString methods that return
- // random or otherwise changing results, effectively making compare function inconsistent.
-
- Vector<ValueStringPair> values(lengthNotIncludingUndefined);
- if (!values.begin()) {
- throwOutOfMemoryError(exec);
- return;
- }
+ ASSERT(!inSparseIndexingMode());
- Heap::heap(this)->pushTempSortVector(&values);
-
- bool isSortingPrimitiveValues = true;
- for (size_t i = 0; i < lengthNotIncludingUndefined; i++) {
- JSValue value = m_storage->m_vector[i].get();
- ASSERT(!value.isUndefined());
- values[i].first = value;
- isSortingPrimitiveValues = isSortingPrimitiveValues && value.isPrimitive();
- }
-
- // FIXME: The following loop continues to call toString on subsequent values even after
- // a toString call raises an exception.
-
- for (size_t i = 0; i < lengthNotIncludingUndefined; i++)
- values[i].second = values[i].first.toWTFStringInline(exec);
-
- if (exec->hadException()) {
- Heap::heap(this)->popTempSortVector(&values);
+ switch (structure()->indexingType()) {
+ case ArrayClass:
return;
- }
-
- // FIXME: Since we sort by string value, a fast algorithm might be to use a radix sort. That would be O(N) rather
- // than O(N log N).
-
+
+ case ArrayWithArrayStorage: {
+ unsigned lengthNotIncludingUndefined = compactForSorting(exec->globalData());
+ ArrayStorage* storage = m_butterfly->arrayStorage();
+ if (storage->m_sparseMap.get()) {
+ throwOutOfMemoryError(exec);
+ return;
+ }
+
+ if (!lengthNotIncludingUndefined)
+ return;
+
+ // Converting JavaScript values to strings can be expensive, so we do it once up front and sort based on that.
+ // This is a considerable improvement over doing it twice per comparison, though it requires a large temporary
+ // buffer. Besides, this protects us from crashing if some objects have custom toString methods that return
+ // random or otherwise changing results, effectively making compare function inconsistent.
+
+ Vector<ValueStringPair> values(lengthNotIncludingUndefined);
+ if (!values.begin()) {
+ throwOutOfMemoryError(exec);
+ return;
+ }
+
+ Heap::heap(this)->pushTempSortVector(&values);
+
+ bool isSortingPrimitiveValues = true;
+ for (size_t i = 0; i < lengthNotIncludingUndefined; i++) {
+ JSValue value = storage->m_vector[i].get();
+ ASSERT(!value.isUndefined());
+ values[i].first = value;
+ isSortingPrimitiveValues = isSortingPrimitiveValues && value.isPrimitive();
+ }
+
+ // FIXME: The following loop continues to call toString on subsequent values even after
+ // a toString call raises an exception.
+
+ for (size_t i = 0; i < lengthNotIncludingUndefined; i++)
+ values[i].second = values[i].first.toWTFStringInline(exec);
+
+ if (exec->hadException()) {
+ Heap::heap(this)->popTempSortVector(&values);
+ return;
+ }
+
+ // FIXME: Since we sort by string value, a fast algorithm might be to use a radix sort. That would be O(N) rather
+ // than O(N log N).
+
#if HAVE(MERGESORT)
- if (isSortingPrimitiveValues)
- qsort(values.begin(), values.size(), sizeof(ValueStringPair), compareByStringPairForQSort);
- else
- mergesort(values.begin(), values.size(), sizeof(ValueStringPair), compareByStringPairForQSort);
+ if (isSortingPrimitiveValues)
+ qsort(values.begin(), values.size(), sizeof(ValueStringPair), compareByStringPairForQSort);
+ else
+ mergesort(values.begin(), values.size(), sizeof(ValueStringPair), compareByStringPairForQSort);
#else
- // FIXME: The qsort library function is likely to not be a stable sort.
- // ECMAScript-262 does not specify a stable sort, but in practice, browsers perform a stable sort.
- qsort(values.begin(), values.size(), sizeof(ValueStringPair), compareByStringPairForQSort);
+ // FIXME: The qsort library function is likely to not be a stable sort.
+ // ECMAScript-262 does not specify a stable sort, but in practice, browsers perform a stable sort.
+ qsort(values.begin(), values.size(), sizeof(ValueStringPair), compareByStringPairForQSort);
#endif
-
- // If the toString function changed the length of the array or vector storage,
- // increase the length to handle the orignal number of actual values.
- if (m_vectorLength < lengthNotIncludingUndefined)
- increaseVectorLength(exec->globalData(), lengthNotIncludingUndefined);
- if (m_storage->m_length < lengthNotIncludingUndefined)
- m_storage->m_length = lengthNotIncludingUndefined;
-
- JSGlobalData& globalData = exec->globalData();
- for (size_t i = 0; i < lengthNotIncludingUndefined; i++)
- m_storage->m_vector[i].set(globalData, this, values[i].first);
-
- Heap::heap(this)->popTempSortVector(&values);
-
- checkConsistency(SortConsistencyCheck);
+
+ // If the toString function changed the length of the array or vector storage,
+ // increase the length to handle the orignal number of actual values.
+ if (storage->vectorLength() < lengthNotIncludingUndefined) {
+ increaseVectorLength(exec->globalData(), lengthNotIncludingUndefined);
+ storage = m_butterfly->arrayStorage();
+ }
+ if (storage->length() < lengthNotIncludingUndefined)
+ storage->setLength(lengthNotIncludingUndefined);
+
+ JSGlobalData& globalData = exec->globalData();
+ for (size_t i = 0; i < lengthNotIncludingUndefined; i++)
+ storage->m_vector[i].set(globalData, this, values[i].first);
+
+ Heap::heap(this)->popTempSortVector(&values);
+
+ checkIndexingConsistency(SortConsistencyCheck);
+ return;
+ }
+
+ default:
+ ASSERT_NOT_REACHED();
+ }
}
struct AVLTreeNodeForArrayCompare {
@@ -1597,253 +788,257 @@ struct AVLTreeAbstractorForArrayCompare {
void JSArray::sort(ExecState* exec, JSValue compareFunction, CallType callType, const CallData& callData)
{
- ASSERT(!inSparseMode());
-
- checkConsistency();
-
- // FIXME: This ignores exceptions raised in the compare function or in toNumber.
-
- // The maximum tree depth is compiled in - but the caller is clearly up to no good
- // if a larger array is passed.
- ASSERT(m_storage->m_length <= static_cast<unsigned>(std::numeric_limits<int>::max()));
- if (m_storage->m_length > static_cast<unsigned>(std::numeric_limits<int>::max()))
- return;
-
- unsigned usedVectorLength = min(m_storage->m_length, m_vectorLength);
- unsigned nodeCount = usedVectorLength + (m_sparseValueMap ? m_sparseValueMap->size() : 0);
-
- if (!nodeCount)
- return;
-
- AVLTree<AVLTreeAbstractorForArrayCompare, 44> tree; // Depth 44 is enough for 2^31 items
- tree.abstractor().m_exec = exec;
- tree.abstractor().m_compareFunction = compareFunction;
- tree.abstractor().m_compareCallType = callType;
- tree.abstractor().m_compareCallData = &callData;
- tree.abstractor().m_nodes.grow(nodeCount);
-
- if (callType == CallTypeJS)
- tree.abstractor().m_cachedCall = adoptPtr(new CachedCall(exec, jsCast<JSFunction*>(compareFunction), 2));
-
- if (!tree.abstractor().m_nodes.begin()) {
- throwOutOfMemoryError(exec);
+ ASSERT(!inSparseIndexingMode());
+
+ switch (structure()->indexingType()) {
+ case ArrayClass:
return;
- }
-
- // FIXME: If the compare function modifies the array, the vector, map, etc. could be modified
- // right out from under us while we're building the tree here.
-
- unsigned numDefined = 0;
- unsigned numUndefined = 0;
-
- // Iterate over the array, ignoring missing values, counting undefined ones, and inserting all other ones into the tree.
- for (; numDefined < usedVectorLength; ++numDefined) {
- JSValue v = m_storage->m_vector[numDefined].get();
- if (!v || v.isUndefined())
- break;
- tree.abstractor().m_nodes[numDefined].value = v;
- tree.insert(numDefined);
- }
- for (unsigned i = numDefined; i < usedVectorLength; ++i) {
- JSValue v = m_storage->m_vector[i].get();
- if (v) {
- if (v.isUndefined())
- ++numUndefined;
- else {
- tree.abstractor().m_nodes[numDefined].value = v;
- tree.insert(numDefined);
- ++numDefined;
+
+ case ArrayWithArrayStorage: {
+ ArrayStorage* storage = m_butterfly->arrayStorage();
+ checkIndexingConsistency();
+
+ // FIXME: This ignores exceptions raised in the compare function or in toNumber.
+
+ // The maximum tree depth is compiled in - but the caller is clearly up to no good
+ // if a larger array is passed.
+ ASSERT(storage->length() <= static_cast<unsigned>(std::numeric_limits<int>::max()));
+ if (storage->length() > static_cast<unsigned>(std::numeric_limits<int>::max()))
+ return;
+
+ unsigned usedVectorLength = min(storage->length(), storage->vectorLength());
+ unsigned nodeCount = usedVectorLength + (storage->m_sparseMap ? storage->m_sparseMap->size() : 0);
+
+ if (!nodeCount)
+ return;
+
+ AVLTree<AVLTreeAbstractorForArrayCompare, 44> tree; // Depth 44 is enough for 2^31 items
+ tree.abstractor().m_exec = exec;
+ tree.abstractor().m_compareFunction = compareFunction;
+ tree.abstractor().m_compareCallType = callType;
+ tree.abstractor().m_compareCallData = &callData;
+ tree.abstractor().m_nodes.grow(nodeCount);
+
+ if (callType == CallTypeJS)
+ tree.abstractor().m_cachedCall = adoptPtr(new CachedCall(exec, jsCast<JSFunction*>(compareFunction), 2));
+
+ if (!tree.abstractor().m_nodes.begin()) {
+ throwOutOfMemoryError(exec);
+ return;
+ }
+
+ // FIXME: If the compare function modifies the array, the vector, map, etc. could be modified
+ // right out from under us while we're building the tree here.
+
+ unsigned numDefined = 0;
+ unsigned numUndefined = 0;
+
+ // Iterate over the array, ignoring missing values, counting undefined ones, and inserting all other ones into the tree.
+ for (; numDefined < usedVectorLength; ++numDefined) {
+ JSValue v = storage->m_vector[numDefined].get();
+ if (!v || v.isUndefined())
+ break;
+ tree.abstractor().m_nodes[numDefined].value = v;
+ tree.insert(numDefined);
+ }
+ for (unsigned i = numDefined; i < usedVectorLength; ++i) {
+ JSValue v = storage->m_vector[i].get();
+ if (v) {
+ if (v.isUndefined())
+ ++numUndefined;
+ else {
+ tree.abstractor().m_nodes[numDefined].value = v;
+ tree.insert(numDefined);
+ ++numDefined;
+ }
}
}
- }
-
- unsigned newUsedVectorLength = numDefined + numUndefined;
-
- if (SparseArrayValueMap* map = m_sparseValueMap) {
- newUsedVectorLength += map->size();
- if (newUsedVectorLength > m_vectorLength) {
- // Check that it is possible to allocate an array large enough to hold all the entries.
- if ((newUsedVectorLength > MAX_STORAGE_VECTOR_LENGTH) || !increaseVectorLength(exec->globalData(), newUsedVectorLength)) {
- throwOutOfMemoryError(exec);
- return;
+
+ unsigned newUsedVectorLength = numDefined + numUndefined;
+
+ if (SparseArrayValueMap* map = storage->m_sparseMap.get()) {
+ newUsedVectorLength += map->size();
+ if (newUsedVectorLength > storage->vectorLength()) {
+ // Check that it is possible to allocate an array large enough to hold all the entries.
+ if ((newUsedVectorLength > MAX_STORAGE_VECTOR_LENGTH) || !increaseVectorLength(exec->globalData(), newUsedVectorLength)) {
+ throwOutOfMemoryError(exec);
+ return;
+ }
+ storage = m_butterfly->arrayStorage();
}
+
+ SparseArrayValueMap::const_iterator end = map->end();
+ for (SparseArrayValueMap::const_iterator it = map->begin(); it != end; ++it) {
+ tree.abstractor().m_nodes[numDefined].value = it->second.getNonSparseMode();
+ tree.insert(numDefined);
+ ++numDefined;
+ }
+
+ deallocateSparseIndexMap();
}
-
- SparseArrayValueMap::const_iterator end = map->end();
- for (SparseArrayValueMap::const_iterator it = map->begin(); it != end; ++it) {
- tree.abstractor().m_nodes[numDefined].value = it->second.getNonSparseMode();
- tree.insert(numDefined);
- ++numDefined;
+
+ ASSERT(tree.abstractor().m_nodes.size() >= numDefined);
+
+ // FIXME: If the compare function changed the length of the array, the following might be
+ // modifying the vector incorrectly.
+
+ // Copy the values back into m_storage.
+ AVLTree<AVLTreeAbstractorForArrayCompare, 44>::Iterator iter;
+ iter.start_iter_least(tree);
+ JSGlobalData& globalData = exec->globalData();
+ for (unsigned i = 0; i < numDefined; ++i) {
+ storage->m_vector[i].set(globalData, this, tree.abstractor().m_nodes[*iter].value);
+ ++iter;
}
-
- deallocateSparseMap();
+
+ // Put undefined values back in.
+ for (unsigned i = numDefined; i < newUsedVectorLength; ++i)
+ storage->m_vector[i].setUndefined();
+
+ // Ensure that unused values in the vector are zeroed out.
+ for (unsigned i = newUsedVectorLength; i < usedVectorLength; ++i)
+ storage->m_vector[i].clear();
+
+ storage->m_numValuesInVector = newUsedVectorLength;
+
+ checkIndexingConsistency(SortConsistencyCheck);
+ return;
}
-
- ASSERT(tree.abstractor().m_nodes.size() >= numDefined);
-
- // FIXME: If the compare function changed the length of the array, the following might be
- // modifying the vector incorrectly.
-
- // Copy the values back into m_storage.
- AVLTree<AVLTreeAbstractorForArrayCompare, 44>::Iterator iter;
- iter.start_iter_least(tree);
- JSGlobalData& globalData = exec->globalData();
- for (unsigned i = 0; i < numDefined; ++i) {
- m_storage->m_vector[i].set(globalData, this, tree.abstractor().m_nodes[*iter].value);
- ++iter;
+
+ default:
+ ASSERT_NOT_REACHED();
}
-
- // Put undefined values back in.
- for (unsigned i = numDefined; i < newUsedVectorLength; ++i)
- m_storage->m_vector[i].setUndefined();
-
- // Ensure that unused values in the vector are zeroed out.
- for (unsigned i = newUsedVectorLength; i < usedVectorLength; ++i)
- m_storage->m_vector[i].clear();
-
- m_storage->m_numValuesInVector = newUsedVectorLength;
-
- checkConsistency(SortConsistencyCheck);
}
void JSArray::fillArgList(ExecState* exec, MarkedArgumentBuffer& args)
{
- ArrayStorage* storage = m_storage;
-
- WriteBarrier<Unknown>* vector = storage->m_vector;
- unsigned vectorEnd = min(storage->m_length, m_vectorLength);
- unsigned i = 0;
- for (; i < vectorEnd; ++i) {
- WriteBarrier<Unknown>& v = vector[i];
- if (!v)
- break;
- args.append(v.get());
+ switch (structure()->indexingType()) {
+ case ArrayClass:
+ return;
+
+ case ArrayWithArrayStorage: {
+ ArrayStorage* storage = m_butterfly->arrayStorage();
+
+ WriteBarrier<Unknown>* vector = storage->m_vector;
+ unsigned vectorEnd = min(storage->length(), storage->vectorLength());
+ unsigned i = 0;
+ for (; i < vectorEnd; ++i) {
+ WriteBarrier<Unknown>& v = vector[i];
+ if (!v)
+ break;
+ args.append(v.get());
+ }
+
+ for (; i < storage->length(); ++i)
+ args.append(get(exec, i));
+ return;
+ }
+
+ default:
+ ASSERT_NOT_REACHED();
}
-
- for (; i < storage->m_length; ++i)
- args.append(get(exec, i));
}
void JSArray::copyToArguments(ExecState* exec, CallFrame* callFrame, uint32_t length)
{
ASSERT(length == this->length());
- UNUSED_PARAM(length);
- unsigned i = 0;
- WriteBarrier<Unknown>* vector = m_storage->m_vector;
- unsigned vectorEnd = min(length, m_vectorLength);
- for (; i < vectorEnd; ++i) {
- WriteBarrier<Unknown>& v = vector[i];
- if (!v)
- break;
- callFrame->setArgument(i, v.get());
+ switch (structure()->indexingType()) {
+ case ArrayClass:
+ return;
+
+ case ArrayWithArrayStorage: {
+ ArrayStorage* storage = m_butterfly->arrayStorage();
+ unsigned i = 0;
+ WriteBarrier<Unknown>* vector = storage->m_vector;
+ unsigned vectorEnd = min(length, storage->vectorLength());
+ for (; i < vectorEnd; ++i) {
+ WriteBarrier<Unknown>& v = vector[i];
+ if (!v)
+ break;
+ callFrame->setArgument(i, v.get());
+ }
+
+ for (; i < length; ++i)
+ callFrame->setArgument(i, get(exec, i));
+ return;
+ }
+
+ default:
+ ASSERT_NOT_REACHED();
}
-
- for (; i < length; ++i)
- callFrame->setArgument(i, get(exec, i));
}
unsigned JSArray::compactForSorting(JSGlobalData& globalData)
{
- ASSERT(!inSparseMode());
-
- checkConsistency();
-
- ArrayStorage* storage = m_storage;
+ ASSERT(!inSparseIndexingMode());
- unsigned usedVectorLength = min(storage->m_length, m_vectorLength);
-
- unsigned numDefined = 0;
- unsigned numUndefined = 0;
-
- for (; numDefined < usedVectorLength; ++numDefined) {
- JSValue v = storage->m_vector[numDefined].get();
- if (!v || v.isUndefined())
- break;
- }
+ checkIndexingConsistency();
+
+ switch (structure()->indexingType()) {
+ case ArrayClass:
+ return 0;
- for (unsigned i = numDefined; i < usedVectorLength; ++i) {
- JSValue v = storage->m_vector[i].get();
- if (v) {
- if (v.isUndefined())
- ++numUndefined;
- else
- storage->m_vector[numDefined++].setWithoutWriteBarrier(v);
+ case ArrayWithArrayStorage: {
+ ArrayStorage* storage = m_butterfly->arrayStorage();
+
+ unsigned usedVectorLength = min(storage->length(), storage->vectorLength());
+
+ unsigned numDefined = 0;
+ unsigned numUndefined = 0;
+
+ for (; numDefined < usedVectorLength; ++numDefined) {
+ JSValue v = storage->m_vector[numDefined].get();
+ if (!v || v.isUndefined())
+ break;
}
- }
-
- unsigned newUsedVectorLength = numDefined + numUndefined;
-
- if (SparseArrayValueMap* map = m_sparseValueMap) {
- newUsedVectorLength += map->size();
- if (newUsedVectorLength > m_vectorLength) {
- // Check that it is possible to allocate an array large enough to hold all the entries - if not,
- // exception is thrown by caller.
- if ((newUsedVectorLength > MAX_STORAGE_VECTOR_LENGTH) || !increaseVectorLength(globalData, newUsedVectorLength))
- return 0;
-
- storage = m_storage;
+
+ for (unsigned i = numDefined; i < usedVectorLength; ++i) {
+ JSValue v = storage->m_vector[i].get();
+ if (v) {
+ if (v.isUndefined())
+ ++numUndefined;
+ else
+ storage->m_vector[numDefined++].setWithoutWriteBarrier(v);
+ }
}
-
- SparseArrayValueMap::const_iterator end = map->end();
- for (SparseArrayValueMap::const_iterator it = map->begin(); it != end; ++it)
- storage->m_vector[numDefined++].setWithoutWriteBarrier(it->second.getNonSparseMode());
-
- deallocateSparseMap();
- }
-
- for (unsigned i = numDefined; i < newUsedVectorLength; ++i)
- storage->m_vector[i].setUndefined();
- for (unsigned i = newUsedVectorLength; i < usedVectorLength; ++i)
- storage->m_vector[i].clear();
-
- storage->m_numValuesInVector = newUsedVectorLength;
-
- checkConsistency(SortConsistencyCheck);
-
- return numDefined;
-}
-
-#if CHECK_ARRAY_CONSISTENCY
-
-void JSArray::checkConsistency(ConsistencyCheckType type)
-{
- ArrayStorage* storage = m_storage;
-
- ASSERT(!storage->m_inCompactInitialization);
-
- ASSERT(storage);
- if (type == SortConsistencyCheck)
- ASSERT(!m_sparseValueMap);
-
- unsigned numValuesInVector = 0;
- for (unsigned i = 0; i < m_vectorLength; ++i) {
- if (JSValue value = storage->m_vector[i].get()) {
- ASSERT(i < storage->m_length);
- if (type != DestructorConsistencyCheck)
- value.isUndefined(); // Likely to crash if the object was deallocated.
- ++numValuesInVector;
- } else {
- if (type == SortConsistencyCheck)
- ASSERT(i >= storage->m_numValuesInVector);
+
+ unsigned newUsedVectorLength = numDefined + numUndefined;
+
+ if (SparseArrayValueMap* map = storage->m_sparseMap.get()) {
+ newUsedVectorLength += map->size();
+ if (newUsedVectorLength > storage->vectorLength()) {
+ // Check that it is possible to allocate an array large enough to hold all the entries - if not,
+ // exception is thrown by caller.
+ if ((newUsedVectorLength > MAX_STORAGE_VECTOR_LENGTH) || !increaseVectorLength(globalData, newUsedVectorLength))
+ return 0;
+
+ storage = m_butterfly->arrayStorage();
+ }
+
+ SparseArrayValueMap::const_iterator end = map->end();
+ for (SparseArrayValueMap::const_iterator it = map->begin(); it != end; ++it)
+ storage->m_vector[numDefined++].setWithoutWriteBarrier(it->second.getNonSparseMode());
+
+ deallocateSparseIndexMap();
}
+
+ for (unsigned i = numDefined; i < newUsedVectorLength; ++i)
+ storage->m_vector[i].setUndefined();
+ for (unsigned i = newUsedVectorLength; i < usedVectorLength; ++i)
+ storage->m_vector[i].clear();
+
+ storage->m_numValuesInVector = newUsedVectorLength;
+
+ checkIndexingConsistency(SortConsistencyCheck);
+
+ return numDefined;
}
- ASSERT(numValuesInVector == storage->m_numValuesInVector);
- ASSERT(numValuesInVector <= storage->m_length);
-
- if (m_sparseValueMap) {
- SparseArrayValueMap::const_iterator end = m_sparseValueMap->end();
- for (SparseArrayValueMap::const_iterator it = m_sparseValueMap->begin(); it != end; ++it) {
- unsigned index = it->first;
- ASSERT(index < storage->m_length);
- ASSERT(index >= m_vectorLength);
- ASSERT(index <= MAX_ARRAY_INDEX);
- ASSERT(it->second);
- if (type != DestructorConsistencyCheck)
- it->second.getNonSparseMode().isUndefined(); // Likely to crash if the object was deallocated.
- }
+
+ default:
+ ASSERT_NOT_REACHED();
+ return 0;
}
}
-#endif
} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/JSArray.h b/Source/JavaScriptCore/runtime/JSArray.h
index 2aab8c683..d382f64a9 100644
--- a/Source/JavaScriptCore/runtime/JSArray.h
+++ b/Source/JavaScriptCore/runtime/JSArray.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
- * Copyright (C) 2003, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2007, 2008, 2009, 2012 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -21,142 +21,30 @@
#ifndef JSArray_h
#define JSArray_h
+#include "ArrayConventions.h"
+#include "ButterflyInlineMethods.h"
#include "JSObject.h"
-#define CHECK_ARRAY_CONSISTENCY 0
-
namespace JSC {
class JSArray;
class LLIntOffsetsExtractor;
- enum PutDirectIndexMode { PutDirectIndexLikePutDirect, PutDirectIndexShouldNotThrow, PutDirectIndexShouldThrow };
-
- struct SparseArrayEntry : public WriteBarrier<Unknown> {
- typedef WriteBarrier<Unknown> Base;
-
- SparseArrayEntry() : attributes(0) {}
-
- JSValue get(ExecState*, JSArray*) const;
- void get(PropertySlot&) const;
- void get(PropertyDescriptor&) const;
- JSValue getNonSparseMode() const;
-
- unsigned attributes;
- };
-
- class SparseArrayValueMap {
- typedef HashMap<uint64_t, SparseArrayEntry, WTF::IntHash<uint64_t>, WTF::UnsignedWithZeroKeyHashTraits<uint64_t> > Map;
-
- enum Flags {
- Normal = 0,
- SparseMode = 1,
- LengthIsReadOnly = 2,
- };
-
- public:
- typedef Map::iterator iterator;
- typedef Map::const_iterator const_iterator;
- typedef Map::AddResult AddResult;
-
- SparseArrayValueMap()
- : m_flags(Normal)
- , m_reportedCapacity(0)
- {
- }
-
- void visitChildren(SlotVisitor&);
-
- bool sparseMode()
- {
- return m_flags & SparseMode;
- }
-
- void setSparseMode()
- {
- m_flags = static_cast<Flags>(m_flags | SparseMode);
- }
-
- bool lengthIsReadOnly()
- {
- return m_flags & LengthIsReadOnly;
- }
-
- void setLengthIsReadOnly()
- {
- m_flags = static_cast<Flags>(m_flags | LengthIsReadOnly);
- }
-
- // These methods may mutate the contents of the map
- void put(ExecState*, JSArray*, unsigned, JSValue, bool shouldThrow);
- bool putDirect(ExecState*, JSArray*, unsigned, JSValue, PutDirectIndexMode);
- AddResult add(JSArray*, unsigned);
- iterator find(unsigned i) { return m_map.find(i); }
- // This should ASSERT the remove is valid (check the result of the find).
- void remove(iterator it) { m_map.remove(it); }
- void remove(unsigned i) { m_map.remove(i); }
-
- // These methods do not mutate the contents of the map.
- iterator notFound() { return m_map.end(); }
- bool isEmpty() const { return m_map.isEmpty(); }
- bool contains(unsigned i) const { return m_map.contains(i); }
- size_t size() const { return m_map.size(); }
- // Only allow const begin/end iteration.
- const_iterator begin() const { return m_map.begin(); }
- const_iterator end() const { return m_map.end(); }
-
- private:
- Map m_map;
- Flags m_flags;
- size_t m_reportedCapacity;
- };
-
- // This struct holds the actual data values of an array. A JSArray object points to it's contained ArrayStorage
- // struct by pointing to m_vector. To access the contained ArrayStorage struct, use the getStorage() and
- // setStorage() methods. It is important to note that there may be space before the ArrayStorage that
- // is used to quick unshift / shift operation. The actual allocated pointer is available by using:
- // getStorage() - m_indexBias * sizeof(JSValue)
- struct ArrayStorage {
- unsigned m_length; // The "length" property on the array
- unsigned m_numValuesInVector;
- void* m_allocBase; // Pointer to base address returned by malloc(). Keeping this pointer does eliminate false positives from the leak detector.
-#if CHECK_ARRAY_CONSISTENCY
- // Needs to be a uintptr_t for alignment purposes.
- uintptr_t m_initializationIndex;
- uintptr_t m_inCompactInitialization;
-#else
- uintptr_t m_padding;
-#endif
- WriteBarrier<Unknown> m_vector[1];
-
- static ptrdiff_t lengthOffset() { return OBJECT_OFFSETOF(ArrayStorage, m_length); }
- static ptrdiff_t numValuesInVectorOffset() { return OBJECT_OFFSETOF(ArrayStorage, m_numValuesInVector); }
- static ptrdiff_t allocBaseOffset() { return OBJECT_OFFSETOF(ArrayStorage, m_allocBase); }
- static ptrdiff_t vectorOffset() { return OBJECT_OFFSETOF(ArrayStorage, m_vector); }
- };
-
class JSArray : public JSNonFinalObject {
friend class LLIntOffsetsExtractor;
friend class Walker;
friend class JIT;
+ public:
+ typedef JSNonFinalObject Base;
+
protected:
- explicit JSArray(JSGlobalData& globalData, Structure* structure)
- : JSNonFinalObject(globalData, structure)
- , m_indexBias(0)
- , m_storage(0)
- , m_sparseValueMap(0)
+ explicit JSArray(JSGlobalData& globalData, Structure* structure, Butterfly* butterfly)
+ : JSNonFinalObject(globalData, structure, butterfly)
{
}
- JS_EXPORT_PRIVATE void finishCreation(JSGlobalData&, unsigned initialLength = 0);
- JS_EXPORT_PRIVATE JSArray* tryFinishCreationUninitialized(JSGlobalData&, unsigned initialLength);
-
public:
- typedef JSNonFinalObject Base;
-
- static void finalize(JSCell*);
-
static JSArray* create(JSGlobalData&, Structure*, unsigned initialLength = 0);
// tryCreateUninitialized is used for fast construction of arrays whose size and
@@ -169,26 +57,11 @@ namespace JSC {
JS_EXPORT_PRIVATE static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool throwException);
static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
- JS_EXPORT_PRIVATE static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
- static void putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue, bool shouldThrow);
- // This is similar to the JSObject::putDirect* methods:
- // - the prototype chain is not consulted
- // - accessors are not called.
- // - it will ignore extensibility and read-only properties if PutDirectIndexLikePutDirect is passed as the mode (the default).
- // This method creates a property with attributes writable, enumerable and configurable all set to true.
- bool putDirectIndex(ExecState* exec, unsigned propertyName, JSValue value, PutDirectIndexMode mode = PutDirectIndexLikePutDirect)
- {
- if (canSetIndex(propertyName)) {
- setIndex(exec->globalData(), propertyName, value);
- return true;
- }
- return putDirectIndexBeyondVectorLength(exec, propertyName, value, mode);
- }
static JS_EXPORTDATA const ClassInfo s_info;
- unsigned length() const { return m_storage->m_length; }
+ unsigned length() const { return getArrayLength(); }
// OK to use on new arrays, but not if it might be a RegExpMatchArray.
bool setLength(ExecState*, unsigned, bool throwException = false);
@@ -202,142 +75,86 @@ namespace JSC {
bool shiftCount(ExecState*, unsigned count);
bool unshiftCount(ExecState*, unsigned count);
- bool canGetIndex(unsigned i) { return i < m_vectorLength && m_storage->m_vector[i]; }
- JSValue getIndex(unsigned i)
- {
- ASSERT(canGetIndex(i));
- return m_storage->m_vector[i].get();
- }
-
- bool canSetIndex(unsigned i) { return i < m_vectorLength; }
- void setIndex(JSGlobalData& globalData, unsigned i, JSValue v)
- {
- ASSERT(canSetIndex(i));
-
- WriteBarrier<Unknown>& x = m_storage->m_vector[i];
- if (!x) {
- ArrayStorage *storage = m_storage;
- ++storage->m_numValuesInVector;
- if (i >= storage->m_length)
- storage->m_length = i + 1;
- }
- x.set(globalData, this, v);
- }
-
- inline void initializeIndex(JSGlobalData& globalData, unsigned i, JSValue v)
- {
- ASSERT(canSetIndex(i));
- ArrayStorage *storage = m_storage;
-#if CHECK_ARRAY_CONSISTENCY
- ASSERT(storage->m_inCompactInitialization);
- // Check that we are initializing the next index in sequence.
- ASSERT(i == storage->m_initializationIndex);
- // tryCreateUninitialized set m_numValuesInVector to the initialLength,
- // check we do not try to initialize more than this number of properties.
- ASSERT(storage->m_initializationIndex < storage->m_numValuesInVector);
- storage->m_initializationIndex++;
-#endif
- ASSERT(i < storage->m_length);
- ASSERT(i < storage->m_numValuesInVector);
- storage->m_vector[i].set(globalData, this, v);
- }
-
- inline void completeInitialization(unsigned newLength)
- {
- // Check that we have initialized as meny properties as we think we have.
- ASSERT_UNUSED(newLength, newLength == m_storage->m_length);
-#if CHECK_ARRAY_CONSISTENCY
- // Check that the number of propreties initialized matches the initialLength.
- ASSERT(m_storage->m_initializationIndex == m_storage->m_numValuesInVector);
- ASSERT(m_storage->m_inCompactInitialization);
- m_storage->m_inCompactInitialization = false;
-#endif
- }
-
- bool inSparseMode()
- {
- SparseArrayValueMap* map = m_sparseValueMap;
- return map && map->sparseMode();
- }
-
void fillArgList(ExecState*, MarkedArgumentBuffer&);
void copyToArguments(ExecState*, CallFrame*, uint32_t length);
static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
{
- return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info);
+ return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info, ArrayWithArrayStorage);
}
- static ptrdiff_t storageOffset()
- {
- return OBJECT_OFFSETOF(JSArray, m_storage);
- }
-
- static ptrdiff_t vectorLengthOffset()
- {
- return OBJECT_OFFSETOF(JSArray, m_vectorLength);
- }
-
- JS_EXPORT_PRIVATE static void visitChildren(JSCell*, SlotVisitor&);
-
- void enterDictionaryMode(JSGlobalData&);
-
protected:
- static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | OverridesGetPropertyNames | JSObject::StructureFlags;
+ static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSObject::StructureFlags;
static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
static bool deleteProperty(JSCell*, ExecState*, PropertyName);
- static bool deletePropertyByIndex(JSCell*, ExecState*, unsigned propertyName);
- static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
+ JS_EXPORT_PRIVATE static void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
private:
- static size_t storageSize(unsigned vectorLength);
bool isLengthWritable()
{
- SparseArrayValueMap* map = m_sparseValueMap;
+ ArrayStorage* storage = arrayStorageOrNull();
+ if (!storage)
+ return false;
+ SparseArrayValueMap* map = storage->m_sparseMap.get();
return !map || !map->lengthIsReadOnly();
}
void setLengthWritable(ExecState*, bool writable);
- void putDescriptor(ExecState*, SparseArrayEntry*, PropertyDescriptor&, PropertyDescriptor& old);
- bool defineOwnNumericProperty(ExecState*, unsigned, PropertyDescriptor&, bool throwException);
- void allocateSparseMap(JSGlobalData&);
- void deallocateSparseMap();
- void putByIndexBeyondVectorLength(ExecState*, unsigned propertyName, JSValue, bool shouldThrow);
- JS_EXPORT_PRIVATE bool putDirectIndexBeyondVectorLength(ExecState*, unsigned propertyName, JSValue, PutDirectIndexMode);
-
- unsigned getNewVectorLength(unsigned desiredLength);
- bool increaseVectorLength(JSGlobalData&, unsigned newLength);
bool unshiftCountSlowCase(JSGlobalData&, unsigned count);
unsigned compactForSorting(JSGlobalData&);
+ };
- enum ConsistencyCheckType { NormalConsistencyCheck, DestructorConsistencyCheck, SortConsistencyCheck };
- void checkConsistency(ConsistencyCheckType = NormalConsistencyCheck);
-
- unsigned m_vectorLength; // The valid length of m_vector
- unsigned m_indexBias; // The number of JSValue sized blocks before ArrayStorage.
- ArrayStorage *m_storage;
-
- // FIXME: Maybe SparseArrayValueMap should be put into its own JSCell?
- SparseArrayValueMap* m_sparseValueMap;
+ inline Butterfly* createArrayButterfly(JSGlobalData& globalData, unsigned initialLength)
+ {
+ Butterfly* butterfly = Butterfly::create(
+ globalData, 0, 0, true, baseIndexingHeaderForArray(initialLength), ArrayStorage::sizeFor(BASE_VECTOR_LEN));
+ ArrayStorage* storage = butterfly->arrayStorage();
+ storage->m_indexBias = 0;
+ storage->m_sparseMap.clear();
+ storage->m_numValuesInVector = 0;
+#if CHECK_ARRAY_CONSISTENCY
+ storage->m_initializationIndex = 0;
+ storage->m_inCompactInitialization = 0;
+#endif
+ return butterfly;
+ }
- static ptrdiff_t sparseValueMapOffset() { return OBJECT_OFFSETOF(JSArray, m_sparseValueMap); }
- static ptrdiff_t indexBiasOffset() { return OBJECT_OFFSETOF(JSArray, m_indexBias); }
- };
+ Butterfly* createArrayButterflyInDictionaryIndexingMode(JSGlobalData&, unsigned initialLength);
inline JSArray* JSArray::create(JSGlobalData& globalData, Structure* structure, unsigned initialLength)
{
- JSArray* array = new (NotNull, allocateCell<JSArray>(globalData.heap)) JSArray(globalData, structure);
- array->finishCreation(globalData, initialLength);
+ Butterfly* butterfly = createArrayButterfly(globalData, initialLength);
+ JSArray* array = new (NotNull, allocateCell<JSArray>(globalData.heap)) JSArray(globalData, structure, butterfly);
+ array->finishCreation(globalData);
return array;
}
inline JSArray* JSArray::tryCreateUninitialized(JSGlobalData& globalData, Structure* structure, unsigned initialLength)
{
- JSArray* array = new (NotNull, allocateCell<JSArray>(globalData.heap)) JSArray(globalData, structure);
- return array->tryFinishCreationUninitialized(globalData, initialLength);
+ unsigned vectorLength = std::max(BASE_VECTOR_LEN, initialLength);
+ if (vectorLength > MAX_STORAGE_VECTOR_LENGTH)
+ return 0;
+
+ void* temp;
+ if (!globalData.heap.tryAllocateStorage(Butterfly::totalSize(0, 0, true, ArrayStorage::sizeFor(vectorLength)), &temp))
+ return 0;
+ Butterfly* butterfly = Butterfly::fromBase(temp, 0, 0);
+ *butterfly->indexingHeader() = indexingHeaderForArray(initialLength, vectorLength);
+ ArrayStorage* storage = butterfly->arrayStorage();
+ storage->m_indexBias = 0;
+ storage->m_sparseMap.clear();
+ storage->m_numValuesInVector = initialLength;
+#if CHECK_ARRAY_CONSISTENCY
+ storage->m_initializationIndex = 0;
+ storage->m_inCompactInitialization = true;
+#endif
+
+ JSArray* array = new (NotNull, allocateCell<JSArray>(globalData.heap)) JSArray(globalData, structure, butterfly);
+ array->finishCreation(globalData);
+ return array;
}
JSArray* asArray(JSValue);
@@ -356,30 +173,6 @@ namespace JSC {
inline bool isJSArray(JSCell* cell) { return cell->classInfo() == &JSArray::s_info; }
inline bool isJSArray(JSValue v) { return v.isCell() && isJSArray(v.asCell()); }
-// The definition of MAX_STORAGE_VECTOR_LENGTH is dependant on the definition storageSize
-// function below - the MAX_STORAGE_VECTOR_LENGTH limit is defined such that the storage
-// size calculation cannot overflow. (sizeof(ArrayStorage) - sizeof(WriteBarrier<Unknown>)) +
-// (vectorLength * sizeof(WriteBarrier<Unknown>)) must be <= 0xFFFFFFFFU (which is maximum value of size_t).
-#define MAX_STORAGE_VECTOR_LENGTH static_cast<unsigned>((0xFFFFFFFFU - (sizeof(ArrayStorage) - sizeof(WriteBarrier<Unknown>))) / sizeof(WriteBarrier<Unknown>))
-
-// These values have to be macros to be used in max() and min() without introducing
-// a PIC branch in Mach-O binaries, see <rdar://problem/5971391>.
-#define MIN_SPARSE_ARRAY_INDEX 10000U
-#define MAX_STORAGE_VECTOR_INDEX (MAX_STORAGE_VECTOR_LENGTH - 1)
- inline size_t JSArray::storageSize(unsigned vectorLength)
- {
- ASSERT(vectorLength <= MAX_STORAGE_VECTOR_LENGTH);
-
- // MAX_STORAGE_VECTOR_LENGTH is defined such that provided (vectorLength <= MAX_STORAGE_VECTOR_LENGTH)
- // - as asserted above - the following calculation cannot overflow.
- size_t size = (sizeof(ArrayStorage) - sizeof(WriteBarrier<Unknown>)) + (vectorLength * sizeof(WriteBarrier<Unknown>));
- // Assertion to detect integer overflow in previous calculation (should not be possible, provided that
- // MAX_STORAGE_VECTOR_LENGTH is correctly defined).
- ASSERT(((size - (sizeof(ArrayStorage) - sizeof(WriteBarrier<Unknown>))) / sizeof(WriteBarrier<Unknown>) == vectorLength) && (size >= (sizeof(ArrayStorage) - sizeof(WriteBarrier<Unknown>))));
-
- return size;
- }
-
inline JSArray* constructArray(ExecState* exec, Structure* arrayStructure, const ArgList& values)
{
JSGlobalData& globalData = exec->globalData();
diff --git a/Source/JavaScriptCore/runtime/JSBoundFunction.cpp b/Source/JavaScriptCore/runtime/JSBoundFunction.cpp
index 7540d4394..08d6831c0 100644
--- a/Source/JavaScriptCore/runtime/JSBoundFunction.cpp
+++ b/Source/JavaScriptCore/runtime/JSBoundFunction.cpp
@@ -45,7 +45,7 @@ EncodedJSValue JSC_HOST_CALL boundFunctionCall(ExecState* exec)
MarkedArgumentBuffer args;
for (unsigned i = 0; i < boundArgs->length(); ++i)
- args.append(boundArgs->getIndex(i));
+ args.append(boundArgs->getIndexQuickly(i));
for (unsigned i = 0; i < exec->argumentCount(); ++i)
args.append(exec->argument(i));
@@ -65,7 +65,7 @@ EncodedJSValue JSC_HOST_CALL boundFunctionConstruct(ExecState* exec)
MarkedArgumentBuffer args;
for (unsigned i = 0; i < boundArgs->length(); ++i)
- args.append(boundArgs->getIndex(i));
+ args.append(boundArgs->getIndexQuickly(i));
for (unsigned i = 0; i < exec->argumentCount(); ++i)
args.append(exec->argument(i));
@@ -112,8 +112,8 @@ void JSBoundFunction::finishCreation(ExecState* exec, NativeExecutable* executab
Base::finishCreation(exec, executable, length, name);
ASSERT(inherits(&s_info));
- putDirectAccessor(exec->globalData(), exec->propertyNames().arguments, globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
- putDirectAccessor(exec->globalData(), exec->propertyNames().caller, globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
+ putDirectAccessor(exec, exec->propertyNames().arguments, globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
+ putDirectAccessor(exec, exec->propertyNames().caller, globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
}
void JSBoundFunction::visitChildren(JSCell* cell, SlotVisitor& visitor)
diff --git a/Source/JavaScriptCore/runtime/JSCell.cpp b/Source/JavaScriptCore/runtime/JSCell.cpp
index ffb76ff95..e050a53ef 100644
--- a/Source/JavaScriptCore/runtime/JSCell.cpp
+++ b/Source/JavaScriptCore/runtime/JSCell.cpp
@@ -178,6 +178,11 @@ void JSCell::getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, Enum
ASSERT_NOT_REACHED();
}
+void JSCell::getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode)
+{
+ ASSERT_NOT_REACHED();
+}
+
String JSCell::className(const JSObject*)
{
ASSERT_NOT_REACHED();
diff --git a/Source/JavaScriptCore/runtime/JSCell.h b/Source/JavaScriptCore/runtime/JSCell.h
index a63e08e33..94f08f31b 100644
--- a/Source/JavaScriptCore/runtime/JSCell.h
+++ b/Source/JavaScriptCore/runtime/JSCell.h
@@ -64,6 +64,7 @@ namespace JSC {
friend class JSValue;
friend class MarkedBlock;
template<typename T> friend void* allocateCell(Heap&);
+ template<typename T> friend void* allocateCell(Heap&, size_t);
public:
static const unsigned StructureFlags = 0;
@@ -137,7 +138,7 @@ namespace JSC {
{
return &m_structure;
}
-
+
#if ENABLE(GC_VALIDATION)
Structure* unvalidatedStructure() { return m_structure.unvalidatedGet(); }
#endif
@@ -155,6 +156,7 @@ namespace JSC {
// Dummy implementations of override-able static functions for classes to put in their MethodTable
static JSValue defaultValue(const JSObject*, ExecState*, PreferredPrimitiveType);
static NO_RETURN_DUE_TO_ASSERT void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
+ static NO_RETURN_DUE_TO_ASSERT void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
static NO_RETURN_DUE_TO_ASSERT void getPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
static String className(const JSObject*);
static bool hasInstance(JSObject*, ExecState*, JSValue, JSValue prototypeProperty);
@@ -337,6 +339,25 @@ namespace JSC {
return result;
}
+ template<typename T>
+ void* allocateCell(Heap& heap, size_t size)
+ {
+ ASSERT(size >= sizeof(T));
+#if ENABLE(GC_VALIDATION)
+ ASSERT(!heap.globalData()->isInitializingObject());
+ heap.globalData()->setInitializingObjectClass(&T::s_info);
+#endif
+ JSCell* result = 0;
+ if (NeedsDestructor<T>::value)
+ result = static_cast<JSCell*>(heap.allocateWithDestructor(size));
+ else {
+ ASSERT(T::s_info.methodTable.destroy == JSCell::destroy);
+ result = static_cast<JSCell*>(heap.allocateWithoutDestructor(size));
+ }
+ result->clearStructure();
+ return result;
+ }
+
inline bool isZapped(const JSCell* cell)
{
return cell->isZapped();
diff --git a/Source/JavaScriptCore/runtime/JSFunction.cpp b/Source/JavaScriptCore/runtime/JSFunction.cpp
index e5cb8cf38..4afe63216 100644
--- a/Source/JavaScriptCore/runtime/JSFunction.cpp
+++ b/Source/JavaScriptCore/runtime/JSFunction.cpp
@@ -84,13 +84,6 @@ JSFunction::JSFunction(ExecState* exec, JSGlobalObject* globalObject, Structure*
{
}
-JSFunction::JSFunction(ExecState* exec, FunctionExecutable* executable, JSScope* scope)
- : Base(exec->globalData(), scope->globalObject()->functionStructure())
- , m_executable(exec->globalData(), this, executable)
- , m_scope(exec->globalData(), this, scope)
-{
-}
-
void JSFunction::finishCreation(ExecState* exec, NativeExecutable* executable, int length, const String& name)
{
Base::finishCreation(exec->globalData());
@@ -100,20 +93,6 @@ void JSFunction::finishCreation(ExecState* exec, NativeExecutable* executable, i
putDirect(exec->globalData(), exec->propertyNames().length, jsNumber(length), DontDelete | ReadOnly | DontEnum);
}
-void JSFunction::finishCreation(ExecState* exec, FunctionExecutable* executable, JSScope* scope)
-{
- JSGlobalData& globalData = exec->globalData();
- Base::finishCreation(globalData);
- ASSERT(inherits(&s_info));
-
- // Switching the structure here is only safe if we currently have the function structure!
- ASSERT(structure() == scope->globalObject()->functionStructure());
- setStructureAndReallocateStorageIfNecessary(
- globalData,
- scope->globalObject()->namedFunctionStructure());
- putDirectOffset(globalData, scope->globalObject()->functionNameOffset(), executable->nameValue());
-}
-
Structure* JSFunction::cacheInheritorID(ExecState* exec)
{
JSValue prototype = get(exec, exec->globalData().propertyNames->prototype);
@@ -124,12 +103,12 @@ Structure* JSFunction::cacheInheritorID(ExecState* exec)
return m_cachedInheritorID.get();
}
-const String& JSFunction::name(ExecState* exec)
+String JSFunction::name(ExecState* exec)
{
- return asString(getDirect(exec->globalData(), exec->globalData().propertyNames->name))->tryGetValue();
+ return get(exec, exec->globalData().propertyNames->name).toWTFString(exec);
}
-const String JSFunction::displayName(ExecState* exec)
+String JSFunction::displayName(ExecState* exec)
{
JSValue displayName = getDirect(exec->globalData(), exec->globalData().propertyNames->displayName);
@@ -213,6 +192,13 @@ JSValue JSFunction::lengthGetter(ExecState*, JSValue slotBase, PropertyName)
return jsNumber(thisObj->jsExecutable()->parameterCount());
}
+JSValue JSFunction::nameGetter(ExecState*, JSValue slotBase, PropertyName)
+{
+ JSFunction* thisObj = jsCast<JSFunction*>(slotBase);
+ ASSERT(!thisObj->isHostFunction());
+ return thisObj->jsExecutable()->nameValue();
+}
+
bool JSFunction::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
JSFunction* thisObject = jsCast<JSFunction*>(cell);
@@ -236,7 +222,7 @@ bool JSFunction::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName
if (thisObject->jsExecutable()->isStrictMode()) {
bool result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
if (!result) {
- thisObject->putDirectAccessor(exec->globalData(), propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
+ thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
ASSERT(result);
}
@@ -251,11 +237,16 @@ bool JSFunction::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName
return true;
}
+ if (propertyName == exec->propertyNames().name) {
+ slot.setCacheableCustom(thisObject, nameGetter);
+ return true;
+ }
+
if (propertyName == exec->propertyNames().caller) {
if (thisObject->jsExecutable()->isStrictMode()) {
bool result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
if (!result) {
- thisObject->putDirectAccessor(exec->globalData(), propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
+ thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
ASSERT(result);
}
@@ -284,7 +275,7 @@ bool JSFunction::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, Pro
if (thisObject->jsExecutable()->isStrictMode()) {
bool result = Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
if (!result) {
- thisObject->putDirectAccessor(exec->globalData(), propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
+ thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
result = Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
ASSERT(result);
}
@@ -299,11 +290,16 @@ bool JSFunction::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, Pro
return true;
}
+ if (propertyName == exec->propertyNames().name) {
+ descriptor.setDescriptor(thisObject->jsExecutable()->nameValue(), ReadOnly | DontEnum | DontDelete);
+ return true;
+ }
+
if (propertyName == exec->propertyNames().caller) {
if (thisObject->jsExecutable()->isStrictMode()) {
bool result = Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
if (!result) {
- thisObject->putDirectAccessor(exec->globalData(), propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
+ thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
result = Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
ASSERT(result);
}
@@ -316,7 +312,7 @@ bool JSFunction::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, Pro
return Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
}
-void JSFunction::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
+void JSFunction::getOwnNonIndexPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
JSFunction* thisObject = jsCast<JSFunction*>(object);
if (!thisObject->isHostFunction() && (mode == IncludeDontEnumProperties)) {
@@ -327,8 +323,9 @@ void JSFunction::getOwnPropertyNames(JSObject* object, ExecState* exec, Property
propertyNames.add(exec->propertyNames().arguments);
propertyNames.add(exec->propertyNames().caller);
propertyNames.add(exec->propertyNames().length);
+ propertyNames.add(exec->propertyNames().name);
}
- Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
+ Base::getOwnNonIndexPropertyNames(thisObject, exec, propertyNames, mode);
}
void JSFunction::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
@@ -356,7 +353,7 @@ void JSFunction::put(JSCell* cell, ExecState* exec, PropertyName propertyName, J
Base::put(thisObject, exec, propertyName, value, slot);
return;
}
- if (propertyName == exec->propertyNames().arguments || propertyName == exec->propertyNames().length || propertyName == exec->propertyNames().caller) {
+ if (propertyName == exec->propertyNames().arguments || propertyName == exec->propertyNames().length || propertyName == exec->propertyNames().name || propertyName == exec->propertyNames().caller) {
if (slot.isStrictMode())
throwTypeError(exec, StrictModeReadonlyPropertyWriteError);
return;
@@ -371,6 +368,7 @@ bool JSFunction::deleteProperty(JSCell* cell, ExecState* exec, PropertyName prop
if (!thisObject->isHostFunction() && !exec->globalData().isInDefineOwnProperty()
&& (propertyName == exec->propertyNames().arguments
|| propertyName == exec->propertyNames().length
+ || propertyName == exec->propertyNames().name
|| propertyName == exec->propertyNames().prototype
|| propertyName == exec->propertyNames().caller))
return false;
@@ -396,19 +394,21 @@ bool JSFunction::defineOwnProperty(JSObject* object, ExecState* exec, PropertyNa
if (propertyName == exec->propertyNames().arguments) {
if (thisObject->jsExecutable()->isStrictMode()) {
if (!Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor))
- thisObject->putDirectAccessor(exec->globalData(), propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
+ thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
return Base::defineOwnProperty(object, exec, propertyName, descriptor, throwException);
}
valueCheck = !descriptor.value() || sameValue(exec, descriptor.value(), exec->interpreter()->retrieveArgumentsFromVMCode(exec, thisObject));
} else if (propertyName == exec->propertyNames().caller) {
if (thisObject->jsExecutable()->isStrictMode()) {
if (!Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor))
- thisObject->putDirectAccessor(exec->globalData(), propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
+ thisObject->putDirectAccessor(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
return Base::defineOwnProperty(object, exec, propertyName, descriptor, throwException);
}
valueCheck = !descriptor.value() || sameValue(exec, descriptor.value(), exec->interpreter()->retrieveCallerFromVMCode(exec, thisObject));
} else if (propertyName == exec->propertyNames().length)
valueCheck = !descriptor.value() || sameValue(exec, descriptor.value(), jsNumber(thisObject->jsExecutable()->parameterCount()));
+ else if (propertyName == exec->propertyNames().name)
+ valueCheck = !descriptor.value() || sameValue(exec, descriptor.value(), thisObject->jsExecutable()->nameValue());
else
return Base::defineOwnProperty(object, exec, propertyName, descriptor, throwException);
diff --git a/Source/JavaScriptCore/runtime/JSFunction.h b/Source/JavaScriptCore/runtime/JSFunction.h
index 4bd5f46fa..c1f066585 100644
--- a/Source/JavaScriptCore/runtime/JSFunction.h
+++ b/Source/JavaScriptCore/runtime/JSFunction.h
@@ -59,14 +59,15 @@ namespace JSC {
static JSFunction* create(ExecState* exec, FunctionExecutable* executable, JSScope* scope)
{
- JSFunction* function = new (NotNull, allocateCell<JSFunction>(*exec->heap())) JSFunction(exec, executable, scope);
+ JSGlobalData& globalData = exec->globalData();
+ JSFunction* function = new (NotNull, allocateCell<JSFunction>(globalData.heap)) JSFunction(globalData, executable, scope);
ASSERT(function->structure()->globalObject());
- function->finishCreation(exec, executable, scope);
+ function->finishCreation(globalData);
return function;
}
- JS_EXPORT_PRIVATE const String& name(ExecState*);
- JS_EXPORT_PRIVATE const String displayName(ExecState*);
+ JS_EXPORT_PRIVATE String name(ExecState*);
+ JS_EXPORT_PRIVATE String displayName(ExecState*);
const String calculatedDisplayName(ExecState*);
JSScope* scope()
@@ -137,16 +138,16 @@ namespace JSC {
const static unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesVisitChildren | OverridesGetPropertyNames | JSObject::StructureFlags;
JS_EXPORT_PRIVATE JSFunction(ExecState*, JSGlobalObject*, Structure*);
- JSFunction(ExecState*, FunctionExecutable*, JSScope*);
+ JSFunction(JSGlobalData&, FunctionExecutable*, JSScope*);
void finishCreation(ExecState*, NativeExecutable*, int length, const String& name);
- void finishCreation(ExecState*, FunctionExecutable*, JSScope*);
+ using Base::finishCreation;
Structure* cacheInheritorID(ExecState*);
static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
- static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode = ExcludeDontEnumProperties);
+ static void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode = ExcludeDontEnumProperties);
static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool shouldThrow);
static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
@@ -163,6 +164,7 @@ namespace JSC {
static JSValue argumentsGetter(ExecState*, JSValue, PropertyName);
static JSValue callerGetter(ExecState*, JSValue, PropertyName);
static JSValue lengthGetter(ExecState*, JSValue, PropertyName);
+ static JSValue nameGetter(ExecState*, JSValue, PropertyName);
WriteBarrier<ExecutableBase> m_executable;
WriteBarrier<JSScope> m_scope;
diff --git a/Source/JavaScriptCore/runtime/JSGlobalData.cpp b/Source/JavaScriptCore/runtime/JSGlobalData.cpp
index 217526f6a..e409c8219 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalData.cpp
+++ b/Source/JavaScriptCore/runtime/JSGlobalData.cpp
@@ -55,6 +55,7 @@
#include "ParserArena.h"
#include "RegExpCache.h"
#include "RegExpObject.h"
+#include "SparseArrayValueMapInlineMethods.h"
#include "StrictEvalActivation.h"
#include "StrongInlines.h"
#include <wtf/RetainPtr.h>
@@ -213,6 +214,7 @@ JSGlobalData::JSGlobalData(GlobalDataType globalDataType, ThreadStackType thread
regExpStructure.set(*this, RegExp::createStructure(*this, 0, jsNull()));
sharedSymbolTableStructure.set(*this, SharedSymbolTable::createStructure(*this, 0, jsNull()));
structureChainStructure.set(*this, StructureChain::createStructure(*this, 0, jsNull()));
+ sparseArrayValueMapStructure.set(*this, SparseArrayValueMap::createStructure(*this, 0, jsNull()));
wtfThreadData().setCurrentIdentifierTable(existingEntryIdentifierTable);
@@ -457,7 +459,7 @@ void JSGlobalData::releaseExecutableMemory()
recompiler.currentlyExecutingFunctions.add(static_cast<FunctionExecutable*>(executable));
}
- heap.objectSpace().forEachCell<StackPreservingRecompiler>(recompiler);
+ heap.objectSpace().forEachLiveCell<StackPreservingRecompiler>(recompiler);
}
m_regExpCache->invalidateCode();
heap.collectAllGarbage();
diff --git a/Source/JavaScriptCore/runtime/JSGlobalData.h b/Source/JavaScriptCore/runtime/JSGlobalData.h
index e4e6784da..68e0e25d1 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalData.h
+++ b/Source/JavaScriptCore/runtime/JSGlobalData.h
@@ -244,6 +244,7 @@ namespace JSC {
Strong<Structure> regExpStructure;
Strong<Structure> sharedSymbolTableStructure;
Strong<Structure> structureChainStructure;
+ Strong<Structure> sparseArrayValueMapStructure;
IdentifierTable* identifierTable;
CommonIdentifiers* propertyNames;
diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
index 97e9153cb..8ee8e1498 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
@@ -213,7 +213,7 @@ void JSGlobalObject::reset(JSValue prototype)
GetterSetter* protoAccessor = GetterSetter::create(exec);
protoAccessor->setGetter(exec->globalData(), JSFunction::create(exec, this, 0, String(), globalFuncProtoGetter));
protoAccessor->setSetter(exec->globalData(), JSFunction::create(exec, this, 0, String(), globalFuncProtoSetter));
- m_objectPrototype->putDirectAccessor(exec->globalData(), exec->propertyNames().underscoreProto, protoAccessor, Accessor | DontEnum);
+ m_objectPrototype->putDirectAccessor(exec, exec->propertyNames().underscoreProto, protoAccessor, Accessor | DontEnum);
m_functionPrototype->structure()->setPrototypeWithoutTransition(exec->globalData(), m_objectPrototype.get());
m_nameScopeStructure.set(exec->globalData(), this, JSNameScope::createStructure(exec->globalData(), this, jsNull()));
diff --git a/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp b/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
index 4588ec2d9..e9a3e2836 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
+++ b/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
@@ -27,6 +27,7 @@
#include "CallFrame.h"
#include "Interpreter.h"
+#include "JSFunction.h"
#include "JSGlobalObject.h"
#include "JSString.h"
#include "JSStringBuilder.h"
diff --git a/Source/JavaScriptCore/runtime/JSONObject.cpp b/Source/JavaScriptCore/runtime/JSONObject.cpp
index 45854dcea..fe894afba 100644
--- a/Source/JavaScriptCore/runtime/JSONObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSONObject.cpp
@@ -521,8 +521,8 @@ bool Stringifier::Holder::appendNextProperty(Stringifier& stringifier, StringBui
if (m_isArray) {
// Get the value.
JSValue value;
- if (m_isJSArray && asArray(m_object.get())->canGetIndex(index))
- value = asArray(m_object.get())->getIndex(index);
+ if (m_isJSArray && asArray(m_object.get())->canGetIndexQuickly(index))
+ value = asArray(m_object.get())->getIndexQuickly(index);
else {
PropertySlot slot(m_object.get());
if (!m_object->methodTable()->getOwnPropertySlotByIndex(m_object.get(), exec, index, slot))
@@ -687,8 +687,8 @@ NEVER_INLINE JSValue Walker::walk(JSValue unfiltered)
indexStack.removeLast();
break;
}
- if (isJSArray(array) && array->canGetIndex(index))
- inValue = array->getIndex(index);
+ if (isJSArray(array) && array->canGetIndexQuickly(index))
+ inValue = array->getIndexQuickly(index);
else {
PropertySlot slot;
if (array->methodTable()->getOwnPropertySlotByIndex(array, m_exec, index, slot))
diff --git a/Source/JavaScriptCore/runtime/JSObject.cpp b/Source/JavaScriptCore/runtime/JSObject.cpp
index 812ba3bc8..6eac0d1cb 100644
--- a/Source/JavaScriptCore/runtime/JSObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSObject.cpp
@@ -1,7 +1,7 @@
/*
* Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
* Copyright (C) 2001 Peter Kelly (pmk@post.com)
- * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2012 Apple Inc. All rights reserved.
* Copyright (C) 2007 Eric Seidel (eric@webkit.org)
*
* This library is free software; you can redistribute it and/or
@@ -24,10 +24,12 @@
#include "config.h"
#include "JSObject.h"
+#include "ButterflyInlineMethods.h"
#include "CopiedSpaceInlineMethods.h"
#include "DatePrototype.h"
#include "ErrorConstructor.h"
#include "GetterSetter.h"
+#include "IndexingHeaderInlineMethods.h"
#include "JSFunction.h"
#include "JSGlobalObject.h"
#include "JSGlobalThis.h"
@@ -38,12 +40,19 @@
#include "Operations.h"
#include "PropertyDescriptor.h"
#include "PropertyNameArray.h"
+#include "Reject.h"
#include "SlotVisitorInlineMethods.h"
+#include "SparseArrayValueMapInlineMethods.h"
#include <math.h>
#include <wtf/Assertions.h>
namespace JSC {
+// We keep track of the size of the last array after it was grown. We use this
+// as a simple heuristic for as the value to grow the next array from size 0.
+// This value is capped by the constant FIRST_VECTOR_GROW defined above.
+static unsigned lastArraySize = 0;
+
JSCell* getCallableObjectSlow(JSCell* cell)
{
Structure* structure = cell->structure();
@@ -86,29 +95,81 @@ static inline void getClassPropertyNames(ExecState* exec, const ClassInfo* class
}
}
-ALWAYS_INLINE void JSObject::visitOutOfLineStorage(SlotVisitor& visitor, PropertyStorage storage, size_t storageSize)
+ALWAYS_INLINE void JSObject::visitButterfly(SlotVisitor& visitor, Butterfly* butterfly, size_t storageSize)
{
- ASSERT(storage);
- ASSERT(storageSize);
-
- size_t capacity = structure()->outOfLineCapacity();
- ASSERT(capacity);
- size_t capacityInBytes = capacity * sizeof(WriteBarrierBase<Unknown>);
- PropertyStorage baseOfStorage = storage - capacity - 1;
- if (visitor.checkIfShouldCopyAndPinOtherwise(baseOfStorage, capacityInBytes)) {
- PropertyStorage newBaseOfStorage = static_cast<PropertyStorage>(visitor.allocateNewSpace(capacityInBytes));
- PropertyStorage currentTarget = newBaseOfStorage + capacity;
- PropertyStorage newStorage = currentTarget + 1;
- PropertyStorage currentSource = storage - 1;
+ ASSERT(butterfly);
+
+ Structure* structure = this->structure();
+
+ size_t propertyCapacity = structure->outOfLineCapacity();
+ size_t preCapacity;
+ size_t indexingPayloadSizeInBytes;
+ bool hasIndexingHeader = JSC::hasIndexingHeader(structure->indexingType());
+ if (UNLIKELY(hasIndexingHeader)) {
+ preCapacity = butterfly->indexingHeader()->preCapacity(structure);
+ indexingPayloadSizeInBytes = butterfly->indexingHeader()->indexingPayloadSizeInBytes(structure);
+ } else {
+ preCapacity = 0;
+ indexingPayloadSizeInBytes = 0;
+ }
+ size_t capacityInBytes = Butterfly::totalSize(
+ preCapacity, propertyCapacity, hasIndexingHeader, indexingPayloadSizeInBytes);
+ if (visitor.checkIfShouldCopyAndPinOtherwise(
+ butterfly->base(preCapacity, propertyCapacity), capacityInBytes)) {
+ Butterfly* newButterfly = Butterfly::createUninitializedDuringCollection(visitor, preCapacity, propertyCapacity, hasIndexingHeader, indexingPayloadSizeInBytes);
+
+ // Mark and copy the properties.
+ PropertyStorage currentTarget = newButterfly->propertyStorage();
+ PropertyStorage currentSource = butterfly->propertyStorage();
for (size_t count = storageSize; count--;) {
JSValue value = (--currentSource)->get();
ASSERT(value);
visitor.appendUnbarrieredValue(&value);
(--currentTarget)->setWithoutWriteBarrier(value);
}
- m_outOfLineStorage.set(newStorage, StorageBarrier::Unchecked);
- } else
- visitor.appendValues(storage - storageSize - 1, storageSize);
+
+ if (UNLIKELY(hasIndexingHeader)) {
+ *newButterfly->indexingHeader() = *butterfly->indexingHeader();
+
+ // Mark and copy the array if appropriate.
+ switch (structure->indexingType()) {
+ case ArrayWithArrayStorage:
+ case NonArrayWithArrayStorage: {
+ newButterfly->arrayStorage()->copyHeaderFromDuringGC(*butterfly->arrayStorage());
+ WriteBarrier<Unknown>* currentTarget = newButterfly->arrayStorage()->m_vector;
+ WriteBarrier<Unknown>* currentSource = butterfly->arrayStorage()->m_vector;
+ for (size_t count = newButterfly->arrayStorage()->vectorLength(); count--;) {
+ JSValue value = (currentSource++)->get();
+ if (value)
+ visitor.appendUnbarrieredValue(&value);
+ (currentTarget++)->setWithoutWriteBarrier(value);
+ }
+ if (newButterfly->arrayStorage()->m_sparseMap)
+ visitor.append(&newButterfly->arrayStorage()->m_sparseMap);
+ break;
+ }
+ default:
+ break;
+ }
+ }
+
+ m_butterfly = newButterfly;
+ } else {
+ // Mark the properties.
+ visitor.appendValues(butterfly->propertyStorage() - storageSize, storageSize);
+
+ // Mark the array if appropriate.
+ switch (structure->indexingType()) {
+ case ArrayWithArrayStorage:
+ case NonArrayWithArrayStorage:
+ visitor.appendValues(butterfly->arrayStorage()->m_vector, butterfly->arrayStorage()->vectorLength());
+ if (butterfly->arrayStorage()->m_sparseMap)
+ visitor.append(&butterfly->arrayStorage()->m_sparseMap);
+ break;
+ default:
+ break;
+ }
+ }
}
void JSObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
@@ -122,9 +183,9 @@ void JSObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
JSCell::visitChildren(thisObject, visitor);
- PropertyStorage storage = thisObject->outOfLineStorage();
- if (storage)
- thisObject->visitOutOfLineStorage(visitor, storage, thisObject->structure()->outOfLineSizeForKnownNonFinalObject());
+ Butterfly* butterfly = thisObject->butterfly();
+ if (butterfly)
+ thisObject->visitButterfly(visitor, butterfly, thisObject->structure()->outOfLineSizeForKnownNonFinalObject());
#if !ASSERT_DISABLED
visitor.m_isCheckingForDefaultMarkViolation = wasCheckingForDefaultMarkViolation;
@@ -142,9 +203,9 @@ void JSFinalObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
JSCell::visitChildren(thisObject, visitor);
- PropertyStorage storage = thisObject->outOfLineStorage();
- if (storage)
- thisObject->visitOutOfLineStorage(visitor, storage, thisObject->structure()->outOfLineSizeForKnownFinalObject());
+ Butterfly* butterfly = thisObject->butterfly();
+ if (butterfly)
+ thisObject->visitButterfly(visitor, butterfly, thisObject->structure()->outOfLineSizeForKnownFinalObject());
size_t storageSize = thisObject->structure()->inlineSizeForKnownFinalObject();
visitor.appendValues(thisObject->inlineStorage(), storageSize);
@@ -161,10 +222,50 @@ String JSObject::className(const JSObject* object)
return info->className;
}
-bool JSObject::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
+bool JSObject::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned i, PropertySlot& slot)
{
+ // NB. The fact that we're directly consulting our indexed storage implies that it is not
+ // legal for anyone to override getOwnPropertySlot() without also overriding
+ // getOwnPropertySlotByIndex().
+
JSObject* thisObject = jsCast<JSObject*>(cell);
- return thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, Identifier::from(exec, propertyName), slot);
+
+ if (i > MAX_ARRAY_INDEX)
+ return thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, Identifier::from(exec, i), slot);
+
+ switch (thisObject->structure()->indexingType()) {
+ case NonArray:
+ case ArrayClass:
+ break;
+
+ case NonArrayWithArrayStorage:
+ case ArrayWithArrayStorage: {
+ ArrayStorage* storage = thisObject->m_butterfly->arrayStorage();
+ if (i >= storage->length())
+ return false;
+
+ if (i < storage->vectorLength()) {
+ JSValue value = storage->m_vector[i].get();
+ if (value) {
+ slot.setValue(value);
+ return true;
+ }
+ } else if (SparseArrayValueMap* map = storage->m_sparseMap.get()) {
+ SparseArrayValueMap::iterator it = map->find(i);
+ if (it != map->notFound()) {
+ it->second.get(slot);
+ return true;
+ }
+ }
+ break;
+ }
+
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+
+ return false;
}
// ECMA 8.6.2.2
@@ -174,6 +275,14 @@ void JSObject::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSV
ASSERT(value);
ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(thisObject));
JSGlobalData& globalData = exec->globalData();
+
+ // Try indexed put first. This is required for correctness, since loads on property names that appear like
+ // valid indices will never look in the named property storage.
+ unsigned i = propertyName.asIndex();
+ if (i != PropertyName::NotAnIndex) {
+ putByIndex(thisObject, exec, i, value, slot.isStrictMode());
+ return;
+ }
// Check if there are any setters or getters in the prototype chain
JSValue prototype;
@@ -235,9 +344,145 @@ void JSObject::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSV
void JSObject::putByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, JSValue value, bool shouldThrow)
{
- PutPropertySlot slot(shouldThrow);
JSObject* thisObject = jsCast<JSObject*>(cell);
- thisObject->methodTable()->put(thisObject, exec, Identifier::from(exec, propertyName), value, slot);
+ thisObject->checkIndexingConsistency();
+
+ if (UNLIKELY(propertyName > MAX_ARRAY_INDEX)) {
+ PutPropertySlot slot(shouldThrow);
+ thisObject->methodTable()->put(thisObject, exec, Identifier::from(exec, propertyName), value, slot);
+ return;
+ }
+
+ switch (thisObject->structure()->indexingType()) {
+ case NonArray:
+ case ArrayClass:
+ break;
+
+ case NonArrayWithArrayStorage:
+ case ArrayWithArrayStorage: {
+ ArrayStorage* storage = thisObject->m_butterfly->arrayStorage();
+
+ if (propertyName >= storage->vectorLength())
+ break;
+
+ WriteBarrier<Unknown>& valueSlot = storage->m_vector[propertyName];
+ unsigned length = storage->length();
+
+ // Update length & m_numValuesInVector as necessary.
+ if (propertyName >= length) {
+ length = propertyName + 1;
+ storage->setLength(length);
+ ++storage->m_numValuesInVector;
+ } else if (!valueSlot)
+ ++storage->m_numValuesInVector;
+
+ valueSlot.set(exec->globalData(), thisObject, value);
+ thisObject->checkIndexingConsistency();
+ return;
+ }
+
+ default:
+ ASSERT_NOT_REACHED();
+ }
+
+ thisObject->putByIndexBeyondVectorLength(exec, propertyName, value, shouldThrow);
+ thisObject->checkIndexingConsistency();
+}
+
+ArrayStorage* JSObject::enterDictionaryIndexingModeWhenArrayStorageAlreadyExists(JSGlobalData& globalData, ArrayStorage* storage)
+{
+ SparseArrayValueMap* map = storage->m_sparseMap.get();
+
+ if (!map)
+ map = allocateSparseIndexMap(globalData);
+
+ if (map->sparseMode())
+ return storage;
+
+ map->setSparseMode();
+
+ unsigned usedVectorLength = std::min(storage->length(), storage->vectorLength());
+ for (unsigned i = 0; i < usedVectorLength; ++i) {
+ JSValue value = storage->m_vector[i].get();
+ // This will always be a new entry in the map, so no need to check we can write,
+ // and attributes are default so no need to set them.
+ if (value)
+ map->add(this, i).iterator->second.set(globalData, this, value);
+ }
+
+ Butterfly* newButterfly = storage->butterfly()->resizeArray(globalData, structure(), 0, ArrayStorage::sizeFor(0));
+ if (!newButterfly)
+ CRASH();
+
+ m_butterfly = newButterfly;
+ newButterfly->arrayStorage()->m_indexBias = 0;
+ newButterfly->arrayStorage()->setVectorLength(0);
+ newButterfly->arrayStorage()->m_sparseMap.set(globalData, this, map);
+
+ return newButterfly->arrayStorage();
+}
+
+void JSObject::enterDictionaryIndexingMode(JSGlobalData& globalData)
+{
+ switch (structure()->indexingType()) {
+ case ArrayWithArrayStorage:
+ case NonArrayWithArrayStorage:
+ enterDictionaryIndexingModeWhenArrayStorageAlreadyExists(globalData, m_butterfly->arrayStorage());
+ break;
+
+ default:
+ break;
+ }
+}
+
+ArrayStorage* JSObject::createArrayStorage(JSGlobalData& globalData, unsigned length, unsigned vectorLength)
+{
+ IndexingType oldType = structure()->indexingType();
+ ASSERT_UNUSED(oldType, oldType == NonArray || oldType == ArrayClass);
+ Butterfly* newButterfly = m_butterfly->growArrayRight(
+ globalData, structure(), structure()->outOfLineCapacity(), false, 0,
+ ArrayStorage::sizeFor(vectorLength));
+ if (!newButterfly)
+ CRASH();
+ ArrayStorage* result = newButterfly->arrayStorage();
+ result->setLength(length);
+ result->setVectorLength(vectorLength);
+ result->m_sparseMap.clear();
+ result->m_numValuesInVector = 0;
+ result->m_indexBias = 0;
+#if CHECK_ARRAY_CONSISTENCY
+ result->m_initializationIndex = 0;
+ result->m_inCompactInitialization = 0;
+#endif
+ Structure* newStructure = Structure::nonPropertyTransition(globalData, structure(), AllocateArrayStorage);
+ setButterfly(globalData, newButterfly, newStructure);
+ return result;
+}
+
+ArrayStorage* JSObject::createInitialArrayStorage(JSGlobalData& globalData)
+{
+ return createArrayStorage(globalData, 0, BASE_VECTOR_LEN);
+}
+
+ArrayStorage* JSObject::ensureArrayStorageExistsAndEnterDictionaryIndexingMode(JSGlobalData& globalData)
+{
+ switch (structure()->indexingType()) {
+ case ArrayWithArrayStorage:
+ case NonArrayWithArrayStorage:
+ return enterDictionaryIndexingModeWhenArrayStorageAlreadyExists(globalData, m_butterfly->arrayStorage());
+
+ case ArrayClass:
+ case NonArray: {
+ createArrayStorage(globalData, 0, 0);
+ SparseArrayValueMap* map = allocateSparseIndexMap(globalData);
+ map->setSparseMode();
+ return arrayStorage();
+ }
+
+ default:
+ ASSERT_NOT_REACHED();
+ return 0;
+ }
}
void JSObject::putDirectVirtual(JSObject* object, ExecState* exec, PropertyName propertyName, JSValue value, unsigned attributes)
@@ -269,10 +514,18 @@ bool JSObject::allowsAccessFrom(ExecState* exec)
return globalObject->globalObjectMethodTable()->allowsAccessFrom(globalObject, exec);
}
-void JSObject::putDirectAccessor(JSGlobalData& globalData, PropertyName propertyName, JSValue value, unsigned attributes)
+void JSObject::putDirectAccessor(ExecState* exec, PropertyName propertyName, JSValue value, unsigned attributes)
{
ASSERT(value.isGetterSetter() && (attributes & Accessor));
+ unsigned index = propertyName.asIndex();
+ if (index != PropertyName::NotAnIndex) {
+ putDirectIndex(exec, index, value, attributes, PutDirectIndexLikePutDirect);
+ return;
+ }
+
+ JSGlobalData& globalData = exec->globalData();
+
PutPropertySlot slot;
putDirectInternal<PutModeDefineOwnProperty>(globalData, propertyName, value, attributes, slot, getCallableObject(value));
@@ -304,6 +557,10 @@ bool JSObject::hasProperty(ExecState* exec, unsigned propertyName) const
bool JSObject::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName)
{
JSObject* thisObject = jsCast<JSObject*>(cell);
+
+ unsigned i = propertyName.asIndex();
+ if (i != PropertyName::NotAnIndex)
+ return thisObject->methodTable()->deletePropertyByIndex(thisObject, exec, i);
if (!thisObject->staticFunctionsReified())
thisObject->reifyStaticFunctionsForDelete(exec);
@@ -332,10 +589,45 @@ bool JSObject::hasOwnProperty(ExecState* exec, PropertyName propertyName) const
return const_cast<JSObject*>(this)->methodTable()->getOwnPropertySlot(const_cast<JSObject*>(this), exec, propertyName, slot);
}
-bool JSObject::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned propertyName)
+bool JSObject::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned i)
{
JSObject* thisObject = jsCast<JSObject*>(cell);
- return thisObject->methodTable()->deleteProperty(thisObject, exec, Identifier::from(exec, propertyName));
+
+ if (i > MAX_ARRAY_INDEX)
+ return thisObject->methodTable()->deleteProperty(thisObject, exec, Identifier::from(exec, i));
+
+ switch (thisObject->structure()->indexingType()) {
+ case ArrayClass:
+ case NonArray:
+ return true;
+
+ case ArrayWithArrayStorage:
+ case NonArrayWithArrayStorage: {
+ ArrayStorage* storage = thisObject->m_butterfly->arrayStorage();
+
+ if (i < storage->vectorLength()) {
+ WriteBarrier<Unknown>& valueSlot = storage->m_vector[i];
+ if (valueSlot) {
+ valueSlot.clear();
+ --storage->m_numValuesInVector;
+ }
+ } else if (SparseArrayValueMap* map = storage->m_sparseMap.get()) {
+ SparseArrayValueMap::iterator it = map->find(i);
+ if (it != map->notFound()) {
+ if (it->second.attributes & DontDelete)
+ return false;
+ map->remove(it);
+ }
+ }
+
+ thisObject->checkIndexingConsistency();
+ return true;
+ }
+
+ default:
+ ASSERT_NOT_REACHED();
+ return false;
+ }
}
static ALWAYS_INLINE JSValue callDefaultValueFunction(ExecState* exec, const JSObject* object, PropertyName propertyName)
@@ -465,6 +757,51 @@ void JSObject::getPropertyNames(JSObject* object, ExecState* exec, PropertyNameA
void JSObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
+ // Add numeric properties first. That appears to be the accepted convention.
+ // FIXME: Filling PropertyNameArray with an identifier for every integer
+ // is incredibly inefficient for large arrays. We need a different approach,
+ // which almost certainly means a different structure for PropertyNameArray.
+ switch (object->structure()->indexingType()) {
+ case NonArray:
+ case ArrayClass:
+ break;
+
+ case NonArrayWithArrayStorage:
+ case ArrayWithArrayStorage: {
+ ArrayStorage* storage = object->m_butterfly->arrayStorage();
+
+ unsigned usedVectorLength = std::min(storage->length(), storage->vectorLength());
+ for (unsigned i = 0; i < usedVectorLength; ++i) {
+ if (storage->m_vector[i])
+ propertyNames.add(Identifier::from(exec, i));
+ }
+
+ if (SparseArrayValueMap* map = storage->m_sparseMap.get()) {
+ Vector<unsigned> keys;
+ keys.reserveCapacity(map->size());
+
+ SparseArrayValueMap::const_iterator end = map->end();
+ for (SparseArrayValueMap::const_iterator it = map->begin(); it != end; ++it) {
+ if (mode == IncludeDontEnumProperties || !(it->second.attributes & DontEnum))
+ keys.append(static_cast<unsigned>(it->first));
+ }
+
+ std::sort(keys.begin(), keys.end());
+ for (unsigned i = 0; i < keys.size(); ++i)
+ propertyNames.add(Identifier::from(exec, keys[i]));
+ }
+ break;
+ }
+
+ default:
+ ASSERT_NOT_REACHED();
+ }
+
+ object->methodTable()->getOwnNonIndexPropertyNames(object, exec, propertyNames, mode);
+}
+
+void JSObject::getOwnNonIndexPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
+{
getClassPropertyNames(exec, object->classInfo(), propertyNames, mode, object->staticFunctionsReified());
object->structure()->getPropertyNamesFromStructure(exec->globalData(), propertyNames, mode);
}
@@ -515,8 +852,7 @@ void JSObject::freeze(JSGlobalData& globalData)
void JSObject::preventExtensions(JSGlobalData& globalData)
{
- if (isJSArray(this))
- asArray(this)->enterDictionaryMode(globalData);
+ enterDictionaryIndexingMode(globalData);
if (isExtensible())
setStructure(globalData, Structure::preventExtensionsTransition(globalData, structure()));
}
@@ -573,11 +909,11 @@ bool JSObject::removeDirect(JSGlobalData& globalData, PropertyName propertyName)
return true;
}
-NEVER_INLINE void JSObject::fillGetterPropertySlot(PropertySlot& slot, WriteBarrierBase<Unknown>* location)
+NEVER_INLINE void JSObject::fillGetterPropertySlot(PropertySlot& slot, PropertyOffset offset)
{
- if (JSObject* getterFunction = asGetterSetter(location->get())->getter()) {
+ if (JSObject* getterFunction = asGetterSetter(getDirectOffset(offset))->getter()) {
if (!structure()->isDictionary())
- slot.setCacheableGetterSlot(this, getterFunction, offsetForLocation(location));
+ slot.setCacheableGetterSlot(this, getterFunction, offset);
else
slot.setGetterSlot(getterFunction);
} else
@@ -603,26 +939,528 @@ Structure* JSObject::createInheritorID(JSGlobalData& globalData)
return inheritorID;
}
-PropertyStorage JSObject::growOutOfLineStorage(JSGlobalData& globalData, size_t oldSize, size_t newSize)
+void JSObject::putIndexedDescriptor(ExecState* exec, SparseArrayEntry* entryInMap, PropertyDescriptor& descriptor, PropertyDescriptor& oldDescriptor)
{
- ASSERT(newSize > oldSize);
+ if (descriptor.isDataDescriptor()) {
+ if (descriptor.value())
+ entryInMap->set(exec->globalData(), this, descriptor.value());
+ else if (oldDescriptor.isAccessorDescriptor())
+ entryInMap->set(exec->globalData(), this, jsUndefined());
+ entryInMap->attributes = descriptor.attributesOverridingCurrent(oldDescriptor) & ~Accessor;
+ return;
+ }
- // It's important that this function not rely on structure(), since
- // we might be in the middle of a transition.
+ if (descriptor.isAccessorDescriptor()) {
+ JSObject* getter = 0;
+ if (descriptor.getterPresent())
+ getter = descriptor.getterObject();
+ else if (oldDescriptor.isAccessorDescriptor())
+ getter = oldDescriptor.getterObject();
+ JSObject* setter = 0;
+ if (descriptor.setterPresent())
+ setter = descriptor.setterObject();
+ else if (oldDescriptor.isAccessorDescriptor())
+ setter = oldDescriptor.setterObject();
+
+ GetterSetter* accessor = GetterSetter::create(exec);
+ if (getter)
+ accessor->setGetter(exec->globalData(), getter);
+ if (setter)
+ accessor->setSetter(exec->globalData(), setter);
+
+ entryInMap->set(exec->globalData(), this, accessor);
+ entryInMap->attributes = descriptor.attributesOverridingCurrent(oldDescriptor) & ~ReadOnly;
+ return;
+ }
+
+ ASSERT(descriptor.isGenericDescriptor());
+ entryInMap->attributes = descriptor.attributesOverridingCurrent(oldDescriptor);
+}
+
+// Defined in ES5.1 8.12.9
+bool JSObject::defineOwnIndexedProperty(ExecState* exec, unsigned index, PropertyDescriptor& descriptor, bool throwException)
+{
+ ASSERT(index != 0xFFFFFFFF);
+
+ if (!inSparseIndexingMode()) {
+ // Fast case: we're putting a regular property to a regular array
+ // FIXME: this will pessimistically assume that if attributes are missing then they'll default to false
+ // however if the property currently exists missing attributes will override from their current 'true'
+ // state (i.e. defineOwnProperty could be used to set a value without needing to entering 'SparseMode').
+ if (!descriptor.attributes()) {
+ ASSERT(!descriptor.isAccessorDescriptor());
+ return putDirectIndex(exec, index, descriptor.value(), 0, throwException ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
+ }
+
+ ensureArrayStorageExistsAndEnterDictionaryIndexingMode(exec->globalData());
+ }
+
+ SparseArrayValueMap* map = m_butterfly->arrayStorage()->m_sparseMap.get();
+ ASSERT(map);
+
+ // 1. Let current be the result of calling the [[GetOwnProperty]] internal method of O with property name P.
+ SparseArrayValueMap::AddResult result = map->add(this, index);
+ SparseArrayEntry* entryInMap = &result.iterator->second;
+
+ // 2. Let extensible be the value of the [[Extensible]] internal property of O.
+ // 3. If current is undefined and extensible is false, then Reject.
+ // 4. If current is undefined and extensible is true, then
+ if (result.isNewEntry) {
+ if (!isExtensible()) {
+ map->remove(result.iterator);
+ return reject(exec, throwException, "Attempting to define property on object that is not extensible.");
+ }
+
+ // 4.a. If IsGenericDescriptor(Desc) or IsDataDescriptor(Desc) is true, then create an own data property
+ // named P of object O whose [[Value]], [[Writable]], [[Enumerable]] and [[Configurable]] attribute values
+ // are described by Desc. If the value of an attribute field of Desc is absent, the attribute of the newly
+ // created property is set to its default value.
+ // 4.b. Else, Desc must be an accessor Property Descriptor so, create an own accessor property named P of
+ // object O whose [[Get]], [[Set]], [[Enumerable]] and [[Configurable]] attribute values are described by
+ // Desc. If the value of an attribute field of Desc is absent, the attribute of the newly created property
+ // is set to its default value.
+ // 4.c. Return true.
+
+ PropertyDescriptor defaults;
+ entryInMap->setWithoutWriteBarrier(jsUndefined());
+ entryInMap->attributes = DontDelete | DontEnum | ReadOnly;
+ entryInMap->get(defaults);
+
+ putIndexedDescriptor(exec, entryInMap, descriptor, defaults);
+ if (index >= m_butterfly->arrayStorage()->length())
+ m_butterfly->arrayStorage()->setLength(index + 1);
+ return true;
+ }
+
+ // 5. Return true, if every field in Desc is absent.
+ // 6. Return true, if every field in Desc also occurs in current and the value of every field in Desc is the same value as the corresponding field in current when compared using the SameValue algorithm (9.12).
+ PropertyDescriptor current;
+ entryInMap->get(current);
+ if (descriptor.isEmpty() || descriptor.equalTo(exec, current))
+ return true;
+
+ // 7. If the [[Configurable]] field of current is false then
+ if (!current.configurable()) {
+ // 7.a. Reject, if the [[Configurable]] field of Desc is true.
+ if (descriptor.configurablePresent() && descriptor.configurable())
+ return reject(exec, throwException, "Attempting to change configurable attribute of unconfigurable property.");
+ // 7.b. Reject, if the [[Enumerable]] field of Desc is present and the [[Enumerable]] fields of current and Desc are the Boolean negation of each other.
+ if (descriptor.enumerablePresent() && current.enumerable() != descriptor.enumerable())
+ return reject(exec, throwException, "Attempting to change enumerable attribute of unconfigurable property.");
+ }
+
+ // 8. If IsGenericDescriptor(Desc) is true, then no further validation is required.
+ if (!descriptor.isGenericDescriptor()) {
+ // 9. Else, if IsDataDescriptor(current) and IsDataDescriptor(Desc) have different results, then
+ if (current.isDataDescriptor() != descriptor.isDataDescriptor()) {
+ // 9.a. Reject, if the [[Configurable]] field of current is false.
+ if (!current.configurable())
+ return reject(exec, throwException, "Attempting to change access mechanism for an unconfigurable property.");
+ // 9.b. If IsDataDescriptor(current) is true, then convert the property named P of object O from a
+ // data property to an accessor property. Preserve the existing values of the converted property's
+ // [[Configurable]] and [[Enumerable]] attributes and set the rest of the property's attributes to
+ // their default values.
+ // 9.c. Else, convert the property named P of object O from an accessor property to a data property.
+ // Preserve the existing values of the converted property's [[Configurable]] and [[Enumerable]]
+ // attributes and set the rest of the property's attributes to their default values.
+ } else if (current.isDataDescriptor() && descriptor.isDataDescriptor()) {
+ // 10. Else, if IsDataDescriptor(current) and IsDataDescriptor(Desc) are both true, then
+ // 10.a. If the [[Configurable]] field of current is false, then
+ if (!current.configurable() && !current.writable()) {
+ // 10.a.i. Reject, if the [[Writable]] field of current is false and the [[Writable]] field of Desc is true.
+ if (descriptor.writable())
+ return reject(exec, throwException, "Attempting to change writable attribute of unconfigurable property.");
+ // 10.a.ii. If the [[Writable]] field of current is false, then
+ // 10.a.ii.1. Reject, if the [[Value]] field of Desc is present and SameValue(Desc.[[Value]], current.[[Value]]) is false.
+ if (descriptor.value() && !sameValue(exec, descriptor.value(), current.value()))
+ return reject(exec, throwException, "Attempting to change value of a readonly property.");
+ }
+ // 10.b. else, the [[Configurable]] field of current is true, so any change is acceptable.
+ } else {
+ ASSERT(current.isAccessorDescriptor() && current.getterPresent() && current.setterPresent());
+ // 11. Else, IsAccessorDescriptor(current) and IsAccessorDescriptor(Desc) are both true so, if the [[Configurable]] field of current is false, then
+ if (!current.configurable()) {
+ // 11.i. Reject, if the [[Set]] field of Desc is present and SameValue(Desc.[[Set]], current.[[Set]]) is false.
+ if (descriptor.setterPresent() && descriptor.setter() != current.setter())
+ return reject(exec, throwException, "Attempting to change the setter of an unconfigurable property.");
+ // 11.ii. Reject, if the [[Get]] field of Desc is present and SameValue(Desc.[[Get]], current.[[Get]]) is false.
+ if (descriptor.getterPresent() && descriptor.getter() != current.getter())
+ return reject(exec, throwException, "Attempting to change the getter of an unconfigurable property.");
+ }
+ }
+ }
+
+ // 12. For each attribute field of Desc that is present, set the correspondingly named attribute of the property named P of object O to the value of the field.
+ putIndexedDescriptor(exec, entryInMap, descriptor, current);
+ // 13. Return true.
+ return true;
+}
+
+SparseArrayValueMap* JSObject::allocateSparseIndexMap(JSGlobalData& globalData)
+{
+ SparseArrayValueMap* result = SparseArrayValueMap::create(globalData);
+ arrayStorage()->m_sparseMap.set(globalData, this, result);
+ return result;
+}
+
+void JSObject::deallocateSparseIndexMap()
+{
+ if (ArrayStorage* arrayStorage = arrayStorageOrNull())
+ arrayStorage->m_sparseMap.clear();
+}
+
+void JSObject::putByIndexBeyondVectorLengthWithArrayStorage(ExecState* exec, unsigned i, JSValue value, bool shouldThrow, ArrayStorage* storage)
+{
+ JSGlobalData& globalData = exec->globalData();
+
+ // i should be a valid array index that is outside of the current vector.
+ ASSERT(i <= MAX_ARRAY_INDEX);
+ ASSERT(i >= storage->vectorLength());
+
+ SparseArrayValueMap* map = storage->m_sparseMap.get();
+
+ // First, handle cases where we don't currently have a sparse map.
+ if (LIKELY(!map)) {
+ // If the array is not extensible, we should have entered dictionary mode, and created the spare map.
+ ASSERT(isExtensible());
+
+ // Update m_length if necessary.
+ if (i >= storage->length())
+ storage->setLength(i + 1);
+
+ // Check that it is sensible to still be using a vector, and then try to grow the vector.
+ if (LIKELY((isDenseEnoughForVector(i, storage->m_numValuesInVector)) && increaseVectorLength(globalData, i + 1))) {
+ // success! - reread m_storage since it has likely been reallocated, and store to the vector.
+ storage = arrayStorage();
+ storage->m_vector[i].set(globalData, this, value);
+ ++storage->m_numValuesInVector;
+ return;
+ }
+ // We don't want to, or can't use a vector to hold this property - allocate a sparse map & add the value.
+ map = allocateSparseIndexMap(exec->globalData());
+ map->putEntry(exec, this, i, value, shouldThrow);
+ return;
+ }
+
+ // Update m_length if necessary.
+ unsigned length = storage->length();
+ if (i >= length) {
+ // Prohibit growing the array if length is not writable.
+ if (map->lengthIsReadOnly() || !isExtensible()) {
+ if (shouldThrow)
+ throwTypeError(exec, StrictModeReadonlyPropertyWriteError);
+ return;
+ }
+ length = i + 1;
+ storage->setLength(length);
+ }
+
+ // We are currently using a map - check whether we still want to be doing so.
+ // We will continue to use a sparse map if SparseMode is set, a vector would be too sparse, or if allocation fails.
+ unsigned numValuesInArray = storage->m_numValuesInVector + map->size();
+ if (map->sparseMode() || !isDenseEnoughForVector(length, numValuesInArray) || !increaseVectorLength(exec->globalData(), length)) {
+ map->putEntry(exec, this, i, value, shouldThrow);
+ return;
+ }
+
+ // Reread m_storage after increaseVectorLength, update m_numValuesInVector.
+ storage = arrayStorage();
+ storage->m_numValuesInVector = numValuesInArray;
+
+ // Copy all values from the map into the vector, and delete the map.
+ WriteBarrier<Unknown>* vector = storage->m_vector;
+ SparseArrayValueMap::const_iterator end = map->end();
+ for (SparseArrayValueMap::const_iterator it = map->begin(); it != end; ++it)
+ vector[it->first].set(globalData, this, it->second.getNonSparseMode());
+ deallocateSparseIndexMap();
+
+ // Store the new property into the vector.
+ WriteBarrier<Unknown>& valueSlot = vector[i];
+ if (!valueSlot)
+ ++storage->m_numValuesInVector;
+ valueSlot.set(globalData, this, value);
+}
+
+void JSObject::putByIndexBeyondVectorLength(ExecState* exec, unsigned i, JSValue value, bool shouldThrow)
+{
+ JSGlobalData& globalData = exec->globalData();
+
+ // i should be a valid array index that is outside of the current vector.
+ ASSERT(i <= MAX_ARRAY_INDEX);
- PropertyStorage oldPropertyStorage = m_outOfLineStorage.get();
- PropertyStorage newPropertyStorage = 0;
+ switch (structure()->indexingType()) {
+ case NonArray:
+ case ArrayClass: {
+ if (indexingShouldBeSparse()) {
+ putByIndexBeyondVectorLengthWithArrayStorage(exec, i, value, shouldThrow, ensureArrayStorageExistsAndEnterDictionaryIndexingMode(globalData));
+ break;
+ }
+ if (!isDenseEnoughForVector(i, 0) || i >= MAX_STORAGE_VECTOR_LENGTH) {
+ putByIndexBeyondVectorLengthWithArrayStorage(exec, i, value, shouldThrow, createArrayStorage(globalData, 0, 0));
+ break;
+ }
+
+ ArrayStorage* storage = createArrayStorage(globalData, i + 1, getNewVectorLength(0, 0, i + 1));
+ storage->m_vector[i].set(globalData, this, value);
+ storage->m_numValuesInVector = 1;
+ break;
+ }
+
+ case NonArrayWithArrayStorage:
+ case ArrayWithArrayStorage:
+ putByIndexBeyondVectorLengthWithArrayStorage(exec, i, value, shouldThrow, arrayStorage());
+ break;
+
+ default:
+ ASSERT_NOT_REACHED();
+ }
+}
+
+bool JSObject::putDirectIndexBeyondVectorLengthWithArrayStorage(ExecState* exec, unsigned i, JSValue value, unsigned attributes, PutDirectIndexMode mode, ArrayStorage* storage)
+{
+ JSGlobalData& globalData = exec->globalData();
+
+ // i should be a valid array index that is outside of the current vector.
+ ASSERT(i >= storage->vectorLength() || attributes);
+ ASSERT(i <= MAX_ARRAY_INDEX);
+
+ SparseArrayValueMap* map = storage->m_sparseMap.get();
+
+ // First, handle cases where we don't currently have a sparse map.
+ if (LIKELY(!map)) {
+ // If the array is not extensible, we should have entered dictionary mode, and created the spare map.
+ ASSERT(isExtensible());
+
+ // Update m_length if necessary.
+ if (i >= storage->length())
+ storage->setLength(i + 1);
+
+ // Check that it is sensible to still be using a vector, and then try to grow the vector.
+ if (LIKELY(
+ !attributes
+ && (isDenseEnoughForVector(i, storage->m_numValuesInVector))
+ && increaseVectorLength(globalData, i + 1))) {
+ // success! - reread m_storage since it has likely been reallocated, and store to the vector.
+ storage = arrayStorage();
+ storage->m_vector[i].set(globalData, this, value);
+ ++storage->m_numValuesInVector;
+ return true;
+ }
+ // We don't want to, or can't use a vector to hold this property - allocate a sparse map & add the value.
+ map = allocateSparseIndexMap(exec->globalData());
+ return map->putDirect(exec, this, i, value, attributes, mode);
+ }
+
+ // Update m_length if necessary.
+ unsigned length = storage->length();
+ if (i >= length) {
+ if (mode != PutDirectIndexLikePutDirect) {
+ // Prohibit growing the array if length is not writable.
+ if (map->lengthIsReadOnly())
+ return reject(exec, mode == PutDirectIndexShouldThrow, StrictModeReadonlyPropertyWriteError);
+ if (!isExtensible())
+ return reject(exec, mode == PutDirectIndexShouldThrow, "Attempting to define property on object that is not extensible.");
+ }
+ length = i + 1;
+ storage->setLength(length);
+ }
+
+ // We are currently using a map - check whether we still want to be doing so.
+ // We will continue to use a sparse map if SparseMode is set, a vector would be too sparse, or if allocation fails.
+ unsigned numValuesInArray = storage->m_numValuesInVector + map->size();
+ if (map->sparseMode() || attributes || !isDenseEnoughForVector(length, numValuesInArray) || !increaseVectorLength(exec->globalData(), length))
+ return map->putDirect(exec, this, i, value, attributes, mode);
+
+ // Reread m_storage after increaseVectorLength, update m_numValuesInVector.
+ storage = arrayStorage();
+ storage->m_numValuesInVector = numValuesInArray;
+
+ // Copy all values from the map into the vector, and delete the map.
+ WriteBarrier<Unknown>* vector = storage->m_vector;
+ SparseArrayValueMap::const_iterator end = map->end();
+ for (SparseArrayValueMap::const_iterator it = map->begin(); it != end; ++it)
+ vector[it->first].set(globalData, this, it->second.getNonSparseMode());
+ deallocateSparseIndexMap();
+
+ // Store the new property into the vector.
+ WriteBarrier<Unknown>& valueSlot = vector[i];
+ if (!valueSlot)
+ ++storage->m_numValuesInVector;
+ valueSlot.set(globalData, this, value);
+ return true;
+}
+
+bool JSObject::putDirectIndexBeyondVectorLength(ExecState* exec, unsigned i, JSValue value, unsigned attributes, PutDirectIndexMode mode)
+{
+ JSGlobalData& globalData = exec->globalData();
+
+ // i should be a valid array index that is outside of the current vector.
+ ASSERT(i <= MAX_ARRAY_INDEX);
+
+ switch (structure()->indexingType()) {
+ case NonArray:
+ case ArrayClass: {
+ if (indexingShouldBeSparse() || attributes)
+ return putDirectIndexBeyondVectorLengthWithArrayStorage(exec, i, value, attributes, mode, ensureArrayStorageExistsAndEnterDictionaryIndexingMode(globalData));
+ if (!isDenseEnoughForVector(i, 0) || i >= MAX_STORAGE_VECTOR_LENGTH)
+ return putDirectIndexBeyondVectorLengthWithArrayStorage(exec, i, value, attributes, mode, createArrayStorage(globalData, 0, 0));
+
+ ArrayStorage* storage = createArrayStorage(globalData, i + 1, getNewVectorLength(0, 0, i + 1));
+ storage->m_vector[i].set(globalData, this, value);
+ storage->m_numValuesInVector = 1;
+ return true;
+ }
+
+ case NonArrayWithArrayStorage:
+ case ArrayWithArrayStorage:
+ return putDirectIndexBeyondVectorLengthWithArrayStorage(exec, i, value, attributes, mode, arrayStorage());
+
+ default:
+ ASSERT_NOT_REACHED();
+ return false;
+ }
+}
+
+ALWAYS_INLINE unsigned JSObject::getNewVectorLength(unsigned currentVectorLength, unsigned currentLength, unsigned desiredLength)
+{
+ ASSERT(desiredLength <= MAX_STORAGE_VECTOR_LENGTH);
+
+ unsigned increasedLength;
+ unsigned maxInitLength = std::min(currentLength, 100000U);
+
+ if (desiredLength < maxInitLength)
+ increasedLength = maxInitLength;
+ else if (!currentVectorLength)
+ increasedLength = std::max(desiredLength, lastArraySize);
+ else {
+ // Mathematically equivalent to:
+ // increasedLength = (newLength * 3 + 1) / 2;
+ // or:
+ // increasedLength = (unsigned)ceil(newLength * 1.5));
+ // This form is not prone to internal overflow.
+ increasedLength = desiredLength + (desiredLength >> 1) + (desiredLength & 1);
+ }
+
+ ASSERT(increasedLength >= desiredLength);
+
+ lastArraySize = std::min(increasedLength, FIRST_VECTOR_GROW);
+
+ return std::min(increasedLength, MAX_STORAGE_VECTOR_LENGTH);
+}
- // We have this extra temp here to slake GCC's thirst for the blood of those who dereference type-punned pointers.
- void* temp = newPropertyStorage;
- if (!globalData.heap.tryAllocateStorage(sizeof(WriteBarrierBase<Unknown>) * newSize, &temp))
+ALWAYS_INLINE unsigned JSObject::getNewVectorLength(unsigned desiredLength)
+{
+ unsigned vectorLength;
+ unsigned length;
+
+ switch (structure()->indexingType()) {
+ case NonArray:
+ case ArrayClass:
+ vectorLength = 0;
+ length = 0;
+ break;
+ case NonArrayWithArrayStorage:
+ case ArrayWithArrayStorage:
+ vectorLength = m_butterfly->arrayStorage()->vectorLength();
+ length = m_butterfly->arrayStorage()->length();
+ break;
+ default:
CRASH();
- newPropertyStorage = static_cast<PropertyStorage>(temp) + newSize + 1;
+ return 0;
+ }
+ return getNewVectorLength(vectorLength, length, desiredLength);
+}
+
+bool JSObject::increaseVectorLength(JSGlobalData& globalData, unsigned newLength)
+{
+ // This function leaves the array in an internally inconsistent state, because it does not move any values from sparse value map
+ // to the vector. Callers have to account for that, because they can do it more efficiently.
+ if (newLength > MAX_STORAGE_VECTOR_LENGTH)
+ return false;
+
+ ArrayStorage* storage = arrayStorage();
+
+ unsigned indexBias = storage->m_indexBias;
+ unsigned vectorLength = storage->vectorLength();
+ ASSERT(newLength > vectorLength);
+ unsigned newVectorLength = getNewVectorLength(newLength);
+
+ // Fast case - there is no precapacity. In these cases a realloc makes sense.
+ if (LIKELY(!indexBias)) {
+ Butterfly* newButterfly = storage->butterfly()->growArrayRight(globalData, structure(), structure()->outOfLineCapacity(), true, ArrayStorage::sizeFor(vectorLength), ArrayStorage::sizeFor(newVectorLength));
+ if (!newButterfly)
+ return false;
+ m_butterfly = newButterfly;
+ newButterfly->arrayStorage()->setVectorLength(newVectorLength);
+ return true;
+ }
- memcpy(newPropertyStorage - oldSize - 1, oldPropertyStorage - oldSize - 1, sizeof(WriteBarrierBase<Unknown>) * oldSize);
+ // Remove some, but not all of the precapacity. Atomic decay, & capped to not overflow array length.
+ unsigned newIndexBias = std::min(indexBias >> 1, MAX_STORAGE_VECTOR_LENGTH - newVectorLength);
+ Butterfly* newButterfly = storage->butterfly()->resizeArray(
+ globalData,
+ structure()->outOfLineCapacity(), true, ArrayStorage::sizeFor(vectorLength),
+ newIndexBias, true, ArrayStorage::sizeFor(newVectorLength));
+ if (!newButterfly)
+ return false;
+
+ m_butterfly = newButterfly;
+ newButterfly->arrayStorage()->setVectorLength(newVectorLength);
+ newButterfly->arrayStorage()->m_indexBias = newIndexBias;
+ return true;
+}
- ASSERT(newPropertyStorage);
- return newPropertyStorage;
+#if CHECK_ARRAY_CONSISTENCY
+void JSObject::checkIndexingConsistency(ConsistencyCheckType type)
+{
+ ArrayStorage* storage = arrayStorageOrNull();
+ if (!storage)
+ return;
+
+ ASSERT(!storage->m_inCompactInitialization);
+
+ ASSERT(storage);
+ if (type == SortConsistencyCheck)
+ ASSERT(!storage->m_sparseMap);
+
+ unsigned numValuesInVector = 0;
+ for (unsigned i = 0; i < storage->vectorLength(); ++i) {
+ if (JSValue value = storage->m_vector[i].get()) {
+ ASSERT(i < storage->length());
+ if (type != DestructorConsistencyCheck)
+ value.isUndefined(); // Likely to crash if the object was deallocated.
+ ++numValuesInVector;
+ } else {
+ if (type == SortConsistencyCheck)
+ ASSERT(i >= storage->m_numValuesInVector);
+ }
+ }
+ ASSERT(numValuesInVector == storage->m_numValuesInVector);
+ ASSERT(numValuesInVector <= storage->length());
+
+ if (m_sparseValueMap) {
+ SparseArrayValueMap::const_iterator end = m_sparseValueMap->end();
+ for (SparseArrayValueMap::const_iterator it = m_sparseValueMap->begin(); it != end; ++it) {
+ unsigned index = it->first;
+ ASSERT(index < storage->length());
+ ASSERT(index >= storage->vectorLength());
+ ASSERT(index <= MAX_ARRAY_INDEX);
+ ASSERT(it->second);
+ if (type != DestructorConsistencyCheck)
+ it->second.getNonSparseMode().isUndefined(); // Likely to crash if the object was deallocated.
+ }
+ }
+}
+#endif // CHECK_ARRAY_CONSISTENCY
+
+Butterfly* JSObject::growOutOfLineStorage(JSGlobalData& globalData, size_t oldSize, size_t newSize)
+{
+ ASSERT(newSize > oldSize);
+
+ // It's important that this function not rely on structure(), for the property
+ // capacity, since we might have already mutated the structure in-place.
+
+ return m_butterfly->growPropertyStorage(globalData, structure(), oldSize, newSize);
}
bool JSObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
@@ -630,10 +1468,46 @@ bool JSObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, Prope
unsigned attributes = 0;
JSCell* cell = 0;
PropertyOffset offset = object->structure()->get(exec->globalData(), propertyName, attributes, cell);
- if (offset == invalidOffset)
+ if (isValidOffset(offset)) {
+ descriptor.setDescriptor(object->getDirectOffset(offset), attributes);
+ return true;
+ }
+
+ unsigned i = propertyName.asIndex();
+ if (i == PropertyName::NotAnIndex)
return false;
- descriptor.setDescriptor(object->getDirectOffset(offset), attributes);
- return true;
+
+ switch (object->structure()->indexingType()) {
+ case NonArray:
+ case ArrayClass:
+ return false;
+
+ case NonArrayWithArrayStorage:
+ case ArrayWithArrayStorage: {
+ ArrayStorage* storage = object->m_butterfly->arrayStorage();
+ if (i >= storage->length())
+ return false;
+ if (i < storage->vectorLength()) {
+ WriteBarrier<Unknown>& value = storage->m_vector[i];
+ if (!value)
+ return false;
+ descriptor.setDescriptor(value.get(), 0);
+ return true;
+ }
+ if (SparseArrayValueMap* map = storage->m_sparseMap.get()) {
+ SparseArrayValueMap::iterator it = map->find(i);
+ if (it == map->notFound())
+ return false;
+ it->second.get(descriptor);
+ return true;
+ }
+ return false;
+ }
+
+ default:
+ ASSERT_NOT_REACHED();
+ return false;
+ }
}
bool JSObject::getPropertyDescriptor(ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
@@ -658,7 +1532,7 @@ static bool putDescriptor(ExecState* exec, JSObject* target, PropertyName proper
accessor->setGetter(exec->globalData(), oldDescriptor.getterObject());
if (oldDescriptor.setterPresent())
accessor->setSetter(exec->globalData(), oldDescriptor.setterObject());
- target->putDirectAccessor(exec->globalData(), propertyName, accessor, attributes | Accessor);
+ target->putDirectAccessor(exec, propertyName, accessor, attributes | Accessor);
return true;
}
JSValue newValue = jsUndefined();
@@ -683,10 +1557,19 @@ static bool putDescriptor(ExecState* exec, JSObject* target, PropertyName proper
else if (oldDescriptor.setterPresent())
accessor->setSetter(exec->globalData(), oldDescriptor.setterObject());
- target->putDirectAccessor(exec->globalData(), propertyName, accessor, attributes | Accessor);
+ target->putDirectAccessor(exec, propertyName, accessor, attributes | Accessor);
return true;
}
+void JSObject::putDirectMayBeIndex(ExecState* exec, PropertyName propertyName, JSValue value)
+{
+ unsigned asIndex = propertyName.asIndex();
+ if (asIndex == PropertyName::NotAnIndex)
+ putDirect(exec->globalData(), propertyName, value);
+ else
+ putDirectIndex(exec, asIndex, value);
+}
+
class DefineOwnPropertyScope {
public:
DefineOwnPropertyScope(ExecState* exec)
@@ -704,26 +1587,26 @@ private:
JSGlobalData& m_globalData;
};
-bool JSObject::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor, bool throwException)
+bool JSObject::defineOwnNonIndexProperty(ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor, bool throwException)
{
// Track on the globaldata that we're in define property.
// Currently DefineOwnProperty uses delete to remove properties when they are being replaced
// (particularly when changing attributes), however delete won't allow non-configurable (i.e.
// DontDelete) properties to be deleted. For now, we can use this flag to make this work.
DefineOwnPropertyScope scope(exec);
-
+
// If we have a new property we can just put it on normally
PropertyDescriptor current;
- if (!object->methodTable()->getOwnPropertyDescriptor(object, exec, propertyName, current)) {
+ if (!methodTable()->getOwnPropertyDescriptor(this, exec, propertyName, current)) {
// unless extensions are prevented!
- if (!object->isExtensible()) {
+ if (!isExtensible()) {
if (throwException)
throwError(exec, createTypeError(exec, ASCIILiteral("Attempting to define property on object that is not extensible.")));
return false;
}
PropertyDescriptor oldDescriptor;
oldDescriptor.setValue(jsUndefined());
- return putDescriptor(exec, object, propertyName, descriptor, descriptor.attributes(), oldDescriptor);
+ return putDescriptor(exec, this, propertyName, descriptor, descriptor.attributes(), oldDescriptor);
}
if (descriptor.isEmpty())
@@ -749,8 +1632,8 @@ bool JSObject::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName
// A generic descriptor is simply changing the attributes of an existing property
if (descriptor.isGenericDescriptor()) {
if (!current.attributesEqual(descriptor)) {
- object->methodTable()->deleteProperty(object, exec, propertyName);
- return putDescriptor(exec, object, propertyName, descriptor, descriptor.attributesOverridingCurrent(current), current);
+ methodTable()->deleteProperty(this, exec, propertyName);
+ return putDescriptor(exec, this, propertyName, descriptor, descriptor.attributesOverridingCurrent(current), current);
}
return true;
}
@@ -762,8 +1645,8 @@ bool JSObject::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName
throwError(exec, createTypeError(exec, ASCIILiteral("Attempting to change access mechanism for an unconfigurable property.")));
return false;
}
- object->methodTable()->deleteProperty(object, exec, propertyName);
- return putDescriptor(exec, object, propertyName, descriptor, descriptor.attributesOverridingCurrent(current), current);
+ methodTable()->deleteProperty(this, exec, propertyName);
+ return putDescriptor(exec, this, propertyName, descriptor, descriptor.attributesOverridingCurrent(current), current);
}
// Changing the value and attributes of an existing property
@@ -784,8 +1667,8 @@ bool JSObject::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName
}
if (current.attributesEqual(descriptor) && !descriptor.value())
return true;
- object->methodTable()->deleteProperty(object, exec, propertyName);
- return putDescriptor(exec, object, propertyName, descriptor, descriptor.attributesOverridingCurrent(current), current);
+ methodTable()->deleteProperty(this, exec, propertyName);
+ return putDescriptor(exec, this, propertyName, descriptor, descriptor.attributesOverridingCurrent(current), current);
}
// Changing the accessor functions of an existing accessor property
@@ -802,7 +1685,7 @@ bool JSObject::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName
return false;
}
}
- JSValue accessor = object->getDirect(exec->globalData(), propertyName);
+ JSValue accessor = getDirect(exec->globalData(), propertyName);
if (!accessor)
return false;
GetterSetter* getterSetter = asGetterSetter(accessor);
@@ -812,12 +1695,37 @@ bool JSObject::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName
getterSetter->setGetter(exec->globalData(), descriptor.getterObject());
if (current.attributesEqual(descriptor))
return true;
- object->methodTable()->deleteProperty(object, exec, propertyName);
+ methodTable()->deleteProperty(this, exec, propertyName);
unsigned attrs = descriptor.attributesOverridingCurrent(current);
- object->putDirectAccessor(exec->globalData(), propertyName, getterSetter, attrs | Accessor);
+ putDirectAccessor(exec, propertyName, getterSetter, attrs | Accessor);
return true;
}
+bool JSObject::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor, bool throwException)
+{
+ // If it's an array index, then use the indexed property storage.
+ unsigned index = propertyName.asIndex();
+ if (index != PropertyName::NotAnIndex) {
+ // c. Let succeeded be the result of calling the default [[DefineOwnProperty]] internal method (8.12.9) on A passing P, Desc, and false as arguments.
+ // d. Reject if succeeded is false.
+ // e. If index >= oldLen
+ // e.i. Set oldLenDesc.[[Value]] to index + 1.
+ // e.ii. Call the default [[DefineOwnProperty]] internal method (8.12.9) on A passing "length", oldLenDesc, and false as arguments. This call will always return true.
+ // f. Return true.
+ return object->defineOwnIndexedProperty(exec, index, descriptor, throwException);
+ }
+
+ return object->defineOwnNonIndexProperty(exec, propertyName, descriptor, throwException);
+}
+
+bool JSObject::getOwnPropertySlotSlow(ExecState* exec, PropertyName propertyName, PropertySlot& slot)
+{
+ unsigned i = propertyName.asIndex();
+ if (i != PropertyName::NotAnIndex)
+ return getOwnPropertySlotByIndex(this, exec, i, slot);
+ return false;
+}
+
JSObject* throwTypeError(ExecState* exec, const String& message)
{
return throwError(exec, createTypeError(exec, message));
diff --git a/Source/JavaScriptCore/runtime/JSObject.h b/Source/JavaScriptCore/runtime/JSObject.h
index 5e2c12f2f..8df521b75 100644
--- a/Source/JavaScriptCore/runtime/JSObject.h
+++ b/Source/JavaScriptCore/runtime/JSObject.h
@@ -1,7 +1,7 @@
/*
* Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
* Copyright (C) 2001 Peter Kelly (pmk@post.com)
- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -24,17 +24,22 @@
#define JSObject_h
#include "ArgList.h"
+#include "ArrayConventions.h"
+#include "ArrayStorage.h"
+#include "Butterfly.h"
#include "ClassInfo.h"
#include "CommonIdentifiers.h"
#include "CallFrame.h"
#include "JSCell.h"
#include "PropertySlot.h"
+#include "PropertyStorage.h"
+#include "PutDirectIndexMode.h"
#include "PutPropertySlot.h"
-#include "StorageBarrier.h"
#include "Structure.h"
#include "JSGlobalData.h"
#include "JSString.h"
+#include "SparseArrayValueMap.h"
#include <wtf/StdLibExtras.h>
namespace JSC {
@@ -79,6 +84,13 @@ namespace JSC {
Accessor = 1 << 5, // property is a getter/setter
};
+ COMPILE_ASSERT(None < FirstInternalAttribute, None_is_below_FirstInternalAttribute);
+ COMPILE_ASSERT(ReadOnly < FirstInternalAttribute, ReadOnly_is_below_FirstInternalAttribute);
+ COMPILE_ASSERT(DontEnum < FirstInternalAttribute, DontEnum_is_below_FirstInternalAttribute);
+ COMPILE_ASSERT(DontDelete < FirstInternalAttribute, DontDelete_is_below_FirstInternalAttribute);
+ COMPILE_ASSERT(Function < FirstInternalAttribute, Function_is_below_FirstInternalAttribute);
+ COMPILE_ASSERT(Accessor < FirstInternalAttribute, Accessor_is_below_FirstInternalAttribute);
+
class JSFinalObject;
class JSObject : public JSCell {
@@ -96,7 +108,7 @@ namespace JSC {
public:
typedef JSCell Base;
-
+
JS_EXPORT_PRIVATE static void visitChildren(JSCell*, SlotVisitor&);
JS_EXPORT_PRIVATE static String className(const JSObject*);
@@ -120,18 +132,196 @@ namespace JSC {
bool allowsAccessFrom(ExecState*);
+ unsigned getArrayLength() const
+ {
+ switch (structure()->indexingType()) {
+ case NonArray:
+ case ArrayClass:
+ return 0;
+ case NonArrayWithArrayStorage:
+ case ArrayWithArrayStorage:
+ return m_butterfly->arrayStorage()->length();
+ default:
+ ASSERT_NOT_REACHED();
+ return 0;
+ }
+ }
+
+ unsigned getVectorLength()
+ {
+ switch (structure()->indexingType()) {
+ case NonArray:
+ case ArrayClass:
+ return 0;
+ case NonArrayWithArrayStorage:
+ case ArrayWithArrayStorage:
+ return m_butterfly->arrayStorage()->vectorLength();
+ default:
+ ASSERT_NOT_REACHED();
+ return 0;
+ }
+ }
+
JS_EXPORT_PRIVATE static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
JS_EXPORT_PRIVATE static void putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue, bool shouldThrow);
+
+ // This is similar to the putDirect* methods:
+ // - the prototype chain is not consulted
+ // - accessors are not called.
+ // - it will ignore extensibility and read-only properties if PutDirectIndexLikePutDirect is passed as the mode (the default).
+ // This method creates a property with attributes writable, enumerable and configurable all set to true.
+ bool putDirectIndex(ExecState* exec, unsigned propertyName, JSValue value, unsigned attributes, PutDirectIndexMode mode)
+ {
+ if (!attributes && canSetIndexQuickly(propertyName)) {
+ setIndexQuickly(exec->globalData(), propertyName, value);
+ return true;
+ }
+ return putDirectIndexBeyondVectorLength(exec, propertyName, value, attributes, mode);
+ }
+ bool putDirectIndex(ExecState* exec, unsigned propertyName, JSValue value)
+ {
+ return putDirectIndex(exec, propertyName, value, 0, PutDirectIndexLikePutDirect);
+ }
+
+ // A non-throwing version of putDirect and putDirectIndex.
+ void putDirectMayBeIndex(ExecState*, PropertyName, JSValue);
+
+ bool canGetIndexQuickly(unsigned i)
+ {
+ switch (structure()->indexingType()) {
+ case NonArray:
+ case ArrayClass:
+ return false;
+ case NonArrayWithArrayStorage:
+ case ArrayWithArrayStorage:
+ return i < m_butterfly->arrayStorage()->vectorLength() && m_butterfly->arrayStorage()->m_vector[i];
+ default:
+ ASSERT_NOT_REACHED();
+ return false;
+ }
+ }
+
+ JSValue getIndexQuickly(unsigned i)
+ {
+ switch (structure()->indexingType()) {
+ case NonArrayWithArrayStorage:
+ case ArrayWithArrayStorage:
+ return m_butterfly->arrayStorage()->m_vector[i].get();
+ default:
+ ASSERT_NOT_REACHED();
+ return JSValue();
+ }
+ }
+
+ bool canSetIndexQuickly(unsigned i)
+ {
+ switch (structure()->indexingType()) {
+ case NonArray:
+ case ArrayClass:
+ return false;
+ case NonArrayWithArrayStorage:
+ case ArrayWithArrayStorage:
+ return i < m_butterfly->arrayStorage()->vectorLength();
+ default:
+ ASSERT_NOT_REACHED();
+ return false;
+ }
+ }
+
+ void setIndexQuickly(JSGlobalData& globalData, unsigned i, JSValue v)
+ {
+ switch (structure()->indexingType()) {
+ case NonArrayWithArrayStorage:
+ case ArrayWithArrayStorage: {
+ WriteBarrier<Unknown>& x = m_butterfly->arrayStorage()->m_vector[i];
+ if (!x) {
+ ArrayStorage* storage = m_butterfly->arrayStorage();
+ ++storage->m_numValuesInVector;
+ if (i >= storage->length())
+ storage->setLength(i + 1);
+ }
+ x.set(globalData, this, v);
+ break;
+ }
+ default:
+ ASSERT_NOT_REACHED();
+ }
+ }
+
+ void initializeIndex(JSGlobalData& globalData, unsigned i, JSValue v)
+ {
+ switch (structure()->indexingType()) {
+ case NonArrayWithArrayStorage:
+ case ArrayWithArrayStorage: {
+ ArrayStorage* storage = m_butterfly->arrayStorage();
+#if CHECK_ARRAY_CONSISTENCY
+ ASSERT(storage->m_inCompactInitialization);
+ // Check that we are initializing the next index in sequence.
+ ASSERT(i == storage->m_initializationIndex);
+ // tryCreateUninitialized set m_numValuesInVector to the initialLength,
+ // check we do not try to initialize more than this number of properties.
+ ASSERT(storage->m_initializationIndex < storage->m_numValuesInVector);
+ storage->m_initializationIndex++;
+#endif
+ ASSERT(i < storage->length());
+ ASSERT(i < storage->m_numValuesInVector);
+ storage->m_vector[i].set(globalData, this, v);
+ break;
+ }
+ default:
+ ASSERT_NOT_REACHED();
+ }
+ }
+
+ void completeInitialization(unsigned newLength)
+ {
+ switch (structure()->indexingType()) {
+ case NonArrayWithArrayStorage:
+ case ArrayWithArrayStorage: {
+ ArrayStorage* storage = m_butterfly->arrayStorage();
+ // Check that we have initialized as meny properties as we think we have.
+ UNUSED_PARAM(storage);
+ ASSERT_UNUSED(newLength, newLength == storage->length());
+#if CHECK_ARRAY_CONSISTENCY
+ // Check that the number of propreties initialized matches the initialLength.
+ ASSERT(storage->m_initializationIndex == m_storage->m_numValuesInVector);
+ ASSERT(storage->m_inCompactInitialization);
+ storage->m_inCompactInitialization = false;
+#endif
+ break;
+ }
+ default:
+ ASSERT_NOT_REACHED();
+ }
+ }
+
+ bool inSparseIndexingMode()
+ {
+ switch (structure()->indexingType()) {
+ case NonArray:
+ case ArrayClass:
+ return false;
+ case NonArrayWithArrayStorage:
+ case ArrayWithArrayStorage:
+ return m_butterfly->arrayStorage()->inSparseMode();
+ default:
+ ASSERT_NOT_REACHED();
+ return false;
+ }
+ }
+
+ void enterDictionaryIndexingMode(JSGlobalData&);
// putDirect is effectively an unchecked vesion of 'defineOwnProperty':
// - the prototype chain is not consulted
// - accessors are not called.
// - attributes will be respected (after the call the property will exist with the given attributes)
+ // - the property name is assumed to not be an index.
JS_EXPORT_PRIVATE static void putDirectVirtual(JSObject*, ExecState*, PropertyName, JSValue, unsigned attributes);
void putDirect(JSGlobalData&, PropertyName, JSValue, unsigned attributes = 0);
void putDirect(JSGlobalData&, PropertyName, JSValue, PutPropertySlot&);
void putDirectWithoutTransition(JSGlobalData&, PropertyName, JSValue, unsigned attributes = 0);
- void putDirectAccessor(JSGlobalData&, PropertyName, JSValue, unsigned attributes);
+ void putDirectAccessor(ExecState*, PropertyName, JSValue, unsigned attributes);
bool propertyIsEnumerable(ExecState*, const Identifier& propertyName) const;
@@ -147,6 +337,7 @@ namespace JSC {
JS_EXPORT_PRIVATE static bool hasInstance(JSObject*, ExecState*, JSValue, JSValue prototypeProperty);
JS_EXPORT_PRIVATE static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
+ JS_EXPORT_PRIVATE static void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
JS_EXPORT_PRIVATE static void getPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
JSValue toPrimitive(ExecState*, PreferredPrimitiveType = NoPreference) const;
@@ -203,8 +394,11 @@ namespace JSC {
return inlineStorageUnsafe();
}
- ConstPropertyStorage outOfLineStorage() const { return m_outOfLineStorage.get(); }
- PropertyStorage outOfLineStorage() { return m_outOfLineStorage.get(); }
+ const Butterfly* butterfly() const { return m_butterfly; }
+ Butterfly* butterfly() { return m_butterfly; }
+
+ ConstPropertyStorage outOfLineStorage() const { return m_butterfly->propertyStorage(); }
+ PropertyStorage outOfLineStorage() { return m_butterfly->propertyStorage(); }
const WriteBarrierBase<Unknown>* locationForOffset(PropertyOffset offset) const
{
@@ -227,7 +421,7 @@ namespace JSC {
if (offsetInInlineStorage < static_cast<size_t>(inlineStorageCapacity))
result = offsetInInlineStorage;
else
- result = outOfLineStorage() - location + (inlineStorageCapacity - 2);
+ result = outOfLineStorage() - location + (inlineStorageCapacity - 1);
validateOffset(result, structure()->typeInfo().type());
return result;
}
@@ -265,21 +459,22 @@ namespace JSC {
bool isSealed(JSGlobalData& globalData) { return structure()->isSealed(globalData); }
bool isFrozen(JSGlobalData& globalData) { return structure()->isFrozen(globalData); }
bool isExtensible() { return structure()->isExtensible(); }
+ bool indexingShouldBeSparse()
+ {
+ return !isExtensible()
+ || structure()->typeInfo().interceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero();
+ }
bool staticFunctionsReified() { return structure()->staticFunctionsReified(); }
void reifyStaticFunctionsForDelete(ExecState* exec);
- JS_EXPORT_PRIVATE PropertyStorage growOutOfLineStorage(JSGlobalData&, size_t oldSize, size_t newSize);
- void setOutOfLineStorage(JSGlobalData&, PropertyStorage, Structure*);
+ JS_EXPORT_PRIVATE Butterfly* growOutOfLineStorage(JSGlobalData&, size_t oldSize, size_t newSize);
+ void setButterfly(JSGlobalData&, Butterfly*, Structure*);
+ void setButterflyWithoutChangingStructure(Butterfly*); // You probably don't want to call this.
void setStructureAndReallocateStorageIfNecessary(JSGlobalData&, unsigned oldCapacity, Structure*);
void setStructureAndReallocateStorageIfNecessary(JSGlobalData&, Structure*);
- void* addressOfOutOfLineStorage()
- {
- return &m_outOfLineStorage;
- }
-
void flattenDictionaryObject(JSGlobalData& globalData)
{
structure()->flattenDictionaryStructure(globalData, this);
@@ -293,7 +488,16 @@ namespace JSC {
}
static size_t offsetOfInlineStorage();
- static size_t offsetOfOutOfLineStorage();
+
+ static ptrdiff_t butterflyOffset()
+ {
+ return OBJECT_OFFSETOF(JSObject, m_butterfly);
+ }
+
+ void* butterflyAddress()
+ {
+ return &m_butterfly;
+ }
static JS_EXPORTDATA const ClassInfo s_info;
@@ -316,14 +520,78 @@ namespace JSC {
// To instantiate objects you likely want JSFinalObject, below.
// To create derived types you likely want JSNonFinalObject, below.
- JSObject(JSGlobalData&, Structure*);
+ JSObject(JSGlobalData&, Structure*, Butterfly* = 0);
void resetInheritorID(JSGlobalData& globalData)
{
removeDirect(globalData, globalData.m_inheritorIDKey);
}
- void visitOutOfLineStorage(SlotVisitor&, PropertyStorage, size_t storageSize);
+ void visitButterfly(SlotVisitor&, Butterfly*, size_t storageSize);
+
+ // Call this if you know that the object is in a mode where it has array
+ // storage. This will assert otherwise.
+ ArrayStorage* arrayStorage()
+ {
+ ASSERT(structure()->indexingType() | HasArrayStorage);
+ return m_butterfly->arrayStorage();
+ }
+
+ // Call this if you want to predicate some actions on whether or not the
+ // object is in a mode where it has array storage.
+ ArrayStorage* arrayStorageOrNull()
+ {
+ switch (structure()->indexingType()) {
+ case ArrayWithArrayStorage:
+ case NonArrayWithArrayStorage:
+ return m_butterfly->arrayStorage();
+
+ default:
+ return 0;
+ }
+ }
+
+ // Ensure that the object is in a mode where it has array storage. Use
+ // this if you're about to perform actions that would have required the
+ // object to be converted to have array storage, if it didn't have it
+ // already.
+ ArrayStorage* ensureArrayStorage(JSGlobalData& globalData)
+ {
+ switch (structure()->indexingType()) {
+ case ArrayWithArrayStorage:
+ case NonArrayWithArrayStorage:
+ return m_butterfly->arrayStorage();
+
+ case NonArray:
+ case ArrayClass:
+ return createInitialArrayStorage(globalData);
+
+ default:
+ ASSERT_NOT_REACHED();
+ return 0;
+ }
+ }
+
+ ArrayStorage* createArrayStorage(JSGlobalData&, unsigned length, unsigned vectorLength);
+ ArrayStorage* createInitialArrayStorage(JSGlobalData&);
+
+ ArrayStorage* ensureArrayStorageExistsAndEnterDictionaryIndexingMode(JSGlobalData&);
+
+ bool defineOwnNonIndexProperty(ExecState*, PropertyName, PropertyDescriptor&, bool throwException);
+
+ enum ConsistencyCheckType { NormalConsistencyCheck, DestructorConsistencyCheck, SortConsistencyCheck };
+#if !CHECK_ARRAY_CONSISTENCY
+ void checkIndexingConsistency(ConsistencyCheckType = NormalConsistencyCheck) { }
+#else
+ void checkIndexingConsistency(ConsistencyCheckType = NormalConsistencyCheck);
+#endif
+
+ void putByIndexBeyondVectorLengthWithArrayStorage(ExecState*, unsigned propertyName, JSValue, bool shouldThrow, ArrayStorage*);
+
+ bool increaseVectorLength(JSGlobalData&, unsigned newLength);
+ void deallocateSparseIndexMap();
+ bool defineOwnIndexedProperty(ExecState*, unsigned, PropertyDescriptor&, bool throwException);
+ SparseArrayValueMap* allocateSparseIndexMap(JSGlobalData&);
private:
friend class LLIntOffsetsExtractor;
@@ -336,16 +604,30 @@ namespace JSC {
void isObject();
void isString();
+ ArrayStorage* enterDictionaryIndexingModeWhenArrayStorageAlreadyExists(JSGlobalData&, ArrayStorage*);
+
template<PutMode>
bool putDirectInternal(JSGlobalData&, PropertyName, JSValue, unsigned attr, PutPropertySlot&, JSCell*);
bool inlineGetOwnPropertySlot(ExecState*, PropertyName, PropertySlot&);
- JS_EXPORT_PRIVATE void fillGetterPropertySlot(PropertySlot&, WriteBarrierBase<Unknown>* location);
+ JS_EXPORT_PRIVATE void fillGetterPropertySlot(PropertySlot&, PropertyOffset);
const HashEntry* findPropertyHashEntry(ExecState*, PropertyName) const;
Structure* createInheritorID(JSGlobalData&);
+
+ void putIndexedDescriptor(ExecState*, SparseArrayEntry*, PropertyDescriptor&, PropertyDescriptor& old);
+
+ void putByIndexBeyondVectorLength(ExecState*, unsigned propertyName, JSValue, bool shouldThrow);
+ bool putDirectIndexBeyondVectorLengthWithArrayStorage(ExecState*, unsigned propertyName, JSValue, unsigned attributes, PutDirectIndexMode, ArrayStorage*);
+ JS_EXPORT_PRIVATE bool putDirectIndexBeyondVectorLength(ExecState*, unsigned propertyName, JSValue, unsigned attributes, PutDirectIndexMode);
+
+ unsigned getNewVectorLength(unsigned currentVectorLength, unsigned currentLength, unsigned desiredLength);
+ unsigned getNewVectorLength(unsigned desiredLength);
- StorageBarrier m_outOfLineStorage;
+ JS_EXPORT_PRIVATE bool getOwnPropertySlotSlow(ExecState*, PropertyName, PropertySlot&);
+
+ protected:
+ Butterfly* m_butterfly;
};
@@ -369,8 +651,8 @@ namespace JSC {
}
protected:
- explicit JSNonFinalObject(JSGlobalData& globalData, Structure* structure)
- : JSObject(globalData, structure)
+ explicit JSNonFinalObject(JSGlobalData& globalData, Structure* structure, Butterfly* butterfly = 0)
+ : JSObject(globalData, structure, butterfly)
{
}
@@ -453,11 +735,6 @@ inline size_t JSObject::offsetOfInlineStorage()
return OBJECT_OFFSETOF(JSFinalObject, m_inlineStorage);
}
-inline size_t JSObject::offsetOfOutOfLineStorage()
-{
- return OBJECT_OFFSETOF(JSObject, m_outOfLineStorage);
-}
-
inline bool JSObject::isGlobalObject() const
{
return structure()->typeInfo().type() == GlobalObjectType;
@@ -488,18 +765,17 @@ inline bool JSObject::isGlobalThis() const
return structure()->typeInfo().type() == GlobalThisType;
}
-inline void JSObject::setOutOfLineStorage(JSGlobalData& globalData, PropertyStorage storage, Structure* structure)
+inline void JSObject::setButterfly(JSGlobalData& globalData, Butterfly* butterfly, Structure* structure)
{
ASSERT(structure);
- if (!storage) {
- ASSERT(!structure->outOfLineCapacity());
- ASSERT(!structure->outOfLineSize());
- } else {
- ASSERT(structure->outOfLineCapacity());
- ASSERT(structure->outOfLineSize());
- }
+ ASSERT(!butterfly == (!structure->outOfLineCapacity() && !hasIndexingHeader(structure->indexingType())));
setStructure(globalData, structure);
- m_outOfLineStorage.set(globalData, this, storage);
+ m_butterfly = butterfly;
+}
+
+inline void JSObject::setButterflyWithoutChangingStructure(Butterfly* butterfly)
+{
+ m_butterfly = butterfly;
}
inline JSObject* constructEmptyObject(ExecState* exec, Structure* structure)
@@ -537,9 +813,9 @@ inline JSObject* asObject(JSValue value)
return asObject(value.asCell());
}
-inline JSObject::JSObject(JSGlobalData& globalData, Structure* structure)
+inline JSObject::JSObject(JSGlobalData& globalData, Structure* structure, Butterfly* butterfly)
: JSCell(globalData, structure)
- , m_outOfLineStorage(globalData, this, 0)
+ , m_butterfly(butterfly)
{
}
@@ -587,15 +863,17 @@ inline JSObject* JSValue::toThisObject(ExecState* exec) const
ALWAYS_INLINE bool JSObject::inlineGetOwnPropertySlot(ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
- if (WriteBarrierBase<Unknown>* location = getDirectLocation(exec->globalData(), propertyName)) {
- if (structure()->hasGetterSetterProperties() && location->isGetterSetter())
- fillGetterPropertySlot(slot, location);
+ PropertyOffset offset = structure()->get(exec->globalData(), propertyName);
+ if (LIKELY(isValidOffset(offset))) {
+ JSValue value = getDirectOffset(offset);
+ if (structure()->hasGetterSetterProperties() && value.isGetterSetter())
+ fillGetterPropertySlot(slot, offset);
else
- slot.setValue(this, location->get(), offsetForLocation(location));
+ slot.setValue(this, value, offset);
return true;
}
- return false;
+ return getOwnPropertySlotSlow(exec, propertyName, slot);
}
// It may seem crazy to inline a function this large, especially a virtual function,
@@ -681,6 +959,7 @@ inline bool JSObject::putDirectInternal(JSGlobalData& globalData, PropertyName p
ASSERT(value);
ASSERT(value.isGetterSetter() == !!(attributes & Accessor));
ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(this));
+ ASSERT(propertyName.asIndex() == PropertyName::NotAnIndex);
if (structure()->isDictionary()) {
unsigned currentAttributes;
@@ -709,11 +988,11 @@ inline bool JSObject::putDirectInternal(JSGlobalData& globalData, PropertyName p
if ((mode == PutModePut) && !isExtensible())
return false;
- PropertyStorage newStorage = outOfLineStorage();
+ Butterfly* newButterfly = m_butterfly;
if (structure()->putWillGrowOutOfLineStorage())
- newStorage = growOutOfLineStorage(globalData, structure()->outOfLineCapacity(), structure()->suggestedNewOutOfLineStorageCapacity());
+ newButterfly = growOutOfLineStorage(globalData, structure()->outOfLineCapacity(), structure()->suggestedNewOutOfLineStorageCapacity());
offset = structure()->addPropertyWithoutTransition(globalData, propertyName, attributes, specificFunction);
- setOutOfLineStorage(globalData, newStorage, structure());
+ setButterfly(globalData, newButterfly, structure());
validateOffset(offset);
ASSERT(structure()->isValidOffset(offset));
@@ -727,13 +1006,13 @@ inline bool JSObject::putDirectInternal(JSGlobalData& globalData, PropertyName p
PropertyOffset offset;
size_t currentCapacity = structure()->outOfLineCapacity();
if (Structure* structure = Structure::addPropertyTransitionToExistingStructure(this->structure(), propertyName, attributes, specificFunction, offset)) {
- PropertyStorage newStorage = outOfLineStorage();
+ Butterfly* newButterfly = m_butterfly;
if (currentCapacity != structure->outOfLineCapacity())
- newStorage = growOutOfLineStorage(globalData, currentCapacity, structure->outOfLineCapacity());
+ newButterfly = growOutOfLineStorage(globalData, currentCapacity, structure->outOfLineCapacity());
validateOffset(offset);
ASSERT(structure->isValidOffset(offset));
- setOutOfLineStorage(globalData, newStorage, structure);
+ setButterfly(globalData, newButterfly, structure);
putDirectOffset(globalData, offset, value);
// This is a new property; transitions with specific values are not currently cachable,
// so leave the slot in an uncachable state.
@@ -800,9 +1079,9 @@ inline void JSObject::setStructureAndReallocateStorageIfNecessary(JSGlobalData&
return;
}
- PropertyStorage newStorage = growOutOfLineStorage(
+ Butterfly* newButterfly = growOutOfLineStorage(
globalData, oldCapacity, newStructure->outOfLineCapacity());
- setOutOfLineStorage(globalData, newStorage, newStructure);
+ setButterfly(globalData, newButterfly, newStructure);
}
inline void JSObject::setStructureAndReallocateStorageIfNecessary(JSGlobalData& globalData, Structure* newStructure)
@@ -836,11 +1115,11 @@ inline void JSObject::putDirect(JSGlobalData& globalData, PropertyName propertyN
inline void JSObject::putDirectWithoutTransition(JSGlobalData& globalData, PropertyName propertyName, JSValue value, unsigned attributes)
{
ASSERT(!value.isGetterSetter() && !(attributes & Accessor));
- PropertyStorage newStorage = outOfLineStorage();
+ Butterfly* newButterfly = m_butterfly;
if (structure()->putWillGrowOutOfLineStorage())
- newStorage = growOutOfLineStorage(globalData, structure()->outOfLineCapacity(), structure()->suggestedNewOutOfLineStorageCapacity());
+ newButterfly = growOutOfLineStorage(globalData, structure()->outOfLineCapacity(), structure()->suggestedNewOutOfLineStorageCapacity());
PropertyOffset offset = structure()->addPropertyWithoutTransition(globalData, propertyName, attributes, getCallableObject(value));
- setOutOfLineStorage(globalData, newStorage, structure());
+ setButterfly(globalData, newButterfly, structure());
putDirectOffset(globalData, offset, value);
}
@@ -932,6 +1211,11 @@ ALWAYS_INLINE Register Register::withCallee(JSObject* callee)
return r;
}
+inline size_t offsetInButterfly(PropertyOffset offset)
+{
+ return offsetInOutOfLineStorage(offset) + Butterfly::indexOfPropertyStorage();
+}
+
// This is a helper for patching code where you want to emit a load or store and
// the base is:
// For inline offsets: a pointer to the out-of-line storage pointer.
@@ -939,14 +1223,14 @@ ALWAYS_INLINE Register Register::withCallee(JSObject* callee)
inline size_t offsetRelativeToPatchedStorage(PropertyOffset offset)
{
if (isOutOfLineOffset(offset))
- return sizeof(EncodedJSValue) * offsetInOutOfLineStorage(offset);
- return JSObject::offsetOfInlineStorage() - JSObject::offsetOfOutOfLineStorage() + sizeof(EncodedJSValue) * offsetInInlineStorage(offset);
+ return sizeof(EncodedJSValue) * offsetInButterfly(offset);
+ return JSObject::offsetOfInlineStorage() - JSObject::butterflyOffset() + sizeof(EncodedJSValue) * offsetInInlineStorage(offset);
}
inline int indexRelativeToBase(PropertyOffset offset)
{
if (isOutOfLineOffset(offset))
- return offsetInOutOfLineStorage(offset);
+ return offsetInOutOfLineStorage(offset) + Butterfly::indexOfPropertyStorage();
ASSERT(!(JSObject::offsetOfInlineStorage() % sizeof(EncodedJSValue)));
return JSObject::offsetOfInlineStorage() / sizeof(EncodedJSValue) + offsetInInlineStorage(offset);
}
@@ -954,7 +1238,7 @@ inline int indexRelativeToBase(PropertyOffset offset)
inline int offsetRelativeToBase(PropertyOffset offset)
{
if (isOutOfLineOffset(offset))
- return offsetInOutOfLineStorage(offset) * sizeof(EncodedJSValue);
+ return offsetInOutOfLineStorage(offset) * sizeof(EncodedJSValue) + Butterfly::offsetOfPropertyStorage();
return JSObject::offsetOfInlineStorage() + offsetInInlineStorage(offset) * sizeof(EncodedJSValue);
}
diff --git a/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp b/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp
index b1376c5e8..897ceff8c 100644
--- a/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp
+++ b/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp
@@ -67,6 +67,9 @@ JSPropertyNameIterator* JSPropertyNameIterator::create(ExecState* exec, JSObject
if (o->structure()->typeInfo().overridesGetPropertyNames())
return jsPropertyNameIterator;
+ if (hasIndexingHeader(o->structure()->indexingType()))
+ return jsPropertyNameIterator;
+
size_t count = normalizePrototypeChain(exec, o);
StructureChain* structureChain = o->structure()->prototypeChain(exec);
WriteBarrier<Structure>* structure = structureChain->head();
diff --git a/Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp b/Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp
index 72caa33db..765e1d3d4 100644
--- a/Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp
@@ -56,7 +56,7 @@ bool JSSymbolTableObject::deleteProperty(JSCell* cell, ExecState* exec, Property
return JSObject::deleteProperty(thisObject, exec, propertyName);
}
-void JSSymbolTableObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
+void JSSymbolTableObject::getOwnNonIndexPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
JSSymbolTableObject* thisObject = jsCast<JSSymbolTableObject*>(object);
SymbolTable::const_iterator end = thisObject->symbolTable()->end();
@@ -65,7 +65,7 @@ void JSSymbolTableObject::getOwnPropertyNames(JSObject* object, ExecState* exec,
propertyNames.add(Identifier(exec, it->first.get()));
}
- JSObject::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
+ JSObject::getOwnNonIndexPropertyNames(thisObject, exec, propertyNames, mode);
}
void JSSymbolTableObject::putDirectVirtual(JSObject*, ExecState*, PropertyName, JSValue, unsigned)
diff --git a/Source/JavaScriptCore/runtime/JSSymbolTableObject.h b/Source/JavaScriptCore/runtime/JSSymbolTableObject.h
index 1913d018b..b4d313c19 100644
--- a/Source/JavaScriptCore/runtime/JSSymbolTableObject.h
+++ b/Source/JavaScriptCore/runtime/JSSymbolTableObject.h
@@ -44,22 +44,23 @@ public:
static NO_RETURN_DUE_TO_ASSERT void putDirectVirtual(JSObject*, ExecState*, PropertyName, JSValue, unsigned attributes);
JS_EXPORT_PRIVATE static bool deleteProperty(JSCell*, ExecState*, PropertyName);
- JS_EXPORT_PRIVATE static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
+ JS_EXPORT_PRIVATE static void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
protected:
static const unsigned StructureFlags = IsEnvironmentRecord | OverridesVisitChildren | OverridesGetPropertyNames | Base::StructureFlags;
- JSSymbolTableObject(JSGlobalData& globalData, Structure* structure, JSScope* scope)
+ JSSymbolTableObject(JSGlobalData& globalData, Structure* structure, JSScope* scope, SharedSymbolTable* symbolTable = 0)
: Base(globalData, structure, scope)
{
+ if (symbolTable)
+ m_symbolTable.set(globalData, this, symbolTable);
}
- void finishCreation(JSGlobalData& globalData, SharedSymbolTable* symbolTable = 0)
+ void finishCreation(JSGlobalData& globalData)
{
Base::finishCreation(globalData);
- if (!symbolTable)
- symbolTable = SharedSymbolTable::create(globalData);
- m_symbolTable.set(globalData, this, symbolTable);
+ if (!m_symbolTable)
+ m_symbolTable.set(globalData, this, SharedSymbolTable::create(globalData));
}
static void visitChildren(JSCell*, SlotVisitor&);
diff --git a/Source/JavaScriptCore/runtime/JSTypeInfo.h b/Source/JavaScriptCore/runtime/JSTypeInfo.h
index 8c62fa166..d9b3585a0 100644
--- a/Source/JavaScriptCore/runtime/JSTypeInfo.h
+++ b/Source/JavaScriptCore/runtime/JSTypeInfo.h
@@ -42,9 +42,10 @@ namespace JSC {
static const unsigned ImplementsDefaultHasInstance = 1 << 3;
static const unsigned IsEnvironmentRecord = 1 << 4;
static const unsigned OverridesGetOwnPropertySlot = 1 << 5;
- static const unsigned OverridesVisitChildren = 1 << 6;
- static const unsigned OverridesGetPropertyNames = 1 << 7;
- static const unsigned ProhibitsPropertyCaching = 1 << 8;
+ static const unsigned InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero = 1 << 6;
+ static const unsigned OverridesVisitChildren = 1 << 7;
+ static const unsigned OverridesGetPropertyNames = 1 << 8;
+ static const unsigned ProhibitsPropertyCaching = 1 << 9;
class TypeInfo {
public:
@@ -75,8 +76,9 @@ namespace JSC {
bool overridesHasInstance() const { return isSetOnFlags1(OverridesHasInstance); }
bool implementsDefaultHasInstance() const { return isSetOnFlags1(ImplementsDefaultHasInstance); }
bool overridesGetOwnPropertySlot() const { return isSetOnFlags1(OverridesGetOwnPropertySlot); }
+ bool interceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero() const { return isSetOnFlags1(InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero); }
bool overridesVisitChildren() const { return isSetOnFlags1(OverridesVisitChildren); }
- bool overridesGetPropertyNames() const { return isSetOnFlags1(OverridesGetPropertyNames); }
+ bool overridesGetPropertyNames() const { return isSetOnFlags2(OverridesGetPropertyNames); }
bool prohibitsPropertyCaching() const { return isSetOnFlags2(ProhibitsPropertyCaching); }
static ptrdiff_t flagsOffset()
diff --git a/Source/JavaScriptCore/runtime/JSVariableObject.h b/Source/JavaScriptCore/runtime/JSVariableObject.h
index c9f989e68..55952820e 100644
--- a/Source/JavaScriptCore/runtime/JSVariableObject.h
+++ b/Source/JavaScriptCore/runtime/JSVariableObject.h
@@ -60,19 +60,14 @@ namespace JSC {
JSGlobalData& globalData,
Structure* structure,
Register* registers,
- JSScope* scope
+ JSScope* scope,
+ SharedSymbolTable* symbolTable = 0
)
- : Base(globalData, structure, scope)
+ : Base(globalData, structure, scope, symbolTable)
, m_registers(reinterpret_cast<WriteBarrierBase<Unknown>*>(registers))
{
}
- void finishCreation(JSGlobalData& globalData, SharedSymbolTable* symbolTable = 0)
- {
- Base::finishCreation(globalData, symbolTable);
- COMPILE_ASSERT(sizeof(WriteBarrierBase<Unknown>) == sizeof(Register), Register_should_be_same_size_as_WriteBarrierBase);
- }
-
WriteBarrierBase<Unknown>* m_registers; // "r" in the register file.
};
diff --git a/Source/JavaScriptCore/runtime/LiteralParser.cpp b/Source/JavaScriptCore/runtime/LiteralParser.cpp
index 30a478d48..732d818bd 100644
--- a/Source/JavaScriptCore/runtime/LiteralParser.cpp
+++ b/Source/JavaScriptCore/runtime/LiteralParser.cpp
@@ -27,6 +27,8 @@
#include "config.h"
#include "LiteralParser.h"
+#include "ButterflyInlineMethods.h"
+#include "CopiedSpaceInlineMethods.h"
#include "JSArray.h"
#include "JSString.h"
#include "Lexer.h"
@@ -640,7 +642,13 @@ JSValue LiteralParser<CharType>::parse(ParserState initialState)
}
case DoParseObjectEndExpression:
{
- asObject(objectStack.last())->putDirect(m_exec->globalData(), identifierStack.last(), lastValue);
+ JSObject* object = asObject(objectStack.last());
+ PropertyName ident = identifierStack.last();
+ unsigned i = ident.asIndex();
+ if (i != PropertyName::NotAnIndex)
+ object->putDirectIndex(m_exec, i, lastValue);
+ else
+ object->putDirect(m_exec->globalData(), ident, lastValue);
identifierStack.removeLast();
if (m_lexer.currentToken().type == TokComma)
goto doParseObjectStartExpression;
diff --git a/Source/JavaScriptCore/runtime/ObjectConstructor.cpp b/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
index ed0d0cfc7..5ac2d8788 100644
--- a/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
+++ b/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
@@ -21,6 +21,8 @@
#include "config.h"
#include "ObjectConstructor.h"
+#include "ButterflyInlineMethods.h"
+#include "CopiedSpaceInlineMethods.h"
#include "Error.h"
#include "ExceptionHelpers.h"
#include "JSFunction.h"
diff --git a/Source/JavaScriptCore/runtime/ObjectPrototype.cpp b/Source/JavaScriptCore/runtime/ObjectPrototype.cpp
index 800909385..84c60a69c 100644
--- a/Source/JavaScriptCore/runtime/ObjectPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/ObjectPrototype.cpp
@@ -67,7 +67,6 @@ ASSERT_CLASS_FITS_IN_CELL(ObjectPrototype);
ObjectPrototype::ObjectPrototype(ExecState* exec, Structure* stucture)
: JSNonFinalObject(exec->globalData(), stucture)
- , m_hasNoPropertiesWithUInt32Names(true)
{
}
@@ -77,34 +76,6 @@ void ObjectPrototype::finishCreation(JSGlobalData& globalData, JSGlobalObject*)
ASSERT(inherits(&s_info));
}
-void ObjectPrototype::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
-{
- ObjectPrototype* thisObject = jsCast<ObjectPrototype*>(cell);
- Base::put(cell, exec, propertyName, value, slot);
-
- if (thisObject->m_hasNoPropertiesWithUInt32Names && propertyName.asIndex() != PropertyName::NotAnIndex)
- thisObject->m_hasNoPropertiesWithUInt32Names = false;
-}
-
-bool ObjectPrototype::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor, bool shouldThrow)
-{
- ObjectPrototype* thisObject = jsCast<ObjectPrototype*>(object);
- bool result = Base::defineOwnProperty(object, exec, propertyName, descriptor, shouldThrow);
-
- if (thisObject->m_hasNoPropertiesWithUInt32Names && propertyName.asIndex() != PropertyName::NotAnIndex)
- thisObject->m_hasNoPropertiesWithUInt32Names = false;
-
- return result;
-}
-
-bool ObjectPrototype::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
-{
- ObjectPrototype* thisObject = jsCast<ObjectPrototype*>(cell);
- if (thisObject->m_hasNoPropertiesWithUInt32Names)
- return false;
- return Base::getOwnPropertySlotByIndex(thisObject, exec, propertyName, slot);
-}
-
bool ObjectPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
{
return getStaticFunctionSlot<JSNonFinalObject>(exec, ExecState::objectPrototypeTable(exec), jsCast<ObjectPrototype*>(cell), propertyName, slot);
diff --git a/Source/JavaScriptCore/runtime/ObjectPrototype.h b/Source/JavaScriptCore/runtime/ObjectPrototype.h
index d46cb91c3..e3551d6fd 100644
--- a/Source/JavaScriptCore/runtime/ObjectPrototype.h
+++ b/Source/JavaScriptCore/runtime/ObjectPrototype.h
@@ -50,14 +50,8 @@ namespace JSC {
private:
ObjectPrototype(ExecState*, Structure*);
- static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
- static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool shouldThrow);
-
static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
- static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
-
- bool m_hasNoPropertiesWithUInt32Names;
};
JS_EXPORT_PRIVATE EncodedJSValue JSC_HOST_CALL objectProtoFuncToString(ExecState*);
diff --git a/Source/JavaScriptCore/runtime/PropertyOffset.h b/Source/JavaScriptCore/runtime/PropertyOffset.h
index aa82eb468..2aea2981e 100644
--- a/Source/JavaScriptCore/runtime/PropertyOffset.h
+++ b/Source/JavaScriptCore/runtime/PropertyOffset.h
@@ -118,7 +118,7 @@ inline size_t offsetInOutOfLineStorage(PropertyOffset offset)
{
validateOffset(offset);
ASSERT(isOutOfLineOffset(offset));
- return -static_cast<ptrdiff_t>(offset - firstOutOfLineOffset) - 2;
+ return -static_cast<ptrdiff_t>(offset - firstOutOfLineOffset) - 1;
}
inline size_t offsetInRespectiveStorage(PropertyOffset offset)
diff --git a/Source/JavaScriptCore/runtime/StorageBarrier.h b/Source/JavaScriptCore/runtime/PropertyStorage.h
index 1fae82091..3d7bb020c 100644
--- a/Source/JavaScriptCore/runtime/StorageBarrier.h
+++ b/Source/JavaScriptCore/runtime/PropertyStorage.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,10 +23,9 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef StorageBarrier_h
-#define StorageBarrier_h
+#ifndef PropertyStorage_h
+#define PropertyStorage_h
-#include "JSGlobalData.h"
#include "WriteBarrier.h"
namespace JSC {
@@ -34,45 +33,7 @@ namespace JSC {
typedef WriteBarrierBase<Unknown>* PropertyStorage;
typedef const WriteBarrierBase<Unknown>* ConstPropertyStorage;
-class StorageBarrier {
-public:
- enum UncheckedTag { Unchecked };
- StorageBarrier(JSGlobalData& globalData, JSCell* owner, PropertyStorage storage)
- {
- set(globalData, owner, storage);
- }
-
- StorageBarrier(PropertyStorage storage, UncheckedTag)
- {
- set(storage, Unchecked);
- }
-
- void set(JSGlobalData&, JSCell*, PropertyStorage newStorage)
- {
- m_storage = newStorage;
- }
-
- void set(PropertyStorage newStorage, UncheckedTag)
- {
- m_storage = newStorage;
- }
-
- WriteBarrierBase<Unknown>* operator->() const { return m_storage; }
- WriteBarrierBase<Unknown>* operator->() { return m_storage; }
- WriteBarrierBase<Unknown> operator*() const { return *m_storage; }
- WriteBarrierBase<Unknown> operator*() { return *m_storage; }
- const WriteBarrierBase<Unknown>& operator[](size_t i) const { return m_storage[i]; }
- WriteBarrierBase<Unknown>& operator[](size_t i) { return m_storage[i]; }
-
- ConstPropertyStorage get() const { return m_storage; }
- PropertyStorage get() { return m_storage; }
+} // namespace JSC
- bool operator!() { return !m_storage; }
-
-private:
- PropertyStorage m_storage;
-};
+#endif // PropertyStorage_h
-}
-
-#endif
diff --git a/Source/JavaScriptCore/runtime/PutDirectIndexMode.h b/Source/JavaScriptCore/runtime/PutDirectIndexMode.h
new file mode 100644
index 000000000..3eb3f5818
--- /dev/null
+++ b/Source/JavaScriptCore/runtime/PutDirectIndexMode.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2011, 2012 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 PutDirectIndexMode_h
+#define PutDirectIndexMode_h
+
+namespace JSC {
+
+enum PutDirectIndexMode { PutDirectIndexLikePutDirect, PutDirectIndexShouldNotThrow, PutDirectIndexShouldThrow };
+
+} // namespace JSC
+
+#endif // PutDirectIndexMode_h
+
diff --git a/Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp b/Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp
index b2c3027b5..ed8aace66 100644
--- a/Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp
+++ b/Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp
@@ -26,15 +26,37 @@
#include "config.h"
#include "RegExpMatchesArray.h"
+#include "ButterflyInlineMethods.h"
+#include "SparseArrayValueMapInlineMethods.h"
+
namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(RegExpMatchesArray);
const ClassInfo RegExpMatchesArray::s_info = {"Array", &JSArray::s_info, 0, 0, CREATE_METHOD_TABLE(RegExpMatchesArray)};
+RegExpMatchesArray::RegExpMatchesArray(JSGlobalData& globalData, Butterfly* butterfly, JSGlobalObject* globalObject, JSString* input, RegExp* regExp, MatchResult result)
+ : JSArray(globalData, globalObject->regExpMatchesArrayStructure(), butterfly)
+ , m_result(result)
+ , m_state(ReifiedNone)
+{
+ m_input.set(globalData, this, input);
+ m_regExp.set(globalData, this, regExp);
+}
+
+RegExpMatchesArray* RegExpMatchesArray::create(ExecState* exec, JSString* input, RegExp* regExp, MatchResult result)
+{
+ ASSERT(result);
+ JSGlobalData& globalData = exec->globalData();
+ Butterfly* butterfly = createArrayButterfly(globalData, regExp->numSubpatterns() + 1);
+ RegExpMatchesArray* array = new (NotNull, allocateCell<RegExpMatchesArray>(globalData.heap)) RegExpMatchesArray(globalData, butterfly, exec->lexicalGlobalObject(), input, regExp, result);
+ array->finishCreation(globalData);
+ return array;
+}
+
void RegExpMatchesArray::finishCreation(JSGlobalData& globalData)
{
- Base::finishCreation(globalData, m_regExp->numSubpatterns() + 1);
+ Base::finishCreation(globalData);
}
void RegExpMatchesArray::visitChildren(JSCell* cell, SlotVisitor& visitor)
diff --git a/Source/JavaScriptCore/runtime/RegExpMatchesArray.h b/Source/JavaScriptCore/runtime/RegExpMatchesArray.h
index f26411f5f..a5b860b9d 100644
--- a/Source/JavaScriptCore/runtime/RegExpMatchesArray.h
+++ b/Source/JavaScriptCore/runtime/RegExpMatchesArray.h
@@ -28,28 +28,14 @@ namespace JSC {
class RegExpMatchesArray : public JSArray {
private:
- RegExpMatchesArray(JSGlobalData& globalData, JSGlobalObject* globalObject, JSString* input, RegExp* regExp, MatchResult result)
- : JSArray(globalData, globalObject->regExpMatchesArrayStructure())
- , m_result(result)
- , m_state(ReifiedNone)
- {
- m_input.set(globalData, this, input);
- m_regExp.set(globalData, this, regExp);
- }
+ RegExpMatchesArray(JSGlobalData&, Butterfly*, JSGlobalObject*, JSString*, RegExp*, MatchResult);
enum ReifiedState { ReifiedNone, ReifiedMatch, ReifiedAll };
public:
typedef JSArray Base;
- static RegExpMatchesArray* create(ExecState* exec, JSString* input, RegExp* regExp, MatchResult result)
- {
- ASSERT(result);
- JSGlobalData& globalData = exec->globalData();
- RegExpMatchesArray* array = new (NotNull, allocateCell<RegExpMatchesArray>(globalData.heap)) RegExpMatchesArray(globalData, exec->lexicalGlobalObject(), input, regExp, result);
- array->finishCreation(globalData);
- return array;
- }
+ static RegExpMatchesArray* create(ExecState*, JSString*, RegExp*, MatchResult);
JSString* leftContext(ExecState*);
JSString* rightContext(ExecState*);
@@ -58,7 +44,7 @@ namespace JSC {
static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
{
- return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info);
+ return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info, ArrayWithArrayStorage);
}
static void visitChildren(JSCell*, SlotVisitor&);
diff --git a/Source/JavaScriptCore/runtime/RegExpObject.cpp b/Source/JavaScriptCore/runtime/RegExpObject.cpp
index b346c7769..bed44f22c 100644
--- a/Source/JavaScriptCore/runtime/RegExpObject.cpp
+++ b/Source/JavaScriptCore/runtime/RegExpObject.cpp
@@ -21,6 +21,8 @@
#include "config.h"
#include "RegExpObject.h"
+#include "ButterflyInlineMethods.h"
+#include "CopiedSpaceInlineMethods.h"
#include "Error.h"
#include "ExceptionHelpers.h"
#include "JSArray.h"
@@ -113,11 +115,11 @@ bool RegExpObject::deleteProperty(JSCell* cell, ExecState* exec, PropertyName pr
return Base::deleteProperty(cell, exec, propertyName);
}
-void RegExpObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
+void RegExpObject::getOwnNonIndexPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
if (mode == IncludeDontEnumProperties)
propertyNames.add(exec->propertyNames().lastIndex);
- Base::getOwnPropertyNames(object, exec, propertyNames, mode);
+ Base::getOwnNonIndexPropertyNames(object, exec, propertyNames, mode);
}
void RegExpObject::getPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
diff --git a/Source/JavaScriptCore/runtime/RegExpObject.h b/Source/JavaScriptCore/runtime/RegExpObject.h
index d1df2b202..f43d6bc79 100644
--- a/Source/JavaScriptCore/runtime/RegExpObject.h
+++ b/Source/JavaScriptCore/runtime/RegExpObject.h
@@ -90,7 +90,7 @@ namespace JSC {
static void visitChildren(JSCell*, SlotVisitor&);
JS_EXPORT_PRIVATE static bool deleteProperty(JSCell*, ExecState*, PropertyName);
- JS_EXPORT_PRIVATE static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
+ JS_EXPORT_PRIVATE static void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
JS_EXPORT_PRIVATE static void getPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
JS_EXPORT_PRIVATE static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool shouldThrow);
diff --git a/Source/JavaScriptCore/runtime/Reject.h b/Source/JavaScriptCore/runtime/Reject.h
new file mode 100644
index 000000000..7f1a5db4d
--- /dev/null
+++ b/Source/JavaScriptCore/runtime/Reject.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2012 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 Reject_h
+#define Reject_h
+
+#include "CallFrame.h"
+#include "Error.h"
+
+namespace JSC {
+
+inline bool reject(ExecState* exec, bool throwException, const char* message)
+{
+ if (throwException)
+ throwTypeError(exec, message);
+ return false;
+}
+
+} // namespace JSC
+
+#endif // Reject_h
+
diff --git a/Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp b/Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp
new file mode 100644
index 000000000..40c4ed26e
--- /dev/null
+++ b/Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2011, 2012 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.
+ */
+
+#include "config.h"
+#include "SparseArrayValueMap.h"
+
+#include "ClassInfo.h"
+#include "SparseArrayValueMapInlineMethods.h"
+
+namespace JSC {
+
+const ClassInfo SparseArrayValueMap::s_info = { "SparseArrayValueMap", 0, 0, 0, CREATE_METHOD_TABLE(SparseArrayValueMap) };
+
+} // namespace JSC
+
diff --git a/Source/JavaScriptCore/runtime/SparseArrayValueMap.h b/Source/JavaScriptCore/runtime/SparseArrayValueMap.h
new file mode 100644
index 000000000..aafdf974f
--- /dev/null
+++ b/Source/JavaScriptCore/runtime/SparseArrayValueMap.h
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2011, 2012 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 SparseArrayValueMap_h
+#define SparseArrayValueMap_h
+
+#include "JSCell.h"
+#include "JSTypeInfo.h"
+#include "PropertyDescriptor.h"
+#include "PutDirectIndexMode.h"
+#include "WriteBarrier.h"
+#include <wtf/HashMap.h>
+#include <wtf/Platform.h>
+
+namespace JSC {
+
+struct SparseArrayEntry : public WriteBarrier<Unknown> {
+ typedef WriteBarrier<Unknown> Base;
+
+ SparseArrayEntry() : attributes(0) { }
+
+ JSValue get(ExecState*, JSObject*) const;
+ void get(PropertySlot&) const;
+ void get(PropertyDescriptor&) const;
+ JSValue getNonSparseMode() const;
+
+ unsigned attributes;
+};
+
+class SparseArrayValueMap : public JSCell {
+public:
+ typedef JSCell Base;
+
+private:
+ typedef HashMap<uint64_t, SparseArrayEntry, WTF::IntHash<uint64_t>, WTF::UnsignedWithZeroKeyHashTraits<uint64_t> > Map;
+
+ enum Flags {
+ Normal = 0,
+ SparseMode = 1,
+ LengthIsReadOnly = 2,
+ };
+
+ SparseArrayValueMap(JSGlobalData&);
+ ~SparseArrayValueMap();
+
+ void finishCreation(JSGlobalData&);
+
+ static const unsigned StructureFlags = OverridesVisitChildren | JSCell::StructureFlags;
+
+public:
+ static JS_EXPORTDATA const ClassInfo s_info;
+
+ typedef Map::iterator iterator;
+ typedef Map::const_iterator const_iterator;
+ typedef Map::AddResult AddResult;
+
+ static SparseArrayValueMap* create(JSGlobalData&);
+
+ static void destroy(JSCell*);
+
+ static Structure* createStructure(JSGlobalData&, JSGlobalObject*, JSValue prototype);
+
+ static void visitChildren(JSCell*, SlotVisitor&);
+
+ bool sparseMode()
+ {
+ return m_flags & SparseMode;
+ }
+
+ void setSparseMode()
+ {
+ m_flags = static_cast<Flags>(m_flags | SparseMode);
+ }
+
+ bool lengthIsReadOnly()
+ {
+ return m_flags & LengthIsReadOnly;
+ }
+
+ void setLengthIsReadOnly()
+ {
+ m_flags = static_cast<Flags>(m_flags | LengthIsReadOnly);
+ }
+
+ // These methods may mutate the contents of the map
+ void putEntry(ExecState*, JSObject*, unsigned, JSValue, bool shouldThrow);
+ bool putDirect(ExecState*, JSObject*, unsigned, JSValue, unsigned attributes, PutDirectIndexMode);
+ AddResult add(JSObject*, unsigned);
+ iterator find(unsigned i) { return m_map.find(i); }
+ // This should ASSERT the remove is valid (check the result of the find).
+ void remove(iterator it) { m_map.remove(it); }
+ void remove(unsigned i) { m_map.remove(i); }
+
+ // These methods do not mutate the contents of the map.
+ iterator notFound() { return m_map.end(); }
+ bool isEmpty() const { return m_map.isEmpty(); }
+ bool contains(unsigned i) const { return m_map.contains(i); }
+ size_t size() const { return m_map.size(); }
+ // Only allow const begin/end iteration.
+ const_iterator begin() const { return m_map.begin(); }
+ const_iterator end() const { return m_map.end(); }
+
+private:
+ Map m_map;
+ Flags m_flags;
+ size_t m_reportedCapacity;
+};
+
+} // namespace JSC
+
+#endif // SparseArrayValueMap_h
+
diff --git a/Source/JavaScriptCore/runtime/SparseArrayValueMapInlineMethods.h b/Source/JavaScriptCore/runtime/SparseArrayValueMapInlineMethods.h
new file mode 100644
index 000000000..f3ef32f46
--- /dev/null
+++ b/Source/JavaScriptCore/runtime/SparseArrayValueMapInlineMethods.h
@@ -0,0 +1,203 @@
+/*
+ * Copyright (C) 2011, 2012 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 SparseArrayValueMapInlineMethods_h
+#define SparseArrayValueMapInlineMethods_h
+
+#include "GetterSetter.h"
+#include "Reject.h"
+#include "SparseArrayValueMap.h"
+
+namespace JSC {
+
+inline SparseArrayValueMap::SparseArrayValueMap(JSGlobalData& globalData)
+ : Base(globalData, globalData.sparseArrayValueMapStructure.get())
+ , m_flags(Normal)
+ , m_reportedCapacity(0)
+{
+}
+
+inline SparseArrayValueMap::~SparseArrayValueMap()
+{
+}
+
+inline void SparseArrayValueMap::finishCreation(JSGlobalData& globalData)
+{
+ Base::finishCreation(globalData);
+}
+
+inline SparseArrayValueMap* SparseArrayValueMap::create(JSGlobalData& globalData)
+{
+ SparseArrayValueMap* result = new (NotNull, allocateCell<SparseArrayValueMap>(globalData.heap)) SparseArrayValueMap(globalData);
+ result->finishCreation(globalData);
+ return result;
+}
+
+inline void SparseArrayValueMap::destroy(JSCell* cell)
+{
+ static_cast<SparseArrayValueMap*>(cell)->SparseArrayValueMap::~SparseArrayValueMap();
+}
+
+inline Structure* SparseArrayValueMap::createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
+{
+ return Structure::create(globalData, globalObject, prototype, TypeInfo(CompoundType, StructureFlags), &s_info);
+}
+
+inline SparseArrayValueMap::AddResult SparseArrayValueMap::add(JSObject* array, unsigned i)
+{
+ SparseArrayEntry entry;
+ entry.setWithoutWriteBarrier(jsUndefined());
+
+ AddResult result = m_map.add(i, entry);
+ size_t capacity = m_map.capacity();
+ if (capacity != m_reportedCapacity) {
+ Heap::heap(array)->reportExtraMemoryCost((capacity - m_reportedCapacity) * (sizeof(unsigned) + sizeof(WriteBarrier<Unknown>)));
+ m_reportedCapacity = capacity;
+ }
+ return result;
+}
+
+inline void SparseArrayValueMap::putEntry(ExecState* exec, JSObject* array, unsigned i, JSValue value, bool shouldThrow)
+{
+ AddResult result = add(array, i);
+ SparseArrayEntry& entry = result.iterator->second;
+
+ // To save a separate find & add, we first always add to the sparse map.
+ // In the uncommon case that this is a new property, and the array is not
+ // extensible, this is not the right thing to have done - so remove again.
+ if (result.isNewEntry && !array->isExtensible()) {
+ remove(result.iterator);
+ if (shouldThrow)
+ throwTypeError(exec, StrictModeReadonlyPropertyWriteError);
+ return;
+ }
+
+ if (!(entry.attributes & Accessor)) {
+ if (entry.attributes & ReadOnly) {
+ if (shouldThrow)
+ throwTypeError(exec, StrictModeReadonlyPropertyWriteError);
+ return;
+ }
+
+ entry.set(exec->globalData(), this, value);
+ return;
+ }
+
+ JSValue accessor = entry.SparseArrayEntry::Base::get();
+ ASSERT(accessor.isGetterSetter());
+ JSObject* setter = asGetterSetter(accessor)->setter();
+
+ if (!setter) {
+ if (shouldThrow)
+ throwTypeError(exec, StrictModeReadonlyPropertyWriteError);
+ return;
+ }
+
+ CallData callData;
+ CallType callType = setter->methodTable()->getCallData(setter, callData);
+ MarkedArgumentBuffer args;
+ args.append(value);
+ call(exec, setter, callType, callData, array, args);
+}
+
+inline bool SparseArrayValueMap::putDirect(ExecState* exec, JSObject* array, unsigned i, JSValue value, unsigned attributes, PutDirectIndexMode mode)
+{
+ AddResult result = add(array, i);
+ SparseArrayEntry& entry = result.iterator->second;
+
+ // To save a separate find & add, we first always add to the sparse map.
+ // In the uncommon case that this is a new property, and the array is not
+ // extensible, this is not the right thing to have done - so remove again.
+ if (mode != PutDirectIndexLikePutDirect && result.isNewEntry && !array->isExtensible()) {
+ remove(result.iterator);
+ return reject(exec, mode == PutDirectIndexShouldThrow, "Attempting to define property on object that is not extensible.");
+ }
+
+ entry.attributes = attributes;
+ entry.set(exec->globalData(), this, value);
+ return true;
+}
+
+inline void SparseArrayEntry::get(PropertySlot& slot) const
+{
+ JSValue value = Base::get();
+ ASSERT(value);
+
+ if (LIKELY(!value.isGetterSetter())) {
+ slot.setValue(value);
+ return;
+ }
+
+ JSObject* getter = asGetterSetter(value)->getter();
+ if (!getter) {
+ slot.setUndefined();
+ return;
+ }
+
+ slot.setGetterSlot(getter);
+}
+
+inline void SparseArrayEntry::get(PropertyDescriptor& descriptor) const
+{
+ descriptor.setDescriptor(Base::get(), attributes);
+}
+
+inline JSValue SparseArrayEntry::get(ExecState* exec, JSObject* array) const
+{
+ JSValue result = Base::get();
+ ASSERT(result);
+
+ if (LIKELY(!result.isGetterSetter()))
+ return result;
+
+ JSObject* getter = asGetterSetter(result)->getter();
+ if (!getter)
+ return jsUndefined();
+
+ CallData callData;
+ CallType callType = getter->methodTable()->getCallData(getter, callData);
+ return call(exec, getter, callType, callData, array, exec->emptyList());
+}
+
+inline JSValue SparseArrayEntry::getNonSparseMode() const
+{
+ ASSERT(!attributes);
+ return Base::get();
+}
+
+inline void SparseArrayValueMap::visitChildren(JSCell* thisObject, SlotVisitor& visitor)
+{
+ Base::visitChildren(thisObject, visitor);
+
+ SparseArrayValueMap* thisMap = jsCast<SparseArrayValueMap*>(thisObject);
+ iterator end = thisMap->m_map.end();
+ for (iterator it = thisMap->m_map.begin(); it != end; ++it)
+ visitor.append(&it->second);
+}
+
+} // namespace JSC
+
+#endif // SparseArrayValueMapInlineMethods_h
+
diff --git a/Source/JavaScriptCore/runtime/StringObject.cpp b/Source/JavaScriptCore/runtime/StringObject.cpp
index 113dee165..15900913d 100644
--- a/Source/JavaScriptCore/runtime/StringObject.cpp
+++ b/Source/JavaScriptCore/runtime/StringObject.cpp
@@ -78,6 +78,17 @@ void StringObject::put(JSCell* cell, ExecState* exec, PropertyName propertyName,
JSObject::put(cell, exec, propertyName, value, slot);
}
+void StringObject::putByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, JSValue value, bool shouldThrow)
+{
+ StringObject* thisObject = jsCast<StringObject*>(cell);
+ if (thisObject->internalValue()->canGetIndex(propertyName)) {
+ if (shouldThrow)
+ throwTypeError(exec, StrictModeReadonlyPropertyWriteError);
+ return;
+ }
+ JSObject::putByIndex(cell, exec, propertyName, value, shouldThrow);
+}
+
bool StringObject::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor, bool throwException)
{
StringObject* thisObject = jsCast<StringObject*>(object);
@@ -133,6 +144,14 @@ bool StringObject::deleteProperty(JSCell* cell, ExecState* exec, PropertyName pr
return JSObject::deleteProperty(thisObject, exec, propertyName);
}
+bool StringObject::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned i)
+{
+ StringObject* thisObject = jsCast<StringObject*>(cell);
+ if (thisObject->internalValue()->canGetIndex(i))
+ return false;
+ return JSObject::deletePropertyByIndex(thisObject, exec, i);
+}
+
void StringObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
StringObject* thisObject = jsCast<StringObject*>(object);
diff --git a/Source/JavaScriptCore/runtime/StringObject.h b/Source/JavaScriptCore/runtime/StringObject.h
index f0c445e91..4369eace1 100644
--- a/Source/JavaScriptCore/runtime/StringObject.h
+++ b/Source/JavaScriptCore/runtime/StringObject.h
@@ -50,8 +50,10 @@ namespace JSC {
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
+ static void putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue, bool shouldThrow);
static bool deleteProperty(JSCell*, ExecState*, PropertyName);
+ static bool deletePropertyByIndex(JSCell*, ExecState*, unsigned propertyName);
static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool shouldThrow);
@@ -66,7 +68,7 @@ namespace JSC {
protected:
JS_EXPORT_PRIVATE void finishCreation(JSGlobalData&, JSString*);
- static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSWrapperObject::StructureFlags;
+ static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | OverridesGetPropertyNames | JSWrapperObject::StructureFlags;
JS_EXPORT_PRIVATE StringObject(JSGlobalData&, Structure*);
};
diff --git a/Source/JavaScriptCore/runtime/StringPrototype.cpp b/Source/JavaScriptCore/runtime/StringPrototype.cpp
index 73633a60b..8daa0f335 100644
--- a/Source/JavaScriptCore/runtime/StringPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/StringPrototype.cpp
@@ -22,7 +22,9 @@
#include "config.h"
#include "StringPrototype.h"
+#include "ButterflyInlineMethods.h"
#include "CachedCall.h"
+#include "CopiedSpaceInlineMethods.h"
#include "Error.h"
#include "Executable.h"
#include "JSGlobalObjectFunctions.h"
diff --git a/Source/JavaScriptCore/runtime/Structure.cpp b/Source/JavaScriptCore/runtime/Structure.cpp
index 4c8ee8741..c99c6dda4 100644
--- a/Source/JavaScriptCore/runtime/Structure.cpp
+++ b/Source/JavaScriptCore/runtime/Structure.cpp
@@ -149,9 +149,10 @@ void Structure::dumpStatistics()
#endif
}
-Structure::Structure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype, const TypeInfo& typeInfo, const ClassInfo* classInfo)
+Structure::Structure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype, const TypeInfo& typeInfo, const ClassInfo* classInfo, IndexingType indexingType)
: JSCell(globalData, globalData.structureStructure.get())
, m_typeInfo(typeInfo)
+ , m_indexingType(indexingType)
, m_globalObject(globalData, this, globalObject, WriteBarrier<JSGlobalObject>::MayBeNull)
, m_prototype(globalData, this, prototype)
, m_classInfo(classInfo)
@@ -176,6 +177,7 @@ const ClassInfo Structure::s_info = { "Structure", 0, 0, 0, CREATE_METHOD_TABLE(
Structure::Structure(JSGlobalData& globalData)
: JSCell(CreatingEarlyCell)
, m_typeInfo(CompoundType, OverridesVisitChildren)
+ , m_indexingType(0)
, m_prototype(globalData, this, jsNull())
, m_classInfo(&s_info)
, m_transitionWatchpointSet(InitializedWatching)
@@ -197,6 +199,7 @@ Structure::Structure(JSGlobalData& globalData)
Structure::Structure(JSGlobalData& globalData, const Structure* previous)
: JSCell(globalData, globalData.structureStructure.get())
, m_typeInfo(previous->typeInfo())
+ , m_indexingType(previous->indexingTypeIncludingHistory())
, m_prototype(globalData, this, previous->storedPrototype())
, m_classInfo(previous->m_classInfo)
, m_transitionWatchpointSet(InitializedWatching)
@@ -251,6 +254,8 @@ void Structure::materializePropertyMap(JSGlobalData& globalData)
for (ptrdiff_t i = structures.size() - 2; i >= 0; --i) {
structure = structures[i];
+ if (!structure->m_nameInPrevious)
+ continue;
PropertyMapEntry entry(globalData, this, structure->m_nameInPrevious.get(), structure->m_offset, structure->m_attributesInPrevious, structure->m_specificValueInPrevious.get());
m_propertyTable->add(entry);
}
@@ -502,6 +507,38 @@ Structure* Structure::preventExtensionsTransition(JSGlobalData& globalData, Stru
return transition;
}
+Structure* Structure::nonPropertyTransition(JSGlobalData& globalData, Structure* structure, NonPropertyTransition transitionKind)
+{
+ unsigned attributes = toAttributes(transitionKind);
+ IndexingType indexingType = newIndexingType(structure->indexingTypeIncludingHistory(), transitionKind);
+
+ if (Structure* existingTransition = structure->m_transitionTable.get(0, attributes)) {
+ ASSERT(existingTransition->m_attributesInPrevious == attributes);
+ ASSERT(existingTransition->indexingTypeIncludingHistory() == indexingType);
+ return existingTransition;
+ }
+
+ Structure* transition = create(globalData, structure);
+ transition->m_previous.set(globalData, transition, structure);
+ transition->m_attributesInPrevious = attributes;
+ transition->m_indexingType = indexingType;
+
+ if (structure->m_propertyTable) {
+ if (structure->m_isPinnedPropertyTable)
+ transition->m_propertyTable = structure->m_propertyTable->copy(globalData, transition, structure->m_propertyTable->size() + 1);
+ else
+ transition->m_propertyTable = structure->m_propertyTable.release();
+ } else {
+ if (structure->m_previous)
+ transition->materializePropertyMap(globalData);
+ else
+ transition->createPropertyMap();
+ }
+
+ structure->m_transitionTable.add(globalData, transition);
+ return transition;
+}
+
// In future we may want to cache this property.
bool Structure::isSealed(JSGlobalData& globalData)
{
diff --git a/Source/JavaScriptCore/runtime/Structure.h b/Source/JavaScriptCore/runtime/Structure.h
index 73ec0789e..9303a0dbb 100644
--- a/Source/JavaScriptCore/runtime/Structure.h
+++ b/Source/JavaScriptCore/runtime/Structure.h
@@ -27,6 +27,7 @@
#define Structure_h
#include "ClassInfo.h"
+#include "IndexingType.h"
#include "JSCell.h"
#include "JSType.h"
#include "JSValue.h"
@@ -68,7 +69,7 @@ namespace JSC {
typedef JSCell Base;
- static Structure* create(JSGlobalData&, JSGlobalObject*, JSValue prototype, const TypeInfo&, const ClassInfo*);
+ static Structure* create(JSGlobalData&, JSGlobalObject*, JSValue prototype, const TypeInfo&, const ClassInfo*, IndexingType = 0);
protected:
void finishCreation(JSGlobalData& globalData)
@@ -100,6 +101,7 @@ namespace JSC {
static Structure* sealTransition(JSGlobalData&, Structure*);
static Structure* freezeTransition(JSGlobalData&, Structure*);
static Structure* preventExtensionsTransition(JSGlobalData&, Structure*);
+ static Structure* nonPropertyTransition(JSGlobalData&, Structure*, NonPropertyTransition);
bool isSealed(JSGlobalData&);
bool isFrozen(JSGlobalData&);
@@ -140,6 +142,8 @@ namespace JSC {
const TypeInfo& typeInfo() const { ASSERT(structure()->classInfo() == &s_info); return m_typeInfo; }
bool isObject() const { return typeInfo().isObject(); }
+ IndexingType indexingType() const { return m_indexingType & AllArrayTypes; }
+ IndexingType indexingTypeIncludingHistory() const { return m_indexingType; }
JSGlobalObject* globalObject() const { return m_globalObject.get(); }
void setGlobalObject(JSGlobalData& globalData, JSGlobalObject* globalObject) { m_globalObject.set(globalData, this, globalObject); }
@@ -334,6 +338,11 @@ namespace JSC {
{
return OBJECT_OFFSETOF(Structure, m_classInfo);
}
+
+ static ptrdiff_t indexingTypeOffset()
+ {
+ return OBJECT_OFFSETOF(Structure, m_indexingType);
+ }
static Structure* createStructure(JSGlobalData&);
@@ -363,7 +372,7 @@ namespace JSC {
private:
friend class LLIntOffsetsExtractor;
- JS_EXPORT_PRIVATE Structure(JSGlobalData&, JSGlobalObject*, JSValue prototype, const TypeInfo&, const ClassInfo*);
+ JS_EXPORT_PRIVATE Structure(JSGlobalData&, JSGlobalObject*, JSValue prototype, const TypeInfo&, const ClassInfo*, IndexingType = 0);
Structure(JSGlobalData&);
Structure(JSGlobalData&, const Structure*);
@@ -416,6 +425,7 @@ namespace JSC {
static const unsigned maxSpecificFunctionThrashCount = 3;
TypeInfo m_typeInfo;
+ IndexingType m_indexingType;
WriteBarrier<JSGlobalObject> m_globalObject;
WriteBarrier<Unknown> m_prototype;
@@ -447,7 +457,7 @@ namespace JSC {
bool m_hasGetterSetterProperties : 1;
bool m_hasReadOnlyOrGetterSetterPropertiesExcludingProto : 1;
bool m_hasNonEnumerableProperties : 1;
- unsigned m_attributesInPrevious : 7;
+ unsigned m_attributesInPrevious : 22;
unsigned m_specificFunctionThrashCount : 2;
unsigned m_preventExtensions : 1;
unsigned m_didTransition : 1;
@@ -465,11 +475,11 @@ namespace JSC {
return result;
}
- inline Structure* Structure::create(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype, const TypeInfo& typeInfo, const ClassInfo* classInfo)
+ inline Structure* Structure::create(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype, const TypeInfo& typeInfo, const ClassInfo* classInfo, IndexingType indexingType)
{
ASSERT(globalData.structureStructure);
ASSERT(classInfo);
- Structure* structure = new (NotNull, allocateCell<Structure>(globalData.heap)) Structure(globalData, globalObject, prototype, typeInfo, classInfo);
+ Structure* structure = new (NotNull, allocateCell<Structure>(globalData.heap)) Structure(globalData, globalObject, prototype, typeInfo, classInfo, indexingType);
structure->finishCreation(globalData);
return structure;
}
diff --git a/Source/JavaScriptCore/runtime/StructureTransitionTable.h b/Source/JavaScriptCore/runtime/StructureTransitionTable.h
index 7c9d50894..59e7e94f3 100644
--- a/Source/JavaScriptCore/runtime/StructureTransitionTable.h
+++ b/Source/JavaScriptCore/runtime/StructureTransitionTable.h
@@ -26,6 +26,7 @@
#ifndef StructureTransitionTable_h
#define StructureTransitionTable_h
+#include "IndexingType.h"
#include "WeakGCMap.h"
#include <wtf/HashFunctions.h>
#include <wtf/OwnPtr.h>
@@ -37,6 +38,30 @@ namespace JSC {
class JSCell;
class Structure;
+static const unsigned FirstInternalAttribute = 1 << 6; // Use for transitions that don't have to do with property additions.
+
+// Support for attributes used to indicate transitions not related to properties.
+// If any of these are used, the string portion of the key should be 0.
+enum NonPropertyTransition {
+ AllocateArrayStorage
+};
+
+inline unsigned toAttributes(NonPropertyTransition transition)
+{
+ return transition + FirstInternalAttribute;
+}
+
+inline IndexingType newIndexingType(IndexingType oldType, NonPropertyTransition transition)
+{
+ switch (transition) {
+ case AllocateArrayStorage:
+ return oldType | HasArrayStorage;
+ default:
+ ASSERT_NOT_REACHED();
+ return oldType;
+ }
+}
+
class StructureTransitionTable {
static const intptr_t UsingSingleSlotFlag = 1;
@@ -44,7 +69,10 @@ class StructureTransitionTable {
typedef std::pair<RefPtr<StringImpl>, unsigned> Key;
static unsigned hash(const Key& p)
{
- return p.first->existingHash();
+ unsigned result = p.second;
+ if (p.first)
+ result += p.first->existingHash();
+ return result;
}
static bool equal(const Key& a, const Key& b)
diff --git a/Source/JavaScriptCore/runtime/SymbolTable.h b/Source/JavaScriptCore/runtime/SymbolTable.h
index 08ea8c163..f6f70c6b9 100644
--- a/Source/JavaScriptCore/runtime/SymbolTable.h
+++ b/Source/JavaScriptCore/runtime/SymbolTable.h
@@ -340,13 +340,45 @@ namespace JSC {
return Structure::create(globalData, globalObject, prototype, TypeInfo(LeafType, StructureFlags), &s_info);
}
+ bool usesNonStrictEval() { return m_usesNonStrictEval; }
+ void setUsesNonStrictEval(bool usesNonStrictEval) { m_usesNonStrictEval = usesNonStrictEval; }
+
+ enum CaptureMode {
+ SomeOfTheThings,
+ AllOfTheThings
+ };
+
+ CaptureMode captureMode() { return m_captureMode; }
+ void setCaptureMode(CaptureMode captureMode) { m_captureMode = captureMode; }
+
+ int captureStart() { return m_captureStart; }
+ void setCaptureStart(int captureStart) { m_captureStart = captureStart; }
+
+ int captureEnd() { return m_captureEnd; }
+ void setCaptureEnd(int captureEnd) { m_captureEnd = captureEnd; }
+
+ int parameterCountIncludingThis() { return m_parameterCountIncludingThis; }
+ void setParameterCountIncludingThis(int parameterCountIncludingThis) { m_parameterCountIncludingThis = parameterCountIncludingThis; }
+
static JS_EXPORTDATA const ClassInfo s_info;
private:
SharedSymbolTable(JSGlobalData& globalData)
: JSCell(globalData, globalData.sharedSymbolTableStructure.get())
+ , m_parameterCountIncludingThis(0)
+ , m_usesNonStrictEval(false)
+ , m_captureMode(SomeOfTheThings)
+ , m_captureStart(0)
+ , m_captureEnd(0)
{
}
+
+ int m_parameterCountIncludingThis;
+ bool m_usesNonStrictEval;
+
+ CaptureMode m_captureMode;
+ int m_captureStart;
+ int m_captureEnd;
};
} // namespace JSC
diff --git a/Source/JavaScriptCore/shell/PlatformBlackBerry.cmake b/Source/JavaScriptCore/shell/PlatformBlackBerry.cmake
index 4271148c6..aff77caf7 100644
--- a/Source/JavaScriptCore/shell/PlatformBlackBerry.cmake
+++ b/Source/JavaScriptCore/shell/PlatformBlackBerry.cmake
@@ -1,3 +1,4 @@
+FIND_STAGING_LIBRARY(SLOG2_LIBRARY slog2)
LIST(APPEND JSC_LIBRARIES
${ICUI18N_LIBRARY}
${ICUUC_LIBRARY}
@@ -6,6 +7,7 @@ LIST(APPEND JSC_LIBRARIES
${Screen_LIBRARY}
${Skia_QNX_LIBRARY}
${WebKitPlatform_LIBRARY}
+ ${SLOG2_LIBRARY}
)
IF (PROFILING)
diff --git a/Source/JavaScriptCore/tests/mozilla/js1_6/Array/regress-304828.js b/Source/JavaScriptCore/tests/mozilla/js1_6/Array/regress-304828.js
index fb751e555..4cc3a94a1 100644
--- a/Source/JavaScriptCore/tests/mozilla/js1_6/Array/regress-304828.js
+++ b/Source/JavaScriptCore/tests/mozilla/js1_6/Array/regress-304828.js
@@ -60,7 +60,7 @@ reportCompare(expect, actual, summary + ': join');
// reverse
value = '123';
-expect = '123';
+expect = 'TypeError: Attempted to assign to readonly property.';
try
{
actual = Array.prototype.reverse.call(value) + '';
@@ -73,7 +73,7 @@ reportCompare(expect, actual, summary + ': reverse');
// sort
value = 'cba';
-expect = 'cba';
+expect = 'TypeError: Attempted to assign to readonly property.';
try
{
actual = Array.prototype.sort.call(value) + '';
@@ -114,7 +114,7 @@ reportCompare('abc', value, summary + ': pop');
// unshift
value = 'def';
-expect = 6;
+expect = "TypeError: Attempted to assign to readonly property.";
try
{
actual = Array.prototype.unshift.call(value, 'a', 'b', 'c');
@@ -128,7 +128,7 @@ reportCompare('def', value, summary + ': unshift');
// shift
value = 'abc';
-expect = 'TypeError: Unable to delete property.';
+expect = 'TypeError: Attempted to assign to readonly property.';
try
{
actual = Array.prototype.shift.call(value);
@@ -142,7 +142,7 @@ reportCompare('abc', value, summary + ': shift');
// splice
value = 'abc';
-expect = 'TypeError: Unable to delete property.';
+expect = 'TypeError: Attempted to assign to readonly property.';
try
{
actual = Array.prototype.splice.call(value, 1, 1) + '';