Changeset 225416 in webkit


Ignore:
Timestamp:
Dec 1, 2017 2:19:03 PM (6 years ago)
Author:
jfbastien@apple.com
Message:

WebAssembly: stack trace improvement follow-ups
https://bugs.webkit.org/show_bug.cgi?id=180273

Reviewed by Saam Barati.

  • wasm/WasmIndexOrName.cpp:

(JSC::Wasm::makeString):

  • wasm/WasmIndexOrName.h:

(JSC::Wasm::IndexOrName::nameSection const):

  • wasm/WasmNameSection.h:

(JSC::Wasm::NameSection::NameSection):
(JSC::Wasm::NameSection::get):

Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r225411 r225416  
     12017-12-01  JF Bastien  <jfbastien@apple.com>
     2
     3        WebAssembly: stack trace improvement follow-ups
     4        https://bugs.webkit.org/show_bug.cgi?id=180273
     5
     6        Reviewed by Saam Barati.
     7
     8        * wasm/WasmIndexOrName.cpp:
     9        (JSC::Wasm::makeString):
     10        * wasm/WasmIndexOrName.h:
     11        (JSC::Wasm::IndexOrName::nameSection const):
     12        * wasm/WasmNameSection.h:
     13        (JSC::Wasm::NameSection::NameSection):
     14        (JSC::Wasm::NameSection::get):
     15
    1162017-12-01  JF Bastien  <jfbastien@apple.com>
    217
  • trunk/Source/JavaScriptCore/wasm/WasmIndexOrName.cpp

    r225378 r225416  
    4747{
    4848    if (ion.isEmpty())
    49         return String("wasm-stub");
     49        return ASCIILiteral("wasm-stub");
    5050    const String moduleName = ion.nameSection()->moduleName.size() ? String(ion.nameSection()->moduleName.data(), ion.nameSection()->moduleName.size()) : String(ion.nameSection()->moduleHash.data(), ion.nameSection()->moduleHash.size());
    5151    if (ion.isIndex())
    52         return makeString(moduleName, ".wasm-function[", String::number(ion.m_indexName.index & ~IndexOrName::indexTag), "]");
    53     return makeString(moduleName, ".wasm-function[", String(ion.m_indexName.name->data(), ion.m_indexName.name->size()), "]");
     52        return makeString(moduleName, ".wasm-function[", String::number(ion.m_indexName.index & ~IndexOrName::indexTag), ']');
     53    return makeString(moduleName, ".wasm-function[", String(ion.m_indexName.name->data(), ion.m_indexName.name->size()), ']');
    5454}
    5555
  • trunk/Source/JavaScriptCore/wasm/WasmIndexOrName.h

    r225378 r225416  
    4444    bool isIndex() const { return bitwise_cast<Index>(m_indexName) & indexTag; }
    4545    bool isName() const { return !(isEmpty() || isName()); }
    46     NameSection* nameSection() const { return m_nameSection ? m_nameSection.get() : nullptr; }
     46    NameSection* nameSection() const { return m_nameSection.get(); }
    4747
    4848    friend String makeString(const IndexOrName&);
  • trunk/Source/JavaScriptCore/wasm/WasmNameSection.h

    r225378 r225416  
    2727
    2828#include "WasmName.h"
     29#include <wtf/Noncopyable.h>
    2930#include <wtf/text/CString.h>
    3031#include <wtf/ThreadSafeRefCounted.h>
     
    3536
    3637struct NameSection : public ThreadSafeRefCounted<NameSection> {
     38    WTF_MAKE_NONCOPYABLE(NameSection);
     39
     40public:
    3741    NameSection(const CString &hash)
    3842        : moduleHash(hash.length())
     
    4145            moduleHash[i] = static_cast<uint8_t>(*(hash.data() + i));
    4246    }
    43     NameSection(const NameSection&) = delete;
    4447
    4548    std::pair<const Name*, RefPtr<NameSection>> get(size_t functionIndexSpace)
    4649    {
    47         return std::make_pair(functionIndexSpace < functionNames.size() ? &functionNames[functionIndexSpace] : nullptr, RefPtr<NameSection>(this));
     50        return std::make_pair(functionIndexSpace < functionNames.size() ? &functionNames[functionIndexSpace] : nullptr, makeRefPtr(this));
    4851    }
    4952    Name moduleName;
Note: See TracChangeset for help on using the changeset viewer.