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

Side by Side Diff: src/spaces.cc

Issue 203070: Stop "cooking" targets of jumps and calls in code objects. Do not convert ju... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 3 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/serialize.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 // Perform space-specific object verification. 820 // Perform space-specific object verification.
821 VerifyObject(object); 821 VerifyObject(object);
822 822
823 // The object itself should look OK. 823 // The object itself should look OK.
824 object->Verify(); 824 object->Verify();
825 825
826 // All the interior pointers should be contained in the heap and 826 // All the interior pointers should be contained in the heap and
827 // have their remembered set bits set if required as determined 827 // have their remembered set bits set if required as determined
828 // by the visitor. 828 // by the visitor.
829 int size = object->Size(); 829 int size = object->Size();
830 if (object->IsCode()) { 830 object->IterateBody(map->instance_type(), size, visitor);
831 Code::cast(object)->ConvertICTargetsFromAddressToObject();
832 object->IterateBody(map->instance_type(), size, visitor);
833 Code::cast(object)->ConvertICTargetsFromObjectToAddress();
834 } else {
835 object->IterateBody(map->instance_type(), size, visitor);
836 }
837 831
838 current += size; 832 current += size;
839 } 833 }
840 834
841 // The allocation pointer should not be in the middle of an object. 835 // The allocation pointer should not be in the middle of an object.
842 ASSERT(current == top); 836 ASSERT(current == top);
843 } 837 }
844 838
845 current_page = current_page->next_page(); 839 current_page = current_page->next_page();
846 } 840 }
(...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after
2567 ASSERT(object->IsCode() || object->IsSeqString() || 2561 ASSERT(object->IsCode() || object->IsSeqString() ||
2568 object->IsExternalString() || object->IsFixedArray() || 2562 object->IsExternalString() || object->IsFixedArray() ||
2569 object->IsByteArray()); 2563 object->IsByteArray());
2570 2564
2571 // The object itself should look OK. 2565 // The object itself should look OK.
2572 object->Verify(); 2566 object->Verify();
2573 2567
2574 // Byte arrays and strings don't have interior pointers. 2568 // Byte arrays and strings don't have interior pointers.
2575 if (object->IsCode()) { 2569 if (object->IsCode()) {
2576 VerifyPointersVisitor code_visitor; 2570 VerifyPointersVisitor code_visitor;
2577 Code::cast(object)->ConvertICTargetsFromAddressToObject();
2578 object->IterateBody(map->instance_type(), 2571 object->IterateBody(map->instance_type(),
2579 object->Size(), 2572 object->Size(),
2580 &code_visitor); 2573 &code_visitor);
2581 Code::cast(object)->ConvertICTargetsFromObjectToAddress();
2582 } else if (object->IsFixedArray()) { 2574 } else if (object->IsFixedArray()) {
2583 // We loop over fixed arrays ourselves, rather then using the visitor, 2575 // We loop over fixed arrays ourselves, rather then using the visitor,
2584 // because the visitor doesn't support the start/offset iteration 2576 // because the visitor doesn't support the start/offset iteration
2585 // needed for IsRSetSet. 2577 // needed for IsRSetSet.
2586 FixedArray* array = FixedArray::cast(object); 2578 FixedArray* array = FixedArray::cast(object);
2587 for (int j = 0; j < array->length(); j++) { 2579 for (int j = 0; j < array->length(); j++) {
2588 Object* element = array->get(j); 2580 Object* element = array->get(j);
2589 if (element->IsHeapObject()) { 2581 if (element->IsHeapObject()) {
2590 HeapObject* element_object = HeapObject::cast(element); 2582 HeapObject* element_object = HeapObject::cast(element);
2591 ASSERT(Heap::Contains(element_object)); 2583 ASSERT(Heap::Contains(element_object));
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
2658 reinterpret_cast<Object**>(object->address() 2650 reinterpret_cast<Object**>(object->address()
2659 + Page::kObjectAreaSize), 2651 + Page::kObjectAreaSize),
2660 allocation_top); 2652 allocation_top);
2661 PrintF("\n"); 2653 PrintF("\n");
2662 } 2654 }
2663 } 2655 }
2664 } 2656 }
2665 #endif // DEBUG 2657 #endif // DEBUG
2666 2658
2667 } } // namespace v8::internal 2659 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/serialize.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698