public function addStackFrame($stackFrameData)
    {
        $stackFrameData += [
            'function' => '',
            'locals' => []
        ];

        $sf = new StackFrame(
            $stackFrameData['function'],
            new SourceLocation($stackFrameData['filename'], $stackFrameData['line'])
        );

        foreach ($stackFrameData['locals'] as $local) {
            if ($this->variableTable->isFull()) {
                break;
            }
            $value = isset($local['value']) ? $local['value'] : null;
            $hash = isset($local['id']) ? $local['id'] : null;
            try {
                $variable = $this->addVariable($local['name'], $value, $hash);
            } catch (BufferFullException $e) {
                $sf->addLocal($this->variableTable->bufferFullVariable());
                break;
            }
            $sf->addLocal($variable);
        }

        array_push($this->stackFrames, $sf);
    }