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 3933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3944 Representation exponent_type = instr->hydrogen()->right()->representation(); | 3944 Representation exponent_type = instr->hydrogen()->right()->representation(); |
3945 // Having marked this as a call, we can use any registers. | 3945 // Having marked this as a call, we can use any registers. |
3946 // Just make sure that the input/output registers are the expected ones. | 3946 // Just make sure that the input/output registers are the expected ones. |
3947 ASSERT(!instr->right()->IsDoubleRegister() || | 3947 ASSERT(!instr->right()->IsDoubleRegister() || |
3948 ToDoubleRegister(instr->right()).is(d2)); | 3948 ToDoubleRegister(instr->right()).is(d2)); |
3949 ASSERT(!instr->right()->IsRegister() || | 3949 ASSERT(!instr->right()->IsRegister() || |
3950 ToRegister(instr->right()).is(r2)); | 3950 ToRegister(instr->right()).is(r2)); |
3951 ASSERT(ToDoubleRegister(instr->left()).is(d1)); | 3951 ASSERT(ToDoubleRegister(instr->left()).is(d1)); |
3952 ASSERT(ToDoubleRegister(instr->result()).is(d3)); | 3952 ASSERT(ToDoubleRegister(instr->result()).is(d3)); |
3953 | 3953 |
3954 if (exponent_type.IsTagged()) { | 3954 if (exponent_type.IsSmi()) { |
| 3955 MathPowStub stub(MathPowStub::TAGGED); |
| 3956 __ CallStub(&stub); |
| 3957 } else if (exponent_type.IsTagged()) { |
3955 Label no_deopt; | 3958 Label no_deopt; |
3956 __ JumpIfSmi(r2, &no_deopt); | 3959 __ JumpIfSmi(r2, &no_deopt); |
3957 __ ldr(r7, FieldMemOperand(r2, HeapObject::kMapOffset)); | 3960 __ ldr(r7, FieldMemOperand(r2, HeapObject::kMapOffset)); |
3958 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); | 3961 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); |
3959 __ cmp(r7, Operand(ip)); | 3962 __ cmp(r7, Operand(ip)); |
3960 DeoptimizeIf(ne, instr->environment()); | 3963 DeoptimizeIf(ne, instr->environment()); |
3961 __ bind(&no_deopt); | 3964 __ bind(&no_deopt); |
3962 MathPowStub stub(MathPowStub::TAGGED); | 3965 MathPowStub stub(MathPowStub::TAGGED); |
3963 __ CallStub(&stub); | 3966 __ CallStub(&stub); |
3964 } else if (exponent_type.IsInteger32()) { | 3967 } else if (exponent_type.IsInteger32()) { |
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4932 | 4935 |
4933 | 4936 |
4934 void LCodeGen::DoSmiUntag(LSmiUntag* instr) { | 4937 void LCodeGen::DoSmiUntag(LSmiUntag* instr) { |
4935 Register input = ToRegister(instr->value()); | 4938 Register input = ToRegister(instr->value()); |
4936 Register result = ToRegister(instr->result()); | 4939 Register result = ToRegister(instr->result()); |
4937 if (instr->needs_check()) { | 4940 if (instr->needs_check()) { |
4938 STATIC_ASSERT(kHeapObjectTag == 1); | 4941 STATIC_ASSERT(kHeapObjectTag == 1); |
4939 // If the input is a HeapObject, SmiUntag will set the carry flag. | 4942 // If the input is a HeapObject, SmiUntag will set the carry flag. |
4940 __ SmiUntag(result, input, SetCC); | 4943 __ SmiUntag(result, input, SetCC); |
4941 DeoptimizeIf(cs, instr->environment()); | 4944 DeoptimizeIf(cs, instr->environment()); |
4942 } else if (instr->hydrogen()->value()->IsLoadKeyed()) { | |
4943 HLoadKeyed* load = HLoadKeyed::cast(instr->hydrogen()->value()); | |
4944 if (load->UsesMustHandleHole()) { | |
4945 __ SmiUntag(result, input, SetCC); | |
4946 if (load->hole_mode() == ALLOW_RETURN_HOLE) { | |
4947 Label done; | |
4948 __ b(cc, &done); | |
4949 __ mov(result, Operand(Smi::FromInt(0))); | |
4950 __ bind(&done); | |
4951 } else { | |
4952 DeoptimizeIf(cs, instr->environment()); | |
4953 } | |
4954 } else { | |
4955 __ SmiUntag(result, input); | |
4956 } | |
4957 } else { | 4945 } else { |
4958 __ SmiUntag(result, input); | 4946 __ SmiUntag(result, input); |
4959 } | 4947 } |
4960 } | 4948 } |
4961 | 4949 |
4962 | 4950 |
4963 void LCodeGen::EmitNumberUntagD(Register input_reg, | 4951 void LCodeGen::EmitNumberUntagD(Register input_reg, |
4964 DwVfpRegister result_reg, | 4952 DwVfpRegister result_reg, |
4965 bool deoptimize_on_undefined, | 4953 bool deoptimize_on_undefined, |
4966 bool deoptimize_on_minus_zero, | 4954 bool deoptimize_on_minus_zero, |
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5995 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5983 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5996 __ ldr(result, FieldMemOperand(scratch, | 5984 __ ldr(result, FieldMemOperand(scratch, |
5997 FixedArray::kHeaderSize - kPointerSize)); | 5985 FixedArray::kHeaderSize - kPointerSize)); |
5998 __ bind(&done); | 5986 __ bind(&done); |
5999 } | 5987 } |
6000 | 5988 |
6001 | 5989 |
6002 #undef __ | 5990 #undef __ |
6003 | 5991 |
6004 } } // namespace v8::internal | 5992 } } // namespace v8::internal |
OLD | NEW |