| 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/globals.h" | 5 #include "platform/globals.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/dart_api_impl.h" | 8 #include "vm/dart_api_impl.h" |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 #include "vm/heap.h" | 10 #include "vm/heap.h" |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 FindNothing find_nothing; | 277 FindNothing find_nothing; |
| 278 EXPECT(Object::null() == heap->FindObject(&find_nothing)); | 278 EXPECT(Object::null() == heap->FindObject(&find_nothing)); |
| 279 } | 279 } |
| 280 } | 280 } |
| 281 | 281 |
| 282 | 282 |
| 283 TEST_CASE(IterateReadOnly) { | 283 TEST_CASE(IterateReadOnly) { |
| 284 const String& obj = String::Handle(String::New("x", Heap::kOld)); | 284 const String& obj = String::Handle(String::New("x", Heap::kOld)); |
| 285 Heap* heap = Thread::Current()->isolate()->heap(); | 285 Heap* heap = Thread::Current()->isolate()->heap(); |
| 286 EXPECT(heap->Contains(RawObject::ToAddr(obj.raw()))); | 286 EXPECT(heap->Contains(RawObject::ToAddr(obj.raw()))); |
| 287 heap->WriteProtect(true, true /* include_code_pages */); | 287 heap->WriteProtect(true); |
| 288 EXPECT(heap->Contains(RawObject::ToAddr(obj.raw()))); | 288 EXPECT(heap->Contains(RawObject::ToAddr(obj.raw()))); |
| 289 heap->WriteProtect(false, true /* include_code_pages */); | 289 heap->WriteProtect(false); |
| 290 EXPECT(heap->Contains(RawObject::ToAddr(obj.raw()))); | 290 EXPECT(heap->Contains(RawObject::ToAddr(obj.raw()))); |
| 291 } | 291 } |
| 292 | 292 |
| 293 } // namespace dart. | 293 } // namespace dart. |
| OLD | NEW |