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

Unified Diff: src/ia32/macro-assembler-ia32.cc

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: ports. Created 7 years, 1 month 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
Index: src/ia32/macro-assembler-ia32.cc
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc
index ed69fd07686f8d1df9287782fc9f40459744a420..730ec83c4fb4de1967fffdd8416f3b422f1fd835 100644
--- a/src/ia32/macro-assembler-ia32.cc
+++ b/src/ia32/macro-assembler-ia32.cc
@@ -3550,6 +3550,34 @@ void MacroAssembler::TestJSArrayForAllocationMemento(
}
+void MacroAssembler::HasDictionaryInPrototypeChain(
+ Register object,
+ Register elements,
+ Register scratch,
+ Label* found) {
+ Factory* factory = isolate()->factory();
+ Register temp = elements;
+ Label loop_again;
+
+ // scratch contained elements pointer.
+ mov(temp, object);
+
+ // Loop based on the map going up the prototype chain.
+ bind(&loop_again);
+ mov(temp, FieldOperand(temp, HeapObject::kMapOffset));
+ mov(scratch, FieldOperand(temp, Map::kBitField2Offset));
+ and_(scratch, Map::kElementsKindMask);
+ shr(scratch, Map::kElementsKindShift);
+ cmp(scratch, Immediate(DICTIONARY_ELEMENTS));
+ j(equal, found);
+ mov(temp, FieldOperand(temp, Map::kPrototypeOffset));
+ cmp(temp, Immediate(factory->null_value()));
+ j(not_equal, &loop_again);
+
+ // Restore elements
+ mov(elements, FieldOperand(object, JSObject::kElementsOffset));
+}
+
} } // namespace v8::internal
#endif // V8_TARGET_ARCH_IA32

Powered by Google App Engine
This is Rietveld 408576698