OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/compiler/code-assembler.h" | 5 #include "src/compiler/code-assembler.h" |
6 | 6 |
7 #include <ostream> | 7 #include <ostream> |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 size_t result_size, Node* target, Node* context, | 580 size_t result_size, Node* target, Node* context, |
581 TArgs... args) { | 581 TArgs... args) { |
582 Node* nodes[] = {target, args..., context}; | 582 Node* nodes[] = {target, args..., context}; |
583 return CallStubN(descriptor, result_size, arraysize(nodes), nodes); | 583 return CallStubN(descriptor, result_size, arraysize(nodes), nodes); |
584 } | 584 } |
585 | 585 |
586 // Instantiate CallStubR() for argument counts used by CSA-generated code. | 586 // Instantiate CallStubR() for argument counts used by CSA-generated code. |
587 #define INSTANTIATE(...) \ | 587 #define INSTANTIATE(...) \ |
588 template V8_EXPORT_PRIVATE Node* CodeAssembler::CallStubR( \ | 588 template V8_EXPORT_PRIVATE Node* CodeAssembler::CallStubR( \ |
589 const CallInterfaceDescriptor& descriptor, size_t, Node*, __VA_ARGS__); | 589 const CallInterfaceDescriptor& descriptor, size_t, Node*, __VA_ARGS__); |
590 REPEAT_1_TO_7(INSTANTIATE, Node*) | 590 REPEAT_1_TO_8(INSTANTIATE, Node*) |
591 #undef INSTANTIATE | 591 #undef INSTANTIATE |
592 | 592 |
593 Node* CodeAssembler::CallStubN(const CallInterfaceDescriptor& descriptor, | 593 Node* CodeAssembler::CallStubN(const CallInterfaceDescriptor& descriptor, |
594 size_t result_size, int input_count, | 594 size_t result_size, int input_count, |
595 Node* const* inputs) { | 595 Node* const* inputs) { |
596 // 2 is for target and context. | 596 // 2 is for target and context. |
597 DCHECK_LE(2, input_count); | 597 DCHECK_LE(2, input_count); |
598 int argc = input_count - 2; | 598 int argc = input_count - 2; |
599 DCHECK_LE(descriptor.GetParameterCount(), argc); | 599 DCHECK_LE(descriptor.GetParameterCount(), argc); |
600 // Extra arguments not mentioned in the descriptor are passed on the stack. | 600 // Extra arguments not mentioned in the descriptor are passed on the stack. |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 DCHECK_NOT_NULL(impl_->value_); | 759 DCHECK_NOT_NULL(impl_->value_); |
760 return impl_->value_; | 760 return impl_->value_; |
761 } | 761 } |
762 | 762 |
763 MachineRepresentation CodeAssemblerVariable::rep() const { return impl_->rep_; } | 763 MachineRepresentation CodeAssemblerVariable::rep() const { return impl_->rep_; } |
764 | 764 |
765 bool CodeAssemblerVariable::IsBound() const { return impl_->value_ != nullptr; } | 765 bool CodeAssemblerVariable::IsBound() const { return impl_->value_ != nullptr; } |
766 | 766 |
767 CodeAssemblerLabel::CodeAssemblerLabel(CodeAssembler* assembler, | 767 CodeAssemblerLabel::CodeAssemblerLabel(CodeAssembler* assembler, |
768 size_t vars_count, | 768 size_t vars_count, |
769 CodeAssemblerVariable** vars, | 769 CodeAssemblerVariable* const* vars, |
770 CodeAssemblerLabel::Type type) | 770 CodeAssemblerLabel::Type type) |
771 : bound_(false), | 771 : bound_(false), |
772 merge_count_(0), | 772 merge_count_(0), |
773 state_(assembler->state()), | 773 state_(assembler->state()), |
774 label_(nullptr) { | 774 label_(nullptr) { |
775 void* buffer = assembler->zone()->New(sizeof(RawMachineLabel)); | 775 void* buffer = assembler->zone()->New(sizeof(RawMachineLabel)); |
776 label_ = new (buffer) | 776 label_ = new (buffer) |
777 RawMachineLabel(type == kDeferred ? RawMachineLabel::kDeferred | 777 RawMachineLabel(type == kDeferred ? RawMachineLabel::kDeferred |
778 : RawMachineLabel::kNonDeferred); | 778 : RawMachineLabel::kNonDeferred); |
779 for (size_t i = 0; i < vars_count; ++i) { | 779 for (size_t i = 0; i < vars_count; ++i) { |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 } | 882 } |
883 } | 883 } |
884 } | 884 } |
885 | 885 |
886 bound_ = true; | 886 bound_ = true; |
887 } | 887 } |
888 | 888 |
889 } // namespace compiler | 889 } // namespace compiler |
890 } // namespace internal | 890 } // namespace internal |
891 } // namespace v8 | 891 } // namespace v8 |
OLD | NEW |