Reviewed by Maciej.
Fix "AllInOneFile.o has a global initializer in it".
Some versions of gcc generate a global initializer for std::numeric_limits<size_t>::max().
We can avoid this by moving it inside an inline function.
* kjs/SymbolTable.h:
(KJS::missingSymbolMarker):
* kjs/function.cpp:
(KJS::ActivationImp::getOwnPropertySlot):
(KJS::ActivationImp::put):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27198
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-10-28 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Maciej.
+
+ Fix "AllInOneFile.o has a global initializer in it".
+
+ Some versions of gcc generate a global initializer for std::numeric_limits<size_t>::max().
+ We can avoid this by moving it inside an inline function.
+
+ * kjs/SymbolTable.h:
+ (KJS::missingSymbolMarker):
+ * kjs/function.cpp:
+ (KJS::ActivationImp::getOwnPropertySlot):
+ (KJS::ActivationImp::put):
+
2007-10-28 Maciej Stachowiak <mjs@apple.com>
Reviewed by Mark.
#define SymbolTable_h
#include "property_map.h"
+#include "AlwaysInline.h"
namespace KJS {
static const bool safeToCompareToEmptyOrDeleted = true;
};
- static const size_t missingSymbolMarker = std::numeric_limits<size_t>::max();
+ static ALWAYS_INLINE size_t missingSymbolMarker() { return std::numeric_limits<size_t>::max(); }
struct SymbolTableIndexHashTraits {
typedef size_t TraitType;
typedef SymbolTableIndexHashTraits StorageTraits;
- static size_t emptyValue() { return missingSymbolMarker; }
+ static size_t emptyValue() { return missingSymbolMarker(); }
static const bool emptyValueIsZero = false;
static const bool needsDestruction = false;
static const bool needsRef = false;
// it's more efficient to just get and check for a special empty
// value than to do a separate contains check
size_t index = symbolTable->get(propertyName.ustring().rep());
- if (index != missingSymbolMarker) {
+ if (index != missingSymbolMarker()) {
slot.setValueSlot(this, &d->localStorage[index].value);
return true;
}
// it's more efficient to just get and check for a special empty
// value than to do a separate contains check
size_t index = symbolTable->get(propertyName.ustring().rep());
- if (index != missingSymbolMarker) {
+ if (index != missingSymbolMarker()) {
LocalStorageEntry& entry = d->localStorage[index];
entry.value = value;
entry.attributes = attr;