MCPcopy Create free account
hub / github.com/Snapchat/Valdi / toJSForGC

Function toJSForGC

third-party/jscore/include/JavaScriptCore/APICast.h:91–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91inline JSC::JSValue toJSForGC(JSC::ExecState* exec, JSValueRef v)
92{
93 ASSERT_UNUSED(exec, exec);
94#if USE(JSVALUE32_64)
95 JSC::JSCell* jsCell = reinterpret_cast<JSC::JSCell*>(const_cast<OpaqueJSValue*>(v));
96 if (!jsCell)
97 return JSC::JSValue();
98 JSC::JSValue result = jsCell;
99#else
100 JSC::JSValue result = JSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(const_cast<OpaqueJSValue*>(v)));
101#endif
102 if (result && result.isCell())
103 RELEASE_ASSERT(result.asCell()->methodTable(exec->vm()));
104 return result;
105}
106
107// Used in JSObjectGetPrivate as that may be called during finalization
108inline JSC::JSObject* uncheckedToJS(JSObjectRef o)

Callers

nothing calls this directly

Calls 2

decodeFunction · 0.85
JSValueClass · 0.70

Tested by

no test coverage detected