Commit 52df1966 authored by Dan Elphick's avatar Dan Elphick Committed by Commit Bot

[explicit isolates] Pass Isolate* into Verify*Pointer methods

Also moves ObjectVerify to GlobalHandles::CopyGlobal from
V8::CopyPersistent (which was the only caller) so it can get hold of an
Isolate*.

Bug: v8:7786
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I0758bf6e431bf6e617244741ab2e1583a3566b20
Reviewed-on: https://chromium-review.googlesource.com/1140295Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54493}
parent 9eb96bb4
...@@ -1085,11 +1085,6 @@ i::Object** V8::GlobalizeReference(i::Isolate* isolate, i::Object** obj) { ...@@ -1085,11 +1085,6 @@ i::Object** V8::GlobalizeReference(i::Isolate* isolate, i::Object** obj) {
i::Object** V8::CopyPersistent(i::Object** obj) { i::Object** V8::CopyPersistent(i::Object** obj) {
i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj); i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj);
#ifdef VERIFY_HEAP
if (i::FLAG_verify_heap) {
(*obj)->ObjectVerify();
}
#endif // VERIFY_HEAP
return result.location(); return result.location();
} }
......
...@@ -626,7 +626,7 @@ void RelocInfo::Print(Isolate* isolate, std::ostream& os) { // NOLINT ...@@ -626,7 +626,7 @@ void RelocInfo::Print(Isolate* isolate, std::ostream& os) { // NOLINT
void RelocInfo::Verify(Isolate* isolate) { void RelocInfo::Verify(Isolate* isolate) {
switch (rmode_) { switch (rmode_) {
case EMBEDDED_OBJECT: case EMBEDDED_OBJECT:
Object::VerifyPointer(target_object()); Object::VerifyPointer(isolate, target_object());
break; break;
case CODE_TARGET: case CODE_TARGET:
case RELATIVE_CODE_TARGET: { case RELATIVE_CODE_TARGET: {
......
...@@ -562,7 +562,14 @@ Handle<Object> GlobalHandles::Create(Object* value) { ...@@ -562,7 +562,14 @@ Handle<Object> GlobalHandles::Create(Object* value) {
Handle<Object> GlobalHandles::CopyGlobal(Object** location) { Handle<Object> GlobalHandles::CopyGlobal(Object** location) {
DCHECK_NOT_NULL(location); DCHECK_NOT_NULL(location);
return Node::FromLocation(location)->GetGlobalHandles()->Create(*location); GlobalHandles* global_handles =
Node::FromLocation(location)->GetGlobalHandles();
#ifdef VERIFY_HEAP
if (i::FLAG_verify_heap) {
(*location)->ObjectVerify(global_handles->isolate());
}
#endif // VERIFY_HEAP
return global_handles->Create(*location);
} }
......
This diff is collapsed.
...@@ -982,12 +982,12 @@ HeapObject* MapWord::ToForwardingAddress() { ...@@ -982,12 +982,12 @@ HeapObject* MapWord::ToForwardingAddress() {
#ifdef VERIFY_HEAP #ifdef VERIFY_HEAP
void HeapObject::VerifyObjectField(int offset) { void HeapObject::VerifyObjectField(Isolate* isolate, int offset) {
VerifyPointer(READ_FIELD(this, offset)); VerifyPointer(isolate, READ_FIELD(this, offset));
} }
void HeapObject::VerifyMaybeObjectField(int offset) { void HeapObject::VerifyMaybeObjectField(Isolate* isolate, int offset) {
MaybeObject::VerifyMaybeObjectPointer(READ_WEAK_FIELD(this, offset)); MaybeObject::VerifyMaybeObjectPointer(isolate, READ_WEAK_FIELD(this, offset));
} }
void HeapObject::VerifySmiField(int offset) { void HeapObject::VerifySmiField(int offset) {
......
...@@ -1273,10 +1273,7 @@ class Object { ...@@ -1273,10 +1273,7 @@ class Object {
DECL_VERIFIER(Object) DECL_VERIFIER(Object)
#ifdef VERIFY_HEAP #ifdef VERIFY_HEAP
// Verify a pointer is a valid object pointer. // Verify a pointer is a valid object pointer.
static void VerifyPointer(Object* p); static void VerifyPointer(Isolate* isolate, Object* p);
// Special non-isolate overload for cases where we don't have an isolate.
// TODO(v8:7786): Remove this overload.
void ObjectVerify();
#endif #endif
inline void VerifyApiCallResultType(); inline void VerifyApiCallResultType();
...@@ -1627,13 +1624,13 @@ class HeapObject: public Object { ...@@ -1627,13 +1624,13 @@ class HeapObject: public Object {
DECL_PRINTER(HeapObject) DECL_PRINTER(HeapObject)
DECL_VERIFIER(HeapObject) DECL_VERIFIER(HeapObject)
#ifdef VERIFY_HEAP #ifdef VERIFY_HEAP
inline void VerifyObjectField(int offset); inline void VerifyObjectField(Isolate* isolate, int offset);
inline void VerifySmiField(int offset); inline void VerifySmiField(int offset);
inline void VerifyMaybeObjectField(int offset); inline void VerifyMaybeObjectField(Isolate* isolate, int offset);
// Verify a pointer is a valid HeapObject pointer that points to object // Verify a pointer is a valid HeapObject pointer that points to object
// areas in the heap. // areas in the heap.
static void VerifyHeapPointer(Object* p); static void VerifyHeapPointer(Isolate* isolate, Object* p);
#endif #endif
static inline AllocationAlignment RequiredAlignment(Map* map); static inline AllocationAlignment RequiredAlignment(Map* map);
......
...@@ -59,7 +59,7 @@ class MaybeObject { ...@@ -59,7 +59,7 @@ class MaybeObject {
static inline MaybeObject* MakeWeak(MaybeObject* object); static inline MaybeObject* MakeWeak(MaybeObject* object);
#ifdef VERIFY_HEAP #ifdef VERIFY_HEAP
static void VerifyMaybeObjectPointer(MaybeObject* p); static void VerifyMaybeObjectPointer(Isolate* isolate, MaybeObject* p);
#endif #endif
// Prints this object without details. // Prints this object without details.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment