OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 12860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12871 } | 12871 } |
12872 SetElementsKind(to_kind); | 12872 SetElementsKind(to_kind); |
12873 dependent_code()->DeoptimizeDependentCodeGroup( | 12873 dependent_code()->DeoptimizeDependentCodeGroup( |
12874 isolate, DependentCode::kAllocationSiteTransitionChangedGroup); | 12874 isolate, DependentCode::kAllocationSiteTransitionChangedGroup); |
12875 } | 12875 } |
12876 } | 12876 } |
12877 return this; | 12877 return this; |
12878 } | 12878 } |
12879 | 12879 |
12880 | 12880 |
12881 void AllocationSite::AddDependentCompilationInfo(Reason reason, | 12881 // static |
| 12882 void AllocationSite::AddDependentCompilationInfo(Handle<AllocationSite> site, |
| 12883 Reason reason, |
12882 CompilationInfo* info) { | 12884 CompilationInfo* info) { |
12883 DependentCode::DependencyGroup group = ToDependencyGroup(reason); | 12885 DependentCode::DependencyGroup group = site->ToDependencyGroup(reason); |
12884 Handle<DependentCode> dep(dependent_code()); | 12886 Handle<DependentCode> dep(site->dependent_code()); |
12885 Handle<DependentCode> codes = | 12887 Handle<DependentCode> codes = |
12886 DependentCode::Insert(dep, group, info->object_wrapper()); | 12888 DependentCode::Insert(dep, group, info->object_wrapper()); |
12887 if (*codes != dependent_code()) set_dependent_code(*codes); | 12889 if (*codes != site->dependent_code()) site->set_dependent_code(*codes); |
12888 info->dependencies(group)->Add(Handle<HeapObject>(this), info->zone()); | 12890 info->dependencies(group)->Add(Handle<HeapObject>(site), info->zone()); |
12889 } | 12891 } |
12890 | 12892 |
12891 | 12893 |
12892 void AllocationSite::AddDependentCode(Reason reason, Handle<Code> code) { | |
12893 DependentCode::DependencyGroup group = ToDependencyGroup(reason); | |
12894 Handle<DependentCode> codes = DependentCode::Insert( | |
12895 Handle<DependentCode>(dependent_code()), group, code); | |
12896 if (*codes != dependent_code()) set_dependent_code(*codes); | |
12897 } | |
12898 | |
12899 | |
12900 void JSObject::UpdateAllocationSite(Handle<JSObject> object, | 12894 void JSObject::UpdateAllocationSite(Handle<JSObject> object, |
12901 ElementsKind to_kind) { | 12895 ElementsKind to_kind) { |
12902 CALL_HEAP_FUNCTION_VOID(object->GetIsolate(), | 12896 CALL_HEAP_FUNCTION_VOID(object->GetIsolate(), |
12903 object->UpdateAllocationSite(to_kind)); | 12897 object->UpdateAllocationSite(to_kind)); |
12904 } | 12898 } |
12905 | 12899 |
12906 | 12900 |
12907 MaybeObject* JSObject::UpdateAllocationSite(ElementsKind to_kind) { | 12901 MaybeObject* JSObject::UpdateAllocationSite(ElementsKind to_kind) { |
12908 if (!IsJSArray()) { | 12902 if (!IsJSArray()) { |
12909 return this; | 12903 return this; |
(...skipping 3746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16656 Handle<DependentCode> dep(dependent_code()); | 16650 Handle<DependentCode> dep(dependent_code()); |
16657 Handle<DependentCode> codes = | 16651 Handle<DependentCode> codes = |
16658 DependentCode::Insert(dep, DependentCode::kPropertyCellChangedGroup, | 16652 DependentCode::Insert(dep, DependentCode::kPropertyCellChangedGroup, |
16659 info->object_wrapper()); | 16653 info->object_wrapper()); |
16660 if (*codes != dependent_code()) set_dependent_code(*codes); | 16654 if (*codes != dependent_code()) set_dependent_code(*codes); |
16661 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 16655 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
16662 Handle<HeapObject>(this), info->zone()); | 16656 Handle<HeapObject>(this), info->zone()); |
16663 } | 16657 } |
16664 | 16658 |
16665 | 16659 |
16666 void PropertyCell::AddDependentCode(Handle<Code> code) { | |
16667 Handle<DependentCode> codes = DependentCode::Insert( | |
16668 Handle<DependentCode>(dependent_code()), | |
16669 DependentCode::kPropertyCellChangedGroup, code); | |
16670 if (*codes != dependent_code()) set_dependent_code(*codes); | |
16671 } | |
16672 | |
16673 | |
16674 const char* GetBailoutReason(BailoutReason reason) { | 16660 const char* GetBailoutReason(BailoutReason reason) { |
16675 ASSERT(reason < kLastErrorMessage); | 16661 ASSERT(reason < kLastErrorMessage); |
16676 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16662 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16677 static const char* error_messages_[] = { | 16663 static const char* error_messages_[] = { |
16678 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16664 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16679 }; | 16665 }; |
16680 #undef ERROR_MESSAGES_TEXTS | 16666 #undef ERROR_MESSAGES_TEXTS |
16681 return error_messages_[reason]; | 16667 return error_messages_[reason]; |
16682 } | 16668 } |
16683 | 16669 |
16684 | 16670 |
16685 } } // namespace v8::internal | 16671 } } // namespace v8::internal |
OLD | NEW |