| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |