Reviewers: Mads Ager,

Description:
Writing snapshot.cc in a form that can be compiled by the crosstool
compiler.
Changed a cast that caused alignment problems on ARM.

Please review this at http://codereview.chromium.org/18312

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     src/mksnapshot.cc
   M     src/serialize.h


Index: src/serialize.h
===================================================================
--- src/serialize.h     (revision 1073)
+++ src/serialize.h     (working copy)
@@ -225,8 +225,8 @@
    }

    int GetInt() {
-    int result = *reinterpret_cast<const int*>(str_);
-    str_ += sizeof(result);
+    int result;
+    GetBytes(reinterpret_cast<byte*>(&result), sizeof(result));
      return result;
    }

Index: src/mksnapshot.cc
===================================================================
--- src/mksnapshot.cc   (revision 1073)
+++ src/mksnapshot.cc   (working copy)
@@ -128,9 +128,9 @@
    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");
    }



--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to