Writing snapshot.cc in a form that can be compiled by the crosstool compiler.
authorolehougaard <olehougaard@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 16 Jan 2009 14:12:56 +0000 (14:12 +0000)
committerolehougaard <olehougaard@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 16 Jan 2009 14:12:56 +0000 (14:12 +0000)
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

src/mksnapshot.cc
src/serialize.h

index 441ae18..24f244d 100644 (file)
@@ -128,9 +128,9 @@ static int WriteInternalSnapshotToFile(const char* filename,
   fprintf(f, "namespace v8 {\nnamespace internal {\n\n");
   fprintf(f, "const char Snapshot::data_[] = {");
   int written = 0;
-  written += fprintf(f, "%i", str[0]);
+  written += fprintf(f, "0x%x", str[0]);
   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++:
     if (i % 512 == 0) fprintf(f, "\n");
   }
index 0679ecc..45d1edf 100644 (file)
@@ -225,8 +225,8 @@ class SnapshotReader {
   }
 
   int GetInt() {
-    int result = *reinterpret_cast<const int*>(str_);
-    str_ += sizeof(result);
+    int result;
+    GetBytes(reinterpret_cast<byte*>(&result), sizeof(result));
     return result;
   }