Chromium Code Reviews| 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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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)) { | 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); |
|
Yang
2016/05/13 07:41:10
CallSiteGetFunctionName is accessible from the sta
Clemens Hammacher
2016/05/17 17:43:24
I was assuming that it would be nice for users to
| |
| 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(); |
| 682 return funName + " (<WASM>:" + funcIndex + ":" + pos + ")"; | 681 if (IS_UNDEFINED(funName)) funName = "<WASM UNNAMED>"; |
| 682 return funName + " (<WASM>[" + funcIndex + "]+" + pos + ")"; | |
|
Yang
2016/05/13 07:41:10
So we could get a return value like "<WASM UNNAMED
Clemens Hammacher
2016/05/17 17:43:24
Yes.
| |
| 683 } | 683 } |
| 684 | 684 |
| 685 var fileName; | 685 var fileName; |
| 686 var fileLocation = ""; | 686 var fileLocation = ""; |
| 687 if (this.isNative()) { | 687 if (this.isNative()) { |
| 688 fileLocation = "native"; | 688 fileLocation = "native"; |
| 689 } else { | 689 } else { |
| 690 fileName = this.getScriptNameOrSourceURL(); | 690 fileName = this.getScriptNameOrSourceURL(); |
| 691 if (!fileName && this.isEval()) { | 691 if (!fileName && this.isEval()) { |
| 692 fileLocation = this.getEvalOrigin(); | 692 fileLocation = this.getEvalOrigin(); |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1045 utils.Export(function(to) { | 1045 utils.Export(function(to) { |
| 1046 to.ErrorToString = ErrorToString; | 1046 to.ErrorToString = ErrorToString; |
| 1047 to.MakeError = MakeError; | 1047 to.MakeError = MakeError; |
| 1048 to.MakeRangeError = MakeRangeError; | 1048 to.MakeRangeError = MakeRangeError; |
| 1049 to.MakeSyntaxError = MakeSyntaxError; | 1049 to.MakeSyntaxError = MakeSyntaxError; |
| 1050 to.MakeTypeError = MakeTypeError; | 1050 to.MakeTypeError = MakeTypeError; |
| 1051 to.MakeURIError = MakeURIError; | 1051 to.MakeURIError = MakeURIError; |
| 1052 }); | 1052 }); |
| 1053 | 1053 |
| 1054 }); | 1054 }); |
| OLD | NEW |