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

Unified Diff: runtime/vm/thread_test.cc

Issue 1280013004: Restore frame validation (fixes to CL faaf60801f72). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Clean up test. Created 5 years, 4 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 | « runtime/vm/thread_registry.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread_test.cc
diff --git a/runtime/vm/thread_test.cc b/runtime/vm/thread_test.cc
index 9290d637d30f2e182325010f9ef3e7d2472ea619..a9320d0574522c29e598a1167743f27d11aa439f 100644
--- a/runtime/vm/thread_test.cc
+++ b/runtime/vm/thread_test.cc
@@ -131,13 +131,15 @@ class TaskWithZoneAllocation : public ThreadPool::Task {
const intptr_t unique_smi = id_ + 928327281;
Smi& smi = Smi::Handle(zone, Smi::New(unique_smi));
EXPECT(smi.Value() == unique_smi);
- ObjectCounter counter(isolate_, &smi);
- // Ensure that our particular zone is visited.
- isolate_->IterateObjectPointers(&counter,
- /* visit_prologue_weak_handles = */ true,
- /* validate_frames = */ true);
- EXPECT_EQ(1, counter.count());
-
+ {
+ ObjectCounter counter(isolate_, &smi);
+ // Ensure that our particular zone is visited.
+ isolate_->IterateObjectPointers(
+ &counter,
+ /* visit_prologue_weak_handles = */ true,
+ StackFrameIterator::kValidateFrames);
+ EXPECT_EQ(1, counter.count());
+ }
char* unique_chars = zone->PrintToString("unique_str_%" Pd, id_);
String& unique_str = String::Handle(zone);
{
@@ -147,12 +149,16 @@ class TaskWithZoneAllocation : public ThreadPool::Task {
unique_str = String::New(unique_chars, Heap::kOld);
}
EXPECT(unique_str.Equals(unique_chars));
- ObjectCounter str_counter(isolate_, &unique_str);
- // Ensure that our particular zone is visited.
- // TODO(koda): Remove "->thread_registry()" after updating stack walker.
- isolate_->thread_registry()->VisitObjectPointers(&str_counter);
- // We should visit the string object exactly once.
- EXPECT_EQ(1, str_counter.count());
+ {
+ ObjectCounter str_counter(isolate_, &unique_str);
+ // Ensure that our particular zone is visited.
+ isolate_->IterateObjectPointers(
+ &str_counter,
+ /* visit_prologue_weak_handles = */ true,
+ StackFrameIterator::kValidateFrames);
+ // We should visit the string object exactly once.
+ EXPECT_EQ(1, str_counter.count());
+ }
}
Thread::ExitIsolateAsHelper();
{
@@ -273,7 +279,10 @@ class SafepointTestTask : public ThreadPool::Task {
// But occasionally, organize a rendezvous.
isolate_->thread_registry()->SafepointThreads();
ObjectCounter counter(isolate_, &smi);
- isolate_->thread_registry()->VisitObjectPointers(&counter);
+ isolate_->IterateObjectPointers(
+ &counter,
+ /* visit_prologue_weak_handles = */ true,
+ StackFrameIterator::kValidateFrames);
{
MutexLocker ml(mutex_);
EXPECT_EQ(*expected_count_, counter.count());
« no previous file with comments | « runtime/vm/thread_registry.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698