Home | History | Annotate | Download | only in compiler
      1 // 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"
      8 #include "src/compiler/node.h"
      9 
     10 namespace v8 {
     11 namespace internal {
     12 namespace compiler {
     13 
     14 Node** CommonNodeCache::FindExternalConstant(ExternalReference value) {
     15   return external_constants_.Find(zone(), bit_cast<intptr_t>(value.address()));
     16 }
     17 
     18 
     19 Node** CommonNodeCache::FindHeapConstant(Handle<HeapObject> value) {
     20   return heap_constants_.Find(zone(), bit_cast<intptr_t>(value.location()));
     21 }
     22 
     23 
     24 void 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);
     31   heap_constants_.GetCachedNodes(nodes);
     32 }
     33 
     34 }  // namespace compiler
     35 }  // namespace internal
     36 }  // namespace v8
     37