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 |
11 // with the distribution. | 11 // with the distribution. |
12 // * Neither the name of Google Inc. nor the names of its | 12 // * Neither the name of Google Inc. nor the names of its |
13 // contributors may be used to endorse or promote products derived | 13 // contributors may be used to endorse or promote products derived |
14 // from this software without specific prior written permission. | 14 // from this software without specific prior written permission. |
15 // | 15 // |
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #include "a64/lithium-codegen-a64.h" | 30 #include "arm64/lithium-codegen-arm64.h" |
31 #include "a64/lithium-gap-resolver-a64.h" | 31 #include "arm64/lithium-gap-resolver-arm64.h" |
32 #include "code-stubs.h" | 32 #include "code-stubs.h" |
33 #include "stub-cache.h" | 33 #include "stub-cache.h" |
34 #include "hydrogen-osr.h" | 34 #include "hydrogen-osr.h" |
35 | 35 |
36 namespace v8 { | 36 namespace v8 { |
37 namespace internal { | 37 namespace internal { |
38 | 38 |
39 | 39 |
40 class SafepointGenerator V8_FINAL : public CallWrapper { | 40 class SafepointGenerator V8_FINAL : public CallWrapper { |
41 public: | 41 public: |
(...skipping 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1691 case Token::MUL: __ Fmul(result, left, right); break; | 1691 case Token::MUL: __ Fmul(result, left, right); break; |
1692 case Token::DIV: __ Fdiv(result, left, right); break; | 1692 case Token::DIV: __ Fdiv(result, left, right); break; |
1693 case Token::MOD: { | 1693 case Token::MOD: { |
1694 // The ECMA-262 remainder operator is the remainder from a truncating | 1694 // The ECMA-262 remainder operator is the remainder from a truncating |
1695 // (round-towards-zero) division. Note that this differs from IEEE-754. | 1695 // (round-towards-zero) division. Note that this differs from IEEE-754. |
1696 // | 1696 // |
1697 // TODO(jbramley): See if it's possible to do this inline, rather than by | 1697 // TODO(jbramley): See if it's possible to do this inline, rather than by |
1698 // calling a helper function. With frintz (to produce the intermediate | 1698 // calling a helper function. With frintz (to produce the intermediate |
1699 // quotient) and fmsub (to calculate the remainder without loss of | 1699 // quotient) and fmsub (to calculate the remainder without loss of |
1700 // precision), it should be possible. However, we would need support for | 1700 // precision), it should be possible. However, we would need support for |
1701 // fdiv in round-towards-zero mode, and the A64 simulator doesn't support | 1701 // fdiv in round-towards-zero mode, and the ARM64 simulator doesn't |
1702 // that yet. | 1702 // support that yet. |
1703 ASSERT(left.Is(d0)); | 1703 ASSERT(left.Is(d0)); |
1704 ASSERT(right.Is(d1)); | 1704 ASSERT(right.Is(d1)); |
1705 __ CallCFunction( | 1705 __ CallCFunction( |
1706 ExternalReference::mod_two_doubles_operation(isolate()), | 1706 ExternalReference::mod_two_doubles_operation(isolate()), |
1707 0, 2); | 1707 0, 2); |
1708 ASSERT(result.Is(d0)); | 1708 ASSERT(result.Is(d0)); |
1709 break; | 1709 break; |
1710 } | 1710 } |
1711 default: | 1711 default: |
1712 UNREACHABLE(); | 1712 UNREACHABLE(); |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1993 ASSERT(ToRegister(instr->result()).Is(x0)); | 1993 ASSERT(ToRegister(instr->result()).Is(x0)); |
1994 | 1994 |
1995 LPointerMap* pointers = instr->pointer_map(); | 1995 LPointerMap* pointers = instr->pointer_map(); |
1996 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); | 1996 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); |
1997 | 1997 |
1998 if (instr->target()->IsConstantOperand()) { | 1998 if (instr->target()->IsConstantOperand()) { |
1999 LConstantOperand* target = LConstantOperand::cast(instr->target()); | 1999 LConstantOperand* target = LConstantOperand::cast(instr->target()); |
2000 Handle<Code> code = Handle<Code>::cast(ToHandle(target)); | 2000 Handle<Code> code = Handle<Code>::cast(ToHandle(target)); |
2001 generator.BeforeCall(__ CallSize(code, RelocInfo::CODE_TARGET)); | 2001 generator.BeforeCall(__ CallSize(code, RelocInfo::CODE_TARGET)); |
2002 // TODO(all): on ARM we use a call descriptor to specify a storage mode | 2002 // TODO(all): on ARM we use a call descriptor to specify a storage mode |
2003 // but on A64 we only have one storage mode so it isn't necessary. Check | 2003 // but on ARM64 we only have one storage mode so it isn't necessary. Check |
2004 // this understanding is correct. | 2004 // this understanding is correct. |
2005 __ Call(code, RelocInfo::CODE_TARGET, TypeFeedbackId::None()); | 2005 __ Call(code, RelocInfo::CODE_TARGET, TypeFeedbackId::None()); |
2006 } else { | 2006 } else { |
2007 ASSERT(instr->target()->IsRegister()); | 2007 ASSERT(instr->target()->IsRegister()); |
2008 Register target = ToRegister(instr->target()); | 2008 Register target = ToRegister(instr->target()); |
2009 generator.BeforeCall(__ CallSize(target)); | 2009 generator.BeforeCall(__ CallSize(target)); |
2010 __ Add(target, target, Code::kHeaderSize - kHeapObjectTag); | 2010 __ Add(target, target, Code::kHeaderSize - kHeapObjectTag); |
2011 __ Call(target); | 2011 __ Call(target); |
2012 } | 2012 } |
2013 generator.AfterCall(); | 2013 generator.AfterCall(); |
(...skipping 3841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5855 __ Bind(&out_of_object); | 5855 __ Bind(&out_of_object); |
5856 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5856 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
5857 // Index is equal to negated out of object property index plus 1. | 5857 // Index is equal to negated out of object property index plus 1. |
5858 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5858 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
5859 __ Ldr(result, FieldMemOperand(result, | 5859 __ Ldr(result, FieldMemOperand(result, |
5860 FixedArray::kHeaderSize - kPointerSize)); | 5860 FixedArray::kHeaderSize - kPointerSize)); |
5861 __ Bind(&done); | 5861 __ Bind(&done); |
5862 } | 5862 } |
5863 | 5863 |
5864 } } // namespace v8::internal | 5864 } } // namespace v8::internal |
OLD | NEW |