| 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 1971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1982 } | 1982 } |
| 1983 | 1983 |
| 1984 StubCompiler::GenerateLoadFunctionPrototype(masm, receiver, x10, x11, &miss); | 1984 StubCompiler::GenerateLoadFunctionPrototype(masm, receiver, x10, x11, &miss); |
| 1985 | 1985 |
| 1986 __ Bind(&miss); | 1986 __ Bind(&miss); |
| 1987 StubCompiler::TailCallBuiltin(masm, | 1987 StubCompiler::TailCallBuiltin(masm, |
| 1988 BaseLoadStoreStubCompiler::MissBuiltin(kind())); | 1988 BaseLoadStoreStubCompiler::MissBuiltin(kind())); |
| 1989 } | 1989 } |
| 1990 | 1990 |
| 1991 | 1991 |
| 1992 void StoreArrayLengthStub::Generate(MacroAssembler* masm) { | |
| 1993 ASM_LOCATION("StoreArrayLengthStub::Generate"); | |
| 1994 // This accepts as a receiver anything JSArray::SetElementsLength accepts | |
| 1995 // (currently anything except for external arrays which means anything with | |
| 1996 // elements of FixedArray type). Value must be a number, but only smis are | |
| 1997 // accepted as the most common case. | |
| 1998 Label miss; | |
| 1999 | |
| 2000 Register receiver; | |
| 2001 Register value; | |
| 2002 if (kind() == Code::KEYED_STORE_IC) { | |
| 2003 // ----------- S t a t e ------------- | |
| 2004 // -- lr : return address | |
| 2005 // -- x2 : receiver | |
| 2006 // -- x1 : key | |
| 2007 // -- x0 : value | |
| 2008 // ----------------------------------- | |
| 2009 Register key = x1; | |
| 2010 receiver = x2; | |
| 2011 value = x0; | |
| 2012 __ Cmp(key, Operand(masm->isolate()->factory()->length_string())); | |
| 2013 __ B(ne, &miss); | |
| 2014 } else { | |
| 2015 ASSERT(kind() == Code::STORE_IC); | |
| 2016 // ----------- S t a t e ------------- | |
| 2017 // -- lr : return address | |
| 2018 // -- x2 : key | |
| 2019 // -- x1 : receiver | |
| 2020 // -- x0 : value | |
| 2021 // ----------------------------------- | |
| 2022 receiver = x1; | |
| 2023 value = x0; | |
| 2024 } | |
| 2025 | |
| 2026 // Check that the receiver isn't a smi. | |
| 2027 __ JumpIfSmi(receiver, &miss); | |
| 2028 | |
| 2029 // Check that the object is a JS array. | |
| 2030 __ CompareObjectType(receiver, x10, x11, JS_ARRAY_TYPE); | |
| 2031 __ B(ne, &miss); | |
| 2032 | |
| 2033 // Check that elements are FixedArray. | |
| 2034 // We rely on StoreIC_ArrayLength below to deal with all types of | |
| 2035 // fast elements (including COW). | |
| 2036 __ Ldr(x10, FieldMemOperand(receiver, JSArray::kElementsOffset)); | |
| 2037 __ CompareObjectType(x10, x11, x12, FIXED_ARRAY_TYPE); | |
| 2038 __ B(ne, &miss); | |
| 2039 | |
| 2040 // Check that the array has fast properties, otherwise the length | |
| 2041 // property might have been redefined. | |
| 2042 __ Ldr(x10, FieldMemOperand(receiver, JSArray::kPropertiesOffset)); | |
| 2043 __ Ldr(x10, FieldMemOperand(x10, FixedArray::kMapOffset)); | |
| 2044 __ CompareRoot(x10, Heap::kHashTableMapRootIndex); | |
| 2045 __ B(eq, &miss); | |
| 2046 | |
| 2047 // Check that value is a smi. | |
| 2048 __ JumpIfNotSmi(value, &miss); | |
| 2049 | |
| 2050 // Prepare tail call to StoreIC_ArrayLength. | |
| 2051 __ Push(receiver, value); | |
| 2052 | |
| 2053 ExternalReference ref = | |
| 2054 ExternalReference(IC_Utility(IC::kStoreIC_ArrayLength), masm->isolate()); | |
| 2055 __ TailCallExternalReference(ref, 2, 1); | |
| 2056 | |
| 2057 __ Bind(&miss); | |
| 2058 StubCompiler::TailCallBuiltin(masm, | |
| 2059 BaseLoadStoreStubCompiler::MissBuiltin(kind())); | |
| 2060 } | |
| 2061 | |
| 2062 | |
| 2063 void InstanceofStub::Generate(MacroAssembler* masm) { | 1992 void InstanceofStub::Generate(MacroAssembler* masm) { |
| 2064 // Stack on entry: | 1993 // Stack on entry: |
| 2065 // jssp[0]: function. | 1994 // jssp[0]: function. |
| 2066 // jssp[8]: object. | 1995 // jssp[8]: object. |
| 2067 // | 1996 // |
| 2068 // Returns result in x0. Zero indicates instanceof, smi 1 indicates not | 1997 // Returns result in x0. Zero indicates instanceof, smi 1 indicates not |
| 2069 // instanceof. | 1998 // instanceof. |
| 2070 | 1999 |
| 2071 Register result = x0; | 2000 Register result = x0; |
| 2072 Register function = right(); | 2001 Register function = right(); |
| (...skipping 3720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5793 MemOperand(fp, 6 * kPointerSize), | 5722 MemOperand(fp, 6 * kPointerSize), |
| 5794 NULL); | 5723 NULL); |
| 5795 } | 5724 } |
| 5796 | 5725 |
| 5797 | 5726 |
| 5798 #undef __ | 5727 #undef __ |
| 5799 | 5728 |
| 5800 } } // namespace v8::internal | 5729 } } // namespace v8::internal |
| 5801 | 5730 |
| 5802 #endif // V8_TARGET_ARCH_A64 | 5731 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |