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 15881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15892 void PropertyCell::set_type(Type* type, WriteBarrierMode ignored) { | 15892 void PropertyCell::set_type(Type* type, WriteBarrierMode ignored) { |
15893 ASSERT(IsPropertyCell()); | 15893 ASSERT(IsPropertyCell()); |
15894 set_type_raw(type, ignored); | 15894 set_type_raw(type, ignored); |
15895 } | 15895 } |
15896 | 15896 |
15897 | 15897 |
15898 Type* PropertyCell::UpdateType(Handle<PropertyCell> cell, | 15898 Type* PropertyCell::UpdateType(Handle<PropertyCell> cell, |
15899 Handle<Object> value) { | 15899 Handle<Object> value) { |
15900 Isolate* isolate = cell->GetIsolate(); | 15900 Isolate* isolate = cell->GetIsolate(); |
15901 Handle<Type> old_type(cell->type(), isolate); | 15901 Handle<Type> old_type(cell->type(), isolate); |
15902 Handle<Type> new_type((value->IsSmi() || value->IsUndefined()) | 15902 Handle<Type> new_type((value->IsSmi() || value->IsJSFunction() || |
| 15903 value->IsUndefined()) |
15903 ? Type::Constant(value, isolate) | 15904 ? Type::Constant(value, isolate) |
15904 : Type::Any(), isolate); | 15905 : Type::Any(), isolate); |
15905 | 15906 |
15906 if (new_type->Is(old_type)) { | 15907 if (new_type->Is(old_type)) { |
15907 return *old_type; | 15908 return *old_type; |
15908 } | 15909 } |
15909 | 15910 |
15910 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 15911 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
15911 isolate, DependentCode::kPropertyCellChangedGroup); | 15912 isolate, DependentCode::kPropertyCellChangedGroup); |
15912 | 15913 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15948 | 15949 |
15949 void PropertyCell::AddDependentCode(Handle<Code> code) { | 15950 void PropertyCell::AddDependentCode(Handle<Code> code) { |
15950 Handle<DependentCode> codes = DependentCode::Insert( | 15951 Handle<DependentCode> codes = DependentCode::Insert( |
15951 Handle<DependentCode>(dependent_code()), | 15952 Handle<DependentCode>(dependent_code()), |
15952 DependentCode::kPropertyCellChangedGroup, code); | 15953 DependentCode::kPropertyCellChangedGroup, code); |
15953 if (*codes != dependent_code()) set_dependent_code(*codes); | 15954 if (*codes != dependent_code()) set_dependent_code(*codes); |
15954 } | 15955 } |
15955 | 15956 |
15956 | 15957 |
15957 } } // namespace v8::internal | 15958 } } // namespace v8::internal |
OLD | NEW |