| 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 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1747 global_handles_(NULL), | 1747 global_handles_(NULL), |
| 1748 context_switcher_(NULL), | 1748 context_switcher_(NULL), |
| 1749 thread_manager_(NULL), | 1749 thread_manager_(NULL), |
| 1750 fp_stubs_generated_(false), | 1750 fp_stubs_generated_(false), |
| 1751 has_installed_extensions_(false), | 1751 has_installed_extensions_(false), |
| 1752 string_tracker_(NULL), | 1752 string_tracker_(NULL), |
| 1753 regexp_stack_(NULL), | 1753 regexp_stack_(NULL), |
| 1754 date_cache_(NULL), | 1754 date_cache_(NULL), |
| 1755 code_stub_interface_descriptors_(NULL), | 1755 code_stub_interface_descriptors_(NULL), |
| 1756 context_exit_happened_(false), | 1756 context_exit_happened_(false), |
| 1757 initialized_from_snapshot_(false), |
| 1757 cpu_profiler_(NULL), | 1758 cpu_profiler_(NULL), |
| 1758 heap_profiler_(NULL), | 1759 heap_profiler_(NULL), |
| 1760 function_entry_hook_(NULL), |
| 1759 deferred_handles_head_(NULL), | 1761 deferred_handles_head_(NULL), |
| 1760 optimizing_compiler_thread_(this), | 1762 optimizing_compiler_thread_(this), |
| 1761 marking_thread_(NULL), | 1763 marking_thread_(NULL), |
| 1762 sweeper_thread_(NULL), | 1764 sweeper_thread_(NULL), |
| 1763 callback_table_(NULL) { | 1765 callback_table_(NULL) { |
| 1764 id_ = NoBarrier_AtomicIncrement(&isolate_counter_, 1); | 1766 id_ = NoBarrier_AtomicIncrement(&isolate_counter_, 1); |
| 1765 TRACE_ISOLATE(constructor); | 1767 TRACE_ISOLATE(constructor); |
| 1766 | 1768 |
| 1767 memset(isolate_addresses_, 0, | 1769 memset(isolate_addresses_, 0, |
| 1768 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1)); | 1770 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1)); |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2074 Release_Store(&debugger_initialized_, true); | 2076 Release_Store(&debugger_initialized_, true); |
| 2075 #endif | 2077 #endif |
| 2076 } | 2078 } |
| 2077 | 2079 |
| 2078 | 2080 |
| 2079 bool Isolate::Init(Deserializer* des) { | 2081 bool Isolate::Init(Deserializer* des) { |
| 2080 ASSERT(state_ != INITIALIZED); | 2082 ASSERT(state_ != INITIALIZED); |
| 2081 ASSERT(Isolate::Current() == this); | 2083 ASSERT(Isolate::Current() == this); |
| 2082 TRACE_ISOLATE(init); | 2084 TRACE_ISOLATE(init); |
| 2083 | 2085 |
| 2086 if (function_entry_hook() != NULL) { |
| 2087 // When function entry hooking is in effect, we have to create the code |
| 2088 // stubs from scratch to get entry hooks, rather than loading the previously |
| 2089 // generated stubs from disk. |
| 2090 // If this assert fires, the initialization path has regressed. |
| 2091 ASSERT(des == NULL); |
| 2092 } |
| 2093 |
| 2084 // The initialization process does not handle memory exhaustion. | 2094 // The initialization process does not handle memory exhaustion. |
| 2085 DisallowAllocationFailure disallow_allocation_failure; | 2095 DisallowAllocationFailure disallow_allocation_failure; |
| 2086 | 2096 |
| 2087 InitializeLoggingAndCounters(); | 2097 InitializeLoggingAndCounters(); |
| 2088 | 2098 |
| 2089 InitializeDebugger(); | 2099 InitializeDebugger(); |
| 2090 | 2100 |
| 2091 memory_allocator_ = new MemoryAllocator(this); | 2101 memory_allocator_ = new MemoryAllocator(this); |
| 2092 code_range_ = new CodeRange(this); | 2102 code_range_ = new CodeRange(this); |
| 2093 | 2103 |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2293 } | 2303 } |
| 2294 } else { | 2304 } else { |
| 2295 FLAG_concurrent_sweeping = false; | 2305 FLAG_concurrent_sweeping = false; |
| 2296 FLAG_parallel_sweeping = false; | 2306 FLAG_parallel_sweeping = false; |
| 2297 } | 2307 } |
| 2298 if (FLAG_parallel_recompilation && | 2308 if (FLAG_parallel_recompilation && |
| 2299 SystemThreadManager::NumberOfParallelSystemThreads( | 2309 SystemThreadManager::NumberOfParallelSystemThreads( |
| 2300 SystemThreadManager::PARALLEL_RECOMPILATION) == 0) { | 2310 SystemThreadManager::PARALLEL_RECOMPILATION) == 0) { |
| 2301 FLAG_parallel_recompilation = false; | 2311 FLAG_parallel_recompilation = false; |
| 2302 } | 2312 } |
| 2313 |
| 2314 initialized_from_snapshot_ = (des != NULL); |
| 2315 |
| 2303 return true; | 2316 return true; |
| 2304 } | 2317 } |
| 2305 | 2318 |
| 2306 | 2319 |
| 2307 // Initialized lazily to allow early | 2320 // Initialized lazily to allow early |
| 2308 // v8::V8::SetAddHistogramSampleFunction calls. | 2321 // v8::V8::SetAddHistogramSampleFunction calls. |
| 2309 StatsTable* Isolate::stats_table() { | 2322 StatsTable* Isolate::stats_table() { |
| 2310 if (stats_table_ == NULL) { | 2323 if (stats_table_ == NULL) { |
| 2311 stats_table_ = new StatsTable; | 2324 stats_table_ = new StatsTable; |
| 2312 } | 2325 } |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2471 | 2484 |
| 2472 #ifdef DEBUG | 2485 #ifdef DEBUG |
| 2473 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2486 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 2474 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2487 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
| 2475 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2488 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 2476 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2489 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 2477 #undef ISOLATE_FIELD_OFFSET | 2490 #undef ISOLATE_FIELD_OFFSET |
| 2478 #endif | 2491 #endif |
| 2479 | 2492 |
| 2480 } } // namespace v8::internal | 2493 } } // namespace v8::internal |
| OLD | NEW |