Chromium Code Reviews| 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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
| 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/codegen.h" | 11 #include "src/codegen.h" |
| 12 #include "src/isolate.h" | 12 #include "src/isolate.h" |
| 13 #include "src/jsregexp.h" | 13 #include "src/jsregexp.h" |
| 14 #include "src/regexp-macro-assembler.h" | 14 #include "src/regexp-macro-assembler.h" |
| 15 #include "src/runtime.h" | 15 #include "src/runtime.h" |
| 16 #include "src/runtime.h" | 16 #include "src/runtime.h" |
| 17 #include "src/stub-cache.h" | 17 #include "src/stub-cache.h" |
| 18 | 18 |
| 19 namespace v8 { | 19 namespace v8 { |
| 20 namespace internal { | 20 namespace internal { |
| 21 | 21 |
| 22 | 22 |
| 23 void CodeStubInterfaceDescriptor::InitializeRegisterParams( | |
| 24 int register_parameter_count, | |
| 25 Register* registers) { | |
| 26 register_param_count_ = register_parameter_count; | |
| 27 register_params_ = SmartArrayPointer<Register>( | |
|
Jakob Kummerow
2014/06/24 17:23:24
As discussed:
(1) this can (hopefully!) go into th
mvstanton
2014/06/25 06:43:13
Done.
| |
| 28 NewArray<Register>(register_parameter_count)); | |
| 29 for (int i = 0; i < register_parameter_count; i++) { | |
| 30 register_params_[i] = registers[i]; | |
| 31 } | |
| 32 } | |
| 33 | |
| 34 | |
| 23 void FastNewClosureStub::InitializeInterfaceDescriptor( | 35 void FastNewClosureStub::InitializeInterfaceDescriptor( |
| 24 CodeStubInterfaceDescriptor* descriptor) { | 36 CodeStubInterfaceDescriptor* descriptor) { |
| 25 static Register registers[] = { ebx }; | 37 Register registers[] = { ebx }; |
| 26 descriptor->register_param_count_ = 1; | 38 descriptor->Initialize( |
| 27 descriptor->register_params_ = registers; | 39 1, registers, |
|
Jakob Kummerow
2014/06/24 17:23:24
How about s/1/ARRAY_SIZE(registers)/ ? Less likely
Sven Panne
2014/06/25 06:24:06
We discussed similar things yesterday, another (IM
mvstanton
2014/06/25 06:43:13
Let's do it, because already arm64 made that chang
| |
| 28 descriptor->deoptimization_handler_ = | 40 Runtime::FunctionForId(Runtime::kHiddenNewClosureFromStubFailure)->entry); |
| 29 Runtime::FunctionForId(Runtime::kHiddenNewClosureFromStubFailure)->entry; | |
| 30 } | 41 } |
| 31 | 42 |
| 32 | 43 |
| 33 void FastNewContextStub::InitializeInterfaceDescriptor( | 44 void FastNewContextStub::InitializeInterfaceDescriptor( |
| 34 CodeStubInterfaceDescriptor* descriptor) { | 45 CodeStubInterfaceDescriptor* descriptor) { |
| 35 static Register registers[] = { edi }; | 46 Register registers[] = { edi }; |
| 36 descriptor->register_param_count_ = 1; | 47 descriptor->Initialize(1, registers); |
| 37 descriptor->register_params_ = registers; | |
| 38 descriptor->deoptimization_handler_ = NULL; | |
| 39 } | 48 } |
| 40 | 49 |
| 41 | 50 |
| 42 void ToNumberStub::InitializeInterfaceDescriptor( | 51 void ToNumberStub::InitializeInterfaceDescriptor( |
| 43 CodeStubInterfaceDescriptor* descriptor) { | 52 CodeStubInterfaceDescriptor* descriptor) { |
| 44 static Register registers[] = { eax }; | 53 Register registers[] = { eax }; |
| 45 descriptor->register_param_count_ = 1; | 54 descriptor->Initialize(1, registers); |
| 46 descriptor->register_params_ = registers; | |
| 47 descriptor->deoptimization_handler_ = NULL; | |
| 48 } | 55 } |
| 49 | 56 |
| 50 | 57 |
| 51 void NumberToStringStub::InitializeInterfaceDescriptor( | 58 void NumberToStringStub::InitializeInterfaceDescriptor( |
| 52 CodeStubInterfaceDescriptor* descriptor) { | 59 CodeStubInterfaceDescriptor* descriptor) { |
| 53 static Register registers[] = { eax }; | 60 Register registers[] = { eax }; |
| 54 descriptor->register_param_count_ = 1; | 61 descriptor->Initialize( |
| 55 descriptor->register_params_ = registers; | 62 1, registers, |
| 56 descriptor->deoptimization_handler_ = | 63 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry); |
| 57 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; | |
| 58 } | 64 } |
| 59 | 65 |
| 60 | 66 |
| 61 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 67 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
| 62 CodeStubInterfaceDescriptor* descriptor) { | 68 CodeStubInterfaceDescriptor* descriptor) { |
| 63 static Register registers[] = { eax, ebx, ecx }; | 69 Register registers[] = { eax, ebx, ecx }; |
| 64 descriptor->register_param_count_ = 3; | |
| 65 descriptor->register_params_ = registers; | |
| 66 static Representation representations[] = { | 70 static Representation representations[] = { |
| 67 Representation::Tagged(), | 71 Representation::Tagged(), |
| 68 Representation::Smi(), | 72 Representation::Smi(), |
| 69 Representation::Tagged() }; | 73 Representation::Tagged() }; |
| 70 descriptor->register_param_representations_ = representations; | 74 |
| 71 descriptor->deoptimization_handler_ = | 75 descriptor->Initialize( |
| 76 3, registers, | |
| 72 Runtime::FunctionForId( | 77 Runtime::FunctionForId( |
| 73 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; | 78 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry, |
| 79 representations); | |
| 74 } | 80 } |
| 75 | 81 |
| 76 | 82 |
| 77 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( | 83 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( |
| 78 CodeStubInterfaceDescriptor* descriptor) { | 84 CodeStubInterfaceDescriptor* descriptor) { |
| 79 static Register registers[] = { eax, ebx, ecx, edx }; | 85 Register registers[] = { eax, ebx, ecx, edx }; |
| 80 descriptor->register_param_count_ = 4; | 86 descriptor->Initialize( |
| 81 descriptor->register_params_ = registers; | 87 4, registers, |
| 82 descriptor->deoptimization_handler_ = | 88 Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry); |
| 83 Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry; | |
| 84 } | 89 } |
| 85 | 90 |
| 86 | 91 |
| 87 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( | 92 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( |
| 88 CodeStubInterfaceDescriptor* descriptor) { | 93 CodeStubInterfaceDescriptor* descriptor) { |
| 89 static Register registers[] = { ebx, edx }; | 94 Register registers[] = { ebx, edx }; |
| 90 descriptor->register_param_count_ = 2; | 95 descriptor->Initialize(2, registers); |
| 91 descriptor->register_params_ = registers; | |
| 92 descriptor->deoptimization_handler_ = NULL; | |
| 93 } | |
| 94 | |
| 95 | |
| 96 void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( | |
| 97 CodeStubInterfaceDescriptor* descriptor) { | |
| 98 static Register registers[] = { edx, ecx }; | |
| 99 descriptor->register_param_count_ = 2; | |
| 100 descriptor->register_params_ = registers; | |
| 101 descriptor->deoptimization_handler_ = | |
| 102 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); | |
| 103 } | |
| 104 | |
| 105 | |
| 106 void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor( | |
| 107 CodeStubInterfaceDescriptor* descriptor) { | |
| 108 static Register registers[] = { edx, ecx }; | |
| 109 descriptor->register_param_count_ = 2; | |
| 110 descriptor->register_params_ = registers; | |
| 111 descriptor->deoptimization_handler_ = | |
| 112 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); | |
| 113 } | 96 } |
| 114 | 97 |
| 115 | 98 |
| 116 void RegExpConstructResultStub::InitializeInterfaceDescriptor( | 99 void RegExpConstructResultStub::InitializeInterfaceDescriptor( |
| 117 CodeStubInterfaceDescriptor* descriptor) { | 100 CodeStubInterfaceDescriptor* descriptor) { |
| 118 static Register registers[] = { ecx, ebx, eax }; | 101 Register registers[] = { ecx, ebx, eax }; |
| 119 descriptor->register_param_count_ = 3; | 102 descriptor->Initialize( |
| 120 descriptor->register_params_ = registers; | 103 3, registers, |
| 121 descriptor->deoptimization_handler_ = | 104 Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry); |
| 122 Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry; | |
| 123 } | |
| 124 | |
| 125 | |
| 126 void KeyedLoadGenericElementStub::InitializeInterfaceDescriptor( | |
| 127 CodeStubInterfaceDescriptor* descriptor) { | |
| 128 static Register registers[] = { edx, ecx }; | |
| 129 descriptor->register_param_count_ = 2; | |
| 130 descriptor->register_params_ = registers; | |
| 131 descriptor->deoptimization_handler_ = | |
| 132 Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry; | |
| 133 } | 105 } |
| 134 | 106 |
| 135 | 107 |
| 136 void LoadFieldStub::InitializeInterfaceDescriptor( | 108 void LoadFieldStub::InitializeInterfaceDescriptor( |
| 137 CodeStubInterfaceDescriptor* descriptor) { | 109 CodeStubInterfaceDescriptor* descriptor) { |
| 138 static Register registers[] = { edx }; | 110 Register registers[] = { edx }; |
| 139 descriptor->register_param_count_ = 1; | 111 descriptor->Initialize(1, registers); |
| 140 descriptor->register_params_ = registers; | |
| 141 descriptor->deoptimization_handler_ = NULL; | |
| 142 } | 112 } |
| 143 | 113 |
| 144 | 114 |
| 145 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( | 115 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( |
| 146 CodeStubInterfaceDescriptor* descriptor) { | 116 CodeStubInterfaceDescriptor* descriptor) { |
| 147 static Register registers[] = { edx }; | 117 Register registers[] = { edx }; |
| 148 descriptor->register_param_count_ = 1; | 118 descriptor->Initialize(1, registers); |
| 149 descriptor->register_params_ = registers; | |
| 150 descriptor->deoptimization_handler_ = NULL; | |
| 151 } | 119 } |
| 152 | 120 |
| 153 | 121 |
| 154 void StringLengthStub::InitializeInterfaceDescriptor( | 122 void StringLengthStub::InitializeInterfaceDescriptor( |
| 155 CodeStubInterfaceDescriptor* descriptor) { | 123 CodeStubInterfaceDescriptor* descriptor) { |
| 156 static Register registers[] = { edx, ecx }; | 124 Register registers[] = { edx, ecx }; |
| 157 descriptor->register_param_count_ = 2; | 125 descriptor->Initialize(2, registers); |
| 158 descriptor->register_params_ = registers; | |
| 159 descriptor->deoptimization_handler_ = NULL; | |
| 160 } | 126 } |
| 161 | 127 |
| 162 | 128 |
| 163 void KeyedStringLengthStub::InitializeInterfaceDescriptor( | 129 void KeyedStringLengthStub::InitializeInterfaceDescriptor( |
| 164 CodeStubInterfaceDescriptor* descriptor) { | 130 CodeStubInterfaceDescriptor* descriptor) { |
| 165 static Register registers[] = { edx, ecx }; | 131 Register registers[] = { edx, ecx }; |
| 166 descriptor->register_param_count_ = 2; | 132 descriptor->Initialize(2, registers); |
| 167 descriptor->register_params_ = registers; | |
| 168 descriptor->deoptimization_handler_ = NULL; | |
| 169 } | 133 } |
| 170 | 134 |
| 171 | 135 |
| 172 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( | 136 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( |
| 173 CodeStubInterfaceDescriptor* descriptor) { | 137 CodeStubInterfaceDescriptor* descriptor) { |
| 174 static Register registers[] = { edx, ecx, eax }; | 138 Register registers[] = { edx, ecx, eax }; |
| 175 descriptor->register_param_count_ = 3; | 139 descriptor->Initialize( |
| 176 descriptor->register_params_ = registers; | 140 3, registers, |
| 177 descriptor->deoptimization_handler_ = | 141 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure)); |
| 178 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); | |
| 179 } | 142 } |
| 180 | 143 |
| 181 | 144 |
| 182 void TransitionElementsKindStub::InitializeInterfaceDescriptor( | 145 void TransitionElementsKindStub::InitializeInterfaceDescriptor( |
| 183 CodeStubInterfaceDescriptor* descriptor) { | 146 CodeStubInterfaceDescriptor* descriptor) { |
| 184 static Register registers[] = { eax, ebx }; | 147 Register registers[] = { eax, ebx }; |
| 185 descriptor->register_param_count_ = 2; | 148 descriptor->Initialize( |
| 186 descriptor->register_params_ = registers; | 149 2, registers, |
| 187 descriptor->deoptimization_handler_ = | 150 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry); |
| 188 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry; | |
| 189 } | 151 } |
| 190 | 152 |
| 191 | 153 |
| 192 static void InitializeArrayConstructorDescriptor( | 154 static void InitializeArrayConstructorDescriptor( |
| 193 Isolate* isolate, | 155 Isolate* isolate, |
| 194 CodeStubInterfaceDescriptor* descriptor, | 156 CodeStubInterfaceDescriptor* descriptor, |
| 195 int constant_stack_parameter_count) { | 157 int constant_stack_parameter_count) { |
| 196 // register state | 158 // register state |
| 197 // eax -- number of arguments | 159 // eax -- number of arguments |
| 198 // edi -- function | 160 // edi -- function |
| 199 // ebx -- allocation site with elements kind | 161 // ebx -- allocation site with elements kind |
| 200 static Register registers_variable_args[] = { edi, ebx, eax }; | 162 Address deopt_handler = Runtime::FunctionForId( |
| 201 static Register registers_no_args[] = { edi, ebx }; | 163 Runtime::kHiddenArrayConstructor)->entry; |
| 202 | 164 |
| 203 if (constant_stack_parameter_count == 0) { | 165 if (constant_stack_parameter_count == 0) { |
| 204 descriptor->register_param_count_ = 2; | 166 Register registers[] = { edi, ebx }; |
| 205 descriptor->register_params_ = registers_no_args; | 167 descriptor->Initialize(2, registers, |
| 168 deopt_handler, | |
| 169 NULL, | |
| 170 constant_stack_parameter_count, | |
| 171 JS_FUNCTION_STUB_MODE); | |
| 206 } else { | 172 } else { |
| 207 // stack param count needs (constructor pointer, and single argument) | 173 // stack param count needs (constructor pointer, and single argument) |
| 208 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | 174 Register registers[] = { edi, ebx, eax }; |
| 209 descriptor->stack_parameter_count_ = eax; | |
| 210 descriptor->register_param_count_ = 3; | |
| 211 descriptor->register_params_ = registers_variable_args; | |
| 212 static Representation representations[] = { | 175 static Representation representations[] = { |
| 213 Representation::Tagged(), | 176 Representation::Tagged(), |
| 214 Representation::Tagged(), | 177 Representation::Tagged(), |
| 215 Representation::Integer32() }; | 178 Representation::Integer32() }; |
| 216 descriptor->register_param_representations_ = representations; | 179 descriptor->Initialize(3, registers, |
| 180 eax, | |
| 181 deopt_handler, | |
| 182 representations, | |
| 183 constant_stack_parameter_count, | |
| 184 JS_FUNCTION_STUB_MODE, | |
| 185 PASS_ARGUMENTS); | |
| 217 } | 186 } |
| 218 | |
| 219 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | |
| 220 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | |
| 221 descriptor->deoptimization_handler_ = | |
| 222 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; | |
| 223 } | 187 } |
| 224 | 188 |
| 225 | 189 |
| 226 static void InitializeInternalArrayConstructorDescriptor( | 190 static void InitializeInternalArrayConstructorDescriptor( |
| 227 CodeStubInterfaceDescriptor* descriptor, | 191 CodeStubInterfaceDescriptor* descriptor, |
| 228 int constant_stack_parameter_count) { | 192 int constant_stack_parameter_count) { |
| 229 // register state | 193 // register state |
| 230 // eax -- number of arguments | 194 // eax -- number of arguments |
| 231 // edi -- constructor function | 195 // edi -- constructor function |
| 232 static Register registers_variable_args[] = { edi, eax }; | 196 Address deopt_handler = Runtime::FunctionForId( |
| 233 static Register registers_no_args[] = { edi }; | 197 Runtime::kHiddenInternalArrayConstructor)->entry; |
| 234 | 198 |
| 235 if (constant_stack_parameter_count == 0) { | 199 if (constant_stack_parameter_count == 0) { |
| 236 descriptor->register_param_count_ = 1; | 200 Register registers[] = { edi }; |
| 237 descriptor->register_params_ = registers_no_args; | 201 descriptor->Initialize(1, registers, |
| 202 deopt_handler, | |
| 203 NULL, | |
| 204 constant_stack_parameter_count, | |
| 205 JS_FUNCTION_STUB_MODE); | |
| 238 } else { | 206 } else { |
| 239 // stack param count needs (constructor pointer, and single argument) | 207 // stack param count needs (constructor pointer, and single argument) |
| 240 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | 208 Register registers[] = { edi, eax }; |
| 241 descriptor->stack_parameter_count_ = eax; | |
| 242 descriptor->register_param_count_ = 2; | |
| 243 descriptor->register_params_ = registers_variable_args; | |
| 244 static Representation representations[] = { | 209 static Representation representations[] = { |
| 245 Representation::Tagged(), | 210 Representation::Tagged(), |
| 246 Representation::Integer32() }; | 211 Representation::Integer32() }; |
| 247 descriptor->register_param_representations_ = representations; | 212 descriptor->Initialize(2, registers, |
| 213 eax, | |
| 214 deopt_handler, | |
| 215 representations, | |
| 216 constant_stack_parameter_count, | |
| 217 JS_FUNCTION_STUB_MODE, | |
| 218 PASS_ARGUMENTS); | |
| 248 } | 219 } |
| 249 | |
| 250 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | |
| 251 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | |
| 252 descriptor->deoptimization_handler_ = | |
| 253 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; | |
| 254 } | 220 } |
| 255 | 221 |
| 256 | 222 |
| 257 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 223 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
| 258 CodeStubInterfaceDescriptor* descriptor) { | 224 CodeStubInterfaceDescriptor* descriptor) { |
| 259 InitializeArrayConstructorDescriptor(isolate(), descriptor, 0); | 225 InitializeArrayConstructorDescriptor(isolate(), descriptor, 0); |
| 260 } | 226 } |
| 261 | 227 |
| 262 | 228 |
| 263 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( | 229 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 285 | 251 |
| 286 | 252 |
| 287 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( | 253 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( |
| 288 CodeStubInterfaceDescriptor* descriptor) { | 254 CodeStubInterfaceDescriptor* descriptor) { |
| 289 InitializeInternalArrayConstructorDescriptor(descriptor, -1); | 255 InitializeInternalArrayConstructorDescriptor(descriptor, -1); |
| 290 } | 256 } |
| 291 | 257 |
| 292 | 258 |
| 293 void CompareNilICStub::InitializeInterfaceDescriptor( | 259 void CompareNilICStub::InitializeInterfaceDescriptor( |
| 294 CodeStubInterfaceDescriptor* descriptor) { | 260 CodeStubInterfaceDescriptor* descriptor) { |
| 295 static Register registers[] = { eax }; | 261 Register registers[] = { eax }; |
| 296 descriptor->register_param_count_ = 1; | 262 descriptor->Initialize(1, registers, |
| 297 descriptor->register_params_ = registers; | 263 FUNCTION_ADDR(CompareNilIC_Miss)); |
| 298 descriptor->deoptimization_handler_ = | |
| 299 FUNCTION_ADDR(CompareNilIC_Miss); | |
| 300 descriptor->SetMissHandler( | 264 descriptor->SetMissHandler( |
| 301 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); | 265 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); |
| 302 } | 266 } |
| 303 | 267 |
| 304 void ToBooleanStub::InitializeInterfaceDescriptor( | 268 void ToBooleanStub::InitializeInterfaceDescriptor( |
| 305 CodeStubInterfaceDescriptor* descriptor) { | 269 CodeStubInterfaceDescriptor* descriptor) { |
| 306 static Register registers[] = { eax }; | 270 Register registers[] = { eax }; |
| 307 descriptor->register_param_count_ = 1; | 271 descriptor->Initialize(1, registers, |
| 308 descriptor->register_params_ = registers; | 272 FUNCTION_ADDR(ToBooleanIC_Miss)); |
| 309 descriptor->deoptimization_handler_ = | |
| 310 FUNCTION_ADDR(ToBooleanIC_Miss); | |
| 311 descriptor->SetMissHandler( | 273 descriptor->SetMissHandler( |
| 312 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate())); | 274 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate())); |
| 313 } | 275 } |
| 314 | 276 |
| 315 | 277 |
| 316 void StoreGlobalStub::InitializeInterfaceDescriptor( | 278 void StoreGlobalStub::InitializeInterfaceDescriptor( |
| 317 CodeStubInterfaceDescriptor* descriptor) { | 279 CodeStubInterfaceDescriptor* descriptor) { |
| 318 static Register registers[] = { edx, ecx, eax }; | 280 Register registers[] = { edx, ecx, eax }; |
| 319 descriptor->register_param_count_ = 3; | 281 descriptor->Initialize(3, registers, |
| 320 descriptor->register_params_ = registers; | 282 FUNCTION_ADDR(StoreIC_MissFromStubFailure)); |
| 321 descriptor->deoptimization_handler_ = | |
| 322 FUNCTION_ADDR(StoreIC_MissFromStubFailure); | |
| 323 } | 283 } |
| 324 | 284 |
| 325 | 285 |
| 326 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( | 286 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( |
| 327 CodeStubInterfaceDescriptor* descriptor) { | 287 CodeStubInterfaceDescriptor* descriptor) { |
| 328 static Register registers[] = { eax, ebx, ecx, edx }; | 288 Register registers[] = { eax, ebx, ecx, edx }; |
| 329 descriptor->register_param_count_ = 4; | 289 descriptor->Initialize(4, registers, |
| 330 descriptor->register_params_ = registers; | 290 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss)); |
| 331 descriptor->deoptimization_handler_ = | |
| 332 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss); | |
| 333 } | 291 } |
| 334 | 292 |
| 335 | 293 |
| 336 void BinaryOpICStub::InitializeInterfaceDescriptor( | 294 void BinaryOpICStub::InitializeInterfaceDescriptor( |
| 337 CodeStubInterfaceDescriptor* descriptor) { | 295 CodeStubInterfaceDescriptor* descriptor) { |
| 338 static Register registers[] = { edx, eax }; | 296 Register registers[] = { edx, eax }; |
| 339 descriptor->register_param_count_ = 2; | 297 descriptor->Initialize(2, registers, |
| 340 descriptor->register_params_ = registers; | 298 FUNCTION_ADDR(BinaryOpIC_Miss)); |
| 341 descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss); | |
| 342 descriptor->SetMissHandler( | 299 descriptor->SetMissHandler( |
| 343 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate())); | 300 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate())); |
| 344 } | 301 } |
| 345 | 302 |
| 346 | 303 |
| 347 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( | 304 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( |
| 348 CodeStubInterfaceDescriptor* descriptor) { | 305 CodeStubInterfaceDescriptor* descriptor) { |
| 349 static Register registers[] = { ecx, edx, eax }; | 306 Register registers[] = { ecx, edx, eax }; |
| 350 descriptor->register_param_count_ = 3; | 307 descriptor->Initialize(3, registers, |
| 351 descriptor->register_params_ = registers; | 308 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite)); |
| 352 descriptor->deoptimization_handler_ = | |
| 353 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite); | |
| 354 } | 309 } |
| 355 | 310 |
| 356 | 311 |
| 357 void StringAddStub::InitializeInterfaceDescriptor( | 312 void StringAddStub::InitializeInterfaceDescriptor( |
| 358 CodeStubInterfaceDescriptor* descriptor) { | 313 CodeStubInterfaceDescriptor* descriptor) { |
| 359 static Register registers[] = { edx, eax }; | 314 Register registers[] = { edx, eax }; |
| 360 descriptor->register_param_count_ = 2; | 315 descriptor->Initialize( |
| 361 descriptor->register_params_ = registers; | 316 2, registers, |
| 362 descriptor->deoptimization_handler_ = | 317 Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry); |
| 363 Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry; | |
| 364 } | 318 } |
| 365 | 319 |
| 366 | 320 |
| 367 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { | 321 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { |
| 368 { | 322 { |
| 369 CallInterfaceDescriptor* descriptor = | 323 CallInterfaceDescriptor* descriptor = |
| 370 isolate->call_descriptor(Isolate::ArgumentAdaptorCall); | 324 isolate->call_descriptor(Isolate::ArgumentAdaptorCall); |
| 371 static Register registers[] = { edi, // JSFunction | 325 static Register registers[] = { edi, // JSFunction |
| 372 esi, // context | 326 esi, // context |
| 373 eax, // actual number of arguments | 327 eax, // actual number of arguments |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 449 | 403 |
| 450 | 404 |
| 451 #define __ ACCESS_MASM(masm) | 405 #define __ ACCESS_MASM(masm) |
| 452 | 406 |
| 453 | 407 |
| 454 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { | 408 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { |
| 455 // Update the static counter each time a new code stub is generated. | 409 // Update the static counter each time a new code stub is generated. |
| 456 isolate()->counters()->code_stubs()->Increment(); | 410 isolate()->counters()->code_stubs()->Increment(); |
| 457 | 411 |
| 458 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); | 412 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); |
| 459 int param_count = descriptor->register_param_count_; | 413 int param_count = descriptor->register_param_count(); |
| 460 { | 414 { |
| 461 // Call the runtime system in a fresh internal frame. | 415 // Call the runtime system in a fresh internal frame. |
| 462 FrameScope scope(masm, StackFrame::INTERNAL); | 416 FrameScope scope(masm, StackFrame::INTERNAL); |
| 463 ASSERT(descriptor->register_param_count_ == 0 || | 417 ASSERT(descriptor->register_param_count() == 0 || |
| 464 eax.is(descriptor->register_params_[param_count - 1])); | 418 eax.is(descriptor->GetParameterRegister(param_count - 1))); |
| 465 // Push arguments | 419 // Push arguments |
| 466 for (int i = 0; i < param_count; ++i) { | 420 for (int i = 0; i < param_count; ++i) { |
| 467 __ push(descriptor->register_params_[i]); | 421 __ push(descriptor->GetParameterRegister(i)); |
| 468 } | 422 } |
| 469 ExternalReference miss = descriptor->miss_handler(); | 423 ExternalReference miss = descriptor->miss_handler(); |
| 470 __ CallExternalReference(miss, descriptor->register_param_count_); | 424 __ CallExternalReference(miss, descriptor->register_param_count()); |
| 471 } | 425 } |
| 472 | 426 |
| 473 __ ret(0); | 427 __ ret(0); |
| 474 } | 428 } |
| 475 | 429 |
| 476 | 430 |
| 477 void StoreBufferOverflowStub::Generate(MacroAssembler* masm) { | 431 void StoreBufferOverflowStub::Generate(MacroAssembler* masm) { |
| 478 // We don't allow a GC during a store buffer overflow so there is no need to | 432 // We don't allow a GC during a store buffer overflow so there is no need to |
| 479 // store the registers in any particular way, but we do have to store and | 433 // store the registers in any particular way, but we do have to store and |
| 480 // restore them. | 434 // restore them. |
| (...skipping 4604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5085 Operand(ebp, 7 * kPointerSize), | 5039 Operand(ebp, 7 * kPointerSize), |
| 5086 NULL); | 5040 NULL); |
| 5087 } | 5041 } |
| 5088 | 5042 |
| 5089 | 5043 |
| 5090 #undef __ | 5044 #undef __ |
| 5091 | 5045 |
| 5092 } } // namespace v8::internal | 5046 } } // namespace v8::internal |
| 5093 | 5047 |
| 5094 #endif // V8_TARGET_ARCH_IA32 | 5048 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |