fixed static calls.
git-svn-id: svn://10.0.0.236/trunk@73499 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -818,7 +818,7 @@ TypedRegister ICodeGenerator::genExpr(ExprNode *p,
|
||||
const StringAtom &className = (static_cast<IdentifierExprNode *>(b->op1))->name;
|
||||
const JSValue &v = mGlobal->getVariable(className);
|
||||
JSClass* c = dynamic_cast<JSClass*>(v.type);
|
||||
if (c && c->getScope()->hasProperty(name)) {
|
||||
if (c && c->hasStatic(name)) {
|
||||
ret = staticCall(c, name, args);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -529,9 +529,12 @@ JSValue Context::interpret(ICodeModule* iCode, const JSValues& args)
|
||||
|
||||
case STATIC_CALL:
|
||||
{
|
||||
// FIXME: static call should use its static index.
|
||||
StaticCall* call = static_cast<StaticCall*>(instruction);
|
||||
ASSERT(op2(call)->getScope()->getProperty(*op3(call)).isFunction());
|
||||
JSFunction *target = op2(call)->getScope()->getProperty(*op3(call)).function;
|
||||
JSClass* thisClass = op2(call);
|
||||
const JSValue& value = (*thisClass)[thisClass->getStatic(*op3(call)).mIndex];
|
||||
ASSERT(value.isFunction());
|
||||
JSFunction *target = value.function;
|
||||
if (target->isNative()) {
|
||||
RegisterList ¶ms = op4(call);
|
||||
JSValues argv(params.size() + 1);
|
||||
|
||||
@@ -818,7 +818,7 @@ TypedRegister ICodeGenerator::genExpr(ExprNode *p,
|
||||
const StringAtom &className = (static_cast<IdentifierExprNode *>(b->op1))->name;
|
||||
const JSValue &v = mGlobal->getVariable(className);
|
||||
JSClass* c = dynamic_cast<JSClass*>(v.type);
|
||||
if (c && c->getScope()->hasProperty(name)) {
|
||||
if (c && c->hasStatic(name)) {
|
||||
ret = staticCall(c, name, args);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -529,9 +529,12 @@ JSValue Context::interpret(ICodeModule* iCode, const JSValues& args)
|
||||
|
||||
case STATIC_CALL:
|
||||
{
|
||||
// FIXME: static call should use its static index.
|
||||
StaticCall* call = static_cast<StaticCall*>(instruction);
|
||||
ASSERT(op2(call)->getScope()->getProperty(*op3(call)).isFunction());
|
||||
JSFunction *target = op2(call)->getScope()->getProperty(*op3(call)).function;
|
||||
JSClass* thisClass = op2(call);
|
||||
const JSValue& value = (*thisClass)[thisClass->getStatic(*op3(call)).mIndex];
|
||||
ASSERT(value.isFunction());
|
||||
JSFunction *target = value.function;
|
||||
if (target->isNative()) {
|
||||
RegisterList ¶ms = op4(call);
|
||||
JSValues argv(params.size() + 1);
|
||||
|
||||
Reference in New Issue
Block a user