Changeset 223274 in webkit for trunk/Source/JavaScriptCore
- Timestamp:
- Oct 12, 2017, 7:13:20 PM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r223248 r223274 1 2017-10-12 Yusuke Suzuki <[email protected]> 2 3 WebAssembly: Wasm functions should have either JSFunctionType or TypeOfShouldCallGetCallData 4 https://bugs.webkit.org/show_bug.cgi?id=178210 5 6 Reviewed by Saam Barati. 7 8 In Wasm, we have two JS functions exposed to users: WebAssemblyFunction and WebAssemblyWrapperFunction. 9 The former is an exported wasm function and the latter is an imported & exported function. Since they 10 have [[Call]], they should be categorized into "function" in typeof operation. 11 12 However, these functions do not implement our function protocol correctly. They inherit JSFunction. 13 But JSType of WebAssemblyFunction is WebAssemblyFunctionType, and one of WebAssemblyWrapperFunction is 14 ObjectType. Since both do not have TypeOfShouldCallGetCallData, they return "object" when performing 15 typeof operation. 16 17 In this patch, we address the above issue by the following 2 fixes. 18 19 1. We add TypeOfShouldCallGetCallData to WebAssemblyFunction. This is the same way how we implement 20 InternalFunction. Since WebAssemblyFunction requires WebAssemblyFunctionType for fast checking in Wasm 21 implementation, we cannot make this JSFunctionType. 22 23 2. On the other hand, WebAssemblyWrapperFunction does not require a specific JSType. So this patch 24 changes JSType of WebAssemblyWrapperFunction to JSFunctionType. JSFunctionType can be usable for derived 25 classes of JSFunction (e.g. JSCustomGetterSetterFunction). 26 27 * wasm/js/WebAssemblyFunction.h: 28 (JSC::WebAssemblyFunction::signatureIndex const): Deleted. 29 (JSC::WebAssemblyFunction::wasmEntrypointLoadLocation const): Deleted. 30 (JSC::WebAssemblyFunction::callableFunction const): Deleted. 31 (JSC::WebAssemblyFunction::jsEntrypoint): Deleted. 32 (JSC::WebAssemblyFunction::offsetOfWasmEntrypointLoadLocation): Deleted. 33 * wasm/js/WebAssemblyWrapperFunction.cpp: 34 (JSC::WebAssemblyWrapperFunction::createStructure): 35 * wasm/js/WebAssemblyWrapperFunction.h: 36 (JSC::WebAssemblyWrapperFunction::signatureIndex const): Deleted. 37 (JSC::WebAssemblyWrapperFunction::wasmEntrypointLoadLocation const): Deleted. 38 (JSC::WebAssemblyWrapperFunction::callableFunction const): Deleted. 39 (JSC::WebAssemblyWrapperFunction::function): Deleted. 40 1 41 2017-10-12 Per Arne Vollan <[email protected]> 2 42 -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.h
r217645 r223274 42 42 } 43 43 44 class WebAssemblyFunction : public WebAssemblyFunctionBase {44 class WebAssemblyFunction final : public WebAssemblyFunctionBase { 45 45 public: 46 46 using Base = WebAssemblyFunctionBase; 47 47 48 const static unsigned StructureFlags = Base::StructureFlags ;48 const static unsigned StructureFlags = Base::StructureFlags | TypeOfShouldCallGetCallData; 49 49 50 50 DECLARE_EXPORT_INFO; -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyWrapperFunction.cpp
r223002 r223274 80 80 { 81 81 ASSERT(globalObject); 82 return Structure::create(vm, globalObject, prototype, TypeInfo( ObjectType, StructureFlags), info());82 return Structure::create(vm, globalObject, prototype, TypeInfo(JSFunctionType, StructureFlags), info()); 83 83 } 84 84 -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyWrapperFunction.h
r217017 r223274 33 33 namespace JSC { 34 34 35 class WebAssemblyWrapperFunction : public WebAssemblyFunctionBase {35 class WebAssemblyWrapperFunction final : public WebAssemblyFunctionBase { 36 36 public: 37 37 using Base = WebAssemblyFunctionBase;
Note:
See TracChangeset
for help on using the changeset viewer.