Commit a3e62593 authored by Nico Hartmann's avatar Nico Hartmann Committed by V8 LUCI CQ

Revert "[test] Migrate cctest/test-global-handles to unittests/"

This reverts commit 3615ae69.

Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20TSAN%20-%20stress-incremental-marking/8836/overview

Original change's description:
> [test] Migrate cctest/test-global-handles to unittests/
>
> Bug: v8:12781
> Change-Id: If7681564f3e0c087e3347557a3f9169625b51607
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3817621
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82633}

Bug: v8:12781
Change-Id: Ia0e714028e1554b46421d455d86759b61883fd8f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3845712
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Nico Hartmann <nicohartmann@chromium.org>
Owners-Override: Nico Hartmann <nicohartmann@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#82638}
parent c246574a
...@@ -182,6 +182,7 @@ v8_source_set("cctest_sources") { ...@@ -182,6 +182,7 @@ v8_source_set("cctest_sources") {
"test-disasm-regex-helper.h", "test-disasm-regex-helper.h",
"test-field-type-tracking.cc", "test-field-type-tracking.cc",
"test-func-name-inference.cc", "test-func-name-inference.cc",
"test-global-handles.cc",
"test-heap-profiler.cc", "test-heap-profiler.cc",
"test-icache.cc", "test-icache.cc",
"test-ignition-statistics-extension.cc", "test-ignition-statistics-extension.cc",
......
...@@ -522,6 +522,7 @@ ...@@ -522,6 +522,7 @@
'test-bignum-dtoa/*': [SKIP], 'test-bignum-dtoa/*': [SKIP],
'test-cpu-profiler/*': [SKIP], 'test-cpu-profiler/*': [SKIP],
'test-debug/*': [SKIP], 'test-debug/*': [SKIP],
'test-global-handles/*': [SKIP],
'test-heap-profiler/*': [SKIP], 'test-heap-profiler/*': [SKIP],
'test-heap/*': [SKIP], 'test-heap/*': [SKIP],
'test-inobject-slack-tracking/*': [SKIP], 'test-inobject-slack-tracking/*': [SKIP],
...@@ -976,6 +977,13 @@ ...@@ -976,6 +977,13 @@
'test-embedder-tracing/V8RegisteringEmbedderReference': [SKIP], 'test-embedder-tracing/V8RegisteringEmbedderReference': [SKIP],
'test-external-string-tracker/ExternalString_ExternalBackingStoreSizeIncreasesAfterExternalization': [SKIP], 'test-external-string-tracker/ExternalString_ExternalBackingStoreSizeIncreasesAfterExternalization': [SKIP],
'test-external-string-tracker/ExternalString_ExternalBackingStoreSizeIncreasesMarkCompact': [SKIP], 'test-external-string-tracker/ExternalString_ExternalBackingStoreSizeIncreasesMarkCompact': [SKIP],
'test-global-handles/FinalizerDiesAndKeepsPhantomAliveOnMarkCompact': [SKIP],
'test-global-handles/FinalizerWeakness': [SKIP],
'test-global-handles/GCFromWeakCallbacks': [SKIP],
'test-global-handles/PhantomHandlesWithoutCallbacks': [SKIP],
'test-global-handles/SecondPassPhantomCallbacks': [SKIP],
'test-global-handles/WeakHandleToUnmodifiedJSApiObjectDiesOnMarkCompact': [SKIP],
'test-global-handles/WeakHandleToUnmodifiedJSObjectDiesOnMarkCompact': [SKIP],
'test-heap-profiler/HeapSnapshotDeleteDuringTakeSnapshot': [SKIP], 'test-heap-profiler/HeapSnapshotDeleteDuringTakeSnapshot': [SKIP],
'test-heap-profiler/HeapSnapshotObjectsStats': [SKIP], 'test-heap-profiler/HeapSnapshotObjectsStats': [SKIP],
'test-heap-profiler/SamplingHeapProfilerPretenuredInlineAllocations': [SKIP], 'test-heap-profiler/SamplingHeapProfilerPretenuredInlineAllocations': [SKIP],
......
...@@ -25,17 +25,16 @@ ...@@ -25,17 +25,16 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "src/handles/global-handles.h"
#include "include/v8-function.h" #include "include/v8-function.h"
#include "include/v8-locker.h"
#include "src/api/api-inl.h" #include "src/api/api-inl.h"
#include "src/execution/isolate.h" #include "src/execution/isolate.h"
#include "src/handles/global-handles.h"
#include "src/heap/factory.h" #include "src/heap/factory.h"
#include "src/heap/heap-inl.h" #include "src/heap/heap-inl.h"
#include "src/objects/objects-inl.h" #include "src/objects/objects-inl.h"
#include "test/unittests/heap/heap-utils.h" #include "test/cctest/cctest.h"
#include "test/unittests/test-utils.h" #include "test/cctest/heap/heap-utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace v8 { namespace v8 {
namespace internal { namespace internal {
...@@ -82,9 +81,12 @@ class NonRootingEmbedderHeapTracer final : public v8::EmbedderHeapTracer { ...@@ -82,9 +81,12 @@ class NonRootingEmbedderHeapTracer final : public v8::EmbedderHeapTracer {
std::vector<TracedReferenceWrapper*> wrappers_; std::vector<TracedReferenceWrapper*> wrappers_;
}; };
void InvokeScavenge() { CcTest::CollectGarbage(i::NEW_SPACE); }
void InvokeMarkSweep() { CcTest::CollectAllGarbage(); }
void SimpleCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { void SimpleCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate(); info.GetReturnValue().Set(v8_num(0));
info.GetReturnValue().Set(v8::Number::New(isolate, 0));
} }
struct FlagAndGlobal { struct FlagAndGlobal {
...@@ -152,7 +154,7 @@ void WeakHandleTest(v8::Isolate* isolate, ConstructFunction construct_function, ...@@ -152,7 +154,7 @@ void WeakHandleTest(v8::Isolate* isolate, ConstructFunction construct_function,
FlagAndGlobal fp; FlagAndGlobal fp;
construct_function(isolate, context, &fp); construct_function(isolate, context, &fp);
CHECK(IsNewObjectInCorrectGeneration(isolate, fp.handle)); CHECK(heap::InCorrectGeneration(isolate, fp.handle));
fp.handle.SetWeak(&fp, &ResetHandleAndSetFlag, fp.handle.SetWeak(&fp, &ResetHandleAndSetFlag,
v8::WeakCallbackType::kParameter); v8::WeakCallbackType::kParameter);
fp.flag = false; fp.flag = false;
...@@ -162,44 +164,42 @@ void WeakHandleTest(v8::Isolate* isolate, ConstructFunction construct_function, ...@@ -162,44 +164,42 @@ void WeakHandleTest(v8::Isolate* isolate, ConstructFunction construct_function,
CHECK_IMPLIES(survives == SurvivalMode::kDies, fp.flag); CHECK_IMPLIES(survives == SurvivalMode::kDies, fp.flag);
} }
void EmptyWeakCallback(const v8::WeakCallbackInfo<void>& data) {} template <typename ConstructFunction, typename ModifierFunction>
void TracedReferenceTestWithScavenge(v8::Isolate* isolate,
ConstructFunction construct_function,
ModifierFunction modifier_function,
SurvivalMode survives) {
v8::HandleScope scope(isolate);
v8::Local<v8::Context> context = v8::Context::New(isolate);
v8::Context::Scope context_scope(context);
class GlobalHandlesTest : public TestWithContext { NonRootingEmbedderHeapTracer tracer;
protected: heap::TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
template <typename ConstructFunction, typename ModifierFunction>
void TracedReferenceTestWithScavenge(ConstructFunction construct_function, auto fp = std::make_unique<TracedReferenceWrapper>();
ModifierFunction modifier_function, tracer.Register(fp.get());
SurvivalMode survives) { construct_function(isolate, context, fp.get());
v8::Isolate* isolate = v8_isolate(); CHECK(heap::InCorrectGeneration(isolate, fp->handle));
v8::HandleScope scope(isolate); modifier_function(fp.get());
v8::Local<v8::Context> context = v8::Context::New(isolate); InvokeScavenge();
v8::Context::Scope context_scope(context); // Scavenge clear properly resets the original handle, so we can check the
// handle directly here.
NonRootingEmbedderHeapTracer tracer; CHECK_IMPLIES(survives == SurvivalMode::kSurvives, !fp->handle.IsEmpty());
TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer); CHECK_IMPLIES(survives == SurvivalMode::kDies, fp->handle.IsEmpty());
}
auto fp = std::make_unique<TracedReferenceWrapper>();
tracer.Register(fp.get()); void EmptyWeakCallback(const v8::WeakCallbackInfo<void>& data) {}
construct_function(isolate, context, fp.get());
CHECK(IsNewObjectInCorrectGeneration(isolate, fp->handle));
modifier_function(fp.get());
CollectGarbage(i::NEW_SPACE);
// Scavenge clear properly resets the original handle, so we can check the
// handle directly here.
CHECK_IMPLIES(survives == SurvivalMode::kSurvives, !fp->handle.IsEmpty());
CHECK_IMPLIES(survives == SurvivalMode::kDies, fp->handle.IsEmpty());
}
};
} // namespace } // namespace
TEST_F(GlobalHandlesTest, EternalHandles) { TEST(EternalHandles) {
Isolate* isolate = i_isolate(); CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate); v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate);
EternalHandles* eternal_handles = isolate->eternal_handles(); EternalHandles* eternal_handles = isolate->eternal_handles();
// Create a number of handles that will not be on a block boundary // Create a number of handles that will not be on a block boundary
const int kArrayLength = 2048 - 1; const int kArrayLength = 2048-1;
int indices[kArrayLength]; int indices[kArrayLength];
v8::Eternal<v8::Value> eternals[kArrayLength]; v8::Eternal<v8::Value> eternals[kArrayLength];
...@@ -208,20 +208,19 @@ TEST_F(GlobalHandlesTest, EternalHandles) { ...@@ -208,20 +208,19 @@ TEST_F(GlobalHandlesTest, EternalHandles) {
indices[i] = -1; indices[i] = -1;
HandleScope scope(isolate); HandleScope scope(isolate);
v8::Local<v8::Object> object = v8::Object::New(v8_isolate); v8::Local<v8::Object> object = v8::Object::New(v8_isolate);
object object->Set(v8_isolate->GetCurrentContext(), i,
->Set(v8_isolate->GetCurrentContext(), i, v8::Integer::New(v8_isolate, i))
v8::Integer::New(v8_isolate, i))
.FromJust(); .FromJust();
// Create with internal api // Create with internal api
eternal_handles->Create(isolate, *v8::Utils::OpenHandle(*object), eternal_handles->Create(
&indices[i]); isolate, *v8::Utils::OpenHandle(*object), &indices[i]);
// Create with external api // Create with external api
CHECK(eternals[i].IsEmpty()); CHECK(eternals[i].IsEmpty());
eternals[i].Set(v8_isolate, object); eternals[i].Set(v8_isolate, object);
CHECK(!eternals[i].IsEmpty()); CHECK(!eternals[i].IsEmpty());
} }
CollectAllAvailableGarbage(); CcTest::CollectAllAvailableGarbage();
for (int i = 0; i < kArrayLength; i++) { for (int i = 0; i < kArrayLength; i++) {
for (int j = 0; j < 2; j++) { for (int j = 0; j < 2; j++) {
...@@ -257,8 +256,10 @@ TEST_F(GlobalHandlesTest, EternalHandles) { ...@@ -257,8 +256,10 @@ TEST_F(GlobalHandlesTest, EternalHandles) {
CHECK_EQ(2 * kArrayLength + 1, eternal_handles->handles_count()); CHECK_EQ(2 * kArrayLength + 1, eternal_handles->handles_count());
} }
TEST_F(GlobalHandlesTest, PersistentBaseGetLocal) {
v8::Isolate* isolate = v8_isolate(); TEST(PersistentBaseGetLocal) {
CcTest::InitializeVM();
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope scope(isolate); v8::HandleScope scope(isolate);
v8::Local<v8::Object> o = v8::Object::New(isolate); v8::Local<v8::Object> o = v8::Object::New(isolate);
...@@ -272,8 +273,9 @@ TEST_F(GlobalHandlesTest, PersistentBaseGetLocal) { ...@@ -272,8 +273,9 @@ TEST_F(GlobalHandlesTest, PersistentBaseGetLocal) {
CHECK(v8::Local<v8::Object>::New(isolate, g) == g.Get(isolate)); CHECK(v8::Local<v8::Object>::New(isolate, g) == g.Get(isolate));
} }
TEST_F(GlobalHandlesTest, WeakPersistentSmi) { TEST(WeakPersistentSmi) {
v8::Isolate* isolate = v8_isolate(); CcTest::InitializeVM();
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope scope(isolate); v8::HandleScope scope(isolate);
v8::Local<v8::Number> n = v8::Number::New(isolate, 0); v8::Local<v8::Number> n = v8::Number::New(isolate, 0);
...@@ -286,8 +288,9 @@ TEST_F(GlobalHandlesTest, WeakPersistentSmi) { ...@@ -286,8 +288,9 @@ TEST_F(GlobalHandlesTest, WeakPersistentSmi) {
START_ALLOW_USE_DEPRECATED() START_ALLOW_USE_DEPRECATED()
TEST_F(GlobalHandlesTest, PhantomHandlesWithoutCallbacks) { TEST(PhantomHandlesWithoutCallbacks) {
v8::Isolate* isolate = v8_isolate(); CcTest::InitializeVM();
v8::Isolate* isolate = CcTest::isolate();
v8::Global<v8::Object> g1, g2; v8::Global<v8::Object> g1, g2;
{ {
...@@ -299,127 +302,129 @@ TEST_F(GlobalHandlesTest, PhantomHandlesWithoutCallbacks) { ...@@ -299,127 +302,129 @@ TEST_F(GlobalHandlesTest, PhantomHandlesWithoutCallbacks) {
} }
CHECK(!g1.IsEmpty()); CHECK(!g1.IsEmpty());
CHECK(!g2.IsEmpty()); CHECK(!g2.IsEmpty());
CollectAllAvailableGarbage(); CcTest::CollectAllAvailableGarbage();
CHECK(g1.IsEmpty()); CHECK(g1.IsEmpty());
CHECK(g2.IsEmpty()); CHECK(g2.IsEmpty());
} }
END_ALLOW_USE_DEPRECATED() END_ALLOW_USE_DEPRECATED()
TEST_F(GlobalHandlesTest, WeakHandleToUnmodifiedJSObjectDiesOnScavenge) { TEST(WeakHandleToUnmodifiedJSObjectDiesOnScavenge) {
if (FLAG_single_generation) return; if (FLAG_single_generation) return;
CcTest::InitializeVM();
WeakHandleTest( WeakHandleTest(
v8_isolate(), &ConstructJSObject<FlagAndGlobal>, [](FlagAndGlobal* fp) {}, CcTest::isolate(), &ConstructJSObject<FlagAndGlobal>,
[this]() { CollectGarbage(i::NEW_SPACE); }, SurvivalMode::kDies); [](FlagAndGlobal* fp) {}, []() { InvokeScavenge(); },
SurvivalMode::kDies);
} }
TEST_F(GlobalHandlesTest, TracedReferenceToUnmodifiedJSObjectSurvivesScavenge) { TEST(TracedReferenceToUnmodifiedJSObjectSurvivesScavenge) {
if (FLAG_single_generation) return; if (FLAG_single_generation) return;
ManualGCScope manual_gc;
ManualGCScope manual_gc(i_isolate()); CcTest::InitializeVM();
TracedReferenceTestWithScavenge( TracedReferenceTestWithScavenge(
&ConstructJSObject<TracedReferenceWrapper>, CcTest::isolate(), &ConstructJSObject<TracedReferenceWrapper>,
[](TracedReferenceWrapper* fp) {}, SurvivalMode::kSurvives); [](TracedReferenceWrapper* fp) {}, SurvivalMode::kSurvives);
} }
TEST_F(GlobalHandlesTest, WeakHandleToUnmodifiedJSObjectDiesOnMarkCompact) { TEST(WeakHandleToUnmodifiedJSObjectDiesOnMarkCompact) {
CcTest::InitializeVM();
WeakHandleTest( WeakHandleTest(
v8_isolate(), &ConstructJSObject<FlagAndGlobal>, [](FlagAndGlobal* fp) {}, CcTest::isolate(), &ConstructJSObject<FlagAndGlobal>,
[this]() { CollectAllGarbage(); }, SurvivalMode::kDies); [](FlagAndGlobal* fp) {}, []() { InvokeMarkSweep(); },
SurvivalMode::kDies);
} }
TEST_F(GlobalHandlesTest, TEST(WeakHandleToUnmodifiedJSObjectSurvivesMarkCompactWhenInHandle) {
WeakHandleToUnmodifiedJSObjectSurvivesMarkCompactWhenInHandle) { CcTest::InitializeVM();
WeakHandleTest( WeakHandleTest(
v8_isolate(), &ConstructJSObject<FlagAndGlobal>, CcTest::isolate(), &ConstructJSObject<FlagAndGlobal>,
[this](FlagAndGlobal* fp) { [](FlagAndGlobal* fp) {
v8::Local<v8::Object> handle = v8::Local<v8::Object> handle =
v8::Local<v8::Object>::New(v8_isolate(), fp->handle); v8::Local<v8::Object>::New(CcTest::isolate(), fp->handle);
USE(handle); USE(handle);
}, },
[this]() { CollectAllGarbage(); }, SurvivalMode::kSurvives); []() { InvokeMarkSweep(); }, SurvivalMode::kSurvives);
} }
TEST_F(GlobalHandlesTest, WeakHandleToUnmodifiedJSApiObjectDiesOnScavenge) { TEST(WeakHandleToUnmodifiedJSApiObjectDiesOnScavenge) {
if (FLAG_single_generation) return; if (FLAG_single_generation) return;
CcTest::InitializeVM();
WeakHandleTest( WeakHandleTest(
v8_isolate(), &ConstructJSApiObject<FlagAndGlobal>, CcTest::isolate(), &ConstructJSApiObject<FlagAndGlobal>,
[](FlagAndGlobal* fp) {}, [this]() { CollectGarbage(i::NEW_SPACE); }, [](FlagAndGlobal* fp) {}, []() { InvokeScavenge(); },
SurvivalMode::kDies); SurvivalMode::kDies);
} }
TEST_F(GlobalHandlesTest, TEST(TracedReferenceToUnmodifiedJSApiObjectDiesOnScavenge) {
TracedReferenceToUnmodifiedJSApiObjectDiesOnScavenge) {
if (FLAG_single_generation) return; if (FLAG_single_generation) return;
ManualGCScope manual_gc;
ManualGCScope manual_gc(i_isolate()); CcTest::InitializeVM();
TracedReferenceTestWithScavenge( TracedReferenceTestWithScavenge(
&ConstructJSApiObject<TracedReferenceWrapper>, CcTest::isolate(), &ConstructJSApiObject<TracedReferenceWrapper>,
[](TracedReferenceWrapper* fp) {}, SurvivalMode::kDies); [](TracedReferenceWrapper* fp) {}, SurvivalMode::kDies);
} }
TEST_F(GlobalHandlesTest, TEST(TracedReferenceToJSApiObjectWithIdentityHashSurvivesScavenge) {
TracedReferenceToJSApiObjectWithIdentityHashSurvivesScavenge) {
if (FLAG_single_generation) return; if (FLAG_single_generation) return;
ManualGCScope manual_gc(i_isolate()); ManualGCScope manual_gc;
Isolate* isolate = i_isolate(); CcTest::InitializeVM();
HandleScope scope(isolate); Isolate* i_isolate = CcTest::i_isolate();
Handle<JSWeakMap> weakmap = isolate->factory()->NewJSWeakMap(); HandleScope scope(i_isolate);
Handle<JSWeakMap> weakmap = i_isolate->factory()->NewJSWeakMap();
TracedReferenceTestWithScavenge( TracedReferenceTestWithScavenge(
&ConstructJSApiObject<TracedReferenceWrapper>, CcTest::isolate(), &ConstructJSApiObject<TracedReferenceWrapper>,
[this, &weakmap, isolate](TracedReferenceWrapper* fp) { [&weakmap, i_isolate](TracedReferenceWrapper* fp) {
v8::HandleScope scope(v8_isolate()); v8::HandleScope scope(CcTest::isolate());
Handle<JSReceiver> key = Handle<JSReceiver> key =
Utils::OpenHandle(*fp->handle.Get(v8_isolate())); Utils::OpenHandle(*fp->handle.Get(CcTest::isolate()));
Handle<Smi> smi(Smi::FromInt(23), isolate); Handle<Smi> smi(Smi::FromInt(23), i_isolate);
int32_t hash = key->GetOrCreateHash(isolate).value(); int32_t hash = key->GetOrCreateHash(i_isolate).value();
JSWeakCollection::Set(weakmap, key, smi, hash); JSWeakCollection::Set(weakmap, key, smi, hash);
}, },
SurvivalMode::kSurvives); SurvivalMode::kSurvives);
} }
TEST_F(GlobalHandlesTest, TEST(WeakHandleToUnmodifiedJSApiObjectSurvivesScavengeWhenInHandle) {
WeakHandleToUnmodifiedJSApiObjectSurvivesScavengeWhenInHandle) {
if (FLAG_single_generation) return; if (FLAG_single_generation) return;
CcTest::InitializeVM();
WeakHandleTest( WeakHandleTest(
v8_isolate(), &ConstructJSApiObject<FlagAndGlobal>, CcTest::isolate(), &ConstructJSApiObject<FlagAndGlobal>,
[this](FlagAndGlobal* fp) { [](FlagAndGlobal* fp) {
v8::Local<v8::Object> handle = v8::Local<v8::Object> handle =
v8::Local<v8::Object>::New(v8_isolate(), fp->handle); v8::Local<v8::Object>::New(CcTest::isolate(), fp->handle);
USE(handle); USE(handle);
}, },
[this]() { CollectGarbage(i::NEW_SPACE); }, SurvivalMode::kSurvives); []() { InvokeScavenge(); }, SurvivalMode::kSurvives);
} }
TEST_F(GlobalHandlesTest, WeakHandleToUnmodifiedJSApiObjectDiesOnMarkCompact) { TEST(WeakHandleToUnmodifiedJSApiObjectDiesOnMarkCompact) {
CcTest::InitializeVM();
WeakHandleTest( WeakHandleTest(
v8_isolate(), &ConstructJSApiObject<FlagAndGlobal>, CcTest::isolate(), &ConstructJSApiObject<FlagAndGlobal>,
[](FlagAndGlobal* fp) {}, [this]() { CollectAllGarbage(); }, [](FlagAndGlobal* fp) {}, []() { InvokeMarkSweep(); },
SurvivalMode::kDies); SurvivalMode::kDies);
} }
TEST_F(GlobalHandlesTest, TEST(WeakHandleToUnmodifiedJSApiObjectSurvivesMarkCompactWhenInHandle) {
WeakHandleToUnmodifiedJSApiObjectSurvivesMarkCompactWhenInHandle) { CcTest::InitializeVM();
WeakHandleTest( WeakHandleTest(
v8_isolate(), &ConstructJSApiObject<FlagAndGlobal>, CcTest::isolate(), &ConstructJSApiObject<FlagAndGlobal>,
[this](FlagAndGlobal* fp) { [](FlagAndGlobal* fp) {
v8::Local<v8::Object> handle = v8::Local<v8::Object> handle =
v8::Local<v8::Object>::New(v8_isolate(), fp->handle); v8::Local<v8::Object>::New(CcTest::isolate(), fp->handle);
USE(handle); USE(handle);
}, },
[this]() { CollectAllGarbage(); }, SurvivalMode::kSurvives); []() { InvokeMarkSweep(); }, SurvivalMode::kSurvives);
} }
TEST_F(GlobalHandlesTest, TEST(TracedReferenceToJSApiObjectWithModifiedMapSurvivesScavenge) {
TracedReferenceToJSApiObjectWithModifiedMapSurvivesScavenge) {
if (FLAG_single_generation) return; if (FLAG_single_generation) return;
CcTest::InitializeVM();
v8::Isolate* isolate = v8_isolate(); v8::Isolate* isolate = CcTest::isolate();
LocalContext context;
TracedReference<v8::Object> handle; TracedReference<v8::Object> handle;
{ {
...@@ -429,19 +434,19 @@ TEST_F(GlobalHandlesTest, ...@@ -429,19 +434,19 @@ TEST_F(GlobalHandlesTest,
auto instance_t = function_template->InstanceTemplate(); auto instance_t = function_template->InstanceTemplate();
instance_t->Set(isolate, "a", v8::Number::New(isolate, 10)); instance_t->Set(isolate, "a", v8::Number::New(isolate, 10));
auto function = auto function =
function_template->GetFunction(v8_context()).ToLocalChecked(); function_template->GetFunction(context.local()).ToLocalChecked();
auto i = function->NewInstance(v8_context()).ToLocalChecked(); auto i = function->NewInstance(context.local()).ToLocalChecked();
handle.Reset(isolate, i); handle.Reset(isolate, i);
} }
CollectGarbage(i::NEW_SPACE); InvokeScavenge();
CHECK(!handle.IsEmpty()); CHECK(!handle.IsEmpty());
} }
TEST_F(GlobalHandlesTest, TEST(TracedReferenceTOJsApiObjectWithElementsSurvivesScavenge) {
TracedReferenceTOJsApiObjectWithElementsSurvivesScavenge) {
if (FLAG_single_generation) return; if (FLAG_single_generation) return;
CcTest::InitializeVM();
v8::Isolate* isolate = v8_isolate(); v8::Isolate* isolate = CcTest::isolate();
LocalContext context;
TracedReference<v8::Object> handle; TracedReference<v8::Object> handle;
{ {
...@@ -453,11 +458,11 @@ TEST_F(GlobalHandlesTest, ...@@ -453,11 +458,11 @@ TEST_F(GlobalHandlesTest,
instance_t->Set(isolate, "1", v8::Number::New(isolate, 10)); instance_t->Set(isolate, "1", v8::Number::New(isolate, 10));
instance_t->Set(isolate, "2", v8::Number::New(isolate, 10)); instance_t->Set(isolate, "2", v8::Number::New(isolate, 10));
auto function = auto function =
function_template->GetFunction(v8_context()).ToLocalChecked(); function_template->GetFunction(context.local()).ToLocalChecked();
auto i = function->NewInstance(v8_context()).ToLocalChecked(); auto i = function->NewInstance(context.local()).ToLocalChecked();
handle.Reset(isolate, i); handle.Reset(isolate, i);
} }
CollectGarbage(i::NEW_SPACE); InvokeScavenge();
CHECK(!handle.IsEmpty()); CHECK(!handle.IsEmpty());
} }
...@@ -465,7 +470,7 @@ namespace { ...@@ -465,7 +470,7 @@ namespace {
void ForceScavenge2(const v8::WeakCallbackInfo<FlagAndGlobal>& data) { void ForceScavenge2(const v8::WeakCallbackInfo<FlagAndGlobal>& data) {
data.GetParameter()->flag = true; data.GetParameter()->flag = true;
YoungGC(data.GetIsolate()); InvokeScavenge();
} }
void ForceScavenge1(const v8::WeakCallbackInfo<FlagAndGlobal>& data) { void ForceScavenge1(const v8::WeakCallbackInfo<FlagAndGlobal>& data) {
...@@ -475,7 +480,7 @@ void ForceScavenge1(const v8::WeakCallbackInfo<FlagAndGlobal>& data) { ...@@ -475,7 +480,7 @@ void ForceScavenge1(const v8::WeakCallbackInfo<FlagAndGlobal>& data) {
void ForceMarkSweep2(const v8::WeakCallbackInfo<FlagAndGlobal>& data) { void ForceMarkSweep2(const v8::WeakCallbackInfo<FlagAndGlobal>& data) {
data.GetParameter()->flag = true; data.GetParameter()->flag = true;
FullGC(data.GetIsolate()); InvokeMarkSweep();
} }
void ForceMarkSweep1(const v8::WeakCallbackInfo<FlagAndGlobal>& data) { void ForceMarkSweep1(const v8::WeakCallbackInfo<FlagAndGlobal>& data) {
...@@ -485,8 +490,9 @@ void ForceMarkSweep1(const v8::WeakCallbackInfo<FlagAndGlobal>& data) { ...@@ -485,8 +490,9 @@ void ForceMarkSweep1(const v8::WeakCallbackInfo<FlagAndGlobal>& data) {
} // namespace } // namespace
TEST_F(GlobalHandlesTest, GCFromWeakCallbacks) { TEST(GCFromWeakCallbacks) {
v8::Isolate* isolate = v8_isolate(); v8::Isolate* isolate = CcTest::isolate();
v8::Locker locker(CcTest::isolate());
v8::HandleScope scope(isolate); v8::HandleScope scope(isolate);
v8::Local<v8::Context> context = v8::Context::New(isolate); v8::Local<v8::Context> context = v8::Context::New(isolate);
v8::Context::Scope context_scope(context); v8::Context::Scope context_scope(context);
...@@ -494,11 +500,11 @@ TEST_F(GlobalHandlesTest, GCFromWeakCallbacks) { ...@@ -494,11 +500,11 @@ TEST_F(GlobalHandlesTest, GCFromWeakCallbacks) {
if (FLAG_single_generation) { if (FLAG_single_generation) {
FlagAndGlobal fp; FlagAndGlobal fp;
ConstructJSApiObject(isolate, context, &fp); ConstructJSApiObject(isolate, context, &fp);
CHECK(!InYoungGeneration(isolate, fp.handle)); CHECK(!heap::InYoungGeneration(isolate, fp.handle));
fp.flag = false; fp.flag = false;
fp.handle.SetWeak(&fp, &ForceMarkSweep1, v8::WeakCallbackType::kParameter); fp.handle.SetWeak(&fp, &ForceMarkSweep1, v8::WeakCallbackType::kParameter);
CollectAllGarbage(); InvokeMarkSweep();
EmptyMessageQueues(); EmptyMessageQueues(isolate);
CHECK(fp.flag); CHECK(fp.flag);
return; return;
} }
...@@ -508,21 +514,19 @@ TEST_F(GlobalHandlesTest, GCFromWeakCallbacks) { ...@@ -508,21 +514,19 @@ TEST_F(GlobalHandlesTest, GCFromWeakCallbacks) {
Callback gc_forcing_callback[kNumberOfGCTypes] = {&ForceScavenge1, Callback gc_forcing_callback[kNumberOfGCTypes] = {&ForceScavenge1,
&ForceMarkSweep1}; &ForceMarkSweep1};
using GCInvoker = std::function<void(void)>; using GCInvoker = void (*)();
GCInvoker invoke_gc[kNumberOfGCTypes] = { GCInvoker invoke_gc[kNumberOfGCTypes] = {&InvokeScavenge, &InvokeMarkSweep};
[this]() { CollectGarbage(i::NEW_SPACE); },
[this]() { CollectAllGarbage(); }};
for (int outer_gc = 0; outer_gc < kNumberOfGCTypes; outer_gc++) { for (int outer_gc = 0; outer_gc < kNumberOfGCTypes; outer_gc++) {
for (int inner_gc = 0; inner_gc < kNumberOfGCTypes; inner_gc++) { for (int inner_gc = 0; inner_gc < kNumberOfGCTypes; inner_gc++) {
FlagAndGlobal fp; FlagAndGlobal fp;
ConstructJSApiObject(isolate, context, &fp); ConstructJSApiObject(isolate, context, &fp);
CHECK(InYoungGeneration(isolate, fp.handle)); CHECK(heap::InYoungGeneration(isolate, fp.handle));
fp.flag = false; fp.flag = false;
fp.handle.SetWeak(&fp, gc_forcing_callback[inner_gc], fp.handle.SetWeak(&fp, gc_forcing_callback[inner_gc],
v8::WeakCallbackType::kParameter); v8::WeakCallbackType::kParameter);
invoke_gc[outer_gc](); invoke_gc[outer_gc]();
EmptyMessageQueues(); EmptyMessageQueues(isolate);
CHECK(fp.flag); CHECK(fp.flag);
} }
} }
...@@ -541,8 +545,9 @@ void FirstPassCallback(const v8::WeakCallbackInfo<FlagAndGlobal>& data) { ...@@ -541,8 +545,9 @@ void FirstPassCallback(const v8::WeakCallbackInfo<FlagAndGlobal>& data) {
} // namespace } // namespace
TEST_F(GlobalHandlesTest, SecondPassPhantomCallbacks) { TEST(SecondPassPhantomCallbacks) {
v8::Isolate* isolate = v8_isolate(); v8::Isolate* isolate = CcTest::isolate();
v8::Locker locker(CcTest::isolate());
v8::HandleScope scope(isolate); v8::HandleScope scope(isolate);
v8::Local<v8::Context> context = v8::Context::New(isolate); v8::Local<v8::Context> context = v8::Context::New(isolate);
v8::Context::Scope context_scope(context); v8::Context::Scope context_scope(context);
...@@ -551,65 +556,72 @@ TEST_F(GlobalHandlesTest, SecondPassPhantomCallbacks) { ...@@ -551,65 +556,72 @@ TEST_F(GlobalHandlesTest, SecondPassPhantomCallbacks) {
fp.flag = false; fp.flag = false;
fp.handle.SetWeak(&fp, FirstPassCallback, v8::WeakCallbackType::kParameter); fp.handle.SetWeak(&fp, FirstPassCallback, v8::WeakCallbackType::kParameter);
CHECK(!fp.flag); CHECK(!fp.flag);
CollectAllGarbage(); InvokeMarkSweep();
CollectAllGarbage(); InvokeMarkSweep();
CHECK(fp.flag); CHECK(fp.flag);
} }
TEST_F(GlobalHandlesTest, MoveStrongGlobal) { TEST(MoveStrongGlobal) {
v8::Isolate* isolate = v8_isolate(); CcTest::InitializeVM();
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope scope(isolate); v8::HandleScope scope(isolate);
v8::Global<v8::Object>* global = new Global<v8::Object>(); v8::Global<v8::Object>* global = new Global<v8::Object>();
ConstructJSObject(isolate, global); ConstructJSObject(isolate, global);
CollectAllGarbage(); InvokeMarkSweep();
v8::Global<v8::Object> global2(std::move(*global)); v8::Global<v8::Object> global2(std::move(*global));
delete global; delete global;
CollectAllGarbage(); InvokeMarkSweep();
} }
TEST_F(GlobalHandlesTest, MoveWeakGlobal) { TEST(MoveWeakGlobal) {
v8::Isolate* isolate = v8_isolate(); CcTest::InitializeVM();
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope scope(isolate); v8::HandleScope scope(isolate);
v8::Global<v8::Object>* global = new Global<v8::Object>(); v8::Global<v8::Object>* global = new Global<v8::Object>();
ConstructJSObject(isolate, global); ConstructJSObject(isolate, global);
CollectAllGarbage(); InvokeMarkSweep();
global->SetWeak(); global->SetWeak();
v8::Global<v8::Object> global2(std::move(*global)); v8::Global<v8::Object> global2(std::move(*global));
delete global; delete global;
CollectAllGarbage(); InvokeMarkSweep();
} }
TEST_F(GlobalHandlesTest, TotalSizeRegularNode) { TEST(TotalSizeRegularNode) {
v8::Isolate* isolate = v8_isolate(); CcTest::InitializeVM();
v8::Isolate* isolate = CcTest::isolate();
Isolate* i_isolate = CcTest::i_isolate();
v8::HandleScope scope(isolate); v8::HandleScope scope(isolate);
v8::Global<v8::Object>* global = new Global<v8::Object>(); v8::Global<v8::Object>* global = new Global<v8::Object>();
CHECK_EQ(i_isolate()->global_handles()->TotalSize(), 0); CHECK_EQ(i_isolate->global_handles()->TotalSize(), 0);
CHECK_EQ(i_isolate()->global_handles()->UsedSize(), 0); CHECK_EQ(i_isolate->global_handles()->UsedSize(), 0);
ConstructJSObject(isolate, global); ConstructJSObject(isolate, global);
CHECK_GT(i_isolate()->global_handles()->TotalSize(), 0); CHECK_GT(i_isolate->global_handles()->TotalSize(), 0);
CHECK_GT(i_isolate()->global_handles()->UsedSize(), 0); CHECK_GT(i_isolate->global_handles()->UsedSize(), 0);
delete global; delete global;
CHECK_GT(i_isolate()->global_handles()->TotalSize(), 0); CHECK_GT(i_isolate->global_handles()->TotalSize(), 0);
CHECK_EQ(i_isolate()->global_handles()->UsedSize(), 0); CHECK_EQ(i_isolate->global_handles()->UsedSize(), 0);
} }
TEST_F(GlobalHandlesTest, TotalSizeTracedNode) { TEST(TotalSizeTracedNode) {
v8::Isolate* isolate = v8_isolate(); ManualGCScope manual_gc;
CcTest::InitializeVM();
v8::Isolate* isolate = CcTest::isolate();
Isolate* i_isolate = CcTest::i_isolate();
v8::HandleScope scope(isolate); v8::HandleScope scope(isolate);
v8::TracedReference<v8::Object>* handle = new TracedReference<v8::Object>(); v8::TracedReference<v8::Object>* handle = new TracedReference<v8::Object>();
CHECK_EQ(i_isolate()->global_handles()->TotalSize(), 0); CHECK_EQ(i_isolate->global_handles()->TotalSize(), 0);
CHECK_EQ(i_isolate()->global_handles()->UsedSize(), 0); CHECK_EQ(i_isolate->global_handles()->UsedSize(), 0);
ConstructJSObject(isolate, handle); ConstructJSObject(isolate, handle);
CHECK_GT(i_isolate()->global_handles()->TotalSize(), 0); CHECK_GT(i_isolate->global_handles()->TotalSize(), 0);
CHECK_GT(i_isolate()->global_handles()->UsedSize(), 0); CHECK_GT(i_isolate->global_handles()->UsedSize(), 0);
delete handle; delete handle;
CollectAllGarbage(); InvokeMarkSweep();
CHECK_GT(i_isolate()->global_handles()->TotalSize(), 0); CHECK_GT(i_isolate->global_handles()->TotalSize(), 0);
CHECK_EQ(i_isolate()->global_handles()->UsedSize(), 0); CHECK_EQ(i_isolate->global_handles()->UsedSize(), 0);
} }
} // namespace internal } // namespace internal
......
...@@ -378,7 +378,6 @@ v8_source_set("unittests_sources") { ...@@ -378,7 +378,6 @@ v8_source_set("unittests_sources") {
"heap/embedder-tracing-unittest.cc", "heap/embedder-tracing-unittest.cc",
"heap/gc-idle-time-handler-unittest.cc", "heap/gc-idle-time-handler-unittest.cc",
"heap/gc-tracer-unittest.cc", "heap/gc-tracer-unittest.cc",
"heap/global-handles-unittest.cc",
"heap/global-safepoint-unittest.cc", "heap/global-safepoint-unittest.cc",
"heap/heap-controller-unittest.cc", "heap/heap-controller-unittest.cc",
"heap/heap-unittest.cc", "heap/heap-unittest.cc",
......
...@@ -39,7 +39,9 @@ class ApiWasmTest : public TestWithIsolate { ...@@ -39,7 +39,9 @@ class ApiWasmTest : public TestWithIsolate {
// value is irrelevant. // value is irrelevant.
Local<Promise> promise = Local<Promise> promise =
Local<Promise>::Cast(RunJS("WebAssembly.compileStreaming(null)")); Local<Promise>::Cast(RunJS("WebAssembly.compileStreaming(null)"));
EmptyMessageQueues();
while (platform::PumpMessageLoop(platform(), isolate())) {
}
CHECK_EQ(expected_state, promise->State()); CHECK_EQ(expected_state, promise->State());
} }
}; };
......
...@@ -498,6 +498,23 @@ void ConstructJSApiObject(v8::Isolate* isolate, v8::Local<v8::Context> context, ...@@ -498,6 +498,23 @@ void ConstructJSApiObject(v8::Isolate* isolate, v8::Local<v8::Context> context,
EXPECT_FALSE(global->IsEmpty()); EXPECT_FALSE(global->IsEmpty());
} }
namespace {
bool InCorrectGeneration(HeapObject object) {
return FLAG_single_generation ? !i::Heap::InYoungGeneration(object)
: i::Heap::InYoungGeneration(object);
}
template <typename GlobalOrPersistent>
bool InCorrectGeneration(v8::Isolate* isolate,
const GlobalOrPersistent& global) {
v8::HandleScope scope(isolate);
auto tmp = global.Get(isolate);
return InCorrectGeneration(*v8::Utils::OpenHandle(*tmp));
}
} // namespace
enum class SurvivalMode { kSurvives, kDies }; enum class SurvivalMode { kSurvives, kDies };
template <typename ModifierFunction, typename ConstructTracedReferenceFunction, template <typename ModifierFunction, typename ConstructTracedReferenceFunction,
...@@ -515,7 +532,7 @@ void TracedReferenceTest(v8::Isolate* isolate, ...@@ -515,7 +532,7 @@ void TracedReferenceTest(v8::Isolate* isolate,
const size_t initial_count = global_handles->handles_count(); const size_t initial_count = global_handles->handles_count();
auto handle = std::make_unique<v8::TracedReference<v8::Object>>(); auto handle = std::make_unique<v8::TracedReference<v8::Object>>();
construct_function(isolate, context, handle.get()); construct_function(isolate, context, handle.get());
ASSERT_TRUE(IsNewObjectInCorrectGeneration(isolate, *handle)); ASSERT_TRUE(InCorrectGeneration(isolate, *handle));
modifier_function(*handle); modifier_function(*handle);
const size_t after_modification_count = global_handles->handles_count(); const size_t after_modification_count = global_handles->handles_count();
gc_function(); gc_function();
...@@ -966,8 +983,7 @@ V8_NOINLINE void StackToHeapTest(v8::Isolate* v8_isolate, ...@@ -966,8 +983,7 @@ V8_NOINLINE void StackToHeapTest(v8::Isolate* v8_isolate,
v8::HandleScope scope(v8_isolate); v8::HandleScope scope(v8_isolate);
v8::Local<v8::Object> to_object(ConstructTraceableJSApiObject( v8::Local<v8::Object> to_object(ConstructTraceableJSApiObject(
v8_isolate->GetCurrentContext(), nullptr, nullptr)); v8_isolate->GetCurrentContext(), nullptr, nullptr));
EXPECT_TRUE( EXPECT_TRUE(InCorrectGeneration(*v8::Utils::OpenHandle(*to_object)));
IsNewObjectInCorrectGeneration(*v8::Utils::OpenHandle(*to_object)));
if (!FLAG_single_generation && if (!FLAG_single_generation &&
target_handling == TargetHandling::kInitializedOldGen) { target_handling == TargetHandling::kInitializedOldGen) {
FullGC(v8_isolate); FullGC(v8_isolate);
...@@ -1018,8 +1034,7 @@ V8_NOINLINE void HeapToStackTest(v8::Isolate* v8_isolate, ...@@ -1018,8 +1034,7 @@ V8_NOINLINE void HeapToStackTest(v8::Isolate* v8_isolate,
v8::HandleScope scope(v8_isolate); v8::HandleScope scope(v8_isolate);
v8::Local<v8::Object> to_object(ConstructTraceableJSApiObject( v8::Local<v8::Object> to_object(ConstructTraceableJSApiObject(
v8_isolate->GetCurrentContext(), nullptr, nullptr)); v8_isolate->GetCurrentContext(), nullptr, nullptr));
EXPECT_TRUE( EXPECT_TRUE(InCorrectGeneration(*v8::Utils::OpenHandle(*to_object)));
IsNewObjectInCorrectGeneration(*v8::Utils::OpenHandle(*to_object)));
if (!FLAG_single_generation && if (!FLAG_single_generation &&
target_handling == TargetHandling::kInitializedOldGen) { target_handling == TargetHandling::kInitializedOldGen) {
FullGC(v8_isolate); FullGC(v8_isolate);
...@@ -1059,8 +1074,7 @@ V8_NOINLINE void StackToStackTest(v8::Isolate* v8_isolate, ...@@ -1059,8 +1074,7 @@ V8_NOINLINE void StackToStackTest(v8::Isolate* v8_isolate,
v8::HandleScope scope(v8_isolate); v8::HandleScope scope(v8_isolate);
v8::Local<v8::Object> to_object(ConstructTraceableJSApiObject( v8::Local<v8::Object> to_object(ConstructTraceableJSApiObject(
v8_isolate->GetCurrentContext(), nullptr, nullptr)); v8_isolate->GetCurrentContext(), nullptr, nullptr));
EXPECT_TRUE( EXPECT_TRUE(InCorrectGeneration(*v8::Utils::OpenHandle(*to_object)));
IsNewObjectInCorrectGeneration(*v8::Utils::OpenHandle(*to_object)));
if (!FLAG_single_generation && if (!FLAG_single_generation &&
target_handling == TargetHandling::kInitializedOldGen) { target_handling == TargetHandling::kInitializedOldGen) {
FullGC(v8_isolate); FullGC(v8_isolate);
......
...@@ -220,10 +220,5 @@ std::vector<Handle<FixedArray>> HeapInternalsBase::CreatePadding( ...@@ -220,10 +220,5 @@ std::vector<Handle<FixedArray>> HeapInternalsBase::CreatePadding(
return handles; return handles;
} }
bool IsNewObjectInCorrectGeneration(HeapObject object) {
return FLAG_single_generation ? !i::Heap::InYoungGeneration(object)
: i::Heap::InYoungGeneration(object);
}
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
...@@ -99,22 +99,6 @@ class WithHeapInternals : public TMixin, HeapInternalsBase { ...@@ -99,22 +99,6 @@ class WithHeapInternals : public TMixin, HeapInternalsBase {
} }
}; };
class V8_NODISCARD TemporaryEmbedderHeapTracerScope {
public:
TemporaryEmbedderHeapTracerScope(v8::Isolate* isolate,
v8::EmbedderHeapTracer* tracer)
: isolate_(isolate) {
isolate_->SetEmbedderHeapTracer(tracer);
}
~TemporaryEmbedderHeapTracerScope() {
isolate_->SetEmbedderHeapTracer(nullptr);
}
private:
v8::Isolate* const isolate_;
};
using TestWithHeapInternals = // using TestWithHeapInternals = //
WithHeapInternals< // WithHeapInternals< //
WithInternalIsolateMixin< // WithInternalIsolateMixin< //
...@@ -137,24 +121,6 @@ inline void YoungGC(v8::Isolate* isolate) { ...@@ -137,24 +121,6 @@ inline void YoungGC(v8::Isolate* isolate) {
i::NEW_SPACE, i::GarbageCollectionReason::kTesting); i::NEW_SPACE, i::GarbageCollectionReason::kTesting);
} }
template <typename GlobalOrPersistent>
bool InYoungGeneration(v8::Isolate* isolate, const GlobalOrPersistent& global) {
CHECK(!FLAG_single_generation);
v8::HandleScope scope(isolate);
auto tmp = global.Get(isolate);
return i::Heap::InYoungGeneration(*v8::Utils::OpenHandle(*tmp));
}
bool IsNewObjectInCorrectGeneration(HeapObject object);
template <typename GlobalOrPersistent>
bool IsNewObjectInCorrectGeneration(v8::Isolate* isolate,
const GlobalOrPersistent& global) {
v8::HandleScope scope(isolate);
auto tmp = global.Get(isolate);
return IsNewObjectInCorrectGeneration(*v8::Utils::OpenHandle(*tmp));
}
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
......
...@@ -211,12 +211,6 @@ class WithIsolateScopeMixin : public TMixin { ...@@ -211,12 +211,6 @@ class WithIsolateScopeMixin : public TMixin {
return v8::String::NewFromUtf8(this->v8_isolate(), string).ToLocalChecked(); return v8::String::NewFromUtf8(this->v8_isolate(), string).ToLocalChecked();
} }
void EmptyMessageQueues() {
while (v8::platform::PumpMessageLoop(internal::V8::GetCurrentPlatform(),
this->v8_isolate())) {
}
}
private: private:
Local<Value> RunJS(Local<String> source) { Local<Value> RunJS(Local<String> source) {
return TryRunJS(source).ToLocalChecked(); return TryRunJS(source).ToLocalChecked();
......
...@@ -203,13 +203,6 @@ ...@@ -203,13 +203,6 @@
# Performs GC # Performs GC
'APIExceptionTest.ExceptionMessageDoesNotKeepContextAlive': [SKIP], 'APIExceptionTest.ExceptionMessageDoesNotKeepContextAlive': [SKIP],
'GlobalHandlesTest.FinalizerDiesAndKeepsPhantomAliveOnMarkCompact': [SKIP],
'GlobalHandlesTest.FinalizerWeakness': [SKIP],
'GlobalHandlesTest.GCFromWeakCallbacks': [SKIP],
'GlobalHandlesTest.PhantomHandlesWithoutCallbacks': [SKIP],
'GlobalHandlesTest.SecondPassPhantomCallbacks': [SKIP],
'GlobalHandlesTest.WeakHandleToUnmodifiedJSApiObjectDiesOnMarkCompact': [SKIP],
'GlobalHandlesTest.WeakHandleToUnmodifiedJSObjectDiesOnMarkCompact': [SKIP],
'LocalHeapTest.GCEpilogue': [SKIP], 'LocalHeapTest.GCEpilogue': [SKIP],
'UnifiedHeapDetachedTest.AllocationBeforeConfigureHeap': [SKIP], 'UnifiedHeapDetachedTest.AllocationBeforeConfigureHeap': [SKIP],
'UnifiedHeapTest.FindingV8ToBlinkReference': [SKIP], 'UnifiedHeapTest.FindingV8ToBlinkReference': [SKIP],
...@@ -290,7 +283,6 @@ ...@@ -290,7 +283,6 @@
'BignumDtoaTest.*': [SKIP], 'BignumDtoaTest.*': [SKIP],
'DtoaTest.*': [SKIP], 'DtoaTest.*': [SKIP],
'DeclsTest.*': [SKIP], 'DeclsTest.*': [SKIP],
'GlobalHandlesTest.*': [SKIP],
}], # variant == no_wasm_traps }], # variant == no_wasm_traps
############################################################################## ##############################################################################
......
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