OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
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 2595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2606 __ lw(map, FieldMemOperand(object, HeapObject::kMapOffset)); | 2606 __ lw(map, FieldMemOperand(object, HeapObject::kMapOffset)); |
2607 | 2607 |
2608 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); | 2608 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); |
2609 __ bind(deferred->map_check()); // Label for calculating code patching. | 2609 __ bind(deferred->map_check()); // Label for calculating code patching. |
2610 // We use Factory::the_hole_value() on purpose instead of loading from the | 2610 // We use Factory::the_hole_value() on purpose instead of loading from the |
2611 // root array to force relocation to be able to later patch with | 2611 // root array to force relocation to be able to later patch with |
2612 // the cached map. | 2612 // the cached map. |
2613 Handle<Cell> cell = factory()->NewCell(factory()->the_hole_value()); | 2613 Handle<Cell> cell = factory()->NewCell(factory()->the_hole_value()); |
2614 __ li(at, Operand(Handle<Object>(cell))); | 2614 __ li(at, Operand(Handle<Object>(cell))); |
2615 __ lw(at, FieldMemOperand(at, PropertyCell::kValueOffset)); | 2615 __ lw(at, FieldMemOperand(at, PropertyCell::kValueOffset)); |
2616 __ Branch(&cache_miss, ne, map, Operand(at)); | 2616 __ BranchShort(&cache_miss, ne, map, Operand(at)); |
2617 // We use Factory::the_hole_value() on purpose instead of loading from the | 2617 // We use Factory::the_hole_value() on purpose instead of loading from the |
2618 // root array to force relocation to be able to later patch | 2618 // root array to force relocation to be able to later patch |
2619 // with true or false. | 2619 // with true or false. The distance from map check has to be constant. |
2620 __ li(result, Operand(factory()->the_hole_value()), CONSTANT_SIZE); | 2620 __ li(result, Operand(factory()->the_hole_value()), CONSTANT_SIZE); |
2621 __ Branch(&done); | 2621 __ Branch(&done); |
2622 | 2622 |
2623 // The inlined call site cache did not match. Check null and string before | 2623 // The inlined call site cache did not match. Check null and string before |
2624 // calling the deferred code. | 2624 // calling the deferred code. |
2625 __ bind(&cache_miss); | 2625 __ bind(&cache_miss); |
2626 // Null is not instance of anything. | 2626 // Null is not instance of anything. |
2627 __ LoadRoot(temp, Heap::kNullValueRootIndex); | 2627 __ LoadRoot(temp, Heap::kNullValueRootIndex); |
2628 __ Branch(&false_result, eq, object, Operand(temp)); | 2628 __ Branch(&false_result, eq, object, Operand(temp)); |
2629 | 2629 |
(...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3748 ASSERT(ToDoubleRegister(instr->left()).is(f2)); | 3748 ASSERT(ToDoubleRegister(instr->left()).is(f2)); |
3749 ASSERT(ToDoubleRegister(instr->result()).is(f0)); | 3749 ASSERT(ToDoubleRegister(instr->result()).is(f0)); |
3750 | 3750 |
3751 if (exponent_type.IsSmi()) { | 3751 if (exponent_type.IsSmi()) { |
3752 MathPowStub stub(MathPowStub::TAGGED); | 3752 MathPowStub stub(MathPowStub::TAGGED); |
3753 __ CallStub(&stub); | 3753 __ CallStub(&stub); |
3754 } else if (exponent_type.IsTagged()) { | 3754 } else if (exponent_type.IsTagged()) { |
3755 Label no_deopt; | 3755 Label no_deopt; |
3756 __ JumpIfSmi(a2, &no_deopt); | 3756 __ JumpIfSmi(a2, &no_deopt); |
3757 __ lw(t3, FieldMemOperand(a2, HeapObject::kMapOffset)); | 3757 __ lw(t3, FieldMemOperand(a2, HeapObject::kMapOffset)); |
| 3758 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); |
3758 DeoptimizeIf(ne, instr->environment(), t3, Operand(at)); | 3759 DeoptimizeIf(ne, instr->environment(), t3, Operand(at)); |
3759 __ bind(&no_deopt); | 3760 __ bind(&no_deopt); |
3760 MathPowStub stub(MathPowStub::TAGGED); | 3761 MathPowStub stub(MathPowStub::TAGGED); |
3761 __ CallStub(&stub); | 3762 __ CallStub(&stub); |
3762 } else if (exponent_type.IsInteger32()) { | 3763 } else if (exponent_type.IsInteger32()) { |
3763 MathPowStub stub(MathPowStub::INTEGER); | 3764 MathPowStub stub(MathPowStub::INTEGER); |
3764 __ CallStub(&stub); | 3765 __ CallStub(&stub); |
3765 } else { | 3766 } else { |
3766 ASSERT(exponent_type.IsDouble()); | 3767 ASSERT(exponent_type.IsDouble()); |
3767 MathPowStub stub(MathPowStub::DOUBLE); | 3768 MathPowStub stub(MathPowStub::DOUBLE); |
(...skipping 1962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5730 __ Subu(scratch, result, scratch); | 5731 __ Subu(scratch, result, scratch); |
5731 __ lw(result, FieldMemOperand(scratch, | 5732 __ lw(result, FieldMemOperand(scratch, |
5732 FixedArray::kHeaderSize - kPointerSize)); | 5733 FixedArray::kHeaderSize - kPointerSize)); |
5733 __ bind(&done); | 5734 __ bind(&done); |
5734 } | 5735 } |
5735 | 5736 |
5736 | 5737 |
5737 #undef __ | 5738 #undef __ |
5738 | 5739 |
5739 } } // namespace v8::internal | 5740 } } // namespace v8::internal |
OLD | NEW |