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

Side by Side Diff: src/d8.cc

Issue 412163003: Move gc notifications from V8 to Isolate and make idle hint mandatory (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 5 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/api.cc ('k') | test/cctest/test-api.cc » ('j') | 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 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 PerIsolateData data(isolate); 1244 PerIsolateData data(isolate);
1245 Local<Context> context = Shell::CreateEvaluationContext(isolate); 1245 Local<Context> context = Shell::CreateEvaluationContext(isolate);
1246 { 1246 {
1247 Context::Scope cscope(context); 1247 Context::Scope cscope(context);
1248 PerIsolateData::RealmScope realm_scope(PerIsolateData::Get(isolate)); 1248 PerIsolateData::RealmScope realm_scope(PerIsolateData::Get(isolate));
1249 Execute(isolate); 1249 Execute(isolate);
1250 } 1250 }
1251 } 1251 }
1252 if (Shell::options.send_idle_notification) { 1252 if (Shell::options.send_idle_notification) {
1253 const int kLongIdlePauseInMs = 1000; 1253 const int kLongIdlePauseInMs = 1000;
1254 V8::ContextDisposedNotification(); 1254 isolate->ContextDisposedNotification();
1255 V8::IdleNotification(kLongIdlePauseInMs); 1255 isolate->IdleNotification(kLongIdlePauseInMs);
1256 } 1256 }
1257 if (Shell::options.invoke_weak_callbacks) { 1257 if (Shell::options.invoke_weak_callbacks) {
1258 // By sending a low memory notifications, we will try hard to collect 1258 // By sending a low memory notifications, we will try hard to collect
1259 // all garbage and will therefore also invoke all weak callbacks of 1259 // all garbage and will therefore also invoke all weak callbacks of
1260 // actually unreachable persistent handles. 1260 // actually unreachable persistent handles.
1261 V8::LowMemoryNotification(); 1261 isolate->LowMemoryNotification();
1262 } 1262 }
1263 } 1263 }
1264 done_semaphore_.Signal(); 1264 done_semaphore_.Signal();
1265 } while (!Shell::options.last_run); 1265 } while (!Shell::options.last_run);
1266 1266
1267 isolate->Dispose(); 1267 isolate->Dispose();
1268 } 1268 }
1269 1269
1270 1270
1271 void SourceGroup::StartExecuteInThread() { 1271 void SourceGroup::StartExecuteInThread() {
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1433 #endif // !V8_SHARED 1433 #endif // !V8_SHARED
1434 } 1434 }
1435 { 1435 {
1436 Context::Scope cscope(context); 1436 Context::Scope cscope(context);
1437 PerIsolateData::RealmScope realm_scope(PerIsolateData::Get(isolate)); 1437 PerIsolateData::RealmScope realm_scope(PerIsolateData::Get(isolate));
1438 options.isolate_sources[0].Execute(isolate); 1438 options.isolate_sources[0].Execute(isolate);
1439 } 1439 }
1440 } 1440 }
1441 if (options.send_idle_notification) { 1441 if (options.send_idle_notification) {
1442 const int kLongIdlePauseInMs = 1000; 1442 const int kLongIdlePauseInMs = 1000;
1443 V8::ContextDisposedNotification(); 1443 isolate->ContextDisposedNotification();
1444 V8::IdleNotification(kLongIdlePauseInMs); 1444 isolate->IdleNotification(kLongIdlePauseInMs);
1445 } 1445 }
1446 if (options.invoke_weak_callbacks) { 1446 if (options.invoke_weak_callbacks) {
1447 // By sending a low memory notifications, we will try hard to collect all 1447 // By sending a low memory notifications, we will try hard to collect all
1448 // garbage and will therefore also invoke all weak callbacks of actually 1448 // garbage and will therefore also invoke all weak callbacks of actually
1449 // unreachable persistent handles. 1449 // unreachable persistent handles.
1450 V8::LowMemoryNotification(); 1450 isolate->LowMemoryNotification();
1451 } 1451 }
1452 1452
1453 #ifndef V8_SHARED 1453 #ifndef V8_SHARED
1454 for (int i = 1; i < options.num_isolates; ++i) { 1454 for (int i = 1; i < options.num_isolates; ++i) {
1455 options.isolate_sources[i].WaitForThread(); 1455 options.isolate_sources[i].WaitForThread();
1456 } 1456 }
1457 #endif // !V8_SHARED 1457 #endif // !V8_SHARED
1458 return 0; 1458 return 0;
1459 } 1459 }
1460 1460
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
1691 } 1691 }
1692 1692
1693 } // namespace v8 1693 } // namespace v8
1694 1694
1695 1695
1696 #ifndef GOOGLE3 1696 #ifndef GOOGLE3
1697 int main(int argc, char* argv[]) { 1697 int main(int argc, char* argv[]) {
1698 return v8::Shell::Main(argc, argv); 1698 return v8::Shell::Main(argc, argv);
1699 } 1699 }
1700 #endif 1700 #endif
OLDNEW
« no previous file with comments | « src/api.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698