Reapply 0489249d29 with a fix for front_end tests.
Proper sequencing of _asyncStackTraceHelper in Kernel This helper function was being called before its argument was initialized so it was passing null. Instead, it should be called after its argument is initialized. Because the initialization happens in Kernel code, it is simplest to insert the call explicitly in Kernel code as well as part of the async transformation. This has the consequence that we now call the helper function even when the flag causal_async_stacks is false. Fixes issue #29771. Fixes issue #30178 Fixes issue #30058 BUG= R=aam@google.com, asiva@google.com Review-Url: https://codereview.chromium.org/2936793003 . Review-Url: https://codereview.chromium.org/2982943002 .
This commit is contained in:
@@ -107,13 +107,15 @@ DEFINE_NATIVE_ENTRY(StackTrace_current, 0) {
|
||||
}
|
||||
|
||||
DEFINE_NATIVE_ENTRY(StackTrace_asyncStackTraceHelper, 1) {
|
||||
if (!FLAG_causal_async_stacks) {
|
||||
return Object::null();
|
||||
}
|
||||
|
||||
GET_NATIVE_ARGUMENT(Closure, async_op, arguments->NativeArgAt(0));
|
||||
if (!async_op.IsNull()) {
|
||||
if (FLAG_support_debugger) {
|
||||
Debugger* debugger = isolate->debugger();
|
||||
if (debugger != NULL) {
|
||||
debugger->MaybeAsyncStepInto(async_op);
|
||||
}
|
||||
if (FLAG_support_debugger) {
|
||||
Debugger* debugger = isolate->debugger();
|
||||
if (debugger != NULL) {
|
||||
debugger->MaybeAsyncStepInto(async_op);
|
||||
}
|
||||
}
|
||||
return CurrentStackTrace(thread, true);
|
||||
@@ -125,6 +127,10 @@ DEFINE_NATIVE_ENTRY(StackTrace_clearAsyncThreadStackTrace, 0) {
|
||||
}
|
||||
|
||||
DEFINE_NATIVE_ENTRY(StackTrace_setAsyncThreadStackTrace, 1) {
|
||||
if (!FLAG_causal_async_stacks) {
|
||||
return Object::null();
|
||||
}
|
||||
|
||||
GET_NON_NULL_NATIVE_ARGUMENT(StackTrace, stack_trace,
|
||||
arguments->NativeArgAt(0));
|
||||
thread->set_async_stack_trace(stack_trace);
|
||||
|
||||
Reference in New Issue
Block a user