BindingAllocs.h (1070B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 * vim: set ts=8 sts=2 et sw=2 tw=80: 3 * This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 /* 8 * Special allocation functions for DOM binding code. 9 * 10 */ 11 12 #ifndef js_experimental_BindingAllocs_h 13 #define js_experimental_BindingAllocs_h 14 15 #include "jstypes.h" 16 17 /** 18 * Unlike JS_NewObject, JS_NewObjectWithGivenProtoAndUseAllocSite does not 19 * compute a default proto. If proto is nullptr, the JS object will have `null` 20 * as [[Prototype]]. 21 * 22 * If the JIT code has set an allocation site, this allocation will consume that 23 * allocation site. This only happens for DOM calls with Object return type. 24 * 25 * Must be called with a non-null clasp. 26 * 27 */ 28 extern JS_PUBLIC_API JSObject* JS_NewObjectWithGivenProtoAndUseAllocSite( 29 JSContext* cx, const JSClass* clasp, JS::Handle<JSObject*> proto); 30 31 #endif // js_experimental_BindingAllocs_h