| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdlib.h> | 5 #include <stdlib.h> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "src/ast.h" | 9 #include "src/ast.h" |
| 10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
| (...skipping 1902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1913 | 1913 |
| 1914 // SetUp the object heap. | 1914 // SetUp the object heap. |
| 1915 DCHECK(!heap_.HasBeenSetUp()); | 1915 DCHECK(!heap_.HasBeenSetUp()); |
| 1916 if (!heap_.SetUp()) { | 1916 if (!heap_.SetUp()) { |
| 1917 V8::FatalProcessOutOfMemory("heap setup"); | 1917 V8::FatalProcessOutOfMemory("heap setup"); |
| 1918 return false; | 1918 return false; |
| 1919 } | 1919 } |
| 1920 | 1920 |
| 1921 deoptimizer_data_ = new DeoptimizerData(memory_allocator_); | 1921 deoptimizer_data_ = new DeoptimizerData(memory_allocator_); |
| 1922 | 1922 |
| 1923 CallDescriptors::InitializeForIsolate(this); |
| 1924 |
| 1923 const bool create_heap_objects = (des == NULL); | 1925 const bool create_heap_objects = (des == NULL); |
| 1924 if (create_heap_objects && !heap_.CreateHeapObjects()) { | 1926 if (create_heap_objects && !heap_.CreateHeapObjects()) { |
| 1925 V8::FatalProcessOutOfMemory("heap object creation"); | 1927 V8::FatalProcessOutOfMemory("heap object creation"); |
| 1926 return false; | 1928 return false; |
| 1927 } | 1929 } |
| 1928 | 1930 |
| 1929 if (create_heap_objects) { | 1931 if (create_heap_objects) { |
| 1930 // Terminate the cache array with the sentinel so we can iterate. | 1932 // Terminate the cache array with the sentinel so we can iterate. |
| 1931 PushToPartialSnapshotCache(heap_.undefined_value()); | 1933 PushToPartialSnapshotCache(heap_.undefined_value()); |
| 1932 } | 1934 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2023 // Now that the heap is consistent, it's OK to generate the code for the | 2025 // Now that the heap is consistent, it's OK to generate the code for the |
| 2024 // deopt entry table that might have been referred to by optimized code in | 2026 // deopt entry table that might have been referred to by optimized code in |
| 2025 // the snapshot. | 2027 // the snapshot. |
| 2026 HandleScope scope(this); | 2028 HandleScope scope(this); |
| 2027 Deoptimizer::EnsureCodeForDeoptimizationEntry( | 2029 Deoptimizer::EnsureCodeForDeoptimizationEntry( |
| 2028 this, | 2030 this, |
| 2029 Deoptimizer::LAZY, | 2031 Deoptimizer::LAZY, |
| 2030 kDeoptTableSerializeEntryCount - 1); | 2032 kDeoptTableSerializeEntryCount - 1); |
| 2031 } | 2033 } |
| 2032 | 2034 |
| 2033 CallDescriptors::InitializeForIsolate(this); | |
| 2034 | |
| 2035 if (!serializer_enabled()) { | 2035 if (!serializer_enabled()) { |
| 2036 // Ensure that all stubs which need to be generated ahead of time, but | 2036 // Ensure that all stubs which need to be generated ahead of time, but |
| 2037 // cannot be serialized into the snapshot have been generated. | 2037 // cannot be serialized into the snapshot have been generated. |
| 2038 HandleScope scope(this); | 2038 HandleScope scope(this); |
| 2039 CodeStub::GenerateFPStubs(this); | 2039 CodeStub::GenerateFPStubs(this); |
| 2040 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(this); | 2040 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(this); |
| 2041 StubFailureTrampolineStub::GenerateAheadOfTime(this); | 2041 StubFailureTrampolineStub::GenerateAheadOfTime(this); |
| 2042 // Ensure interface descriptors are initialized even when stubs have been | 2042 // Ensure interface descriptors are initialized even when stubs have been |
| 2043 // deserialized out of the snapshot without using the graph builder. | 2043 // deserialized out of the snapshot without using the graph builder. |
| 2044 FastCloneShallowArrayStub::InstallDescriptors(this); | 2044 FastCloneShallowArrayStub::InstallDescriptors(this); |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2417 if (prev_ && prev_->Intercept(flag)) return true; | 2417 if (prev_ && prev_->Intercept(flag)) return true; |
| 2418 // Then check whether this scope intercepts. | 2418 // Then check whether this scope intercepts. |
| 2419 if ((flag & intercept_mask_)) { | 2419 if ((flag & intercept_mask_)) { |
| 2420 intercepted_flags_ |= flag; | 2420 intercepted_flags_ |= flag; |
| 2421 return true; | 2421 return true; |
| 2422 } | 2422 } |
| 2423 return false; | 2423 return false; |
| 2424 } | 2424 } |
| 2425 | 2425 |
| 2426 } } // namespace v8::internal | 2426 } } // namespace v8::internal |
| OLD | NEW |