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

Side by Side Diff: src/isolate.cc

Issue 12907006: Isolatify HeapProfiler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Prohibited construction and destruction of v8::HeapProfiler Created 7 years, 9 months 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 | « src/isolate.h ('k') | test/cctest/test-heap-profiler.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 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 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after
1672 context_switcher_(NULL), 1672 context_switcher_(NULL),
1673 thread_manager_(NULL), 1673 thread_manager_(NULL),
1674 fp_stubs_generated_(false), 1674 fp_stubs_generated_(false),
1675 has_installed_extensions_(false), 1675 has_installed_extensions_(false),
1676 string_tracker_(NULL), 1676 string_tracker_(NULL),
1677 regexp_stack_(NULL), 1677 regexp_stack_(NULL),
1678 date_cache_(NULL), 1678 date_cache_(NULL),
1679 code_stub_interface_descriptors_(NULL), 1679 code_stub_interface_descriptors_(NULL),
1680 context_exit_happened_(false), 1680 context_exit_happened_(false),
1681 cpu_profiler_(NULL), 1681 cpu_profiler_(NULL),
1682 heap_profiler_(NULL),
1682 deferred_handles_head_(NULL), 1683 deferred_handles_head_(NULL),
1683 optimizing_compiler_thread_(this), 1684 optimizing_compiler_thread_(this),
1684 marking_thread_(NULL), 1685 marking_thread_(NULL),
1685 sweeper_thread_(NULL) { 1686 sweeper_thread_(NULL) {
1686 id_ = NoBarrier_AtomicIncrement(&isolate_counter_, 1); 1687 id_ = NoBarrier_AtomicIncrement(&isolate_counter_, 1);
1687 TRACE_ISOLATE(constructor); 1688 TRACE_ISOLATE(constructor);
1688 1689
1689 memset(isolate_addresses_, 0, 1690 memset(isolate_addresses_, 0,
1690 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1)); 1691 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1));
1691 1692
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1803 v8::Locker::StopPreemption(); 1804 v8::Locker::StopPreemption();
1804 } 1805 }
1805 builtins_.TearDown(); 1806 builtins_.TearDown();
1806 bootstrapper_->TearDown(); 1807 bootstrapper_->TearDown();
1807 1808
1808 // Remove the external reference to the preallocated stack memory. 1809 // Remove the external reference to the preallocated stack memory.
1809 delete preallocated_message_space_; 1810 delete preallocated_message_space_;
1810 preallocated_message_space_ = NULL; 1811 preallocated_message_space_ = NULL;
1811 PreallocatedMemoryThreadStop(); 1812 PreallocatedMemoryThreadStop();
1812 1813
1813 HeapProfiler::TearDown(); 1814 delete heap_profiler_;
1815 heap_profiler_ = NULL;
1814 delete cpu_profiler_; 1816 delete cpu_profiler_;
1815 cpu_profiler_ = NULL; 1817 cpu_profiler_ = NULL;
1816 1818
1817 if (runtime_profiler_ != NULL) { 1819 if (runtime_profiler_ != NULL) {
1818 runtime_profiler_->TearDown(); 1820 runtime_profiler_->TearDown();
1819 delete runtime_profiler_; 1821 delete runtime_profiler_;
1820 runtime_profiler_ = NULL; 1822 runtime_profiler_ = NULL;
1821 } 1823 }
1822 heap_.TearDown(); 1824 heap_.TearDown();
1823 logger_->TearDown(); 1825 logger_->TearDown();
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
2036 regexp_stack_ = new RegExpStack(); 2038 regexp_stack_ = new RegExpStack();
2037 regexp_stack_->isolate_ = this; 2039 regexp_stack_->isolate_ = this;
2038 date_cache_ = new DateCache(); 2040 date_cache_ = new DateCache();
2039 code_stub_interface_descriptors_ = 2041 code_stub_interface_descriptors_ =
2040 new CodeStubInterfaceDescriptor[CodeStub::NUMBER_OF_IDS]; 2042 new CodeStubInterfaceDescriptor[CodeStub::NUMBER_OF_IDS];
2041 2043
2042 // Enable logging before setting up the heap 2044 // Enable logging before setting up the heap
2043 logger_->SetUp(); 2045 logger_->SetUp();
2044 2046
2045 cpu_profiler_ = new CpuProfiler(this); 2047 cpu_profiler_ = new CpuProfiler(this);
2046 HeapProfiler::SetUp(); 2048 heap_profiler_ = new HeapProfiler(heap());
2047 2049
2048 // Initialize other runtime facilities 2050 // Initialize other runtime facilities
2049 #if defined(USE_SIMULATOR) 2051 #if defined(USE_SIMULATOR)
2050 #if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS) 2052 #if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS)
2051 Simulator::Initialize(this); 2053 Simulator::Initialize(this);
2052 #endif 2054 #endif
2053 #endif 2055 #endif
2054 2056
2055 { // NOLINT 2057 { // NOLINT
2056 // Ensure that the thread has a valid stack guard. The v8::Locker object 2058 // Ensure that the thread has a valid stack guard. The v8::Locker object
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
2368 2370
2369 #ifdef DEBUG 2371 #ifdef DEBUG
2370 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 2372 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
2371 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); 2373 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
2372 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 2374 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
2373 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 2375 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
2374 #undef ISOLATE_FIELD_OFFSET 2376 #undef ISOLATE_FIELD_OFFSET
2375 #endif 2377 #endif
2376 2378
2377 } } // namespace v8::internal 2379 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.h ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698