| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
| 8 | 8 |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| 11 #include "src/regexp-macro-assembler.h" | 11 #include "src/regexp-macro-assembler.h" |
| 12 #include "src/stub-cache.h" | 12 #include "src/stub-cache.h" |
| 13 | 13 |
| 14 namespace v8 { | 14 namespace v8 { |
| 15 namespace internal { | 15 namespace internal { |
| 16 | 16 |
| 17 | |
| 18 void FastNewClosureStub::InitializeInterfaceDescriptor( | 17 void FastNewClosureStub::InitializeInterfaceDescriptor( |
| 19 CodeStubInterfaceDescriptor* descriptor) { | 18 CodeStubInterfaceDescriptor* descriptor) { |
| 20 // x2: function info | 19 // x2: function info |
| 21 static Register registers[] = { x2 }; | 20 Register registers[] = { x2 }; |
| 22 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 21 descriptor->Initialize( |
| 23 descriptor->register_params_ = registers; | 22 ARRAY_SIZE(registers), registers, |
| 24 descriptor->deoptimization_handler_ = | 23 Runtime::FunctionForId(Runtime::kHiddenNewClosureFromStubFailure)->entry); |
| 25 Runtime::FunctionForId(Runtime::kHiddenNewClosureFromStubFailure)->entry; | |
| 26 } | 24 } |
| 27 | 25 |
| 28 | 26 |
| 29 void FastNewContextStub::InitializeInterfaceDescriptor( | 27 void FastNewContextStub::InitializeInterfaceDescriptor( |
| 30 CodeStubInterfaceDescriptor* descriptor) { | 28 CodeStubInterfaceDescriptor* descriptor) { |
| 31 // x1: function | 29 // x1: function |
| 32 static Register registers[] = { x1 }; | 30 Register registers[] = { x1 }; |
| 33 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 31 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
| 34 descriptor->register_params_ = registers; | |
| 35 descriptor->deoptimization_handler_ = NULL; | |
| 36 } | 32 } |
| 37 | 33 |
| 38 | 34 |
| 39 void ToNumberStub::InitializeInterfaceDescriptor( | 35 void ToNumberStub::InitializeInterfaceDescriptor( |
| 40 CodeStubInterfaceDescriptor* descriptor) { | 36 CodeStubInterfaceDescriptor* descriptor) { |
| 41 // x0: value | 37 // x0: value |
| 42 static Register registers[] = { x0 }; | 38 Register registers[] = { x0 }; |
| 43 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 39 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
| 44 descriptor->register_params_ = registers; | |
| 45 descriptor->deoptimization_handler_ = NULL; | |
| 46 } | 40 } |
| 47 | 41 |
| 48 | 42 |
| 49 void NumberToStringStub::InitializeInterfaceDescriptor( | 43 void NumberToStringStub::InitializeInterfaceDescriptor( |
| 50 CodeStubInterfaceDescriptor* descriptor) { | 44 CodeStubInterfaceDescriptor* descriptor) { |
| 51 // x0: value | 45 // x0: value |
| 52 static Register registers[] = { x0 }; | 46 Register registers[] = { x0 }; |
| 53 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 47 descriptor->Initialize( |
| 54 descriptor->register_params_ = registers; | 48 ARRAY_SIZE(registers), registers, |
| 55 descriptor->deoptimization_handler_ = | 49 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry); |
| 56 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; | |
| 57 } | 50 } |
| 58 | 51 |
| 59 | 52 |
| 60 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 53 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
| 61 CodeStubInterfaceDescriptor* descriptor) { | 54 CodeStubInterfaceDescriptor* descriptor) { |
| 62 // x3: array literals array | 55 // x3: array literals array |
| 63 // x2: array literal index | 56 // x2: array literal index |
| 64 // x1: constant elements | 57 // x1: constant elements |
| 65 static Register registers[] = { x3, x2, x1 }; | 58 Register registers[] = { x3, x2, x1 }; |
| 66 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 59 Representation representations[] = { |
| 67 descriptor->register_params_ = registers; | |
| 68 static Representation representations[] = { | |
| 69 Representation::Tagged(), | 60 Representation::Tagged(), |
| 70 Representation::Smi(), | 61 Representation::Smi(), |
| 71 Representation::Tagged() }; | 62 Representation::Tagged() }; |
| 72 descriptor->register_param_representations_ = representations; | 63 descriptor->Initialize( |
| 73 descriptor->deoptimization_handler_ = | 64 ARRAY_SIZE(registers), registers, |
| 74 Runtime::FunctionForId( | 65 Runtime::FunctionForId( |
| 75 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; | 66 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry, |
| 67 representations); |
| 76 } | 68 } |
| 77 | 69 |
| 78 | 70 |
| 79 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( | 71 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( |
| 80 CodeStubInterfaceDescriptor* descriptor) { | 72 CodeStubInterfaceDescriptor* descriptor) { |
| 81 // x3: object literals array | 73 // x3: object literals array |
| 82 // x2: object literal index | 74 // x2: object literal index |
| 83 // x1: constant properties | 75 // x1: constant properties |
| 84 // x0: object literal flags | 76 // x0: object literal flags |
| 85 static Register registers[] = { x3, x2, x1, x0 }; | 77 Register registers[] = { x3, x2, x1, x0 }; |
| 86 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 78 descriptor->Initialize( |
| 87 descriptor->register_params_ = registers; | 79 ARRAY_SIZE(registers), registers, |
| 88 descriptor->deoptimization_handler_ = | 80 Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry); |
| 89 Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry; | |
| 90 } | 81 } |
| 91 | 82 |
| 92 | 83 |
| 93 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( | 84 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( |
| 94 CodeStubInterfaceDescriptor* descriptor) { | 85 CodeStubInterfaceDescriptor* descriptor) { |
| 95 // x2: feedback vector | 86 // x2: feedback vector |
| 96 // x3: call feedback slot | 87 // x3: call feedback slot |
| 97 static Register registers[] = { x2, x3 }; | 88 Register registers[] = { x2, x3 }; |
| 98 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 89 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
| 99 descriptor->register_params_ = registers; | |
| 100 descriptor->deoptimization_handler_ = NULL; | |
| 101 } | 90 } |
| 102 | 91 |
| 103 | 92 |
| 104 void KeyedLoadGenericElementStub::InitializeInterfaceDescriptor( | |
| 105 CodeStubInterfaceDescriptor* descriptor) { | |
| 106 static Register registers[] = { x1, x0 }; | |
| 107 descriptor->register_param_count_ = 2; | |
| 108 descriptor->register_params_ = registers; | |
| 109 descriptor->deoptimization_handler_ = | |
| 110 Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry; | |
| 111 } | |
| 112 | |
| 113 | |
| 114 void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( | |
| 115 CodeStubInterfaceDescriptor* descriptor) { | |
| 116 // x1: receiver | |
| 117 // x0: key | |
| 118 static Register registers[] = { x1, x0 }; | |
| 119 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | |
| 120 descriptor->register_params_ = registers; | |
| 121 descriptor->deoptimization_handler_ = | |
| 122 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); | |
| 123 } | |
| 124 | |
| 125 | |
| 126 void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor( | |
| 127 CodeStubInterfaceDescriptor* descriptor) { | |
| 128 // x1: receiver | |
| 129 // x0: key | |
| 130 static Register registers[] = { x1, x0 }; | |
| 131 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | |
| 132 descriptor->register_params_ = registers; | |
| 133 descriptor->deoptimization_handler_ = | |
| 134 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); | |
| 135 } | |
| 136 | |
| 137 | |
| 138 void RegExpConstructResultStub::InitializeInterfaceDescriptor( | 93 void RegExpConstructResultStub::InitializeInterfaceDescriptor( |
| 139 CodeStubInterfaceDescriptor* descriptor) { | 94 CodeStubInterfaceDescriptor* descriptor) { |
| 140 // x2: length | 95 // x2: length |
| 141 // x1: index (of last match) | 96 // x1: index (of last match) |
| 142 // x0: string | 97 // x0: string |
| 143 static Register registers[] = { x2, x1, x0 }; | 98 Register registers[] = { x2, x1, x0 }; |
| 144 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 99 descriptor->Initialize( |
| 145 descriptor->register_params_ = registers; | 100 ARRAY_SIZE(registers), registers, |
| 146 descriptor->deoptimization_handler_ = | 101 Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry); |
| 147 Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry; | |
| 148 } | 102 } |
| 149 | 103 |
| 150 | 104 |
| 151 void LoadFieldStub::InitializeInterfaceDescriptor( | 105 void LoadFieldStub::InitializeInterfaceDescriptor( |
| 152 CodeStubInterfaceDescriptor* descriptor) { | 106 CodeStubInterfaceDescriptor* descriptor) { |
| 153 // x0: receiver | 107 // x0: receiver |
| 154 static Register registers[] = { x0 }; | 108 Register registers[] = { x0 }; |
| 155 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 109 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
| 156 descriptor->register_params_ = registers; | |
| 157 descriptor->deoptimization_handler_ = NULL; | |
| 158 } | 110 } |
| 159 | 111 |
| 160 | 112 |
| 161 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( | 113 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( |
| 162 CodeStubInterfaceDescriptor* descriptor) { | 114 CodeStubInterfaceDescriptor* descriptor) { |
| 163 // x1: receiver | 115 // x1: receiver |
| 164 static Register registers[] = { x1 }; | 116 Register registers[] = { x1 }; |
| 165 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 117 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
| 166 descriptor->register_params_ = registers; | |
| 167 descriptor->deoptimization_handler_ = NULL; | |
| 168 } | 118 } |
| 169 | 119 |
| 170 | 120 |
| 171 void StringLengthStub::InitializeInterfaceDescriptor( | 121 void StringLengthStub::InitializeInterfaceDescriptor( |
| 172 CodeStubInterfaceDescriptor* descriptor) { | 122 CodeStubInterfaceDescriptor* descriptor) { |
| 173 static Register registers[] = { x0, x2 }; | 123 Register registers[] = { x0, x2 }; |
| 174 descriptor->register_param_count_ = 2; | 124 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
| 175 descriptor->register_params_ = registers; | |
| 176 descriptor->deoptimization_handler_ = NULL; | |
| 177 } | 125 } |
| 178 | 126 |
| 179 | 127 |
| 180 void KeyedStringLengthStub::InitializeInterfaceDescriptor( | 128 void KeyedStringLengthStub::InitializeInterfaceDescriptor( |
| 181 CodeStubInterfaceDescriptor* descriptor) { | 129 CodeStubInterfaceDescriptor* descriptor) { |
| 182 static Register registers[] = { x1, x0 }; | 130 Register registers[] = { x1, x0 }; |
| 183 descriptor->register_param_count_ = 2; | 131 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
| 184 descriptor->register_params_ = registers; | |
| 185 descriptor->deoptimization_handler_ = NULL; | |
| 186 } | 132 } |
| 187 | 133 |
| 188 | 134 |
| 189 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( | 135 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( |
| 190 CodeStubInterfaceDescriptor* descriptor) { | 136 CodeStubInterfaceDescriptor* descriptor) { |
| 191 // x2: receiver | 137 // x2: receiver |
| 192 // x1: key | 138 // x1: key |
| 193 // x0: value | 139 // x0: value |
| 194 static Register registers[] = { x2, x1, x0 }; | 140 Register registers[] = { x2, x1, x0 }; |
| 195 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 141 descriptor->Initialize( |
| 196 descriptor->register_params_ = registers; | 142 ARRAY_SIZE(registers), registers, |
| 197 descriptor->deoptimization_handler_ = | 143 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure)); |
| 198 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); | |
| 199 } | 144 } |
| 200 | 145 |
| 201 | 146 |
| 202 void TransitionElementsKindStub::InitializeInterfaceDescriptor( | 147 void TransitionElementsKindStub::InitializeInterfaceDescriptor( |
| 203 CodeStubInterfaceDescriptor* descriptor) { | 148 CodeStubInterfaceDescriptor* descriptor) { |
| 204 // x0: value (js_array) | 149 // x0: value (js_array) |
| 205 // x1: to_map | 150 // x1: to_map |
| 206 static Register registers[] = { x0, x1 }; | 151 Register registers[] = { x0, x1 }; |
| 207 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | |
| 208 descriptor->register_params_ = registers; | |
| 209 Address entry = | 152 Address entry = |
| 210 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry; | 153 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry; |
| 211 descriptor->deoptimization_handler_ = FUNCTION_ADDR(entry); | 154 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 155 FUNCTION_ADDR(entry)); |
| 212 } | 156 } |
| 213 | 157 |
| 214 | 158 |
| 215 void CompareNilICStub::InitializeInterfaceDescriptor( | 159 void CompareNilICStub::InitializeInterfaceDescriptor( |
| 216 CodeStubInterfaceDescriptor* descriptor) { | 160 CodeStubInterfaceDescriptor* descriptor) { |
| 217 // x0: value to compare | 161 // x0: value to compare |
| 218 static Register registers[] = { x0 }; | 162 Register registers[] = { x0 }; |
| 219 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 163 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 220 descriptor->register_params_ = registers; | 164 FUNCTION_ADDR(CompareNilIC_Miss)); |
| 221 descriptor->deoptimization_handler_ = | |
| 222 FUNCTION_ADDR(CompareNilIC_Miss); | |
| 223 descriptor->SetMissHandler( | 165 descriptor->SetMissHandler( |
| 224 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); | 166 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); |
| 225 } | 167 } |
| 226 | 168 |
| 227 | 169 |
| 228 static void InitializeArrayConstructorDescriptor( | 170 static void InitializeArrayConstructorDescriptor( |
| 229 CodeStubInterfaceDescriptor* descriptor, | 171 CodeStubInterfaceDescriptor* descriptor, |
| 230 int constant_stack_parameter_count) { | 172 int constant_stack_parameter_count) { |
| 231 // x1: function | 173 // x1: function |
| 232 // x2: allocation site with elements kind | 174 // x2: allocation site with elements kind |
| 233 // x0: number of arguments to the constructor function | 175 // x0: number of arguments to the constructor function |
| 234 static Register registers_variable_args[] = { x1, x2, x0 }; | 176 Address deopt_handler = Runtime::FunctionForId( |
| 235 static Register registers_no_args[] = { x1, x2 }; | 177 Runtime::kHiddenArrayConstructor)->entry; |
| 236 | 178 |
| 237 if (constant_stack_parameter_count == 0) { | 179 if (constant_stack_parameter_count == 0) { |
| 238 descriptor->register_param_count_ = | 180 Register registers[] = { x1, x2 }; |
| 239 sizeof(registers_no_args) / sizeof(registers_no_args[0]); | 181 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 240 descriptor->register_params_ = registers_no_args; | 182 deopt_handler, |
| 183 NULL, |
| 184 constant_stack_parameter_count, |
| 185 JS_FUNCTION_STUB_MODE); |
| 241 } else { | 186 } else { |
| 242 // stack param count needs (constructor pointer, and single argument) | 187 // stack param count needs (constructor pointer, and single argument) |
| 243 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | 188 Register registers[] = { x1, x2, x0 }; |
| 244 descriptor->stack_parameter_count_ = x0; | 189 Representation representations[] = { |
| 245 descriptor->register_param_count_ = | |
| 246 sizeof(registers_variable_args) / sizeof(registers_variable_args[0]); | |
| 247 descriptor->register_params_ = registers_variable_args; | |
| 248 static Representation representations[] = { | |
| 249 Representation::Tagged(), | 190 Representation::Tagged(), |
| 250 Representation::Tagged(), | 191 Representation::Tagged(), |
| 251 Representation::Integer32() }; | 192 Representation::Integer32() }; |
| 252 descriptor->register_param_representations_ = representations; | 193 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 194 x0, |
| 195 deopt_handler, |
| 196 representations, |
| 197 constant_stack_parameter_count, |
| 198 JS_FUNCTION_STUB_MODE, |
| 199 PASS_ARGUMENTS); |
| 253 } | 200 } |
| 254 | |
| 255 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | |
| 256 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | |
| 257 descriptor->deoptimization_handler_ = | |
| 258 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; | |
| 259 } | 201 } |
| 260 | 202 |
| 261 | 203 |
| 262 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 204 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
| 263 CodeStubInterfaceDescriptor* descriptor) { | 205 CodeStubInterfaceDescriptor* descriptor) { |
| 264 InitializeArrayConstructorDescriptor(descriptor, 0); | 206 InitializeArrayConstructorDescriptor(descriptor, 0); |
| 265 } | 207 } |
| 266 | 208 |
| 267 | 209 |
| 268 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( | 210 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( |
| 269 CodeStubInterfaceDescriptor* descriptor) { | 211 CodeStubInterfaceDescriptor* descriptor) { |
| 270 InitializeArrayConstructorDescriptor(descriptor, 1); | 212 InitializeArrayConstructorDescriptor(descriptor, 1); |
| 271 } | 213 } |
| 272 | 214 |
| 273 | 215 |
| 274 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( | 216 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( |
| 275 CodeStubInterfaceDescriptor* descriptor) { | 217 CodeStubInterfaceDescriptor* descriptor) { |
| 276 InitializeArrayConstructorDescriptor(descriptor, -1); | 218 InitializeArrayConstructorDescriptor(descriptor, -1); |
| 277 } | 219 } |
| 278 | 220 |
| 279 | 221 |
| 280 static void InitializeInternalArrayConstructorDescriptor( | 222 static void InitializeInternalArrayConstructorDescriptor( |
| 281 CodeStubInterfaceDescriptor* descriptor, | 223 CodeStubInterfaceDescriptor* descriptor, |
| 282 int constant_stack_parameter_count) { | 224 int constant_stack_parameter_count) { |
| 283 // x1: constructor function | 225 // x1: constructor function |
| 284 // x0: number of arguments to the constructor function | 226 // x0: number of arguments to the constructor function |
| 285 static Register registers_variable_args[] = { x1, x0 }; | 227 Address deopt_handler = Runtime::FunctionForId( |
| 286 static Register registers_no_args[] = { x1 }; | 228 Runtime::kHiddenInternalArrayConstructor)->entry; |
| 287 | 229 |
| 288 if (constant_stack_parameter_count == 0) { | 230 if (constant_stack_parameter_count == 0) { |
| 289 descriptor->register_param_count_ = | 231 Register registers[] = { x1 }; |
| 290 sizeof(registers_no_args) / sizeof(registers_no_args[0]); | 232 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 291 descriptor->register_params_ = registers_no_args; | 233 deopt_handler, |
| 234 NULL, |
| 235 constant_stack_parameter_count, |
| 236 JS_FUNCTION_STUB_MODE); |
| 292 } else { | 237 } else { |
| 293 // stack param count needs (constructor pointer, and single argument) | 238 // stack param count needs (constructor pointer, and single argument) |
| 294 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | 239 Register registers[] = { x1, x0 }; |
| 295 descriptor->stack_parameter_count_ = x0; | 240 Representation representations[] = { |
| 296 descriptor->register_param_count_ = | |
| 297 sizeof(registers_variable_args) / sizeof(registers_variable_args[0]); | |
| 298 descriptor->register_params_ = registers_variable_args; | |
| 299 static Representation representations[] = { | |
| 300 Representation::Tagged(), | 241 Representation::Tagged(), |
| 301 Representation::Integer32() }; | 242 Representation::Integer32() }; |
| 302 descriptor->register_param_representations_ = representations; | 243 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 244 x0, |
| 245 deopt_handler, |
| 246 representations, |
| 247 constant_stack_parameter_count, |
| 248 JS_FUNCTION_STUB_MODE, |
| 249 PASS_ARGUMENTS); |
| 303 } | 250 } |
| 304 | |
| 305 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | |
| 306 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | |
| 307 descriptor->deoptimization_handler_ = | |
| 308 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; | |
| 309 } | 251 } |
| 310 | 252 |
| 311 | 253 |
| 312 void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 254 void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
| 313 CodeStubInterfaceDescriptor* descriptor) { | 255 CodeStubInterfaceDescriptor* descriptor) { |
| 314 InitializeInternalArrayConstructorDescriptor(descriptor, 0); | 256 InitializeInternalArrayConstructorDescriptor(descriptor, 0); |
| 315 } | 257 } |
| 316 | 258 |
| 317 | 259 |
| 318 void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( | 260 void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( |
| 319 CodeStubInterfaceDescriptor* descriptor) { | 261 CodeStubInterfaceDescriptor* descriptor) { |
| 320 InitializeInternalArrayConstructorDescriptor(descriptor, 1); | 262 InitializeInternalArrayConstructorDescriptor(descriptor, 1); |
| 321 } | 263 } |
| 322 | 264 |
| 323 | 265 |
| 324 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( | 266 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( |
| 325 CodeStubInterfaceDescriptor* descriptor) { | 267 CodeStubInterfaceDescriptor* descriptor) { |
| 326 InitializeInternalArrayConstructorDescriptor(descriptor, -1); | 268 InitializeInternalArrayConstructorDescriptor(descriptor, -1); |
| 327 } | 269 } |
| 328 | 270 |
| 329 | 271 |
| 330 void ToBooleanStub::InitializeInterfaceDescriptor( | 272 void ToBooleanStub::InitializeInterfaceDescriptor( |
| 331 CodeStubInterfaceDescriptor* descriptor) { | 273 CodeStubInterfaceDescriptor* descriptor) { |
| 332 // x0: value | 274 // x0: value |
| 333 static Register registers[] = { x0 }; | 275 Register registers[] = { x0 }; |
| 334 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 276 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 335 descriptor->register_params_ = registers; | 277 FUNCTION_ADDR(ToBooleanIC_Miss)); |
| 336 descriptor->deoptimization_handler_ = FUNCTION_ADDR(ToBooleanIC_Miss); | |
| 337 descriptor->SetMissHandler( | 278 descriptor->SetMissHandler( |
| 338 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate())); | 279 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate())); |
| 339 } | 280 } |
| 340 | 281 |
| 341 | 282 |
| 342 void StoreGlobalStub::InitializeInterfaceDescriptor( | 283 void StoreGlobalStub::InitializeInterfaceDescriptor( |
| 343 CodeStubInterfaceDescriptor* descriptor) { | 284 CodeStubInterfaceDescriptor* descriptor) { |
| 344 // x1: receiver | 285 // x1: receiver |
| 345 // x2: key (unused) | 286 // x2: key (unused) |
| 346 // x0: value | 287 // x0: value |
| 347 static Register registers[] = { x1, x2, x0 }; | 288 Register registers[] = { x1, x2, x0 }; |
| 348 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 289 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 349 descriptor->register_params_ = registers; | 290 FUNCTION_ADDR(StoreIC_MissFromStubFailure)); |
| 350 descriptor->deoptimization_handler_ = | |
| 351 FUNCTION_ADDR(StoreIC_MissFromStubFailure); | |
| 352 } | 291 } |
| 353 | 292 |
| 354 | 293 |
| 355 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( | 294 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( |
| 356 CodeStubInterfaceDescriptor* descriptor) { | 295 CodeStubInterfaceDescriptor* descriptor) { |
| 357 // x0: value | 296 // x0: value |
| 358 // x3: target map | 297 // x3: target map |
| 359 // x1: key | 298 // x1: key |
| 360 // x2: receiver | 299 // x2: receiver |
| 361 static Register registers[] = { x0, x3, x1, x2 }; | 300 Register registers[] = { x0, x3, x1, x2 }; |
| 362 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 301 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 363 descriptor->register_params_ = registers; | 302 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss)); |
| 364 descriptor->deoptimization_handler_ = | |
| 365 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss); | |
| 366 } | 303 } |
| 367 | 304 |
| 368 | 305 |
| 369 void BinaryOpICStub::InitializeInterfaceDescriptor( | 306 void BinaryOpICStub::InitializeInterfaceDescriptor( |
| 370 CodeStubInterfaceDescriptor* descriptor) { | 307 CodeStubInterfaceDescriptor* descriptor) { |
| 371 // x1: left operand | 308 // x1: left operand |
| 372 // x0: right operand | 309 // x0: right operand |
| 373 static Register registers[] = { x1, x0 }; | 310 Register registers[] = { x1, x0 }; |
| 374 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 311 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 375 descriptor->register_params_ = registers; | 312 FUNCTION_ADDR(BinaryOpIC_Miss)); |
| 376 descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss); | |
| 377 descriptor->SetMissHandler( | 313 descriptor->SetMissHandler( |
| 378 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate())); | 314 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate())); |
| 379 } | 315 } |
| 380 | 316 |
| 381 | 317 |
| 382 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( | 318 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( |
| 383 CodeStubInterfaceDescriptor* descriptor) { | 319 CodeStubInterfaceDescriptor* descriptor) { |
| 384 // x2: allocation site | 320 // x2: allocation site |
| 385 // x1: left operand | 321 // x1: left operand |
| 386 // x0: right operand | 322 // x0: right operand |
| 387 static Register registers[] = { x2, x1, x0 }; | 323 Register registers[] = { x2, x1, x0 }; |
| 388 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 324 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 389 descriptor->register_params_ = registers; | 325 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite)); |
| 390 descriptor->deoptimization_handler_ = | |
| 391 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite); | |
| 392 } | 326 } |
| 393 | 327 |
| 394 | 328 |
| 395 void StringAddStub::InitializeInterfaceDescriptor( | 329 void StringAddStub::InitializeInterfaceDescriptor( |
| 396 CodeStubInterfaceDescriptor* descriptor) { | 330 CodeStubInterfaceDescriptor* descriptor) { |
| 397 // x1: left operand | 331 // x1: left operand |
| 398 // x0: right operand | 332 // x0: right operand |
| 399 static Register registers[] = { x1, x0 }; | 333 Register registers[] = { x1, x0 }; |
| 400 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 334 descriptor->Initialize( |
| 401 descriptor->register_params_ = registers; | 335 ARRAY_SIZE(registers), registers, |
| 402 descriptor->deoptimization_handler_ = | 336 Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry); |
| 403 Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry; | |
| 404 } | 337 } |
| 405 | 338 |
| 406 | 339 |
| 407 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { | 340 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { |
| 408 static PlatformCallInterfaceDescriptor default_descriptor = | 341 static PlatformCallInterfaceDescriptor default_descriptor = |
| 409 PlatformCallInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); | 342 PlatformCallInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); |
| 410 | 343 |
| 411 static PlatformCallInterfaceDescriptor noInlineDescriptor = | 344 static PlatformCallInterfaceDescriptor noInlineDescriptor = |
| 412 PlatformCallInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); | 345 PlatformCallInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); |
| 413 | 346 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 | 433 |
| 501 | 434 |
| 502 #define __ ACCESS_MASM(masm) | 435 #define __ ACCESS_MASM(masm) |
| 503 | 436 |
| 504 | 437 |
| 505 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { | 438 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { |
| 506 // Update the static counter each time a new code stub is generated. | 439 // Update the static counter each time a new code stub is generated. |
| 507 isolate()->counters()->code_stubs()->Increment(); | 440 isolate()->counters()->code_stubs()->Increment(); |
| 508 | 441 |
| 509 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); | 442 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); |
| 510 int param_count = descriptor->register_param_count_; | 443 int param_count = descriptor->register_param_count(); |
| 511 { | 444 { |
| 512 // Call the runtime system in a fresh internal frame. | 445 // Call the runtime system in a fresh internal frame. |
| 513 FrameScope scope(masm, StackFrame::INTERNAL); | 446 FrameScope scope(masm, StackFrame::INTERNAL); |
| 514 ASSERT((descriptor->register_param_count_ == 0) || | 447 ASSERT((descriptor->register_param_count() == 0) || |
| 515 x0.Is(descriptor->register_params_[param_count - 1])); | 448 x0.Is(descriptor->GetParameterRegister(param_count - 1))); |
| 516 | 449 |
| 517 // Push arguments | 450 // Push arguments |
| 518 MacroAssembler::PushPopQueue queue(masm); | 451 MacroAssembler::PushPopQueue queue(masm); |
| 519 for (int i = 0; i < param_count; ++i) { | 452 for (int i = 0; i < param_count; ++i) { |
| 520 queue.Queue(descriptor->register_params_[i]); | 453 queue.Queue(descriptor->GetParameterRegister(i)); |
| 521 } | 454 } |
| 522 queue.PushQueued(); | 455 queue.PushQueued(); |
| 523 | 456 |
| 524 ExternalReference miss = descriptor->miss_handler(); | 457 ExternalReference miss = descriptor->miss_handler(); |
| 525 __ CallExternalReference(miss, descriptor->register_param_count_); | 458 __ CallExternalReference(miss, descriptor->register_param_count()); |
| 526 } | 459 } |
| 527 | 460 |
| 528 __ Ret(); | 461 __ Ret(); |
| 529 } | 462 } |
| 530 | 463 |
| 531 | 464 |
| 532 void DoubleToIStub::Generate(MacroAssembler* masm) { | 465 void DoubleToIStub::Generate(MacroAssembler* masm) { |
| 533 Label done; | 466 Label done; |
| 534 Register input = source(); | 467 Register input = source(); |
| 535 Register result = destination(); | 468 Register result = destination(); |
| (...skipping 5010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5546 MemOperand(fp, 6 * kPointerSize), | 5479 MemOperand(fp, 6 * kPointerSize), |
| 5547 NULL); | 5480 NULL); |
| 5548 } | 5481 } |
| 5549 | 5482 |
| 5550 | 5483 |
| 5551 #undef __ | 5484 #undef __ |
| 5552 | 5485 |
| 5553 } } // namespace v8::internal | 5486 } } // namespace v8::internal |
| 5554 | 5487 |
| 5555 #endif // V8_TARGET_ARCH_ARM64 | 5488 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |