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