Changeset 225416 in webkit
- Timestamp:
- Dec 1, 2017 2:19:03 PM (6 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r225411 r225416 1 2017-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 1 16 2017-12-01 JF Bastien <jfbastien@apple.com> 2 17 -
trunk/Source/JavaScriptCore/wasm/WasmIndexOrName.cpp
r225378 r225416 47 47 { 48 48 if (ion.isEmpty()) 49 return String("wasm-stub");49 return ASCIILiteral("wasm-stub"); 50 50 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()); 51 51 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()), ']'); 54 54 } 55 55 -
trunk/Source/JavaScriptCore/wasm/WasmIndexOrName.h
r225378 r225416 44 44 bool isIndex() const { return bitwise_cast<Index>(m_indexName) & indexTag; } 45 45 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(); } 47 47 48 48 friend String makeString(const IndexOrName&); -
trunk/Source/JavaScriptCore/wasm/WasmNameSection.h
r225378 r225416 27 27 28 28 #include "WasmName.h" 29 #include <wtf/Noncopyable.h> 29 30 #include <wtf/text/CString.h> 30 31 #include <wtf/ThreadSafeRefCounted.h> … … 35 36 36 37 struct NameSection : public ThreadSafeRefCounted<NameSection> { 38 WTF_MAKE_NONCOPYABLE(NameSection); 39 40 public: 37 41 NameSection(const CString &hash) 38 42 : moduleHash(hash.length()) … … 41 45 moduleHash[i] = static_cast<uint8_t>(*(hash.data() + i)); 42 46 } 43 NameSection(const NameSection&) = delete;44 47 45 48 std::pair<const Name*, RefPtr<NameSection>> get(size_t functionIndexSpace) 46 49 { 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)); 48 51 } 49 52 Name moduleName;
Note: See TracChangeset
for help on using the changeset viewer.