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

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

Issue 2646443005: Track async causal stack traces (Closed)
Patch Set: rebase Created 3 years, 10 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/service.cc ('k') | runtime/vm/stack_trace.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 <setjmp.h> // NOLINT 5 #include <setjmp.h> // NOLINT
6 #include <stdlib.h> 6 #include <stdlib.h>
7 7
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 #if defined(TARGET_ARCH_DBC) 9 #if defined(TARGET_ARCH_DBC)
10 10
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 RawObject** FP, 427 RawObject** FP,
428 RawObject** result) { 428 RawObject** result) {
429 double d1, d2; 429 double d1, d2;
430 if (!GetDoubleOperands(FrameArguments(FP, 2), &d1, &d2)) { 430 if (!GetDoubleOperands(FrameArguments(FP, 2), &d1, &d2)) {
431 return false; 431 return false;
432 } 432 }
433 *result = d1 <= d2 ? Bool::True().raw() : Bool::False().raw(); 433 *result = d1 <= d2 ? Bool::True().raw() : Bool::False().raw();
434 return true; 434 return true;
435 } 435 }
436 436
437 static bool ClearAsyncThreadStack(Thread* thread,
438 RawObject** FP,
439 RawObject** result) {
440 thread->clear_async_stack_trace();
441 *result = Object::null();
442 return true;
443 }
444
445 static bool SetAsyncThreadStackTrace(Thread* thread,
446 RawObject** FP,
447 RawObject** result) {
448 RawObject** args = FrameArguments(FP, 1);
449 thread->set_raw_async_stack_trace(
450 reinterpret_cast<RawStackTrace*>(args[0]));
451 *result = Object::null();
452 return true;
453 }
454
437 DART_FORCE_INLINE static RawCode* FrameCode(RawObject** FP) { 455 DART_FORCE_INLINE static RawCode* FrameCode(RawObject** FP) {
438 ASSERT(GetClassId(FP[kPcMarkerSlotFromFp]) == kCodeCid); 456 ASSERT(GetClassId(FP[kPcMarkerSlotFromFp]) == kCodeCid);
439 return static_cast<RawCode*>(FP[kPcMarkerSlotFromFp]); 457 return static_cast<RawCode*>(FP[kPcMarkerSlotFromFp]);
440 } 458 }
441 459
442 460
443 DART_FORCE_INLINE static void SetFrameCode(RawObject** FP, RawCode* code) { 461 DART_FORCE_INLINE static void SetFrameCode(RawObject** FP, RawCode* code) {
444 ASSERT(GetClassId(code) == kCodeCid); 462 ASSERT(GetClassId(code) == kCodeCid);
445 FP[kPcMarkerSlotFromFp] = code; 463 FP[kPcMarkerSlotFromFp] = code;
446 } 464 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 intrinsics_[kDouble_subIntrinsic] = SimulatorHelpers::Double_sub; 515 intrinsics_[kDouble_subIntrinsic] = SimulatorHelpers::Double_sub;
498 intrinsics_[kDouble_divIntrinsic] = SimulatorHelpers::Double_div; 516 intrinsics_[kDouble_divIntrinsic] = SimulatorHelpers::Double_div;
499 intrinsics_[kDouble_greaterThanIntrinsic] = 517 intrinsics_[kDouble_greaterThanIntrinsic] =
500 SimulatorHelpers::Double_greaterThan; 518 SimulatorHelpers::Double_greaterThan;
501 intrinsics_[kDouble_greaterEqualThanIntrinsic] = 519 intrinsics_[kDouble_greaterEqualThanIntrinsic] =
502 SimulatorHelpers::Double_greaterEqualThan; 520 SimulatorHelpers::Double_greaterEqualThan;
503 intrinsics_[kDouble_lessThanIntrinsic] = SimulatorHelpers::Double_lessThan; 521 intrinsics_[kDouble_lessThanIntrinsic] = SimulatorHelpers::Double_lessThan;
504 intrinsics_[kDouble_equalIntrinsic] = SimulatorHelpers::Double_equal; 522 intrinsics_[kDouble_equalIntrinsic] = SimulatorHelpers::Double_equal;
505 intrinsics_[kDouble_lessEqualThanIntrinsic] = 523 intrinsics_[kDouble_lessEqualThanIntrinsic] =
506 SimulatorHelpers::Double_lessEqualThan; 524 SimulatorHelpers::Double_lessEqualThan;
525 intrinsics_[kClearAsyncThreadStackTraceIntrinsic] =
526 SimulatorHelpers::ClearAsyncThreadStack;
527 intrinsics_[kSetAsyncThreadStackTraceIntrinsic] =
528 SimulatorHelpers::SetAsyncThreadStackTrace;
507 } 529 }
508 530
509 531
510 Simulator::Simulator() : stack_(NULL), fp_(NULL) { 532 Simulator::Simulator() : stack_(NULL), fp_(NULL) {
511 // Setup simulator support first. Some of this information is needed to 533 // Setup simulator support first. Some of this information is needed to
512 // setup the architecture state. 534 // setup the architecture state.
513 // We allocate the stack here, the size is computed as the sum of 535 // We allocate the stack here, the size is computed as the sum of
514 // the size specified by the user and the buffer space needed for 536 // the size specified by the user and the buffer space needed for
515 // handling stack overflow exceptions. To be safe in potential 537 // handling stack overflow exceptions. To be safe in potential
516 // stack underflows we also add some underflow buffer space. 538 // stack underflows we also add some underflow buffer space.
(...skipping 3204 matching lines...) Expand 10 before | Expand all | Expand 10 after
3721 pc_ = pc; 3743 pc_ = pc;
3722 } 3744 }
3723 3745
3724 buf->Longjmp(); 3746 buf->Longjmp();
3725 UNREACHABLE(); 3747 UNREACHABLE();
3726 } 3748 }
3727 3749
3728 } // namespace dart 3750 } // namespace dart
3729 3751
3730 #endif // defined TARGET_ARCH_DBC 3752 #endif // defined TARGET_ARCH_DBC
OLDNEW
« no previous file with comments | « runtime/vm/service.cc ('k') | runtime/vm/stack_trace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698