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

Unified Diff: src/heap/heap.cc

Issue 1690923002: [runtime] Speed up allocating instances in the runtime by having a quick-check for inobject slack t… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 713cda82f57b786da7ac63195b81969cd715cbc9..00ef8680d53c8ac6e5e99e5df2d665a7b9599872 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -3446,7 +3446,6 @@ void Heap::InitializeJSObjectBody(JSObject* obj, Map* map, int start_offset) {
if (start_offset == map->instance_size()) return;
DCHECK_LT(start_offset, map->instance_size());
- Object* filler;
// We cannot always fill with one_pointer_filler_map because objects
// created from API functions expect their internal fields to be initialized
// with undefined_value.
@@ -3456,15 +3455,17 @@ void Heap::InitializeJSObjectBody(JSObject* obj, Map* map, int start_offset) {
// In case of Array subclassing the |map| could already be transitioned
// to different elements kind from the initial map on which we track slack.
- Map* initial_map = map->FindRootMap();
- if (initial_map->IsInobjectSlackTrackingInProgress()) {
- // We might want to shrink the object later.
- filler = Heap::one_pointer_filler_map();
+ bool in_progress = map->IsInobjectSlackTrackingInProgress();
+ Object* filler;
+ if (in_progress) {
+ filler = one_pointer_filler_map();
} else {
- filler = Heap::undefined_value();
+ filler = undefined_value();
}
obj->InitializeBody(map, start_offset, Heap::undefined_value(), filler);
- initial_map->InobjectSlackTrackingStep();
+ if (in_progress) {
+ map->FindRootMap()->InobjectSlackTrackingStep();
+ }
}
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698