OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ast/scopes.h" | 5 #include "src/ast/scopes.h" |
6 #include "src/code-stubs.h" | 6 #include "src/code-stubs.h" |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 #include "src/compiler/common-operator.h" | 8 #include "src/compiler/common-operator.h" |
9 #include "src/compiler/frame.h" | 9 #include "src/compiler/frame.h" |
10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 locations.Build(), // location_sig | 397 locations.Build(), // location_sig |
398 stack_parameter_count, // stack_parameter_count | 398 stack_parameter_count, // stack_parameter_count |
399 properties, // properties | 399 properties, // properties |
400 kNoCalleeSaved, // callee-saved registers | 400 kNoCalleeSaved, // callee-saved registers |
401 kNoCalleeSaved, // callee-saved fp | 401 kNoCalleeSaved, // callee-saved fp |
402 CallDescriptor::kCanUseRoots | // flags | 402 CallDescriptor::kCanUseRoots | // flags |
403 flags, // flags | 403 flags, // flags |
404 descriptor.DebugName(isolate)); | 404 descriptor.DebugName(isolate)); |
405 } | 405 } |
406 | 406 |
| 407 // static |
| 408 CallDescriptor* Linkage::GetAllocateCallDescriptor(Zone* zone) { |
| 409 LocationSignature::Builder locations(zone, 1, 1); |
| 410 MachineSignature::Builder types(zone, 1, 1); |
| 411 |
| 412 locations.AddParam(regloc(kAllocateSizeRegister)); |
| 413 types.AddParam(MachineType::Int32()); |
| 414 |
| 415 locations.AddReturn(regloc(kReturnRegister0)); |
| 416 types.AddReturn(MachineType::AnyTagged()); |
| 417 |
| 418 // The target for allocate calls is a code object. |
| 419 MachineType target_type = MachineType::AnyTagged(); |
| 420 LinkageLocation target_loc = LinkageLocation::ForAnyRegister(); |
| 421 return new (zone) CallDescriptor( // -- |
| 422 CallDescriptor::kCallCodeObject, // kind |
| 423 target_type, // target MachineType |
| 424 target_loc, // target location |
| 425 types.Build(), // machine_sig |
| 426 locations.Build(), // location_sig |
| 427 0, // stack_parameter_count |
| 428 Operator::kNoThrow, // properties |
| 429 kNoCalleeSaved, // callee-saved registers |
| 430 kNoCalleeSaved, // callee-saved fp |
| 431 CallDescriptor::kCanUseRoots, // flags |
| 432 "Allocate"); |
| 433 } |
| 434 |
| 435 // static |
407 CallDescriptor* Linkage::GetBytecodeDispatchCallDescriptor( | 436 CallDescriptor* Linkage::GetBytecodeDispatchCallDescriptor( |
408 Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor, | 437 Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor, |
409 int stack_parameter_count) { | 438 int stack_parameter_count) { |
410 const int register_parameter_count = descriptor.GetRegisterParameterCount(); | 439 const int register_parameter_count = descriptor.GetRegisterParameterCount(); |
411 const int parameter_count = register_parameter_count + stack_parameter_count; | 440 const int parameter_count = register_parameter_count + stack_parameter_count; |
412 | 441 |
413 LocationSignature::Builder locations(zone, 0, parameter_count); | 442 LocationSignature::Builder locations(zone, 0, parameter_count); |
414 MachineSignature::Builder types(zone, 0, parameter_count); | 443 MachineSignature::Builder types(zone, 0, parameter_count); |
415 | 444 |
416 // Add parameters in registers and on the stack. | 445 // Add parameters in registers and on the stack. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 } else { | 517 } else { |
489 DCHECK(loc == regloc(kContextRegister)); | 518 DCHECK(loc == regloc(kContextRegister)); |
490 return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot); | 519 return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot); |
491 } | 520 } |
492 } | 521 } |
493 | 522 |
494 | 523 |
495 } // namespace compiler | 524 } // namespace compiler |
496 } // namespace internal | 525 } // namespace internal |
497 } // namespace v8 | 526 } // namespace v8 |
OLD | NEW |