code(exit_frame->LookupCode(), this); const int offset = static_cast(exit_frame->pc() - code->instruction_start()); int flags = 0; if (helper.IsStrictFrame(*fun)) flags |= FrameArray::kIsStrict; if (exit_frame->IsConstructor()) flags |= FrameArray::kForceConstructor; elements = FrameArray::AppendJSFrame(elements, recv, fun, Handle::cast(code), offset, flags); } break; case StackFrame::WASM_COMPILED: { WasmCompiledFrame* wasm_frame = WasmCompiledFrame::cast(frame); Handle instance(wasm_frame->wasm_instance(), this); const int wasm_function_index = wasm_frame->function_index(); Code* code = wasm_frame->unchecked_code(); Handle abstract_code(AbstractCode::cast(code), this); const int offset = static_cast(wasm_frame->pc() - code->instruction_start()); int flags = 0; if (instance->compiled_module()->is_asm_js()) { flags |= FrameArray::kIsAsmJsWasmFrame; if (wasm_frame->at_to_number_conversion()) { flags |= FrameArray::kAsmJsAtNumberConversion; } } else { flags |= FrameArray::kIsWasmFrame; } elements = FrameArray::AppendWasmFrame(elements, instance, wasm_function_index, abstract_code, offset, flags); } break; case StackFrame::WASM_INTERPRETER_ENTRY: // TODO(clemensh): Add frames. break; default: break; } } elements->ShrinkToFit(); // TODO(yangguo): Queue this structured stack trace for preprocessing on GC. return factory()->NewJSArrayWithElements(elements); } MaybeHandle Isolate::CaptureAndSetDetailedStackTrace( Handle error_object) { if (capture_stack_trace_for_uncaught_exceptions_) { // Capture stack trace for a detailed exception message. Handle key = factory()->detailed_stack_trace_symbol(); Handle stack_trace = CaptureCurrentStackTrace( stack_trace_for_uncaught_exceptions_frame_limit_, stack_trace_for_uncaught_exceptions_options_); RETURN_ON_EXCEPTION( this, JSReceiver::SetProperty(error_object, key, stack_trace, STRICT), JSReceiver); } return error_object; } MaybeHandle Isolate::CaptureAndSetSimpleStackTrace( Handle error_object, FrameSkipMode mode, Handle caller) { // Capture stack trace for simple stack trace string formatting. Handle key = factory()->stack_trace_symbol(); Handle stack_trace = CaptureSimpleStackTrace(error_object, mode, caller); RETURN_ON_EXCEPTION( this, JSReceiver::SetProperty(error_object, key, stack_trace, STRICT), JSReceiver); return error_object; } Handle Isolate::GetDetailedStackTrace(Handle error_object) { Handle key_detailed = factory()->detailed_stack_trace_symbol(); Handle stack_trace = JSReceiver::GetDataProperty(error_object, key_detailed); if (stack_trace->IsJSArray()) return Handle::cast(stack_trace); return Handle(); } class CaptureStackTraceHelper { public: CaptureStackTraceHelper(Isolate* isolate, StackTrace::StackTraceOptions options) : isolate_(isolate) { if (options & StackTrace::kColumnOffset) { column_key_ = factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("column")); } if (options & StackTrace::kLineNumber) { line_key_ = factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("lineNumber")); } if (options & StackTrace::kScriptId) { script_id_key_ = factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("scriptId")); } if (options & StackTrace::kScriptName) { script_name_key_ = factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("scriptName")); } if (options & StackTrace::kScriptNameOrSourceURL) { script_name_or_source_url_key_ = factory()->InternalizeOneByteString( STATIC_CHAR_VECTOR("scriptNameOrSourceURL")); } if (options & StackTrace::kFunctionName) { function_key_ = factory()->InternalizeOneByteString( STATIC_CHAR_VECTOR("functionName")); } if (options & StackTrace::kIsEval) { eval_key_ = factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("isEval")); } if (options & StackTrace::kIsConstructor) { constructor_key_ = factory()->InternalizeOneByteString( STATIC_CHAR_VECTOR("isConstructor")); } } Handle NewStackFrameObject(FrameSummary& summ) { if (summ.IsJavaScript()) return NewStackFrameObject(summ.AsJavaScript()); if (summ.IsWasm()) return NewStackFrameObject(summ.AsWasm()); UNREACHABLE(); return Handle::null(); } Handle NewStackFrameObject( const FrameSummary::JavaScriptFrameSummary& summ) { Handle stack_frame = factory()->NewJSObject(isolate_->object_function()); Handle 登录后可以享受更多权益 您还没有登录,登录后您可以: 收藏Android系统代码 收藏喜欢的文章 多个平台共享账号 去登录 首次使用?从这里 注册
您还没有登录,登录后您可以:
首次使用?从这里 注册