| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 <sstream> | 5 #include <sstream> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
| 10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
| (...skipping 12941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12952 } | 12952 } |
| 12953 site->SetElementsKind(to_kind); | 12953 site->SetElementsKind(to_kind); |
| 12954 site->dependent_code()->DeoptimizeDependentCodeGroup( | 12954 site->dependent_code()->DeoptimizeDependentCodeGroup( |
| 12955 isolate, DependentCode::kAllocationSiteTransitionChangedGroup); | 12955 isolate, DependentCode::kAllocationSiteTransitionChangedGroup); |
| 12956 } | 12956 } |
| 12957 } | 12957 } |
| 12958 } | 12958 } |
| 12959 | 12959 |
| 12960 | 12960 |
| 12961 // static | 12961 // static |
| 12962 void AllocationSite::AddDependentCompilationInfo(Handle<AllocationSite> site, | 12962 void AllocationSite::RegisterForDeoptOnTenureChange(Handle<AllocationSite> site, |
| 12963 Reason reason, | 12963 CompilationInfo* info) { |
| 12964 CompilationInfo* info) { | 12964 AddDependentCompilationInfo( |
| 12965 DependentCode::DependencyGroup group = site->ToDependencyGroup(reason); | 12965 site, DependentCode::kAllocationSiteTenuringChangedGroup, info); |
| 12966 } |
| 12967 |
| 12968 |
| 12969 // static |
| 12970 void AllocationSite::RegisterForDeoptOnTransitionChange( |
| 12971 Handle<AllocationSite> site, CompilationInfo* info) { |
| 12972 // Do nothing if the object doesn't have any useful element transitions left. |
| 12973 ElementsKind kind = |
| 12974 site->SitePointsToLiteral() |
| 12975 ? JSObject::cast(site->transition_info())->GetElementsKind() |
| 12976 : site->GetElementsKind(); |
| 12977 if (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) { |
| 12978 AddDependentCompilationInfo( |
| 12979 site, DependentCode::kAllocationSiteTransitionChangedGroup, info); |
| 12980 } |
| 12981 } |
| 12982 |
| 12983 |
| 12984 // static |
| 12985 void AllocationSite::AddDependentCompilationInfo( |
| 12986 Handle<AllocationSite> site, DependentCode::DependencyGroup group, |
| 12987 CompilationInfo* info) { |
| 12966 Handle<DependentCode> dep(site->dependent_code()); | 12988 Handle<DependentCode> dep(site->dependent_code()); |
| 12967 Handle<DependentCode> codes = | 12989 Handle<DependentCode> codes = |
| 12968 DependentCode::Insert(dep, group, info->object_wrapper()); | 12990 DependentCode::Insert(dep, group, info->object_wrapper()); |
| 12969 if (*codes != site->dependent_code()) site->set_dependent_code(*codes); | 12991 if (*codes != site->dependent_code()) site->set_dependent_code(*codes); |
| 12970 info->dependencies(group)->Add(Handle<HeapObject>(*site), info->zone()); | 12992 info->dependencies(group)->Add(Handle<HeapObject>(*site), info->zone()); |
| 12971 } | 12993 } |
| 12972 | 12994 |
| 12973 | 12995 |
| 12974 const char* AllocationSite::PretenureDecisionName(PretenureDecision decision) { | 12996 const char* AllocationSite::PretenureDecisionName(PretenureDecision decision) { |
| 12975 switch (decision) { | 12997 switch (decision) { |
| (...skipping 3831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16807 Handle<DependentCode> codes = | 16829 Handle<DependentCode> codes = |
| 16808 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), | 16830 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), |
| 16809 DependentCode::kPropertyCellChangedGroup, | 16831 DependentCode::kPropertyCellChangedGroup, |
| 16810 info->object_wrapper()); | 16832 info->object_wrapper()); |
| 16811 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 16833 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
| 16812 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 16834 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
| 16813 cell, info->zone()); | 16835 cell, info->zone()); |
| 16814 } | 16836 } |
| 16815 | 16837 |
| 16816 } } // namespace v8::internal | 16838 } } // namespace v8::internal |
| OLD | NEW |