[vm, bytecode] Fix vm/cc/CompileFunctionOnHelperThread.

Change-Id: I9358bef937642fdadce3922b7c481b3780f9f623
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107685
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This commit is contained in:
Ryan Macnak 2019-07-08 23:12:26 +00:00 committed by commit-bot@chromium.org
parent 4de495fccc
commit 572619b639

View file

@ -6,6 +6,7 @@
#include "platform/assert.h"
#include "vm/class_finalizer.h"
#include "vm/code_patcher.h"
#include "vm/compiler/frontend/bytecode_reader.h"
#include "vm/dart_api_impl.h"
#include "vm/heap/safepoint.h"
#include "vm/kernel_isolate.h"
@ -124,6 +125,9 @@ ISOLATE_UNIT_TEST_CASE(CompileFunctionOnHelperThread) {
EXPECT(func.HasCode());
return;
}
// Bytecode loading must happen on the main thread. Ensure the bytecode is
// loaded before asking for an unoptimized compile on a background thread.
kernel::BytecodeReader::ReadFunctionBytecode(thread, func);
#if !defined(PRODUCT)
// Constant in product mode.
FLAG_background_compilation = true;