Skip to content

Commit

Permalink
[vm] Fix WriteByteSequence for simarm_x64
Browse files Browse the repository at this point in the history
Bug: #36839
Change-Id: Ibf9ffda6be7a6585d90b4fb1430ae0b227609af6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109482
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
  • Loading branch information
liamappelbe authored and commit-bot@chromium.org committed Jul 17, 2019
1 parent b4e66ed commit 6bf1f8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
13 changes: 6 additions & 7 deletions runtime/vm/image_snapshot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -811,8 +811,8 @@ void AssemblyImageWriter::FrameUnwindEpilogue() {
}

intptr_t AssemblyImageWriter::WriteByteSequence(uword start, uword end) {
for (uword* cursor = reinterpret_cast<uword*>(start);
cursor < reinterpret_cast<uword*>(end); cursor++) {
for (auto* cursor = reinterpret_cast<compiler::target::uword*>(start);
cursor < reinterpret_cast<compiler::target::uword*>(end); cursor++) {
WriteWordLiteralText(*cursor);
}
return end - start;
Expand Down Expand Up @@ -841,11 +841,10 @@ BlobImageWriter::BlobImageWriter(Thread* thread,
}

intptr_t BlobImageWriter::WriteByteSequence(uword start, uword end) {
for (uword* cursor = reinterpret_cast<uword*>(start);
cursor < reinterpret_cast<uword*>(end); cursor++) {
instructions_blob_stream_.WriteWord(*cursor);
}
return end - start;
const uword size = end - start;
instructions_blob_stream_.WriteBytes(reinterpret_cast<const void*>(start),
size);
return size;
}

void BlobImageWriter::WriteText(WriteStream* clustered_stream, bool vm) {
Expand Down
3 changes: 2 additions & 1 deletion runtime/vm/image_snapshot.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include "platform/assert.h"
#include "vm/allocation.h"
#include "vm/compiler/runtime_api.h"
#include "vm/datastream.h"
#include "vm/globals.h"
#include "vm/growable_array.h"
Expand Down Expand Up @@ -313,7 +314,7 @@ class AssemblyImageWriter : public ImageWriter {
void FrameUnwindPrologue();
void FrameUnwindEpilogue();
intptr_t WriteByteSequence(uword start, uword end);
void WriteWordLiteralText(uword value) {
void WriteWordLiteralText(compiler::target::uword value) {
// Padding is helpful for comparing the .S with --disassemble.
#if defined(TARGET_ARCH_IS_64_BIT)
assembly_stream_.Print(".quad 0x%0.16" Px "\n", value);
Expand Down

0 comments on commit 6bf1f8e

Please sign in to comment.