OLD | NEW |
---|---|
1 // Copyright 2011 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 3728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3740 isolate()->factory()->NewJSGlobalPropertyCell(target); | 3740 isolate()->factory()->NewJSGlobalPropertyCell(target); |
3741 __ movq(kScratchRegister, cell, RelocInfo::GLOBAL_PROPERTY_CELL); | 3741 __ movq(kScratchRegister, cell, RelocInfo::GLOBAL_PROPERTY_CELL); |
3742 __ cmpq(reg, Operand(kScratchRegister, 0)); | 3742 __ cmpq(reg, Operand(kScratchRegister, 0)); |
3743 } else { | 3743 } else { |
3744 __ Cmp(reg, target); | 3744 __ Cmp(reg, target); |
3745 } | 3745 } |
3746 DeoptimizeIf(not_equal, instr->environment()); | 3746 DeoptimizeIf(not_equal, instr->environment()); |
3747 } | 3747 } |
3748 | 3748 |
3749 | 3749 |
3750 void LCodeGen::DoCheckMapCommon(Register reg, | |
3751 Handle<Map> map, | |
3752 MapCheckMode mode, | |
3753 LEnvironment* env) { | |
3754 Label success; | |
3755 __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), map); | |
3756 if (mode == ALLOW_ELEMENT_TRANSITION_MAPS) { | |
3757 bool ignore; | |
3758 Map* transitioned_double_map = | |
fschneider
2012/01/04 09:20:18
Handle<Map> transitioned_double_map(...)
fschneider
2012/01/04 09:20:18
I'd order this differently and move this down clos
danno
2012/01/04 10:42:15
Done.
danno
2012/01/04 10:42:15
Done.
| |
3759 map->LookupElementsTransitionMap(FAST_DOUBLE_ELEMENTS, &ignore); | |
3760 ASSERT(transitioned_double_map == NULL || | |
3761 map->elements_kind() == FAST_SMI_ONLY_ELEMENTS); | |
3762 Map* transitioned_fast_element_map = | |
fschneider
2012/01/04 09:20:18
Handle<Map> transitioned_fast_element_map(...)
danno
2012/01/04 10:42:15
Done.
| |
3763 map->LookupElementsTransitionMap(FAST_ELEMENTS, &ignore); | |
3764 ASSERT(transitioned_fast_element_map == NULL || | |
3765 map->elements_kind() != FAST_ELEMENTS); | |
3766 if (transitioned_fast_element_map != NULL) { | |
3767 __ j(equal, &success); | |
3768 __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), | |
3769 Handle<Map>(transitioned_fast_element_map)); | |
3770 } | |
3771 | |
3772 if (transitioned_double_map != NULL) { | |
3773 __ j(equal, &success); | |
3774 __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), | |
3775 Handle<Map>(transitioned_double_map)); | |
3776 } | |
3777 } | |
3778 DeoptimizeIf(not_equal, env); | |
3779 __ bind(&success); | |
3780 } | |
3781 | |
3782 | |
3750 void LCodeGen::DoCheckMap(LCheckMap* instr) { | 3783 void LCodeGen::DoCheckMap(LCheckMap* instr) { |
3751 LOperand* input = instr->InputAt(0); | 3784 LOperand* input = instr->InputAt(0); |
3752 ASSERT(input->IsRegister()); | 3785 ASSERT(input->IsRegister()); |
3753 Register reg = ToRegister(input); | 3786 Register reg = ToRegister(input); |
3754 __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), | 3787 Handle<Map> map = Handle<Map>(instr->hydrogen()->map()); |
fschneider
2012/01/04 09:20:18
Simpler would be:
Handle<Map> map = instr->hydrog
danno
2012/01/04 10:42:15
Done.
| |
3755 instr->hydrogen()->map()); | 3788 DoCheckMapCommon(reg, map, instr->hydrogen()->mode(), instr->environment()); |
3756 DeoptimizeIf(not_equal, instr->environment()); | |
3757 } | 3789 } |
3758 | 3790 |
3759 | 3791 |
3760 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { | 3792 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { |
3761 XMMRegister value_reg = ToDoubleRegister(instr->unclamped()); | 3793 XMMRegister value_reg = ToDoubleRegister(instr->unclamped()); |
3762 Register result_reg = ToRegister(instr->result()); | 3794 Register result_reg = ToRegister(instr->result()); |
3763 Register temp_reg = ToRegister(instr->TempAt(0)); | 3795 Register temp_reg = ToRegister(instr->TempAt(0)); |
3764 __ ClampDoubleToUint8(value_reg, xmm0, result_reg, temp_reg); | 3796 __ ClampDoubleToUint8(value_reg, xmm0, result_reg, temp_reg); |
3765 } | 3797 } |
3766 | 3798 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3812 Register reg = ToRegister(instr->TempAt(0)); | 3844 Register reg = ToRegister(instr->TempAt(0)); |
3813 | 3845 |
3814 Handle<JSObject> holder = instr->holder(); | 3846 Handle<JSObject> holder = instr->holder(); |
3815 Handle<JSObject> current_prototype = instr->prototype(); | 3847 Handle<JSObject> current_prototype = instr->prototype(); |
3816 | 3848 |
3817 // Load prototype object. | 3849 // Load prototype object. |
3818 __ LoadHeapObject(reg, current_prototype); | 3850 __ LoadHeapObject(reg, current_prototype); |
3819 | 3851 |
3820 // Check prototype maps up to the holder. | 3852 // Check prototype maps up to the holder. |
3821 while (!current_prototype.is_identical_to(holder)) { | 3853 while (!current_prototype.is_identical_to(holder)) { |
3822 __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), | 3854 DoCheckMapCommon(reg, Handle<Map>(current_prototype->map()), |
3823 Handle<Map>(current_prototype->map())); | 3855 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); |
3824 DeoptimizeIf(not_equal, instr->environment()); | |
3825 current_prototype = | 3856 current_prototype = |
3826 Handle<JSObject>(JSObject::cast(current_prototype->GetPrototype())); | 3857 Handle<JSObject>(JSObject::cast(current_prototype->GetPrototype())); |
3827 // Load next prototype object. | 3858 // Load next prototype object. |
3828 __ LoadHeapObject(reg, current_prototype); | 3859 __ LoadHeapObject(reg, current_prototype); |
3829 } | 3860 } |
3830 | 3861 |
3831 // Check the holder map. | 3862 // Check the holder map. |
3832 __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), | 3863 DoCheckMapCommon(reg, Handle<Map>(current_prototype->map()), |
3833 Handle<Map>(current_prototype->map())); | 3864 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); |
3834 DeoptimizeIf(not_equal, instr->environment()); | |
3835 } | 3865 } |
3836 | 3866 |
3837 | 3867 |
3838 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { | 3868 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { |
3839 Heap* heap = isolate()->heap(); | 3869 Heap* heap = isolate()->heap(); |
3840 ElementsKind boilerplate_elements_kind = | 3870 ElementsKind boilerplate_elements_kind = |
3841 instr->hydrogen()->boilerplate_elements_kind(); | 3871 instr->hydrogen()->boilerplate_elements_kind(); |
3842 | 3872 |
3843 // Deopt if the array literal boilerplate ElementsKind is of a type different | 3873 // Deopt if the array literal boilerplate ElementsKind is of a type different |
3844 // than the expected one. The check isn't necessary if the boilerplate has | 3874 // than the expected one. The check isn't necessary if the boilerplate has |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4329 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 4359 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
4330 ASSERT(osr_pc_offset_ == -1); | 4360 ASSERT(osr_pc_offset_ == -1); |
4331 osr_pc_offset_ = masm()->pc_offset(); | 4361 osr_pc_offset_ = masm()->pc_offset(); |
4332 } | 4362 } |
4333 | 4363 |
4334 #undef __ | 4364 #undef __ |
4335 | 4365 |
4336 } } // namespace v8::internal | 4366 } } // namespace v8::internal |
4337 | 4367 |
4338 #endif // V8_TARGET_ARCH_X64 | 4368 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |