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

Side by Side Diff: src/heap/scavenger.cc

Issue 2950993002: Make some functions that are hit during renderer startup available for inlining (Closed)
Patch Set: rebase Created 3 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/heap/scavenger.h ('k') | src/heap/scavenger-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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/heap/scavenger.h" 5 #include "src/heap/scavenger.h"
6 6
7 #include "src/contexts.h" 7 #include "src/contexts.h"
8 #include "src/heap/heap-inl.h" 8 #include "src/heap/heap-inl.h"
9 #include "src/heap/incremental-marking.h" 9 #include "src/heap/incremental-marking.h"
10 #include "src/heap/objects-visiting-inl.h" 10 #include "src/heap/objects-visiting-inl.h"
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 void Scavenger::Initialize() { 397 void Scavenger::Initialize() {
398 ScavengingVisitor<TRANSFER_MARKS, 398 ScavengingVisitor<TRANSFER_MARKS,
399 LOGGING_AND_PROFILING_DISABLED>::Initialize(); 399 LOGGING_AND_PROFILING_DISABLED>::Initialize();
400 ScavengingVisitor<IGNORE_MARKS, LOGGING_AND_PROFILING_DISABLED>::Initialize(); 400 ScavengingVisitor<IGNORE_MARKS, LOGGING_AND_PROFILING_DISABLED>::Initialize();
401 ScavengingVisitor<TRANSFER_MARKS, 401 ScavengingVisitor<TRANSFER_MARKS,
402 LOGGING_AND_PROFILING_ENABLED>::Initialize(); 402 LOGGING_AND_PROFILING_ENABLED>::Initialize();
403 ScavengingVisitor<IGNORE_MARKS, LOGGING_AND_PROFILING_ENABLED>::Initialize(); 403 ScavengingVisitor<IGNORE_MARKS, LOGGING_AND_PROFILING_ENABLED>::Initialize();
404 } 404 }
405 405
406 406
407 // static
408 void Scavenger::ScavengeObjectSlow(HeapObject** p, HeapObject* object) {
409 SLOW_DCHECK(object->GetIsolate()->heap()->InFromSpace(object));
410 MapWord first_word = object->map_word();
411 SLOW_DCHECK(!first_word.IsForwardingAddress());
412 Map* map = first_word.ToMap();
413 Scavenger* scavenger = map->GetHeap()->scavenge_collector_;
414 scavenger->scavenging_visitors_table_.GetVisitor(map)(map, p, object);
415 }
416
417
418 void Scavenger::SelectScavengingVisitorsTable() { 407 void Scavenger::SelectScavengingVisitorsTable() {
419 bool logging_and_profiling = 408 bool logging_and_profiling =
420 FLAG_verify_predictable || isolate()->logger()->is_logging() || 409 FLAG_verify_predictable || isolate()->logger()->is_logging() ||
421 isolate()->is_profiling() || 410 isolate()->is_profiling() ||
422 (isolate()->heap_profiler() != NULL && 411 (isolate()->heap_profiler() != NULL &&
423 isolate()->heap_profiler()->is_tracking_object_moves()); 412 isolate()->heap_profiler()->is_tracking_object_moves());
424 413
425 if (!heap()->incremental_marking()->IsMarking()) { 414 if (!heap()->incremental_marking()->IsMarking()) {
426 if (!logging_and_profiling) { 415 if (!logging_and_profiling) {
427 scavenging_visitors_table_.CopyFrom( 416 scavenging_visitors_table_.CopyFrom(
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 void RootScavengeVisitor::ScavengePointer(Object** p) { 464 void RootScavengeVisitor::ScavengePointer(Object** p) {
476 Object* object = *p; 465 Object* object = *p;
477 if (!heap_->InNewSpace(object)) return; 466 if (!heap_->InNewSpace(object)) return;
478 467
479 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), 468 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p),
480 reinterpret_cast<HeapObject*>(object)); 469 reinterpret_cast<HeapObject*>(object));
481 } 470 }
482 471
483 } // namespace internal 472 } // namespace internal
484 } // namespace v8 473 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/scavenger.h ('k') | src/heap/scavenger-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698