fixed static calls.

git-svn-id: svn://10.0.0.236/trunk@73499 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
beard%netscape.com
2000-06-29 03:15:52 +00:00
parent fc6a0c74b6
commit ca9ef8f4a5
4 changed files with 12 additions and 6 deletions

View File

@@ -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;
}

View File

@@ -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 &params = op4(call);
JSValues argv(params.size() + 1);

View File

@@ -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;
}

View File

@@ -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 &params = op4(call);
JSValues argv(params.size() + 1);