OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // ------------------------------------------------------------------- | 5 // ------------------------------------------------------------------- |
6 | 6 |
7 (function(global, utils) { | 7 (function(global, utils) { |
8 | 8 |
9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
10 | 10 |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
626 CheckCallSite(this, "getScriptNameOrSourceURL"); | 626 CheckCallSite(this, "getScriptNameOrSourceURL"); |
627 return %CallSiteGetScriptNameOrSourceUrlRT(this); | 627 return %CallSiteGetScriptNameOrSourceUrlRT(this); |
628 } | 628 } |
629 | 629 |
630 function CallSiteGetFunctionName() { | 630 function CallSiteGetFunctionName() { |
631 // See if the function knows its own name | 631 // See if the function knows its own name |
632 CheckCallSite(this, "getFunctionName"); | 632 CheckCallSite(this, "getFunctionName"); |
633 if (HAS_PRIVATE(this, callSiteWasmObjectSymbol)) { | 633 if (HAS_PRIVATE(this, callSiteWasmObjectSymbol)) { |
634 var wasm = GET_PRIVATE(this, callSiteWasmObjectSymbol); | 634 var wasm = GET_PRIVATE(this, callSiteWasmObjectSymbol); |
635 var func_index = GET_PRIVATE(this, callSiteWasmFunctionIndexSymbol); | 635 var func_index = GET_PRIVATE(this, callSiteWasmFunctionIndexSymbol); |
636 if (IS_UNDEFINED(wasm)) return "<WASM>"; | |
637 return %WasmGetFunctionName(wasm, func_index); | 636 return %WasmGetFunctionName(wasm, func_index); |
638 } | 637 } |
639 return %CallSiteGetFunctionNameRT(this); | 638 return %CallSiteGetFunctionNameRT(this); |
640 } | 639 } |
641 | 640 |
642 function CallSiteGetMethodName() { | 641 function CallSiteGetMethodName() { |
643 // See if we can find a unique property on the receiver that holds | 642 // See if we can find a unique property on the receiver that holds |
644 // this function. | 643 // this function. |
645 CheckCallSite(this, "getMethodName"); | 644 CheckCallSite(this, "getMethodName"); |
646 return %CallSiteGetMethodNameRT(this); | 645 return %CallSiteGetMethodNameRT(this); |
(...skipping 25 matching lines...) Expand all Loading... | |
672 function CallSiteIsConstructor() { | 671 function CallSiteIsConstructor() { |
673 CheckCallSite(this, "isConstructor"); | 672 CheckCallSite(this, "isConstructor"); |
674 return %CallSiteIsConstructorRT(this); | 673 return %CallSiteIsConstructorRT(this); |
675 } | 674 } |
676 | 675 |
677 function CallSiteToString() { | 676 function CallSiteToString() { |
678 if (HAS_PRIVATE(this, callSiteWasmObjectSymbol)) { | 677 if (HAS_PRIVATE(this, callSiteWasmObjectSymbol)) { |
679 var funName = this.getFunctionName(); | 678 var funName = this.getFunctionName(); |
680 var funcIndex = GET_PRIVATE(this, callSiteWasmFunctionIndexSymbol); | 679 var funcIndex = GET_PRIVATE(this, callSiteWasmFunctionIndexSymbol); |
681 var pos = this.getPosition(); | 680 var pos = this.getPosition(); |
681 if (IS_NULL_OR_UNDEFINED(funName)) | |
682 funName = "<WASM UNNAMED>"; | |
titzer
2016/05/12 09:05:51
Should probably also add the position here.
Clemens Hammacher
2016/05/12 09:45:57
It's still added in the line below, there is no re
titzer
2016/05/12 09:54:35
Acknowledged.
| |
682 return funName + " (<WASM>:" + funcIndex + ":" + pos + ")"; | 683 return funName + " (<WASM>:" + funcIndex + ":" + pos + ")"; |
titzer
2016/05/12 09:05:51
bikeshed: for this line:
" (<WASM>[" + funcIndex
Clemens Hammacher
2016/05/12 09:45:57
Would you prefer this format for all wasm frames?
titzer
2016/05/12 09:54:35
yes
| |
683 } | 684 } |
684 | 685 |
685 var fileName; | 686 var fileName; |
686 var fileLocation = ""; | 687 var fileLocation = ""; |
687 if (this.isNative()) { | 688 if (this.isNative()) { |
688 fileLocation = "native"; | 689 fileLocation = "native"; |
689 } else { | 690 } else { |
690 fileName = this.getScriptNameOrSourceURL(); | 691 fileName = this.getScriptNameOrSourceURL(); |
691 if (!fileName && this.isEval()) { | 692 if (!fileName && this.isEval()) { |
692 fileLocation = this.getEvalOrigin(); | 693 fileLocation = this.getEvalOrigin(); |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1042 utils.Export(function(to) { | 1043 utils.Export(function(to) { |
1043 to.ErrorToString = ErrorToString; | 1044 to.ErrorToString = ErrorToString; |
1044 to.MakeError = MakeError; | 1045 to.MakeError = MakeError; |
1045 to.MakeRangeError = MakeRangeError; | 1046 to.MakeRangeError = MakeRangeError; |
1046 to.MakeSyntaxError = MakeSyntaxError; | 1047 to.MakeSyntaxError = MakeSyntaxError; |
1047 to.MakeTypeError = MakeTypeError; | 1048 to.MakeTypeError = MakeTypeError; |
1048 to.MakeURIError = MakeURIError; | 1049 to.MakeURIError = MakeURIError; |
1049 }); | 1050 }); |
1050 | 1051 |
1051 }); | 1052 }); |
OLD | NEW |