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

Unified Diff: src/code-stubs.cc

Issue 2055793002: Revert of [ic] Don't pollute per-map code cache with CompareIC stubs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 | « src/code-stubs.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index d656d583e42a90e785d567a46fa189320c3fd865..07cb4f11dd10b6fd9f8749675a7714e16360d9cc 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -370,6 +370,40 @@
Condition CompareICStub::GetCondition() const {
return CompareIC::ComputeCondition(op());
+}
+
+
+void CompareICStub::AddToSpecialCache(Handle<Code> new_object) {
+ DCHECK(*known_map_ != NULL);
+ Isolate* isolate = new_object->GetIsolate();
+ Factory* factory = isolate->factory();
+ return Map::UpdateCodeCache(known_map_,
+ strict() ?
+ factory->strict_compare_ic_string() :
+ factory->compare_ic_string(),
+ new_object);
+}
+
+
+bool CompareICStub::FindCodeInSpecialCache(Code** code_out) {
+ Code::Flags flags = Code::ComputeFlags(
+ GetCodeKind(),
+ UNINITIALIZED);
+ Name* name = strict() ? isolate()->heap()->strict_compare_ic_string()
+ : isolate()->heap()->compare_ic_string();
+ Code* code = known_map_->LookupInCodeCache(name, flags);
+ if (code != nullptr) {
+ *code_out = code;
+#ifdef DEBUG
+ CompareICStub decode((*code_out)->stub_key(), isolate());
+ DCHECK(op() == decode.op());
+ DCHECK(left() == decode.left());
+ DCHECK(right() == decode.right());
+ DCHECK(state() == decode.state());
+#endif
+ return true;
+ }
+ return false;
}
« no previous file with comments | « src/code-stubs.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698