Skip to content

Commit

Permalink
deps: backport 78867ad8707a016 from v8 upstream
Browse files Browse the repository at this point in the history
Original commit message:

    Remove object grouping

    Enbedders should switch to EmbedderHeapTracer API.

    BUG=v8:5828

    Change-Id: I82f2bc583d246617865a17f5904e02cd35f92fec
    Reviewed-on: https://chromium-review.googlesource.com/448539
    Reviewed-by: Hannes Payer <hpayer@chromium.org>
    Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
    Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#43551}

Ref: https://chromium-review.googlesource.com/448539
Ref: v8/v8@78867ad8707a016

PR-URL: #12875
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
mlippautz authored and jasnell committed May 28, 2017
1 parent f06f836 commit 95c4b0d
Show file tree
Hide file tree
Showing 16 changed files with 5 additions and 1,139 deletions.
5 changes: 0 additions & 5 deletions deps/v8/include/v8-profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -812,11 +812,6 @@ class V8_EXPORT HeapProfiler {
/** Returns memory used for profiler internal data and snapshots. */
size_t GetProfilerMemorySize();

/**
* Sets a RetainedObjectInfo for an object group (see V8::SetObjectGroupId).
*/
void SetRetainedObjectInfo(UniqueId id, RetainedObjectInfo* info);

private:
HeapProfiler();
~HeapProfiler();
Expand Down
69 changes: 0 additions & 69 deletions deps/v8/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -6824,45 +6824,6 @@ class V8_EXPORT Isolate {
*/
Local<Value> ThrowException(Local<Value> exception);

/**
* Allows the host application to group objects together. If one
* object in the group is alive, all objects in the group are alive.
* After each garbage collection, object groups are removed. It is
* intended to be used in the before-garbage-collection callback
* function, for instance to simulate DOM tree connections among JS
* wrapper objects. Object groups for all dependent handles need to
* be provided for kGCTypeMarkSweepCompact collections, for all other
* garbage collection types it is sufficient to provide object groups
* for partially dependent handles only.
*/
template <typename T>
V8_DEPRECATED("Use EmbedderHeapTracer",
void SetObjectGroupId(const Persistent<T>& object,
UniqueId id));

/**
* Allows the host application to declare implicit references from an object
* group to an object. If the objects of the object group are alive, the child
* object is alive too. After each garbage collection, all implicit references
* are removed. It is intended to be used in the before-garbage-collection
* callback function.
*/
template <typename T>
V8_DEPRECATED("Use EmbedderHeapTracer",
void SetReferenceFromGroup(UniqueId id,
const Persistent<T>& child));

/**
* Allows the host application to declare implicit references from an object
* to another object. If the parent object is alive, the child object is alive
* too. After each garbage collection, all implicit references are removed. It
* is intended to be used in the before-garbage-collection callback function.
*/
template <typename T, typename S>
V8_DEPRECATED("Use EmbedderHeapTracer",
void SetReference(const Persistent<T>& parent,
const Persistent<S>& child));

typedef void (*GCCallback)(Isolate* isolate, GCType type,
GCCallbackFlags flags);

Expand Down Expand Up @@ -7328,9 +7289,6 @@ class V8_EXPORT Isolate {
template <class K, class V, class Traits>
friend class PersistentValueMapBase;

void SetObjectGroupId(internal::Object** object, UniqueId id);
void SetReferenceFromGroup(UniqueId id, internal::Object** object);
void SetReference(internal::Object** parent, internal::Object** child);
void ReportExternalAllocationLimitReached();
};

Expand Down Expand Up @@ -9745,33 +9703,6 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory(
return *external_memory;
}


template<typename T>
void Isolate::SetObjectGroupId(const Persistent<T>& object,
UniqueId id) {
TYPE_CHECK(Value, T);
SetObjectGroupId(reinterpret_cast<internal::Object**>(object.val_), id);
}


template<typename T>
void Isolate::SetReferenceFromGroup(UniqueId id,
const Persistent<T>& object) {
TYPE_CHECK(Value, T);
SetReferenceFromGroup(id, reinterpret_cast<internal::Object**>(object.val_));
}


template<typename T, typename S>
void Isolate::SetReference(const Persistent<T>& parent,
const Persistent<S>& child) {
TYPE_CHECK(Object, T);
TYPE_CHECK(Value, S);
SetReference(reinterpret_cast<internal::Object**>(parent.val_),
reinterpret_cast<internal::Object**>(child.val_));
}


Local<Value> Context::GetEmbedderData(int index) {
#ifndef V8_ENABLE_CHECKS
typedef internal::Object O;
Expand Down
32 changes: 0 additions & 32 deletions deps/v8/src/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8059,31 +8059,6 @@ v8::Local<Value> Isolate::ThrowException(v8::Local<v8::Value> value) {
return v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate));
}


void Isolate::SetObjectGroupId(internal::Object** object, UniqueId id) {
i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(this);
internal_isolate->global_handles()->SetObjectGroupId(
i::Handle<i::Object>(object).location(), id);
}


void Isolate::SetReferenceFromGroup(UniqueId id, internal::Object** object) {
i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(this);
internal_isolate->global_handles()->SetReferenceFromGroup(
id, i::Handle<i::Object>(object).location());
}


void Isolate::SetReference(internal::Object** parent,
internal::Object** child) {
i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(this);
i::Object** parent_location = i::Handle<i::Object>(parent).location();
internal_isolate->global_handles()->SetReference(
reinterpret_cast<i::HeapObject**>(parent_location),
i::Handle<i::Object>(child).location());
}


void Isolate::AddGCPrologueCallback(GCCallback callback, GCType gc_type) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
isolate->heap()->AddGCPrologueCallback(callback, gc_type);
Expand Down Expand Up @@ -10028,13 +10003,6 @@ size_t HeapProfiler::GetProfilerMemorySize() {
GetMemorySizeUsedByProfiler();
}


void HeapProfiler::SetRetainedObjectInfo(UniqueId id,
RetainedObjectInfo* info) {
reinterpret_cast<i::HeapProfiler*>(this)->SetRetainedObjectInfo(id, info);
}


v8::Testing::StressType internal::Testing::stress_type_ =
v8::Testing::kStressTypeOpt;

Expand Down
Loading

0 comments on commit 95c4b0d

Please sign in to comment.