Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/assert.h" | 5 #include "platform/assert.h" |
| 6 #include "vm/isolate.h" | 6 #include "vm/isolate.h" |
| 7 #include "vm/lockers.h" | 7 #include "vm/lockers.h" |
| 8 #include "vm/unit_test.h" | 8 #include "vm/unit_test.h" |
| 9 #include "vm/profiler.h" | 9 #include "vm/profiler.h" |
| 10 #include "vm/thread_pool.h" | 10 #include "vm/thread_pool.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 } | 126 } |
| 127 // Check that we can create handles and allocate in old space. | 127 // Check that we can create handles and allocate in old space. |
| 128 String& str = String::Handle(zone, String::New("old", Heap::kOld)); | 128 String& str = String::Handle(zone, String::New("old", Heap::kOld)); |
| 129 EXPECT(str.Equals("old")); | 129 EXPECT(str.Equals("old")); |
| 130 | 130 |
| 131 const intptr_t unique_smi = id_ + 928327281; | 131 const intptr_t unique_smi = id_ + 928327281; |
| 132 Smi& smi = Smi::Handle(zone, Smi::New(unique_smi)); | 132 Smi& smi = Smi::Handle(zone, Smi::New(unique_smi)); |
| 133 EXPECT(smi.Value() == unique_smi); | 133 EXPECT(smi.Value() == unique_smi); |
| 134 ObjectCounter counter(isolate_, &smi); | 134 ObjectCounter counter(isolate_, &smi); |
| 135 // Ensure that our particular zone is visited. | 135 // Ensure that our particular zone is visited. |
| 136 // TODO(koda): Remove "->thread_registry()" after updating stack walker. | 136 isolate_->IterateObjectPointers(&counter, |
| 137 isolate_->thread_registry()->VisitObjectPointers(&counter); | 137 /* visit_prologue_weak_handles = */ true, |
| 138 /* validate_frames = */ true); | |
|
Ivan Posva
2015/08/11 17:41:31
ditto
| |
| 138 EXPECT_EQ(1, counter.count()); | 139 EXPECT_EQ(1, counter.count()); |
| 139 | 140 |
| 140 char* unique_chars = zone->PrintToString("unique_str_%" Pd, id_); | 141 char* unique_chars = zone->PrintToString("unique_str_%" Pd, id_); |
| 141 String& unique_str = String::Handle(zone); | 142 String& unique_str = String::Handle(zone); |
| 142 { | 143 { |
| 143 // String::New may create additional handles in the topmost scope that | 144 // String::New may create additional handles in the topmost scope that |
| 144 // we don't want to count, so wrap this in its own scope. | 145 // we don't want to count, so wrap this in its own scope. |
| 145 HANDLESCOPE(thread); | 146 HANDLESCOPE(thread); |
| 146 unique_str = String::New(unique_chars, Heap::kOld); | 147 unique_str = String::New(unique_chars, Heap::kOld); |
| 147 } | 148 } |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 432 while (true) { | 433 while (true) { |
| 433 isolate->thread_registry()->CheckSafepoint(); | 434 isolate->thread_registry()->CheckSafepoint(); |
| 434 MutexLocker ml(&mutex); | 435 MutexLocker ml(&mutex); |
| 435 if (exited == SafepointTestTask::kTaskCount) { | 436 if (exited == SafepointTestTask::kTaskCount) { |
| 436 break; | 437 break; |
| 437 } | 438 } |
| 438 } | 439 } |
| 439 } | 440 } |
| 440 | 441 |
| 441 } // namespace dart | 442 } // namespace dart |
| OLD | NEW |