Diff
Modified: branches/ftlopt/Source/_javascript_Core/ChangeLog (171610 => 171611)
--- branches/ftlopt/Source/_javascript_Core/ChangeLog 2014-07-25 20:07:34 UTC (rev 171610)
+++ branches/ftlopt/Source/_javascript_Core/ChangeLog 2014-07-25 20:26:35 UTC (rev 171611)
@@ -1,3 +1,28 @@
+2014-07-25 Saam Barati <[email protected]>
+
+ Fix 32-bit build breakage for type profiling
+ https://bugs.webkit.org/process_bug.cgi
+
+ Reviewed by Mark Hahnenberg.
+
+ 32-bit builds currently break because global variable IDs for high
+ fidelity type profiling are int64_t. Change this to intptr_t so that
+ it's 32 bits on 32-bit platforms and 64 bits on 64-bit platforms.
+
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::CodeBlock):
+ (JSC::CodeBlock::scopeDependentProfile):
+ * bytecode/TypeLocation.h:
+ * runtime/SymbolTable.cpp:
+ (JSC::SymbolTable::uniqueIDForVariable):
+ (JSC::SymbolTable::uniqueIDForRegister):
+ * runtime/SymbolTable.h:
+ * runtime/TypeLocationCache.cpp:
+ (JSC::TypeLocationCache::getTypeLocation):
+ * runtime/TypeLocationCache.h:
+ * runtime/VM.h:
+ (JSC::VM::getNextUniqueVariableID):
+
2014-07-25 Mark Hahnenberg <[email protected]>
Reindent PropertyNameArray.h
Modified: branches/ftlopt/Source/_javascript_Core/bytecode/CodeBlock.cpp (171610 => 171611)
--- branches/ftlopt/Source/_javascript_Core/bytecode/CodeBlock.cpp 2014-07-25 20:07:34 UTC (rev 171610)
+++ branches/ftlopt/Source/_javascript_Core/bytecode/CodeBlock.cpp 2014-07-25 20:26:35 UTC (rev 171611)
@@ -2057,7 +2057,7 @@
case op_profile_types_with_high_fidelity: {
size_t instructionOffset = i + opLength - 1;
unsigned divotStart, divotEnd;
- intptr_t globalVariableID;
+ GlobalVariableID globalVariableID;
RefPtr<TypeSet> globalTypeSet;
bool shouldAnalyze = m_unlinkedCode->highFidelityTypeProfileExpressionInfoForBytecodeOffset(instructionOffset, divotStart, divotEnd);
VirtualRegister virtualRegister(pc[1].u.operand);
@@ -3993,7 +3993,7 @@
{
unsigned divotStart, divotEnd;
bool shouldAnalyze = m_unlinkedCode->highFidelityTypeProfileExpressionInfoForBytecodeOffset(instructionOffset, divotStart, divotEnd);
- intptr_t globalVariableID;
+ GlobalVariableID globalVariableID;
RefPtr<TypeSet> globalTypeSet;
// FIXME: handle other values for op.type here, and also consider what to do when we can't statically determine the globalID
Modified: branches/ftlopt/Source/_javascript_Core/bytecode/TypeLocation.h (171610 => 171611)
--- branches/ftlopt/Source/_javascript_Core/bytecode/TypeLocation.h 2014-07-25 20:07:34 UTC (rev 171610)
+++ branches/ftlopt/Source/_javascript_Core/bytecode/TypeLocation.h 2014-07-25 20:26:35 UTC (rev 171611)
@@ -37,6 +37,8 @@
HighFidelityThisStatement = -4
};
+typedef intptr_t GlobalVariableID;
+
class TypeLocation {
public:
TypeLocation()
@@ -46,7 +48,7 @@
{
}
- int64_t m_globalVariableID;
+ GlobalVariableID m_globalVariableID;
intptr_t m_sourceID;
unsigned m_divotStart;
unsigned m_divotEnd;
Modified: branches/ftlopt/Source/_javascript_Core/runtime/SymbolTable.cpp (171610 => 171611)
--- branches/ftlopt/Source/_javascript_Core/runtime/SymbolTable.cpp 2014-07-25 20:07:34 UTC (rev 171610)
+++ branches/ftlopt/Source/_javascript_Core/runtime/SymbolTable.cpp 2014-07-25 20:26:35 UTC (rev 171611)
@@ -192,13 +192,13 @@
return result;
}
-int64_t SymbolTable::uniqueIDForVariable(const ConcurrentJITLocker&, StringImpl* key, VM& vm)
+GlobalVariableID SymbolTable::uniqueIDForVariable(const ConcurrentJITLocker&, StringImpl* key, VM& vm)
{
auto iter = m_uniqueIDMap->find(key);
auto end = m_uniqueIDMap->end();
ASSERT_UNUSED(end, iter != end);
- int64_t& id = iter->value;
+ GlobalVariableID& id = iter->value;
if (id == HighFidelityNeedsUniqueIDGeneration) {
id = vm.getNextUniqueVariableID();
m_uniqueTypeSetMap->set(key, TypeSet::create()); //make a new global typeset for the ID
@@ -207,7 +207,7 @@
return id;
}
-int64_t SymbolTable::uniqueIDForRegister(const ConcurrentJITLocker& locker, int registerIndex, VM& vm)
+GlobalVariableID SymbolTable::uniqueIDForRegister(const ConcurrentJITLocker& locker, int registerIndex, VM& vm)
{
auto iter = m_registerToVariableMap->find(registerIndex);
auto end = m_registerToVariableMap->end();
Modified: branches/ftlopt/Source/_javascript_Core/runtime/SymbolTable.h (171610 => 171611)
--- branches/ftlopt/Source/_javascript_Core/runtime/SymbolTable.h 2014-07-25 20:07:34 UTC (rev 171610)
+++ branches/ftlopt/Source/_javascript_Core/runtime/SymbolTable.h 2014-07-25 20:26:35 UTC (rev 171611)
@@ -337,7 +337,7 @@
typedef JSCell Base;
typedef HashMap<RefPtr<StringImpl>, SymbolTableEntry, IdentifierRepHash, HashTraits<RefPtr<StringImpl>>, SymbolTableIndexHashTraits> Map;
- typedef HashMap<RefPtr<StringImpl>, int64_t> UniqueIDMap;
+ typedef HashMap<RefPtr<StringImpl>, GlobalVariableID> UniqueIDMap;
typedef HashMap<RefPtr<StringImpl>, RefPtr<TypeSet>> UniqueTypeSetMap;
typedef HashMap<int, RefPtr<StringImpl>, WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int>> RegisterToVariableMap;
@@ -458,8 +458,8 @@
return contains(locker, key);
}
- int64_t uniqueIDForVariable(const ConcurrentJITLocker&, StringImpl* key, VM& vm);
- int64_t uniqueIDForRegister(const ConcurrentJITLocker& locker, int registerIndex, VM& vm);
+ GlobalVariableID uniqueIDForVariable(const ConcurrentJITLocker&, StringImpl* key, VM& vm);
+ GlobalVariableID uniqueIDForRegister(const ConcurrentJITLocker& locker, int registerIndex, VM& vm);
RefPtr<TypeSet> globalTypeSetForRegister(const ConcurrentJITLocker& locker, int registerIndex, VM& vm);
RefPtr<TypeSet> globalTypeSetForVariable(const ConcurrentJITLocker& locker, StringImpl* key, VM& vm);
Modified: branches/ftlopt/Source/_javascript_Core/runtime/TypeLocationCache.cpp (171610 => 171611)
--- branches/ftlopt/Source/_javascript_Core/runtime/TypeLocationCache.cpp 2014-07-25 20:07:34 UTC (rev 171610)
+++ branches/ftlopt/Source/_javascript_Core/runtime/TypeLocationCache.cpp 2014-07-25 20:26:35 UTC (rev 171611)
@@ -31,7 +31,7 @@
namespace JSC {
-std::pair<TypeLocation*, bool> TypeLocationCache::getTypeLocation(int64_t globalVariableID, intptr_t sourceID, unsigned start, unsigned end, PassRefPtr<TypeSet> globalTypeSet, VM* vm)
+std::pair<TypeLocation*, bool> TypeLocationCache::getTypeLocation(GlobalVariableID globalVariableID, intptr_t sourceID, unsigned start, unsigned end, PassRefPtr<TypeSet> globalTypeSet, VM* vm)
{
LocationKey key;
key.m_globalVariableID = globalVariableID;
Modified: branches/ftlopt/Source/_javascript_Core/runtime/TypeLocationCache.h (171610 => 171611)
--- branches/ftlopt/Source/_javascript_Core/runtime/TypeLocationCache.h 2014-07-25 20:07:34 UTC (rev 171610)
+++ branches/ftlopt/Source/_javascript_Core/runtime/TypeLocationCache.h 2014-07-25 20:26:35 UTC (rev 171611)
@@ -51,13 +51,13 @@
return m_globalVariableID + m_sourceID + m_start + m_end;
}
- int64_t m_globalVariableID;
+ GlobalVariableID m_globalVariableID;
intptr_t m_sourceID;
unsigned m_start;
unsigned m_end;
};
- std::pair<TypeLocation*, bool> getTypeLocation(int64_t, intptr_t, unsigned start, unsigned end, PassRefPtr<TypeSet>, VM*);
+ std::pair<TypeLocation*, bool> getTypeLocation(GlobalVariableID, intptr_t, unsigned start, unsigned end, PassRefPtr<TypeSet>, VM*);
private:
typedef std::unordered_map<LocationKey, TypeLocation*, HashMethod<LocationKey>> LocationMap;
LocationMap m_locationMap;
Modified: branches/ftlopt/Source/_javascript_Core/runtime/VM.h (171610 => 171611)
--- branches/ftlopt/Source/_javascript_Core/runtime/VM.h 2014-07-25 20:07:34 UTC (rev 171610)
+++ branches/ftlopt/Source/_javascript_Core/runtime/VM.h 2014-07-25 20:26:35 UTC (rev 171611)
@@ -521,7 +521,7 @@
HighFidelityTypeProfiler* highFidelityTypeProfiler() { return m_highFidelityTypeProfiler.get(); }
TypeLocation* nextLocation() { return m_locationInfo.add(); } //TODO: possible optmization: when codeblocks die, report which locations are no longer being changed so we don't walk over them
JS_EXPORT_PRIVATE void dumpHighFidelityProfilingTypes();
- int64_t getNextUniqueVariableID() { return m_nextUniqueVariableID++; }
+ GlobalVariableID getNextUniqueVariableID() { return m_nextUniqueVariableID++; }
private:
friend class LLIntOffsetsExtractor;
@@ -573,7 +573,7 @@
HashMap<String, RefPtr<WatchpointSet>> m_impurePropertyWatchpointSets;
std::unique_ptr<HighFidelityTypeProfiler> m_highFidelityTypeProfiler;
std::unique_ptr<HighFidelityLog> m_highFidelityLog;
- int64_t m_nextUniqueVariableID;
+ GlobalVariableID m_nextUniqueVariableID;
Bag<TypeLocation> m_locationInfo;
};