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

Side by Side Diff: src/objects.cc

Issue 139133004: Merged r19024, r19026 into trunk branch. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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/mark-compact.cc ('k') | src/spaces.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 12820 matching lines...) Expand 10 before | Expand all | Expand 10 after
12831 object->UpdateAllocationSite(to_kind)); 12831 object->UpdateAllocationSite(to_kind));
12832 } 12832 }
12833 12833
12834 12834
12835 MaybeObject* JSObject::UpdateAllocationSite(ElementsKind to_kind) { 12835 MaybeObject* JSObject::UpdateAllocationSite(ElementsKind to_kind) {
12836 if (!IsJSArray()) return this; 12836 if (!IsJSArray()) return this;
12837 12837
12838 Heap* heap = GetHeap(); 12838 Heap* heap = GetHeap();
12839 if (!heap->InNewSpace(this)) return this; 12839 if (!heap->InNewSpace(this)) return this;
12840 12840
12841 // Check if there is potentially a memento behind the object. If
12842 // the last word of the momento is on another page we return
12843 // immediatelly.
12844 Address object_address = address();
12845 Address memento_address = object_address + JSArray::kSize;
12846 Address last_memento_word_address = memento_address + kPointerSize;
12847 if (!NewSpacePage::OnSamePage(object_address,
12848 last_memento_word_address)) {
12849 return this;
12850 }
12851
12841 // Either object is the last object in the new space, or there is another 12852 // Either object is the last object in the new space, or there is another
12842 // object of at least word size (the header map word) following it, so 12853 // object of at least word size (the header map word) following it, so
12843 // suffices to compare ptr and top here. 12854 // suffices to compare ptr and top here.
12844 Address ptr = address() + JSArray::kSize;
12845 Address top = heap->NewSpaceTop(); 12855 Address top = heap->NewSpaceTop();
12846 ASSERT(ptr == top || ptr + HeapObject::kHeaderSize <= top); 12856 ASSERT(memento_address == top ||
12847 if (ptr == top) return this; 12857 memento_address + HeapObject::kHeaderSize <= top);
12858 if (memento_address == top) return this;
12848 12859
12849 HeapObject* candidate = HeapObject::FromAddress(ptr); 12860 HeapObject* candidate = HeapObject::FromAddress(memento_address);
12850 if (candidate->map() != heap->allocation_memento_map()) return this; 12861 if (candidate->map() != heap->allocation_memento_map()) return this;
12851 12862
12852 AllocationMemento* memento = AllocationMemento::cast(candidate); 12863 AllocationMemento* memento = AllocationMemento::cast(candidate);
12853 if (!memento->IsValid()) return this; 12864 if (!memento->IsValid()) return this;
12854 12865
12855 // Walk through to the Allocation Site 12866 // Walk through to the Allocation Site
12856 AllocationSite* site = memento->GetAllocationSite(); 12867 AllocationSite* site = memento->GetAllocationSite();
12857 return site->DigestTransitionFeedback(to_kind); 12868 return site->DigestTransitionFeedback(to_kind);
12858 } 12869 }
12859 12870
(...skipping 3615 matching lines...) Expand 10 before | Expand all | Expand 10 after
16475 #define ERROR_MESSAGES_TEXTS(C, T) T, 16486 #define ERROR_MESSAGES_TEXTS(C, T) T,
16476 static const char* error_messages_[] = { 16487 static const char* error_messages_[] = {
16477 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16488 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16478 }; 16489 };
16479 #undef ERROR_MESSAGES_TEXTS 16490 #undef ERROR_MESSAGES_TEXTS
16480 return error_messages_[reason]; 16491 return error_messages_[reason];
16481 } 16492 }
16482 16493
16483 16494
16484 } } // namespace v8::internal 16495 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mark-compact.cc ('k') | src/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698