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

Unified Diff: src/isolate.h

Issue 110573004: Merge bleeding_edge 17696:18016. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« include/v8-platform.h ('K') | « src/ic-inl.h ('k') | src/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.h
diff --git a/src/isolate.h b/src/isolate.h
index 12afd5f22848231da249f5509ab9b7a5db5198e3..b00be2822a15925670579819c610ccb86b024bdd 100644
--- a/src/isolate.h
+++ b/src/isolate.h
@@ -60,7 +60,6 @@ struct CodeStubInterfaceDescriptor;
class CodeTracer;
class CompilationCache;
class ContextSlotCache;
-class ContextSwitcher;
class Counters;
class CpuFeatures;
class CpuProfiler;
@@ -78,7 +77,6 @@ class HTracer;
class InlineRuntimeFunctionsTable;
class NoAllocationStringAllocator;
class InnerPointerToCodeCache;
-class PreallocatedMemoryThread;
class RandomNumberGenerator;
class RegExpStack;
class SaveContext;
@@ -304,20 +302,6 @@ class ThreadLocalTop BASE_EMBEDDED {
};
-class SystemThreadManager {
- public:
- enum ParallelSystemComponent {
- PARALLEL_SWEEPING,
- CONCURRENT_SWEEPING,
- CONCURRENT_RECOMPILATION
- };
-
- static int NumberOfParallelSystemThreads(ParallelSystemComponent type);
-
- static const int kMaxThreads = 4;
-};
-
-
#ifdef ENABLE_DEBUGGER_SUPPORT
#define ISOLATE_DEBUGGER_INIT_LIST(V) \
@@ -348,7 +332,7 @@ class SystemThreadManager {
V(uint32_t, private_random_seed, 2) \
ISOLATE_INIT_DEBUG_ARRAY_LIST(V)
-typedef List<HeapObject*, PreallocatedStorageAllocationPolicy> DebugObjectCache;
+typedef List<HeapObject*> DebugObjectCache;
#define ISOLATE_INIT_LIST(V) \
/* SerializerDeserializer state. */ \
@@ -734,10 +718,8 @@ class Isolate {
}
void PrintCurrentStackTrace(FILE* out);
- void PrintStackTrace(FILE* out, char* thread_data);
void PrintStack(StringStream* accumulator);
void PrintStack(FILE* out);
- void PrintStack();
Handle<String> StackTraceString();
NO_INLINE(void PushStackTraceAndDie(unsigned int magic,
Object* object,
@@ -939,12 +921,6 @@ class Isolate {
ThreadManager* thread_manager() { return thread_manager_; }
- ContextSwitcher* context_switcher() { return context_switcher_; }
-
- void set_context_switcher(ContextSwitcher* switcher) {
- context_switcher_ = switcher;
- }
-
StringTracker* string_tracker() { return string_tracker_; }
unibrow::Mapping<unibrow::Ecma262UnCanonicalize>* jsregexp_uncanonicalize() {
@@ -995,10 +971,6 @@ class Isolate {
return &interp_canonicalize_mapping_;
}
- void* PreallocatedStorageNew(size_t size);
- void PreallocatedStorageDelete(void* p);
- void PreallocatedStorageInit(size_t size);
-
inline bool IsCodePreAgingActive();
#ifdef ENABLE_DEBUGGER_SUPPORT
@@ -1067,8 +1039,14 @@ class Isolate {
thread_local_top_.current_vm_state_ = state;
}
- void SetData(void* data) { embedder_data_ = data; }
- void* GetData() { return embedder_data_; }
+ void SetData(uint32_t slot, void* data) {
+ ASSERT(slot < Internals::kNumIsolateDataSlots);
+ embedder_data_[slot] = data;
+ }
+ void* GetData(uint32_t slot) {
+ ASSERT(slot < Internals::kNumIsolateDataSlots);
+ return embedder_data_[slot];
+ }
LookupResult* top_lookup_result() {
return thread_local_top_.top_lookup_result_;
@@ -1114,19 +1092,41 @@ class Isolate {
bool IsDeferredHandle(Object** location);
#endif // DEBUG
+ void set_max_available_threads(int value) {
+ max_available_threads_ = value;
+ }
+
+ bool concurrent_recompilation_enabled() {
+ // Thread is only available with flag enabled.
+ ASSERT(optimizing_compiler_thread_ == NULL ||
+ FLAG_concurrent_recompilation);
+ return optimizing_compiler_thread_ != NULL;
+ }
+
+ bool concurrent_osr_enabled() const {
+ // Thread is only available with flag enabled.
+ ASSERT(optimizing_compiler_thread_ == NULL ||
+ FLAG_concurrent_recompilation);
+ return optimizing_compiler_thread_ != NULL && FLAG_concurrent_osr;
+ }
+
OptimizingCompilerThread* optimizing_compiler_thread() {
return optimizing_compiler_thread_;
}
- // PreInits and returns a default isolate. Needed when a new thread tries
- // to create a Locker for the first time (the lock itself is in the isolate).
- // TODO(svenpanne) This method is on death row...
- static v8::Isolate* GetDefaultIsolateForLocking();
+ int num_sweeper_threads() const {
+ return num_sweeper_threads_;
+ }
SweeperThread** sweeper_threads() {
return sweeper_thread_;
}
+ // PreInits and returns a default isolate. Needed when a new thread tries
+ // to create a Locker for the first time (the lock itself is in the isolate).
+ // TODO(svenpanne) This method is on death row...
+ static v8::Isolate* GetDefaultIsolateForLocking();
+
int id() const { return static_cast<int>(id_); }
HStatistics* GetHStatistics();
@@ -1162,9 +1162,9 @@ class Isolate {
// These fields are accessed through the API, offsets must be kept in sync
// with v8::internal::Internals (in include/v8.h) constants. This is also
// verified in Isolate::Init() using runtime checks.
- State state_; // Will be padded to kApiPointerSize.
- void* embedder_data_;
+ void* embedder_data_[Internals::kNumIsolateDataSlots];
Heap heap_;
+ State state_; // Will be padded to kApiPointerSize.
// The per-process lock should be acquired before the ThreadDataTable is
// modified.
@@ -1240,11 +1240,8 @@ class Isolate {
// at the same time, this should be prevented using external locking.
void Exit();
- void PreallocatedMemoryThreadStart();
- void PreallocatedMemoryThreadStop();
void InitializeThreadLocal();
- void PrintStackTrace(FILE* out, ThreadLocalTop* thread);
void MarkCompactPrologue(bool is_compacting,
ThreadLocalTop* archived_thread_data);
void MarkCompactEpilogue(bool is_compacting,
@@ -1267,10 +1264,7 @@ class Isolate {
EntryStackItem* entry_stack_;
int stack_trace_nesting_level_;
StringStream* incomplete_message_;
- // The preallocated memory thread singleton.
- PreallocatedMemoryThread* preallocated_memory_thread_;
Address isolate_addresses_[kIsolateAddressCount + 1]; // NOLINT
- NoAllocationStringAllocator* preallocated_message_space_;
Bootstrapper* bootstrapper_;
RuntimeProfiler* runtime_profiler_;
CompilationCache* compilation_cache_;
@@ -1297,14 +1291,10 @@ class Isolate {
HandleScopeImplementer* handle_scope_implementer_;
UnicodeCache* unicode_cache_;
Zone runtime_zone_;
- PreallocatedStorage in_use_list_;
- PreallocatedStorage free_list_;
- bool preallocated_storage_preallocated_;
InnerPointerToCodeCache* inner_pointer_to_code_cache_;
ConsStringIteratorOp* write_iterator_;
GlobalHandles* global_handles_;
EternalHandles* eternal_handles_;
- ContextSwitcher* context_switcher_;
ThreadManager* thread_manager_;
RuntimeState runtime_state_;
bool fp_stubs_generated_;
@@ -1382,6 +1372,11 @@ class Isolate {
DeferredHandles* deferred_handles_head_;
OptimizingCompilerThread* optimizing_compiler_thread_;
SweeperThread** sweeper_thread_;
+ int num_sweeper_threads_;
+
+ // TODO(yangguo): This will become obsolete once ResourceConstraints
+ // becomes an argument to Isolate constructor.
+ int max_available_threads_;
// Counts deopt points if deopt_every_n_times is enabled.
unsigned int stress_deopt_count_;
« include/v8-platform.h ('K') | « src/ic-inl.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698