Implement --omit, --raw_[context_]file=... for mksnapshot tool.

These switches are analogous to --omit and --raw for js2c.py.
The goal it to allow embedders to externally load all (or generate) the V8 startup data.

There's a bit of gratuitous refactoring with the writing logic that helped me understand the code. Let me know if it's not an improvement.

BUG=355539
LOG=N
R=jochen@chromium.org, svenpanne@chromium.org

Review URL: https://codereview.chromium.org/249283002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20941 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b8d27f9d
...@@ -653,7 +653,13 @@ DEFINE_string(testing_serialization_file, "/tmp/serdes", ...@@ -653,7 +653,13 @@ DEFINE_string(testing_serialization_file, "/tmp/serdes",
// mksnapshot.cc // mksnapshot.cc
DEFINE_string(extra_code, NULL, "A filename with extra code to be included in" DEFINE_string(extra_code, NULL, "A filename with extra code to be included in"
" the snapshot (mksnapshot only)") " the snapshot (mksnapshot only)")
DEFINE_string(raw_file, NULL, "A file to write the raw snapshot bytes to. "
"(mksnapshot only)")
DEFINE_string(raw_context_file, NULL, "A file to write the raw context "
"snapshot bytes to. (mksnapshot only)")
DEFINE_bool(omit, false, "Omit raw snapshot bytes in generated code. "
"(mksnapshot only)")
// code-stubs-hydrogen.cc // code-stubs-hydrogen.cc
DEFINE_bool(profile_hydrogen_code_stub_compilation, false, DEFINE_bool(profile_hydrogen_code_stub_compilation, false,
......
This diff is collapsed.
...@@ -464,7 +464,7 @@ class Serializer : public SerializerDeserializer { ...@@ -464,7 +464,7 @@ class Serializer : public SerializerDeserializer {
void VisitPointers(Object** start, Object** end); void VisitPointers(Object** start, Object** end);
// You can call this after serialization to find out how much space was used // You can call this after serialization to find out how much space was used
// in each space. // in each space.
int CurrentAllocationAddress(int space) { int CurrentAllocationAddress(int space) const {
ASSERT(space < kNumberOfSpaces); ASSERT(space < kNumberOfSpaces);
return fullness_[space]; return fullness_[space];
} }
......
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