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 2012 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 | 2023 // 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 | 2024 // deopt entry table that might have been referred to by optimized code in |
2025 // the snapshot. | 2025 // the snapshot. |
2026 HandleScope scope(this); | 2026 HandleScope scope(this); |
2027 Deoptimizer::EnsureCodeForDeoptimizationEntry( | 2027 Deoptimizer::EnsureCodeForDeoptimizationEntry( |
2028 this, | 2028 this, |
2029 Deoptimizer::LAZY, | 2029 Deoptimizer::LAZY, |
2030 kDeoptTableSerializeEntryCount - 1); | 2030 kDeoptTableSerializeEntryCount - 1); |
2031 } | 2031 } |
2032 | 2032 |
| 2033 CallDescriptors::InitializeForIsolate(this); |
| 2034 |
2033 if (!serializer_enabled()) { | 2035 if (!serializer_enabled()) { |
2034 // 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 |
2035 // cannot be serialized into the snapshot have been generated. | 2037 // cannot be serialized into the snapshot have been generated. |
2036 HandleScope scope(this); | 2038 HandleScope scope(this); |
2037 CodeStub::GenerateFPStubs(this); | 2039 CodeStub::GenerateFPStubs(this); |
2038 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(this); | 2040 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(this); |
2039 StubFailureTrampolineStub::GenerateAheadOfTime(this); | 2041 StubFailureTrampolineStub::GenerateAheadOfTime(this); |
2040 // Ensure interface descriptors are initialized even when stubs have been | 2042 // Ensure interface descriptors are initialized even when stubs have been |
2041 // deserialized out of the snapshot without using the graph builder. | 2043 // deserialized out of the snapshot without using the graph builder. |
2042 FastCloneShallowArrayStub::InstallDescriptors(this); | 2044 FastCloneShallowArrayStub::InstallDescriptors(this); |
2043 BinaryOpICStub::InstallDescriptors(this); | 2045 BinaryOpICStub::InstallDescriptors(this); |
2044 BinaryOpWithAllocationSiteStub::InstallDescriptors(this); | 2046 BinaryOpWithAllocationSiteStub::InstallDescriptors(this); |
2045 CompareNilICStub::InstallDescriptors(this); | 2047 CompareNilICStub::InstallDescriptors(this); |
2046 ToBooleanStub::InstallDescriptors(this); | 2048 ToBooleanStub::InstallDescriptors(this); |
2047 ToNumberStub::InstallDescriptors(this); | 2049 ToNumberStub::InstallDescriptors(this); |
2048 ArrayConstructorStubBase::InstallDescriptors(this); | 2050 ArrayConstructorStubBase::InstallDescriptors(this); |
2049 InternalArrayConstructorStubBase::InstallDescriptors(this); | 2051 InternalArrayConstructorStubBase::InstallDescriptors(this); |
2050 FastNewClosureStub::InstallDescriptors(this); | 2052 FastNewClosureStub::InstallDescriptors(this); |
2051 FastNewContextStub::InstallDescriptors(this); | 2053 FastNewContextStub::InstallDescriptors(this); |
2052 NumberToStringStub::InstallDescriptors(this); | 2054 NumberToStringStub::InstallDescriptors(this); |
2053 StringAddStub::InstallDescriptors(this); | 2055 StringAddStub::InstallDescriptors(this); |
2054 RegExpConstructResultStub::InstallDescriptors(this); | 2056 RegExpConstructResultStub::InstallDescriptors(this); |
2055 KeyedLoadGenericStub::InstallDescriptors(this); | 2057 KeyedLoadGenericStub::InstallDescriptors(this); |
2056 StoreFieldStub::InstallDescriptors(this); | 2058 StoreFieldStub::InstallDescriptors(this); |
2057 LoadFastElementStub::InstallDescriptors(this); | 2059 LoadFastElementStub::InstallDescriptors(this); |
2058 } | 2060 } |
2059 | 2061 |
2060 CallDescriptors::InitializeForIsolate(this); | |
2061 | |
2062 initialized_from_snapshot_ = (des != NULL); | 2062 initialized_from_snapshot_ = (des != NULL); |
2063 | 2063 |
2064 return true; | 2064 return true; |
2065 } | 2065 } |
2066 | 2066 |
2067 | 2067 |
2068 // Initialized lazily to allow early | 2068 // Initialized lazily to allow early |
2069 // v8::V8::SetAddHistogramSampleFunction calls. | 2069 // v8::V8::SetAddHistogramSampleFunction calls. |
2070 StatsTable* Isolate::stats_table() { | 2070 StatsTable* Isolate::stats_table() { |
2071 if (stats_table_ == NULL) { | 2071 if (stats_table_ == NULL) { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2235 return iter.IsAtEnd(); | 2235 return iter.IsAtEnd(); |
2236 } | 2236 } |
2237 | 2237 |
2238 | 2238 |
2239 CodeStubInterfaceDescriptor* | 2239 CodeStubInterfaceDescriptor* |
2240 Isolate::code_stub_interface_descriptor(int index) { | 2240 Isolate::code_stub_interface_descriptor(int index) { |
2241 return code_stub_interface_descriptors_ + index; | 2241 return code_stub_interface_descriptors_ + index; |
2242 } | 2242 } |
2243 | 2243 |
2244 | 2244 |
2245 CallInterfaceDescriptor* | 2245 CallInterfaceDescriptor* Isolate::call_descriptor(int index) { |
2246 Isolate::call_descriptor(CallDescriptorKey index) { | 2246 DCHECK(0 <= index && index < CallDescriptorKey::NUMBER_OF_CALL_DESCRIPTORS); |
2247 DCHECK(0 <= index && index < NUMBER_OF_CALL_DESCRIPTORS); | |
2248 return &call_descriptors_[index]; | 2247 return &call_descriptors_[index]; |
2249 } | 2248 } |
2250 | 2249 |
2251 | 2250 |
2252 Object* Isolate::FindCodeObject(Address a) { | 2251 Object* Isolate::FindCodeObject(Address a) { |
2253 return inner_pointer_to_code_cache()->GcSafeFindCodeForInnerPointer(a); | 2252 return inner_pointer_to_code_cache()->GcSafeFindCodeForInnerPointer(a); |
2254 } | 2253 } |
2255 | 2254 |
2256 | 2255 |
2257 #ifdef DEBUG | 2256 #ifdef DEBUG |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2418 if (prev_ && prev_->Intercept(flag)) return true; | 2417 if (prev_ && prev_->Intercept(flag)) return true; |
2419 // Then check whether this scope intercepts. | 2418 // Then check whether this scope intercepts. |
2420 if ((flag & intercept_mask_)) { | 2419 if ((flag & intercept_mask_)) { |
2421 intercepted_flags_ |= flag; | 2420 intercepted_flags_ |= flag; |
2422 return true; | 2421 return true; |
2423 } | 2422 } |
2424 return false; | 2423 return false; |
2425 } | 2424 } |
2426 | 2425 |
2427 } } // namespace v8::internal | 2426 } } // namespace v8::internal |
OLD | NEW |