OLD | NEW |
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 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1746 global_handles_(NULL), | 1746 global_handles_(NULL), |
1747 context_switcher_(NULL), | 1747 context_switcher_(NULL), |
1748 thread_manager_(NULL), | 1748 thread_manager_(NULL), |
1749 fp_stubs_generated_(false), | 1749 fp_stubs_generated_(false), |
1750 has_installed_extensions_(false), | 1750 has_installed_extensions_(false), |
1751 string_tracker_(NULL), | 1751 string_tracker_(NULL), |
1752 regexp_stack_(NULL), | 1752 regexp_stack_(NULL), |
1753 date_cache_(NULL), | 1753 date_cache_(NULL), |
1754 code_stub_interface_descriptors_(NULL), | 1754 code_stub_interface_descriptors_(NULL), |
1755 context_exit_happened_(false), | 1755 context_exit_happened_(false), |
1756 initialized_from_snapshot_(false), | |
1757 cpu_profiler_(NULL), | 1756 cpu_profiler_(NULL), |
1758 heap_profiler_(NULL), | 1757 heap_profiler_(NULL), |
1759 function_entry_hook_(NULL), | |
1760 deferred_handles_head_(NULL), | 1758 deferred_handles_head_(NULL), |
1761 optimizing_compiler_thread_(this), | 1759 optimizing_compiler_thread_(this), |
1762 marking_thread_(NULL), | 1760 marking_thread_(NULL), |
1763 sweeper_thread_(NULL), | 1761 sweeper_thread_(NULL), |
1764 callback_table_(NULL) { | 1762 callback_table_(NULL) { |
1765 id_ = NoBarrier_AtomicIncrement(&isolate_counter_, 1); | 1763 id_ = NoBarrier_AtomicIncrement(&isolate_counter_, 1); |
1766 TRACE_ISOLATE(constructor); | 1764 TRACE_ISOLATE(constructor); |
1767 | 1765 |
1768 memset(isolate_addresses_, 0, | 1766 memset(isolate_addresses_, 0, |
1769 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1)); | 1767 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1)); |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2072 Release_Store(&debugger_initialized_, true); | 2070 Release_Store(&debugger_initialized_, true); |
2073 #endif | 2071 #endif |
2074 } | 2072 } |
2075 | 2073 |
2076 | 2074 |
2077 bool Isolate::Init(Deserializer* des) { | 2075 bool Isolate::Init(Deserializer* des) { |
2078 ASSERT(state_ != INITIALIZED); | 2076 ASSERT(state_ != INITIALIZED); |
2079 ASSERT(Isolate::Current() == this); | 2077 ASSERT(Isolate::Current() == this); |
2080 TRACE_ISOLATE(init); | 2078 TRACE_ISOLATE(init); |
2081 | 2079 |
2082 if (function_entry_hook() != NULL) { | |
2083 // When function entry hooking is in effect, we have to create the code | |
2084 // stubs from scratch to get entry hooks, rather than loading the previously | |
2085 // generated stubs from disk. | |
2086 // If this assert fires, the initialization path has regressed. | |
2087 ASSERT(des == NULL); | |
2088 } | |
2089 | |
2090 // The initialization process does not handle memory exhaustion. | 2080 // The initialization process does not handle memory exhaustion. |
2091 DisallowAllocationFailure disallow_allocation_failure; | 2081 DisallowAllocationFailure disallow_allocation_failure; |
2092 | 2082 |
2093 InitializeLoggingAndCounters(); | 2083 InitializeLoggingAndCounters(); |
2094 | 2084 |
2095 InitializeDebugger(); | 2085 InitializeDebugger(); |
2096 | 2086 |
2097 memory_allocator_ = new MemoryAllocator(this); | 2087 memory_allocator_ = new MemoryAllocator(this); |
2098 code_range_ = new CodeRange(this); | 2088 code_range_ = new CodeRange(this); |
2099 | 2089 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2271 } | 2261 } |
2272 } | 2262 } |
2273 | 2263 |
2274 if (FLAG_sweeper_threads > 0) { | 2264 if (FLAG_sweeper_threads > 0) { |
2275 sweeper_thread_ = new SweeperThread*[FLAG_sweeper_threads]; | 2265 sweeper_thread_ = new SweeperThread*[FLAG_sweeper_threads]; |
2276 for (int i = 0; i < FLAG_sweeper_threads; i++) { | 2266 for (int i = 0; i < FLAG_sweeper_threads; i++) { |
2277 sweeper_thread_[i] = new SweeperThread(this); | 2267 sweeper_thread_[i] = new SweeperThread(this); |
2278 sweeper_thread_[i]->Start(); | 2268 sweeper_thread_[i]->Start(); |
2279 } | 2269 } |
2280 } | 2270 } |
2281 | |
2282 initialized_from_snapshot_ = (des != NULL); | |
2283 | |
2284 return true; | 2271 return true; |
2285 } | 2272 } |
2286 | 2273 |
2287 | 2274 |
2288 // Initialized lazily to allow early | 2275 // Initialized lazily to allow early |
2289 // v8::V8::SetAddHistogramSampleFunction calls. | 2276 // v8::V8::SetAddHistogramSampleFunction calls. |
2290 StatsTable* Isolate::stats_table() { | 2277 StatsTable* Isolate::stats_table() { |
2291 if (stats_table_ == NULL) { | 2278 if (stats_table_ == NULL) { |
2292 stats_table_ = new StatsTable; | 2279 stats_table_ = new StatsTable; |
2293 } | 2280 } |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2452 | 2439 |
2453 #ifdef DEBUG | 2440 #ifdef DEBUG |
2454 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2441 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
2455 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2442 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
2456 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2443 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
2457 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2444 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
2458 #undef ISOLATE_FIELD_OFFSET | 2445 #undef ISOLATE_FIELD_OFFSET |
2459 #endif | 2446 #endif |
2460 | 2447 |
2461 } } // namespace v8::internal | 2448 } } // namespace v8::internal |
OLD | NEW |