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

Side by Side Diff: src/objects.cc

Issue 2950003: Virtually dispatched scavengers (Closed)
Patch Set: Created 10 years, 5 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/objects.h ('k') | src/objects-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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-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 2172 matching lines...) Expand 10 before | Expand all | Expand 10 after
2183 if (obj->IsFailure()) return obj; 2183 if (obj->IsFailure()) return obj;
2184 Map* new_map = Map::cast(obj); 2184 Map* new_map = Map::cast(obj);
2185 2185
2186 // Clear inobject properties if needed by adjusting the instance size and 2186 // Clear inobject properties if needed by adjusting the instance size and
2187 // putting in a filler object instead of the inobject properties. 2187 // putting in a filler object instead of the inobject properties.
2188 if (mode == CLEAR_INOBJECT_PROPERTIES && map()->inobject_properties() > 0) { 2188 if (mode == CLEAR_INOBJECT_PROPERTIES && map()->inobject_properties() > 0) {
2189 int instance_size_delta = map()->inobject_properties() * kPointerSize; 2189 int instance_size_delta = map()->inobject_properties() * kPointerSize;
2190 int new_instance_size = map()->instance_size() - instance_size_delta; 2190 int new_instance_size = map()->instance_size() - instance_size_delta;
2191 new_map->set_inobject_properties(0); 2191 new_map->set_inobject_properties(0);
2192 new_map->set_instance_size(new_instance_size); 2192 new_map->set_instance_size(new_instance_size);
2193 new_map->set_scavenger(Heap::GetScavenger(new_map->instance_type(),
2194 new_map->instance_size()));
2193 Heap::CreateFillerObjectAt(this->address() + new_instance_size, 2195 Heap::CreateFillerObjectAt(this->address() + new_instance_size,
2194 instance_size_delta); 2196 instance_size_delta);
2195 } 2197 }
2196 new_map->set_unused_property_fields(0); 2198 new_map->set_unused_property_fields(0);
2197 2199
2198 // We have now successfully allocated all the necessary objects. 2200 // We have now successfully allocated all the necessary objects.
2199 // Changes can now be made with the guarantee that all of them take effect. 2201 // Changes can now be made with the guarantee that all of them take effect.
2200 set_map(new_map); 2202 set_map(new_map);
2201 map()->set_instance_descriptors(Heap::empty_descriptor_array()); 2203 map()->set_instance_descriptors(Heap::empty_descriptor_array());
2202 2204
(...skipping 2823 matching lines...) Expand 10 before | Expand all | Expand 10 after
5026 // Getter prototype() is read-only, set_prototype() has side effects. 5028 // Getter prototype() is read-only, set_prototype() has side effects.
5027 *RawField(target, Map::kPrototypeOffset) = real_prototype; 5029 *RawField(target, Map::kPrototypeOffset) = real_prototype;
5028 } 5030 }
5029 } 5031 }
5030 } 5032 }
5031 } 5033 }
5032 5034
5033 5035
5034 void Map::MapIterateBody(ObjectVisitor* v) { 5036 void Map::MapIterateBody(ObjectVisitor* v) {
5035 // Assumes all Object* members are contiguously allocated! 5037 // Assumes all Object* members are contiguously allocated!
5036 IteratePointers(v, kPrototypeOffset, kCodeCacheOffset + kPointerSize); 5038 IteratePointers(v, kPointerFieldsBeginOffset, kPointerFieldsEndOffset);
5037 } 5039 }
5038 5040
5039 5041
5040 Object* JSFunction::SetInstancePrototype(Object* value) { 5042 Object* JSFunction::SetInstancePrototype(Object* value) {
5041 ASSERT(value->IsJSObject()); 5043 ASSERT(value->IsJSObject());
5042 5044
5043 if (has_initial_map()) { 5045 if (has_initial_map()) {
5044 initial_map()->set_prototype(value); 5046 initial_map()->set_prototype(value);
5045 } else { 5047 } else {
5046 // Put the value in the initial map field until an initial map is 5048 // Put the value in the initial map field until an initial map is
(...skipping 3722 matching lines...) Expand 10 before | Expand all | Expand 10 after
8769 if (break_point_objects()->IsUndefined()) return 0; 8771 if (break_point_objects()->IsUndefined()) return 0;
8770 // Single beak point. 8772 // Single beak point.
8771 if (!break_point_objects()->IsFixedArray()) return 1; 8773 if (!break_point_objects()->IsFixedArray()) return 1;
8772 // Multiple break points. 8774 // Multiple break points.
8773 return FixedArray::cast(break_point_objects())->length(); 8775 return FixedArray::cast(break_point_objects())->length();
8774 } 8776 }
8775 #endif 8777 #endif
8776 8778
8777 8779
8778 } } // namespace v8::internal 8780 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698