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

Unified Diff: src/interpreter/bytecode-array-builder.cc

Issue 2263253002: [interpreter] Make the binary op with Smi bytecode handlers collect type feedback. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added tests. Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: src/interpreter/bytecode-array-builder.cc
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc
index 9bef5a5a4cdb3d82b762eafc7eb9d1f777625a08..392761d03f74f8b10087d1e4705ed4dd5d7660a3 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -158,6 +158,14 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::BinaryOperation(Token::Value op,
return *this;
}
+BytecodeArrayBuilder& BytecodeArrayBuilder::BinaryOperationSmi(
+ Token::Value op, int32_t smi_value, Register reg, int feedback_slot) {
+ DCHECK(Smi::IsValid(smi_value));
+ Output(BytecodeForBinaryOperationSmi(op), SignedOperand(smi_value),
+ RegisterOperand(reg), UnsignedOperand(feedback_slot));
+ return *this;
+}
+
BytecodeArrayBuilder& BytecodeArrayBuilder::CountOperation(Token::Value op,
int feedback_slot) {
Output(BytecodeForCountOperation(op), UnsignedOperand(feedback_slot));
@@ -846,6 +854,27 @@ Bytecode BytecodeArrayBuilder::BytecodeForBinaryOperation(Token::Value op) {
}
// static
+Bytecode BytecodeArrayBuilder::BytecodeForBinaryOperationSmi(Token::Value op) {
+ switch (op) {
+ case Token::Value::ADD:
+ return Bytecode::kAddSmi;
+ case Token::Value::SUB:
+ return Bytecode::kSubSmi;
+ case Token::Value::BIT_OR:
+ return Bytecode::kBitwiseOrSmi;
+ case Token::Value::BIT_AND:
+ return Bytecode::kBitwiseAndSmi;
+ case Token::Value::SHL:
+ return Bytecode::kShiftLeftSmi;
+ case Token::Value::SAR:
+ return Bytecode::kShiftRightSmi;
+ default:
+ UNREACHABLE();
+ return Bytecode::kIllegal;
+ }
+}
+
+// static
Bytecode BytecodeArrayBuilder::BytecodeForCountOperation(Token::Value op) {
switch (op) {
case Token::Value::ADD:

Powered by Google App Engine
This is Rietveld 408576698