Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(502)

Side by Side Diff: src/objects.cc

Issue 132493002: [Sheriff] Revert "Templatise type representation" and "Fix Mac warnings". (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.h ('k') | src/property-details.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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();
10546 for (RelocIterator it(this, mask); !it.done(); it.next()) { 10547 for (RelocIterator it(this, mask); !it.done(); it.next()) {
10547 RelocInfo* info = it.rinfo(); 10548 RelocInfo* info = it.rinfo();
10548 Object* object = info->target_object(); 10549 Object* object = info->target_object();
10549 if (object->IsMap()) { 10550 if (object->IsMap()) {
10550 Handle<Map> map(Map::cast(object)); 10551 Handle<Map> map(Map::cast(object));
10551 types->Add(IC::MapToType(map)); 10552 types->Add(handle(IC::MapToType(map), isolate));
10552 } 10553 }
10553 } 10554 }
10554 } 10555 }
10555 10556
10556 10557
10557 void Code::ReplaceFirstMap(Map* replace_with) { 10558 void Code::ReplaceFirstMap(Map* replace_with) {
10558 ReplaceNthObject(1, GetHeap()->meta_map(), replace_with); 10559 ReplaceNthObject(1, GetHeap()->meta_map(), replace_with);
10559 } 10560 }
10560 10561
10561 10562
(...skipping 6035 matching lines...) Expand 10 before | Expand all | Expand 10 after
16597 set_type_raw(type, ignored); 16598 set_type_raw(type, ignored);
16598 } 16599 }
16599 16600
16600 16601
16601 Handle<Type> PropertyCell::UpdatedType(Handle<PropertyCell> cell, 16602 Handle<Type> PropertyCell::UpdatedType(Handle<PropertyCell> cell,
16602 Handle<Object> value) { 16603 Handle<Object> value) {
16603 Isolate* isolate = cell->GetIsolate(); 16604 Isolate* isolate = cell->GetIsolate();
16604 Handle<Type> old_type(cell->type(), isolate); 16605 Handle<Type> old_type(cell->type(), isolate);
16605 // TODO(2803): Do not track ConsString as constant because they cannot be 16606 // TODO(2803): Do not track ConsString as constant because they cannot be
16606 // embedded into code. 16607 // embedded into code.
16607 Handle<Type> new_type = value->IsConsString() || value->IsTheHole() 16608 Handle<Type> new_type(value->IsConsString() || value->IsTheHole()
16608 ? Type::Any(isolate) : Type::Constant(value, isolate); 16609 ? Type::Any()
16610 : Type::Constant(value, isolate), isolate);
16609 16611
16610 if (new_type->Is(old_type)) { 16612 if (new_type->Is(old_type)) {
16611 return old_type; 16613 return old_type;
16612 } 16614 }
16613 16615
16614 cell->dependent_code()->DeoptimizeDependentCodeGroup( 16616 cell->dependent_code()->DeoptimizeDependentCodeGroup(
16615 isolate, DependentCode::kPropertyCellChangedGroup); 16617 isolate, DependentCode::kPropertyCellChangedGroup);
16616 16618
16617 if (old_type->Is(Type::None()) || old_type->Is(Type::Undefined())) { 16619 if (old_type->Is(Type::None()) || old_type->Is(Type::Undefined())) {
16618 return new_type; 16620 return new_type;
16619 } 16621 }
16620 16622
16621 return Type::Any(isolate); 16623 return handle(Type::Any(), isolate);
16622 } 16624 }
16623 16625
16624 16626
16625 void PropertyCell::SetValueInferType(Handle<PropertyCell> cell, 16627 void PropertyCell::SetValueInferType(Handle<PropertyCell> cell,
16626 Handle<Object> value) { 16628 Handle<Object> value) {
16627 cell->set_value(*value); 16629 cell->set_value(*value);
16628 if (!Type::Any()->Is(cell->type())) { 16630 if (!Type::Any()->Is(cell->type())) {
16629 Handle<Type> new_type = UpdatedType(cell, value); 16631 Handle<Type> new_type = UpdatedType(cell, value);
16630 cell->set_type(*new_type); 16632 cell->set_type(*new_type);
16631 } 16633 }
(...skipping 24 matching lines...) Expand all
16656 #define ERROR_MESSAGES_TEXTS(C, T) T, 16658 #define ERROR_MESSAGES_TEXTS(C, T) T,
16657 static const char* error_messages_[] = { 16659 static const char* error_messages_[] = {
16658 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16660 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16659 }; 16661 };
16660 #undef ERROR_MESSAGES_TEXTS 16662 #undef ERROR_MESSAGES_TEXTS
16661 return error_messages_[reason]; 16663 return error_messages_[reason];
16662 } 16664 }
16663 16665
16664 16666
16665 } } // namespace v8::internal 16667 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/property-details.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698