| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1615 // | 1615 // |
| 1616 // TODO(jbramley): See if it's possible to do this inline, rather than by | 1616 // TODO(jbramley): See if it's possible to do this inline, rather than by |
| 1617 // calling a helper function. With frintz (to produce the intermediate | 1617 // calling a helper function. With frintz (to produce the intermediate |
| 1618 // quotient) and fmsub (to calculate the remainder without loss of | 1618 // quotient) and fmsub (to calculate the remainder without loss of |
| 1619 // precision), it should be possible. However, we would need support for | 1619 // precision), it should be possible. However, we would need support for |
| 1620 // fdiv in round-towards-zero mode, and the A64 simulator doesn't support | 1620 // fdiv in round-towards-zero mode, and the A64 simulator doesn't support |
| 1621 // that yet. | 1621 // that yet. |
| 1622 ASSERT(left.Is(d0)); | 1622 ASSERT(left.Is(d0)); |
| 1623 ASSERT(right.Is(d1)); | 1623 ASSERT(right.Is(d1)); |
| 1624 __ CallCFunction( | 1624 __ CallCFunction( |
| 1625 ExternalReference::double_fp_operation(Token::MOD, isolate()), | 1625 ExternalReference::mod_two_doubles_operation(isolate()), |
| 1626 0, 2); | 1626 0, 2); |
| 1627 ASSERT(result.Is(d0)); | 1627 ASSERT(result.Is(d0)); |
| 1628 break; | 1628 break; |
| 1629 } | 1629 } |
| 1630 default: | 1630 default: |
| 1631 UNREACHABLE(); | 1631 UNREACHABLE(); |
| 1632 break; | 1632 break; |
| 1633 } | 1633 } |
| 1634 } | 1634 } |
| 1635 | 1635 |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1989 case CodeStub::SubString: { | 1989 case CodeStub::SubString: { |
| 1990 SubStringStub stub; | 1990 SubStringStub stub; |
| 1991 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 1991 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
| 1992 break; | 1992 break; |
| 1993 } | 1993 } |
| 1994 case CodeStub::StringCompare: { | 1994 case CodeStub::StringCompare: { |
| 1995 StringCompareStub stub; | 1995 StringCompareStub stub; |
| 1996 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 1996 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
| 1997 break; | 1997 break; |
| 1998 } | 1998 } |
| 1999 case CodeStub::TranscendentalCache: { | |
| 2000 __ Peek(x0, 0); | |
| 2001 TranscendentalCacheStub stub(instr->transcendental_type(), | |
| 2002 TranscendentalCacheStub::TAGGED); | |
| 2003 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | |
| 2004 break; | |
| 2005 } | |
| 2006 default: | 1999 default: |
| 2007 UNREACHABLE(); | 2000 UNREACHABLE(); |
| 2008 } | 2001 } |
| 2009 } | 2002 } |
| 2010 | 2003 |
| 2011 | 2004 |
| 2012 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { | 2005 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { |
| 2013 GenerateOsrPrologue(); | 2006 GenerateOsrPrologue(); |
| 2014 } | 2007 } |
| 2015 | 2008 |
| (...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3522 | 3515 |
| 3523 Register result = ToRegister(instr->result()); | 3516 Register result = ToRegister(instr->result()); |
| 3524 Register source; | 3517 Register source; |
| 3525 if (access.IsInobject()) { | 3518 if (access.IsInobject()) { |
| 3526 source = object; | 3519 source = object; |
| 3527 } else { | 3520 } else { |
| 3528 // Load the properties array, using result as a scratch register. | 3521 // Load the properties array, using result as a scratch register. |
| 3529 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 3522 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
| 3530 source = result; | 3523 source = result; |
| 3531 } | 3524 } |
| 3532 __ Load(result, FieldMemOperand(source, offset), access.representation()); | 3525 |
| 3526 if (access.representation().IsSmi() && |
| 3527 instr->hydrogen()->representation().IsInteger32()) { |
| 3528 // Read int value directly from upper half of the smi. |
| 3529 __ Load(result, UntagSmiFieldMemOperand(source, offset), |
| 3530 Representation::Integer32()); |
| 3531 } else { |
| 3532 __ Load(result, FieldMemOperand(source, offset), access.representation()); |
| 3533 } |
| 3533 } | 3534 } |
| 3534 | 3535 |
| 3535 | 3536 |
| 3536 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3537 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
| 3537 // LoadIC expects x2 to hold the name, and x0 to hold the receiver. | 3538 // LoadIC expects x2 to hold the name, and x0 to hold the receiver. |
| 3538 ASSERT(ToRegister(instr->object()).is(x0)); | 3539 ASSERT(ToRegister(instr->object()).is(x0)); |
| 3539 __ Mov(x2, Operand(instr->name())); | 3540 __ Mov(x2, Operand(instr->name())); |
| 3540 | 3541 |
| 3541 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); | 3542 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); |
| 3542 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3543 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3782 // Check if the result needs to be corrected. | 3783 // Check if the result needs to be corrected. |
| 3783 __ Msub(remainder, result, right, left); | 3784 __ Msub(remainder, result, right, left); |
| 3784 __ Cbz(remainder, &done); | 3785 __ Cbz(remainder, &done); |
| 3785 __ Sub(result, result, 1); | 3786 __ Sub(result, result, 1); |
| 3786 | 3787 |
| 3787 __ Bind(&done); | 3788 __ Bind(&done); |
| 3788 } | 3789 } |
| 3789 | 3790 |
| 3790 | 3791 |
| 3791 void LCodeGen::DoMathLog(LMathLog* instr) { | 3792 void LCodeGen::DoMathLog(LMathLog* instr) { |
| 3792 ASSERT(ToDoubleRegister(instr->result()).is(d0)); | 3793 ASSERT(instr->IsMarkedAsCall()); |
| 3793 TranscendentalCacheStub stub(TranscendentalCache::LOG, | 3794 ASSERT(ToDoubleRegister(instr->value()).is(d0)); |
| 3794 TranscendentalCacheStub::UNTAGGED); | 3795 __ CallCFunction(ExternalReference::math_log_double_function(isolate()), |
| 3795 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 3796 0, 1); |
| 3796 ASSERT(ToDoubleRegister(instr->result()).Is(d0)); | 3797 ASSERT(ToDoubleRegister(instr->result()).Is(d0)); |
| 3797 } | 3798 } |
| 3798 | 3799 |
| 3799 | 3800 |
| 3800 void LCodeGen::DoMathPowHalf(LMathPowHalf* instr) { | 3801 void LCodeGen::DoMathPowHalf(LMathPowHalf* instr) { |
| 3801 DoubleRegister input = ToDoubleRegister(instr->value()); | 3802 DoubleRegister input = ToDoubleRegister(instr->value()); |
| 3802 DoubleRegister result = ToDoubleRegister(instr->result()); | 3803 DoubleRegister result = ToDoubleRegister(instr->result()); |
| 3803 Label done; | 3804 Label done; |
| 3804 | 3805 |
| 3805 // Math.pow(x, 0.5) differs from fsqrt(x) in the following cases: | 3806 // Math.pow(x, 0.5) differs from fsqrt(x) in the following cases: |
| (...skipping 1819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5625 __ Bind(&out_of_object); | 5626 __ Bind(&out_of_object); |
| 5626 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5627 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
| 5627 // Index is equal to negated out of object property index plus 1. | 5628 // Index is equal to negated out of object property index plus 1. |
| 5628 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5629 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
| 5629 __ Ldr(result, FieldMemOperand(result, | 5630 __ Ldr(result, FieldMemOperand(result, |
| 5630 FixedArray::kHeaderSize - kPointerSize)); | 5631 FixedArray::kHeaderSize - kPointerSize)); |
| 5631 __ Bind(&done); | 5632 __ Bind(&done); |
| 5632 } | 5633 } |
| 5633 | 5634 |
| 5634 } } // namespace v8::internal | 5635 } } // namespace v8::internal |
| OLD | NEW |