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

Side by Side Diff: src/isolate.cc

Issue 11782028: Parallel and concurrent sweeping. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 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') | src/mark-compact.h » ('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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "log.h" 42 #include "log.h"
43 #include "messages.h" 43 #include "messages.h"
44 #include "platform.h" 44 #include "platform.h"
45 #include "regexp-stack.h" 45 #include "regexp-stack.h"
46 #include "runtime-profiler.h" 46 #include "runtime-profiler.h"
47 #include "scopeinfo.h" 47 #include "scopeinfo.h"
48 #include "serialize.h" 48 #include "serialize.h"
49 #include "simulator.h" 49 #include "simulator.h"
50 #include "spaces.h" 50 #include "spaces.h"
51 #include "stub-cache.h" 51 #include "stub-cache.h"
52 #include "sweeper-thread.h"
52 #include "version.h" 53 #include "version.h"
53 #include "vm-state-inl.h" 54 #include "vm-state-inl.h"
54 55
55 56
56 namespace v8 { 57 namespace v8 {
57 namespace internal { 58 namespace internal {
58 59
59 Atomic32 ThreadId::highest_thread_id_ = 0; 60 Atomic32 ThreadId::highest_thread_id_ = 0;
60 61
61 int ThreadId::AllocateThreadId() { 62 int ThreadId::AllocateThreadId() {
(...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after
1692 name##_ = (initial_value); 1693 name##_ = (initial_value);
1693 ISOLATE_INIT_LIST(ISOLATE_INIT_EXECUTE) 1694 ISOLATE_INIT_LIST(ISOLATE_INIT_EXECUTE)
1694 #undef ISOLATE_INIT_EXECUTE 1695 #undef ISOLATE_INIT_EXECUTE
1695 1696
1696 #define ISOLATE_INIT_ARRAY_EXECUTE(type, name, length) \ 1697 #define ISOLATE_INIT_ARRAY_EXECUTE(type, name, length) \
1697 memset(name##_, 0, sizeof(type) * length); 1698 memset(name##_, 0, sizeof(type) * length);
1698 ISOLATE_INIT_ARRAY_LIST(ISOLATE_INIT_ARRAY_EXECUTE) 1699 ISOLATE_INIT_ARRAY_LIST(ISOLATE_INIT_ARRAY_EXECUTE)
1699 #undef ISOLATE_INIT_ARRAY_EXECUTE 1700 #undef ISOLATE_INIT_ARRAY_EXECUTE
1700 } 1701 }
1701 1702
1703
1702 void Isolate::TearDown() { 1704 void Isolate::TearDown() {
1703 TRACE_ISOLATE(tear_down); 1705 TRACE_ISOLATE(tear_down);
1704 1706
1705 // Temporarily set this isolate as current so that various parts of 1707 // Temporarily set this isolate as current so that various parts of
1706 // the isolate can access it in their destructors without having a 1708 // the isolate can access it in their destructors without having a
1707 // direct pointer. We don't use Enter/Exit here to avoid 1709 // direct pointer. We don't use Enter/Exit here to avoid
1708 // initializing the thread data. 1710 // initializing the thread data.
1709 PerIsolateThreadData* saved_data = CurrentPerIsolateThreadData(); 1711 PerIsolateThreadData* saved_data = CurrentPerIsolateThreadData();
1710 Isolate* saved_isolate = UncheckedCurrent(); 1712 Isolate* saved_isolate = UncheckedCurrent();
1711 SetIsolateThreadLocals(this, NULL); 1713 SetIsolateThreadLocals(this, NULL);
(...skipping 15 matching lines...) Expand all
1727 1729
1728 // Restore the previous current isolate. 1730 // Restore the previous current isolate.
1729 SetIsolateThreadLocals(saved_isolate, saved_data); 1731 SetIsolateThreadLocals(saved_isolate, saved_data);
1730 } 1732 }
1731 1733
1732 1734
1733 void Isolate::Deinit() { 1735 void Isolate::Deinit() {
1734 if (state_ == INITIALIZED) { 1736 if (state_ == INITIALIZED) {
1735 TRACE_ISOLATE(deinit); 1737 TRACE_ISOLATE(deinit);
1736 1738
1739 if (FLAG_concurrent_sweeping || FLAG_parallel_sweeping) {
1740 for (int i = 0; i < FLAG_sweeper_threads; i++) {
1741 sweeper_thread_[i]->Stop();
1742 delete sweeper_thread_[i];
1743 }
1744 delete[] sweeper_thread_;
1745 }
1746
1737 if (FLAG_parallel_recompilation) optimizing_compiler_thread_.Stop(); 1747 if (FLAG_parallel_recompilation) optimizing_compiler_thread_.Stop();
1738 1748
1739 if (FLAG_hydrogen_stats) HStatistics::Instance()->Print(); 1749 if (FLAG_hydrogen_stats) HStatistics::Instance()->Print();
1740 1750
1741 // We must stop the logger before we tear down other components. 1751 // We must stop the logger before we tear down other components.
1742 logger_->EnsureTickerStopped(); 1752 logger_->EnsureTickerStopped();
1743 1753
1744 delete deoptimizer_data_; 1754 delete deoptimizer_data_;
1745 deoptimizer_data_ = NULL; 1755 deoptimizer_data_ = NULL;
1746 if (FLAG_preemption) { 1756 if (FLAG_preemption) {
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
2096 } 2106 }
2097 2107
2098 if (!Serializer::enabled()) { 2108 if (!Serializer::enabled()) {
2099 // Ensure that the stub failure trampoline has been generated. 2109 // Ensure that the stub failure trampoline has been generated.
2100 HandleScope scope(this); 2110 HandleScope scope(this);
2101 CodeStub::GenerateFPStubs(); 2111 CodeStub::GenerateFPStubs();
2102 StubFailureTrampolineStub().GetCode(); 2112 StubFailureTrampolineStub().GetCode();
2103 } 2113 }
2104 2114
2105 if (FLAG_parallel_recompilation) optimizing_compiler_thread_.Start(); 2115 if (FLAG_parallel_recompilation) optimizing_compiler_thread_.Start();
2116
2117 if (FLAG_parallel_sweeping || FLAG_concurrent_sweeping) {
2118 if (FLAG_sweeper_threads < 1) {
2119 FLAG_sweeper_threads = 1;
2120 }
2121 sweeper_thread_ = new SweeperThread*[FLAG_sweeper_threads];
2122 for (int i = 0; i < FLAG_sweeper_threads; i++) {
2123 sweeper_thread_[i] = new SweeperThread(this);
2124 sweeper_thread_[i]->Start();
2125 }
2126 }
2106 return true; 2127 return true;
2107 } 2128 }
2108 2129
2109 2130
2110 // Initialized lazily to allow early 2131 // Initialized lazily to allow early
2111 // v8::V8::SetAddHistogramSampleFunction calls. 2132 // v8::V8::SetAddHistogramSampleFunction calls.
2112 StatsTable* Isolate::stats_table() { 2133 StatsTable* Isolate::stats_table() {
2113 if (stats_table_ == NULL) { 2134 if (stats_table_ == NULL) {
2114 stats_table_ = new StatsTable; 2135 stats_table_ = new StatsTable;
2115 } 2136 }
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2224 2245
2225 #ifdef DEBUG 2246 #ifdef DEBUG
2226 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 2247 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
2227 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); 2248 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
2228 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 2249 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
2229 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 2250 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
2230 #undef ISOLATE_FIELD_OFFSET 2251 #undef ISOLATE_FIELD_OFFSET
2231 #endif 2252 #endif
2232 2253
2233 } } // namespace v8::internal 2254 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.h ('k') | src/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698