Chromium Code Reviews| Index: runtime/vm/object_store.cc |
| diff --git a/runtime/vm/object_store.cc b/runtime/vm/object_store.cc |
| index 5528afd0487c9a0963997af94b07d0e7b80f73bf..9c5bd82557910081c518ca13ab3fe3dae9323b43 100644 |
| --- a/runtime/vm/object_store.cc |
| +++ b/runtime/vm/object_store.cc |
| @@ -89,7 +89,11 @@ ObjectStore::ObjectStore() |
| lookup_port_handler_(Function::null()), |
| empty_uint32_array_(TypedData::null()), |
| handle_message_function_(Function::null()), |
| + simple_instance_of_function_(Function::null()), |
| + simple_instance_of_true_function_(Function::null()), |
| + simple_instance_of_false_function_(Function::null()), |
| library_load_error_table_(Array::null()), |
| + compile_time_constants_(Array::null()), |
|
Florian Schneider
2016/07/14 17:18:03
Same here.
bakster
2016/07/14 17:59:42
Done.
|
| 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 |
| } |