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 if (IS_UNDEFINED(wasm)) return "<WASM>"; | |
635 var func_index = GET_PRIVATE(this, callSiteWasmFunctionIndexSymbol); | 636 var func_index = GET_PRIVATE(this, callSiteWasmFunctionIndexSymbol); |
636 if (IS_UNDEFINED(wasm)) return "<WASM>"; | 637 var func_name = %WasmGetFunctionName(wasm, func_index); |
637 return %WasmGetFunctionName(wasm, func_index); | 638 return func_name ? func_name : "<WASM>"; |
Yang
2016/05/09 05:34:55
Can we do a IS_UNDEFINED check if we only expect u
clemensh
2016/05/09 07:38:46
Unfortunately not. At least not without further ch
Yang
2016/05/11 05:49:41
I see. Can we hide this logic inside %WasmGetFunct
| |
638 } | 639 } |
639 return %CallSiteGetFunctionNameRT(this); | 640 return %CallSiteGetFunctionNameRT(this); |
640 } | 641 } |
641 | 642 |
642 function CallSiteGetMethodName() { | 643 function CallSiteGetMethodName() { |
643 // See if we can find a unique property on the receiver that holds | 644 // See if we can find a unique property on the receiver that holds |
644 // this function. | 645 // this function. |
645 CheckCallSite(this, "getMethodName"); | 646 CheckCallSite(this, "getMethodName"); |
646 return %CallSiteGetMethodNameRT(this); | 647 return %CallSiteGetMethodNameRT(this); |
647 } | 648 } |
(...skipping 394 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 |