blob: fa4ca34468c65df1445fc3f7ec28c0094ce0e24a [file] [log] [blame]
Emily Bernierd0a1eb72015-03-24 16:35:39 -04001// Copyright 2014 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "src/compiler/common-node-cache.h"
6
7#include "src/assembler.h"
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00008#include "src/compiler/node.h"
Emily Bernierd0a1eb72015-03-24 16:35:39 -04009
10namespace v8 {
11namespace internal {
12namespace compiler {
13
14Node** CommonNodeCache::FindExternalConstant(ExternalReference value) {
15 return external_constants_.Find(zone(), bit_cast<intptr_t>(value.address()));
16}
17
18
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000019Node** CommonNodeCache::FindHeapConstant(Handle<HeapObject> value) {
Ben Murdochc5610432016-08-08 18:44:38 +010020 return heap_constants_.Find(zone(), bit_cast<intptr_t>(value.address()));
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000021}
22
23
Emily Bernierd0a1eb72015-03-24 16:35:39 -040024void CommonNodeCache::GetCachedNodes(ZoneVector<Node*>* nodes) {
25 int32_constants_.GetCachedNodes(nodes);
26 int64_constants_.GetCachedNodes(nodes);
27 float32_constants_.GetCachedNodes(nodes);
28 float64_constants_.GetCachedNodes(nodes);
29 external_constants_.GetCachedNodes(nodes);
30 number_constants_.GetCachedNodes(nodes);
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000031 heap_constants_.GetCachedNodes(nodes);
Ben Murdochc5610432016-08-08 18:44:38 +010032 relocatable_int32_constants_.GetCachedNodes(nodes);
33 relocatable_int64_constants_.GetCachedNodes(nodes);
Emily Bernierd0a1eb72015-03-24 16:35:39 -040034}
35
36} // namespace compiler
37} // namespace internal
38} // namespace v8