Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: test/cctest/test-debug.cc

Issue 435003: Patch for allowing several V8 instances in process:... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/cctest/cctest.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 } 363 }
364 364
365 365
366 // This function is in namespace v8::internal to be friend with class 366 // This function is in namespace v8::internal to be friend with class
367 // v8::internal::Debug. 367 // v8::internal::Debug.
368 namespace v8 { 368 namespace v8 {
369 namespace internal { 369 namespace internal {
370 370
371 // Collect the currently debugged functions. 371 // Collect the currently debugged functions.
372 Handle<FixedArray> GetDebuggedFunctions() { 372 Handle<FixedArray> GetDebuggedFunctions() {
373 v8::internal::DebugInfoListNode* node = Debug::debug_info_list_; 373 v8::internal::DebugInfoListNode* node =
374 v8_context()->debug_data_.debug_info_list_;
374 375
375 // Find the number of debugged functions. 376 // Find the number of debugged functions.
376 int count = 0; 377 int count = 0;
377 while (node) { 378 while (node) {
378 count++; 379 count++;
379 node = node->next(); 380 node = node->next();
380 } 381 }
381 382
382 // Allocate array for the debugged functions 383 // Allocate array for the debugged functions
383 Handle<FixedArray> debugged_functions = 384 Handle<FixedArray> debugged_functions =
(...skipping 14 matching lines...) Expand all
398 CALL_HEAP_FUNCTION(v8::internal::StubCache::ComputeCallDebugBreak(argc), 399 CALL_HEAP_FUNCTION(v8::internal::StubCache::ComputeCallDebugBreak(argc),
399 Code); 400 Code);
400 } 401 }
401 402
402 403
403 // Check that the debugger has been fully unloaded. 404 // Check that the debugger has been fully unloaded.
404 void CheckDebuggerUnloaded(bool check_functions) { 405 void CheckDebuggerUnloaded(bool check_functions) {
405 // Check that the debugger context is cleared and that there is no debug 406 // Check that the debugger context is cleared and that there is no debug
406 // information stored for the debugger. 407 // information stored for the debugger.
407 CHECK(Debug::debug_context().is_null()); 408 CHECK(Debug::debug_context().is_null());
408 CHECK_EQ(NULL, Debug::debug_info_list_); 409 CHECK_EQ(NULL, v8_context()->debug_data_.debug_info_list_);
409 410
410 // Collect garbage to ensure weak handles are cleared. 411 // Collect garbage to ensure weak handles are cleared.
411 Heap::CollectAllGarbage(false); 412 Heap::CollectAllGarbage(false);
412 Heap::CollectAllGarbage(false); 413 Heap::CollectAllGarbage(false);
413 414
414 // Iterate the head and check that there are no debugger related objects left. 415 // Iterate the head and check that there are no debugger related objects left.
415 HeapIterator iterator; 416 HeapIterator iterator;
416 while (iterator.has_next()) { 417 while (iterator.has_next()) {
417 HeapObject* obj = iterator.next(); 418 HeapObject* obj = iterator.next();
418 CHECK(obj != NULL); 419 CHECK(obj != NULL);
(...skipping 5327 matching lines...) Expand 10 before | Expand all | Expand 10 after
5746 5747
5747 break_point_hit_count = 0; 5748 break_point_hit_count = 0;
5748 foo->Call(env->Global(), 0, NULL); 5749 foo->Call(env->Global(), 0, NULL);
5749 CHECK_EQ(1, break_point_hit_count); 5750 CHECK_EQ(1, break_point_hit_count);
5750 5751
5751 v8::Debug::SetDebugEventListener(NULL); 5752 v8::Debug::SetDebugEventListener(NULL);
5752 debugee_context = v8::Handle<v8::Context>(); 5753 debugee_context = v8::Handle<v8::Context>();
5753 debugger_context = v8::Handle<v8::Context>(); 5754 debugger_context = v8::Handle<v8::Context>();
5754 CheckDebuggerUnloaded(); 5755 CheckDebuggerUnloaded();
5755 } 5756 }
OLDNEW
« no previous file with comments | « test/cctest/cctest.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698