| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 Isolate* isolate, | 180 Isolate* isolate, |
| 181 CodeStubInterfaceDescriptor* descriptor) { | 181 CodeStubInterfaceDescriptor* descriptor) { |
| 182 // x1: receiver | 182 // x1: receiver |
| 183 static Register registers[] = { x1 }; | 183 static Register registers[] = { x1 }; |
| 184 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 184 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); |
| 185 descriptor->register_params_ = registers; | 185 descriptor->register_params_ = registers; |
| 186 descriptor->deoptimization_handler_ = NULL; | 186 descriptor->deoptimization_handler_ = NULL; |
| 187 } | 187 } |
| 188 | 188 |
| 189 | 189 |
| 190 void StringLengthStub::InitializeInterfaceDescriptor( |
| 191 Isolate* isolate, |
| 192 CodeStubInterfaceDescriptor* descriptor) { |
| 193 static Register registers[] = { x0, x2 }; |
| 194 descriptor->register_param_count_ = 2; |
| 195 descriptor->register_params_ = registers; |
| 196 descriptor->deoptimization_handler_ = NULL; |
| 197 } |
| 198 |
| 199 |
| 200 void KeyedStringLengthStub::InitializeInterfaceDescriptor( |
| 201 Isolate* isolate, |
| 202 CodeStubInterfaceDescriptor* descriptor) { |
| 203 static Register registers[] = { x1, x0 }; |
| 204 descriptor->register_param_count_ = 2; |
| 205 descriptor->register_params_ = registers; |
| 206 descriptor->deoptimization_handler_ = NULL; |
| 207 } |
| 208 |
| 209 |
| 190 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( | 210 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( |
| 191 Isolate* isolate, | 211 Isolate* isolate, |
| 192 CodeStubInterfaceDescriptor* descriptor) { | 212 CodeStubInterfaceDescriptor* descriptor) { |
| 193 // x2: receiver | 213 // x2: receiver |
| 194 // x1: key | 214 // x1: key |
| 195 // x0: value | 215 // x0: value |
| 196 static Register registers[] = { x2, x1, x0 }; | 216 static Register registers[] = { x2, x1, x0 }; |
| 197 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 217 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); |
| 198 descriptor->register_params_ = registers; | 218 descriptor->register_params_ = registers; |
| 199 descriptor->deoptimization_handler_ = | 219 descriptor->deoptimization_handler_ = |
| (...skipping 1762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1962 } | 1982 } |
| 1963 | 1983 |
| 1964 StubCompiler::GenerateLoadFunctionPrototype(masm, receiver, x10, x11, &miss); | 1984 StubCompiler::GenerateLoadFunctionPrototype(masm, receiver, x10, x11, &miss); |
| 1965 | 1985 |
| 1966 __ Bind(&miss); | 1986 __ Bind(&miss); |
| 1967 StubCompiler::TailCallBuiltin(masm, | 1987 StubCompiler::TailCallBuiltin(masm, |
| 1968 BaseLoadStoreStubCompiler::MissBuiltin(kind())); | 1988 BaseLoadStoreStubCompiler::MissBuiltin(kind())); |
| 1969 } | 1989 } |
| 1970 | 1990 |
| 1971 | 1991 |
| 1972 void StringLengthStub::Generate(MacroAssembler* masm) { | |
| 1973 Label miss; | |
| 1974 Register receiver; | |
| 1975 if (kind() == Code::KEYED_LOAD_IC) { | |
| 1976 // ----------- S t a t e ------------- | |
| 1977 // -- lr : return address | |
| 1978 // -- x1 : receiver | |
| 1979 // -- x0 : key | |
| 1980 // ----------------------------------- | |
| 1981 Register key = x0; | |
| 1982 receiver = x1; | |
| 1983 __ Cmp(key, Operand(masm->isolate()->factory()->length_string())); | |
| 1984 __ B(ne, &miss); | |
| 1985 } else { | |
| 1986 ASSERT(kind() == Code::LOAD_IC); | |
| 1987 // ----------- S t a t e ------------- | |
| 1988 // -- lr : return address | |
| 1989 // -- x2 : name | |
| 1990 // -- x0 : receiver | |
| 1991 // -- sp[0] : receiver | |
| 1992 // ----------------------------------- | |
| 1993 receiver = x0; | |
| 1994 } | |
| 1995 | |
| 1996 StubCompiler::GenerateLoadStringLength(masm, receiver, x10, x11, &miss); | |
| 1997 | |
| 1998 __ Bind(&miss); | |
| 1999 StubCompiler::TailCallBuiltin(masm, | |
| 2000 BaseLoadStoreStubCompiler::MissBuiltin(kind())); | |
| 2001 } | |
| 2002 | |
| 2003 | |
| 2004 void StoreArrayLengthStub::Generate(MacroAssembler* masm) { | 1992 void StoreArrayLengthStub::Generate(MacroAssembler* masm) { |
| 2005 ASM_LOCATION("StoreArrayLengthStub::Generate"); | 1993 ASM_LOCATION("StoreArrayLengthStub::Generate"); |
| 2006 // This accepts as a receiver anything JSArray::SetElementsLength accepts | 1994 // This accepts as a receiver anything JSArray::SetElementsLength accepts |
| 2007 // (currently anything except for external arrays which means anything with | 1995 // (currently anything except for external arrays which means anything with |
| 2008 // elements of FixedArray type). Value must be a number, but only smis are | 1996 // elements of FixedArray type). Value must be a number, but only smis are |
| 2009 // accepted as the most common case. | 1997 // accepted as the most common case. |
| 2010 Label miss; | 1998 Label miss; |
| 2011 | 1999 |
| 2012 Register receiver; | 2000 Register receiver; |
| 2013 Register value; | 2001 Register value; |
| (...skipping 3791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5805 MemOperand(fp, 6 * kPointerSize), | 5793 MemOperand(fp, 6 * kPointerSize), |
| 5806 NULL); | 5794 NULL); |
| 5807 } | 5795 } |
| 5808 | 5796 |
| 5809 | 5797 |
| 5810 #undef __ | 5798 #undef __ |
| 5811 | 5799 |
| 5812 } } // namespace v8::internal | 5800 } } // namespace v8::internal |
| 5813 | 5801 |
| 5814 #endif // V8_TARGET_ARCH_A64 | 5802 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |