| 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 15818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15829 void PropertyCell::set_type(Type* type, WriteBarrierMode ignored) { | 15829 void PropertyCell::set_type(Type* type, WriteBarrierMode ignored) { |
| 15830 ASSERT(IsPropertyCell()); | 15830 ASSERT(IsPropertyCell()); |
| 15831 set_type_raw(type, ignored); | 15831 set_type_raw(type, ignored); |
| 15832 } | 15832 } |
| 15833 | 15833 |
| 15834 | 15834 |
| 15835 Type* PropertyCell::UpdateType(Handle<PropertyCell> cell, | 15835 Type* PropertyCell::UpdateType(Handle<PropertyCell> cell, |
| 15836 Handle<Object> value) { | 15836 Handle<Object> value) { |
| 15837 Isolate* isolate = cell->GetIsolate(); | 15837 Isolate* isolate = cell->GetIsolate(); |
| 15838 Handle<Type> old_type(cell->type(), isolate); | 15838 Handle<Type> old_type(cell->type(), isolate); |
| 15839 Handle<Type> new_type((value->IsSmi() || value->IsUndefined()) | 15839 Handle<Type> new_type(Type::Constant(value, isolate), isolate); |
| 15840 ? Type::Constant(value, isolate) | |
| 15841 : Type::Any(), isolate); | |
| 15842 | 15840 |
| 15843 if (new_type->Is(old_type)) { | 15841 if (new_type->Is(old_type)) { |
| 15844 return *old_type; | 15842 return *old_type; |
| 15845 } | 15843 } |
| 15846 | 15844 |
| 15847 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 15845 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
| 15848 isolate, DependentCode::kPropertyCellChangedGroup); | 15846 isolate, DependentCode::kPropertyCellChangedGroup); |
| 15849 | 15847 |
| 15850 if (old_type->Is(Type::None()) || old_type->Is(Type::Undefined())) { | 15848 if (old_type->Is(Type::None()) || old_type->Is(Type::Undefined())) { |
| 15851 return *new_type; | 15849 return *new_type; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15885 | 15883 |
| 15886 void PropertyCell::AddDependentCode(Handle<Code> code) { | 15884 void PropertyCell::AddDependentCode(Handle<Code> code) { |
| 15887 Handle<DependentCode> codes = DependentCode::Insert( | 15885 Handle<DependentCode> codes = DependentCode::Insert( |
| 15888 Handle<DependentCode>(dependent_code()), | 15886 Handle<DependentCode>(dependent_code()), |
| 15889 DependentCode::kPropertyCellChangedGroup, code); | 15887 DependentCode::kPropertyCellChangedGroup, code); |
| 15890 if (*codes != dependent_code()) set_dependent_code(*codes); | 15888 if (*codes != dependent_code()) set_dependent_code(*codes); |
| 15891 } | 15889 } |
| 15892 | 15890 |
| 15893 | 15891 |
| 15894 } } // namespace v8::internal | 15892 } } // namespace v8::internal |
| OLD | NEW |