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

Unified Diff: src/objects-inl.h

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: 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
« src/objects.cc ('K') | « src/objects.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 49fd9d4816af83fbc6d364f872e83ca8ca2f7a3b..1867787888bbc75c9b867b8191a0f6e57923a8fe 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -4591,6 +4591,24 @@ bool Code::IsWeakObjectInOptimizedCode(Object* object) {
}
+class Code::FindAndReplacePattern {
+ public:
+ FindAndReplacePattern() : count_(0) { }
+ void Add(Handle<Map> map_to_find, Handle<Object> obj_to_replace) {
+ ASSERT(count_ < kMaxCount);
+ find_[count_] = map_to_find;
+ replace_[count_] = obj_to_replace;
+ ++count_;
+ }
+ private:
+ static const int kMaxCount = 4;
+ int count_;
+ Handle<Map> find_[kMaxCount];
+ Handle<Object> replace_[kMaxCount];
+ friend class Code;
+};
+
+
Object* Map::prototype() {
return READ_FIELD(this, kPrototypeOffset);
}
« src/objects.cc ('K') | « src/objects.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698