]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - assembler/AssemblerBufferWithConstantPool.h
JavaScriptCore-1218.tar.gz
[apple/javascriptcore.git] / assembler / AssemblerBufferWithConstantPool.h
index cd9ff9c0ef43aacd592e933fa19af15d3c6b75a7..852f86df79835525c33b9a12e59116090733d79e 100644 (file)
@@ -83,7 +83,7 @@ namespace JSC {
 */
 
 template <int maxPoolSize, int barrierSize, int maxInstructionSize, class AssemblerType>
-class AssemblerBufferWithConstantPool: public AssemblerBuffer {
+class AssemblerBufferWithConstantPool : public AssemblerBuffer {
     typedef SegmentedVector<uint32_t, 512> LoadOffsets;
     using AssemblerBuffer::putIntegral;
     using AssemblerBuffer::putIntegralUnchecked;
@@ -127,9 +127,9 @@ public:
         AssemblerBuffer::ensureSpace(insnSpace);
     }
 
-    void ensureSpaceForAnyOneInstruction()
+    void ensureSpaceForAnyInstruction(int amount = 1)
     {
-        flushIfNoSpaceFor(maxInstructionSize, sizeof(uint64_t));
+        flushIfNoSpaceFor(amount * maxInstructionSize, amount * sizeof(uint64_t));
     }
 
     bool isAligned(int alignment)
@@ -195,10 +195,10 @@ public:
         putIntegralUnchecked(value.low);
     }
 
-    void* executableCopy(JSGlobalData& globalData, ExecutablePool* allocator)
+    PassRefPtr<ExecutableMemoryHandle> executableCopy(VM& vm, void* ownerUID, JITCompilationEffort effort)
     {
         flushConstantPool(false);
-        return AssemblerBuffer::executableCopy(globalData, allocator);
+        return AssemblerBuffer::executableCopy(vm, ownerUID, effort);
     }
 
     void putShortWithConstantInt(uint16_t insn, uint32_t constant, bool isReusable = false)
@@ -215,7 +215,7 @@ public:
     void flushWithoutBarrier(bool isForced = false)
     {
         // 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 (isForced || 5 * static_cast<uint32_t>(m_numConsts) > 3 * maxPoolSize / sizeof(uint32_t))
             flushConstantPool(false);
     }