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

Unified Diff: src/objects-inl.h

Issue 437083004: Keep function.prototype fast. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add TODO and make .prototype fast on creating the initial map Created 6 years, 4 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.cc ('k') | test/mjsunit/fast-prototype.js » ('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 42b3913e3a2528c6b536e0b27743b747e4db7aa2..32746b0c7a0d9e2100e2a70e47beb80b5d98a992 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -2115,6 +2115,7 @@ bool JSObject::HasFastProperties() {
bool Map::TooManyFastProperties(StoreFromKeyed store_mode) {
if (unused_property_fields() != 0) return false;
+ if (is_prototype_map()) return false;
int minimum = store_mode == CERTAINLY_NOT_STORE_FROM_KEYED ? 128 : 12;
int limit = Max(minimum, inobject_properties());
int external = NumberOfFields() - inobject_properties();
@@ -4445,6 +4446,15 @@ bool Map::is_extensible() {
}
+void Map::mark_prototype_map() {
+ set_bit_field2(IsPrototypeMapBits::update(bit_field2(), true));
+}
+
+bool Map::is_prototype_map() {
+ return IsPrototypeMapBits::decode(bit_field2());
+}
+
+
void Map::set_is_shared(bool value) {
set_bit_field3(IsShared::update(bit_field3(), value));
}
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/fast-prototype.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698