summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-07-08 11:38:17 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-07-08 16:17:36 (GMT)
commitccda28f5fa5b38a8e7096742202d64bec4fef54c (patch)
tree9946f8bc5d2dc439f05f2ac9e883624a5e14b501
parentd47ea38c927d488b83708564f2e79b09cd631b9f (diff)
downloadQt-ccda28f5fa5b38a8e7096742202d64bec4fef54c.zip
Qt-ccda28f5fa5b38a8e7096742202d64bec4fef54c.tar.gz
Qt-ccda28f5fa5b38a8e7096742202d64bec4fef54c.tar.bz2
make JSC::CallFrame::callee() an InternalFunction
This makes it possible to obtain the callee for native (host) functions as well.
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/interpreter/CallFrame.h6
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp6
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/interpreter/Register.h14
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/Arguments.h6
4 files changed, 16 insertions, 16 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/CallFrame.h b/src/3rdparty/webkit/JavaScriptCore/interpreter/CallFrame.h
index 0b0e5fe..b1e6c4d 100644
--- a/src/3rdparty/webkit/JavaScriptCore/interpreter/CallFrame.h
+++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/CallFrame.h
@@ -37,7 +37,7 @@ namespace JSC {
// Passed as the first argument to most functions.
class ExecState : private Register {
public:
- JSFunction* callee() const { return this[RegisterFile::Callee].function(); }
+ InternalFunction* callee() const { return this[RegisterFile::Callee].function(); }
CodeBlock* codeBlock() const { return this[RegisterFile::CodeBlock].Register::codeBlock(); }
ScopeChainNode* scopeChain() const { return this[RegisterFile::ScopeChain].Register::scopeChain(); }
int argumentCount() const { return this[RegisterFile::ArgumentCount].i(); }
@@ -110,7 +110,7 @@ namespace JSC {
void setScopeChain(ScopeChainNode* scopeChain) { this[RegisterFile::ScopeChain] = scopeChain; }
ALWAYS_INLINE void init(CodeBlock* codeBlock, Instruction* vPC, ScopeChainNode* scopeChain,
- CallFrame* callerFrame, int returnValueRegister, int argc, JSFunction* function)
+ CallFrame* callerFrame, int returnValueRegister, int argc, InternalFunction* function)
{
ASSERT(callerFrame); // Use noCaller() rather than 0 for the outer host call frame caller.
@@ -134,7 +134,7 @@ namespace JSC {
int returnValueRegister() const { return this[RegisterFile::ReturnValueRegister].i(); }
void setArgumentCount(int count) { this[RegisterFile::ArgumentCount] = count; }
- void setCallee(JSFunction* callee) { this[RegisterFile::Callee] = callee; }
+ void setCallee(InternalFunction* callee) { this[RegisterFile::Callee] = callee; }
void setCodeBlock(CodeBlock* codeBlock) { this[RegisterFile::CodeBlock] = codeBlock; }
static const intptr_t HostCallFrameFlag = 1;
diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp
index 7b1e547..2328f97 100644
--- a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp
@@ -3076,7 +3076,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
if (callType == CallTypeHost) {
ScopeChainNode* scopeChain = callFrame->scopeChain();
CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset);
- newCallFrame->init(0, vPC + 5, scopeChain, callFrame, dst, argCount, 0);
+ newCallFrame->init(0, vPC + 5, scopeChain, callFrame, dst, argCount, asInternalFunction(v));
Register* thisRegister = newCallFrame->registers() - RegisterFile::CallFrameHeaderSize - argCount;
ArgList args(thisRegister + 1, argCount - 1);
@@ -3230,7 +3230,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
if (callType == CallTypeHost) {
ScopeChainNode* scopeChain = callFrame->scopeChain();
CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset);
- newCallFrame->init(0, vPC + 5, scopeChain, callFrame, dst, argCount, 0);
+ newCallFrame->init(0, vPC + 5, scopeChain, callFrame, dst, argCount, asInternalFunction(v));
Register* thisRegister = newCallFrame->registers() - RegisterFile::CallFrameHeaderSize - argCount;
ArgList args(thisRegister + 1, argCount - 1);
@@ -3496,7 +3496,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
ScopeChainNode* scopeChain = callFrame->scopeChain();
CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset);
- newCallFrame->init(0, vPC + 7, scopeChain, callFrame, dst, argCount, 0);
+ newCallFrame->init(0, vPC + 7, scopeChain, callFrame, dst, argCount, asInternalFunction(v));
JSValue returnValue;
{
diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/Register.h b/src/3rdparty/webkit/JavaScriptCore/interpreter/Register.h
index 31f0c8b..e0dbc34 100644
--- a/src/3rdparty/webkit/JavaScriptCore/interpreter/Register.h
+++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/Register.h
@@ -40,7 +40,7 @@ namespace JSC {
class CodeBlock;
class ExecState;
class JSActivation;
- class JSFunction;
+ class InternalFunction;
class JSPropertyNameIterator;
class ScopeChainNode;
@@ -62,7 +62,7 @@ namespace JSC {
int32_t i() const;
void* v() const;
- private:
+ public:
friend class ExecState;
friend class Interpreter;
@@ -73,7 +73,7 @@ namespace JSC {
Register(JSActivation*);
Register(CallFrame*);
Register(CodeBlock*);
- Register(JSFunction*);
+ Register(InternalFunction*);
Register(JSPropertyNameIterator*);
Register(ScopeChainNode*);
Register(Instruction*);
@@ -82,7 +82,7 @@ namespace JSC {
Arguments* arguments() const;
CallFrame* callFrame() const;
CodeBlock* codeBlock() const;
- JSFunction* function() const;
+ InternalFunction* function() const;
JSPropertyNameIterator* propertyNameIterator() const;
ScopeChainNode* scopeChain() const;
Instruction* vPC() const;
@@ -96,7 +96,7 @@ namespace JSC {
Arguments* arguments;
CallFrame* callFrame;
CodeBlock* codeBlock;
- JSFunction* function;
+ InternalFunction* function;
JSPropertyNameIterator* propertyNameIterator;
ScopeChainNode* scopeChain;
Instruction* vPC;
@@ -152,7 +152,7 @@ namespace JSC {
u.codeBlock = codeBlock;
}
- ALWAYS_INLINE Register::Register(JSFunction* function)
+ ALWAYS_INLINE Register::Register(InternalFunction* function)
{
u.function = function;
}
@@ -211,7 +211,7 @@ namespace JSC {
return u.codeBlock;
}
- ALWAYS_INLINE JSFunction* Register::function() const
+ ALWAYS_INLINE InternalFunction* Register::function() const
{
return u.function;
}
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Arguments.h b/src/3rdparty/webkit/JavaScriptCore/runtime/Arguments.h
index 72697eb..fffdd78 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/Arguments.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Arguments.h
@@ -112,7 +112,7 @@ namespace JSC {
ALWAYS_INLINE void Arguments::getArgumentsData(CallFrame* callFrame, JSFunction*& function, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc)
{
- function = callFrame->callee();
+ function = asFunction(callFrame->callee());
CodeBlock* codeBlock = &function->body()->generatedBytecode();
int numParameters = codeBlock->m_numParameters;
@@ -168,7 +168,7 @@ namespace JSC {
: JSObject(callFrame->lexicalGlobalObject()->argumentsStructure())
, d(new ArgumentsData)
{
- ASSERT(!callFrame->callee()->body()->parameterCount());
+ ASSERT(!asFunction(callFrame->callee())->body()->parameterCount());
unsigned numArguments = callFrame->argumentCount() - 1;
@@ -188,7 +188,7 @@ namespace JSC {
d->extraArguments = extraArguments;
- d->callee = callFrame->callee();
+ d->callee = asFunction(callFrame->callee());
d->overrodeLength = false;
d->overrodeCallee = false;
}