| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_ARM | 7 #if V8_TARGET_ARCH_ARM |
| 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 | 17 |
| 18 void FastNewClosureStub::InitializeInterfaceDescriptor( | 18 void FastNewClosureStub::InitializeInterfaceDescriptor( |
| 19 CodeStubInterfaceDescriptor* descriptor) { | 19 CodeStubInterfaceDescriptor* descriptor) { |
| 20 static Register registers[] = { r2 }; | 20 Register registers[] = { r2 }; |
| 21 descriptor->register_param_count_ = 1; | 21 descriptor->Initialize( |
| 22 descriptor->register_params_ = registers; | 22 ARRAY_SIZE(registers), registers, |
| 23 descriptor->deoptimization_handler_ = | 23 Runtime::FunctionForId(Runtime::kHiddenNewClosureFromStubFailure)->entry); |
| 24 Runtime::FunctionForId(Runtime::kHiddenNewClosureFromStubFailure)->entry; | |
| 25 } | 24 } |
| 26 | 25 |
| 27 | 26 |
| 28 void FastNewContextStub::InitializeInterfaceDescriptor( | 27 void FastNewContextStub::InitializeInterfaceDescriptor( |
| 29 CodeStubInterfaceDescriptor* descriptor) { | 28 CodeStubInterfaceDescriptor* descriptor) { |
| 30 static Register registers[] = { r1 }; | 29 Register registers[] = { r1 }; |
| 31 descriptor->register_param_count_ = 1; | 30 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
| 32 descriptor->register_params_ = registers; | |
| 33 descriptor->deoptimization_handler_ = NULL; | |
| 34 } | 31 } |
| 35 | 32 |
| 36 | 33 |
| 37 void ToNumberStub::InitializeInterfaceDescriptor( | 34 void ToNumberStub::InitializeInterfaceDescriptor( |
| 38 CodeStubInterfaceDescriptor* descriptor) { | 35 CodeStubInterfaceDescriptor* descriptor) { |
| 39 static Register registers[] = { r0 }; | 36 Register registers[] = { r0 }; |
| 40 descriptor->register_param_count_ = 1; | 37 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
| 41 descriptor->register_params_ = registers; | |
| 42 descriptor->deoptimization_handler_ = NULL; | |
| 43 } | 38 } |
| 44 | 39 |
| 45 | 40 |
| 46 void NumberToStringStub::InitializeInterfaceDescriptor( | 41 void NumberToStringStub::InitializeInterfaceDescriptor( |
| 47 CodeStubInterfaceDescriptor* descriptor) { | 42 CodeStubInterfaceDescriptor* descriptor) { |
| 48 static Register registers[] = { r0 }; | 43 Register registers[] = { r0 }; |
| 49 descriptor->register_param_count_ = 1; | 44 descriptor->Initialize( |
| 50 descriptor->register_params_ = registers; | 45 ARRAY_SIZE(registers), registers, |
| 51 descriptor->deoptimization_handler_ = | 46 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry); |
| 52 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; | |
| 53 } | 47 } |
| 54 | 48 |
| 55 | 49 |
| 56 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 50 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
| 57 CodeStubInterfaceDescriptor* descriptor) { | 51 CodeStubInterfaceDescriptor* descriptor) { |
| 58 static Register registers[] = { r3, r2, r1 }; | 52 Register registers[] = { r3, r2, r1 }; |
| 59 descriptor->register_param_count_ = 3; | 53 Representation representations[] = { |
| 60 descriptor->register_params_ = registers; | |
| 61 static Representation representations[] = { | |
| 62 Representation::Tagged(), | 54 Representation::Tagged(), |
| 63 Representation::Smi(), | 55 Representation::Smi(), |
| 64 Representation::Tagged() }; | 56 Representation::Tagged() }; |
| 65 descriptor->register_param_representations_ = representations; | 57 descriptor->Initialize( |
| 66 descriptor->deoptimization_handler_ = | 58 ARRAY_SIZE(registers), registers, |
| 67 Runtime::FunctionForId( | 59 Runtime::FunctionForId( |
| 68 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; | 60 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry, |
| 61 representations); |
| 69 } | 62 } |
| 70 | 63 |
| 71 | 64 |
| 72 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( | 65 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( |
| 73 CodeStubInterfaceDescriptor* descriptor) { | 66 CodeStubInterfaceDescriptor* descriptor) { |
| 74 static Register registers[] = { r3, r2, r1, r0 }; | 67 Register registers[] = { r3, r2, r1, r0 }; |
| 75 descriptor->register_param_count_ = 4; | 68 descriptor->Initialize( |
| 76 descriptor->register_params_ = registers; | 69 ARRAY_SIZE(registers), registers, |
| 77 descriptor->deoptimization_handler_ = | 70 Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry); |
| 78 Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry; | |
| 79 } | 71 } |
| 80 | 72 |
| 81 | 73 |
| 82 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( | 74 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( |
| 83 CodeStubInterfaceDescriptor* descriptor) { | 75 CodeStubInterfaceDescriptor* descriptor) { |
| 84 static Register registers[] = { r2, r3 }; | 76 Register registers[] = { r2, r3 }; |
| 85 descriptor->register_param_count_ = 2; | 77 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
| 86 descriptor->register_params_ = registers; | |
| 87 descriptor->deoptimization_handler_ = NULL; | |
| 88 } | |
| 89 | |
| 90 | |
| 91 void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( | |
| 92 CodeStubInterfaceDescriptor* descriptor) { | |
| 93 static Register registers[] = { r1, r0 }; | |
| 94 descriptor->register_param_count_ = 2; | |
| 95 descriptor->register_params_ = registers; | |
| 96 descriptor->deoptimization_handler_ = | |
| 97 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); | |
| 98 } | |
| 99 | |
| 100 | |
| 101 void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor( | |
| 102 CodeStubInterfaceDescriptor* descriptor) { | |
| 103 static Register registers[] = { r1, r0 }; | |
| 104 descriptor->register_param_count_ = 2; | |
| 105 descriptor->register_params_ = registers; | |
| 106 descriptor->deoptimization_handler_ = | |
| 107 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); | |
| 108 } | 78 } |
| 109 | 79 |
| 110 | 80 |
| 111 void RegExpConstructResultStub::InitializeInterfaceDescriptor( | 81 void RegExpConstructResultStub::InitializeInterfaceDescriptor( |
| 112 CodeStubInterfaceDescriptor* descriptor) { | 82 CodeStubInterfaceDescriptor* descriptor) { |
| 113 static Register registers[] = { r2, r1, r0 }; | 83 Register registers[] = { r2, r1, r0 }; |
| 114 descriptor->register_param_count_ = 3; | 84 descriptor->Initialize( |
| 115 descriptor->register_params_ = registers; | 85 ARRAY_SIZE(registers), registers, |
| 116 descriptor->deoptimization_handler_ = | 86 Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry); |
| 117 Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry; | |
| 118 } | |
| 119 | |
| 120 | |
| 121 void KeyedLoadGenericElementStub::InitializeInterfaceDescriptor( | |
| 122 CodeStubInterfaceDescriptor* descriptor) { | |
| 123 static Register registers[] = { r1, r0 }; | |
| 124 descriptor->register_param_count_ = 2; | |
| 125 descriptor->register_params_ = registers; | |
| 126 descriptor->deoptimization_handler_ = | |
| 127 Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry; | |
| 128 } | 87 } |
| 129 | 88 |
| 130 | 89 |
| 131 void LoadFieldStub::InitializeInterfaceDescriptor( | 90 void LoadFieldStub::InitializeInterfaceDescriptor( |
| 132 CodeStubInterfaceDescriptor* descriptor) { | 91 CodeStubInterfaceDescriptor* descriptor) { |
| 133 static Register registers[] = { r0 }; | 92 Register registers[] = { r0 }; |
| 134 descriptor->register_param_count_ = 1; | 93 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
| 135 descriptor->register_params_ = registers; | |
| 136 descriptor->deoptimization_handler_ = NULL; | |
| 137 } | 94 } |
| 138 | 95 |
| 139 | 96 |
| 140 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( | 97 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( |
| 141 CodeStubInterfaceDescriptor* descriptor) { | 98 CodeStubInterfaceDescriptor* descriptor) { |
| 142 static Register registers[] = { r1 }; | 99 Register registers[] = { r1 }; |
| 143 descriptor->register_param_count_ = 1; | 100 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
| 144 descriptor->register_params_ = registers; | |
| 145 descriptor->deoptimization_handler_ = NULL; | |
| 146 } | 101 } |
| 147 | 102 |
| 148 | 103 |
| 149 void StringLengthStub::InitializeInterfaceDescriptor( | 104 void StringLengthStub::InitializeInterfaceDescriptor( |
| 150 CodeStubInterfaceDescriptor* descriptor) { | 105 CodeStubInterfaceDescriptor* descriptor) { |
| 151 static Register registers[] = { r0, r2 }; | 106 Register registers[] = { r0, r2 }; |
| 152 descriptor->register_param_count_ = 2; | 107 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
| 153 descriptor->register_params_ = registers; | |
| 154 descriptor->deoptimization_handler_ = NULL; | |
| 155 } | 108 } |
| 156 | 109 |
| 157 | 110 |
| 158 void KeyedStringLengthStub::InitializeInterfaceDescriptor( | 111 void KeyedStringLengthStub::InitializeInterfaceDescriptor( |
| 159 CodeStubInterfaceDescriptor* descriptor) { | 112 CodeStubInterfaceDescriptor* descriptor) { |
| 160 static Register registers[] = { r1, r0 }; | 113 Register registers[] = { r1, r0 }; |
| 161 descriptor->register_param_count_ = 2; | 114 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
| 162 descriptor->register_params_ = registers; | |
| 163 descriptor->deoptimization_handler_ = NULL; | |
| 164 } | 115 } |
| 165 | 116 |
| 166 | 117 |
| 167 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( | 118 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( |
| 168 CodeStubInterfaceDescriptor* descriptor) { | 119 CodeStubInterfaceDescriptor* descriptor) { |
| 169 static Register registers[] = { r2, r1, r0 }; | 120 Register registers[] = { r2, r1, r0 }; |
| 170 descriptor->register_param_count_ = 3; | 121 descriptor->Initialize( |
| 171 descriptor->register_params_ = registers; | 122 ARRAY_SIZE(registers), registers, |
| 172 descriptor->deoptimization_handler_ = | 123 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure)); |
| 173 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); | |
| 174 } | 124 } |
| 175 | 125 |
| 176 | 126 |
| 177 void TransitionElementsKindStub::InitializeInterfaceDescriptor( | 127 void TransitionElementsKindStub::InitializeInterfaceDescriptor( |
| 178 CodeStubInterfaceDescriptor* descriptor) { | 128 CodeStubInterfaceDescriptor* descriptor) { |
| 179 static Register registers[] = { r0, r1 }; | 129 Register registers[] = { r0, r1 }; |
| 180 descriptor->register_param_count_ = 2; | |
| 181 descriptor->register_params_ = registers; | |
| 182 Address entry = | 130 Address entry = |
| 183 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry; | 131 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry; |
| 184 descriptor->deoptimization_handler_ = FUNCTION_ADDR(entry); | 132 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 133 FUNCTION_ADDR(entry)); |
| 185 } | 134 } |
| 186 | 135 |
| 187 | 136 |
| 188 void CompareNilICStub::InitializeInterfaceDescriptor( | 137 void CompareNilICStub::InitializeInterfaceDescriptor( |
| 189 CodeStubInterfaceDescriptor* descriptor) { | 138 CodeStubInterfaceDescriptor* descriptor) { |
| 190 static Register registers[] = { r0 }; | 139 Register registers[] = { r0 }; |
| 191 descriptor->register_param_count_ = 1; | 140 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 192 descriptor->register_params_ = registers; | 141 FUNCTION_ADDR(CompareNilIC_Miss)); |
| 193 descriptor->deoptimization_handler_ = | |
| 194 FUNCTION_ADDR(CompareNilIC_Miss); | |
| 195 descriptor->SetMissHandler( | 142 descriptor->SetMissHandler( |
| 196 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); | 143 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); |
| 197 } | 144 } |
| 198 | 145 |
| 199 | 146 |
| 200 static void InitializeArrayConstructorDescriptor( | 147 static void InitializeArrayConstructorDescriptor( |
| 201 CodeStubInterfaceDescriptor* descriptor, | 148 CodeStubInterfaceDescriptor* descriptor, |
| 202 int constant_stack_parameter_count) { | 149 int constant_stack_parameter_count) { |
| 203 // register state | 150 // register state |
| 204 // r0 -- number of arguments | 151 // r0 -- number of arguments |
| 205 // r1 -- function | 152 // r1 -- function |
| 206 // r2 -- allocation site with elements kind | 153 // r2 -- allocation site with elements kind |
| 207 static Register registers_variable_args[] = { r1, r2, r0 }; | 154 Address deopt_handler = Runtime::FunctionForId( |
| 208 static Register registers_no_args[] = { r1, r2 }; | 155 Runtime::kHiddenArrayConstructor)->entry; |
| 209 | 156 |
| 210 if (constant_stack_parameter_count == 0) { | 157 if (constant_stack_parameter_count == 0) { |
| 211 descriptor->register_param_count_ = 2; | 158 Register registers[] = { r1, r2 }; |
| 212 descriptor->register_params_ = registers_no_args; | 159 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 160 deopt_handler, |
| 161 NULL, |
| 162 constant_stack_parameter_count, |
| 163 JS_FUNCTION_STUB_MODE); |
| 213 } else { | 164 } else { |
| 214 // stack param count needs (constructor pointer, and single argument) | 165 // stack param count needs (constructor pointer, and single argument) |
| 215 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | 166 Register registers[] = { r1, r2, r0 }; |
| 216 descriptor->stack_parameter_count_ = r0; | 167 Representation representations[] = { |
| 217 descriptor->register_param_count_ = 3; | |
| 218 descriptor->register_params_ = registers_variable_args; | |
| 219 static Representation representations[] = { | |
| 220 Representation::Tagged(), | 168 Representation::Tagged(), |
| 221 Representation::Tagged(), | 169 Representation::Tagged(), |
| 222 Representation::Integer32() }; | 170 Representation::Integer32() }; |
| 223 descriptor->register_param_representations_ = representations; | 171 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 172 r0, |
| 173 deopt_handler, |
| 174 representations, |
| 175 constant_stack_parameter_count, |
| 176 JS_FUNCTION_STUB_MODE, |
| 177 PASS_ARGUMENTS); |
| 224 } | 178 } |
| 225 | |
| 226 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | |
| 227 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | |
| 228 descriptor->deoptimization_handler_ = | |
| 229 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; | |
| 230 } | 179 } |
| 231 | 180 |
| 232 | 181 |
| 233 static void InitializeInternalArrayConstructorDescriptor( | 182 static void InitializeInternalArrayConstructorDescriptor( |
| 234 CodeStubInterfaceDescriptor* descriptor, | 183 CodeStubInterfaceDescriptor* descriptor, |
| 235 int constant_stack_parameter_count) { | 184 int constant_stack_parameter_count) { |
| 236 // register state | 185 // register state |
| 237 // r0 -- number of arguments | 186 // r0 -- number of arguments |
| 238 // r1 -- constructor function | 187 // r1 -- constructor function |
| 239 static Register registers_variable_args[] = { r1, r0 }; | 188 Address deopt_handler = Runtime::FunctionForId( |
| 240 static Register registers_no_args[] = { r1 }; | 189 Runtime::kHiddenInternalArrayConstructor)->entry; |
| 241 | 190 |
| 242 if (constant_stack_parameter_count == 0) { | 191 if (constant_stack_parameter_count == 0) { |
| 243 descriptor->register_param_count_ = 1; | 192 Register registers[] = { r1 }; |
| 244 descriptor->register_params_ = registers_no_args; | 193 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 194 deopt_handler, |
| 195 NULL, |
| 196 constant_stack_parameter_count, |
| 197 JS_FUNCTION_STUB_MODE); |
| 245 } else { | 198 } else { |
| 246 // stack param count needs (constructor pointer, and single argument) | 199 // stack param count needs (constructor pointer, and single argument) |
| 247 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | 200 Register registers[] = { r1, r0 }; |
| 248 descriptor->stack_parameter_count_ = r0; | 201 Representation representations[] = { |
| 249 descriptor->register_param_count_ = 2; | |
| 250 descriptor->register_params_ = registers_variable_args; | |
| 251 static Representation representations[] = { | |
| 252 Representation::Tagged(), | 202 Representation::Tagged(), |
| 253 Representation::Integer32() }; | 203 Representation::Integer32() }; |
| 254 descriptor->register_param_representations_ = representations; | 204 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 205 r0, |
| 206 deopt_handler, |
| 207 representations, |
| 208 constant_stack_parameter_count, |
| 209 JS_FUNCTION_STUB_MODE, |
| 210 PASS_ARGUMENTS); |
| 255 } | 211 } |
| 256 | |
| 257 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | |
| 258 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | |
| 259 descriptor->deoptimization_handler_ = | |
| 260 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; | |
| 261 } | 212 } |
| 262 | 213 |
| 263 | 214 |
| 264 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 215 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
| 265 CodeStubInterfaceDescriptor* descriptor) { | 216 CodeStubInterfaceDescriptor* descriptor) { |
| 266 InitializeArrayConstructorDescriptor(descriptor, 0); | 217 InitializeArrayConstructorDescriptor(descriptor, 0); |
| 267 } | 218 } |
| 268 | 219 |
| 269 | 220 |
| 270 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( | 221 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( |
| 271 CodeStubInterfaceDescriptor* descriptor) { | 222 CodeStubInterfaceDescriptor* descriptor) { |
| 272 InitializeArrayConstructorDescriptor(descriptor, 1); | 223 InitializeArrayConstructorDescriptor(descriptor, 1); |
| 273 } | 224 } |
| 274 | 225 |
| 275 | 226 |
| 276 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( | 227 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( |
| 277 CodeStubInterfaceDescriptor* descriptor) { | 228 CodeStubInterfaceDescriptor* descriptor) { |
| 278 InitializeArrayConstructorDescriptor(descriptor, -1); | 229 InitializeArrayConstructorDescriptor(descriptor, -1); |
| 279 } | 230 } |
| 280 | 231 |
| 281 | 232 |
| 282 void ToBooleanStub::InitializeInterfaceDescriptor( | 233 void ToBooleanStub::InitializeInterfaceDescriptor( |
| 283 CodeStubInterfaceDescriptor* descriptor) { | 234 CodeStubInterfaceDescriptor* descriptor) { |
| 284 static Register registers[] = { r0 }; | 235 Register registers[] = { r0 }; |
| 285 descriptor->register_param_count_ = 1; | 236 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 286 descriptor->register_params_ = registers; | 237 FUNCTION_ADDR(ToBooleanIC_Miss)); |
| 287 descriptor->deoptimization_handler_ = | |
| 288 FUNCTION_ADDR(ToBooleanIC_Miss); | |
| 289 descriptor->SetMissHandler( | 238 descriptor->SetMissHandler( |
| 290 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate())); | 239 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate())); |
| 291 } | 240 } |
| 292 | 241 |
| 293 | 242 |
| 294 void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 243 void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
| 295 CodeStubInterfaceDescriptor* descriptor) { | 244 CodeStubInterfaceDescriptor* descriptor) { |
| 296 InitializeInternalArrayConstructorDescriptor(descriptor, 0); | 245 InitializeInternalArrayConstructorDescriptor(descriptor, 0); |
| 297 } | 246 } |
| 298 | 247 |
| 299 | 248 |
| 300 void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( | 249 void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( |
| 301 CodeStubInterfaceDescriptor* descriptor) { | 250 CodeStubInterfaceDescriptor* descriptor) { |
| 302 InitializeInternalArrayConstructorDescriptor(descriptor, 1); | 251 InitializeInternalArrayConstructorDescriptor(descriptor, 1); |
| 303 } | 252 } |
| 304 | 253 |
| 305 | 254 |
| 306 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( | 255 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( |
| 307 CodeStubInterfaceDescriptor* descriptor) { | 256 CodeStubInterfaceDescriptor* descriptor) { |
| 308 InitializeInternalArrayConstructorDescriptor(descriptor, -1); | 257 InitializeInternalArrayConstructorDescriptor(descriptor, -1); |
| 309 } | 258 } |
| 310 | 259 |
| 311 | 260 |
| 312 void StoreGlobalStub::InitializeInterfaceDescriptor( | 261 void StoreGlobalStub::InitializeInterfaceDescriptor( |
| 313 CodeStubInterfaceDescriptor* descriptor) { | 262 CodeStubInterfaceDescriptor* descriptor) { |
| 314 static Register registers[] = { r1, r2, r0 }; | 263 Register registers[] = { r1, r2, r0 }; |
| 315 descriptor->register_param_count_ = 3; | 264 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 316 descriptor->register_params_ = registers; | 265 FUNCTION_ADDR(StoreIC_MissFromStubFailure)); |
| 317 descriptor->deoptimization_handler_ = | |
| 318 FUNCTION_ADDR(StoreIC_MissFromStubFailure); | |
| 319 } | 266 } |
| 320 | 267 |
| 321 | 268 |
| 322 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( | 269 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( |
| 323 CodeStubInterfaceDescriptor* descriptor) { | 270 CodeStubInterfaceDescriptor* descriptor) { |
| 324 static Register registers[] = { r0, r3, r1, r2 }; | 271 Register registers[] = { r0, r3, r1, r2 }; |
| 325 descriptor->register_param_count_ = 4; | 272 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 326 descriptor->register_params_ = registers; | 273 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss)); |
| 327 descriptor->deoptimization_handler_ = | |
| 328 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss); | |
| 329 } | 274 } |
| 330 | 275 |
| 331 | 276 |
| 332 void BinaryOpICStub::InitializeInterfaceDescriptor( | 277 void BinaryOpICStub::InitializeInterfaceDescriptor( |
| 333 CodeStubInterfaceDescriptor* descriptor) { | 278 CodeStubInterfaceDescriptor* descriptor) { |
| 334 static Register registers[] = { r1, r0 }; | 279 Register registers[] = { r1, r0 }; |
| 335 descriptor->register_param_count_ = 2; | 280 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 336 descriptor->register_params_ = registers; | 281 FUNCTION_ADDR(BinaryOpIC_Miss)); |
| 337 descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss); | |
| 338 descriptor->SetMissHandler( | 282 descriptor->SetMissHandler( |
| 339 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate())); | 283 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate())); |
| 340 } | 284 } |
| 341 | 285 |
| 342 | 286 |
| 343 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( | 287 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( |
| 344 CodeStubInterfaceDescriptor* descriptor) { | 288 CodeStubInterfaceDescriptor* descriptor) { |
| 345 static Register registers[] = { r2, r1, r0 }; | 289 Register registers[] = { r2, r1, r0 }; |
| 346 descriptor->register_param_count_ = 3; | 290 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 347 descriptor->register_params_ = registers; | 291 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite)); |
| 348 descriptor->deoptimization_handler_ = | |
| 349 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite); | |
| 350 } | 292 } |
| 351 | 293 |
| 352 | 294 |
| 353 void StringAddStub::InitializeInterfaceDescriptor( | 295 void StringAddStub::InitializeInterfaceDescriptor( |
| 354 CodeStubInterfaceDescriptor* descriptor) { | 296 CodeStubInterfaceDescriptor* descriptor) { |
| 355 static Register registers[] = { r1, r0 }; | 297 Register registers[] = { r1, r0 }; |
| 356 descriptor->register_param_count_ = 2; | 298 descriptor->Initialize( |
| 357 descriptor->register_params_ = registers; | 299 ARRAY_SIZE(registers), registers, |
| 358 descriptor->deoptimization_handler_ = | 300 Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry); |
| 359 Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry; | |
| 360 } | 301 } |
| 361 | 302 |
| 362 | 303 |
| 363 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { | 304 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { |
| 364 static PlatformCallInterfaceDescriptor default_descriptor = | 305 static PlatformCallInterfaceDescriptor default_descriptor = |
| 365 PlatformCallInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); | 306 PlatformCallInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); |
| 366 | 307 |
| 367 static PlatformCallInterfaceDescriptor noInlineDescriptor = | 308 static PlatformCallInterfaceDescriptor noInlineDescriptor = |
| 368 PlatformCallInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); | 309 PlatformCallInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); |
| 369 | 310 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 static void EmitStrictTwoHeapObjectCompare(MacroAssembler* masm, | 411 static void EmitStrictTwoHeapObjectCompare(MacroAssembler* masm, |
| 471 Register lhs, | 412 Register lhs, |
| 472 Register rhs); | 413 Register rhs); |
| 473 | 414 |
| 474 | 415 |
| 475 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { | 416 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { |
| 476 // Update the static counter each time a new code stub is generated. | 417 // Update the static counter each time a new code stub is generated. |
| 477 isolate()->counters()->code_stubs()->Increment(); | 418 isolate()->counters()->code_stubs()->Increment(); |
| 478 | 419 |
| 479 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); | 420 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); |
| 480 int param_count = descriptor->register_param_count_; | 421 int param_count = descriptor->register_param_count(); |
| 481 { | 422 { |
| 482 // Call the runtime system in a fresh internal frame. | 423 // Call the runtime system in a fresh internal frame. |
| 483 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 424 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
| 484 ASSERT(descriptor->register_param_count_ == 0 || | 425 ASSERT(descriptor->register_param_count() == 0 || |
| 485 r0.is(descriptor->register_params_[param_count - 1])); | 426 r0.is(descriptor->GetParameterRegister(param_count - 1))); |
| 486 // Push arguments | 427 // Push arguments |
| 487 for (int i = 0; i < param_count; ++i) { | 428 for (int i = 0; i < param_count; ++i) { |
| 488 __ push(descriptor->register_params_[i]); | 429 __ push(descriptor->GetParameterRegister(i)); |
| 489 } | 430 } |
| 490 ExternalReference miss = descriptor->miss_handler(); | 431 ExternalReference miss = descriptor->miss_handler(); |
| 491 __ CallExternalReference(miss, descriptor->register_param_count_); | 432 __ CallExternalReference(miss, descriptor->register_param_count()); |
| 492 } | 433 } |
| 493 | 434 |
| 494 __ Ret(); | 435 __ Ret(); |
| 495 } | 436 } |
| 496 | 437 |
| 497 | 438 |
| 498 // Takes a Smi and converts to an IEEE 64 bit floating point value in two | 439 // Takes a Smi and converts to an IEEE 64 bit floating point value in two |
| 499 // registers. The format is 1 sign bit, 11 exponent bits (biased 1023) and | 440 // registers. The format is 1 sign bit, 11 exponent bits (biased 1023) and |
| 500 // 52 fraction bits (20 in the first word, 32 in the second). Zeros is a | 441 // 52 fraction bits (20 in the first word, 32 in the second). Zeros is a |
| 501 // scratch register. Destroys the source register. No GC occurs during this | 442 // scratch register. Destroys the source register. No GC occurs during this |
| (...skipping 4677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5179 MemOperand(fp, 6 * kPointerSize), | 5120 MemOperand(fp, 6 * kPointerSize), |
| 5180 NULL); | 5121 NULL); |
| 5181 } | 5122 } |
| 5182 | 5123 |
| 5183 | 5124 |
| 5184 #undef __ | 5125 #undef __ |
| 5185 | 5126 |
| 5186 } } // namespace v8::internal | 5127 } } // namespace v8::internal |
| 5187 | 5128 |
| 5188 #endif // V8_TARGET_ARCH_ARM | 5129 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |