Chromium Code Reviews| Index: src/objects.cc |
| diff --git a/src/objects.cc b/src/objects.cc |
| index 0ab325b45ba9d2bbf780760c4f0dbe7f7f39bbf4..7b36eafb4593f827308c2debfdcf72af4036a9b1 100644 |
| --- a/src/objects.cc |
| +++ b/src/objects.cc |
| @@ -21,13 +21,13 @@ |
| #include "src/field-index.h" |
| #include "src/full-codegen.h" |
| #include "src/heap/mark-compact.h" |
| +#include "src/heap/objects-visiting-inl.h" |
| #include "src/hydrogen.h" |
| #include "src/isolate-inl.h" |
| #include "src/log.h" |
| #include "src/lookup.h" |
| #include "src/macro-assembler.h" |
| #include "src/objects-inl.h" |
| -#include "src/objects-visiting-inl.h" |
| #include "src/prototype.h" |
| #include "src/safepoint-table.h" |
| #include "src/string-search.h" |
| @@ -11558,6 +11558,32 @@ void JSObject::SetFastDoubleElementsCapacityAndLength(Handle<JSObject> object, |
| } |
| +void Code::CodeIterateBody(ObjectVisitor* v) { |
|
Michael Starzinger
2014/08/06 11:35:29
Would it be possible to move this into the objects
Hannes Payer (out of office)
2014/08/07 11:12:03
Unfortunately, this is not easy.
|
| + int mode_mask = RelocInfo::kCodeTargetMask | |
| + RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | |
| + RelocInfo::ModeMask(RelocInfo::CELL) | |
| + RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) | |
| + RelocInfo::ModeMask(RelocInfo::JS_RETURN) | |
| + RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) | |
| + RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); |
| + |
| + // There are two places where we iterate code bodies: here and the |
| + // templated CodeIterateBody (below). They should be kept in sync. |
| + IteratePointer(v, kRelocationInfoOffset); |
| + IteratePointer(v, kHandlerTableOffset); |
| + IteratePointer(v, kDeoptimizationDataOffset); |
| + IteratePointer(v, kTypeFeedbackInfoOffset); |
| + IterateNextCodeLink(v, kNextCodeLinkOffset); |
| + IteratePointer(v, kConstantPoolOffset); |
| + |
| + RelocIterator it(this, mode_mask); |
| + Isolate* isolate = this->GetIsolate(); |
| + for (; !it.done(); it.next()) { |
| + it.rinfo()->Visit(isolate, v); |
| + } |
| +} |
| + |
| + |
| // static |
| void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) { |
| DCHECK(capacity >= 0); |