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

Unified Diff: test/cctest/heap/test-heap.cc

Issue 1883403002: [compiler] Move ensuring deoptimization support to backends. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 4 years, 8 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 | « src/objects.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/heap/test-heap.cc
diff --git a/test/cctest/heap/test-heap.cc b/test/cctest/heap/test-heap.cc
index 10ff89c278e198baee5c9e35bc8e8298bb8066d6..b1af005fd8a0d6e2f305492ec58ab83c74c8d15c 100644
--- a/test/cctest/heap/test-heap.cc
+++ b/test/cctest/heap/test-heap.cc
@@ -2658,6 +2658,14 @@ TEST(InstanceOfStubWriteBarrier) {
CcTest::heap()->CollectGarbage(OLD_SPACE);
}
+namespace {
+
+int GetProfilerTicks(SharedFunctionInfo* shared) {
+ return FLAG_ignition ? shared->profiler_ticks()
+ : shared->code()->profiler_ticks();
+}
+
+} // namespace
TEST(ResetSharedFunctionInfoCountersDuringIncrementalMarking) {
i::FLAG_stress_compaction = false;
@@ -2688,16 +2696,18 @@ TEST(ResetSharedFunctionInfoCountersDuringIncrementalMarking) {
CcTest::global()->Get(ctx, v8_str("f")).ToLocalChecked())));
CHECK(f->IsOptimized());
- IncrementalMarking* marking = CcTest::heap()->incremental_marking();
- marking->Stop();
+ // Make sure incremental marking it not running.
+ CcTest::heap()->incremental_marking()->Stop();
+
CcTest::heap()->StartIncrementalMarking();
// The following calls will increment CcTest::heap()->global_ic_age().
CcTest::isolate()->ContextDisposedNotification();
SimulateIncrementalMarking(CcTest::heap());
CcTest::heap()->CollectAllGarbage();
+
CHECK_EQ(CcTest::heap()->global_ic_age(), f->shared()->ic_age());
CHECK_EQ(0, f->shared()->opt_count());
- CHECK_EQ(0, f->shared()->code()->profiler_ticks());
+ CHECK_EQ(0, GetProfilerTicks(f->shared()));
}
@@ -2728,9 +2738,9 @@ TEST(ResetSharedFunctionInfoCountersDuringMarkSweep) {
i::Handle<JSFunction> f = i::Handle<JSFunction>::cast(
v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
CcTest::global()->Get(ctx, v8_str("f")).ToLocalChecked())));
-
CHECK(f->IsOptimized());
+ // Make sure incremental marking it not running.
CcTest::heap()->incremental_marking()->Stop();
// The following two calls will increment CcTest::heap()->global_ic_age().
@@ -2739,7 +2749,7 @@ TEST(ResetSharedFunctionInfoCountersDuringMarkSweep) {
CHECK_EQ(CcTest::heap()->global_ic_age(), f->shared()->ic_age());
CHECK_EQ(0, f->shared()->opt_count());
- CHECK_EQ(0, f->shared()->code()->profiler_ticks());
+ CHECK_EQ(0, GetProfilerTicks(f->shared()));
}
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698