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

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

Issue 1989363004: [turbofan] Add FixedArray peephole optimizations to CodeStubAssembler (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test Created 4 years, 7 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
« no previous file with comments | « src/compiler/code-assembler.h ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 81
82 bool CodeAssembler::IsFloat64RoundDownSupported() const { 82 bool CodeAssembler::IsFloat64RoundDownSupported() const {
83 return raw_assembler_->machine()->Float64RoundDown().IsSupported(); 83 return raw_assembler_->machine()->Float64RoundDown().IsSupported();
84 } 84 }
85 85
86 bool CodeAssembler::IsFloat64RoundTruncateSupported() const { 86 bool CodeAssembler::IsFloat64RoundTruncateSupported() const {
87 return raw_assembler_->machine()->Float64RoundTruncate().IsSupported(); 87 return raw_assembler_->machine()->Float64RoundTruncate().IsSupported();
88 } 88 }
89 89
90 Node* CodeAssembler::Int32Constant(int value) { 90 Node* CodeAssembler::Int32Constant(int32_t value) {
91 return raw_assembler_->Int32Constant(value); 91 return raw_assembler_->Int32Constant(value);
92 } 92 }
93 93
94 Node* CodeAssembler::Int64Constant(int64_t value) {
95 return raw_assembler_->Int64Constant(value);
96 }
97
94 Node* CodeAssembler::IntPtrConstant(intptr_t value) { 98 Node* CodeAssembler::IntPtrConstant(intptr_t value) {
95 return raw_assembler_->IntPtrConstant(value); 99 return raw_assembler_->IntPtrConstant(value);
96 } 100 }
97 101
98 Node* CodeAssembler::NumberConstant(double value) { 102 Node* CodeAssembler::NumberConstant(double value) {
99 return raw_assembler_->NumberConstant(value); 103 return raw_assembler_->NumberConstant(value);
100 } 104 }
101 105
102 Node* CodeAssembler::SmiConstant(Smi* value) { 106 Node* CodeAssembler::SmiConstant(Smi* value) {
103 return IntPtrConstant(bit_cast<intptr_t>(value)); 107 return IntPtrConstant(bit_cast<intptr_t>(value));
(...skipping 12 matching lines...) Expand all
116 } 120 }
117 121
118 Node* CodeAssembler::Float64Constant(double value) { 122 Node* CodeAssembler::Float64Constant(double value) {
119 return raw_assembler_->Float64Constant(value); 123 return raw_assembler_->Float64Constant(value);
120 } 124 }
121 125
122 Node* CodeAssembler::NaNConstant() { 126 Node* CodeAssembler::NaNConstant() {
123 return LoadRoot(Heap::kNanValueRootIndex); 127 return LoadRoot(Heap::kNanValueRootIndex);
124 } 128 }
125 129
130 bool CodeAssembler::ToInt32Constant(Node* node, int32_t& out_value) {
131 if (node->opcode() == IrOpcode::kInt32Constant) {
Michael Starzinger 2016/05/19 10:54:21 Can we use an Int32Matcher to do this kind of matc
danno 2016/05/19 11:10:18 Done.
132 out_value = OpParameter<int32_t>(node);
133 return true;
134 }
135
136 if (node->opcode() == IrOpcode::kInt64Constant) {
Michael Starzinger 2016/05/19 10:54:21 Can we use an Int64Matcher (and the IsInRange meth
danno 2016/05/19 11:10:18 Done.
137 int64_t big_value = OpParameter<int64_t>(node);
138 if (big_value <= std::numeric_limits<int32_t>::max() &&
139 big_value >= std::numeric_limits<int32_t>::min()) {
140 out_value = static_cast<int32_t>(big_value);
141 return true;
142 }
143 }
144
145 return false;
146 }
147
148 bool CodeAssembler::ToInt64Constant(Node* node, int64_t& out_value) {
149 if (node->opcode() == IrOpcode::kInt32Constant) {
Michael Starzinger 2016/05/19 10:54:21 Can we use an Int64Matcher to do this kind of matc
danno 2016/05/19 11:10:18 Done.
150 out_value = OpParameter<int32_t>(node);
151 return true;
152 }
153 if (node->opcode() == IrOpcode::kInt64Constant) {
154 out_value = OpParameter<int64_t>(node);
155 return true;
156 }
157 return false;
158 }
159
160 bool CodeAssembler::ToIntPtrConstant(Node* node, intptr_t& out_value) {
161 if (kPointerSize == 8) {
Michael Starzinger 2016/05/19 10:54:21 Can we use an IntPtrMatcher to do this kind of mat
danno 2016/05/19 11:10:18 Done.
162 if (node->opcode() == IrOpcode::kInt64Constant) {
163 out_value = OpParameter<intptr_t>(node);
164 return true;
165 }
166 } else {
167 DCHECK_EQ(4, kPointerSize);
168 if (node->opcode() == IrOpcode::kInt32Constant) {
169 out_value = OpParameter<intptr_t>(node);
170 return true;
171 }
172 }
173 return false;
174 }
175
126 Node* CodeAssembler::Parameter(int value) { 176 Node* CodeAssembler::Parameter(int value) {
127 return raw_assembler_->Parameter(value); 177 return raw_assembler_->Parameter(value);
128 } 178 }
129 179
130 void CodeAssembler::Return(Node* value) { 180 void CodeAssembler::Return(Node* value) {
131 return raw_assembler_->Return(value); 181 return raw_assembler_->Return(value);
132 } 182 }
133 183
134 void CodeAssembler::Bind(CodeAssembler::Label* label) { return label->Bind(); } 184 void CodeAssembler::Bind(CodeAssembler::Label* label) { return label->Bind(); }
135 185
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 } 749 }
700 } 750 }
701 } 751 }
702 752
703 bound_ = true; 753 bound_ = true;
704 } 754 }
705 755
706 } // namespace compiler 756 } // namespace compiler
707 } // namespace internal 757 } // namespace internal
708 } // namespace v8 758 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/code-assembler.h ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698