| 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 #if defined(V8_TARGET_ARCH_A64) | 30 #if V8_TARGET_ARCH_A64 |
| 31 | 31 |
| 32 #include "ic-inl.h" | 32 #include "ic-inl.h" |
| 33 #include "codegen.h" | 33 #include "codegen.h" |
| 34 #include "stub-cache.h" | 34 #include "stub-cache.h" |
| 35 | 35 |
| 36 namespace v8 { | 36 namespace v8 { |
| 37 namespace internal { | 37 namespace internal { |
| 38 | 38 |
| 39 | 39 |
| 40 #define __ ACCESS_MASM(masm) | 40 #define __ ACCESS_MASM(masm) |
| (...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1235 Heap::kNoInterceptorResultSentinelRootIndex, | 1235 Heap::kNoInterceptorResultSentinelRootIndex, |
| 1236 interceptor_succeeded); | 1236 interceptor_succeeded); |
| 1237 } | 1237 } |
| 1238 | 1238 |
| 1239 StubCompiler* stub_compiler_; | 1239 StubCompiler* stub_compiler_; |
| 1240 const ParameterCount& arguments_; | 1240 const ParameterCount& arguments_; |
| 1241 Register name_; | 1241 Register name_; |
| 1242 Code::ExtraICState extra_ic_state_; | 1242 Code::ExtraICState extra_ic_state_; |
| 1243 }; | 1243 }; |
| 1244 | 1244 |
| 1245 |
| 1245 void StubCompiler::GenerateTailCall(MacroAssembler* masm, Handle<Code> code) { | 1246 void StubCompiler::GenerateTailCall(MacroAssembler* masm, Handle<Code> code) { |
| 1246 __ Jump(code, RelocInfo::CODE_TARGET); | 1247 __ Jump(code, RelocInfo::CODE_TARGET); |
| 1247 } | 1248 } |
| 1248 | 1249 |
| 1249 | 1250 |
| 1250 #undef __ | 1251 #undef __ |
| 1251 #define __ ACCESS_MASM(masm()) | 1252 #define __ ACCESS_MASM(masm()) |
| 1252 | 1253 |
| 1253 | 1254 |
| 1254 Register StubCompiler::CheckPrototypes(Handle<JSObject> object, | 1255 Register StubCompiler::CheckPrototypes(Handle<JSObject> object, |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1791 // Check that the maps haven't changed. | 1792 // Check that the maps haven't changed. |
| 1792 CheckPrototypes(Handle<JSObject>::cast(object), receiver, holder, x3, x0, | 1793 CheckPrototypes(Handle<JSObject>::cast(object), receiver, holder, x3, x0, |
| 1793 x4, name, &miss); | 1794 x4, name, &miss); |
| 1794 } else { | 1795 } else { |
| 1795 ASSERT(cell->value() == *function); | 1796 ASSERT(cell->value() == *function); |
| 1796 GenerateGlobalReceiverCheck(Handle<JSObject>::cast(object), holder, name, | 1797 GenerateGlobalReceiverCheck(Handle<JSObject>::cast(object), holder, name, |
| 1797 &miss); | 1798 &miss); |
| 1798 GenerateLoadFunctionFromCell(cell, function, &miss); | 1799 GenerateLoadFunctionFromCell(cell, function, &miss); |
| 1799 } | 1800 } |
| 1800 | 1801 |
| 1801 Handle<Smi> kind(Smi::FromInt(GetInitialFastElementsKind()), isolate()); | 1802 Handle<AllocationSite> site = isolate()->factory()->NewAllocationSite(); |
| 1802 Handle<Cell> kind_feedback_cell = isolate()->factory()->NewCell(kind); | 1803 site->set_payload(Smi::FromInt(GetInitialFastElementsKind())); |
| 1804 Handle<Cell> site_feedback_cell = isolate()->factory()->NewCell(site); |
| 1803 __ Mov(x0, argc); | 1805 __ Mov(x0, argc); |
| 1804 __ Mov(x1, Operand(function)); | 1806 __ Mov(x1, Operand(function)); |
| 1805 __ Mov(x2, Operand(kind_feedback_cell)); | 1807 __ Mov(x2, Operand(site_feedback_cell)); |
| 1806 | 1808 |
| 1807 ArrayConstructorStub stub(isolate()); | 1809 ArrayConstructorStub stub(isolate()); |
| 1808 __ TailCallStub(&stub); | 1810 __ TailCallStub(&stub); |
| 1809 | 1811 |
| 1810 __ Bind(&miss); | 1812 __ Bind(&miss); |
| 1811 GenerateMissBranch(); | 1813 GenerateMissBranch(); |
| 1812 | 1814 |
| 1813 // Return the generated code. | 1815 // Return the generated code. |
| 1814 return GetCode(type, name); | 1816 return GetCode(type, name); |
| 1815 } | 1817 } |
| (...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3109 // KeyedStoreCompiler::transition_map(). We should verify which registers are | 3111 // KeyedStoreCompiler::transition_map(). We should verify which registers are |
| 3110 // actually scratch registers, and which are important. For now, we use the same | 3112 // actually scratch registers, and which are important. For now, we use the same |
| 3111 // assignments as ARM to remain on the safe side. | 3113 // assignments as ARM to remain on the safe side. |
| 3112 | 3114 |
| 3113 Register* LoadStubCompiler::registers() { | 3115 Register* LoadStubCompiler::registers() { |
| 3114 // receiver, name, scratch1, scratch2, scratch3, scratch4. | 3116 // receiver, name, scratch1, scratch2, scratch3, scratch4. |
| 3115 static Register registers[] = { x0, x2, x3, x1, x4, x5 }; | 3117 static Register registers[] = { x0, x2, x3, x1, x4, x5 }; |
| 3116 return registers; | 3118 return registers; |
| 3117 } | 3119 } |
| 3118 | 3120 |
| 3121 |
| 3119 Register* KeyedLoadStubCompiler::registers() { | 3122 Register* KeyedLoadStubCompiler::registers() { |
| 3120 // receiver, name/key, scratch1, scratch2, scratch3, scratch4. | 3123 // receiver, name/key, scratch1, scratch2, scratch3, scratch4. |
| 3121 static Register registers[] = { x1, x0, x2, x3, x4, x5 }; | 3124 static Register registers[] = { x1, x0, x2, x3, x4, x5 }; |
| 3122 return registers; | 3125 return registers; |
| 3123 } | 3126 } |
| 3124 | 3127 |
| 3125 | 3128 |
| 3126 Register* StoreStubCompiler::registers() { | 3129 Register* StoreStubCompiler::registers() { |
| 3127 // receiver, name, value, scratch1, scratch2, scratch3. | 3130 // receiver, name, value, scratch1, scratch2, scratch3. |
| 3128 static Register registers[] = { x1, x2, x0, x3, x4, x5 }; | 3131 static Register registers[] = { x1, x2, x0, x3, x4, x5 }; |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3804 // ----------- S t a t e ------------- | 3807 // ----------- S t a t e ------------- |
| 3805 | 3808 |
| 3806 GenerateStoreFastSmiOrDoubleElement(masm, is_js_array, FAST_DOUBLE_ELEMENTS, | 3809 GenerateStoreFastSmiOrDoubleElement(masm, is_js_array, FAST_DOUBLE_ELEMENTS, |
| 3807 store_mode, true); | 3810 store_mode, true); |
| 3808 } | 3811 } |
| 3809 | 3812 |
| 3810 | 3813 |
| 3811 } } // namespace v8::internal | 3814 } } // namespace v8::internal |
| 3812 | 3815 |
| 3813 #endif // V8_TARGET_ARCH_A64 | 3816 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |