| 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 1987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1998 if (create_heap_objects) { | 1998 if (create_heap_objects) { |
| 1999 // Terminate the cache array with the sentinel so we can iterate. | 1999 // Terminate the cache array with the sentinel so we can iterate. |
| 2000 PushToPartialSnapshotCache(heap_.undefined_value()); | 2000 PushToPartialSnapshotCache(heap_.undefined_value()); |
| 2001 } | 2001 } |
| 2002 | 2002 |
| 2003 InitializeThreadLocal(); | 2003 InitializeThreadLocal(); |
| 2004 | 2004 |
| 2005 bootstrapper_->Initialize(create_heap_objects); | 2005 bootstrapper_->Initialize(create_heap_objects); |
| 2006 builtins_.SetUp(this, create_heap_objects); | 2006 builtins_.SetUp(this, create_heap_objects); |
| 2007 | 2007 |
| 2008 if (create_heap_objects) heap_.CreateStubsRequiringBuiltins(); | |
| 2009 | |
| 2010 // Set default value if not yet set. | 2008 // Set default value if not yet set. |
| 2011 // TODO(yangguo): move this to ResourceConstraints::ConfigureDefaults | 2009 // TODO(yangguo): move this to ResourceConstraints::ConfigureDefaults |
| 2012 // once ResourceConstraints becomes an argument to the Isolate constructor. | 2010 // once ResourceConstraints becomes an argument to the Isolate constructor. |
| 2013 if (max_available_threads_ < 1) { | 2011 if (max_available_threads_ < 1) { |
| 2014 // Choose the default between 1 and 4. | 2012 // Choose the default between 1 and 4. |
| 2015 max_available_threads_ = Max(Min(CPU::NumberOfProcessorsOnline(), 4), 1); | 2013 max_available_threads_ = Max(Min(CPU::NumberOfProcessorsOnline(), 4), 1); |
| 2016 } | 2014 } |
| 2017 | 2015 |
| 2018 num_sweeper_threads_ = SweeperThread::NumberOfThreads(max_available_threads_); | 2016 num_sweeper_threads_ = SweeperThread::NumberOfThreads(max_available_threads_); |
| 2019 | 2017 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2094 kDeoptTableSerializeEntryCount - 1); | 2092 kDeoptTableSerializeEntryCount - 1); |
| 2095 } | 2093 } |
| 2096 | 2094 |
| 2097 if (!Serializer::enabled()) { | 2095 if (!Serializer::enabled()) { |
| 2098 // Ensure that all stubs which need to be generated ahead of time, but | 2096 // Ensure that all stubs which need to be generated ahead of time, but |
| 2099 // cannot be serialized into the snapshot have been generated. | 2097 // cannot be serialized into the snapshot have been generated. |
| 2100 HandleScope scope(this); | 2098 HandleScope scope(this); |
| 2101 CodeStub::GenerateFPStubs(this); | 2099 CodeStub::GenerateFPStubs(this); |
| 2102 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(this); | 2100 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(this); |
| 2103 StubFailureTrampolineStub::GenerateAheadOfTime(this); | 2101 StubFailureTrampolineStub::GenerateAheadOfTime(this); |
| 2104 StubFailureTailCallTrampolineStub::GenerateAheadOfTime(this); | |
| 2105 // TODO(mstarzinger): The following is an ugly hack to make sure the | 2102 // TODO(mstarzinger): The following is an ugly hack to make sure the |
| 2106 // interface descriptor is initialized even when stubs have been | 2103 // interface descriptor is initialized even when stubs have been |
| 2107 // deserialized out of the snapshot without the graph builder. | 2104 // deserialized out of the snapshot without the graph builder. |
| 2108 FastCloneShallowArrayStub stub(FastCloneShallowArrayStub::CLONE_ELEMENTS, | 2105 FastCloneShallowArrayStub stub(FastCloneShallowArrayStub::CLONE_ELEMENTS, |
| 2109 DONT_TRACK_ALLOCATION_SITE, 0); | 2106 DONT_TRACK_ALLOCATION_SITE, 0); |
| 2110 stub.InitializeInterfaceDescriptor( | 2107 stub.InitializeInterfaceDescriptor( |
| 2111 this, code_stub_interface_descriptor(CodeStub::FastCloneShallowArray)); | 2108 this, code_stub_interface_descriptor(CodeStub::FastCloneShallowArray)); |
| 2112 BinaryOpICStub::InstallDescriptors(this); | 2109 BinaryOpICStub::InstallDescriptors(this); |
| 2113 BinaryOpWithAllocationSiteStub::InstallDescriptors(this); | 2110 BinaryOpWithAllocationSiteStub::InstallDescriptors(this); |
| 2114 CompareNilICStub::InitializeForIsolate(this); | 2111 CompareNilICStub::InitializeForIsolate(this); |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2315 | 2312 |
| 2316 #ifdef DEBUG | 2313 #ifdef DEBUG |
| 2317 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2314 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 2318 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2315 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
| 2319 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2316 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 2320 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2317 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 2321 #undef ISOLATE_FIELD_OFFSET | 2318 #undef ISOLATE_FIELD_OFFSET |
| 2322 #endif | 2319 #endif |
| 2323 | 2320 |
| 2324 } } // namespace v8::internal | 2321 } } // namespace v8::internal |
| OLD | NEW |