diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-08-11 11:53:04 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-08-12 13:15:23 (GMT) |
commit | 45e2a19b4b75fe94a78161f26862bf3c6f727d74 (patch) | |
tree | a6e698eee514ad28815519f3b2ba5ac592941de3 /src/3rdparty/webkit/JavaScriptCore/runtime/CallData.cpp | |
parent | e806a4e887b6584f1115ced3cb489bb0e9a2de36 (diff) | |
download | Qt-45e2a19b4b75fe94a78161f26862bf3c6f727d74.zip Qt-45e2a19b4b75fe94a78161f26862bf3c6f727d74.tar.gz Qt-45e2a19b4b75fe94a78161f26862bf3c6f727d74.tar.bz2 |
Refactor the way the JS stack are created for native function
The original JavaScriptCore doesn't create stack frame or scope for
native function.
JSC has been patched to support that.
This commit revert our patches to JSC, and implement create the stack
frame from QScript
Reviewed-by: Kent Hansen
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/runtime/CallData.cpp')
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/runtime/CallData.cpp | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/CallData.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/CallData.cpp index b33c8ba..c89ebf8 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/CallData.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/CallData.cpp @@ -25,10 +25,6 @@ #include "config.h" #include "CallData.h" -#ifdef QT_BUILD_SCRIPT_LIB -#include "ExceptionHelpers.h" -#include "Interpreter.h" -#endif #include "JSFunction.h" #include "JSGlobalObject.h" @@ -59,29 +55,8 @@ JSValue JSC::NativeFuncWrapper::operator() (ExecState* exec, JSObject* jsobj, JS JSValue call(ExecState* exec, JSValue functionObject, CallType callType, const CallData& callData, JSValue thisValue, const ArgList& args) { - if (callType == CallTypeHost) { -#ifdef QT_BUILD_SCRIPT_LIB - ScopeChainNode* scopeChain = exec->scopeChain(); - Interpreter *interp = exec->interpreter(); - Register *oldEnd = interp->registerFile().end(); - int argc = 1 + args.size(); // implicit "this" parameter - if (!interp->registerFile().grow(oldEnd + argc + RegisterFile::CallFrameHeaderSize)) - return createStackOverflowError(exec); - CallFrame* newCallFrame = CallFrame::create(oldEnd); - newCallFrame[0] = thisValue; - size_t dst = 0; - ArgList::const_iterator it; - for (it = args.begin(); it != args.end(); ++it) - newCallFrame[++dst] = *it; - newCallFrame += argc + RegisterFile::CallFrameHeaderSize; - newCallFrame->init(0, /*vPC=*/0, scopeChain, exec, 0, argc, asObject(functionObject)); - JSValue result = callData.native.function(newCallFrame, asObject(functionObject), thisValue, args); - interp->registerFile().shrink(oldEnd); - return result; -#else + if (callType == CallTypeHost) return callData.native.function(exec, asObject(functionObject), thisValue, args); -#endif - } ASSERT(callType == CallTypeJS); // FIXME: Can this be done more efficiently using the callData? return asFunction(functionObject)->call(exec, thisValue, args); |