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/bytecode-graph-builder.h" | 5 #include "src/compiler/bytecode-graph-builder.h" |
6 | 6 |
7 #include "src/compiler/bytecode-branch-analysis.h" | 7 #include "src/compiler/bytecode-branch-analysis.h" |
8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
9 #include "src/compiler/operator-properties.h" | 9 #include "src/compiler/operator-properties.h" |
10 #include "src/interpreter/bytecodes.h" | 10 #include "src/interpreter/bytecodes.h" |
(...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1178 DCHECK_EQ(FeedbackVectorSlotKind::GENERAL, feedback_vector()->GetKind(slot)); | 1178 DCHECK_EQ(FeedbackVectorSlotKind::GENERAL, feedback_vector()->GetKind(slot)); |
1179 Object* feedback = feedback_vector()->Get(slot); | 1179 Object* feedback = feedback_vector()->Get(slot); |
1180 BinaryOperationHints::Hint hint = BinaryOperationHints::Hint::kAny; | 1180 BinaryOperationHints::Hint hint = BinaryOperationHints::Hint::kAny; |
1181 if (feedback->IsSmi()) { | 1181 if (feedback->IsSmi()) { |
1182 hint = BinaryOperationHintFromFeedback((Smi::cast(feedback))->value()); | 1182 hint = BinaryOperationHintFromFeedback((Smi::cast(feedback))->value()); |
1183 } | 1183 } |
1184 return BinaryOperationHints(hint, hint, hint); | 1184 return BinaryOperationHints(hint, hint, hint); |
1185 } | 1185 } |
1186 | 1186 |
1187 void BytecodeGraphBuilder::VisitAdd() { | 1187 void BytecodeGraphBuilder::VisitAdd() { |
1188 BinaryOperationHints hints = BinaryOperationHints::Any(); | 1188 BuildBinaryOp(javascript()->Add(GetBinaryOperationHint())); |
1189 BuildBinaryOp(javascript()->Add(hints)); | |
1190 } | 1189 } |
1191 | 1190 |
1192 void BytecodeGraphBuilder::VisitSub() { | 1191 void BytecodeGraphBuilder::VisitSub() { |
1193 BuildBinaryOp(javascript()->Subtract(GetBinaryOperationHint())); | 1192 BuildBinaryOp(javascript()->Subtract(GetBinaryOperationHint())); |
1194 } | 1193 } |
1195 | 1194 |
1196 void BytecodeGraphBuilder::VisitMul() { | 1195 void BytecodeGraphBuilder::VisitMul() { |
1197 BinaryOperationHints hints = BinaryOperationHints::Any(); | 1196 BuildBinaryOp(javascript()->Multiply(GetBinaryOperationHint())); |
1198 BuildBinaryOp(javascript()->Multiply(hints)); | |
1199 } | 1197 } |
1200 | 1198 |
1201 void BytecodeGraphBuilder::VisitDiv() { | 1199 void BytecodeGraphBuilder::VisitDiv() { |
1202 BinaryOperationHints hints = BinaryOperationHints::Any(); | 1200 BuildBinaryOp(javascript()->Divide(GetBinaryOperationHint())); |
1203 BuildBinaryOp(javascript()->Divide(hints)); | |
1204 } | 1201 } |
1205 | 1202 |
1206 void BytecodeGraphBuilder::VisitMod() { | 1203 void BytecodeGraphBuilder::VisitMod() { |
1207 BinaryOperationHints hints = BinaryOperationHints::Any(); | 1204 BuildBinaryOp(javascript()->Modulus(GetBinaryOperationHint())); |
1208 BuildBinaryOp(javascript()->Modulus(hints)); | |
1209 } | 1205 } |
1210 | 1206 |
1211 void BytecodeGraphBuilder::VisitBitwiseOr() { | 1207 void BytecodeGraphBuilder::VisitBitwiseOr() { |
1212 BinaryOperationHints hints = BinaryOperationHints::Any(); | 1208 BinaryOperationHints hints = BinaryOperationHints::Any(); |
1213 BuildBinaryOp(javascript()->BitwiseOr(hints)); | 1209 BuildBinaryOp(javascript()->BitwiseOr(hints)); |
1214 } | 1210 } |
1215 | 1211 |
1216 void BytecodeGraphBuilder::VisitBitwiseXor() { | 1212 void BytecodeGraphBuilder::VisitBitwiseXor() { |
1217 BinaryOperationHints hints = BinaryOperationHints::Any(); | 1213 BinaryOperationHints hints = BinaryOperationHints::Any(); |
1218 BuildBinaryOp(javascript()->BitwiseXor(hints)); | 1214 BuildBinaryOp(javascript()->BitwiseXor(hints)); |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1895 // Phi does not exist yet, introduce one. | 1891 // Phi does not exist yet, introduce one. |
1896 value = NewPhi(inputs, value, control); | 1892 value = NewPhi(inputs, value, control); |
1897 value->ReplaceInput(inputs - 1, other); | 1893 value->ReplaceInput(inputs - 1, other); |
1898 } | 1894 } |
1899 return value; | 1895 return value; |
1900 } | 1896 } |
1901 | 1897 |
1902 } // namespace compiler | 1898 } // namespace compiler |
1903 } // namespace internal | 1899 } // namespace internal |
1904 } // namespace v8 | 1900 } // namespace v8 |
OLD | NEW |