| 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 "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "src/ast.h" | 9 #include "src/ast.h" |
| 10 #include "src/background-parser-thread.h" |
| 10 #include "src/base/platform/platform.h" | 11 #include "src/base/platform/platform.h" |
| 11 #include "src/base/utils/random-number-generator.h" | 12 #include "src/base/utils/random-number-generator.h" |
| 12 #include "src/bootstrapper.h" | 13 #include "src/bootstrapper.h" |
| 13 #include "src/codegen.h" | 14 #include "src/codegen.h" |
| 14 #include "src/compilation-cache.h" | 15 #include "src/compilation-cache.h" |
| 15 #include "src/cpu-profiler.h" | 16 #include "src/cpu-profiler.h" |
| 16 #include "src/debug.h" | 17 #include "src/debug.h" |
| 17 #include "src/deoptimizer.h" | 18 #include "src/deoptimizer.h" |
| 18 #include "src/heap/spaces.h" | 19 #include "src/heap/spaces.h" |
| 19 #include "src/heap/sweeper-thread.h" | 20 #include "src/heap/sweeper-thread.h" |
| (...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1463 // be fixed once the default isolate cleanup is done. | 1464 // be fixed once the default isolate cleanup is done. |
| 1464 random_number_generator_(NULL), | 1465 random_number_generator_(NULL), |
| 1465 serializer_enabled_(false), | 1466 serializer_enabled_(false), |
| 1466 has_fatal_error_(false), | 1467 has_fatal_error_(false), |
| 1467 initialized_from_snapshot_(false), | 1468 initialized_from_snapshot_(false), |
| 1468 cpu_profiler_(NULL), | 1469 cpu_profiler_(NULL), |
| 1469 heap_profiler_(NULL), | 1470 heap_profiler_(NULL), |
| 1470 function_entry_hook_(NULL), | 1471 function_entry_hook_(NULL), |
| 1471 deferred_handles_head_(NULL), | 1472 deferred_handles_head_(NULL), |
| 1472 optimizing_compiler_thread_(NULL), | 1473 optimizing_compiler_thread_(NULL), |
| 1474 background_parser_thread_(NULL), |
| 1473 sweeper_thread_(NULL), | 1475 sweeper_thread_(NULL), |
| 1474 num_sweeper_threads_(0), | 1476 num_sweeper_threads_(0), |
| 1475 stress_deopt_count_(0), | 1477 stress_deopt_count_(0), |
| 1476 next_optimization_id_(0), | 1478 next_optimization_id_(0), |
| 1477 use_counter_callback_(NULL) { | 1479 use_counter_callback_(NULL) { |
| 1478 id_ = base::NoBarrier_AtomicIncrement(&isolate_counter_, 1); | 1480 id_ = base::NoBarrier_AtomicIncrement(&isolate_counter_, 1); |
| 1479 TRACE_ISOLATE(constructor); | 1481 TRACE_ISOLATE(constructor); |
| 1480 | 1482 |
| 1481 memset(isolate_addresses_, 0, | 1483 memset(isolate_addresses_, 0, |
| 1482 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1)); | 1484 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1)); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1551 TRACE_ISOLATE(deinit); | 1553 TRACE_ISOLATE(deinit); |
| 1552 | 1554 |
| 1553 debug()->Unload(); | 1555 debug()->Unload(); |
| 1554 | 1556 |
| 1555 if (concurrent_recompilation_enabled()) { | 1557 if (concurrent_recompilation_enabled()) { |
| 1556 optimizing_compiler_thread_->Stop(); | 1558 optimizing_compiler_thread_->Stop(); |
| 1557 delete optimizing_compiler_thread_; | 1559 delete optimizing_compiler_thread_; |
| 1558 optimizing_compiler_thread_ = NULL; | 1560 optimizing_compiler_thread_ = NULL; |
| 1559 } | 1561 } |
| 1560 | 1562 |
| 1563 if (background_parser_thread_) { |
| 1564 background_parser_thread_->Stop(); |
| 1565 delete background_parser_thread_; |
| 1566 background_parser_thread_ = NULL; |
| 1567 } |
| 1568 |
| 1561 for (int i = 0; i < num_sweeper_threads_; i++) { | 1569 for (int i = 0; i < num_sweeper_threads_; i++) { |
| 1562 sweeper_thread_[i]->Stop(); | 1570 sweeper_thread_[i]->Stop(); |
| 1563 delete sweeper_thread_[i]; | 1571 delete sweeper_thread_[i]; |
| 1564 sweeper_thread_[i] = NULL; | 1572 sweeper_thread_[i] = NULL; |
| 1565 } | 1573 } |
| 1566 delete[] sweeper_thread_; | 1574 delete[] sweeper_thread_; |
| 1567 sweeper_thread_ = NULL; | 1575 sweeper_thread_ = NULL; |
| 1568 | 1576 |
| 1569 if (FLAG_job_based_sweeping && | 1577 if (FLAG_job_based_sweeping && |
| 1570 heap_.mark_compact_collector()->sweeping_in_progress()) { | 1578 heap_.mark_compact_collector()->sweeping_in_progress()) { |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1911 } | 1919 } |
| 1912 | 1920 |
| 1913 if (num_sweeper_threads_ > 0) { | 1921 if (num_sweeper_threads_ > 0) { |
| 1914 sweeper_thread_ = new SweeperThread*[num_sweeper_threads_]; | 1922 sweeper_thread_ = new SweeperThread*[num_sweeper_threads_]; |
| 1915 for (int i = 0; i < num_sweeper_threads_; i++) { | 1923 for (int i = 0; i < num_sweeper_threads_; i++) { |
| 1916 sweeper_thread_[i] = new SweeperThread(this); | 1924 sweeper_thread_[i] = new SweeperThread(this); |
| 1917 sweeper_thread_[i]->Start(); | 1925 sweeper_thread_[i]->Start(); |
| 1918 } | 1926 } |
| 1919 } | 1927 } |
| 1920 | 1928 |
| 1929 background_parser_thread_ = new BackgroundParserThread(); |
| 1930 background_parser_thread_->Start(); |
| 1931 |
| 1921 // If we are deserializing, read the state into the now-empty heap. | 1932 // If we are deserializing, read the state into the now-empty heap. |
| 1922 if (!create_heap_objects) { | 1933 if (!create_heap_objects) { |
| 1923 des->Deserialize(this); | 1934 des->Deserialize(this); |
| 1924 } | 1935 } |
| 1925 stub_cache_->Initialize(); | 1936 stub_cache_->Initialize(); |
| 1926 | 1937 |
| 1927 // Finish initialization of ThreadLocal after deserialization is done. | 1938 // Finish initialization of ThreadLocal after deserialization is done. |
| 1928 clear_pending_exception(); | 1939 clear_pending_exception(); |
| 1929 clear_pending_message(); | 1940 clear_pending_message(); |
| 1930 clear_scheduled_exception(); | 1941 clear_scheduled_exception(); |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2364 if (prev_ && prev_->Intercept(flag)) return true; | 2375 if (prev_ && prev_->Intercept(flag)) return true; |
| 2365 // Then check whether this scope intercepts. | 2376 // Then check whether this scope intercepts. |
| 2366 if ((flag & intercept_mask_)) { | 2377 if ((flag & intercept_mask_)) { |
| 2367 intercepted_flags_ |= flag; | 2378 intercepted_flags_ |= flag; |
| 2368 return true; | 2379 return true; |
| 2369 } | 2380 } |
| 2370 return false; | 2381 return false; |
| 2371 } | 2382 } |
| 2372 | 2383 |
| 2373 } } // namespace v8::internal | 2384 } } // namespace v8::internal |
| OLD | NEW |