| 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 2127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2138 InitializeLoggingAndCounters(); | 2138 InitializeLoggingAndCounters(); |
| 2139 debug_ = new Debug(this); | 2139 debug_ = new Debug(this); |
| 2140 debugger_ = new Debugger(this); | 2140 debugger_ = new Debugger(this); |
| 2141 Release_Store(&debugger_initialized_, true); | 2141 Release_Store(&debugger_initialized_, true); |
| 2142 #endif | 2142 #endif |
| 2143 } | 2143 } |
| 2144 | 2144 |
| 2145 | 2145 |
| 2146 bool Isolate::Init(Deserializer* des) { | 2146 bool Isolate::Init(Deserializer* des) { |
| 2147 ASSERT(state_ != INITIALIZED); | 2147 ASSERT(state_ != INITIALIZED); |
| 2148 ASSERT(Isolate::Current() == this); | |
| 2149 TRACE_ISOLATE(init); | 2148 TRACE_ISOLATE(init); |
| 2150 | 2149 |
| 2151 stress_deopt_count_ = FLAG_deopt_every_n_times; | 2150 stress_deopt_count_ = FLAG_deopt_every_n_times; |
| 2152 | 2151 |
| 2153 has_fatal_error_ = false; | 2152 has_fatal_error_ = false; |
| 2154 | 2153 |
| 2155 use_crankshaft_ = FLAG_crankshaft | 2154 use_crankshaft_ = FLAG_crankshaft |
| 2156 && !Serializer::enabled() | 2155 && !Serializer::enabled() |
| 2157 && CPU::SupportsCrankshaft(); | 2156 && CPU::SupportsCrankshaft(); |
| 2158 | 2157 |
| 2159 if (function_entry_hook() != NULL) { | 2158 if (function_entry_hook() != NULL) { |
| 2160 // When function entry hooking is in effect, we have to create the code | 2159 // When function entry hooking is in effect, we have to create the code |
| 2161 // stubs from scratch to get entry hooks, rather than loading the previously | 2160 // stubs from scratch to get entry hooks, rather than loading the previously |
| 2162 // generated stubs from disk. | 2161 // generated stubs from disk. |
| 2163 // If this assert fires, the initialization path has regressed. | 2162 // If this assert fires, the initialization path has regressed. |
| 2164 ASSERT(des == NULL); | 2163 ASSERT(des == NULL); |
| 2165 } | 2164 } |
| 2166 | 2165 |
| 2167 // The initialization process does not handle memory exhaustion. | 2166 // The initialization process does not handle memory exhaustion. |
| 2168 DisallowAllocationFailure disallow_allocation_failure; | 2167 DisallowAllocationFailure disallow_allocation_failure; |
| 2169 | 2168 |
| 2170 InitializeLoggingAndCounters(); | 2169 InitializeLoggingAndCounters(); |
| 2171 | 2170 |
| 2172 InitializeDebugger(); | 2171 InitializeDebugger(); |
| 2173 | 2172 |
| 2174 memory_allocator_ = new MemoryAllocator(this); | 2173 memory_allocator_ = new MemoryAllocator(this); |
| 2175 code_range_ = new CodeRange(this); | 2174 code_range_ = new CodeRange(this); |
| 2176 | 2175 |
| 2177 // Safe after setting Heap::isolate_, initializing StackGuard and | 2176 // Safe after setting Heap::isolate_, and initializing StackGuard |
| 2178 // ensuring that Isolate::Current() == this. | |
| 2179 heap_.SetStackLimits(); | 2177 heap_.SetStackLimits(); |
| 2180 | 2178 |
| 2181 #define ASSIGN_ELEMENT(CamelName, hacker_name) \ | 2179 #define ASSIGN_ELEMENT(CamelName, hacker_name) \ |
| 2182 isolate_addresses_[Isolate::k##CamelName##Address] = \ | 2180 isolate_addresses_[Isolate::k##CamelName##Address] = \ |
| 2183 reinterpret_cast<Address>(hacker_name##_address()); | 2181 reinterpret_cast<Address>(hacker_name##_address()); |
| 2184 FOR_EACH_ISOLATE_ADDRESS_NAME(ASSIGN_ELEMENT) | 2182 FOR_EACH_ISOLATE_ADDRESS_NAME(ASSIGN_ELEMENT) |
| 2185 #undef ASSIGN_ELEMENT | 2183 #undef ASSIGN_ELEMENT |
| 2186 | 2184 |
| 2187 string_tracker_ = new StringTracker(); | 2185 string_tracker_ = new StringTracker(); |
| 2188 string_tracker_->isolate_ = this; | 2186 string_tracker_->isolate_ = this; |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2536 | 2534 |
| 2537 #ifdef DEBUG | 2535 #ifdef DEBUG |
| 2538 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2536 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 2539 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2537 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
| 2540 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2538 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 2541 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2539 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 2542 #undef ISOLATE_FIELD_OFFSET | 2540 #undef ISOLATE_FIELD_OFFSET |
| 2543 #endif | 2541 #endif |
| 2544 | 2542 |
| 2545 } } // namespace v8::internal | 2543 } } // namespace v8::internal |
| OLD | NEW |