diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-05-24 08:28:08 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-05-24 08:28:08 +0000 |
commit | a4e969f4965059196ca948db781e52f7cfebf19e (patch) | |
tree | 6ca352808c8fdc52006a0f33f6ae3c593b23867d /Source/JavaScriptCore/runtime/ConstructData.cpp | |
parent | 41386e9cb918eed93b3f13648cbef387e371e451 (diff) | |
download | WebKitGtk-tarball-a4e969f4965059196ca948db781e52f7cfebf19e.tar.gz |
webkitgtk-2.12.3webkitgtk-2.12.3
Diffstat (limited to 'Source/JavaScriptCore/runtime/ConstructData.cpp')
-rw-r--r-- | Source/JavaScriptCore/runtime/ConstructData.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/Source/JavaScriptCore/runtime/ConstructData.cpp b/Source/JavaScriptCore/runtime/ConstructData.cpp index 3dc46180c..0a4eecbff 100644 --- a/Source/JavaScriptCore/runtime/ConstructData.cpp +++ b/Source/JavaScriptCore/runtime/ConstructData.cpp @@ -28,16 +28,34 @@ #include "Executable.h" #include "Interpreter.h" +#include "JSCInlines.h" #include "JSFunction.h" #include "JSGlobalObject.h" -#include "Operations.h" +#include "ScriptProfilingScope.h" namespace JSC { -JSObject* construct(ExecState* exec, JSValue constructorObject, ConstructType constructType, const ConstructData& constructData, const ArgList& args) +JSObject* construct(ExecState* exec, JSValue constructorObject, const ArgList& args, const String& errorMessage) +{ + ConstructData constructData; + ConstructType constructType = getConstructData(constructorObject, constructData); + if (constructType == ConstructTypeNone) + return throwTypeError(exec, errorMessage); + + return construct(exec, constructorObject, constructType, constructData, args, constructorObject); +} + + +JSObject* construct(ExecState* exec, JSValue constructorObject, ConstructType constructType, const ConstructData& constructData, const ArgList& args, JSValue newTarget) { ASSERT(constructType == ConstructTypeJS || constructType == ConstructTypeHost); - return exec->interpreter()->executeConstruct(exec, asObject(constructorObject), constructType, constructData, args); + return exec->interpreter()->executeConstruct(exec, asObject(constructorObject), constructType, constructData, args, newTarget); +} + +JSObject* profiledConstruct(ExecState* exec, ProfilingReason reason, JSValue constructorObject, ConstructType constructType, const ConstructData& constructData, const ArgList& args, JSValue newTarget) +{ + ScriptProfilingScope profilingScope(exec->vmEntryGlobalObject(), reason); + return construct(exec, constructorObject, constructType, constructData, args, newTarget); } } // namespace JSC |