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

Side by Side Diff: src/d8.cc

Issue 7981023: Turn on d8 interactive debugging before running files passed on the command line (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 } 1246 }
1247 } 1247 }
1248 for (int i = 1; i < options.num_isolates; ++i) { 1248 for (int i = 1; i < options.num_isolates; ++i) {
1249 options.isolate_sources[i].StartExecuteInThread(); 1249 options.isolate_sources[i].StartExecuteInThread();
1250 } 1250 }
1251 #endif // V8_SHARED 1251 #endif // V8_SHARED
1252 { // NOLINT 1252 { // NOLINT
1253 Locker lock; 1253 Locker lock;
1254 HandleScope scope; 1254 HandleScope scope;
1255 Persistent<Context> context = CreateEvaluationContext(); 1255 Persistent<Context> context = CreateEvaluationContext();
1256 if (options.last_run) {
1257 // Keep using the same context in the interactive shell
Kasper Lund 2011/09/21 13:14:49 Terminate comment with .
Søren Thygesen Gjesse 2011/09/21 13:42:50 Done.
1258 evaluation_context_ = context;
1259 // If the interactive debugger is enabled make sure to activate
1260 // it before running the files passed on the command line.
1261 if (i::FLAG_debugger && options.last_run) {
Yang 2011/09/21 13:09:02 This breaks the shared library build. Putting this
Kasper Lund 2011/09/21 13:16:13 options.last_run will be true here, right?
Søren Thygesen Gjesse 2011/09/21 13:42:50 Done.
Søren Thygesen Gjesse 2011/09/21 13:42:50 Yes, removed check.
1262 InstallUtilityScript();
1263 }
1264 }
1256 { 1265 {
1257 Context::Scope cscope(context); 1266 Context::Scope cscope(context);
1258 options.isolate_sources[0].Execute(); 1267 options.isolate_sources[0].Execute();
1259 } 1268 }
1260 if (options.last_run) { 1269 if (!options.last_run) {
1261 // Keep using the same context in the interactive shell
1262 evaluation_context_ = context;
1263 } else {
1264 context.Dispose(); 1270 context.Dispose();
1265 } 1271 }
1266 1272
1267 #ifndef V8_SHARED 1273 #ifndef V8_SHARED
1268 // Start preemption if threads have been created and preemption is enabled. 1274 // Start preemption if threads have been created and preemption is enabled.
1269 if (threads.length() > 0 1275 if (threads.length() > 0
1270 && options.use_preemption) { 1276 && options.use_preemption) {
1271 Locker::StartPreemption(options.preemption_interval); 1277 Locker::StartPreemption(options.preemption_interval);
1272 } 1278 }
1273 #endif // V8_SHARED 1279 #endif // V8_SHARED
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 } 1331 }
1326 #endif // !V8_SHARED && ENABLE_DEBUGGER_SUPPORT 1332 #endif // !V8_SHARED && ENABLE_DEBUGGER_SUPPORT
1327 1333
1328 // Run interactive shell if explicitly requested or if no script has been 1334 // Run interactive shell if explicitly requested or if no script has been
1329 // executed, but never on --test 1335 // executed, but never on --test
1330 1336
1331 if (( options.interactive_shell 1337 if (( options.interactive_shell
1332 || !options.script_executed ) 1338 || !options.script_executed )
1333 && !options.test_shell ) { 1339 && !options.test_shell ) {
1334 #ifndef V8_SHARED 1340 #ifndef V8_SHARED
1335 InstallUtilityScript(); 1341 if (!i::FLAG_debugger) {
1342 InstallUtilityScript();
1343 }
1336 #endif // V8_SHARED 1344 #endif // V8_SHARED
1337 RunShell(); 1345 RunShell();
1338 } 1346 }
1339 1347
1340 V8::Dispose(); 1348 V8::Dispose();
1341 1349
1342 #ifndef V8_SHARED 1350 #ifndef V8_SHARED
1343 OnExit(); 1351 OnExit();
1344 #endif // V8_SHARED 1352 #endif // V8_SHARED
1345 1353
1346 return result; 1354 return result;
1347 } 1355 }
1348 1356
1349 } // namespace v8 1357 } // namespace v8
1350 1358
1351 1359
1352 #ifndef GOOGLE3 1360 #ifndef GOOGLE3
1353 int main(int argc, char* argv[]) { 1361 int main(int argc, char* argv[]) {
1354 return v8::Shell::Main(argc, argv); 1362 return v8::Shell::Main(argc, argv);
1355 } 1363 }
1356 #endif 1364 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698