diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-03-10 14:45:46 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-03-10 14:46:25 +0100 |
commit | 1ee472207c63905ab4455e676ee3ffd3263ab2cb (patch) | |
tree | 5e00ee54aa0f963665e124c2e5ce6a6a554c484f /Source/JavaScriptCore/jit/JIT.cpp | |
parent | 5160ca54bb01b1d7bb0e6b359aa3d475df22e6f0 (diff) | |
parent | 650c6ee8e76bb574d3a1bea09e2494992d8f070e (diff) | |
download | qtwebkit-1ee472207c63905ab4455e676ee3ffd3263ab2cb.tar.gz |
Merge remote-tracking branch 'origin/5.4' into 5.5v5.5.0-alpha1
Change-Id: I824a984e8552340c2f9f631ac951f2c9eaa90b74
Diffstat (limited to 'Source/JavaScriptCore/jit/JIT.cpp')
-rw-r--r-- | Source/JavaScriptCore/jit/JIT.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/JavaScriptCore/jit/JIT.cpp b/Source/JavaScriptCore/jit/JIT.cpp index 8e003c782..9b46d8792 100644 --- a/Source/JavaScriptCore/jit/JIT.cpp +++ b/Source/JavaScriptCore/jit/JIT.cpp @@ -74,7 +74,7 @@ JIT::JIT(VM* vm, CodeBlock* codeBlock) : m_interpreter(vm->interpreter) , m_vm(vm) , m_codeBlock(codeBlock) - , m_labels(codeBlock ? codeBlock->numberOfInstructions() : 0) + , m_labels(0) , m_bytecodeOffset((unsigned)-1) , m_propertyAccessInstructionIndex(UINT_MAX) , m_byValInstructionIndex(UINT_MAX) @@ -96,6 +96,7 @@ JIT::JIT(VM* vm, CodeBlock* codeBlock) , m_shouldEmitProfiling(false) #endif { + m_labels.reserveCapacity(codeBlock ? codeBlock->numberOfInstructions() : 0); } #if ENABLE(DFG_JIT) @@ -174,6 +175,7 @@ void JIT::privateCompileMainPass() m_globalResolveInfoIndex = 0; m_callLinkInfoIndex = 0; + m_labels.resize(instructionCount); for (m_bytecodeOffset = 0; m_bytecodeOffset < instructionCount; ) { if (m_disassembler) @@ -694,6 +696,7 @@ JITCode JIT::privateCompile(CodePtr* functionEntryArityCheck, JITCompilationEffo if (patchBuffer.didFailToAllocate()) return JITCode(); + ASSERT(m_labels.size() >= m_codeBlock->instructionCount()); // Translate vPC offsets into addresses in JIT generated code, for switch tables. for (unsigned i = 0; i < m_switches.size(); ++i) { SwitchRecord record = m_switches[i]; |