summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/ConstructData.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/runtime/ConstructData.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/JavaScriptCore/runtime/ConstructData.h')
-rw-r--r--Source/JavaScriptCore/runtime/ConstructData.h47
1 files changed, 30 insertions, 17 deletions
diff --git a/Source/JavaScriptCore/runtime/ConstructData.h b/Source/JavaScriptCore/runtime/ConstructData.h
index 10317a2f9..b12a4cfdc 100644
--- a/Source/JavaScriptCore/runtime/ConstructData.h
+++ b/Source/JavaScriptCore/runtime/ConstructData.h
@@ -10,7 +10,7 @@
* 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
@@ -26,27 +26,27 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ConstructData_h
-#define ConstructData_h
+#pragma once
#include "CallData.h"
#include "JSCJSValue.h"
namespace JSC {
- class ArgList;
- class ExecState;
- class FunctionExecutable;
- class JSObject;
- class JSScope;
+class ArgList;
+class ExecState;
+class FunctionExecutable;
+class JSObject;
+class JSScope;
- enum ConstructType {
- ConstructTypeNone,
- ConstructTypeHost,
- ConstructTypeJS
- };
+enum class ConstructType : unsigned {
+ None,
+ Host,
+ JS
+};
- union ConstructData {
+struct ConstructData {
+ union {
struct {
NativeFunction function;
} native;
@@ -55,9 +55,22 @@ namespace JSC {
JSScope* scope;
} js;
};
+};
- JS_EXPORT_PRIVATE JSObject* construct(ExecState*, JSValue constructor, ConstructType, const ConstructData&, const ArgList&);
+// Convenience wrapper so you don't need to deal with CallData and CallType unless you are going to use them.
+JSObject* construct(ExecState*, JSValue functionObject, const ArgList&, const char* errorMessage);
+JS_EXPORT_PRIVATE JSObject* construct(ExecState*, JSValue constructor, ConstructType, const ConstructData&, const ArgList&, JSValue newTarget);
-} // namespace JSC
+ALWAYS_INLINE JSObject* construct(ExecState* exec, JSValue constructorObject, ConstructType constructType, const ConstructData& constructData, const ArgList& args)
+{
+ return construct(exec, constructorObject, constructType, constructData, args, constructorObject);
+}
+
+JS_EXPORT_PRIVATE JSObject* profiledConstruct(ExecState*, ProfilingReason, JSValue constructor, ConstructType, const ConstructData&, const ArgList&, JSValue newTarget);
-#endif // ConstructData_h
+ALWAYS_INLINE JSObject* profiledConstruct(ExecState* exec, ProfilingReason reason, JSValue constructorObject, ConstructType constructType, const ConstructData& constructData, const ArgList& args)
+{
+ return profiledConstruct(exec, reason, constructorObject, constructType, constructData, args, constructorObject);
+}
+
+} // namespace JSC