| 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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 pop(scratch1); | 573 pop(scratch1); |
| 574 fstp_d(FieldOperand(elements, key, times_4, | 574 fstp_d(FieldOperand(elements, key, times_4, |
| 575 FixedDoubleArray::kHeaderSize - elements_offset)); | 575 FixedDoubleArray::kHeaderSize - elements_offset)); |
| 576 } | 576 } |
| 577 bind(&done); | 577 bind(&done); |
| 578 } | 578 } |
| 579 | 579 |
| 580 | 580 |
| 581 void MacroAssembler::CompareMap(Register obj, | 581 void MacroAssembler::CompareMap(Register obj, |
| 582 Handle<Map> map, | 582 Handle<Map> map, |
| 583 Label* early_success, | 583 Label* early_success) { |
| 584 CompareMapMode mode) { | |
| 585 cmp(FieldOperand(obj, HeapObject::kMapOffset), map); | 584 cmp(FieldOperand(obj, HeapObject::kMapOffset), map); |
| 586 if (mode == ALLOW_ELEMENT_TRANSITION_MAPS) { | |
| 587 ElementsKind kind = map->elements_kind(); | |
| 588 if (IsFastElementsKind(kind)) { | |
| 589 bool packed = IsFastPackedElementsKind(kind); | |
| 590 Map* current_map = *map; | |
| 591 while (CanTransitionToMoreGeneralFastElementsKind(kind, packed)) { | |
| 592 kind = GetNextMoreGeneralFastElementsKind(kind, packed); | |
| 593 current_map = current_map->LookupElementsTransitionMap(kind); | |
| 594 if (!current_map) break; | |
| 595 j(equal, early_success, Label::kNear); | |
| 596 cmp(FieldOperand(obj, HeapObject::kMapOffset), | |
| 597 Handle<Map>(current_map)); | |
| 598 } | |
| 599 } | |
| 600 } | |
| 601 } | 585 } |
| 602 | 586 |
| 603 | 587 |
| 604 void MacroAssembler::CheckMap(Register obj, | 588 void MacroAssembler::CheckMap(Register obj, |
| 605 Handle<Map> map, | 589 Handle<Map> map, |
| 606 Label* fail, | 590 Label* fail, |
| 607 SmiCheckType smi_check_type, | 591 SmiCheckType smi_check_type) { |
| 608 CompareMapMode mode) { | |
| 609 if (smi_check_type == DO_SMI_CHECK) { | 592 if (smi_check_type == DO_SMI_CHECK) { |
| 610 JumpIfSmi(obj, fail); | 593 JumpIfSmi(obj, fail); |
| 611 } | 594 } |
| 612 | 595 |
| 613 Label success; | 596 Label success; |
| 614 CompareMap(obj, map, &success, mode); | 597 CompareMap(obj, map, &success); |
| 615 j(not_equal, fail); | 598 j(not_equal, fail); |
| 616 bind(&success); | 599 bind(&success); |
| 617 } | 600 } |
| 618 | 601 |
| 619 | 602 |
| 620 void MacroAssembler::DispatchMap(Register obj, | 603 void MacroAssembler::DispatchMap(Register obj, |
| 621 Register unused, | 604 Register unused, |
| 622 Handle<Map> map, | 605 Handle<Map> map, |
| 623 Handle<Code> success, | 606 Handle<Code> success, |
| 624 SmiCheckType smi_check_type) { | 607 SmiCheckType smi_check_type) { |
| (...skipping 2490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3115 j(greater, &no_info_available); | 3098 j(greater, &no_info_available); |
| 3116 cmp(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), | 3099 cmp(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), |
| 3117 Immediate(Handle<Map>(isolate()->heap()->allocation_site_info_map()))); | 3100 Immediate(Handle<Map>(isolate()->heap()->allocation_site_info_map()))); |
| 3118 bind(&no_info_available); | 3101 bind(&no_info_available); |
| 3119 } | 3102 } |
| 3120 | 3103 |
| 3121 | 3104 |
| 3122 } } // namespace v8::internal | 3105 } } // namespace v8::internal |
| 3123 | 3106 |
| 3124 #endif // V8_TARGET_ARCH_IA32 | 3107 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |