| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdlib.h> | 5 #include <stdlib.h> |
| 6 | 6 |
| 7 #include "v8.h" | 7 #include "v8.h" |
| 8 | 8 |
| 9 #include "ast.h" | 9 #include "ast.h" |
| 10 #include "bootstrapper.h" | 10 #include "bootstrapper.h" |
| 11 #include "codegen.h" | 11 #include "codegen.h" |
| 12 #include "compilation-cache.h" | 12 #include "compilation-cache.h" |
| 13 #include "cpu-profiler.h" | 13 #include "cpu-profiler.h" |
| 14 #include "debug.h" | 14 #include "debug.h" |
| 15 #include "deoptimizer.h" | 15 #include "deoptimizer.h" |
| 16 #include "heap-profiler.h" | 16 #include "heap-profiler.h" |
| 17 #include "hydrogen.h" | 17 #include "hydrogen.h" |
| 18 #include "isolate-inl.h" | 18 #include "isolate-inl.h" |
| 19 #include "lithium-allocator.h" | 19 #include "lithium-allocator.h" |
| 20 #include "log.h" | 20 #include "log.h" |
| 21 #include "messages.h" | 21 #include "messages.h" |
| 22 #include "parser-thread.h" |
| 22 #include "platform.h" | 23 #include "platform.h" |
| 23 #include "regexp-stack.h" | 24 #include "regexp-stack.h" |
| 24 #include "runtime-profiler.h" | 25 #include "runtime-profiler.h" |
| 25 #include "sampler.h" | 26 #include "sampler.h" |
| 26 #include "scopeinfo.h" | 27 #include "scopeinfo.h" |
| 27 #include "serialize.h" | 28 #include "serialize.h" |
| 28 #include "simulator.h" | 29 #include "simulator.h" |
| 29 #include "spaces.h" | 30 #include "spaces.h" |
| 30 #include "stub-cache.h" | 31 #include "stub-cache.h" |
| 31 #include "sweeper-thread.h" | 32 #include "sweeper-thread.h" |
| (...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1472 // be fixed once the default isolate cleanup is done. | 1473 // be fixed once the default isolate cleanup is done. |
| 1473 random_number_generator_(NULL), | 1474 random_number_generator_(NULL), |
| 1474 has_fatal_error_(false), | 1475 has_fatal_error_(false), |
| 1475 use_crankshaft_(true), | 1476 use_crankshaft_(true), |
| 1476 initialized_from_snapshot_(false), | 1477 initialized_from_snapshot_(false), |
| 1477 cpu_profiler_(NULL), | 1478 cpu_profiler_(NULL), |
| 1478 heap_profiler_(NULL), | 1479 heap_profiler_(NULL), |
| 1479 function_entry_hook_(NULL), | 1480 function_entry_hook_(NULL), |
| 1480 deferred_handles_head_(NULL), | 1481 deferred_handles_head_(NULL), |
| 1481 optimizing_compiler_thread_(NULL), | 1482 optimizing_compiler_thread_(NULL), |
| 1483 fast_parser_thread_(NULL), |
| 1482 sweeper_thread_(NULL), | 1484 sweeper_thread_(NULL), |
| 1483 num_sweeper_threads_(0), | 1485 num_sweeper_threads_(0), |
| 1484 stress_deopt_count_(0), | 1486 stress_deopt_count_(0), |
| 1485 next_optimization_id_(0) { | 1487 next_optimization_id_(0) { |
| 1486 id_ = NoBarrier_AtomicIncrement(&isolate_counter_, 1); | 1488 id_ = NoBarrier_AtomicIncrement(&isolate_counter_, 1); |
| 1487 TRACE_ISOLATE(constructor); | 1489 TRACE_ISOLATE(constructor); |
| 1488 | 1490 |
| 1489 memset(isolate_addresses_, 0, | 1491 memset(isolate_addresses_, 0, |
| 1490 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1)); | 1492 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1)); |
| 1491 | 1493 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1559 TRACE_ISOLATE(deinit); | 1561 TRACE_ISOLATE(deinit); |
| 1560 | 1562 |
| 1561 debugger()->UnloadDebugger(); | 1563 debugger()->UnloadDebugger(); |
| 1562 | 1564 |
| 1563 if (concurrent_recompilation_enabled()) { | 1565 if (concurrent_recompilation_enabled()) { |
| 1564 optimizing_compiler_thread_->Stop(); | 1566 optimizing_compiler_thread_->Stop(); |
| 1565 delete optimizing_compiler_thread_; | 1567 delete optimizing_compiler_thread_; |
| 1566 optimizing_compiler_thread_ = NULL; | 1568 optimizing_compiler_thread_ = NULL; |
| 1567 } | 1569 } |
| 1568 | 1570 |
| 1571 if (fast_parser_thread_) { |
| 1572 fast_parser_thread_->Stop(); |
| 1573 delete fast_parser_thread_; |
| 1574 fast_parser_thread_ = NULL; |
| 1575 } |
| 1576 |
| 1569 for (int i = 0; i < num_sweeper_threads_; i++) { | 1577 for (int i = 0; i < num_sweeper_threads_; i++) { |
| 1570 sweeper_thread_[i]->Stop(); | 1578 sweeper_thread_[i]->Stop(); |
| 1571 delete sweeper_thread_[i]; | 1579 delete sweeper_thread_[i]; |
| 1572 sweeper_thread_[i] = NULL; | 1580 sweeper_thread_[i] = NULL; |
| 1573 } | 1581 } |
| 1574 delete[] sweeper_thread_; | 1582 delete[] sweeper_thread_; |
| 1575 sweeper_thread_ = NULL; | 1583 sweeper_thread_ = NULL; |
| 1576 | 1584 |
| 1577 if (FLAG_job_based_sweeping && | 1585 if (FLAG_job_based_sweeping && |
| 1578 heap_.mark_compact_collector()->IsConcurrentSweepingInProgress()) { | 1586 heap_.mark_compact_collector()->IsConcurrentSweepingInProgress()) { |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1916 } | 1924 } |
| 1917 | 1925 |
| 1918 if (num_sweeper_threads_ > 0) { | 1926 if (num_sweeper_threads_ > 0) { |
| 1919 sweeper_thread_ = new SweeperThread*[num_sweeper_threads_]; | 1927 sweeper_thread_ = new SweeperThread*[num_sweeper_threads_]; |
| 1920 for (int i = 0; i < num_sweeper_threads_; i++) { | 1928 for (int i = 0; i < num_sweeper_threads_; i++) { |
| 1921 sweeper_thread_[i] = new SweeperThread(this); | 1929 sweeper_thread_[i] = new SweeperThread(this); |
| 1922 sweeper_thread_[i]->Start(); | 1930 sweeper_thread_[i]->Start(); |
| 1923 } | 1931 } |
| 1924 } | 1932 } |
| 1925 | 1933 |
| 1934 if (FLAG_parallel_parse) { |
| 1935 fast_parser_thread_ = new FastParserThread(); |
| 1936 fast_parser_thread_->Start(); |
| 1937 } |
| 1938 |
| 1926 // If we are deserializing, read the state into the now-empty heap. | 1939 // If we are deserializing, read the state into the now-empty heap. |
| 1927 if (!create_heap_objects) { | 1940 if (!create_heap_objects) { |
| 1928 des->Deserialize(this); | 1941 des->Deserialize(this); |
| 1929 } | 1942 } |
| 1930 stub_cache_->Initialize(); | 1943 stub_cache_->Initialize(); |
| 1931 | 1944 |
| 1932 // Finish initialization of ThreadLocal after deserialization is done. | 1945 // Finish initialization of ThreadLocal after deserialization is done. |
| 1933 clear_pending_exception(); | 1946 clear_pending_exception(); |
| 1934 clear_pending_message(); | 1947 clear_pending_message(); |
| 1935 clear_scheduled_exception(); | 1948 clear_scheduled_exception(); |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2301 Execution::Call(this, microtask, factory()->undefined_value(), | 2314 Execution::Call(this, microtask, factory()->undefined_value(), |
| 2302 0, NULL).Check(); | 2315 0, NULL).Check(); |
| 2303 } | 2316 } |
| 2304 } | 2317 } |
| 2305 | 2318 |
| 2306 handle_scope_implementer()->DecrementCallDepth(); | 2319 handle_scope_implementer()->DecrementCallDepth(); |
| 2307 } | 2320 } |
| 2308 | 2321 |
| 2309 | 2322 |
| 2310 } } // namespace v8::internal | 2323 } } // namespace v8::internal |
| OLD | NEW |