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 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <errno.h> | 5 #include <errno.h> |
6 #include <signal.h> | 6 #include <signal.h> |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include "include/libplatform/libplatform.h" | 9 #include "include/libplatform/libplatform.h" |
10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // flags or if the help flag is set. | 143 // flags or if the help flag is set. |
144 int result = i::FlagList::SetFlagsFromCommandLine(&argc, argv, true); | 144 int result = i::FlagList::SetFlagsFromCommandLine(&argc, argv, true); |
145 if (result > 0 || (argc > 3) || i::FLAG_help) { | 145 if (result > 0 || (argc > 3) || i::FLAG_help) { |
146 ::printf("Usage: %s --startup_src=... --startup_blob=... [extras]\n", | 146 ::printf("Usage: %s --startup_src=... --startup_blob=... [extras]\n", |
147 argv[0]); | 147 argv[0]); |
148 i::FlagList::PrintHelp(); | 148 i::FlagList::PrintHelp(); |
149 return !i::FLAG_help; | 149 return !i::FLAG_help; |
150 } | 150 } |
151 | 151 |
152 i::CpuFeatures::Probe(true); | 152 i::CpuFeatures::Probe(true); |
153 V8::InitializeICU(); | 153 V8::InitializeICUDefaultLocation(argv[0]); |
154 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); | 154 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); |
155 v8::V8::InitializePlatform(platform); | 155 v8::V8::InitializePlatform(platform); |
156 v8::V8::Initialize(); | 156 v8::V8::Initialize(); |
157 | 157 |
158 { | 158 { |
159 SnapshotWriter writer; | 159 SnapshotWriter writer; |
160 if (i::FLAG_startup_src) writer.SetSnapshotFile(i::FLAG_startup_src); | 160 if (i::FLAG_startup_src) writer.SetSnapshotFile(i::FLAG_startup_src); |
161 if (i::FLAG_startup_blob) writer.SetStartupBlobFile(i::FLAG_startup_blob); | 161 if (i::FLAG_startup_blob) writer.SetStartupBlobFile(i::FLAG_startup_blob); |
162 | 162 |
163 char* embed_script = GetExtraCode(argc >= 2 ? argv[1] : NULL, "embedding"); | 163 char* embed_script = GetExtraCode(argc >= 2 ? argv[1] : NULL, "embedding"); |
(...skipping 11 matching lines...) Expand all Loading... |
175 CHECK(blob.data); | 175 CHECK(blob.data); |
176 writer.WriteSnapshot(blob); | 176 writer.WriteSnapshot(blob); |
177 delete[] blob.data; | 177 delete[] blob.data; |
178 } | 178 } |
179 | 179 |
180 V8::Dispose(); | 180 V8::Dispose(); |
181 V8::ShutdownPlatform(); | 181 V8::ShutdownPlatform(); |
182 delete platform; | 182 delete platform; |
183 return 0; | 183 return 0; |
184 } | 184 } |
OLD | NEW |