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

Unified Diff: src/objects-inl.h

Issue 35413006: Correct handling of arrays with callbacks in the prototype chain. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: A few test updates and simpler prototype updating. Created 7 years, 2 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/objects-printer.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 006aff394c20cd517c516e0823424f3aa42c9c80..651acc160b501b3ff849740e51f4e804d9715c2f 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -4287,6 +4287,30 @@ uint32_t Map::bit_field3() {
}
+void Map::set_bit_field4(uint32_t bits) {
+ // Ensure the upper 2 bits have the same value by sign extending it. This is
+ // necessary to be able to use the 31st bit.
+ int value = bits << 1;
+ WRITE_FIELD(this, kBitField4Offset, Smi::FromInt(value >> 1));
+}
+
+
+uint32_t Map::bit_field4() {
+ Object* value = READ_FIELD(this, kBitField4Offset);
+ return Smi::cast(value)->value();
+}
+
+
+void Map::set_has_element_callbacks(bool value) {
+ set_bit_field4(HasElementCallbacks::update(bit_field4(), value));
+}
+
+
+bool Map::has_element_callbacks() {
+ return HasElementCallbacks::decode(bit_field4());
+}
+
+
void Map::ClearTransitions(Heap* heap, WriteBarrierMode mode) {
Object* back_pointer = GetBackPointer();
« src/objects.cc ('K') | « src/objects.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698