OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 12 matching lines...) Expand all Loading... |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include <stdlib.h> | 28 #include <stdlib.h> |
29 | 29 |
30 #include "v8.h" | 30 #include "v8.h" |
31 | 31 |
32 #include "ast.h" | 32 #include "ast.h" |
| 33 #include "api.h" |
33 #include "bootstrapper.h" | 34 #include "bootstrapper.h" |
34 #include "codegen.h" | 35 #include "codegen.h" |
35 #include "compilation-cache.h" | 36 #include "compilation-cache.h" |
36 #include "debug.h" | 37 #include "debug.h" |
37 #include "deoptimizer.h" | 38 #include "deoptimizer.h" |
38 #include "heap-profiler.h" | 39 #include "heap-profiler.h" |
39 #include "hydrogen.h" | 40 #include "hydrogen.h" |
40 #include "isolate.h" | 41 #include "isolate.h" |
41 #include "lithium-allocator.h" | 42 #include "lithium-allocator.h" |
42 #include "log.h" | 43 #include "log.h" |
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1405 runtime_profiler_(NULL), | 1406 runtime_profiler_(NULL), |
1406 compilation_cache_(NULL), | 1407 compilation_cache_(NULL), |
1407 counters_(NULL), | 1408 counters_(NULL), |
1408 code_range_(NULL), | 1409 code_range_(NULL), |
1409 // Must be initialized early to allow v8::SetResourceConstraints calls. | 1410 // Must be initialized early to allow v8::SetResourceConstraints calls. |
1410 break_access_(OS::CreateMutex()), | 1411 break_access_(OS::CreateMutex()), |
1411 debugger_initialized_(false), | 1412 debugger_initialized_(false), |
1412 // Must be initialized early to allow v8::Debug calls. | 1413 // Must be initialized early to allow v8::Debug calls. |
1413 debugger_access_(OS::CreateMutex()), | 1414 debugger_access_(OS::CreateMutex()), |
1414 logger_(NULL), | 1415 logger_(NULL), |
| 1416 extension_states_(NULL), |
1415 stats_table_(NULL), | 1417 stats_table_(NULL), |
1416 stub_cache_(NULL), | 1418 stub_cache_(NULL), |
1417 deoptimizer_data_(NULL), | 1419 deoptimizer_data_(NULL), |
1418 capture_stack_trace_for_uncaught_exceptions_(false), | 1420 capture_stack_trace_for_uncaught_exceptions_(false), |
1419 stack_trace_for_uncaught_exceptions_frame_limit_(0), | 1421 stack_trace_for_uncaught_exceptions_frame_limit_(0), |
1420 stack_trace_for_uncaught_exceptions_options_(StackTrace::kOverview), | 1422 stack_trace_for_uncaught_exceptions_options_(StackTrace::kOverview), |
1421 transcendental_cache_(NULL), | 1423 transcendental_cache_(NULL), |
1422 memory_allocator_(NULL), | 1424 memory_allocator_(NULL), |
1423 keyed_lookup_cache_(NULL), | 1425 keyed_lookup_cache_(NULL), |
1424 context_slot_cache_(NULL), | 1426 context_slot_cache_(NULL), |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 preallocated_message_space_ = NULL; | 1534 preallocated_message_space_ = NULL; |
1533 PreallocatedMemoryThreadStop(); | 1535 PreallocatedMemoryThreadStop(); |
1534 | 1536 |
1535 HeapProfiler::TearDown(); | 1537 HeapProfiler::TearDown(); |
1536 CpuProfiler::TearDown(); | 1538 CpuProfiler::TearDown(); |
1537 if (runtime_profiler_ != NULL) { | 1539 if (runtime_profiler_ != NULL) { |
1538 runtime_profiler_->TearDown(); | 1540 runtime_profiler_->TearDown(); |
1539 delete runtime_profiler_; | 1541 delete runtime_profiler_; |
1540 runtime_profiler_ = NULL; | 1542 runtime_profiler_ = NULL; |
1541 } | 1543 } |
| 1544 |
1542 heap_.TearDown(); | 1545 heap_.TearDown(); |
1543 logger_->TearDown(); | 1546 logger_->TearDown(); |
1544 | 1547 |
1545 // The default isolate is re-initializable due to legacy API. | 1548 // The default isolate is re-initializable due to legacy API. |
1546 state_ = UNINITIALIZED; | 1549 state_ = UNINITIALIZED; |
1547 } | 1550 } |
1548 } | 1551 } |
1549 | 1552 |
1550 | 1553 |
1551 void Isolate::SetIsolateThreadLocals(Isolate* isolate, | 1554 void Isolate::SetIsolateThreadLocals(Isolate* isolate, |
(...skipping 25 matching lines...) Expand all Loading... |
1577 delete keyed_lookup_cache_; | 1580 delete keyed_lookup_cache_; |
1578 keyed_lookup_cache_ = NULL; | 1581 keyed_lookup_cache_ = NULL; |
1579 | 1582 |
1580 delete transcendental_cache_; | 1583 delete transcendental_cache_; |
1581 transcendental_cache_ = NULL; | 1584 transcendental_cache_ = NULL; |
1582 delete stub_cache_; | 1585 delete stub_cache_; |
1583 stub_cache_ = NULL; | 1586 stub_cache_ = NULL; |
1584 delete stats_table_; | 1587 delete stats_table_; |
1585 stats_table_ = NULL; | 1588 stats_table_ = NULL; |
1586 | 1589 |
| 1590 delete extension_states_; |
| 1591 extension_states_ = NULL; |
| 1592 |
1587 delete logger_; | 1593 delete logger_; |
1588 logger_ = NULL; | 1594 logger_ = NULL; |
1589 | 1595 |
1590 delete counters_; | 1596 delete counters_; |
1591 counters_ = NULL; | 1597 counters_ = NULL; |
1592 | 1598 |
1593 delete handle_scope_implementer_; | 1599 delete handle_scope_implementer_; |
1594 handle_scope_implementer_ = NULL; | 1600 handle_scope_implementer_ = NULL; |
1595 delete break_access_; | 1601 delete break_access_; |
1596 break_access_ = NULL; | 1602 break_access_ = NULL; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1725 unicode_cache_ = new UnicodeCache(); | 1731 unicode_cache_ = new UnicodeCache(); |
1726 inner_pointer_to_code_cache_ = new InnerPointerToCodeCache(this); | 1732 inner_pointer_to_code_cache_ = new InnerPointerToCodeCache(this); |
1727 write_input_buffer_ = new StringInputBuffer(); | 1733 write_input_buffer_ = new StringInputBuffer(); |
1728 global_handles_ = new GlobalHandles(this); | 1734 global_handles_ = new GlobalHandles(this); |
1729 bootstrapper_ = new Bootstrapper(); | 1735 bootstrapper_ = new Bootstrapper(); |
1730 handle_scope_implementer_ = new HandleScopeImplementer(this); | 1736 handle_scope_implementer_ = new HandleScopeImplementer(this); |
1731 stub_cache_ = new StubCache(this); | 1737 stub_cache_ = new StubCache(this); |
1732 regexp_stack_ = new RegExpStack(); | 1738 regexp_stack_ = new RegExpStack(); |
1733 regexp_stack_->isolate_ = this; | 1739 regexp_stack_->isolate_ = this; |
1734 | 1740 |
| 1741 extension_states_ = new ExtensionStates(); |
| 1742 |
1735 // Enable logging before setting up the heap | 1743 // Enable logging before setting up the heap |
1736 logger_->Setup(); | 1744 logger_->Setup(); |
1737 | 1745 |
1738 CpuProfiler::Setup(); | 1746 CpuProfiler::Setup(); |
1739 HeapProfiler::Setup(); | 1747 HeapProfiler::Setup(); |
1740 | 1748 |
1741 // Initialize other runtime facilities | 1749 // Initialize other runtime facilities |
1742 #if defined(USE_SIMULATOR) | 1750 #if defined(USE_SIMULATOR) |
1743 #if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS) | 1751 #if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS) |
1744 Simulator::Initialize(this); | 1752 Simulator::Initialize(this); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1900 | 1908 |
1901 #ifdef DEBUG | 1909 #ifdef DEBUG |
1902 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 1910 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
1903 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 1911 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
1904 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 1912 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
1905 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 1913 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
1906 #undef ISOLATE_FIELD_OFFSET | 1914 #undef ISOLATE_FIELD_OFFSET |
1907 #endif | 1915 #endif |
1908 | 1916 |
1909 } } // namespace v8::internal | 1917 } } // namespace v8::internal |
OLD | NEW |