Reviewers: mvstanton,
Description:
Move allocation site pretenuring decision making to GC epilog.
BUG=
Please review this at https://codereview.chromium.org/149913005/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+6, -21 lines):
M src/heap.cc
M src/mark-compact.cc
M src/objects.cc
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index
e0b312067fc5c38013c36d76da9f69beae64c4a4..19caf509ebe31a77a17d96785701b5d0a103c9b1
100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -574,6 +574,9 @@ void Heap::GarbageCollectionEpilogue() {
ZapFromSpace();
}
+ // Process pretenuring feedback and update allocation sites.
+ ProcessPretenuringFeedback();
+
#ifdef VERIFY_HEAP
if (FLAG_verify_heap) {
Verify();
@@ -1617,8 +1620,6 @@ void Heap::Scavenge() {
IncrementYoungSurvivorsCounter(static_cast<int>(
(PromotedSpaceSizeOfObjects() - survived_watermark) +
new_space_.Size()));
- ProcessPretenuringFeedback();
-
LOG(isolate_, ResourceEvent("scavenge", "end"));
gc_state_ = NOT_IN_GC;
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index
81de035b0af7a6ae67de51f738b30ecbdbcb2da5..ef1e755d8c3f9a0004420152ec4ce7415444b62b
100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -3385,13 +3385,6 @@ void
MarkCompactCollector::EvacuateNewSpaceAndCandidates() {
EvacuateNewSpace();
}
- // We have to travers our allocation sites scratchpad which contains raw
- // pointers before we move objects. During new space evacauation we
- // gathered pretenuring statistics. The found allocation sites may not be
- // valid after compacting old space.
- heap()->ProcessPretenuringFeedback();
-
-
{ GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_EVACUATE_PAGES);
EvacuatePages();
}
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index
48d77db4580cb9462380d045ac6fa2e63fbfc868..62c0cfb7003b1325b7fd146f08baac4fd73bb106
100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -11764,23 +11764,14 @@ bool DependentCode::MarkCodeForDeoptimization(
// Mark all the code that needs to be deoptimized.
bool marked = false;
for (int i = start; i < end; i++) {
- Object* object = object_at(i);
- // TODO(hpayer): This is a temporary hack. Foreign objects move after
- // new space evacuation. Since pretenuring may mark these objects as
aborted
- // we have to follow the forwarding pointer in that case.
- MapWord map_word = HeapObject::cast(object)->map_word();
- if (map_word.IsForwardingAddress()) {
- object = map_word.ToForwardingAddress();
- }
- if (object->IsCode()) {
- Code* code = Code::cast(object);
+ if (is_code_at(i)) {
+ Code* code = code_at(i);
if (!code->marked_for_deoptimization()) {
code->set_marked_for_deoptimization(true);
marked = true;
}
} else {
- CompilationInfo* info = reinterpret_cast<CompilationInfo*>(
- Foreign::cast(object)->foreign_address());
+ CompilationInfo* info = compilation_info_at(i);
info->AbortDueToDependencyChange();
}
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.