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 #include "src/compiler.h" | 6 #include "src/compiler.h" |
7 | 7 |
8 namespace v8 { | 8 namespace v8 { |
9 namespace internal { | 9 namespace internal { |
10 namespace interpreter { | 10 namespace interpreter { |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 if (exit_seen_in_block_) { | 213 if (exit_seen_in_block_) { |
214 source_position_table_builder_.RevertPosition(bytecodes()->size()); | 214 source_position_table_builder_.RevertPosition(bytecodes()->size()); |
215 return; | 215 return; |
216 } | 216 } |
217 | 217 |
218 DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), 0); | 218 DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), 0); |
219 last_bytecode_start_ = bytecodes()->size(); | 219 last_bytecode_start_ = bytecodes()->size(); |
220 bytecodes()->push_back(Bytecodes::ToByte(bytecode)); | 220 bytecodes()->push_back(Bytecodes::ToByte(bytecode)); |
221 } | 221 } |
222 | 222 |
223 | |
224 BytecodeArrayBuilder& BytecodeArrayBuilder::BinaryOperation(Token::Value op, | 223 BytecodeArrayBuilder& BytecodeArrayBuilder::BinaryOperation(Token::Value op, |
225 Register reg, | 224 Register reg) { |
226 Strength strength) { | |
227 if (is_strong(strength)) { | |
228 UNIMPLEMENTED(); | |
229 } | |
230 | |
231 Output(BytecodeForBinaryOperation(op), reg.ToRawOperand()); | 225 Output(BytecodeForBinaryOperation(op), reg.ToRawOperand()); |
232 return *this; | 226 return *this; |
233 } | 227 } |
234 | 228 |
235 | 229 BytecodeArrayBuilder& BytecodeArrayBuilder::CountOperation(Token::Value op) { |
236 BytecodeArrayBuilder& BytecodeArrayBuilder::CountOperation(Token::Value op, | |
237 Strength strength) { | |
238 if (is_strong(strength)) { | |
239 UNIMPLEMENTED(); | |
240 } | |
241 | |
242 Output(BytecodeForCountOperation(op)); | 230 Output(BytecodeForCountOperation(op)); |
243 return *this; | 231 return *this; |
244 } | 232 } |
245 | 233 |
246 | 234 |
247 BytecodeArrayBuilder& BytecodeArrayBuilder::LogicalNot() { | 235 BytecodeArrayBuilder& BytecodeArrayBuilder::LogicalNot() { |
248 Output(Bytecode::kLogicalNot); | 236 Output(Bytecode::kLogicalNot); |
249 return *this; | 237 return *this; |
250 } | 238 } |
251 | 239 |
252 | 240 |
253 BytecodeArrayBuilder& BytecodeArrayBuilder::TypeOf() { | 241 BytecodeArrayBuilder& BytecodeArrayBuilder::TypeOf() { |
254 Output(Bytecode::kTypeOf); | 242 Output(Bytecode::kTypeOf); |
255 return *this; | 243 return *this; |
256 } | 244 } |
257 | 245 |
258 | 246 BytecodeArrayBuilder& BytecodeArrayBuilder::CompareOperation(Token::Value op, |
259 BytecodeArrayBuilder& BytecodeArrayBuilder::CompareOperation( | 247 Register reg) { |
260 Token::Value op, Register reg, Strength strength) { | |
261 if (is_strong(strength)) { | |
262 UNIMPLEMENTED(); | |
263 } | |
264 | |
265 Output(BytecodeForCompareOperation(op), reg.ToRawOperand()); | 248 Output(BytecodeForCompareOperation(op), reg.ToRawOperand()); |
266 return *this; | 249 return *this; |
267 } | 250 } |
268 | 251 |
269 | 252 |
270 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLiteral( | 253 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLiteral( |
271 v8::internal::Smi* smi) { | 254 v8::internal::Smi* smi) { |
272 int32_t raw_smi = smi->value(); | 255 int32_t raw_smi = smi->value(); |
273 if (raw_smi == 0) { | 256 if (raw_smi == 0) { |
274 Output(Bytecode::kLdaZero); | 257 Output(Bytecode::kLdaZero); |
(...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1688 } | 1671 } |
1689 | 1672 |
1690 // static | 1673 // static |
1691 bool BytecodeArrayBuilder::FitsInReg16OperandUntranslated(Register value) { | 1674 bool BytecodeArrayBuilder::FitsInReg16OperandUntranslated(Register value) { |
1692 return value.is_short_operand(); | 1675 return value.is_short_operand(); |
1693 } | 1676 } |
1694 | 1677 |
1695 } // namespace interpreter | 1678 } // namespace interpreter |
1696 } // namespace internal | 1679 } // namespace internal |
1697 } // namespace v8 | 1680 } // namespace v8 |
OLD | NEW |