| 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/interpreter/bytecode-array-builder.h" | 5 #include "src/interpreter/bytecode-array-builder.h" |
| 6 | 6 |
| 7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
| 8 #include "src/globals.h" | 8 #include "src/globals.h" |
| 9 #include "src/interpreter/bytecode-array-writer.h" | 9 #include "src/interpreter/bytecode-array-writer.h" |
| 10 #include "src/interpreter/bytecode-dead-code-optimizer.h" | 10 #include "src/interpreter/bytecode-dead-code-optimizer.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 145 } |
| 146 | 146 |
| 147 void BytecodeArrayBuilder::Output(Bytecode bytecode) { | 147 void BytecodeArrayBuilder::Output(Bytecode bytecode) { |
| 148 DCHECK(OperandsAreValid(bytecode, 0)); | 148 DCHECK(OperandsAreValid(bytecode, 0)); |
| 149 BytecodeNode node(bytecode); | 149 BytecodeNode node(bytecode); |
| 150 AttachSourceInfo(&node); | 150 AttachSourceInfo(&node); |
| 151 pipeline()->Write(&node); | 151 pipeline()->Write(&node); |
| 152 } | 152 } |
| 153 | 153 |
| 154 BytecodeArrayBuilder& BytecodeArrayBuilder::BinaryOperation(Token::Value op, | 154 BytecodeArrayBuilder& BytecodeArrayBuilder::BinaryOperation(Token::Value op, |
| 155 Register reg) { | 155 Register reg, |
| 156 Output(BytecodeForBinaryOperation(op), RegisterOperand(reg)); | 156 int feedback_slot) { |
| 157 Output(BytecodeForBinaryOperation(op), RegisterOperand(reg), |
| 158 UnsignedOperand(feedback_slot)); |
| 157 return *this; | 159 return *this; |
| 158 } | 160 } |
| 159 | 161 |
| 160 BytecodeArrayBuilder& BytecodeArrayBuilder::CountOperation(Token::Value op) { | 162 BytecodeArrayBuilder& BytecodeArrayBuilder::CountOperation(Token::Value op, |
| 161 Output(BytecodeForCountOperation(op)); | 163 int feedback_slot) { |
| 164 Output(BytecodeForCountOperation(op), UnsignedOperand(feedback_slot)); |
| 162 return *this; | 165 return *this; |
| 163 } | 166 } |
| 164 | 167 |
| 165 BytecodeArrayBuilder& BytecodeArrayBuilder::LogicalNot() { | 168 BytecodeArrayBuilder& BytecodeArrayBuilder::LogicalNot() { |
| 166 Output(Bytecode::kToBooleanLogicalNot); | 169 Output(Bytecode::kToBooleanLogicalNot); |
| 167 return *this; | 170 return *this; |
| 168 } | 171 } |
| 169 | 172 |
| 170 | 173 |
| 171 BytecodeArrayBuilder& BytecodeArrayBuilder::TypeOf() { | 174 BytecodeArrayBuilder& BytecodeArrayBuilder::TypeOf() { |
| (...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 return Bytecode::kTailCall; | 963 return Bytecode::kTailCall; |
| 961 default: | 964 default: |
| 962 UNREACHABLE(); | 965 UNREACHABLE(); |
| 963 } | 966 } |
| 964 return Bytecode::kIllegal; | 967 return Bytecode::kIllegal; |
| 965 } | 968 } |
| 966 | 969 |
| 967 } // namespace interpreter | 970 } // namespace interpreter |
| 968 } // namespace internal | 971 } // namespace internal |
| 969 } // namespace v8 | 972 } // namespace v8 |
| OLD | NEW |