@@ -514,6 +514,26 @@ int JSStackFrame::GetColumnNumber() {
514
514
return kNone ;
515
515
}
516
516
517
+ int JSStackFrame::GetEnclosingLineNumber () {
518
+ if (HasScript ()) {
519
+ Handle <SharedFunctionInfo> shared = handle (function_->shared (), isolate_);
520
+ return Script::GetLineNumber (GetScript (),
521
+ shared->function_token_position ()) + 1 ;
522
+ } else {
523
+ return kNone ;
524
+ }
525
+ }
526
+
527
+ int JSStackFrame::GetEnclosingColumnNumber () {
528
+ if (HasScript ()) {
529
+ Handle <SharedFunctionInfo> shared = handle (function_->shared (), isolate_);
530
+ return Script::GetColumnNumber (GetScript (),
531
+ shared->function_token_position ()) + 1 ;
532
+ } else {
533
+ return kNone ;
534
+ }
535
+ }
536
+
517
537
int JSStackFrame::GetPromiseIndex () const {
518
538
return (is_promise_all_ || is_promise_any_) ? offset_ : kNone ;
519
539
}
@@ -602,6 +622,12 @@ int WasmStackFrame::GetPosition() const {
602
622
603
623
int WasmStackFrame::GetColumnNumber () { return GetModuleOffset (); }
604
624
625
+ int WasmStackFrame::GetEnclosingColumnNumber () {
626
+ const int function_offset =
627
+ GetWasmFunctionOffset (wasm_instance_->module (), wasm_func_index_);
628
+ return function_offset;
629
+ }
630
+
605
631
int WasmStackFrame::GetModuleOffset () const {
606
632
const int function_offset =
607
633
GetWasmFunctionOffset (wasm_instance_->module (), wasm_func_index_);
@@ -672,6 +698,26 @@ int AsmJsWasmStackFrame::GetColumnNumber() {
672
698
return Script::GetColumnNumber (script, GetPosition ()) + 1 ;
673
699
}
674
700
701
+ int AsmJsWasmStackFrame::GetEnclosingLineNumber () {
702
+ DCHECK_LE (0 , GetPosition ());
703
+ Handle <Script> script (wasm_instance_->module_object ().script (), isolate_);
704
+ DCHECK (script->IsUserJavaScript ());
705
+ int byte_offset = GetSourcePosition (wasm_instance_->module (),
706
+ wasm_func_index_, 0 ,
707
+ is_at_number_conversion_);
708
+ return Script::GetLineNumber (script, byte_offset) + 1 ;
709
+ }
710
+
711
+ int AsmJsWasmStackFrame::GetEnclosingColumnNumber () {
712
+ DCHECK_LE (0 , GetPosition ());
713
+ Handle <Script> script (wasm_instance_->module_object ().script (), isolate_);
714
+ DCHECK (script->IsUserJavaScript ());
715
+ int byte_offset = GetSourcePosition (wasm_instance_->module (),
716
+ wasm_func_index_, 0 ,
717
+ is_at_number_conversion_);
718
+ return Script::GetColumnNumber (script, byte_offset) + 1 ;
719
+ }
720
+
675
721
FrameArrayIterator::FrameArrayIterator (Isolate* isolate,
676
722
Handle <FrameArray> array, int frame_ix)
677
723
: isolate_(isolate), array_(array), frame_ix_(frame_ix) {}
0 commit comments