Reviewers: titzer, Michael Starzinger,
Description:
Retire ShortCircuitConsString.
BUG=
Please review this at https://codereview.chromium.org/1267313002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+2, -37 lines):
M src/heap/mark-compact.cc
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index
3cc08f4cdad6d3d1abfe5ea7483b64b07f2eeaa7..2b8d0a935cb12190c1167741455d50923a4e7017
100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -1201,41 +1201,6 @@ MarkCompactCollector::~MarkCompactCollector() {
}
-static inline HeapObject* ShortCircuitConsString(Object** p) {
- // Optimization: If the heap object pointed to by p is a non-internalized
- // cons string whose right substring is HEAP->empty_string, update
- // it in place to its left substring. Return the updated value.
- //
- // Here we assume that if we change *p, we replace it with a heap object
- // (i.e., the left substring of a cons string is always a heap object).
- //
- // The check performed is:
- // object->IsConsString() && !object->IsInternalizedString() &&
- // (ConsString::cast(object)->second() == HEAP->empty_string())
- // except the maps for the object and its possible substrings might be
- // marked.
- HeapObject* object = HeapObject::cast(*p);
- Map* map = object->map();
- InstanceType type = map->instance_type();
- if (!IsShortcutCandidate(type)) return object;
-
- Object* second = reinterpret_cast<ConsString*>(object)->second();
- Heap* heap = map->GetHeap();
- if (second != heap->empty_string()) {
- return object;
- }
-
- // Since we don't have the object's start, it is impossible to update the
- // page dirty marks. Therefore, we only replace the string with its left
- // substring when page dirty marks do not change.
- Object* first = reinterpret_cast<ConsString*>(object)->first();
- if (!heap->InNewSpace(object) && heap->InNewSpace(first)) return object;
-
- *p = first;
- return HeapObject::cast(first);
-}
-
-
class MarkCompactMarkingVisitor
: public StaticMarkingVisitor<MarkCompactMarkingVisitor> {
public:
@@ -1292,7 +1257,7 @@ class MarkCompactMarkingVisitor
INLINE(static void MarkObjectByPointer(MarkCompactCollector* collector,
Object** anchor_slot, Object**
p)) {
if (!(*p)->IsHeapObject()) return;
- HeapObject* object = ShortCircuitConsString(p);
+ HeapObject* object = HeapObject::cast(*p);
collector->RecordSlot(anchor_slot, p, object);
MarkBit mark = Marking::MarkBitFrom(object);
collector->MarkObject(object, mark);
@@ -1670,7 +1635,7 @@ class RootMarkingVisitor : public ObjectVisitor {
if (!(*p)->IsHeapObject()) return;
// Replace flat cons strings in place.
- HeapObject* object = ShortCircuitConsString(p);
+ HeapObject* object = HeapObject::cast(*p);
MarkBit mark_bit = Marking::MarkBitFrom(object);
if (Marking::IsBlackOrGrey(mark_bit)) return;
--
--
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/d/optout.