| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 | 144 |
| 145 int main(int argc, char** argv) { | 145 int main(int argc, char** argv) { |
| 146 #ifdef ENABLE_LOGGING_AND_PROFILING | 146 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 147 // By default, log code create information in the snapshot. | 147 // By default, log code create information in the snapshot. |
| 148 i::FLAG_log_code = true; | 148 i::FLAG_log_code = true; |
| 149 #endif | 149 #endif |
| 150 // Print the usage if an error occurs when parsing the command line | 150 // Print the usage if an error occurs when parsing the command line |
| 151 // flags or if the help flag is set. | 151 // flags or if the help flag is set. |
| 152 int result = i::FlagList::SetFlagsFromCommandLine(&argc, argv, true); | 152 int result = i::FlagList::SetFlagsFromCommandLine(&argc, argv, true); |
| 153 if (result > 0 || argc != 2 || i::FLAG_h) { | 153 if (result > 0 || argc != 2 || i::FLAG_help) { |
| 154 ::printf("Usage: %s [flag] ... outfile\n", argv[0]); | 154 ::printf("Usage: %s [flag] ... outfile\n", argv[0]); |
| 155 i::FlagList::PrintHelp(); | 155 i::FlagList::PrintHelp(); |
| 156 return !i::FLAG_h; | 156 return !i::FLAG_help; |
| 157 } | 157 } |
| 158 | 158 |
| 159 v8::V8::SetCounterFunction(counter_callback); | 159 v8::V8::SetCounterFunction(counter_callback); |
| 160 v8::HandleScope scope; | 160 v8::HandleScope scope; |
| 161 | 161 |
| 162 const int kExtensionCount = 1; | 162 const int kExtensionCount = 1; |
| 163 const char* extension_list[kExtensionCount] = { "v8/gc" }; | 163 const char* extension_list[kExtensionCount] = { "v8/gc" }; |
| 164 v8::ExtensionConfiguration extensions(kExtensionCount, extension_list); | 164 v8::ExtensionConfiguration extensions(kExtensionCount, extension_list); |
| 165 v8::Context::New(&extensions); | 165 v8::Context::New(&extensions); |
| 166 | 166 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 177 char* str; | 177 char* str; |
| 178 int len; | 178 int len; |
| 179 ser.Finalize(&str, &len); | 179 ser.Finalize(&str, &len); |
| 180 | 180 |
| 181 WriteInternalSnapshotToFile(argv[1], str, len); | 181 WriteInternalSnapshotToFile(argv[1], str, len); |
| 182 | 182 |
| 183 i::DeleteArray(str); | 183 i::DeleteArray(str); |
| 184 | 184 |
| 185 return 0; | 185 return 0; |
| 186 } | 186 } |
| OLD | NEW |