Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: src/messages.js

Issue 1122973002: Move more parts of stack trace formatting to runtime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comments Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/messages.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/messages.js
diff --git a/src/messages.js b/src/messages.js
index 8bfd0bc397fae2c257eb94dd3cdfd68f9e50d264..20b7cb3d4e379f099c95d98b48e729601f2f7386 100644
--- a/src/messages.js
+++ b/src/messages.js
@@ -778,31 +778,8 @@ function CallSiteGetMethodName() {
// this function.
var receiver = GET_PRIVATE(this, CallSiteReceiverKey);
var fun = GET_PRIVATE(this, CallSiteFunctionKey);
- var ownName = fun.name;
- if (ownName && receiver &&
- (%_CallFunction(receiver, ownName, $objectLookupGetter) === fun ||
- %_CallFunction(receiver, ownName, $objectLookupSetter) === fun ||
- (IS_OBJECT(receiver) && %GetDataProperty(receiver, ownName) === fun))) {
- // To handle DontEnum properties we guess that the method has
- // the same name as the function.
- return ownName;
- }
- var name = null;
- for (var prop in receiver) {
- if (%_CallFunction(receiver, prop, $objectLookupGetter) === fun ||
- %_CallFunction(receiver, prop, $objectLookupSetter) === fun ||
- (IS_OBJECT(receiver) && %GetDataProperty(receiver, prop) === fun)) {
- // If we find more than one match bail out to avoid confusion.
- if (name) {
- return null;
- }
- name = prop;
- }
- }
- if (name) {
- return name;
- }
- return null;
+ var pos = GET_PRIVATE(this, CallSitePositionKey);
+ return %CallSiteGetMethodNameRT(receiver, fun, pos);
}
function CallSiteGetFileName() {
@@ -835,10 +812,9 @@ function CallSiteIsNative() {
function CallSiteIsConstructor() {
var receiver = GET_PRIVATE(this, CallSiteReceiverKey);
- var constructor = (receiver != null && IS_OBJECT(receiver))
- ? %GetDataProperty(receiver, "constructor") : null;
- if (!constructor) return false;
- return GET_PRIVATE(this, CallSiteFunctionKey) === constructor;
+ var fun = GET_PRIVATE(this, CallSiteFunctionKey);
+ var pos = GET_PRIVATE(this, CallSitePositionKey);
+ return %CallSiteIsConstructorRT(receiver, fun, pos);
}
function CallSiteToString() {
« no previous file with comments | « src/messages.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698