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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 | 371 |
372 // Check that the debugger has been fully unloaded. | 372 // Check that the debugger has been fully unloaded. |
373 void CheckDebuggerUnloaded(bool check_functions) { | 373 void CheckDebuggerUnloaded(bool check_functions) { |
374 // Check that the debugger context is cleared and that there is no debug | 374 // Check that the debugger context is cleared and that there is no debug |
375 // information stored for the debugger. | 375 // information stored for the debugger. |
376 CHECK(CcTest::i_isolate()->debug()->debug_context().is_null()); | 376 CHECK(CcTest::i_isolate()->debug()->debug_context().is_null()); |
377 CHECK(!CcTest::i_isolate()->debug()->debug_info_list_); | 377 CHECK(!CcTest::i_isolate()->debug()->debug_info_list_); |
378 | 378 |
379 // Collect garbage to ensure weak handles are cleared. | 379 // Collect garbage to ensure weak handles are cleared. |
380 CcTest::heap()->CollectAllGarbage(); | 380 CcTest::heap()->CollectAllGarbage(); |
381 CcTest::heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask); | 381 CcTest::heap()->CollectAllGarbage(); |
382 | 382 |
383 // Iterate the head and check that there are no debugger related objects left. | 383 // Iterate the head and check that there are no debugger related objects left. |
384 HeapIterator iterator(CcTest::heap()); | 384 HeapIterator iterator(CcTest::heap()); |
385 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { | 385 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { |
386 CHECK(!obj->IsDebugInfo()); | 386 CHECK(!obj->IsDebugInfo()); |
387 CHECK(!obj->IsBreakPointInfo()); | 387 CHECK(!obj->IsBreakPointInfo()); |
388 | 388 |
389 // If deep check of functions is requested check that no debug break code | 389 // If deep check of functions is requested check that no debug break code |
390 // is left in all functions. | 390 // is left in all functions. |
391 if (check_functions) { | 391 if (check_functions) { |
(...skipping 7788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8180 "function foo() {\n" | 8180 "function foo() {\n" |
8181 " try { throw new Error(); } catch (e) {}\n" | 8181 " try { throw new Error(); } catch (e) {}\n" |
8182 "}\n" | 8182 "}\n" |
8183 "debugger;\n" | 8183 "debugger;\n" |
8184 "foo();\n" | 8184 "foo();\n" |
8185 "foo();\n"); | 8185 "foo();\n"); |
8186 | 8186 |
8187 v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr); | 8187 v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr); |
8188 CHECK_EQ(break_point_hit_count, 4); | 8188 CHECK_EQ(break_point_hit_count, 4); |
8189 } | 8189 } |
OLD | NEW |