| 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 2221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2232 if (create_heap_objects) { | 2232 if (create_heap_objects) { |
| 2233 // Terminate the cache array with the sentinel so we can iterate. | 2233 // Terminate the cache array with the sentinel so we can iterate. |
| 2234 PushToPartialSnapshotCache(heap_.undefined_value()); | 2234 PushToPartialSnapshotCache(heap_.undefined_value()); |
| 2235 } | 2235 } |
| 2236 | 2236 |
| 2237 InitializeThreadLocal(); | 2237 InitializeThreadLocal(); |
| 2238 | 2238 |
| 2239 bootstrapper_->Initialize(create_heap_objects); | 2239 bootstrapper_->Initialize(create_heap_objects); |
| 2240 builtins_.SetUp(this, create_heap_objects); | 2240 builtins_.SetUp(this, create_heap_objects); |
| 2241 | 2241 |
| 2242 if (create_heap_objects) heap_.CreateStubsRequiringBuiltins(); |
| 2243 |
| 2242 // Only preallocate on the first initialization. | 2244 // Only preallocate on the first initialization. |
| 2243 if (FLAG_preallocate_message_memory && preallocated_message_space_ == NULL) { | 2245 if (FLAG_preallocate_message_memory && preallocated_message_space_ == NULL) { |
| 2244 // Start the thread which will set aside some memory. | 2246 // Start the thread which will set aside some memory. |
| 2245 PreallocatedMemoryThreadStart(); | 2247 PreallocatedMemoryThreadStart(); |
| 2246 preallocated_message_space_ = | 2248 preallocated_message_space_ = |
| 2247 new NoAllocationStringAllocator( | 2249 new NoAllocationStringAllocator( |
| 2248 preallocated_memory_thread_->data(), | 2250 preallocated_memory_thread_->data(), |
| 2249 preallocated_memory_thread_->length()); | 2251 preallocated_memory_thread_->length()); |
| 2250 PreallocatedStorageInit(preallocated_memory_thread_->length() / 4); | 2252 PreallocatedStorageInit(preallocated_memory_thread_->length() / 4); |
| 2251 } | 2253 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2308 kDeoptTableSerializeEntryCount - 1); | 2310 kDeoptTableSerializeEntryCount - 1); |
| 2309 } | 2311 } |
| 2310 | 2312 |
| 2311 if (!Serializer::enabled()) { | 2313 if (!Serializer::enabled()) { |
| 2312 // Ensure that all stubs which need to be generated ahead of time, but | 2314 // Ensure that all stubs which need to be generated ahead of time, but |
| 2313 // cannot be serialized into the snapshot have been generated. | 2315 // cannot be serialized into the snapshot have been generated. |
| 2314 HandleScope scope(this); | 2316 HandleScope scope(this); |
| 2315 CodeStub::GenerateFPStubs(this); | 2317 CodeStub::GenerateFPStubs(this); |
| 2316 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(this); | 2318 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(this); |
| 2317 StubFailureTrampolineStub::GenerateAheadOfTime(this); | 2319 StubFailureTrampolineStub::GenerateAheadOfTime(this); |
| 2320 StubFailureTailCallTrampolineStub::GenerateAheadOfTime(this); |
| 2318 // TODO(mstarzinger): The following is an ugly hack to make sure the | 2321 // TODO(mstarzinger): The following is an ugly hack to make sure the |
| 2319 // interface descriptor is initialized even when stubs have been | 2322 // interface descriptor is initialized even when stubs have been |
| 2320 // deserialized out of the snapshot without the graph builder. | 2323 // deserialized out of the snapshot without the graph builder. |
| 2321 FastCloneShallowArrayStub stub(FastCloneShallowArrayStub::CLONE_ELEMENTS, | 2324 FastCloneShallowArrayStub stub(FastCloneShallowArrayStub::CLONE_ELEMENTS, |
| 2322 DONT_TRACK_ALLOCATION_SITE, 0); | 2325 DONT_TRACK_ALLOCATION_SITE, 0); |
| 2323 stub.InitializeInterfaceDescriptor( | 2326 stub.InitializeInterfaceDescriptor( |
| 2324 this, code_stub_interface_descriptor(CodeStub::FastCloneShallowArray)); | 2327 this, code_stub_interface_descriptor(CodeStub::FastCloneShallowArray)); |
| 2325 BinaryOpStub::InitializeForIsolate(this); | 2328 BinaryOpStub::InitializeForIsolate(this); |
| 2326 CompareNilICStub::InitializeForIsolate(this); | 2329 CompareNilICStub::InitializeForIsolate(this); |
| 2327 ToBooleanStub::InitializeForIsolate(this); | 2330 ToBooleanStub::InitializeForIsolate(this); |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2524 | 2527 |
| 2525 #ifdef DEBUG | 2528 #ifdef DEBUG |
| 2526 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2529 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 2527 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2530 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
| 2528 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2531 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 2529 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2532 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 2530 #undef ISOLATE_FIELD_OFFSET | 2533 #undef ISOLATE_FIELD_OFFSET |
| 2531 #endif | 2534 #endif |
| 2532 | 2535 |
| 2533 } } // namespace v8::internal | 2536 } } // namespace v8::internal |
| OLD | NEW |