Bug 1230005: Flush the assembler buffer at the end of asm.js compilation; r=luke
authorBenjamin Bouvier <benj@benj.me>
Wed, 23 Dec 2015 23:06:48 +0100
changeset 317592 b618547dc136d5469d05919236b7cd0e639d048f
parent 317591 b9bb3765e712e07dcd35a63f7aec9fd4e61fdd8a
child 317637 e32159281b0c63af8f2f1a693abcf33ade5034e8
push id8715
push userbenj@benj.me
push dateThu, 24 Dec 2015 10:28:38 +0000
reviewersluke
bugs1230005
milestone46.0a1
Bug 1230005: Flush the assembler buffer at the end of asm.js compilation; r=luke
js/src/jit/CodeGenerator.cpp
--- 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);