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 10525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10536 Object* object = info->target_object(); | 10536 Object* object = info->target_object(); |
10537 if (object->IsMap()) maps->Add(handle(Map::cast(object))); | 10537 if (object->IsMap()) maps->Add(handle(Map::cast(object))); |
10538 } | 10538 } |
10539 } | 10539 } |
10540 | 10540 |
10541 | 10541 |
10542 void Code::FindAllTypes(TypeHandleList* types) { | 10542 void Code::FindAllTypes(TypeHandleList* types) { |
10543 ASSERT(is_inline_cache_stub()); | 10543 ASSERT(is_inline_cache_stub()); |
10544 DisallowHeapAllocation no_allocation; | 10544 DisallowHeapAllocation no_allocation; |
10545 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 10545 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
10546 Isolate* isolate = GetIsolate(); | |
10547 for (RelocIterator it(this, mask); !it.done(); it.next()) { | 10546 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
10548 RelocInfo* info = it.rinfo(); | 10547 RelocInfo* info = it.rinfo(); |
10549 Object* object = info->target_object(); | 10548 Object* object = info->target_object(); |
10550 if (object->IsMap()) { | 10549 if (object->IsMap()) { |
10551 Handle<Map> map(Map::cast(object)); | 10550 Handle<Map> map(Map::cast(object)); |
10552 types->Add(handle(IC::MapToType(map), isolate)); | 10551 types->Add(IC::MapToType(map)); |
10553 } | 10552 } |
10554 } | 10553 } |
10555 } | 10554 } |
10556 | 10555 |
10557 | 10556 |
10558 void Code::ReplaceFirstMap(Map* replace_with) { | 10557 void Code::ReplaceFirstMap(Map* replace_with) { |
10559 ReplaceNthObject(1, GetHeap()->meta_map(), replace_with); | 10558 ReplaceNthObject(1, GetHeap()->meta_map(), replace_with); |
10560 } | 10559 } |
10561 | 10560 |
10562 | 10561 |
(...skipping 6035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16598 set_type_raw(type, ignored); | 16597 set_type_raw(type, ignored); |
16599 } | 16598 } |
16600 | 16599 |
16601 | 16600 |
16602 Handle<Type> PropertyCell::UpdatedType(Handle<PropertyCell> cell, | 16601 Handle<Type> PropertyCell::UpdatedType(Handle<PropertyCell> cell, |
16603 Handle<Object> value) { | 16602 Handle<Object> value) { |
16604 Isolate* isolate = cell->GetIsolate(); | 16603 Isolate* isolate = cell->GetIsolate(); |
16605 Handle<Type> old_type(cell->type(), isolate); | 16604 Handle<Type> old_type(cell->type(), isolate); |
16606 // TODO(2803): Do not track ConsString as constant because they cannot be | 16605 // TODO(2803): Do not track ConsString as constant because they cannot be |
16607 // embedded into code. | 16606 // embedded into code. |
16608 Handle<Type> new_type(value->IsConsString() || value->IsTheHole() | 16607 Handle<Type> new_type = value->IsConsString() || value->IsTheHole() |
16609 ? Type::Any() | 16608 ? Type::Any(isolate) : Type::Constant(value, isolate); |
16610 : Type::Constant(value, isolate), isolate); | |
16611 | 16609 |
16612 if (new_type->Is(old_type)) { | 16610 if (new_type->Is(old_type)) { |
16613 return old_type; | 16611 return old_type; |
16614 } | 16612 } |
16615 | 16613 |
16616 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 16614 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
16617 isolate, DependentCode::kPropertyCellChangedGroup); | 16615 isolate, DependentCode::kPropertyCellChangedGroup); |
16618 | 16616 |
16619 if (old_type->Is(Type::None()) || old_type->Is(Type::Undefined())) { | 16617 if (old_type->Is(Type::None()) || old_type->Is(Type::Undefined())) { |
16620 return new_type; | 16618 return new_type; |
16621 } | 16619 } |
16622 | 16620 |
16623 return handle(Type::Any(), isolate); | 16621 return Type::Any(isolate); |
16624 } | 16622 } |
16625 | 16623 |
16626 | 16624 |
16627 void PropertyCell::SetValueInferType(Handle<PropertyCell> cell, | 16625 void PropertyCell::SetValueInferType(Handle<PropertyCell> cell, |
16628 Handle<Object> value) { | 16626 Handle<Object> value) { |
16629 cell->set_value(*value); | 16627 cell->set_value(*value); |
16630 if (!Type::Any()->Is(cell->type())) { | 16628 if (!Type::Any()->Is(cell->type())) { |
16631 Handle<Type> new_type = UpdatedType(cell, value); | 16629 Handle<Type> new_type = UpdatedType(cell, value); |
16632 cell->set_type(*new_type); | 16630 cell->set_type(*new_type); |
16633 } | 16631 } |
(...skipping 24 matching lines...) Expand all Loading... |
16658 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16656 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16659 static const char* error_messages_[] = { | 16657 static const char* error_messages_[] = { |
16660 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16658 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16661 }; | 16659 }; |
16662 #undef ERROR_MESSAGES_TEXTS | 16660 #undef ERROR_MESSAGES_TEXTS |
16663 return error_messages_[reason]; | 16661 return error_messages_[reason]; |
16664 } | 16662 } |
16665 | 16663 |
16666 | 16664 |
16667 } } // namespace v8::internal | 16665 } } // namespace v8::internal |
OLD | NEW |