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 namespace v8 { | 7 namespace v8 { |
8 namespace internal { | 8 namespace internal { |
9 namespace interpreter { | 9 namespace interpreter { |
10 | 10 |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 if (FitsInIdx8Operand(feedback_slot)) { | 315 if (FitsInIdx8Operand(feedback_slot)) { |
316 Output(bytecode, object.ToOperand(), key.ToOperand(), | 316 Output(bytecode, object.ToOperand(), key.ToOperand(), |
317 static_cast<uint8_t>(feedback_slot)); | 317 static_cast<uint8_t>(feedback_slot)); |
318 } else { | 318 } else { |
319 UNIMPLEMENTED(); | 319 UNIMPLEMENTED(); |
320 } | 320 } |
321 return *this; | 321 return *this; |
322 } | 322 } |
323 | 323 |
324 | 324 |
| 325 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateClosure( |
| 326 PretenureFlag tenured) { |
| 327 DCHECK(FitsInImm8Operand(tenured)); |
| 328 Output(Bytecode::kCreateClosure, static_cast<uint8_t>(tenured)); |
| 329 return *this; |
| 330 } |
| 331 |
| 332 |
325 BytecodeArrayBuilder& BytecodeArrayBuilder::CastAccumulatorToBoolean() { | 333 BytecodeArrayBuilder& BytecodeArrayBuilder::CastAccumulatorToBoolean() { |
326 if (LastBytecodeInSameBlock()) { | 334 if (LastBytecodeInSameBlock()) { |
327 // If the previous bytecode puts a boolean in the accumulator | 335 // If the previous bytecode puts a boolean in the accumulator |
328 // there is no need to emit an instruction. | 336 // there is no need to emit an instruction. |
329 switch (Bytecodes::FromByte(bytecodes()->at(last_bytecode_start_))) { | 337 switch (Bytecodes::FromByte(bytecodes()->at(last_bytecode_start_))) { |
330 case Bytecode::kToBoolean: | 338 case Bytecode::kToBoolean: |
331 UNREACHABLE(); | 339 UNREACHABLE(); |
332 case Bytecode::kLdaTrue: | 340 case Bytecode::kLdaTrue: |
333 case Bytecode::kLdaFalse: | 341 case Bytecode::kLdaFalse: |
334 case Bytecode::kLogicalNot: | 342 case Bytecode::kLogicalNot: |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 | 764 |
757 Register TemporaryRegisterScope::NewRegister() { | 765 Register TemporaryRegisterScope::NewRegister() { |
758 count_++; | 766 count_++; |
759 last_register_index_ = builder_->BorrowTemporaryRegister(); | 767 last_register_index_ = builder_->BorrowTemporaryRegister(); |
760 return Register(last_register_index_); | 768 return Register(last_register_index_); |
761 } | 769 } |
762 | 770 |
763 } // namespace interpreter | 771 } // namespace interpreter |
764 } // namespace internal | 772 } // namespace internal |
765 } // namespace v8 | 773 } // namespace v8 |
OLD | NEW |