OLD | NEW |
---|---|
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 Loading... | |
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::HasElementCallbacksInPrototypeChain( | |
3554 Register object, | |
3555 Register elements, | |
3556 Label* found) { | |
3557 Factory* factory = isolate()->factory(); | |
3558 Register scratch = elements; | |
3559 Label loop, not_found; | |
3560 | |
3561 // ebx contained elements pointer. | |
danno
2013/10/30 12:17:45
nit: comment is wrong above (no explicit register
mvstanton
2013/10/30 18:22:28
Done.
| |
3562 mov(scratch, FieldOperand(object, HeapObject::kMapOffset)); | |
danno
2013/10/30 12:17:45
If you move object into scratch before entering th
mvstanton
2013/10/30 18:22:28
Done.
| |
3563 | |
3564 // Loop based on the map going up the prototype chain. | |
3565 bind(&loop); | |
3566 test(FieldOperand(scratch, Map::kBitField4Offset), | |
3567 Immediate(Smi::FromInt(Map::HasElementCallbacks::kMask))); | |
3568 j(not_zero, found); | |
3569 | |
3570 // Next map | |
3571 mov(scratch, FieldOperand(scratch, Map::kPrototypeOffset)); | |
3572 cmp(scratch, Immediate(factory->null_value())); | |
3573 j(equal, ¬_found); | |
3574 mov(scratch, FieldOperand(scratch, HeapObject::kMapOffset)); | |
3575 jmp(&loop); | |
3576 | |
3577 // Restore ebx | |
3578 bind(¬_found); | |
3579 mov(elements, FieldOperand(object, JSObject::kElementsOffset)); | |
3580 } | |
3581 | |
3582 | |
3553 } } // namespace v8::internal | 3583 } } // namespace v8::internal |
3554 | 3584 |
3555 #endif // V8_TARGET_ARCH_IA32 | 3585 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |