Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
dart::Symbol Class Reference

#include <object.h>

Inheritance diagram for dart::Symbol:
dart::AllStatic

Static Public Member Functions

static bool IsSymbolCid (Thread *thread, classid_t class_id)
 
static uint32_t CanonicalizeHash (Thread *thread, const Instance &instance)
 

Detailed Description

Definition at line 10129 of file object.h.

Member Function Documentation

◆ CanonicalizeHash()

uint32_t dart::Symbol::CanonicalizeHash ( Thread thread,
const Instance instance 
)
static

Definition at line 20340 of file object.cc.

20340 {
20341 ASSERT(IsSymbolCid(thread, instance.GetClassId()));
20342
20343 auto zone = thread->zone();
20344 auto object_store = thread->isolate_group()->object_store();
20345
20346 const auto& symbol_name_field =
20347 Field::Handle(zone, object_store->symbol_name_field());
20348 ASSERT(!symbol_name_field.IsNull());
20349
20350 // Keep in sync with sdk/lib/_internal/vm/lib/symbol_patch.dart.
20351 const auto& name =
20352 String::Cast(Object::Handle(zone, instance.GetField(symbol_name_field)));
20353 const uint32_t arbitrary_prime = 664597;
20354 return 0x1fffffff & (arbitrary_prime * name.CanonicalizeHash());
20355}
static Object & Handle()
Definition object.h:407
static bool IsSymbolCid(Thread *thread, classid_t class_id)
Definition object.cc:20334
#define ASSERT(E)
VkInstance instance
Definition main.cc:48
const char *const name

◆ IsSymbolCid()

bool dart::Symbol::IsSymbolCid ( Thread thread,
classid_t  class_id 
)
static

Definition at line 20334 of file object.cc.

20334 {
20335 auto object_store = thread->isolate_group()->object_store();
20336 return Class::GetClassId(object_store->symbol_class()) == class_id;
20337}
intptr_t GetClassId() const
Definition object.h:341

The documentation for this class was generated from the following files: