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

Side by Side Diff: src/d8.cc

Issue 305553002: Fix d8's interactive shell. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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 | « src/d8.h ('k') | 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 5
6 // Defined when linking against shared lib on Windows. 6 // Defined when linking against shared lib on Windows.
7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED)
8 #define V8_SHARED 8 #define V8_SHARED
9 #endif 9 #endif
10 10
(...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after
1338 1338
1339 int Shell::RunMain(Isolate* isolate, int argc, char* argv[]) { 1339 int Shell::RunMain(Isolate* isolate, int argc, char* argv[]) {
1340 #ifndef V8_SHARED 1340 #ifndef V8_SHARED
1341 for (int i = 1; i < options.num_isolates; ++i) { 1341 for (int i = 1; i < options.num_isolates; ++i) {
1342 options.isolate_sources[i].StartExecuteInThread(); 1342 options.isolate_sources[i].StartExecuteInThread();
1343 } 1343 }
1344 #endif // !V8_SHARED 1344 #endif // !V8_SHARED
1345 { 1345 {
1346 HandleScope scope(isolate); 1346 HandleScope scope(isolate);
1347 Local<Context> context = CreateEvaluationContext(isolate); 1347 Local<Context> context = CreateEvaluationContext(isolate);
1348 if (options.last_run && options.interactive_shell) { 1348 if (options.last_run && options.use_interactive_shell()) {
1349 // Keep using the same context in the interactive shell. 1349 // Keep using the same context in the interactive shell.
1350 evaluation_context_.Reset(isolate, context); 1350 evaluation_context_.Reset(isolate, context);
1351 #ifndef V8_SHARED 1351 #ifndef V8_SHARED
1352 // If the interactive debugger is enabled make sure to activate 1352 // If the interactive debugger is enabled make sure to activate
1353 // it before running the files passed on the command line. 1353 // it before running the files passed on the command line.
1354 if (i::FLAG_debugger) { 1354 if (i::FLAG_debugger) {
1355 InstallUtilityScript(isolate); 1355 InstallUtilityScript(isolate);
1356 } 1356 }
1357 #endif // !V8_SHARED 1357 #endif // !V8_SHARED
1358 } 1358 }
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1517 options.last_run = (i == stress_runs - 1); 1517 options.last_run = (i == stress_runs - 1);
1518 result = RunMain(isolate, argc, argv); 1518 result = RunMain(isolate, argc, argv);
1519 } 1519 }
1520 #endif 1520 #endif
1521 } else { 1521 } else {
1522 result = RunMain(isolate, argc, argv); 1522 result = RunMain(isolate, argc, argv);
1523 } 1523 }
1524 1524
1525 // Run interactive shell if explicitly requested or if no script has been 1525 // Run interactive shell if explicitly requested or if no script has been
1526 // executed, but never on --test 1526 // executed, but never on --test
1527 if (( options.interactive_shell || !options.script_executed ) 1527 if (options.use_interactive_shell()) {
1528 && !options.test_shell ) {
1529 #ifndef V8_SHARED 1528 #ifndef V8_SHARED
1530 if (!i::FLAG_debugger) { 1529 if (!i::FLAG_debugger) {
1531 InstallUtilityScript(isolate); 1530 InstallUtilityScript(isolate);
1532 } 1531 }
1533 #endif // !V8_SHARED 1532 #endif // !V8_SHARED
1534 RunShell(isolate); 1533 RunShell(isolate);
1535 } 1534 }
1536 } 1535 }
1537 isolate->Dispose(); 1536 isolate->Dispose();
1538 V8::Dispose(); 1537 V8::Dispose();
1539 1538
1540 OnExit(); 1539 OnExit();
1541 1540
1542 return result; 1541 return result;
1543 } 1542 }
1544 1543
1545 } // namespace v8 1544 } // namespace v8
1546 1545
1547 1546
1548 #ifndef GOOGLE3 1547 #ifndef GOOGLE3
1549 int main(int argc, char* argv[]) { 1548 int main(int argc, char* argv[]) {
1550 return v8::Shell::Main(argc, argv); 1549 return v8::Shell::Main(argc, argv);
1551 } 1550 }
1552 #endif 1551 #endif
OLDNEW
« no previous file with comments | « src/d8.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698