Flutter Engine
The Flutter Engine
Public Types | Static Public Member Functions | List of all members
dart::ConstantPoolTrait Struct Reference

#include <flow_graph.h>

Public Types

typedef ConstantInstrValue
 
typedef ConstantAndRepresentation Key
 
typedef ConstantInstrPair
 

Static Public Member Functions

static Key KeyOf (Pair kv)
 
static Value ValueOf (Pair kv)
 
static uword Hash (Key key)
 
static bool IsKeyEqual (Pair kv, Key key)
 

Detailed Description

Definition at line 60 of file flow_graph.h.

Member Typedef Documentation

◆ Key

Definition at line 62 of file flow_graph.h.

◆ Pair

Definition at line 63 of file flow_graph.h.

◆ Value

Definition at line 61 of file flow_graph.h.

Member Function Documentation

◆ Hash()

static uword dart::ConstantPoolTrait::Hash ( Key  key)
inlinestatic

Definition at line 71 of file flow_graph.h.

71 {
72 if (key.constant.IsSmi()) {
73 return Smi::Cast(key.constant).Value();
74 }
75 if (key.constant.IsDouble()) {
76 return static_cast<intptr_t>(bit_cast<int32_t, float>(
77 static_cast<float>(Double::Cast(key.constant).value())));
78 }
79 if (key.constant.IsMint()) {
80 return static_cast<intptr_t>(Mint::Cast(key.constant).value());
81 }
82 if (key.constant.IsString()) {
83 return String::Cast(key.constant).Hash();
84 }
85 return key.constant.GetClassId();
86 }

◆ IsKeyEqual()

static bool dart::ConstantPoolTrait::IsKeyEqual ( Pair  kv,
Key  key 
)
inlinestatic

Definition at line 88 of file flow_graph.h.

88 {
89 return (kv->value().ptr() == key.constant.ptr()) &&
90 (kv->representation() == key.representation);
91 }

◆ KeyOf()

static Key dart::ConstantPoolTrait::KeyOf ( Pair  kv)
inlinestatic

Definition at line 65 of file flow_graph.h.

65 {
66 return ConstantAndRepresentation{kv->value(), kv->representation()};
67 }

◆ ValueOf()

static Value dart::ConstantPoolTrait::ValueOf ( Pair  kv)
inlinestatic

Definition at line 69 of file flow_graph.h.

69{ return kv; }

The documentation for this struct was generated from the following file: