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(); }
JSValue JSActivation::argumentsGetter(ExecState*, JSValue slotBase, const Identifier&) { JSActivation* activation = asActivation(slotBase); CallFrame* callFrame = CallFrame::create(reinterpret_cast<Register*>(activation->m_registers)); int argumentsRegister = activation->m_argumentsRegister; if (JSValue arguments = callFrame->uncheckedR(argumentsRegister).jsValue()) return arguments; int realArgumentsRegister = unmodifiedArgumentsRegister(argumentsRegister); JSValue arguments = JSValue(Arguments::create(callFrame->globalData(), callFrame)); callFrame->uncheckedR(argumentsRegister) = arguments; callFrame->uncheckedR(realArgumentsRegister) = arguments; ASSERT(callFrame->uncheckedR(realArgumentsRegister).jsValue().inherits(&Arguments::s_info)); return callFrame->uncheckedR(realArgumentsRegister).jsValue(); }
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; }