Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(870)

Unified Diff: src/mksnapshot.cc

Issue 18583: Change type of snapshot from char array to byte array to avoid portability pr... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/serialize.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mksnapshot.cc
===================================================================
--- src/mksnapshot.cc (revision 1142)
+++ src/mksnapshot.cc (working copy)
@@ -114,7 +114,7 @@
// Write C++ code that defines Snapshot::snapshot_ to contain the snapshot
// to the file given by filename. Only the first size chars are written.
static int WriteInternalSnapshotToFile(const char* filename,
- const char* str,
+ const v8::internal::byte* bytes,
int size) {
FILE* f = i::OS::FOpen(filename, "wb");
if (f == NULL) {
@@ -126,11 +126,11 @@
fprintf(f, "#include \"platform.h\"\n\n");
fprintf(f, "#include \"snapshot.h\"\n\n");
fprintf(f, "namespace v8 {\nnamespace internal {\n\n");
- fprintf(f, "const char Snapshot::data_[] = {");
+ fprintf(f, "const byte Snapshot::data_[] = {");
int written = 0;
- written += fprintf(f, "%i", str[0]);
+ written += fprintf(f, "0x%x", bytes[0]);
for (int i = 1; i < size; ++i) {
- written += fprintf(f, ",%i", str[i]);
+ written += fprintf(f, ",0x%x", bytes[i]);
// The following is needed to keep the line length low on Visual C++:
if (i % 512 == 0) fprintf(f, "\n");
}
@@ -174,13 +174,13 @@
i::Heap::CollectAllGarbage();
i::Serializer ser;
ser.Serialize();
- char* str;
+ v8::internal::byte* bytes;
int len;
- ser.Finalize(&str, &len);
+ ser.Finalize(&bytes, &len);
- WriteInternalSnapshotToFile(argv[1], str, len);
+ WriteInternalSnapshotToFile(argv[1], bytes, len);
- i::DeleteArray(str);
+ i::DeleteArray(bytes);
return 0;
}
« no previous file with comments | « no previous file | src/serialize.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698