aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/common-node-cache.cc
blob: d9fd5ca01389e5880f78d2285afd6a649199823d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/compiler/common-node-cache.h"

#include "src/compiler/node.h"
#include "src/external-reference.h"

namespace v8 {
namespace internal {
namespace compiler {

Node** CommonNodeCache::FindExternalConstant(ExternalReference value) {
  return external_constants_.Find(zone(), bit_cast<intptr_t>(value.address()));
}


Node** CommonNodeCache::FindHeapConstant(Handle<HeapObject> value) {
  return heap_constants_.Find(zone(), bit_cast<intptr_t>(value.address()));
}


void CommonNodeCache::GetCachedNodes(ZoneVector<Node*>* nodes) {
  int32_constants_.GetCachedNodes(nodes);
  int64_constants_.GetCachedNodes(nodes);
  float32_constants_.GetCachedNodes(nodes);
  float64_constants_.GetCachedNodes(nodes);
  external_constants_.GetCachedNodes(nodes);
  number_constants_.GetCachedNodes(nodes);
  heap_constants_.GetCachedNodes(nodes);
  relocatable_int32_constants_.GetCachedNodes(nodes);
  relocatable_int64_constants_.GetCachedNodes(nodes);
}

}  // namespace compiler
}  // namespace internal
}  // namespace v8