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

Side by Side Diff: src/heap.cc

Issue 10066046: Tiny DescriptorArray cleanup. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed copyright year Created 8 years, 8 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/handles.cc ('k') | src/objects.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 3955 matching lines...) Expand 10 before | Expand all | Expand 10 after
3966 StringDictionary::Allocate( 3966 StringDictionary::Allocate(
3967 map->NumberOfDescribedProperties() * 2 + initial_size); 3967 map->NumberOfDescribedProperties() * 2 + initial_size);
3968 if (!maybe_obj->ToObject(&obj)) return maybe_obj; 3968 if (!maybe_obj->ToObject(&obj)) return maybe_obj;
3969 } 3969 }
3970 StringDictionary* dictionary = StringDictionary::cast(obj); 3970 StringDictionary* dictionary = StringDictionary::cast(obj);
3971 3971
3972 // The global object might be created from an object template with accessors. 3972 // The global object might be created from an object template with accessors.
3973 // Fill these accessors into the dictionary. 3973 // Fill these accessors into the dictionary.
3974 DescriptorArray* descs = map->instance_descriptors(); 3974 DescriptorArray* descs = map->instance_descriptors();
3975 for (int i = 0; i < descs->number_of_descriptors(); i++) { 3975 for (int i = 0; i < descs->number_of_descriptors(); i++) {
3976 PropertyDetails details(descs->GetDetails(i)); 3976 PropertyDetails details = descs->GetDetails(i);
3977 ASSERT(details.type() == CALLBACKS); // Only accessors are expected. 3977 ASSERT(details.type() == CALLBACKS); // Only accessors are expected.
3978 PropertyDetails d = 3978 PropertyDetails d =
3979 PropertyDetails(details.attributes(), CALLBACKS, details.index()); 3979 PropertyDetails(details.attributes(), CALLBACKS, details.index());
3980 Object* value = descs->GetCallbacksObject(i); 3980 Object* value = descs->GetCallbacksObject(i);
3981 { MaybeObject* maybe_value = AllocateJSGlobalPropertyCell(value); 3981 { MaybeObject* maybe_value = AllocateJSGlobalPropertyCell(value);
3982 if (!maybe_value->ToObject(&value)) return maybe_value; 3982 if (!maybe_value->ToObject(&value)) return maybe_value;
3983 } 3983 }
3984 3984
3985 Object* result; 3985 Object* result;
3986 { MaybeObject* maybe_result = dictionary->Add(descs->GetKey(i), value, d); 3986 { MaybeObject* maybe_result = dictionary->Add(descs->GetKey(i), value, d);
(...skipping 3019 matching lines...) Expand 10 before | Expand all | Expand 10 after
7006 } else { 7006 } else {
7007 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died. 7007 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died.
7008 } 7008 }
7009 remembered_unmapped_pages_[remembered_unmapped_pages_index_] = 7009 remembered_unmapped_pages_[remembered_unmapped_pages_index_] =
7010 reinterpret_cast<Address>(p); 7010 reinterpret_cast<Address>(p);
7011 remembered_unmapped_pages_index_++; 7011 remembered_unmapped_pages_index_++;
7012 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages; 7012 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages;
7013 } 7013 }
7014 7014
7015 } } // namespace v8::internal 7015 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/handles.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698