| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 } | 75 } |
| 76 | 76 |
| 77 | 77 |
| 78 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 78 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
| 79 Isolate* isolate, | 79 Isolate* isolate, |
| 80 CodeStubInterfaceDescriptor* descriptor) { | 80 CodeStubInterfaceDescriptor* descriptor) { |
| 81 static Register registers[] = { eax, ebx, ecx }; | 81 static Register registers[] = { eax, ebx, ecx }; |
| 82 descriptor->register_param_count_ = 3; | 82 descriptor->register_param_count_ = 3; |
| 83 descriptor->register_params_ = registers; | 83 descriptor->register_params_ = registers; |
| 84 descriptor->deoptimization_handler_ = | 84 descriptor->deoptimization_handler_ = |
| 85 Runtime::FunctionForId(Runtime::kCreateArrayLiteralShallow)->entry; | 85 Runtime::FunctionForId(Runtime::kCreateArrayLiteral)->entry; |
| 86 } | 86 } |
| 87 | 87 |
| 88 | 88 |
| 89 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( | 89 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( |
| 90 Isolate* isolate, | 90 Isolate* isolate, |
| 91 CodeStubInterfaceDescriptor* descriptor) { | 91 CodeStubInterfaceDescriptor* descriptor) { |
| 92 static Register registers[] = { eax, ebx, ecx, edx }; | 92 static Register registers[] = { eax, ebx, ecx, edx }; |
| 93 descriptor->register_param_count_ = 4; | 93 descriptor->register_param_count_ = 4; |
| 94 descriptor->register_params_ = registers; | 94 descriptor->register_params_ = registers; |
| 95 descriptor->deoptimization_handler_ = | 95 descriptor->deoptimization_handler_ = |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 161 |
| 162 | 162 |
| 163 static void InitializeArrayConstructorDescriptor( | 163 static void InitializeArrayConstructorDescriptor( |
| 164 Isolate* isolate, | 164 Isolate* isolate, |
| 165 CodeStubInterfaceDescriptor* descriptor, | 165 CodeStubInterfaceDescriptor* descriptor, |
| 166 int constant_stack_parameter_count) { | 166 int constant_stack_parameter_count) { |
| 167 // register state | 167 // register state |
| 168 // eax -- number of arguments | 168 // eax -- number of arguments |
| 169 // edi -- function | 169 // edi -- function |
| 170 // ebx -- type info cell with elements kind | 170 // ebx -- type info cell with elements kind |
| 171 static Register registers[] = { edi, ebx }; | 171 static Register registers_variable_args[] = { edi, ebx, eax }; |
| 172 descriptor->register_param_count_ = 2; | 172 static Register registers_no_args[] = { edi, ebx }; |
| 173 | 173 |
| 174 if (constant_stack_parameter_count != 0) { | 174 if (constant_stack_parameter_count == 0) { |
| 175 descriptor->register_param_count_ = 2; |
| 176 descriptor->register_params_ = registers_no_args; |
| 177 } else { |
| 175 // stack param count needs (constructor pointer, and single argument) | 178 // stack param count needs (constructor pointer, and single argument) |
| 179 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
| 176 descriptor->stack_parameter_count_ = eax; | 180 descriptor->stack_parameter_count_ = eax; |
| 181 descriptor->register_param_count_ = 3; |
| 182 descriptor->register_params_ = registers_variable_args; |
| 177 } | 183 } |
| 184 |
| 178 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 185 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
| 179 descriptor->register_params_ = registers; | |
| 180 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 186 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
| 181 descriptor->deoptimization_handler_ = | 187 descriptor->deoptimization_handler_ = |
| 182 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry; | 188 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry; |
| 183 } | 189 } |
| 184 | 190 |
| 185 | 191 |
| 186 static void InitializeInternalArrayConstructorDescriptor( | 192 static void InitializeInternalArrayConstructorDescriptor( |
| 187 Isolate* isolate, | 193 Isolate* isolate, |
| 188 CodeStubInterfaceDescriptor* descriptor, | 194 CodeStubInterfaceDescriptor* descriptor, |
| 189 int constant_stack_parameter_count) { | 195 int constant_stack_parameter_count) { |
| 190 // register state | 196 // register state |
| 191 // eax -- number of arguments | 197 // eax -- number of arguments |
| 192 // edi -- constructor function | 198 // edi -- constructor function |
| 193 static Register registers[] = { edi }; | 199 static Register registers_variable_args[] = { edi, eax }; |
| 194 descriptor->register_param_count_ = 1; | 200 static Register registers_no_args[] = { edi }; |
| 195 | 201 |
| 196 if (constant_stack_parameter_count != 0) { | 202 if (constant_stack_parameter_count == 0) { |
| 203 descriptor->register_param_count_ = 1; |
| 204 descriptor->register_params_ = registers_no_args; |
| 205 } else { |
| 197 // stack param count needs (constructor pointer, and single argument) | 206 // stack param count needs (constructor pointer, and single argument) |
| 207 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
| 198 descriptor->stack_parameter_count_ = eax; | 208 descriptor->stack_parameter_count_ = eax; |
| 209 descriptor->register_param_count_ = 2; |
| 210 descriptor->register_params_ = registers_variable_args; |
| 199 } | 211 } |
| 212 |
| 200 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 213 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
| 201 descriptor->register_params_ = registers; | |
| 202 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 214 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
| 203 descriptor->deoptimization_handler_ = | 215 descriptor->deoptimization_handler_ = |
| 204 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry; | 216 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry; |
| 205 } | 217 } |
| 206 | 218 |
| 207 | 219 |
| 208 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 220 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
| 209 Isolate* isolate, | 221 Isolate* isolate, |
| 210 CodeStubInterfaceDescriptor* descriptor) { | 222 CodeStubInterfaceDescriptor* descriptor) { |
| 211 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); | 223 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 CodeStubInterfaceDescriptor* descriptor) { | 311 CodeStubInterfaceDescriptor* descriptor) { |
| 300 static Register registers[] = { edx, eax }; | 312 static Register registers[] = { edx, eax }; |
| 301 descriptor->register_param_count_ = 2; | 313 descriptor->register_param_count_ = 2; |
| 302 descriptor->register_params_ = registers; | 314 descriptor->register_params_ = registers; |
| 303 descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss); | 315 descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss); |
| 304 descriptor->SetMissHandler( | 316 descriptor->SetMissHandler( |
| 305 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate)); | 317 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate)); |
| 306 } | 318 } |
| 307 | 319 |
| 308 | 320 |
| 321 void NewStringAddStub::InitializeInterfaceDescriptor( |
| 322 Isolate* isolate, |
| 323 CodeStubInterfaceDescriptor* descriptor) { |
| 324 static Register registers[] = { edx, eax }; |
| 325 descriptor->register_param_count_ = 2; |
| 326 descriptor->register_params_ = registers; |
| 327 descriptor->deoptimization_handler_ = |
| 328 Runtime::FunctionForId(Runtime::kStringAdd)->entry; |
| 329 } |
| 330 |
| 331 |
| 309 #define __ ACCESS_MASM(masm) | 332 #define __ ACCESS_MASM(masm) |
| 310 | 333 |
| 311 | 334 |
| 312 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { | 335 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { |
| 313 // Update the static counter each time a new code stub is generated. | 336 // Update the static counter each time a new code stub is generated. |
| 314 Isolate* isolate = masm->isolate(); | 337 Isolate* isolate = masm->isolate(); |
| 315 isolate->counters()->code_stubs()->Increment(); | 338 isolate->counters()->code_stubs()->Increment(); |
| 316 | 339 |
| 317 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(isolate); | 340 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(isolate); |
| 318 int param_count = descriptor->register_param_count_; | 341 int param_count = descriptor->register_param_count_; |
| (...skipping 5682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6001 __ bind(&fast_elements_case); | 6024 __ bind(&fast_elements_case); |
| 6002 GenerateCase(masm, FAST_ELEMENTS); | 6025 GenerateCase(masm, FAST_ELEMENTS); |
| 6003 } | 6026 } |
| 6004 | 6027 |
| 6005 | 6028 |
| 6006 #undef __ | 6029 #undef __ |
| 6007 | 6030 |
| 6008 } } // namespace v8::internal | 6031 } } // namespace v8::internal |
| 6009 | 6032 |
| 6010 #endif // V8_TARGET_ARCH_IA32 | 6033 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |