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

Side by Side Diff: src/d8.h

Issue 7891005: Fixing parallel execution in d8 (with -p) and some memory leaks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Applied suggestions. Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/d8.cc » ('j') | src/d8.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 int end_offset_; 173 int end_offset_;
174 }; 174 };
175 175
176 176
177 class ShellOptions { 177 class ShellOptions {
178 public: 178 public:
179 ShellOptions() : 179 ShellOptions() :
180 #ifndef V8_SHARED 180 #ifndef V8_SHARED
181 use_preemption(true), 181 use_preemption(true),
182 preemption_interval(10), 182 preemption_interval(10),
183 num_parallel_files(0),
183 parallel_files(NULL), 184 parallel_files(NULL),
184 #endif // V8_SHARED 185 #endif // V8_SHARED
185 script_executed(false), 186 script_executed(false),
186 last_run(true), 187 last_run(true),
187 stress_opt(false), 188 stress_opt(false),
188 stress_deopt(false), 189 stress_deopt(false),
189 interactive_shell(false), 190 interactive_shell(false),
190 test_shell(false), 191 test_shell(false),
191 num_isolates(1), 192 num_isolates(1),
192 isolate_sources(NULL) { } 193 isolate_sources(NULL) { }
193 194
194 ~ShellOptions(); 195 ~ShellOptions() {
196 #ifndef V8_SHARED
197 delete[] parallel_files;
198 #endif // V8_SHARED
199 delete[] isolate_sources;
200 }
195 201
196 #ifndef V8_SHARED 202 #ifndef V8_SHARED
197 bool use_preemption; 203 bool use_preemption;
198 int preemption_interval; 204 int preemption_interval;
199 i::List< i::Vector<const char> >* parallel_files; 205 int num_parallel_files;
206 char** parallel_files;
200 #endif // V8_SHARED 207 #endif // V8_SHARED
201 bool script_executed; 208 bool script_executed;
202 bool last_run; 209 bool last_run;
203 bool stress_opt; 210 bool stress_opt;
204 bool stress_deopt; 211 bool stress_deopt;
205 bool interactive_shell; 212 bool interactive_shell;
206 bool test_shell; 213 bool test_shell;
207 int num_isolates; 214 int num_isolates;
208 SourceGroup* isolate_sources; 215 SourceGroup* isolate_sources;
209 }; 216 };
210 217
211 #ifdef V8_SHARED 218 #ifdef V8_SHARED
212 class Shell { 219 class Shell {
213 #else 220 #else
214 class Shell : public i::AllStatic { 221 class Shell : public i::AllStatic {
215 #endif // V8_SHARED 222 #endif // V8_SHARED
216 223
217 public: 224 public:
218 static bool ExecuteString(Handle<String> source, 225 static bool ExecuteString(Handle<String> source,
219 Handle<Value> name, 226 Handle<Value> name,
220 bool print_result, 227 bool print_result,
221 bool report_exceptions); 228 bool report_exceptions);
222 static const char* ToCString(const v8::String::Utf8Value& value); 229 static const char* ToCString(const v8::String::Utf8Value& value);
223 static void ReportException(TryCatch* try_catch); 230 static void ReportException(TryCatch* try_catch);
224 static Handle<String> ReadFile(const char* name); 231 static Handle<String> ReadFile(const char* name);
225 static Persistent<Context> CreateEvaluationContext(); 232 static Persistent<Context> CreateEvaluationContext();
226 static int RunMain(int argc, char* argv[]); 233 static int RunMain(int argc, char* argv[]);
227 static int Main(int argc, char* argv[]); 234 static int Main(int argc, char* argv[]);
235 static void Exit(int exit_code);
228 236
229 #ifndef V8_SHARED 237 #ifndef V8_SHARED
230 static Handle<Array> GetCompletions(Handle<String> text, 238 static Handle<Array> GetCompletions(Handle<String> text,
231 Handle<String> full); 239 Handle<String> full);
232 static void OnExit(); 240 static void OnExit();
233 static int* LookupCounter(const char* name); 241 static int* LookupCounter(const char* name);
234 static void* CreateHistogram(const char* name, 242 static void* CreateHistogram(const char* name,
235 int min, 243 int min,
236 int max, 244 int max,
237 size_t buckets); 245 size_t buckets);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 LineEditor* next_; 363 LineEditor* next_;
356 static LineEditor* first_; 364 static LineEditor* first_;
357 }; 365 };
358 #endif // V8_SHARED 366 #endif // V8_SHARED
359 367
360 368
361 } // namespace v8 369 } // namespace v8
362 370
363 371
364 #endif // V8_D8_H_ 372 #endif // V8_D8_H_
OLDNEW
« no previous file with comments | « no previous file | src/d8.cc » ('j') | src/d8.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698