common-node-cache.cc 1.25 KB
Newer Older
1 2 3 4 5 6
// 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"

7
#include "src/codegen/external-reference.h"
8
#include "src/compiler/node.h"
9 10 11 12 13 14

namespace v8 {
namespace internal {
namespace compiler {

Node** CommonNodeCache::FindExternalConstant(ExternalReference value) {
15
  return external_constants_.Find(bit_cast<intptr_t>(value.address()));
16 17 18
}


19
Node** CommonNodeCache::FindHeapConstant(Handle<HeapObject> value) {
20
  return heap_constants_.Find(bit_cast<intptr_t>(value.address()));
21 22 23
}


24 25 26
void CommonNodeCache::GetCachedNodes(ZoneVector<Node*>* nodes) {
  int32_constants_.GetCachedNodes(nodes);
  int64_constants_.GetCachedNodes(nodes);
27
  tagged_index_constants_.GetCachedNodes(nodes);
28 29 30
  float32_constants_.GetCachedNodes(nodes);
  float64_constants_.GetCachedNodes(nodes);
  external_constants_.GetCachedNodes(nodes);
31
  pointer_constants_.GetCachedNodes(nodes);
32
  number_constants_.GetCachedNodes(nodes);
33
  heap_constants_.GetCachedNodes(nodes);
34 35
  relocatable_int32_constants_.GetCachedNodes(nodes);
  relocatable_int64_constants_.GetCachedNodes(nodes);
36 37 38 39 40
}

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