Commit 3291fd4d authored by olehougaard's avatar olehougaard

Writing snapshot.cc in a form that can be compiled by the crosstool compiler.

Changed a cast that caused alignment problems on ARM.
Review URL: http://codereview.chromium.org/18312

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1098 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 49d93349
...@@ -128,9 +128,9 @@ static int WriteInternalSnapshotToFile(const char* filename, ...@@ -128,9 +128,9 @@ static int WriteInternalSnapshotToFile(const char* filename,
fprintf(f, "namespace v8 {\nnamespace internal {\n\n"); fprintf(f, "namespace v8 {\nnamespace internal {\n\n");
fprintf(f, "const char Snapshot::data_[] = {"); fprintf(f, "const char Snapshot::data_[] = {");
int written = 0; int written = 0;
written += fprintf(f, "%i", str[0]); written += fprintf(f, "0x%x", str[0]);
for (int i = 1; i < size; ++i) { for (int i = 1; i < size; ++i) {
written += fprintf(f, ",%i", str[i]); written += fprintf(f, ",0x%x", str[i]);
// The following is needed to keep the line length low on Visual C++: // The following is needed to keep the line length low on Visual C++:
if (i % 512 == 0) fprintf(f, "\n"); if (i % 512 == 0) fprintf(f, "\n");
} }
......
...@@ -225,8 +225,8 @@ class SnapshotReader { ...@@ -225,8 +225,8 @@ class SnapshotReader {
} }
int GetInt() { int GetInt() {
int result = *reinterpret_cast<const int*>(str_); int result;
str_ += sizeof(result); GetBytes(reinterpret_cast<byte*>(&result), sizeof(result));
return result; return result;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment