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

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

Issue 1394673002: Move reusable handles from isolate to thread. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix release build Created 5 years, 2 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/profiler.h ('k') | runtime/vm/reusable_handles.h » ('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/address_sanitizer.h" 5 #include "platform/address_sanitizer.h"
6 #include "platform/memory_sanitizer.h" 6 #include "platform/memory_sanitizer.h"
7 #include "platform/utils.h" 7 #include "platform/utils.h"
8 8
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/atomic.h" 10 #include "vm/atomic.h"
(...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 break; 1246 break;
1247 } 1247 }
1248 processed_sample->Add(current->At(i)); 1248 processed_sample->Add(current->At(i));
1249 } 1249 }
1250 1250
1251 truncated = truncated || current->truncated_trace(); 1251 truncated = truncated || current->truncated_trace();
1252 current = Next(current); 1252 current = Next(current);
1253 } 1253 }
1254 1254
1255 if (!sample->exit_frame_sample()) { 1255 if (!sample->exit_frame_sample()) {
1256 Isolate* isolate = thread->isolate();
1257 Isolate* vm_isolate = Dart::vm_isolate(); 1256 Isolate* vm_isolate = Dart::vm_isolate();
1258 processed_sample->FixupCaller(isolate, 1257 processed_sample->FixupCaller(thread,
1259 vm_isolate, 1258 vm_isolate,
1260 sample->pc_marker(), 1259 sample->pc_marker(),
1261 sample->GetStackBuffer()); 1260 sample->GetStackBuffer());
1262 } 1261 }
1263 1262
1264 processed_sample->set_truncated(truncated); 1263 processed_sample->set_truncated(truncated);
1265 return processed_sample; 1264 return processed_sample;
1266 } 1265 }
1267 1266
1268 1267
(...skipping 20 matching lines...) Expand all
1289 ProcessedSample::ProcessedSample() 1288 ProcessedSample::ProcessedSample()
1290 : pcs_(kSampleSize), 1289 : pcs_(kSampleSize),
1291 timestamp_(0), 1290 timestamp_(0),
1292 vm_tag_(0), 1291 vm_tag_(0),
1293 user_tag_(0), 1292 user_tag_(0),
1294 allocation_cid_(-1), 1293 allocation_cid_(-1),
1295 truncated_(false) { 1294 truncated_(false) {
1296 } 1295 }
1297 1296
1298 1297
1299 void ProcessedSample::FixupCaller(Isolate* isolate, 1298 void ProcessedSample::FixupCaller(Thread* thread,
1300 Isolate* vm_isolate, 1299 Isolate* vm_isolate,
1301 uword pc_marker, 1300 uword pc_marker,
1302 uword* stack_buffer) { 1301 uword* stack_buffer) {
1303 REUSABLE_CODE_HANDLESCOPE(isolate); 1302 REUSABLE_CODE_HANDLESCOPE(thread);
1304 // Lookup code object for leaf frame. 1303 // Lookup code object for leaf frame.
1305 Code& code = reused_code_handle.Handle(); 1304 Code& code = reused_code_handle.Handle();
1306 code = FindCodeForPC(isolate, vm_isolate, At(0)); 1305 code = FindCodeForPC(thread->isolate(), vm_isolate, At(0));
1307 if (code.IsNull()) { 1306 if (code.IsNull()) {
1308 return; 1307 return;
1309 } 1308 }
1310 if (code.compile_timestamp() > timestamp()) { 1309 if (code.compile_timestamp() > timestamp()) {
1311 // Code compiled after sample. Ignore. 1310 // Code compiled after sample. Ignore.
1312 return; 1311 return;
1313 } 1312 }
1314 CheckForMissingDartFrame(isolate, vm_isolate, code, pc_marker, stack_buffer); 1313 CheckForMissingDartFrame(
1314 thread->isolate(), vm_isolate, code, pc_marker, stack_buffer);
1315 } 1315 }
1316 1316
1317 1317
1318 void ProcessedSample::CheckForMissingDartFrame(Isolate* isolate, 1318 void ProcessedSample::CheckForMissingDartFrame(Isolate* isolate,
1319 Isolate* vm_isolate, 1319 Isolate* vm_isolate,
1320 const Code& code, 1320 const Code& code,
1321 uword pc_marker, 1321 uword pc_marker,
1322 uword* stack_buffer) { 1322 uword* stack_buffer) {
1323 // Some stubs (and intrinsics) do not push a frame onto the stack leaving 1323 // Some stubs (and intrinsics) do not push a frame onto the stack leaving
1324 // the frame pointer in the caller. 1324 // the frame pointer in the caller.
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 uword pc) { 1391 uword pc) {
1392 return vm_isolate->heap()->CodeContains(pc) 1392 return vm_isolate->heap()->CodeContains(pc)
1393 || isolate->heap()->CodeContains(pc); 1393 || isolate->heap()->CodeContains(pc);
1394 } 1394 }
1395 1395
1396 1396
1397 ProcessedSampleBuffer::ProcessedSampleBuffer() { 1397 ProcessedSampleBuffer::ProcessedSampleBuffer() {
1398 } 1398 }
1399 1399
1400 } // namespace dart 1400 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/profiler.h ('k') | runtime/vm/reusable_handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698