OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1069 | 1069 |
1070 void SourceGroup::StartExecuteInThread() { | 1070 void SourceGroup::StartExecuteInThread() { |
1071 if (thread_ == NULL) { | 1071 if (thread_ == NULL) { |
1072 thread_ = new IsolateThread(this); | 1072 thread_ = new IsolateThread(this); |
1073 thread_->Start(); | 1073 thread_->Start(); |
1074 } | 1074 } |
1075 next_semaphore_->Signal(); | 1075 next_semaphore_->Signal(); |
1076 } | 1076 } |
1077 | 1077 |
1078 | 1078 |
1079 ShellOptions::~ShellOptions() { | |
Vitaly Repeshko
2011/09/12 22:06:09
nit: To match the order in the .h file this should
fschneider
2011/09/13 09:29:24
Done.
| |
1080 delete[] isolate_sources; | |
1081 isolate_sources = NULL; | |
Vitaly Repeshko
2011/09/12 22:06:09
Looks like parallel_files should be deleted as wel
fschneider
2011/09/13 09:29:24
Done.
| |
1082 } | |
1083 | |
1084 | |
1079 void SourceGroup::WaitForThread() { | 1085 void SourceGroup::WaitForThread() { |
1080 if (thread_ == NULL) return; | 1086 if (thread_ == NULL) return; |
1081 if (Shell::options.last_run) { | 1087 if (Shell::options.last_run) { |
1082 thread_->Join(); | 1088 thread_->Join(); |
1083 } else { | 1089 } else { |
1084 done_semaphore_->Wait(); | 1090 done_semaphore_->Wait(); |
1085 } | 1091 } |
1086 } | 1092 } |
1087 #endif // V8_SHARED | 1093 #endif // V8_SHARED |
1088 | 1094 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1188 } | 1194 } |
1189 argv[i] = NULL; | 1195 argv[i] = NULL; |
1190 options.parallel_files->Add(i::Vector<const char>(files, size)); | 1196 options.parallel_files->Add(i::Vector<const char>(files, size)); |
1191 delete[] files; | 1197 delete[] files; |
1192 } | 1198 } |
1193 } | 1199 } |
1194 #endif // V8_SHARED | 1200 #endif // V8_SHARED |
1195 | 1201 |
1196 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); | 1202 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); |
1197 | 1203 |
1198 // set up isolated source groups | 1204 // Set up isolated source groups. |
1199 options.isolate_sources = new SourceGroup[options.num_isolates]; | 1205 options.isolate_sources = new SourceGroup[options.num_isolates]; |
1200 SourceGroup* current = options.isolate_sources; | 1206 SourceGroup* current = options.isolate_sources; |
1201 current->Begin(argv, 1); | 1207 current->Begin(argv, 1); |
1202 for (int i = 1; i < argc; i++) { | 1208 for (int i = 1; i < argc; i++) { |
1203 const char* str = argv[i]; | 1209 const char* str = argv[i]; |
1204 if (strcmp(str, "--isolate") == 0) { | 1210 if (strcmp(str, "--isolate") == 0) { |
1205 current->End(i); | 1211 current->End(i); |
1206 current++; | 1212 current++; |
1207 current->Begin(argv, i + 1); | 1213 current->Begin(argv, i + 1); |
1208 } else if (strncmp(argv[i], "--", 2) == 0) { | 1214 } else if (strncmp(argv[i], "--", 2) == 0) { |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1325 } | 1331 } |
1326 | 1332 |
1327 } // namespace v8 | 1333 } // namespace v8 |
1328 | 1334 |
1329 | 1335 |
1330 #ifndef GOOGLE3 | 1336 #ifndef GOOGLE3 |
1331 int main(int argc, char* argv[]) { | 1337 int main(int argc, char* argv[]) { |
1332 return v8::Shell::Main(argc, argv); | 1338 return v8::Shell::Main(argc, argv); |
1333 } | 1339 } |
1334 #endif | 1340 #endif |
OLD | NEW |