| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1627 } else if (strcmp(argv[i], "--noalways-opt") == 0) { | 1627 } else if (strcmp(argv[i], "--noalways-opt") == 0) { |
| 1628 // No support for stressing if we can't use --always-opt. | 1628 // No support for stressing if we can't use --always-opt. |
| 1629 options.stress_opt = false; | 1629 options.stress_opt = false; |
| 1630 options.stress_deopt = false; | 1630 options.stress_deopt = false; |
| 1631 } else if (strcmp(argv[i], "--shell") == 0) { | 1631 } else if (strcmp(argv[i], "--shell") == 0) { |
| 1632 options.interactive_shell = true; | 1632 options.interactive_shell = true; |
| 1633 argv[i] = NULL; | 1633 argv[i] = NULL; |
| 1634 } else if (strcmp(argv[i], "--test") == 0) { | 1634 } else if (strcmp(argv[i], "--test") == 0) { |
| 1635 options.test_shell = true; | 1635 options.test_shell = true; |
| 1636 argv[i] = NULL; | 1636 argv[i] = NULL; |
| 1637 } else if (strcmp(argv[i], "--send-idle-notification") == 0) { |
| 1638 options.send_idle_notification = true; |
| 1639 argv[i] = NULL; |
| 1637 } else if (strcmp(argv[i], "--preemption") == 0) { | 1640 } else if (strcmp(argv[i], "--preemption") == 0) { |
| 1638 #ifdef V8_SHARED | 1641 #ifdef V8_SHARED |
| 1639 printf("D8 with shared library does not support multi-threading\n"); | 1642 printf("D8 with shared library does not support multi-threading\n"); |
| 1640 return false; | 1643 return false; |
| 1641 #else | 1644 #else |
| 1642 options.use_preemption = true; | 1645 options.use_preemption = true; |
| 1643 argv[i] = NULL; | 1646 argv[i] = NULL; |
| 1644 #endif // V8_SHARED | 1647 #endif // V8_SHARED |
| 1645 } else if (strcmp(argv[i], "--nopreemption") == 0) { | 1648 } else if (strcmp(argv[i], "--nopreemption") == 0) { |
| 1646 #ifdef V8_SHARED | 1649 #ifdef V8_SHARED |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1783 InstallUtilityScript(); | 1786 InstallUtilityScript(); |
| 1784 } | 1787 } |
| 1785 #endif // !V8_SHARED && ENABLE_DEBUGGER_SUPPORT | 1788 #endif // !V8_SHARED && ENABLE_DEBUGGER_SUPPORT |
| 1786 } | 1789 } |
| 1787 { | 1790 { |
| 1788 Context::Scope cscope(context); | 1791 Context::Scope cscope(context); |
| 1789 options.isolate_sources[0].Execute(); | 1792 options.isolate_sources[0].Execute(); |
| 1790 } | 1793 } |
| 1791 if (!options.last_run) { | 1794 if (!options.last_run) { |
| 1792 context.Dispose(); | 1795 context.Dispose(); |
| 1793 #if !defined(V8_SHARED) | 1796 if (options.send_idle_notification) { |
| 1794 if (i::FLAG_send_idle_notification) { | |
| 1795 const int kLongIdlePauseInMs = 1000; | 1797 const int kLongIdlePauseInMs = 1000; |
| 1796 V8::ContextDisposedNotification(); | 1798 V8::ContextDisposedNotification(); |
| 1797 V8::IdleNotification(kLongIdlePauseInMs); | 1799 V8::IdleNotification(kLongIdlePauseInMs); |
| 1798 } | 1800 } |
| 1799 #endif // !V8_SHARED | |
| 1800 } | 1801 } |
| 1801 | 1802 |
| 1802 #ifndef V8_SHARED | 1803 #ifndef V8_SHARED |
| 1803 // Start preemption if threads have been created and preemption is enabled. | 1804 // Start preemption if threads have been created and preemption is enabled. |
| 1804 if (threads.length() > 0 | 1805 if (threads.length() > 0 |
| 1805 && options.use_preemption) { | 1806 && options.use_preemption) { |
| 1806 Locker::StartPreemption(options.preemption_interval); | 1807 Locker::StartPreemption(options.preemption_interval); |
| 1807 } | 1808 } |
| 1808 #endif // V8_SHARED | 1809 #endif // V8_SHARED |
| 1809 } | 1810 } |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1893 } | 1894 } |
| 1894 | 1895 |
| 1895 } // namespace v8 | 1896 } // namespace v8 |
| 1896 | 1897 |
| 1897 | 1898 |
| 1898 #ifndef GOOGLE3 | 1899 #ifndef GOOGLE3 |
| 1899 int main(int argc, char* argv[]) { | 1900 int main(int argc, char* argv[]) { |
| 1900 return v8::Shell::Main(argc, argv); | 1901 return v8::Shell::Main(argc, argv); |
| 1901 } | 1902 } |
| 1902 #endif | 1903 #endif |
| OLD | NEW |