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

Unified Diff: src/stub-cache.cc

Issue 197283017: Refactor GetCodeCopyFromTemplate to get a single point where objects are replaced in code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comment Created 6 years, 9 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/objects-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/stub-cache.cc
diff --git a/src/stub-cache.cc b/src/stub-cache.cc
index 52e7f4cf3dfa8fc7581c63dca111b718fd86b96d..77733b8cef0801b8eaa8074a53995129c0dd9067 100644
--- a/src/stub-cache.cc
+++ b/src/stub-cache.cc
@@ -333,8 +333,9 @@ Handle<Code> StubCache::ComputeCompareNil(Handle<Map> receiver_map,
if (!cached_ic.is_null()) return cached_ic;
}
- Handle<Code> ic = stub.GetCodeCopyFromTemplate(isolate_);
- ic->ReplaceNthObject(1, isolate_->heap()->meta_map(), *receiver_map);
+ Code::FindAndReplacePattern pattern;
+ pattern.Add(isolate_->factory()->meta_map(), receiver_map);
+ Handle<Code> ic = stub.GetCodeCopy(isolate_, pattern);
if (!receiver_map->is_shared()) {
Map::UpdateCodeCache(receiver_map, name, ic);
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698