| 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_X64 | 7 #if V8_TARGET_ARCH_X64 | 
| 8 | 8 | 
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" | 
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" | 
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 299   descriptor->Initialize( | 299   descriptor->Initialize( | 
| 300       ARRAY_SIZE(registers), registers, | 300       ARRAY_SIZE(registers), registers, | 
| 301       Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry); | 301       Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry); | 
| 302 } | 302 } | 
| 303 | 303 | 
| 304 | 304 | 
| 305 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { | 305 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { | 
| 306   { | 306   { | 
| 307     CallInterfaceDescriptor* descriptor = | 307     CallInterfaceDescriptor* descriptor = | 
| 308         isolate->call_descriptor(Isolate::ArgumentAdaptorCall); | 308         isolate->call_descriptor(Isolate::ArgumentAdaptorCall); | 
| 309     static Register registers[] = { rdi,  // JSFunction | 309     Register registers[] = { rdi,  // JSFunction | 
| 310                                     rsi,  // context | 310                              rsi,  // context | 
| 311                                     rax,  // actual number of arguments | 311                              rax,  // actual number of arguments | 
| 312                                     rbx,  // expected number of arguments | 312                              rbx,  // expected number of arguments | 
| 313     }; | 313     }; | 
| 314     static Representation representations[] = { | 314     Representation representations[] = { | 
| 315         Representation::Tagged(),     // JSFunction | 315         Representation::Tagged(),     // JSFunction | 
| 316         Representation::Tagged(),     // context | 316         Representation::Tagged(),     // context | 
| 317         Representation::Integer32(),  // actual number of arguments | 317         Representation::Integer32(),  // actual number of arguments | 
| 318         Representation::Integer32(),  // expected number of arguments | 318         Representation::Integer32(),  // expected number of arguments | 
| 319     }; | 319     }; | 
| 320     descriptor->register_param_count_ = 4; | 320     descriptor->Initialize(ARRAY_SIZE(registers), registers, representations); | 
| 321     descriptor->register_params_ = registers; |  | 
| 322     descriptor->param_representations_ = representations; |  | 
| 323   } | 321   } | 
| 324   { | 322   { | 
| 325     CallInterfaceDescriptor* descriptor = | 323     CallInterfaceDescriptor* descriptor = | 
| 326         isolate->call_descriptor(Isolate::KeyedCall); | 324         isolate->call_descriptor(Isolate::KeyedCall); | 
| 327     static Register registers[] = { rsi,  // context | 325     Register registers[] = { rsi,  // context | 
| 328                                     rcx,  // key | 326                              rcx,  // key | 
| 329     }; | 327     }; | 
| 330     static Representation representations[] = { | 328     Representation representations[] = { | 
| 331         Representation::Tagged(),     // context | 329         Representation::Tagged(),     // context | 
| 332         Representation::Tagged(),     // key | 330         Representation::Tagged(),     // key | 
| 333     }; | 331     }; | 
| 334     descriptor->register_param_count_ = 2; | 332     descriptor->Initialize(ARRAY_SIZE(registers), registers, representations); | 
| 335     descriptor->register_params_ = registers; |  | 
| 336     descriptor->param_representations_ = representations; |  | 
| 337   } | 333   } | 
| 338   { | 334   { | 
| 339     CallInterfaceDescriptor* descriptor = | 335     CallInterfaceDescriptor* descriptor = | 
| 340         isolate->call_descriptor(Isolate::NamedCall); | 336         isolate->call_descriptor(Isolate::NamedCall); | 
| 341     static Register registers[] = { rsi,  // context | 337     Register registers[] = { rsi,  // context | 
| 342                                     rcx,  // name | 338                              rcx,  // name | 
| 343     }; | 339     }; | 
| 344     static Representation representations[] = { | 340     Representation representations[] = { | 
| 345         Representation::Tagged(),     // context | 341         Representation::Tagged(),     // context | 
| 346         Representation::Tagged(),     // name | 342         Representation::Tagged(),     // name | 
| 347     }; | 343     }; | 
| 348     descriptor->register_param_count_ = 2; | 344     descriptor->Initialize(ARRAY_SIZE(registers), registers, representations); | 
| 349     descriptor->register_params_ = registers; |  | 
| 350     descriptor->param_representations_ = representations; |  | 
| 351   } | 345   } | 
| 352   { | 346   { | 
| 353     CallInterfaceDescriptor* descriptor = | 347     CallInterfaceDescriptor* descriptor = | 
| 354         isolate->call_descriptor(Isolate::CallHandler); | 348         isolate->call_descriptor(Isolate::CallHandler); | 
| 355     static Register registers[] = { rsi,  // context | 349     Register registers[] = { rsi,  // context | 
| 356                                     rdx,  // receiver | 350                              rdx,  // receiver | 
| 357     }; | 351     }; | 
| 358     static Representation representations[] = { | 352     Representation representations[] = { | 
| 359         Representation::Tagged(),  // context | 353         Representation::Tagged(),  // context | 
| 360         Representation::Tagged(),  // receiver | 354         Representation::Tagged(),  // receiver | 
| 361     }; | 355     }; | 
| 362     descriptor->register_param_count_ = 2; | 356     descriptor->Initialize(ARRAY_SIZE(registers), registers, representations); | 
| 363     descriptor->register_params_ = registers; |  | 
| 364     descriptor->param_representations_ = representations; |  | 
| 365   } | 357   } | 
| 366   { | 358   { | 
| 367     CallInterfaceDescriptor* descriptor = | 359     CallInterfaceDescriptor* descriptor = | 
| 368         isolate->call_descriptor(Isolate::ApiFunctionCall); | 360         isolate->call_descriptor(Isolate::ApiFunctionCall); | 
| 369     static Register registers[] = { rax,  // callee | 361     Register registers[] = { rax,  // callee | 
| 370                                     rbx,  // call_data | 362                              rbx,  // call_data | 
| 371                                     rcx,  // holder | 363                              rcx,  // holder | 
| 372                                     rdx,  // api_function_address | 364                              rdx,  // api_function_address | 
| 373                                     rsi,  // context | 365                              rsi,  // context | 
| 374     }; | 366     }; | 
| 375     static Representation representations[] = { | 367     Representation representations[] = { | 
| 376         Representation::Tagged(),    // callee | 368         Representation::Tagged(),    // callee | 
| 377         Representation::Tagged(),    // call_data | 369         Representation::Tagged(),    // call_data | 
| 378         Representation::Tagged(),    // holder | 370         Representation::Tagged(),    // holder | 
| 379         Representation::External(),  // api_function_address | 371         Representation::External(),  // api_function_address | 
| 380         Representation::Tagged(),    // context | 372         Representation::Tagged(),    // context | 
| 381     }; | 373     }; | 
| 382     descriptor->register_param_count_ = 5; | 374     descriptor->Initialize(ARRAY_SIZE(registers), registers, representations); | 
| 383     descriptor->register_params_ = registers; |  | 
| 384     descriptor->param_representations_ = representations; |  | 
| 385   } | 375   } | 
| 386 } | 376 } | 
| 387 | 377 | 
| 388 | 378 | 
| 389 #define __ ACCESS_MASM(masm) | 379 #define __ ACCESS_MASM(masm) | 
| 390 | 380 | 
| 391 | 381 | 
| 392 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { | 382 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { | 
| 393   // Update the static counter each time a new code stub is generated. | 383   // Update the static counter each time a new code stub is generated. | 
| 394   isolate()->counters()->code_stubs()->Increment(); | 384   isolate()->counters()->code_stubs()->Increment(); | 
| (...skipping 4593 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4988                               return_value_operand, | 4978                               return_value_operand, | 
| 4989                               NULL); | 4979                               NULL); | 
| 4990 } | 4980 } | 
| 4991 | 4981 | 
| 4992 | 4982 | 
| 4993 #undef __ | 4983 #undef __ | 
| 4994 | 4984 | 
| 4995 } }  // namespace v8::internal | 4985 } }  // namespace v8::internal | 
| 4996 | 4986 | 
| 4997 #endif  // V8_TARGET_ARCH_X64 | 4987 #endif  // V8_TARGET_ARCH_X64 | 
| OLD | NEW | 
|---|