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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 } | 623 } |
624 | 624 |
625 function CallSiteGetScriptNameOrSourceURL() { | 625 function CallSiteGetScriptNameOrSourceURL() { |
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)) { | |
634 var wasm = GET_PRIVATE(this, callSiteWasmObjectSymbol); | |
635 var func_index = GET_PRIVATE(this, callSiteWasmFunctionIndexSymbol); | |
636 if (IS_UNDEFINED(wasm)) return "<WASM>"; | |
637 return %WasmGetFunctionName(wasm, func_index); | |
638 } | |
639 return %CallSiteGetFunctionNameRT(this); | 633 return %CallSiteGetFunctionNameRT(this); |
640 } | 634 } |
641 | 635 |
642 function CallSiteGetMethodName() { | 636 function CallSiteGetMethodName() { |
643 // See if we can find a unique property on the receiver that holds | 637 // See if we can find a unique property on the receiver that holds |
644 // this function. | 638 // this function. |
645 CheckCallSite(this, "getMethodName"); | 639 CheckCallSite(this, "getMethodName"); |
646 return %CallSiteGetMethodNameRT(this); | 640 return %CallSiteGetMethodNameRT(this); |
647 } | 641 } |
648 | 642 |
(...skipping 23 matching lines...) Expand all Loading... |
672 function CallSiteIsConstructor() { | 666 function CallSiteIsConstructor() { |
673 CheckCallSite(this, "isConstructor"); | 667 CheckCallSite(this, "isConstructor"); |
674 return %CallSiteIsConstructorRT(this); | 668 return %CallSiteIsConstructorRT(this); |
675 } | 669 } |
676 | 670 |
677 function CallSiteToString() { | 671 function CallSiteToString() { |
678 if (HAS_PRIVATE(this, callSiteWasmObjectSymbol)) { | 672 if (HAS_PRIVATE(this, callSiteWasmObjectSymbol)) { |
679 var funName = this.getFunctionName(); | 673 var funName = this.getFunctionName(); |
680 var funcIndex = GET_PRIVATE(this, callSiteWasmFunctionIndexSymbol); | 674 var funcIndex = GET_PRIVATE(this, callSiteWasmFunctionIndexSymbol); |
681 var pos = this.getPosition(); | 675 var pos = this.getPosition(); |
682 return funName + " (<WASM>:" + funcIndex + ":" + pos + ")"; | 676 if (IS_NULL(funName)) funName = "<WASM UNNAMED>"; |
| 677 return funName + " (<WASM>[" + funcIndex + "]+" + pos + ")"; |
683 } | 678 } |
684 | 679 |
685 var fileName; | 680 var fileName; |
686 var fileLocation = ""; | 681 var fileLocation = ""; |
687 if (this.isNative()) { | 682 if (this.isNative()) { |
688 fileLocation = "native"; | 683 fileLocation = "native"; |
689 } else { | 684 } else { |
690 fileName = this.getScriptNameOrSourceURL(); | 685 fileName = this.getScriptNameOrSourceURL(); |
691 if (!fileName && this.isEval()) { | 686 if (!fileName && this.isEval()) { |
692 fileLocation = this.getEvalOrigin(); | 687 fileLocation = this.getEvalOrigin(); |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1045 utils.Export(function(to) { | 1040 utils.Export(function(to) { |
1046 to.ErrorToString = ErrorToString; | 1041 to.ErrorToString = ErrorToString; |
1047 to.MakeError = MakeError; | 1042 to.MakeError = MakeError; |
1048 to.MakeRangeError = MakeRangeError; | 1043 to.MakeRangeError = MakeRangeError; |
1049 to.MakeSyntaxError = MakeSyntaxError; | 1044 to.MakeSyntaxError = MakeSyntaxError; |
1050 to.MakeTypeError = MakeTypeError; | 1045 to.MakeTypeError = MakeTypeError; |
1051 to.MakeURIError = MakeURIError; | 1046 to.MakeURIError = MakeURIError; |
1052 }); | 1047 }); |
1053 | 1048 |
1054 }); | 1049 }); |
OLD | NEW |