Index: runtime/vm/object_store.cc |
diff --git a/runtime/vm/object_store.cc b/runtime/vm/object_store.cc |
index 5528afd0487c9a0963997af94b07d0e7b80f73bf..19e7ebd5819722ee20db3e40fa89c7b22b74c724 100644 |
--- a/runtime/vm/object_store.cc |
+++ b/runtime/vm/object_store.cc |
@@ -90,6 +90,10 @@ ObjectStore::ObjectStore() |
empty_uint32_array_(TypedData::null()), |
handle_message_function_(Function::null()), |
library_load_error_table_(Array::null()), |
+ simple_instance_of_function_(Function::null()), |
+ simple_instance_of_true_function_(Function::null()), |
+ simple_instance_of_false_function_(Function::null()), |
+ compile_time_constants_(Array::null()), |
unique_dynamic_targets_(Array::null()), |
token_objects_(GrowableObjectArray::null()), |
token_objects_map_(Array::null()), |
@@ -201,6 +205,16 @@ RawError* ObjectStore::PreallocateObjects() { |
} |
+RawFunction* ObjectStore::PrivateObjectLookup(const String& name) { |
+ const Library& core_lib = Library::Handle(core_library()); |
+ const String& mangled = String::ZoneHandle(core_lib.PrivateName(name)); |
+ const Class& cls = Class::Handle(object_class()); |
+ const Function& result = Function::Handle(cls.LookupDynamicFunction(mangled)); |
+ ASSERT(!result.IsNull()); |
+ return result.raw(); |
+} |
+ |
+ |
void ObjectStore::InitKnownObjects() { |
#ifdef DART_PRECOMPILED_RUNTIME |
// These objects are only needed for code generation. |
@@ -227,6 +241,14 @@ void ObjectStore::InitKnownObjects() { |
const Library& internal_lib = Library::Handle(internal_library()); |
cls = internal_lib.LookupClass(Symbols::Symbol()); |
set_symbol_class(cls); |
+ |
+ // Cache the core private functions used for fast instance of checks. |
+ simple_instance_of_function_ = |
+ PrivateObjectLookup(Symbols::_simpleInstanceOf()); |
+ simple_instance_of_true_function_ = |
+ PrivateObjectLookup(Symbols::_simpleInstanceOfTrue()); |
+ simple_instance_of_false_function_ = |
+ PrivateObjectLookup(Symbols::_simpleInstanceOfFalse()); |
#endif |
} |