[VM interpreter] Fix broken interpreter build.

Change-Id: I1a877f22605874c6a199e2cab53b068a54383927
Reviewed-on: https://dart-review.googlesource.com/61910
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
index 78c755a..633f263 100644
--- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
+++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
@@ -1369,14 +1369,14 @@
 }
 
 RawCode* BytecodeMetadataHelper::ReadBytecode(const ObjectPool& pool) {
-  // TODO(regis): Avoid copying bytecode from mapped kernel binary.
   intptr_t size = builder_->reader_.ReadUInt();
   intptr_t offset = builder_->reader_.offset();
   const uint8_t* data = builder_->reader_.BufferAt(offset);
   builder_->reader_.set_offset(offset + size);
 
   // Create and return code object.
-  return Code::FinalizeBytecode(reinterpret_cast<void*>(data), size, pool);
+  return Code::FinalizeBytecode(reinterpret_cast<const void*>(data), size,
+                                pool);
 }
 
 void BytecodeMetadataHelper::ReadExceptionsTable(const Code& bytecode) {
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 3a7b5c8..1aa4b52 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -14828,7 +14828,7 @@
 #endif  // !defined(DART_PRECOMPILED_RUNTIME)
 
 #if defined(DART_USE_INTERPRETER)
-RawCode* Code::FinalizeBytecode(void* bytecode_data,
+RawCode* Code::FinalizeBytecode(const void* bytecode_data,
                                 intptr_t bytecode_size,
                                 const ObjectPool& object_pool,
                                 CodeStatistics* stats /* = nullptr */) {
@@ -14845,7 +14845,7 @@
   // Copy the bytecode data into the instruction area. No fixups to apply.
   MemoryRegion instrs_region(reinterpret_cast<void*>(instrs.PayloadStart()),
                              instrs.Size());
-  MemoryRegion bytecode_region(bytecode_data, bytecode_size);
+  MemoryRegion bytecode_region(const_cast<void*>(bytecode_data), bytecode_size);
   // TODO(regis): Avoid copying bytecode.
   instrs_region.CopyFrom(0, bytecode_region);
 
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 9afaff3f..513d91c 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -4990,7 +4990,7 @@
                                bool optimized,
                                CodeStatistics* stats = nullptr);
 #if defined(DART_USE_INTERPRETER)
-  static RawCode* FinalizeBytecode(void* bytecode_data,
+  static RawCode* FinalizeBytecode(const void* bytecode_data,
                                    intptr_t bytecode_size,
                                    const ObjectPool& object_pool,
                                    CodeStatistics* stats = nullptr);