public function compile()
    {
        $classCount = 0;
        foreach ($this->objectManager->getRegisteredClassNames() as $fullOriginalClassNames) {
            foreach ($fullOriginalClassNames as $fullOriginalClassName) {
                if (isset($this->proxyClasses[$fullOriginalClassName])) {
                    $proxyClassCode = $this->proxyClasses[$fullOriginalClassName]->render();
                    if ($proxyClassCode !== '') {
                        $class = new \ReflectionClass($fullOriginalClassName);
                        $classPathAndFilename = $class->getFileName();
                        $this->cacheOriginalClassFileAndProxyCode($fullOriginalClassName, $classPathAndFilename, $proxyClassCode);
                        $this->storedProxyClasses[str_replace('\\', '_', $fullOriginalClassName)] = true;
                        $classCount++;
                    }
                } else {
                    if ($this->classesCache->has(str_replace('\\', '_', $fullOriginalClassName))) {
                        $this->storedProxyClasses[str_replace('\\', '_', $fullOriginalClassName)] = true;
                    }
                }
            }
        }
        return $classCount;
    }