diff --git a/core/includes/common.inc b/core/includes/common.inc
index 3ceb479..60cf4ea 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -657,7 +657,7 @@ function drupal_js_defaults($data = NULL) {
  *   \Drupal\Core\Render\Renderer::mergeAttachments() instead.
  */
 function drupal_merge_attached(array $a, array $b) {
-  return Renderer::mergeAttachments($a, $b);
+  return \Drupal::service('renderer')->mergeAttachments($a, $b);
 }
 
 /**
diff --git a/core/lib/Drupal/Core/Ajax/AjaxResponse.php b/core/lib/Drupal/Core/Ajax/AjaxResponse.php
index 6cd4df5..97eca0a 100644
--- a/core/lib/Drupal/Core/Ajax/AjaxResponse.php
+++ b/core/lib/Drupal/Core/Ajax/AjaxResponse.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Asset\AttachedAssets;
 use Drupal\Core\Render\Renderer;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpFoundation\JsonResponse;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\Response;
@@ -38,6 +39,37 @@ class AjaxResponse extends JsonResponse {
   ];
 
   /**
+   * The renderer service.
+   *
+   * @var \Drupal\Core\Render\Renderer
+   */
+  protected $renderer;
+
+  /**
+   * Constructs a new AjaxResponse object.
+   *
+   * @param \Drupal\Core\Render\Renderer $renderer
+   *   The renderer service.
+   * @param mixed $data
+   *   The response data.
+   * @param int $status
+   *   The response status code.
+   * @param array $headers
+   *   An array of response headers.
+   */
+  public function __construct(Renderer $renderer, $data = NULL, $status = 200, $headers = array()) {
+    parent::__construct($data, $status, $headers);
+    $this->renderer = $renderer;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container, $data = NULL, $status = 200, $headers = array()) {
+    return new static($container->get('renderer'), $data, $status, $headers);
+  }
+
+  /**
    * Sets attachments for this Ajax response.
    *
    * When this Ajax response is rendered, it will take care of generating the
@@ -78,7 +110,7 @@ public function addCommand(CommandInterface $command, $prepend = FALSE) {
         'library' => $assets->getLibraries(),
         'drupalSettings' => $assets->getSettings(),
       ];
-      $attachments = Renderer::mergeAttachments($this->attachments, $attachments);
+      $attachments = $this->renderer->mergeAttachments($this->attachments, $attachments);
       $this->setAttachments($attachments);
     }
 
diff --git a/core/lib/Drupal/Core/Render/BubbleableMetadata.php b/core/lib/Drupal/Core/Render/BubbleableMetadata.php
index c4852a9..3a3ec0b 100644
--- a/core/lib/Drupal/Core/Render/BubbleableMetadata.php
+++ b/core/lib/Drupal/Core/Render/BubbleableMetadata.php
@@ -71,7 +71,7 @@ public function merge(BubbleableMetadata $other) {
     $result->contexts = Cache::mergeContexts($this->contexts, $other->contexts);
     $result->tags = Cache::mergeTags($this->tags, $other->tags);
     $result->maxAge = Cache::mergeMaxAges($this->maxAge, $other->maxAge);
-    $result->attached = Renderer::mergeAttachments($this->attached, $other->attached);
+    $result->attached = \Drupal::service('renderer')->mergeAttachments($this->attached, $other->attached);
     $result->postRenderCache = NestedArray::mergeDeep($this->postRenderCache, $other->postRenderCache);
     return $result;
   }
diff --git a/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php b/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php
index 249b47b..d12b18b 100644
--- a/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php
+++ b/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php
@@ -286,7 +286,7 @@ public function invokePageAttachmentHooks(array &$page) {
     }
 
     // Merge the attachments onto the $page render array.
-    $page = Renderer::mergeBubbleableMetadata($page, $attachments);
+    $page = $this->renderer->mergeBubbleableMetadata($page, $attachments);
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Render/Renderer.php b/core/lib/Drupal/Core/Render/Renderer.php
index 5891805..c6a2f59 100644
--- a/core/lib/Drupal/Core/Render/Renderer.php
+++ b/core/lib/Drupal/Core/Render/Renderer.php
@@ -782,7 +782,7 @@ public function getCacheableRenderArray(array $elements) {
   /**
    * {@inheritdoc}
    */
-  public static function mergeBubbleableMetadata(array $a, array $b) {
+  public function mergeBubbleableMetadata(array $a, array $b) {
     $meta_a = BubbleableMetadata::createFromRenderArray($a);
     $meta_b = BubbleableMetadata::createFromRenderArray($b);
     $meta_a->merge($meta_b)->applyTo($a);
@@ -801,7 +801,7 @@ public function addDependency(array &$elements, CacheableDependencyInterface $de
   /**
    * {@inheritdoc}
    */
-  public static function mergeAttachments(array $a, array $b) {
+  public function mergeAttachments(array $a, array $b) {
     // If both #attached arrays contain drupalSettings, then merge them
     // correctly; adding the same settings multiple times needs to behave
     // idempotently.
diff --git a/core/lib/Drupal/Core/Render/RendererInterface.php b/core/lib/Drupal/Core/Render/RendererInterface.php
index 85035bf..6b6d6cb 100644
--- a/core/lib/Drupal/Core/Render/RendererInterface.php
+++ b/core/lib/Drupal/Core/Render/RendererInterface.php
@@ -340,7 +340,7 @@ public function getCacheableRenderArray(array $elements);
    *
    * @see \Drupal\Core\Render\BubbleableMetadata
    */
-  public static function mergeBubbleableMetadata(array $a, array $b);
+  public function mergeBubbleableMetadata(array $a, array $b);
 
   /**
    * Adds a dependency on an object: merges its cacheability metadata.
@@ -398,7 +398,7 @@ public function addDependency(array &$elements, CacheableDependencyInterface $de
    * @return array
    *   The merged attachments array.
    */
-  public static function mergeAttachments(array $a, array $b);
+  public function mergeAttachments(array $a, array $b);
 
   /**
    * Generates a render cache placeholder.
diff --git a/core/modules/comment/src/CommentPostRenderCache.php b/core/modules/comment/src/CommentPostRenderCache.php
index 0348cc3..fd6fbc7 100644
--- a/core/modules/comment/src/CommentPostRenderCache.php
+++ b/core/modules/comment/src/CommentPostRenderCache.php
@@ -121,7 +121,7 @@ public function renderForm(array $element, array $context) {
     $callback = 'comment.post_render_cache:renderForm';
     $placeholder = $this->generatePlaceholder($callback, $context);
     $element['#markup'] = str_replace($placeholder, $markup, $element['#markup']);
-    $element = Renderer::mergeBubbleableMetadata($element, $form);
+    $element = $this->renderer->mergeBubbleableMetadata($element, $form);
 
     return $element;
   }
