WebAssembly: Wasm::IndexOrName has a raw pointer to Name
authorjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Nov 2017 06:15:59 +0000 (06:15 +0000)
committerjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Nov 2017 06:15:59 +0000 (06:15 +0000)
commitdac70893163fed64b65c3d8ba6ff5dbdfb097828
treed47083f56c678fd42c27318d503315def9703c6e
parentcdf23c7821e2532ec8326aece221815add1e4ca8
WebAssembly: Wasm::IndexOrName has a raw pointer to Name
https://bugs.webkit.org/show_bug.cgi?id=176644

Reviewed by Michael Saboff.

IndexOrName now keeps a RefPtr to its original NameSection, which
holds the Name (or references nullptr if Index). Holding onto the
entire section seems like the better thing to do, since backtraces
probably contain multiple names from the same Module.

* JavaScriptCore.xcodeproj/project.pbxproj:
* interpreter/Interpreter.cpp:
(JSC::GetStackTraceFunctor::operator() const):
* interpreter/StackVisitor.h: Frame is no longer POD because of the
RefPtr.
* runtime/StackFrame.cpp:
(JSC::StackFrame::StackFrame):
* runtime/StackFrame.h: Drop the union, size is now 40 bytes.
(JSC::StackFrame::StackFrame): Deleted. Initialized in class instead.
(JSC::StackFrame::wasm): Deleted. Make it a ctor instead.
* wasm/WasmBBQPlanInlines.h:
(JSC::Wasm::BBQPlan::initializeCallees):
* wasm/WasmCallee.cpp:
(JSC::Wasm::Callee::Callee):
* wasm/WasmCallee.h:
(JSC::Wasm::Callee::create):
* wasm/WasmFormat.h: Move NameSection to its own header.
(JSC::Wasm::isValidNameType):
(JSC::Wasm::NameSection::get): Deleted.
* wasm/WasmIndexOrName.cpp:
(JSC::Wasm::IndexOrName::IndexOrName):
(JSC::Wasm::makeString):
* wasm/WasmIndexOrName.h:
(JSC::Wasm::IndexOrName::IndexOrName):
(JSC::Wasm::IndexOrName::isEmpty const):
(JSC::Wasm::IndexOrName::isIndex const):
* wasm/WasmModuleInformation.cpp:
(JSC::Wasm::ModuleInformation::ModuleInformation):
* wasm/WasmModuleInformation.h:
(JSC::Wasm::ModuleInformation::ModuleInformation): Deleted.
* wasm/WasmNameSection.h:
(JSC::Wasm::NameSection::get):
(JSC::Wasm::NameSection::create): Deleted.
* wasm/WasmNameSectionParser.cpp:
(JSC::Wasm::NameSectionParser::parse):
* wasm/WasmNameSectionParser.h:
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::work):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224272 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/interpreter/Interpreter.cpp
Source/JavaScriptCore/interpreter/StackVisitor.h
Source/JavaScriptCore/runtime/StackFrame.cpp
Source/JavaScriptCore/runtime/StackFrame.h
Source/JavaScriptCore/wasm/WasmBBQPlanInlines.h
Source/JavaScriptCore/wasm/WasmCallee.cpp
Source/JavaScriptCore/wasm/WasmCallee.h
Source/JavaScriptCore/wasm/WasmFormat.h
Source/JavaScriptCore/wasm/WasmIndexOrName.cpp
Source/JavaScriptCore/wasm/WasmIndexOrName.h
Source/JavaScriptCore/wasm/WasmModuleInformation.cpp
Source/JavaScriptCore/wasm/WasmModuleInformation.h
Source/JavaScriptCore/wasm/WasmNameSection.h
Source/JavaScriptCore/wasm/WasmNameSectionParser.cpp
Source/JavaScriptCore/wasm/WasmNameSectionParser.h
Source/JavaScriptCore/wasm/WasmOMGPlan.cpp