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 15803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15814 void PropertyCell::set_type(Type* type, WriteBarrierMode ignored) { | 15814 void PropertyCell::set_type(Type* type, WriteBarrierMode ignored) { |
15815 ASSERT(IsPropertyCell()); | 15815 ASSERT(IsPropertyCell()); |
15816 set_type_raw(type, ignored); | 15816 set_type_raw(type, ignored); |
15817 } | 15817 } |
15818 | 15818 |
15819 | 15819 |
15820 Type* PropertyCell::UpdateType(Handle<PropertyCell> cell, | 15820 Type* PropertyCell::UpdateType(Handle<PropertyCell> cell, |
15821 Handle<Object> value) { | 15821 Handle<Object> value) { |
15822 Isolate* isolate = cell->GetIsolate(); | 15822 Isolate* isolate = cell->GetIsolate(); |
15823 Handle<Type> old_type(cell->type(), isolate); | 15823 Handle<Type> old_type(cell->type(), isolate); |
15824 Handle<Type> new_type((value->IsSmi() || value->IsJSFunction() || | 15824 Handle<Type> new_type((value->IsSmi() || value->IsUndefined()) |
15825 value->IsUndefined()) | |
15826 ? Type::Constant(value, isolate) | 15825 ? Type::Constant(value, isolate) |
15827 : Type::Any(), isolate); | 15826 : Type::Any(), isolate); |
15828 | 15827 |
15829 if (new_type->Is(old_type)) { | 15828 if (new_type->Is(old_type)) { |
15830 return *old_type; | 15829 return *old_type; |
15831 } | 15830 } |
15832 | 15831 |
15833 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 15832 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
15834 isolate, DependentCode::kPropertyCellChangedGroup); | 15833 isolate, DependentCode::kPropertyCellChangedGroup); |
15835 | 15834 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15871 | 15870 |
15872 void PropertyCell::AddDependentCode(Handle<Code> code) { | 15871 void PropertyCell::AddDependentCode(Handle<Code> code) { |
15873 Handle<DependentCode> codes = DependentCode::Insert( | 15872 Handle<DependentCode> codes = DependentCode::Insert( |
15874 Handle<DependentCode>(dependent_code()), | 15873 Handle<DependentCode>(dependent_code()), |
15875 DependentCode::kPropertyCellChangedGroup, code); | 15874 DependentCode::kPropertyCellChangedGroup, code); |
15876 if (*codes != dependent_code()) set_dependent_code(*codes); | 15875 if (*codes != dependent_code()) set_dependent_code(*codes); |
15877 } | 15876 } |
15878 | 15877 |
15879 | 15878 |
15880 } } // namespace v8::internal | 15879 } } // namespace v8::internal |
OLD | NEW |