OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 while (node) { | 402 while (node) { |
403 debugged_functions->set(count++, *node->debug_info()); | 403 debugged_functions->set(count++, *node->debug_info()); |
404 node = node->next(); | 404 node = node->next(); |
405 } | 405 } |
406 | 406 |
407 return debugged_functions; | 407 return debugged_functions; |
408 } | 408 } |
409 | 409 |
410 | 410 |
411 static Handle<Code> ComputeCallDebugBreak(int argc) { | 411 static Handle<Code> ComputeCallDebugBreak(int argc) { |
412 CALL_HEAP_FUNCTION( | 412 return Isolate::Current()->stub_cache()->ComputeCallDebugBreak(argc, |
413 v8::internal::Isolate::Current(), | 413 Code::CALL_IC); |
414 v8::internal::Isolate::Current()->stub_cache()->ComputeCallDebugBreak( | |
415 argc, Code::CALL_IC), | |
416 Code); | |
417 } | 414 } |
418 | 415 |
419 | 416 |
420 // Check that the debugger has been fully unloaded. | 417 // Check that the debugger has been fully unloaded. |
421 void CheckDebuggerUnloaded(bool check_functions) { | 418 void CheckDebuggerUnloaded(bool check_functions) { |
422 // Check that the debugger context is cleared and that there is no debug | 419 // Check that the debugger context is cleared and that there is no debug |
423 // information stored for the debugger. | 420 // information stored for the debugger. |
424 CHECK(Isolate::Current()->debug()->debug_context().is_null()); | 421 CHECK(Isolate::Current()->debug()->debug_context().is_null()); |
425 CHECK_EQ(NULL, Isolate::Current()->debug()->debug_info_list_); | 422 CHECK_EQ(NULL, Isolate::Current()->debug()->debug_info_list_); |
426 | 423 |
427 // Collect garbage to ensure weak handles are cleared. | 424 // Collect garbage to ensure weak handles are cleared. |
428 HEAP->CollectAllGarbage(i::Heap::kNoGCFlags); | 425 HEAP->CollectAllGarbage(Heap::kNoGCFlags); |
429 HEAP->CollectAllGarbage(i::Heap::kMakeHeapIterableMask); | 426 HEAP->CollectAllGarbage(Heap::kMakeHeapIterableMask); |
430 | 427 |
431 // Iterate the head and check that there are no debugger related objects left. | 428 // Iterate the head and check that there are no debugger related objects left. |
432 HeapIterator iterator; | 429 HeapIterator iterator; |
433 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { | 430 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { |
434 CHECK(!obj->IsDebugInfo()); | 431 CHECK(!obj->IsDebugInfo()); |
435 CHECK(!obj->IsBreakPointInfo()); | 432 CHECK(!obj->IsBreakPointInfo()); |
436 | 433 |
437 // If deep check of functions is requested check that no debug break code | 434 // If deep check of functions is requested check that no debug break code |
438 // is left in all functions. | 435 // is left in all functions. |
439 if (check_functions) { | 436 if (check_functions) { |
(...skipping 6849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7289 TestDebugBreakInLoop("for (;;) {", loop_bodies, "}"); | 7286 TestDebugBreakInLoop("for (;;) {", loop_bodies, "}"); |
7290 TestDebugBreakInLoop("for (;a == 1;) {", loop_bodies, "}"); | 7287 TestDebugBreakInLoop("for (;a == 1;) {", loop_bodies, "}"); |
7291 | 7288 |
7292 // Get rid of the debug event listener. | 7289 // Get rid of the debug event listener. |
7293 v8::Debug::SetDebugEventListener(NULL); | 7290 v8::Debug::SetDebugEventListener(NULL); |
7294 CheckDebuggerUnloaded(); | 7291 CheckDebuggerUnloaded(); |
7295 } | 7292 } |
7296 | 7293 |
7297 | 7294 |
7298 #endif // ENABLE_DEBUGGER_SUPPORT | 7295 #endif // ENABLE_DEBUGGER_SUPPORT |
OLD | NEW |