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

Unified Diff: src/heap/spaces.cc

Issue 1850443006: [Interpreter] Handles BytecodeArrays when scanning objects in heap. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Adds mjsunit test to check verifyheap handles BytecodeArrays Created 4 years, 9 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 | test/mjsunit/ignition/regress-599001-verifyheap.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.cc
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
index 3eedc1eeedbfb6567e2a6066e41469bdeded6812..6d30f31c7ca2c09196716cd64ef1b5183035fcc1 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -1646,7 +1646,7 @@ void NewSpace::Verify() {
// The object should not be code or a map.
CHECK(!object->IsMap());
- CHECK(!object->IsCode());
+ CHECK(!object->IsAbstractCode());
// The object itself should look OK.
object->ObjectVerify();
@@ -2780,9 +2780,14 @@ void PagedSpace::CollectCodeStatistics() {
Isolate* isolate = heap()->isolate();
HeapObjectIterator obj_it(this);
for (HeapObject* obj = obj_it.Next(); obj != NULL; obj = obj_it.Next()) {
+ if (obj->IsAbstractCode()) {
+ AbstractCode* code = AbstractCode::cast(obj);
+ isolate->code_kind_statistics()[code->kind()] += code->Size();
+ }
if (obj->IsCode()) {
+ // TODO(mythria): Also enable this for BytecodeArray when it supports
+ // RelocInformation.
Code* code = Code::cast(obj);
- isolate->code_kind_statistics()[code->kind()] += code->Size();
RelocIterator it(code);
int delta = 0;
const byte* prev_pc = code->instruction_start();
@@ -3073,7 +3078,7 @@ void LargeObjectSpace::Verify() {
// (sequential strings that have been morphed into external
// strings), fixed arrays, byte arrays, and constant pool arrays in the
// large object space.
- CHECK(object->IsCode() || object->IsSeqString() ||
+ CHECK(object->IsAbstractCode() || object->IsSeqString() ||
object->IsExternalString() || object->IsFixedArray() ||
object->IsFixedDoubleArray() || object->IsByteArray());
@@ -3081,7 +3086,7 @@ void LargeObjectSpace::Verify() {
object->ObjectVerify();
// Byte arrays and strings don't have interior pointers.
- if (object->IsCode()) {
+ if (object->IsAbstractCode()) {
VerifyPointersVisitor code_visitor;
object->IterateBody(map->instance_type(), object->Size(), &code_visitor);
} else if (object->IsFixedArray()) {
@@ -3132,8 +3137,8 @@ void LargeObjectSpace::CollectCodeStatistics() {
Isolate* isolate = heap()->isolate();
LargeObjectIterator obj_it(this);
for (HeapObject* obj = obj_it.Next(); obj != NULL; obj = obj_it.Next()) {
- if (obj->IsCode()) {
- Code* code = Code::cast(obj);
+ if (obj->IsAbstractCode()) {
+ AbstractCode* code = AbstractCode::cast(obj);
isolate->code_kind_statistics()[code->kind()] += code->Size();
}
}
« no previous file with comments | « no previous file | test/mjsunit/ignition/regress-599001-verifyheap.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698