summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/JavaScriptCore/runtime/Arguments.h
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-07-08 15:49:17 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-07-08 16:17:36 (GMT)
commit9fa78177eb5f31e6941b165949957f2b92b8dd0a (patch)
treebdb6737d1547fbceed3d56c1a0c153b543ec4c62 /src/3rdparty/webkit/JavaScriptCore/runtime/Arguments.h
parentccda28f5fa5b38a8e7096742202d64bec4fef54c (diff)
downloadQt-9fa78177eb5f31e6941b165949957f2b92b8dd0a.zip
Qt-9fa78177eb5f31e6941b165949957f2b92b8dd0a.tar.gz
Qt-9fa78177eb5f31e6941b165949957f2b92b8dd0a.tar.bz2
try to get arguments object to work for host call frames
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/runtime/Arguments.h')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/Arguments.h31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Arguments.h b/src/3rdparty/webkit/JavaScriptCore/runtime/Arguments.h
index fffdd78..41adba5 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/Arguments.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Arguments.h
@@ -45,7 +45,7 @@ namespace JSC {
OwnArrayPtr<bool> deletedArguments;
Register extraArgumentsFixedBuffer[4];
- JSFunction* callee;
+ InternalFunction* callee;
bool overrodeLength : 1;
bool overrodeCallee : 1;
};
@@ -87,7 +87,7 @@ namespace JSC {
}
private:
- void getArgumentsData(CallFrame*, JSFunction*&, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc);
+ void getArgumentsData(CallFrame*, InternalFunction*&, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc);
virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
@@ -110,12 +110,17 @@ namespace JSC {
return static_cast<Arguments*>(asObject(value));
}
- ALWAYS_INLINE void Arguments::getArgumentsData(CallFrame* callFrame, JSFunction*& function, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc)
+ ALWAYS_INLINE void Arguments::getArgumentsData(CallFrame* callFrame, InternalFunction*& function, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc)
{
- function = asFunction(callFrame->callee());
-
- CodeBlock* codeBlock = &function->body()->generatedBytecode();
- int numParameters = codeBlock->m_numParameters;
+ function = callFrame->callee();
+
+ int numParameters;
+ if (function->isObject(&JSFunction::info)) {
+ CodeBlock* codeBlock = &JSC::asFunction(function)->body()->generatedBytecode();
+ numParameters = codeBlock->m_numParameters;
+ } else {
+ numParameters = 0;
+ }
argc = callFrame->argumentCount();
if (argc <= numParameters)
@@ -131,13 +136,16 @@ namespace JSC {
: JSObject(callFrame->lexicalGlobalObject()->argumentsStructure())
, d(new ArgumentsData)
{
- JSFunction* callee;
+ InternalFunction* callee;
ptrdiff_t firstParameterIndex;
Register* argv;
int numArguments;
getArgumentsData(callFrame, callee, firstParameterIndex, argv, numArguments);
- d->numParameters = callee->body()->parameterCount();
+ if (callee->isObject(&JSFunction::info))
+ d->numParameters = JSC::asFunction(callee)->body()->parameterCount();
+ else
+ d->numParameters = 0;
d->firstParameterIndex = firstParameterIndex;
d->numArguments = numArguments;
@@ -168,7 +176,8 @@ namespace JSC {
: JSObject(callFrame->lexicalGlobalObject()->argumentsStructure())
, d(new ArgumentsData)
{
- ASSERT(!asFunction(callFrame->callee())->body()->parameterCount());
+ if (callFrame->callee() && callFrame->callee()->isObject(&JSC::JSFunction::info))
+ ASSERT(!asFunction(callFrame->callee())->body()->parameterCount());
unsigned numArguments = callFrame->argumentCount() - 1;
@@ -188,7 +197,7 @@ namespace JSC {
d->extraArguments = extraArguments;
- d->callee = asFunction(callFrame->callee());
+ d->callee = callFrame->callee();
d->overrodeLength = false;
d->overrodeCallee = false;
}