Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (253074 => 253075)
--- trunk/Source/_javascript_Core/ChangeLog 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/ChangeLog 2019-12-04 01:42:51 UTC (rev 253075)
@@ -1,5 +1,57 @@
2019-12-03 Yusuke Suzuki <[email protected]>
+ [JSC] Remove WebAssemblyToJSCallee
+ https://bugs.webkit.org/show_bug.cgi?id=204808
+
+ Reviewed by Tadeu Zagallo.
+
+ This patch drops WebAssemblyToJSCallee. It was originally required to put small cell to retrieve VM from callee.
+ But now this limitation is removed. We can just put JSWebAssemblyModule in callee place instead.
+
+ * _javascript_Core.xcodeproj/project.pbxproj:
+ * Sources.txt:
+ * interpreter/CallFrame.cpp:
+ (JSC::CallFrame::isAnyWasmCallee):
+ * interpreter/StackVisitor.cpp:
+ (JSC::StackVisitor::Frame::calleeSaveRegistersForUnwinding):
+ * jit/Repatch.cpp:
+ (JSC::webAssemblyOwner):
+ (JSC::linkFor):
+ (JSC::linkPolymorphicCall):
+ * runtime/JSCast.h:
+ * runtime/JSCell.cpp:
+ * runtime/JSCellInlines.h:
+ (JSC::isWebAssemblyModule):
+ (JSC::isWebAssemblyToJSCallee): Deleted.
+ * runtime/JSGlobalObject.cpp:
+ (JSC::JSGlobalObject::init):
+ (JSC::JSGlobalObject::visitChildren):
+ * runtime/JSGlobalObject.h:
+ (JSC::JSGlobalObject::webAssemblyWrapperFunctionStructure const):
+ (JSC::JSGlobalObject::webAssemblyToJSCalleeStructure const): Deleted.
+ * runtime/JSType.cpp:
+ (WTF::printInternal):
+ * runtime/JSType.h:
+ * wasm/WasmOperations.cpp:
+ (JSC::Wasm::operationWasmToJSException):
+ * wasm/js/JSWebAssemblyInstance.cpp:
+ (JSC::JSWebAssemblyInstance::finishCreation):
+ (JSC::JSWebAssemblyInstance::visitChildren):
+ * wasm/js/JSWebAssemblyInstance.h:
+ * wasm/js/JSWebAssemblyModule.cpp:
+ (JSC::JSWebAssemblyModule::createStructure):
+ (JSC::JSWebAssemblyModule::finishCreation):
+ (JSC::JSWebAssemblyModule::visitChildren):
+ (JSC::JSWebAssemblyModule::callee const): Deleted.
+ * wasm/js/JSWebAssemblyModule.h:
+ * wasm/js/WasmToJS.cpp:
+ (JSC::Wasm::handleBadI64Use):
+ (JSC::Wasm::wasmToJS):
+ * wasm/js/WebAssemblyToJSCallee.cpp: Removed.
+ * wasm/js/WebAssemblyToJSCallee.h: Removed.
+
+2019-12-03 Yusuke Suzuki <[email protected]>
+
Adopt the new WebAssembly.Global system
https://bugs.webkit.org/show_bug.cgi?id=186552
Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (253074 => 253075)
--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2019-12-04 01:42:51 UTC (rev 253075)
@@ -1610,7 +1610,6 @@
AD86A93E1AA4D88D002FE77F /* WeakGCMapInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = AD86A93D1AA4D87C002FE77F /* WeakGCMapInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
AD8FF3981EB5BDB20087FF82 /* WasmIndexOrName.h in Headers */ = {isa = PBXBuildFile; fileRef = AD8FF3951EB5BD850087FF82 /* WasmIndexOrName.h */; settings = {ATTRIBUTES = (Private, ); }; };
AD9E852F1E8A0C7C008DE39E /* JSWebAssemblyCodeBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = AD9E852E1E8A0C6E008DE39E /* JSWebAssemblyCodeBlock.h */; settings = {ATTRIBUTES = (Private, ); }; };
- ADBC54D51DF8EA2B005BF738 /* WebAssemblyToJSCallee.h in Headers */ = {isa = PBXBuildFile; fileRef = ADBC54D31DF8EA00005BF738 /* WebAssemblyToJSCallee.h */; };
ADD8FA461EB3079700DF542F /* WasmNameSectionParser.h in Headers */ = {isa = PBXBuildFile; fileRef = ADD8FA431EB3077100DF542F /* WasmNameSectionParser.h */; };
ADE802991E08F1DE0058DE78 /* JSWebAssemblyLinkError.h in Headers */ = {isa = PBXBuildFile; fileRef = ADE802941E08F1C90058DE78 /* JSWebAssemblyLinkError.h */; settings = {ATTRIBUTES = (Private, ); }; };
ADE8029A1E08F1DE0058DE78 /* WebAssemblyLinkErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = ADE802951E08F1C90058DE78 /* WebAssemblyLinkErrorConstructor.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -4685,8 +4684,6 @@
AD8FF3961EB5BD850087FF82 /* WasmIndexOrName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WasmIndexOrName.cpp; sourceTree = "<group>"; };
AD9E852E1E8A0C6E008DE39E /* JSWebAssemblyCodeBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSWebAssemblyCodeBlock.h; path = js/JSWebAssemblyCodeBlock.h; sourceTree = "<group>"; };
ADB6F67C1E15D7500082F384 /* WasmPageCount.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WasmPageCount.cpp; sourceTree = "<group>"; };
- ADBC54D21DF8EA00005BF738 /* WebAssemblyToJSCallee.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyToJSCallee.cpp; path = js/WebAssemblyToJSCallee.cpp; sourceTree = "<group>"; };
- ADBC54D31DF8EA00005BF738 /* WebAssemblyToJSCallee.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyToJSCallee.h; path = js/WebAssemblyToJSCallee.h; sourceTree = "<group>"; };
ADD09AEE1F5F623F001313C2 /* WasmToJS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WasmToJS.h; path = js/WasmToJS.h; sourceTree = "<group>"; };
ADD09AEF1F5F623F001313C2 /* WasmToJS.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = WasmToJS.cpp; path = js/WasmToJS.cpp; sourceTree = "<group>"; };
ADD09AF21F624829001313C2 /* JSWebAssembly.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = JSWebAssembly.cpp; path = js/JSWebAssembly.cpp; sourceTree = "<group>"; };
@@ -8682,8 +8679,6 @@
AD2FCBC11DB58DA400B3E736 /* WebAssemblyTableConstructor.h */,
AD2FCBC21DB58DA400B3E736 /* WebAssemblyTablePrototype.cpp */,
AD2FCBC31DB58DA400B3E736 /* WebAssemblyTablePrototype.h */,
- ADBC54D21DF8EA00005BF738 /* WebAssemblyToJSCallee.cpp */,
- ADBC54D31DF8EA00005BF738 /* WebAssemblyToJSCallee.h */,
52F6C35B1E71EB080081F4CC /* WebAssemblyWrapperFunction.cpp */,
52F6C35C1E71EB080081F4CC /* WebAssemblyWrapperFunction.h */,
);
@@ -10353,7 +10348,6 @@
AD2FCC201DB59CB200B3E736 /* WebAssemblyTableConstructor.lut.h in Headers */,
AD2FCBFF1DB58DAD00B3E736 /* WebAssemblyTablePrototype.h in Headers */,
AD2FCC211DB59CB200B3E736 /* WebAssemblyTablePrototype.lut.h in Headers */,
- ADBC54D51DF8EA2B005BF738 /* WebAssemblyToJSCallee.h in Headers */,
52F6C35E1E71EB080081F4CC /* WebAssemblyWrapperFunction.h in Headers */,
BC18C47A0E16F5CD00B34460 /* WebKitAvailability.h in Headers */,
99DA00A61BD5993100F4575C /* wkbuiltins.py in Headers */,
Modified: trunk/Source/_javascript_Core/Sources.txt (253074 => 253075)
--- trunk/Source/_javascript_Core/Sources.txt 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/Sources.txt 2019-12-04 01:42:51 UTC (rev 253075)
@@ -1074,7 +1074,6 @@
wasm/js/WebAssemblyRuntimeErrorPrototype.cpp
wasm/js/WebAssemblyTableConstructor.cpp
wasm/js/WebAssemblyTablePrototype.cpp
-wasm/js/WebAssemblyToJSCallee.cpp
wasm/js/WebAssemblyWrapperFunction.cpp
yarr/RegularExpression.cpp
Modified: trunk/Source/_javascript_Core/interpreter/CallFrame.cpp (253074 => 253075)
--- trunk/Source/_javascript_Core/interpreter/CallFrame.cpp 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/interpreter/CallFrame.cpp 2019-12-04 01:42:51 UTC (rev 253075)
@@ -197,7 +197,7 @@
return true;
ASSERT(callee.isCell());
- if (!!callee.rawPtr() && isWebAssemblyToJSCallee(callee.asCell()))
+ if (!!callee.rawPtr() && isWebAssemblyModule(callee.asCell()))
return true;
return false;
Modified: trunk/Source/_javascript_Core/interpreter/StackVisitor.cpp (253074 => 253075)
--- trunk/Source/_javascript_Core/interpreter/StackVisitor.cpp 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/interpreter/StackVisitor.cpp 2019-12-04 01:42:51 UTC (rev 253075)
@@ -264,7 +264,7 @@
#if ENABLE(WEBASSEMBLY)
if (isWasmFrame()) {
if (callee().isCell()) {
- RELEASE_ASSERT(isWebAssemblyToJSCallee(callee().asCell()));
+ RELEASE_ASSERT(isWebAssemblyModule(callee().asCell()));
return WTF::nullopt;
}
Wasm::Callee* wasmCallee = callee().asWasmCallee();
Modified: trunk/Source/_javascript_Core/jit/Repatch.cpp (253074 => 253075)
--- trunk/Source/_javascript_Core/jit/Repatch.cpp 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/jit/Repatch.cpp 2019-12-04 01:42:51 UTC (rev 253075)
@@ -64,7 +64,6 @@
#include "SuperSampler.h"
#include "ThunkGenerators.h"
#include "WebAssemblyFunction.h"
-#include "WebAssemblyToJSCallee.h"
#include <wtf/CommaPrinter.h>
#include <wtf/ListDump.h>
#include <wtf/StringPrintStream.h>
@@ -921,7 +920,7 @@
{
#if ENABLE(WEBASSEMBLY)
// Each WebAssembly.Instance shares the stubs from their WebAssembly.Module, which are therefore the appropriate owner.
- return jsCast<WebAssemblyToJSCallee*>(callee)->module();
+ return jsCast<JSWebAssemblyModule*>(callee);
#else
UNUSED_PARAM(callee);
RELEASE_ASSERT_NOT_REACHED();
@@ -943,7 +942,7 @@
CodeBlock* callerCodeBlock = callerFrame->codeBlock();
// WebAssembly -> JS stubs don't have a valid CodeBlock.
- JSCell* owner = isWebAssemblyToJSCallee(callerFrame->callee().asCell()) ? webAssemblyOwner(callerFrame->callee().asCell()) : callerCodeBlock;
+ JSCell* owner = isWebAssemblyModule(callerFrame->callee().asCell()) ? webAssemblyOwner(callerFrame->callee().asCell()) : callerCodeBlock;
ASSERT(owner);
ASSERT(!callLinkInfo.isLinked());
@@ -1074,7 +1073,7 @@
ASSERT(callerFrame->callee().isCell());
CodeBlock* callerCodeBlock = callerFrame->codeBlock();
- bool isWebAssembly = isWebAssemblyToJSCallee(callerFrame->callee().asCell());
+ bool isWebAssembly = isWebAssemblyModule(callerFrame->callee().asCell());
// WebAssembly -> JS stubs don't have a valid CodeBlock.
JSCell* owner = isWebAssembly ? webAssemblyOwner(callerFrame->callee().asCell()) : callerCodeBlock;
Modified: trunk/Source/_javascript_Core/runtime/JSCast.h (253074 => 253075)
--- trunk/Source/_javascript_Core/runtime/JSCast.h 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/runtime/JSCast.h 2019-12-04 01:42:51 UTC (rev 253075)
@@ -63,7 +63,7 @@
macro(NumberObject, JSType::NumberObjectType, JSType::NumberObjectType) \
macro(ProxyObject, JSType::ProxyObjectType, JSType::ProxyObjectType) \
macro(RegExpObject, JSType::RegExpObjectType, JSType::RegExpObjectType) \
- macro(WebAssemblyToJSCallee, JSType::WebAssemblyToJSCalleeType, JSType::WebAssemblyToJSCalleeType) \
+ macro(JSWebAssemblyModule, JSType::WebAssemblyModuleType, JSType::WebAssemblyModuleType) \
macro(DirectArguments, JSType::DirectArgumentsType, JSType::DirectArgumentsType) \
macro(ScopedArguments, JSType::ScopedArgumentsType, JSType::ScopedArgumentsType) \
macro(ClonedArguments, JSType::ClonedArgumentsType, JSType::ClonedArgumentsType) \
Modified: trunk/Source/_javascript_Core/runtime/JSCell.cpp (253074 => 253075)
--- trunk/Source/_javascript_Core/runtime/JSCell.cpp 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/runtime/JSCell.cpp 2019-12-04 01:42:51 UTC (rev 253075)
@@ -30,7 +30,6 @@
#include "JSString.h"
#include "JSObject.h"
#include "NumberObject.h"
-#include "WebAssemblyToJSCallee.h"
#include <wtf/LockAlgorithmInlines.h>
#include <wtf/MathExtras.h>
Modified: trunk/Source/_javascript_Core/runtime/JSCellInlines.h (253074 => 253075)
--- trunk/Source/_javascript_Core/runtime/JSCellInlines.h 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/runtime/JSCellInlines.h 2019-12-04 01:42:51 UTC (rev 253075)
@@ -422,9 +422,9 @@
return putMethod(this, globalObject, propertyName, value, slot);
}
-inline bool isWebAssemblyToJSCallee(const JSCell* cell)
+inline bool isWebAssemblyModule(const JSCell* cell)
{
- return cell->type() == WebAssemblyToJSCalleeType;
+ return cell->type() == WebAssemblyModuleType;
}
} // namespace JSC
Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp (253074 => 253075)
--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp 2019-12-04 01:42:51 UTC (rev 253075)
@@ -205,7 +205,6 @@
#include "WebAssemblyRuntimeErrorPrototype.h"
#include "WebAssemblyTableConstructor.h"
#include "WebAssemblyTablePrototype.h"
-#include "WebAssemblyToJSCallee.h"
#include <wtf/RandomNumber.h>
#if ENABLE(INTL)
@@ -1195,10 +1194,6 @@
[] (const Initializer<Structure>& init) {
init.set(WebAssemblyWrapperFunction::createStructure(init.vm, init.owner, init.owner->m_functionPrototype.get()));
});
- m_webAssemblyToJSCalleeStructure.initLater(
- [] (const Initializer<Structure>& init) {
- init.set(WebAssemblyToJSCallee::createStructure(init.vm, init.owner, jsNull()));
- });
auto* webAssembly = JSWebAssembly::create(vm, this, JSWebAssembly::createStructure(vm, this, m_objectPrototype.get()));
putDirectWithoutTransition(vm, Identifier::fromString(vm, "WebAssembly"), webAssembly, static_cast<unsigned>(PropertyAttribute::DontEnum));
@@ -1850,7 +1845,6 @@
thisObject->m_webAssemblyFunctionStructure.visit(visitor);
thisObject->m_jsToWasmICCalleeStructure.visit(visitor);
thisObject->m_webAssemblyWrapperFunctionStructure.visit(visitor);
- thisObject->m_webAssemblyToJSCalleeStructure.visit(visitor);
FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(VISIT_LAZY_TYPE)
#endif // ENABLE(WEBASSEMBLY)
Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.h (253074 => 253075)
--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.h 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.h 2019-12-04 01:42:51 UTC (rev 253075)
@@ -402,7 +402,6 @@
LazyProperty<JSGlobalObject, Structure> m_webAssemblyFunctionStructure;
LazyProperty<JSGlobalObject, Structure> m_jsToWasmICCalleeStructure;
LazyProperty<JSGlobalObject, Structure> m_webAssemblyWrapperFunctionStructure;
- LazyProperty<JSGlobalObject, Structure> m_webAssemblyToJSCalleeStructure;
FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(DEFINE_STORAGE_FOR_LAZY_TYPE)
#endif // ENABLE(WEBASSEMBLY)
@@ -766,7 +765,6 @@
Structure* webAssemblyFunctionStructure() const { return m_webAssemblyFunctionStructure.get(this); }
Structure* jsToWasmICCalleeStructure() const { return m_jsToWasmICCalleeStructure.get(this); }
Structure* webAssemblyWrapperFunctionStructure() const { return m_webAssemblyWrapperFunctionStructure.get(this); }
- Structure* webAssemblyToJSCalleeStructure() const { return m_webAssemblyToJSCalleeStructure.get(this); }
#endif // ENABLE(WEBASSEMBLY)
#if ENABLE(INTL)
Structure* collatorStructure() { return m_collatorStructure.get(this); }
Modified: trunk/Source/_javascript_Core/runtime/JSType.cpp (253074 => 253075)
--- trunk/Source/_javascript_Core/runtime/JSType.cpp 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/runtime/JSType.cpp 2019-12-04 01:42:51 UTC (rev 253075)
@@ -105,7 +105,7 @@
CASE(JSSetType)
CASE(JSWeakMapType)
CASE(JSWeakSetType)
- CASE(WebAssemblyToJSCalleeType)
+ CASE(WebAssemblyModuleType)
CASE(StringObjectType)
CASE(MaxJSType)
}
Modified: trunk/Source/_javascript_Core/runtime/JSType.h (253074 => 253075)
--- trunk/Source/_javascript_Core/runtime/JSType.h 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/runtime/JSType.h 2019-12-04 01:42:51 UTC (rev 253075)
@@ -116,7 +116,7 @@
JSSetType,
JSWeakMapType,
JSWeakSetType,
- WebAssemblyToJSCalleeType,
+ WebAssemblyModuleType,
StringObjectType,
LastJSCObjectType = StringObjectType, // This is the last "JSC" Object type. After this, we have embedder's (e.g., WebCore) extended object types.
Modified: trunk/Source/_javascript_Core/wasm/WasmOperations.cpp (253074 => 253075)
--- trunk/Source/_javascript_Core/wasm/WasmOperations.cpp 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/wasm/WasmOperations.cpp 2019-12-04 01:42:51 UTC (rev 253075)
@@ -743,7 +743,7 @@
// for exceptions first load callFrameForCatch info call frame register before jumping
// to the exception handler. If we did this, we could remove this terrible hack.
// https://bugs.webkit.org/show_bug.cgi?id=170440
- bitwise_cast<uint64_t*>(callFrame)[CallFrameSlot::callee] = bitwise_cast<uint64_t>(instance->webAssemblyToJSCallee());
+ bitwise_cast<uint64_t*>(callFrame)[CallFrameSlot::callee] = bitwise_cast<uint64_t>(instance->module());
return vm.targetMachinePCForThrow;
}
Modified: trunk/Source/_javascript_Core/wasm/js/JSWebAssemblyInstance.cpp (253074 => 253075)
--- trunk/Source/_javascript_Core/wasm/js/JSWebAssemblyInstance.cpp 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/wasm/js/JSWebAssemblyInstance.cpp 2019-12-04 01:42:51 UTC (rev 253075)
@@ -37,7 +37,6 @@
#include "JSWebAssemblyMemory.h"
#include "JSWebAssemblyModule.h"
#include "WebAssemblyModuleRecord.h"
-#include "WebAssemblyToJSCallee.h"
#include <wtf/StdLibExtras.h>
namespace JSC {
@@ -67,7 +66,6 @@
m_module.set(vm, this, module);
m_moduleNamespaceObject.set(vm, this, moduleNamespaceObject);
- m_callee.set(vm, this, module->callee());
vm.heap.reportExtraMemoryAllocated(m_instance->extraMemoryAllocated());
}
@@ -89,7 +87,6 @@
visitor.append(thisObject->m_memory);
for (unsigned i = 0; i < thisObject->instance().module().moduleInformation().tableCount(); ++i)
visitor.append(thisObject->m_tables[i]);
- visitor.append(thisObject->m_callee);
visitor.reportExtraMemoryVisited(thisObject->m_instance->extraMemoryAllocated());
for (unsigned i = 0; i < thisObject->instance().numImportFunctions(); ++i)
visitor.append(*thisObject->instance().importFunction<WriteBarrier<JSObject>>(i)); // This also keeps the functions' JSWebAssemblyInstance alive.
Modified: trunk/Source/_javascript_Core/wasm/js/JSWebAssemblyInstance.h (253074 => 253075)
--- trunk/Source/_javascript_Core/wasm/js/JSWebAssemblyInstance.h 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/wasm/js/JSWebAssemblyInstance.h 2019-12-04 01:42:51 UTC (rev 253075)
@@ -40,7 +40,6 @@
class JSModuleNamespaceObject;
class JSWebAssemblyModule;
-class WebAssemblyToJSCallee;
namespace Wasm {
class CodeBlock;
@@ -61,7 +60,6 @@
Wasm::Instance& instance() { return m_instance.get(); }
JSModuleNamespaceObject* moduleNamespaceObject() { return m_moduleNamespaceObject.get(); }
- WebAssemblyToJSCallee* webAssemblyToJSCallee() { return m_callee.get(); }
JSWebAssemblyMemory* memory() { return m_memory.get(); }
void setMemory(VM& vm, JSWebAssemblyMemory* value) {
@@ -91,8 +89,8 @@
JSWebAssemblyModule* module() const { return m_module.get(); }
static size_t offsetOfInstance() { return OBJECT_OFFSETOF(JSWebAssemblyInstance, m_instance); }
+ static size_t offsetOfModule() { return OBJECT_OFFSETOF(JSWebAssemblyInstance, m_module); }
static size_t offsetOfGlobalObject() { return OBJECT_OFFSETOF(JSWebAssemblyInstance, m_globalObject); }
- static size_t offsetOfCallee() { return OBJECT_OFFSETOF(JSWebAssemblyInstance, m_callee); }
static size_t offsetOfVM() { return OBJECT_OFFSETOF(JSWebAssemblyInstance, m_vm); }
protected:
@@ -111,7 +109,6 @@
WriteBarrier<JSModuleNamespaceObject> m_moduleNamespaceObject;
WriteBarrier<JSWebAssemblyMemory> m_memory;
Vector<WriteBarrier<JSWebAssemblyTable>> m_tables;
- WriteBarrier<WebAssemblyToJSCallee> m_callee;
};
} // namespace JSC
Modified: trunk/Source/_javascript_Core/wasm/js/JSWebAssemblyModule.cpp (253074 => 253075)
--- trunk/Source/_javascript_Core/wasm/js/JSWebAssemblyModule.cpp 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/wasm/js/JSWebAssemblyModule.cpp 2019-12-04 01:42:51 UTC (rev 253075)
@@ -37,7 +37,6 @@
#include "WasmMemory.h"
#include "WasmModule.h"
#include "WasmPlan.h"
-#include "WebAssemblyToJSCallee.h"
#include <wtf/StdLibExtras.h>
namespace JSC {
@@ -61,7 +60,7 @@
Structure* JSWebAssemblyModule::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
{
- return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+ return Structure::create(vm, globalObject, prototype, TypeInfo(WebAssemblyModuleType, StructureFlags), info());
}
@@ -86,7 +85,6 @@
}
m_exportSymbolTable.set(vm, this, exportSymbolTable);
- m_callee.set(vm, this, WebAssemblyToJSCallee::create(vm, globalObject(vm)->webAssemblyToJSCalleeStructure(), this));
}
void JSWebAssemblyModule::destroy(JSCell* cell)
@@ -110,11 +108,6 @@
return m_module->signatureIndexFromFunctionIndexSpace(functionIndexSpace);
}
-WebAssemblyToJSCallee* JSWebAssemblyModule::callee() const
-{
- return m_callee.get();
-}
-
JSWebAssemblyCodeBlock* JSWebAssemblyModule::codeBlock(Wasm::MemoryMode mode)
{
return m_codeBlocks[static_cast<size_t>(mode)].get();
@@ -137,7 +130,6 @@
Base::visitChildren(thisObject, visitor);
visitor.append(thisObject->m_exportSymbolTable);
- visitor.append(thisObject->m_callee);
for (unsigned i = 0; i < Wasm::NumberOfMemoryModes; ++i)
visitor.append(thisObject->m_codeBlocks[i]);
}
Modified: trunk/Source/_javascript_Core/wasm/js/JSWebAssemblyModule.h (253074 => 253075)
--- trunk/Source/_javascript_Core/wasm/js/JSWebAssemblyModule.h 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/wasm/js/JSWebAssemblyModule.h 2019-12-04 01:42:51 UTC (rev 253075)
@@ -48,7 +48,6 @@
class SymbolTable;
class JSWebAssemblyCodeBlock;
class JSWebAssemblyMemory;
-class WebAssemblyToJSCallee;
class JSWebAssemblyModule final : public JSDestructibleObject {
public:
@@ -62,7 +61,6 @@
const Wasm::ModuleInformation& moduleInformation() const;
SymbolTable* exportSymbolTable() const;
Wasm::SignatureIndex signatureIndexFromFunctionIndexSpace(unsigned functionIndexSpace) const;
- WebAssemblyToJSCallee* callee() const;
JSWebAssemblyCodeBlock* codeBlock(Wasm::MemoryMode mode);
void setCodeBlock(VM&, Wasm::MemoryMode, JSWebAssemblyCodeBlock*);
@@ -80,7 +78,6 @@
Ref<Wasm::Module> m_module;
WriteBarrier<SymbolTable> m_exportSymbolTable;
WriteBarrier<JSWebAssemblyCodeBlock> m_codeBlocks[Wasm::NumberOfMemoryModes];
- WriteBarrier<WebAssemblyToJSCallee> m_callee;
};
} // namespace JSC
Modified: trunk/Source/_javascript_Core/wasm/js/WasmToJS.cpp (253074 => 253075)
--- trunk/Source/_javascript_Core/wasm/js/WasmToJS.cpp 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/wasm/js/WasmToJS.cpp 2019-12-04 01:42:51 UTC (rev 253075)
@@ -67,7 +67,7 @@
// Store Callee.
jit.loadPtr(CCallHelpers::Address(GPRInfo::argumentGPR0, Instance::offsetOfOwner()), GPRInfo::argumentGPR0);
- jit.loadPtr(CCallHelpers::Address(GPRInfo::argumentGPR0, JSWebAssemblyInstance::offsetOfCallee()), GPRInfo::argumentGPR1);
+ jit.loadPtr(CCallHelpers::Address(GPRInfo::argumentGPR0, JSWebAssemblyInstance::offsetOfModule()), GPRInfo::argumentGPR1);
jit.prepareCallOperation(vm);
jit.storePtr(GPRInfo::argumentGPR1, JIT::Address(GPRInfo::callFrameRegister, CallFrameSlot::callee * static_cast<int>(sizeof(Register))));
@@ -254,7 +254,7 @@
jit.loadWasmContextInstance(GPRInfo::argumentGPR0);
jit.loadPtr(CCallHelpers::Address(GPRInfo::argumentGPR0, Instance::offsetOfOwner()), GPRInfo::argumentGPR0);
- jit.loadPtr(CCallHelpers::Address(GPRInfo::argumentGPR0, JSWebAssemblyInstance::offsetOfCallee()), GPRInfo::argumentGPR0);
+ jit.loadPtr(CCallHelpers::Address(GPRInfo::argumentGPR0, JSWebAssemblyInstance::offsetOfModule()), GPRInfo::argumentGPR0);
jit.storePtr(GPRInfo::argumentGPR0, JIT::Address(GPRInfo::callFrameRegister, CallFrameSlot::callee * static_cast<int>(sizeof(Register))));
GPRReg importJSCellGPRReg = GPRInfo::regT0; // Callee needs to be in regT0 for slow path below.
Deleted: trunk/Source/_javascript_Core/wasm/js/WebAssemblyToJSCallee.cpp (253074 => 253075)
--- trunk/Source/_javascript_Core/wasm/js/WebAssemblyToJSCallee.cpp 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/wasm/js/WebAssemblyToJSCallee.cpp 2019-12-04 01:42:51 UTC (rev 253075)
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WebAssemblyToJSCallee.h"
-
-#if ENABLE(WEBASSEMBLY)
-
-#include "JSCInlines.h"
-#include "JSWebAssemblyModule.h"
-
-namespace JSC {
-
-const ClassInfo WebAssemblyToJSCallee::s_info = { "WebAssemblyToJSCallee", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(WebAssemblyToJSCallee) };
-
-WebAssemblyToJSCallee* WebAssemblyToJSCallee::create(VM& vm, Structure* structure, JSWebAssemblyModule* module)
-{
- WebAssemblyToJSCallee* callee = new (NotNull, allocateCell<WebAssemblyToJSCallee>(vm.heap)) WebAssemblyToJSCallee(vm, structure);
- callee->finishCreation(vm, module);
- return callee;
-}
-
-Structure* WebAssemblyToJSCallee::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
-{
- return Structure::create(vm, globalObject, prototype, TypeInfo(WebAssemblyToJSCalleeType, StructureFlags), info());
-}
-
-WebAssemblyToJSCallee::WebAssemblyToJSCallee(VM& vm, Structure* structure)
- : Base(vm, structure)
-{
-}
-
-void WebAssemblyToJSCallee::finishCreation(VM& vm, JSWebAssemblyModule* module)
-{
- Base::finishCreation(vm);
- m_module.set(vm, this, module);
-}
-
-void WebAssemblyToJSCallee::visitChildren(JSCell* cell, SlotVisitor& visitor)
-{
- auto* thisObject = jsCast<WebAssemblyToJSCallee*>(cell);
- ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-
- Base::visitChildren(thisObject, visitor);
- visitor.append(thisObject->m_module);
-}
-
-} // namespace JSC
-
-#endif // ENABLE(WEBASSEMBLY)
Deleted: trunk/Source/_javascript_Core/wasm/js/WebAssemblyToJSCallee.h (253074 => 253075)
--- trunk/Source/_javascript_Core/wasm/js/WebAssemblyToJSCallee.h 2019-12-04 01:36:56 UTC (rev 253074)
+++ trunk/Source/_javascript_Core/wasm/js/WebAssemblyToJSCallee.h 2019-12-04 01:42:51 UTC (rev 253075)
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if ENABLE(WEBASSEMBLY)
-
-#include "JSObject.h"
-
-namespace JSC {
-
-class JSWebAssemblyModule;
-
-class WebAssemblyToJSCallee final : public JSNonFinalObject {
-public:
- using Base = JSNonFinalObject;
- static constexpr unsigned StructureFlags = Base::StructureFlags;
-
- static WebAssemblyToJSCallee* create(VM&, Structure*, JSWebAssemblyModule*);
- static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
-
- DECLARE_EXPORT_INFO;
-
- static void visitChildren(JSCell*, SlotVisitor&);
-
- JSWebAssemblyModule* module() { return m_module.get(); }
-
-private:
- void finishCreation(VM&, JSWebAssemblyModule*);
- WebAssemblyToJSCallee(VM&, Structure*);
-
- WriteBarrier<JSWebAssemblyModule> m_module;
-};
-
-} // namespace JSC
-
-#endif // ENABLE(WEBASSEMBLY)