From ac2fd0c4c19a5330c02cdae1c21f06e78e6c8075 Mon Sep 17 00:00:00 2001 From: "beard%netscape.com" Date: Thu, 29 Jun 2000 04:23:56 +0000 Subject: [PATCH] Changed StaticCall to use static slot. --- js/js2/interpreter.cpp | 7 +++---- js2/src/interpreter.cpp | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/js/js2/interpreter.cpp b/js/js2/interpreter.cpp index c4d97897c16..2125eebefcb 100644 --- a/js/js2/interpreter.cpp +++ b/js/js2/interpreter.cpp @@ -529,16 +529,15 @@ JSValue Context::interpret(ICodeModule* iCode, const JSValues& args) case STATIC_CALL: { - // FIXME: static call should use its static index. StaticCall* call = static_cast(instruction); JSClass* thisClass = op2(call); - const JSValue& value = (*thisClass)[thisClass->getStatic(*op3(call)).mIndex]; + const JSValue& value = (*thisClass)[op3(call)]; + // FIXME: throw runtime error if not a function value. ASSERT(value.isFunction()); JSFunction *target = value.function; if (target->isNative()) { RegisterList ¶ms = op4(call); - JSValues argv(params.size() + 1); - argv[0] = kNullValue; + JSValues argv(params.size() + 1, kNullValue); JSValues::size_type i = 1; for (RegisterList::const_iterator src = params.begin(), end = params.end(); src != end; ++src, ++i) { diff --git a/js2/src/interpreter.cpp b/js2/src/interpreter.cpp index c4d97897c16..2125eebefcb 100644 --- a/js2/src/interpreter.cpp +++ b/js2/src/interpreter.cpp @@ -529,16 +529,15 @@ JSValue Context::interpret(ICodeModule* iCode, const JSValues& args) case STATIC_CALL: { - // FIXME: static call should use its static index. StaticCall* call = static_cast(instruction); JSClass* thisClass = op2(call); - const JSValue& value = (*thisClass)[thisClass->getStatic(*op3(call)).mIndex]; + const JSValue& value = (*thisClass)[op3(call)]; + // FIXME: throw runtime error if not a function value. ASSERT(value.isFunction()); JSFunction *target = value.function; if (target->isNative()) { RegisterList ¶ms = op4(call); - JSValues argv(params.size() + 1); - argv[0] = kNullValue; + JSValues argv(params.size() + 1, kNullValue); JSValues::size_type i = 1; for (RegisterList::const_iterator src = params.begin(), end = params.end(); src != end; ++src, ++i) {