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

Side by Side Diff: src/d8.cc

Issue 293393003: D8 should send idle notification even after the last run. (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 | « 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 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) { 1348 if (options.last_run && options.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 }
1359 { 1359 {
1360 Context::Scope cscope(context); 1360 Context::Scope cscope(context);
1361 PerIsolateData::RealmScope realm_scope(PerIsolateData::Get(isolate)); 1361 PerIsolateData::RealmScope realm_scope(PerIsolateData::Get(isolate));
1362 options.isolate_sources[0].Execute(isolate); 1362 options.isolate_sources[0].Execute(isolate);
1363 } 1363 }
1364 } 1364 }
1365 if (!options.last_run) { 1365 if (options.send_idle_notification) {
1366 if (options.send_idle_notification) { 1366 const int kLongIdlePauseInMs = 1000;
1367 const int kLongIdlePauseInMs = 1000; 1367 V8::ContextDisposedNotification();
1368 V8::ContextDisposedNotification(); 1368 V8::IdleNotification(kLongIdlePauseInMs);
1369 V8::IdleNotification(kLongIdlePauseInMs);
1370 }
1371 } 1369 }
1372 1370
1373 #ifndef V8_SHARED 1371 #ifndef V8_SHARED
1374 for (int i = 1; i < options.num_isolates; ++i) { 1372 for (int i = 1; i < options.num_isolates; ++i) {
1375 options.isolate_sources[i].WaitForThread(); 1373 options.isolate_sources[i].WaitForThread();
1376 } 1374 }
1377 #endif // !V8_SHARED 1375 #endif // !V8_SHARED
1378 return 0; 1376 return 0;
1379 } 1377 }
1380 1378
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1545 } 1543 }
1546 1544
1547 } // namespace v8 1545 } // namespace v8
1548 1546
1549 1547
1550 #ifndef GOOGLE3 1548 #ifndef GOOGLE3
1551 int main(int argc, char* argv[]) { 1549 int main(int argc, char* argv[]) {
1552 return v8::Shell::Main(argc, argv); 1550 return v8::Shell::Main(argc, argv);
1553 } 1551 }
1554 #endif 1552 #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