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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3532 matching lines...) Expand 10 before | Expand all | Expand 10 after
3543 JSArray::kSize + AllocationMemento::kSize - kHeapObjectTag)); 3543 JSArray::kSize + AllocationMemento::kSize - kHeapObjectTag));
3544 cmp(scratch_reg, Immediate(new_space_start)); 3544 cmp(scratch_reg, Immediate(new_space_start));
3545 j(less, no_memento_found); 3545 j(less, no_memento_found);
3546 cmp(scratch_reg, Operand::StaticVariable(new_space_allocation_top)); 3546 cmp(scratch_reg, Operand::StaticVariable(new_space_allocation_top));
3547 j(greater, no_memento_found); 3547 j(greater, no_memento_found);
3548 cmp(MemOperand(scratch_reg, -AllocationMemento::kSize), 3548 cmp(MemOperand(scratch_reg, -AllocationMemento::kSize),
3549 Immediate(isolate()->factory()->allocation_memento_map())); 3549 Immediate(isolate()->factory()->allocation_memento_map()));
3550 } 3550 }
3551 3551
3552 3552
3553 void MacroAssembler::HasDictionaryInPrototypeChain(
3554 Register object,
3555 Register elements,
3556 Register scratch,
3557 Label* found) {
3558 Factory* factory = isolate()->factory();
3559 Register temp = elements;
3560 Label loop_again;
3561
3562 // scratch contained elements pointer.
3563 mov(temp, object);
3564
3565 // Loop based on the map going up the prototype chain.
3566 bind(&loop_again);
3567 mov(temp, FieldOperand(temp, HeapObject::kMapOffset));
3568 mov(scratch, FieldOperand(temp, Map::kBitField2Offset));
3569 and_(scratch, Map::kElementsKindMask);
3570 shr(scratch, Map::kElementsKindShift);
3571 cmp(scratch, Immediate(DICTIONARY_ELEMENTS));
3572 j(equal, found);
3573 mov(temp, FieldOperand(temp, Map::kPrototypeOffset));
3574 cmp(temp, Immediate(factory->null_value()));
3575 j(not_equal, &loop_again);
3576
3577 // Restore elements
3578 mov(elements, FieldOperand(object, JSObject::kElementsOffset));
3579 }
3580
3553 } } // namespace v8::internal 3581 } } // namespace v8::internal
3554 3582
3555 #endif // V8_TARGET_ARCH_IA32 3583 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698