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

Side by Side Diff: src/isolate.cc

Issue 153953005: A64: Synchronize with r16993. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 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/mips/builtins-mips.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 1778 matching lines...) Expand 10 before | Expand all | Expand 10 after
1789 thread_manager_(NULL), 1789 thread_manager_(NULL),
1790 fp_stubs_generated_(false), 1790 fp_stubs_generated_(false),
1791 has_installed_extensions_(false), 1791 has_installed_extensions_(false),
1792 string_tracker_(NULL), 1792 string_tracker_(NULL),
1793 regexp_stack_(NULL), 1793 regexp_stack_(NULL),
1794 date_cache_(NULL), 1794 date_cache_(NULL),
1795 code_stub_interface_descriptors_(NULL), 1795 code_stub_interface_descriptors_(NULL),
1796 // TODO(bmeurer) Initialized lazily because it depends on flags; can 1796 // TODO(bmeurer) Initialized lazily because it depends on flags; can
1797 // be fixed once the default isolate cleanup is done. 1797 // be fixed once the default isolate cleanup is done.
1798 random_number_generator_(NULL), 1798 random_number_generator_(NULL),
1799 // TODO(rmcilroy) Currently setting this based on
1800 // FLAG_force_memory_constrained in Isolate::Init; move to here when
1801 // isolate cleanup is done
1802 is_memory_constrained_(false),
1803 has_fatal_error_(false), 1799 has_fatal_error_(false),
1804 use_crankshaft_(true), 1800 use_crankshaft_(true),
1805 initialized_from_snapshot_(false), 1801 initialized_from_snapshot_(false),
1806 cpu_profiler_(NULL), 1802 cpu_profiler_(NULL),
1807 heap_profiler_(NULL), 1803 heap_profiler_(NULL),
1808 function_entry_hook_(NULL), 1804 function_entry_hook_(NULL),
1809 deferred_handles_head_(NULL), 1805 deferred_handles_head_(NULL),
1810 optimizing_compiler_thread_(this), 1806 optimizing_compiler_thread_(NULL),
1811 marking_thread_(NULL), 1807 marking_thread_(NULL),
1812 sweeper_thread_(NULL), 1808 sweeper_thread_(NULL),
1813 stress_deopt_count_(0) { 1809 stress_deopt_count_(0) {
1814 id_ = NoBarrier_AtomicIncrement(&isolate_counter_, 1); 1810 id_ = NoBarrier_AtomicIncrement(&isolate_counter_, 1);
1815 TRACE_ISOLATE(constructor); 1811 TRACE_ISOLATE(constructor);
1816 1812
1817 memset(isolate_addresses_, 0, 1813 memset(isolate_addresses_, 0,
1818 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1)); 1814 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1));
1819 1815
1820 heap_.isolate_ = this; 1816 heap_.isolate_ = this;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1896 1892
1897 1893
1898 void Isolate::Deinit() { 1894 void Isolate::Deinit() {
1899 if (state_ == INITIALIZED) { 1895 if (state_ == INITIALIZED) {
1900 TRACE_ISOLATE(deinit); 1896 TRACE_ISOLATE(deinit);
1901 1897
1902 #ifdef ENABLE_DEBUGGER_SUPPORT 1898 #ifdef ENABLE_DEBUGGER_SUPPORT
1903 debugger()->UnloadDebugger(); 1899 debugger()->UnloadDebugger();
1904 #endif 1900 #endif
1905 1901
1906 if (FLAG_concurrent_recompilation) optimizing_compiler_thread_.Stop(); 1902 if (FLAG_concurrent_recompilation) {
1903 optimizing_compiler_thread_->Stop();
1904 delete optimizing_compiler_thread_;
1905 }
1907 1906
1908 if (FLAG_sweeper_threads > 0) { 1907 if (FLAG_sweeper_threads > 0) {
1909 for (int i = 0; i < FLAG_sweeper_threads; i++) { 1908 for (int i = 0; i < FLAG_sweeper_threads; i++) {
1910 sweeper_thread_[i]->Stop(); 1909 sweeper_thread_[i]->Stop();
1911 delete sweeper_thread_[i]; 1910 delete sweeper_thread_[i];
1912 } 1911 }
1913 delete[] sweeper_thread_; 1912 delete[] sweeper_thread_;
1914 } 1913 }
1915 1914
1916 if (FLAG_marking_threads > 0) { 1915 if (FLAG_marking_threads > 0) {
(...skipping 11 matching lines...) Expand all
1928 } 1927 }
1929 1928
1930 // We must stop the logger before we tear down other components. 1929 // We must stop the logger before we tear down other components.
1931 Sampler* sampler = logger_->sampler(); 1930 Sampler* sampler = logger_->sampler();
1932 if (sampler && sampler->IsActive()) sampler->Stop(); 1931 if (sampler && sampler->IsActive()) sampler->Stop();
1933 1932
1934 delete deoptimizer_data_; 1933 delete deoptimizer_data_;
1935 deoptimizer_data_ = NULL; 1934 deoptimizer_data_ = NULL;
1936 if (FLAG_preemption) { 1935 if (FLAG_preemption) {
1937 v8::Locker locker(reinterpret_cast<v8::Isolate*>(this)); 1936 v8::Locker locker(reinterpret_cast<v8::Isolate*>(this));
1938 v8::Locker::StopPreemption(); 1937 v8::Locker::StopPreemption(reinterpret_cast<v8::Isolate*>(this));
1939 } 1938 }
1940 builtins_.TearDown(); 1939 builtins_.TearDown();
1941 bootstrapper_->TearDown(); 1940 bootstrapper_->TearDown();
1942 1941
1943 // Remove the external reference to the preallocated stack memory. 1942 // Remove the external reference to the preallocated stack memory.
1944 delete preallocated_message_space_; 1943 delete preallocated_message_space_;
1945 preallocated_message_space_ = NULL; 1944 preallocated_message_space_ = NULL;
1946 PreallocatedMemoryThreadStop(); 1945 PreallocatedMemoryThreadStop();
1947 1946
1948 if (runtime_profiler_ != NULL) { 1947 if (runtime_profiler_ != NULL) {
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
2152 Release_Store(&debugger_initialized_, true); 2151 Release_Store(&debugger_initialized_, true);
2153 #endif 2152 #endif
2154 } 2153 }
2155 2154
2156 2155
2157 bool Isolate::Init(Deserializer* des) { 2156 bool Isolate::Init(Deserializer* des) {
2158 ASSERT(state_ != INITIALIZED); 2157 ASSERT(state_ != INITIALIZED);
2159 TRACE_ISOLATE(init); 2158 TRACE_ISOLATE(init);
2160 2159
2161 stress_deopt_count_ = FLAG_deopt_every_n_times; 2160 stress_deopt_count_ = FLAG_deopt_every_n_times;
2162 if (FLAG_force_memory_constrained.has_value)
2163 is_memory_constrained_ = FLAG_force_memory_constrained.value;
2164 2161
2165 has_fatal_error_ = false; 2162 has_fatal_error_ = false;
2166 2163
2167 use_crankshaft_ = FLAG_crankshaft 2164 use_crankshaft_ = FLAG_crankshaft
2168 && !Serializer::enabled() 2165 && !Serializer::enabled()
2169 && CPU::SupportsCrankshaft(); 2166 && CPU::SupportsCrankshaft();
2170 2167
2171 if (function_entry_hook() != NULL) { 2168 if (function_entry_hook() != NULL) {
2172 // When function entry hooking is in effect, we have to create the code 2169 // When function entry hooking is in effect, we have to create the code
2173 // stubs from scratch to get entry hooks, rather than loading the previously 2170 // stubs from scratch to get entry hooks, rather than loading the previously
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
2238 2235
2239 // SetUp the object heap. 2236 // SetUp the object heap.
2240 ASSERT(!heap_.HasBeenSetUp()); 2237 ASSERT(!heap_.HasBeenSetUp());
2241 if (!heap_.SetUp()) { 2238 if (!heap_.SetUp()) {
2242 V8::FatalProcessOutOfMemory("heap setup"); 2239 V8::FatalProcessOutOfMemory("heap setup");
2243 return false; 2240 return false;
2244 } 2241 }
2245 2242
2246 deoptimizer_data_ = new DeoptimizerData(memory_allocator_); 2243 deoptimizer_data_ = new DeoptimizerData(memory_allocator_);
2247 2244
2245 if (FLAG_concurrent_recompilation) {
2246 optimizing_compiler_thread_ = new OptimizingCompilerThread(this);
2247 optimizing_compiler_thread_->Start();
2248 }
2249
2248 const bool create_heap_objects = (des == NULL); 2250 const bool create_heap_objects = (des == NULL);
2249 if (create_heap_objects && !heap_.CreateHeapObjects()) { 2251 if (create_heap_objects && !heap_.CreateHeapObjects()) {
2250 V8::FatalProcessOutOfMemory("heap object creation"); 2252 V8::FatalProcessOutOfMemory("heap object creation");
2251 return false; 2253 return false;
2252 } 2254 }
2253 2255
2254 if (create_heap_objects) { 2256 if (create_heap_objects) {
2255 // Terminate the cache array with the sentinel so we can iterate. 2257 // Terminate the cache array with the sentinel so we can iterate.
2256 PushToPartialSnapshotCache(heap_.undefined_value()); 2258 PushToPartialSnapshotCache(heap_.undefined_value());
2257 } 2259 }
2258 2260
2259 InitializeThreadLocal(); 2261 InitializeThreadLocal();
2260 2262
2261 bootstrapper_->Initialize(create_heap_objects); 2263 bootstrapper_->Initialize(create_heap_objects);
2262 builtins_.SetUp(this, create_heap_objects); 2264 builtins_.SetUp(this, create_heap_objects);
2263 2265
2264 // Only preallocate on the first initialization. 2266 // Only preallocate on the first initialization.
2265 if (FLAG_preallocate_message_memory && preallocated_message_space_ == NULL) { 2267 if (FLAG_preallocate_message_memory && preallocated_message_space_ == NULL) {
2266 // Start the thread which will set aside some memory. 2268 // Start the thread which will set aside some memory.
2267 PreallocatedMemoryThreadStart(); 2269 PreallocatedMemoryThreadStart();
2268 preallocated_message_space_ = 2270 preallocated_message_space_ =
2269 new NoAllocationStringAllocator( 2271 new NoAllocationStringAllocator(
2270 preallocated_memory_thread_->data(), 2272 preallocated_memory_thread_->data(),
2271 preallocated_memory_thread_->length()); 2273 preallocated_memory_thread_->length());
2272 PreallocatedStorageInit(preallocated_memory_thread_->length() / 4); 2274 PreallocatedStorageInit(preallocated_memory_thread_->length() / 4);
2273 } 2275 }
2274 2276
2275 if (FLAG_preemption) { 2277 if (FLAG_preemption) {
2276 v8::Locker locker(reinterpret_cast<v8::Isolate*>(this)); 2278 v8::Locker locker(reinterpret_cast<v8::Isolate*>(this));
2277 v8::Locker::StartPreemption(100); 2279 v8::Locker::StartPreemption(reinterpret_cast<v8::Isolate*>(this), 100);
2278 } 2280 }
2279 2281
2280 #ifdef ENABLE_DEBUGGER_SUPPORT 2282 #ifdef ENABLE_DEBUGGER_SUPPORT
2281 debug_->SetUp(create_heap_objects); 2283 debug_->SetUp(create_heap_objects);
2282 #endif 2284 #endif
2283 2285
2284 // If we are deserializing, read the state into the now-empty heap. 2286 // If we are deserializing, read the state into the now-empty heap.
2285 if (!create_heap_objects) { 2287 if (!create_heap_objects) {
2286 des->Deserialize(this); 2288 des->Deserialize(this);
2287 } 2289 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
2344 DONT_TRACK_ALLOCATION_SITE, 0); 2346 DONT_TRACK_ALLOCATION_SITE, 0);
2345 stub.InitializeInterfaceDescriptor( 2347 stub.InitializeInterfaceDescriptor(
2346 this, code_stub_interface_descriptor(CodeStub::FastCloneShallowArray)); 2348 this, code_stub_interface_descriptor(CodeStub::FastCloneShallowArray));
2347 CompareNilICStub::InitializeForIsolate(this); 2349 CompareNilICStub::InitializeForIsolate(this);
2348 ToBooleanStub::InitializeForIsolate(this); 2350 ToBooleanStub::InitializeForIsolate(this);
2349 ArrayConstructorStubBase::InstallDescriptors(this); 2351 ArrayConstructorStubBase::InstallDescriptors(this);
2350 InternalArrayConstructorStubBase::InstallDescriptors(this); 2352 InternalArrayConstructorStubBase::InstallDescriptors(this);
2351 FastNewClosureStub::InstallDescriptors(this); 2353 FastNewClosureStub::InstallDescriptors(this);
2352 } 2354 }
2353 2355
2354 if (FLAG_concurrent_recompilation) optimizing_compiler_thread_.Start();
2355
2356 if (FLAG_marking_threads > 0) { 2356 if (FLAG_marking_threads > 0) {
2357 marking_thread_ = new MarkingThread*[FLAG_marking_threads]; 2357 marking_thread_ = new MarkingThread*[FLAG_marking_threads];
2358 for (int i = 0; i < FLAG_marking_threads; i++) { 2358 for (int i = 0; i < FLAG_marking_threads; i++) {
2359 marking_thread_[i] = new MarkingThread(this); 2359 marking_thread_[i] = new MarkingThread(this);
2360 marking_thread_[i]->Start(); 2360 marking_thread_[i]->Start();
2361 } 2361 }
2362 } 2362 }
2363 2363
2364 if (FLAG_sweeper_threads > 0) { 2364 if (FLAG_sweeper_threads > 0) {
2365 sweeper_thread_ = new SweeperThread*[FLAG_sweeper_threads]; 2365 sweeper_thread_ = new SweeperThread*[FLAG_sweeper_threads];
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
2547 2547
2548 #ifdef DEBUG 2548 #ifdef DEBUG
2549 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 2549 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
2550 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); 2550 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
2551 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 2551 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
2552 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 2552 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
2553 #undef ISOLATE_FIELD_OFFSET 2553 #undef ISOLATE_FIELD_OFFSET
2554 #endif 2554 #endif
2555 2555
2556 } } // namespace v8::internal 2556 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.h ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698