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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 OS::Print("%" Pd " ", stats->recent.new_count); | 86 OS::Print("%" Pd " ", stats->recent.new_count); |
87 OS::Print("%" Pd " ", stats->post_gc.new_count); | 87 OS::Print("%" Pd " ", stats->post_gc.new_count); |
88 OS::Print("%" Pd " ", stats->pre_gc.new_count); | 88 OS::Print("%" Pd " ", stats->pre_gc.new_count); |
89 OS::Print("\n"); | 89 OS::Print("\n"); |
90 } | 90 } |
91 }; | 91 }; |
92 | 92 |
93 | 93 |
94 static RawClass* GetClass(const Library& lib, const char* name) { | 94 static RawClass* GetClass(const Library& lib, const char* name) { |
95 const Class& cls = Class::Handle( | 95 const Class& cls = Class::Handle( |
96 lib.LookupClass(String::Handle(Symbols::New(name)))); | 96 lib.LookupClass(String::Handle(Symbols::New(Thread::Current(), name)))); |
97 EXPECT(!cls.IsNull()); // No ambiguity error expected. | 97 EXPECT(!cls.IsNull()); // No ambiguity error expected. |
98 return cls.raw(); | 98 return cls.raw(); |
99 } | 99 } |
100 | 100 |
101 | 101 |
102 TEST_CASE(ClassHeapStats) { | 102 TEST_CASE(ClassHeapStats) { |
103 const char* kScriptChars = | 103 const char* kScriptChars = |
104 "class A {\n" | 104 "class A {\n" |
105 " var a;\n" | 105 " var a;\n" |
106 " var b;\n" | 106 " var b;\n" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 const String& obj = String::Handle(String::New("x", Heap::kOld)); | 283 const String& obj = String::Handle(String::New("x", Heap::kOld)); |
284 Heap* heap = Thread::Current()->isolate()->heap(); | 284 Heap* heap = Thread::Current()->isolate()->heap(); |
285 EXPECT(heap->Contains(RawObject::ToAddr(obj.raw()))); | 285 EXPECT(heap->Contains(RawObject::ToAddr(obj.raw()))); |
286 heap->WriteProtect(true); | 286 heap->WriteProtect(true); |
287 EXPECT(heap->Contains(RawObject::ToAddr(obj.raw()))); | 287 EXPECT(heap->Contains(RawObject::ToAddr(obj.raw()))); |
288 heap->WriteProtect(false); | 288 heap->WriteProtect(false); |
289 EXPECT(heap->Contains(RawObject::ToAddr(obj.raw()))); | 289 EXPECT(heap->Contains(RawObject::ToAddr(obj.raw()))); |
290 } | 290 } |
291 | 291 |
292 } // namespace dart. | 292 } // namespace dart. |
OLD | NEW |