summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h')
-rw-r--r--JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h25
1 files changed, 6 insertions, 19 deletions
diff --git a/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h b/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h
index af3c3be..f15b7f3 100644
--- a/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h
+++ b/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h
@@ -34,8 +34,6 @@
#include "AssemblerBuffer.h"
#include <wtf/SegmentedVector.h>
-#define ASSEMBLER_HAS_CONSTANT_POOL 1
-
namespace JSC {
/*
@@ -86,7 +84,7 @@ namespace JSC {
template <int maxPoolSize, int barrierSize, int maxInstructionSize, class AssemblerType>
class AssemblerBufferWithConstantPool: public AssemblerBuffer {
- typedef SegmentedVector<uint32_t, 512> LoadOffsets;
+ typedef WTF::SegmentedVector<uint32_t, 512> LoadOffsets;
public:
enum {
UniqueConst,
@@ -179,11 +177,6 @@ public:
return AssemblerBuffer::size();
}
- int uncheckedSize()
- {
- return AssemblerBuffer::size();
- }
-
void* executableCopy(ExecutablePool* allocator)
{
flushConstantPool(false);
@@ -214,10 +207,10 @@ public:
}
// This flushing mechanism can be called after any unconditional jumps.
- void flushWithoutBarrier(bool isForced = false)
+ void flushWithoutBarrier()
{
// Flush if constant pool is more than 60% full to avoid overuse of this function.
- if (isForced || 5 * m_numConsts > 3 * maxPoolSize / sizeof(uint32_t))
+ if (5 * m_numConsts > 3 * maxPoolSize / sizeof(uint32_t))
flushConstantPool(false);
}
@@ -226,11 +219,6 @@ public:
return m_pool;
}
- int sizeOfConstantPool()
- {
- return m_numConsts;
- }
-
private:
void correctDeltas(int insnSize)
{
@@ -288,8 +276,7 @@ private:
{
if (m_numConsts == 0)
return;
- int lastConstDelta = m_lastConstDelta > nextInsnSize ? m_lastConstDelta - nextInsnSize : 0;
- if ((m_maxDistance < nextInsnSize + lastConstDelta + barrierSize + (int)sizeof(uint32_t)))
+ if ((m_maxDistance < nextInsnSize + m_lastConstDelta + barrierSize + (int)sizeof(uint32_t)))
flushConstantPool();
}
@@ -297,8 +284,8 @@ private:
{
if (m_numConsts == 0)
return;
- if ((m_maxDistance < nextInsnSize + m_lastConstDelta + nextConstSize + barrierSize + (int)sizeof(uint32_t)) ||
- (m_numConsts * sizeof(uint32_t) + nextConstSize >= maxPoolSize))
+ if ((m_maxDistance < nextInsnSize + m_lastConstDelta + barrierSize + (int)sizeof(uint32_t)) ||
+ (m_numConsts + nextConstSize / sizeof(uint32_t) >= maxPoolSize))
flushConstantPool();
}