Changeset 121393 in webkit for trunk/Source/JavaScriptCore


Ignore:
Timestamp:
Jun 27, 2012, 6:09:22 PM (13 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling out r121359.
http://trac.webkit.org/changeset/121359
https://bugs.webkit.org/show_bug.cgi?id=90115

Broke many inspector tests (Requested by jpfau on #webkit).

Patch by Sheriff Bot <[email protected]> on 2012-06-27

Source/JavaScriptCore:

  • interpreter/Interpreter.h:

(JSC::StackFrame::toString):

Source/WebCore:

  • bindings/js/ScriptCallStackFactory.cpp:

(WebCore::createScriptCallStack):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r121391 r121393  
     12012-06-27  Sheriff Bot  <[email protected]>
     2
     3        Unreviewed, rolling out r121359.
     4        http://trac.webkit.org/changeset/121359
     5        https://bugs.webkit.org/show_bug.cgi?id=90115
     6
     7        Broke many inspector tests (Requested by jpfau on #webkit).
     8
     9        * interpreter/Interpreter.h:
     10        (JSC::StackFrame::toString):
     11
    1122012-06-27  Filip Pizlo  <[email protected]>
    213
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.h

    r121359 r121393  
    11/*
    22 * Copyright (C) 2008 Apple Inc. All rights reserved.
    3  * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
    43 *
    54 * Redistribution and use in source and binary forms, with or without
     
    4140
    4241#include <wtf/HashMap.h>
    43 #include <wtf/text/StringBuilder.h>
    4442
    4543namespace JSC {
     
    8381        UString toString(CallFrame* callFrame) const
    8482        {
    85             StringBuilder traceBuild;
    86             String functionName = friendlyFunctionName(callFrame);
    87             String sourceURL = friendlySourceURL();
    88             traceBuild.append(functionName);
    89             if (!functionName.isEmpty() && !sourceURL.isEmpty())
    90                 traceBuild.append('@');
    91             traceBuild.append(sourceURL);
    92             if (line > -1) {
    93                 traceBuild.append(':');
    94                 traceBuild.append(String::number(line));
    95             }
    96             return traceBuild.toString().impl();
    97         }
    98         String friendlySourceURL() const
    99         {
     83            bool hasSourceURLInfo = !sourceURL.isNull() && !sourceURL.isEmpty();
     84            bool hasLineInfo = line > -1;
    10085            String traceLine;
     86            JSObject* stackFrameCallee = callee.get();
    10187
    10288            switch (codeType) {
    10389            case StackFrameEvalCode:
    104             case StackFrameFunctionCode:
    105             case StackFrameGlobalCode:
    106                 if (!sourceURL.isEmpty())
    107                     traceLine = sourceURL.impl();
     90                if (hasSourceURLInfo) {
     91                    traceLine = hasLineInfo ? String::format("eval code@%s:%d", sourceURL.ascii().data(), line)
     92                                            : String::format("eval code@%s", sourceURL.ascii().data());
     93                } else
     94                    traceLine = String::format("eval code");
    10895                break;
    109             case StackFrameNativeCode:
    110                 traceLine = "[native code]";
     96            case StackFrameNativeCode: {
     97                if (callee) {
     98                    UString functionName = getCalculatedDisplayName(callFrame, stackFrameCallee);
     99                    traceLine = String::format("%s@[native code]", functionName.ascii().data());
     100                } else
     101                    traceLine = "[native code]";
    111102                break;
    112103            }
    113             return traceLine.isNull() ? emptyString() : traceLine;
    114         }
    115         String friendlyFunctionName(CallFrame* callFrame) const
    116         {
    117             String traceLine;
    118             JSObject* stackFrameCallee = callee.get();
    119 
    120             switch (codeType) {
    121             case StackFrameEvalCode:
    122                 traceLine = "eval code";
    123                 break;
    124             case StackFrameNativeCode:
    125                 if (callee)
    126                     traceLine = getCalculatedDisplayName(callFrame, stackFrameCallee).impl();
    127                 break;
    128             case StackFrameFunctionCode:
    129                 traceLine = getCalculatedDisplayName(callFrame, stackFrameCallee).impl();
    130                 break;
    131             case StackFrameGlobalCode:
    132                 traceLine = "global code";
     104            case StackFrameFunctionCode: {
     105                UString functionName = getCalculatedDisplayName(callFrame, stackFrameCallee);
     106                if (hasSourceURLInfo) {
     107                    traceLine = hasLineInfo ? String::format("%s@%s:%d", functionName.ascii().data(), sourceURL.ascii().data(), line)
     108                                            : String::format("%s@%s", functionName.ascii().data(), sourceURL.ascii().data());
     109                } else
     110                    traceLine = String::format("%s\n", functionName.ascii().data());
    133111                break;
    134112            }
    135             return traceLine.isNull() ? emptyString() : traceLine;
    136         }
    137         unsigned friendlyLineNumber() const
    138         {
    139             return line > -1 ? line : 0;
     113            case StackFrameGlobalCode:
     114                if (hasSourceURLInfo) {
     115                    traceLine = hasLineInfo ? String::format("global code@%s:%d", sourceURL.ascii().data(), line)
     116                                            : String::format("global code@%s", sourceURL.ascii().data());
     117                } else
     118                    traceLine = String::format("global code");
     119                   
     120            }
     121            return traceLine.impl();
    140122        }
    141123    };
Note: See TracChangeset for help on using the changeset viewer.