FunctionParameters::FunctionParameters(ParameterNode* firstParameter, unsigned size) : m_size(size) { unsigned i = 0; for (ParameterNode* parameter = firstParameter; parameter; parameter = parameter->nextParam()) new (&identifiers()[i++]) Identifier(parameter->ident()); }
FunctionParameters::FunctionParameters(ParameterNode* firstParameter, unsigned size) : m_size(size) { unsigned i = 0; for (ParameterNode* parameter = firstParameter; parameter; parameter = parameter->nextParam()) { auto pattern = parameter->pattern(); pattern->ref(); patterns()[i++] = pattern; } }
PassRefPtr<FunctionParameters> FunctionParameters::create(ParameterNode* firstParameter) { unsigned parameterCount = 0; for (ParameterNode* parameter = firstParameter; parameter; parameter = parameter->nextParam()) ++parameterCount; size_t objectSize = sizeof(FunctionParameters) - sizeof(void*) + sizeof(DeconstructionPatternNode*) * parameterCount; void* slot = fastMalloc(objectSize); return adoptRef(new (slot) FunctionParameters(firstParameter, parameterCount)); }
FunctionParameters::FunctionParameters(ParameterNode* firstParameter) { for (ParameterNode* parameter = firstParameter; parameter; parameter = parameter->nextParam()) append(parameter->ident()); }