Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Unified Diff: runtime/vm/object.cc

Issue 2137673002: Sped up hashCode by removing megamorphic call to _identityHashCode. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Improved the speed of instance-of for unoptimized code. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 26e4466590c1772af86a7a2c296ca02c8c7492ac..bb0ac9ff7b9c7fbb86818ca568bc789532e46bb6 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -12848,10 +12848,20 @@ void ICData::AddTarget(const Function& target) const {
}
+bool ICData::ValidateInteceptor(const Function& target) const {
+ ObjectStore* store = Isolate::Current()->object_store();
+ ASSERT(target.raw() == store->simple_instance_of_true_function()
+ || target.raw() == store->simple_instance_of_false_function());
+ const String& instance_of_name = String::Handle(
+ Library::PrivateCoreLibName(Symbols::_simpleInstanceOf()).raw());
+ ASSERT(target_name() == instance_of_name.raw());
+ return true;
+}
+
void ICData::AddCheck(const GrowableArray<intptr_t>& class_ids,
const Function& target) const {
ASSERT(!target.IsNull());
- ASSERT(target.name() == target_name());
+ ASSERT(target.name() == target_name() || ValidateInteceptor(target));
DEBUG_ASSERT(!HasCheck(class_ids));
ASSERT(NumArgsTested() > 1); // Otherwise use 'AddReceiverCheck'.
ASSERT(class_ids.length() == NumArgsTested());
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698