Bug 1230005: Flush the assembler buffer at the end of asm.js compilation; r=luke
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -7912,16 +7912,20 @@ CodeGenerator::generateAsmJS(AsmJSFuncti
#if defined(JS_ION_PERF)
// Note the end of the inline code and start of the OOL code.
gen->perfSpewer().noteEndInlineCode(masm);
#endif
if (!generateOutOfLineCode())
return false;
+ // Flush constant pools now so that pool hints encoded in the code stream
+ // get converted into actual instructions.
+ masm.flushBuffer();
+
offsets->end = masm.currentOffset();
MOZ_ASSERT(!masm.failureLabel()->used());
MOZ_ASSERT(snapshots_.listSize() == 0);
MOZ_ASSERT(snapshots_.RVATableSize() == 0);
MOZ_ASSERT(recovers_.size() == 0);
MOZ_ASSERT(bailouts_.empty());
MOZ_ASSERT(graph.numConstants() == 0);