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

Side by Side Diff: runtime/vm/heap_test.cc

Issue 1870343002: - Refactor Symbol allocation to expect a thread parameter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review feedback. 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/guard_field_test.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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.
OLDNEW
« no previous file with comments | « runtime/vm/guard_field_test.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698