Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(983)

Side by Side Diff: src/compiler/code-assembler.cc

Issue 2752273003: [builtins] Implement Array.prototype.reduce in the CSA (Closed)
Patch Set: Cleanup Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 size_t result_size, Node* target, Node* context, 573 size_t result_size, Node* target, Node* context,
574 TArgs... args) { 574 TArgs... args) {
575 Node* nodes[] = {target, args..., context}; 575 Node* nodes[] = {target, args..., context};
576 return CallStubN(descriptor, result_size, arraysize(nodes), nodes); 576 return CallStubN(descriptor, result_size, arraysize(nodes), nodes);
577 } 577 }
578 578
579 // Instantiate CallStubR() for argument counts used by CSA-generated code. 579 // Instantiate CallStubR() for argument counts used by CSA-generated code.
580 #define INSTANTIATE(...) \ 580 #define INSTANTIATE(...) \
581 template V8_EXPORT_PRIVATE Node* CodeAssembler::CallStubR( \ 581 template V8_EXPORT_PRIVATE Node* CodeAssembler::CallStubR( \
582 const CallInterfaceDescriptor& descriptor, size_t, Node*, __VA_ARGS__); 582 const CallInterfaceDescriptor& descriptor, size_t, Node*, __VA_ARGS__);
583 REPEAT_1_TO_7(INSTANTIATE, Node*) 583 REPEAT_1_TO_8(INSTANTIATE, Node*)
584 #undef INSTANTIATE 584 #undef INSTANTIATE
585 585
586 Node* CodeAssembler::CallStubN(const CallInterfaceDescriptor& descriptor, 586 Node* CodeAssembler::CallStubN(const CallInterfaceDescriptor& descriptor,
587 size_t result_size, int input_count, 587 size_t result_size, int input_count,
588 Node* const* inputs) { 588 Node* const* inputs) {
589 // 2 is for target and context. 589 // 2 is for target and context.
590 DCHECK_LE(2, input_count); 590 DCHECK_LE(2, input_count);
591 int argc = input_count - 2; 591 int argc = input_count - 2;
592 DCHECK_LE(descriptor.GetParameterCount(), argc); 592 DCHECK_LE(descriptor.GetParameterCount(), argc);
593 // Extra arguments not mentioned in the descriptor are passed on the stack. 593 // Extra arguments not mentioned in the descriptor are passed on the stack.
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 DCHECK_NOT_NULL(impl_->value_); 752 DCHECK_NOT_NULL(impl_->value_);
753 return impl_->value_; 753 return impl_->value_;
754 } 754 }
755 755
756 MachineRepresentation CodeAssemblerVariable::rep() const { return impl_->rep_; } 756 MachineRepresentation CodeAssemblerVariable::rep() const { return impl_->rep_; }
757 757
758 bool CodeAssemblerVariable::IsBound() const { return impl_->value_ != nullptr; } 758 bool CodeAssemblerVariable::IsBound() const { return impl_->value_ != nullptr; }
759 759
760 CodeAssemblerLabel::CodeAssemblerLabel(CodeAssembler* assembler, 760 CodeAssemblerLabel::CodeAssemblerLabel(CodeAssembler* assembler,
761 size_t vars_count, 761 size_t vars_count,
762 CodeAssemblerVariable** vars, 762 CodeAssemblerVariable* const* vars,
763 CodeAssemblerLabel::Type type) 763 CodeAssemblerLabel::Type type)
764 : bound_(false), 764 : bound_(false),
765 merge_count_(0), 765 merge_count_(0),
766 state_(assembler->state()), 766 state_(assembler->state()),
767 label_(nullptr) { 767 label_(nullptr) {
768 void* buffer = assembler->zone()->New(sizeof(RawMachineLabel)); 768 void* buffer = assembler->zone()->New(sizeof(RawMachineLabel));
769 label_ = new (buffer) 769 label_ = new (buffer)
770 RawMachineLabel(type == kDeferred ? RawMachineLabel::kDeferred 770 RawMachineLabel(type == kDeferred ? RawMachineLabel::kDeferred
771 : RawMachineLabel::kNonDeferred); 771 : RawMachineLabel::kNonDeferred);
772 for (size_t i = 0; i < vars_count; ++i) { 772 for (size_t i = 0; i < vars_count; ++i) {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 } 875 }
876 } 876 }
877 } 877 }
878 878
879 bound_ = true; 879 bound_ = true;
880 } 880 }
881 881
882 } // namespace compiler 882 } // namespace compiler
883 } // namespace internal 883 } // namespace internal
884 } // namespace v8 884 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698