Пример #1
0
JSValue* JSActivation::argumentsGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    JSActivation* thisObj = static_cast<JSActivation*>(slot.slotBase());
    if (!thisObj->d()->argumentsObject)
        thisObj->d()->argumentsObject = thisObj->createArgumentsObject(exec);

    return thisObj->d()->argumentsObject;
}
Пример #2
0
JSValue JSActivation::argumentsGetter(ExecState*, JSValue slotBase, const Identifier&)
{
    JSActivation* activation = asActivation(slotBase);
    CallFrame* callFrame = CallFrame::create(activation->d()->registers);
    int argumentsRegister = activation->d()->functionExecutable->generatedBytecode().argumentsRegister();
    if (!callFrame->uncheckedR(argumentsRegister).jsValue()) {
        JSValue arguments = JSValue(new (callFrame) Arguments(callFrame));
        callFrame->uncheckedR(argumentsRegister) = arguments;
        callFrame->uncheckedR(unmodifiedArgumentsRegister(argumentsRegister)) = arguments;
    }

    ASSERT(callFrame->uncheckedR(argumentsRegister).jsValue().inherits(&Arguments::info));
    return callFrame->uncheckedR(argumentsRegister).jsValue();
}
Пример #3
0
JSValue JSActivation::argumentsGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    JSActivation* activation = asActivation(slot.slotBase());

    if (activation->d()->functionExecutable->usesArguments()) {
        PropertySlot slot;
        activation->symbolTableGet(exec->propertyNames().arguments, slot);
        return slot.getValue(exec, exec->propertyNames().arguments);
    }

    CallFrame* callFrame = CallFrame::create(activation->d()->registers);
    Arguments* arguments = callFrame->optionalCalleeArguments();
    if (!arguments) {
        arguments = new (callFrame) Arguments(callFrame);
        arguments->copyRegisters();
        callFrame->setCalleeArguments(arguments);
    }
    ASSERT(arguments->inherits(&Arguments::info));

    return arguments;
}