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

Side by Side Diff: src/heap.cc

Issue 3397021: [Isolates] StaticVisitor::VisitPointer gets Heap* as additional argument (Closed)
Patch Set: Added CODE_POINTER_ALIGN per Vitaly's suggestion. Created 10 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
« no previous file with comments | « src/globals.h ('k') | src/ia32/assembler-ia32-inl.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 } 1032 }
1033 } 1033 }
1034 1034
1035 ASSERT(last <= end); 1035 ASSERT(last <= end);
1036 external_string_table_.ShrinkNewStrings(static_cast<int>(last - start)); 1036 external_string_table_.ShrinkNewStrings(static_cast<int>(last - start));
1037 } 1037 }
1038 1038
1039 1039
1040 class NewSpaceScavenger : public StaticNewSpaceVisitor<NewSpaceScavenger> { 1040 class NewSpaceScavenger : public StaticNewSpaceVisitor<NewSpaceScavenger> {
1041 public: 1041 public:
1042 static inline void VisitPointer(Object** p) { 1042 static inline void VisitPointer(Heap* heap, Object** p) {
1043 Object* object = *p; 1043 Object* object = *p;
1044 if (!HEAP->InNewSpace(object)) return; 1044 if (!heap->InNewSpace(object)) return;
1045 Heap::ScavengeObject(reinterpret_cast<HeapObject**>(p), 1045 Heap::ScavengeObject(reinterpret_cast<HeapObject**>(p),
1046 reinterpret_cast<HeapObject*>(object)); 1046 reinterpret_cast<HeapObject*>(object));
1047 } 1047 }
1048 }; 1048 };
1049 1049
1050 1050
1051 Address Heap::DoScavenge(ObjectVisitor* scavenge_visitor, 1051 Address Heap::DoScavenge(ObjectVisitor* scavenge_visitor,
1052 Address new_space_front) { 1052 Address new_space_front) {
1053 do { 1053 do {
1054 ASSERT(new_space_front <= new_space_.top()); 1054 ASSERT(new_space_front <= new_space_.top());
(...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after
2780 JSObject* global = JSObject::cast(obj); 2780 JSObject* global = JSObject::cast(obj);
2781 InitializeJSObjectFromMap(global, dictionary, map); 2781 InitializeJSObjectFromMap(global, dictionary, map);
2782 2782
2783 // Create a new map for the global object. 2783 // Create a new map for the global object.
2784 obj = map->CopyDropDescriptors(); 2784 obj = map->CopyDropDescriptors();
2785 if (obj->IsFailure()) return obj; 2785 if (obj->IsFailure()) return obj;
2786 Map* new_map = Map::cast(obj); 2786 Map* new_map = Map::cast(obj);
2787 2787
2788 // Setup the global object as a normalized object. 2788 // Setup the global object as a normalized object.
2789 global->set_map(new_map); 2789 global->set_map(new_map);
2790 global->map()->set_instance_descriptors(HEAP->empty_descriptor_array()); 2790 global->map()->set_instance_descriptors(empty_descriptor_array());
2791 global->set_properties(dictionary); 2791 global->set_properties(dictionary);
2792 2792
2793 // Make sure result is a global object with properties in dictionary. 2793 // Make sure result is a global object with properties in dictionary.
2794 ASSERT(global->IsGlobalObject()); 2794 ASSERT(global->IsGlobalObject());
2795 ASSERT(!global->HasFastProperties()); 2795 ASSERT(!global->HasFastProperties());
2796 return global; 2796 return global;
2797 } 2797 }
2798 2798
2799 2799
2800 Object* Heap::CopyJSObject(JSObject* source) { 2800 Object* Heap::CopyJSObject(JSObject* source) {
(...skipping 2148 matching lines...) Expand 10 before | Expand all | Expand 10 after
4949 } 4949 }
4950 4950
4951 4951
4952 void ExternalStringTable::TearDown() { 4952 void ExternalStringTable::TearDown() {
4953 new_space_strings_.Free(); 4953 new_space_strings_.Free();
4954 old_space_strings_.Free(); 4954 old_space_strings_.Free();
4955 } 4955 }
4956 4956
4957 4957
4958 } } // namespace v8::internal 4958 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/globals.h ('k') | src/ia32/assembler-ia32-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698