11cb0ef41Sopenharmony_ci// Copyright 2014 the V8 project authors. All rights reserved. 21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be 31cb0ef41Sopenharmony_ci// found in the LICENSE file. 41cb0ef41Sopenharmony_ci 51cb0ef41Sopenharmony_ci#include "src/compiler/common-node-cache.h" 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ci#include "src/codegen/external-reference.h" 81cb0ef41Sopenharmony_ci#include "src/compiler/node.h" 91cb0ef41Sopenharmony_ci 101cb0ef41Sopenharmony_cinamespace v8 { 111cb0ef41Sopenharmony_cinamespace internal { 121cb0ef41Sopenharmony_cinamespace compiler { 131cb0ef41Sopenharmony_ci 141cb0ef41Sopenharmony_ciNode** CommonNodeCache::FindExternalConstant(ExternalReference value) { 151cb0ef41Sopenharmony_ci return external_constants_.Find(bit_cast<intptr_t>(value.address())); 161cb0ef41Sopenharmony_ci} 171cb0ef41Sopenharmony_ci 181cb0ef41Sopenharmony_ci 191cb0ef41Sopenharmony_ciNode** CommonNodeCache::FindHeapConstant(Handle<HeapObject> value) { 201cb0ef41Sopenharmony_ci return heap_constants_.Find(bit_cast<intptr_t>(value.address())); 211cb0ef41Sopenharmony_ci} 221cb0ef41Sopenharmony_ci 231cb0ef41Sopenharmony_ci 241cb0ef41Sopenharmony_civoid CommonNodeCache::GetCachedNodes(ZoneVector<Node*>* nodes) { 251cb0ef41Sopenharmony_ci int32_constants_.GetCachedNodes(nodes); 261cb0ef41Sopenharmony_ci int64_constants_.GetCachedNodes(nodes); 271cb0ef41Sopenharmony_ci tagged_index_constants_.GetCachedNodes(nodes); 281cb0ef41Sopenharmony_ci float32_constants_.GetCachedNodes(nodes); 291cb0ef41Sopenharmony_ci float64_constants_.GetCachedNodes(nodes); 301cb0ef41Sopenharmony_ci external_constants_.GetCachedNodes(nodes); 311cb0ef41Sopenharmony_ci pointer_constants_.GetCachedNodes(nodes); 321cb0ef41Sopenharmony_ci number_constants_.GetCachedNodes(nodes); 331cb0ef41Sopenharmony_ci heap_constants_.GetCachedNodes(nodes); 341cb0ef41Sopenharmony_ci relocatable_int32_constants_.GetCachedNodes(nodes); 351cb0ef41Sopenharmony_ci relocatable_int64_constants_.GetCachedNodes(nodes); 361cb0ef41Sopenharmony_ci} 371cb0ef41Sopenharmony_ci 381cb0ef41Sopenharmony_ci} // namespace compiler 391cb0ef41Sopenharmony_ci} // namespace internal 401cb0ef41Sopenharmony_ci} // namespace v8 41