| OLD | NEW |
| 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 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 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 | 862 |
| 863 // Perform a garbage collection when break point is hit and continue. Based | 863 // Perform a garbage collection when break point is hit and continue. Based |
| 864 // on the number of break points hit either scavenge or mark compact | 864 // on the number of break points hit either scavenge or mark compact |
| 865 // collector is used. | 865 // collector is used. |
| 866 if (event == v8::Break) { | 866 if (event == v8::Break) { |
| 867 break_point_hit_count++; | 867 break_point_hit_count++; |
| 868 if (break_point_hit_count % 2 == 0) { | 868 if (break_point_hit_count % 2 == 0) { |
| 869 // Scavenge. | 869 // Scavenge. |
| 870 Heap::CollectGarbage(0, v8::internal::NEW_SPACE); | 870 Heap::CollectGarbage(0, v8::internal::NEW_SPACE); |
| 871 } else { | 871 } else { |
| 872 // Mark sweep compact. | 872 // Mark sweep (and perhaps compact). |
| 873 Heap::CollectAllGarbage(true); | 873 Heap::CollectAllGarbage(false); |
| 874 } | 874 } |
| 875 } | 875 } |
| 876 } | 876 } |
| 877 | 877 |
| 878 | 878 |
| 879 // Debug event handler which re-issues a debug break and calls the garbage | 879 // Debug event handler which re-issues a debug break and calls the garbage |
| 880 // collector to have the heap verified. | 880 // collector to have the heap verified. |
| 881 static void DebugEventBreak(v8::DebugEvent event, | 881 static void DebugEventBreak(v8::DebugEvent event, |
| 882 v8::Handle<v8::Object> exec_state, | 882 v8::Handle<v8::Object> exec_state, |
| 883 v8::Handle<v8::Object> event_data, | 883 v8::Handle<v8::Object> event_data, |
| (...skipping 5953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6837 | 6837 |
| 6838 CHECK_EQ(2, TestClientData::constructor_call_counter); | 6838 CHECK_EQ(2, TestClientData::constructor_call_counter); |
| 6839 CHECK_EQ(TestClientData::constructor_call_counter, | 6839 CHECK_EQ(TestClientData::constructor_call_counter, |
| 6840 TestClientData::destructor_call_counter); | 6840 TestClientData::destructor_call_counter); |
| 6841 | 6841 |
| 6842 v8::Debug::SetDebugEventListener(NULL); | 6842 v8::Debug::SetDebugEventListener(NULL); |
| 6843 CheckDebuggerUnloaded(); | 6843 CheckDebuggerUnloaded(); |
| 6844 } | 6844 } |
| 6845 | 6845 |
| 6846 #endif // ENABLE_DEBUGGER_SUPPORT | 6846 #endif // ENABLE_DEBUGGER_SUPPORT |
| OLD | NEW |