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

Unified Diff: src/objects.cc

Issue 10556004: Revert part of 11727 as it sometimes tanked V8 benchmark (raytrace) performance (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
===================================================================
--- src/objects.cc (revision 11828)
+++ src/objects.cc (working copy)
@@ -7563,34 +7563,11 @@
// Make sure prototypes are fast objects and their maps have the bit set
// so they remain fast.
Map* proto_map = map();
- if (!proto_map->used_for_prototype()) {
- if (!HasFastProperties()) {
- MaybeObject* new_proto = TransformToFastProperties(0);
- if (new_proto->IsFailure()) return new_proto;
- ASSERT(new_proto == this);
- proto_map = map();
- if (!proto_map->is_shared()) {
- proto_map->set_used_for_prototype(true);
- }
- } else {
- Heap* heap = GetHeap();
- // We use the hole value as a singleton key in the prototype transition
- // map so that we don't multiply the number of maps unnecessarily.
- Map* new_map =
- proto_map->GetPrototypeTransition(heap->the_hole_value());
- if (new_map == NULL) {
- MaybeObject* maybe_new_map =
- proto_map->CopyDropTransitions(DescriptorArray::MAY_BE_SHARED);
- if (!maybe_new_map->To<Map>(&new_map)) return maybe_new_map;
- new_map->set_used_for_prototype(true);
- MaybeObject* ok =
- proto_map->PutPrototypeTransition(heap->the_hole_value(),
- new_map);
- if (ok->IsFailure()) return ok;
- }
- ASSERT(!proto_map->is_shared() && !new_map->is_shared());
- set_map(new_map);
- }
+ if (!HasFastProperties()) {
+ MaybeObject* new_proto = TransformToFastProperties(0);
+ if (new_proto->IsFailure()) return new_proto;
+ ASSERT(new_proto == this);
+ proto_map = map();
}
return this;
}
@@ -7600,8 +7577,8 @@
ASSERT(value->IsJSReceiver());
Heap* heap = GetHeap();
- // First some logic for the map of the prototype to make sure the
- // used_for_prototype flag is set.
+ // First some logic for the map of the prototype to make sure it is in fast
+ // mode.
if (value->IsJSObject()) {
MaybeObject* ok = JSObject::cast(value)->OptimizeAsPrototype();
if (ok->IsFailure()) return ok;
« 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