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

Unified Diff: src/objects.cc

Issue 1413003008: Support fast-path allocation for subclass constructors with correctly initialized initial maps. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/runtime/runtime-object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index cc6ae919a8a37927b840575a8ed9235b571bbdfb..67cba48414fba0ffa630654325a73fa580d977e1 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -11222,16 +11222,22 @@ static void ShrinkInstanceSize(Map* map, void* data) {
void JSFunction::CompleteInobjectSlackTracking() {
DCHECK(has_initial_map());
- Map* map = initial_map();
+ initial_map()->CompleteInobjectSlackTracking();
+}
- DCHECK(map->counter() >= Map::kSlackTrackingCounterEnd - 1);
- map->set_counter(Map::kRetainingCounterStart);
- int slack = map->unused_property_fields();
- TransitionArray::TraverseTransitionTree(map, &GetMinInobjectSlack, &slack);
+void Map::CompleteInobjectSlackTracking() {
+ // Has to be an initial map.
+ DCHECK(GetBackPointer()->IsUndefined());
+
+ DCHECK_GE(counter(), kSlackTrackingCounterEnd - 1);
+ set_counter(kRetainingCounterStart);
+
+ int slack = unused_property_fields();
+ TransitionArray::TraverseTransitionTree(this, &GetMinInobjectSlack, &slack);
if (slack != 0) {
// Resize the initial map and all maps in its transition tree.
- TransitionArray::TraverseTransitionTree(map, &ShrinkInstanceSize, &slack);
+ TransitionArray::TraverseTransitionTree(this, &ShrinkInstanceSize, &slack);
}
}
« no previous file with comments | « src/objects.h ('k') | src/runtime/runtime-object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698