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

Side by Side Diff: runtime/vm/profiler_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/precompiler.cc ('k') | runtime/vm/raw_object_snapshot.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 6
7 #include "vm/dart_api_impl.h" 7 #include "vm/dart_api_impl.h"
8 #include "vm/dart_api_state.h" 8 #include "vm/dart_api_state.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/profiler.h" 10 #include "vm/profiler.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 sample->Init(isolate, 0, 0); 173 sample->Init(isolate, 0, 0);
174 sample->set_metadata(99); 174 sample->set_metadata(99);
175 sample->set_is_allocation_sample(true); 175 sample->set_is_allocation_sample(true);
176 EXPECT_EQ(99, sample->allocation_cid()); 176 EXPECT_EQ(99, sample->allocation_cid());
177 delete sample_buffer; 177 delete sample_buffer;
178 } 178 }
179 179
180 180
181 static RawClass* GetClass(const Library& lib, const char* name) { 181 static RawClass* GetClass(const Library& lib, const char* name) {
182 const Class& cls = Class::Handle( 182 const Class& cls = Class::Handle(
183 lib.LookupClassAllowPrivate(String::Handle(Symbols::New(name)))); 183 lib.LookupClassAllowPrivate(String::Handle(Symbols::New(Thread::Current(),
184 name))));
184 EXPECT(!cls.IsNull()); // No ambiguity error expected. 185 EXPECT(!cls.IsNull()); // No ambiguity error expected.
185 return cls.raw(); 186 return cls.raw();
186 } 187 }
187 188
188 189
189 static RawFunction* GetFunction(const Library& lib, const char* name) { 190 static RawFunction* GetFunction(const Library& lib, const char* name) {
190 const Function& func = Function::Handle( 191 const Function& func = Function::Handle(lib.LookupFunctionAllowPrivate(
191 lib.LookupFunctionAllowPrivate(String::Handle(Symbols::New(name)))); 192 String::Handle(Symbols::New(Thread::Current(), name))));
192 EXPECT(!func.IsNull()); // No ambiguity error expected. 193 EXPECT(!func.IsNull()); // No ambiguity error expected.
193 return func.raw(); 194 return func.raw();
194 } 195 }
195 196
196 197
197 class AllocationFilter : public SampleFilter { 198 class AllocationFilter : public SampleFilter {
198 public: 199 public:
199 AllocationFilter(Isolate* isolate, 200 AllocationFilter(Isolate* isolate,
200 intptr_t cid, 201 intptr_t cid,
201 int64_t time_origin_micros = -1, 202 int64_t time_origin_micros = -1,
(...skipping 2295 matching lines...) Expand 10 before | Expand all | Expand 10 after
2497 EXPECT_SUBSTRING("\"positions\":[\"TempMove\",39]", js.ToCString()); 2498 EXPECT_SUBSTRING("\"positions\":[\"TempMove\",39]", js.ToCString());
2498 // Verify exclusive ticks in main. 2499 // Verify exclusive ticks in main.
2499 EXPECT_SUBSTRING("\"exclusiveTicks\":[1,0]", js.ToCString()); 2500 EXPECT_SUBSTRING("\"exclusiveTicks\":[1,0]", js.ToCString());
2500 // Verify inclusive ticks in main. 2501 // Verify inclusive ticks in main.
2501 EXPECT_SUBSTRING("\"inclusiveTicks\":[1,2]", js.ToCString()); 2502 EXPECT_SUBSTRING("\"inclusiveTicks\":[1,2]", js.ToCString());
2502 } 2503 }
2503 2504
2504 #endif // !PRODUCT 2505 #endif // !PRODUCT
2505 2506
2506 } // namespace dart 2507 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/precompiler.cc ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698