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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 return *this; | 347 return *this; |
348 } | 348 } |
349 | 349 |
350 | 350 |
351 BytecodeArrayBuilder& BytecodeArrayBuilder::PopContext(Register context) { | 351 BytecodeArrayBuilder& BytecodeArrayBuilder::PopContext(Register context) { |
352 Output(Bytecode::kPopContext, context.ToOperand()); | 352 Output(Bytecode::kPopContext, context.ToOperand()); |
353 return *this; | 353 return *this; |
354 } | 354 } |
355 | 355 |
356 | 356 |
| 357 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateClosure( |
| 358 PretenureFlag tenured) { |
| 359 DCHECK(FitsInImm8Operand(tenured)); |
| 360 Output(Bytecode::kCreateClosure, static_cast<uint8_t>(tenured)); |
| 361 return *this; |
| 362 } |
| 363 |
| 364 |
357 BytecodeArrayBuilder& BytecodeArrayBuilder::CastAccumulatorToBoolean() { | 365 BytecodeArrayBuilder& BytecodeArrayBuilder::CastAccumulatorToBoolean() { |
358 if (LastBytecodeInSameBlock()) { | 366 if (LastBytecodeInSameBlock()) { |
359 // If the previous bytecode puts a boolean in the accumulator | 367 // If the previous bytecode puts a boolean in the accumulator |
360 // there is no need to emit an instruction. | 368 // there is no need to emit an instruction. |
361 switch (Bytecodes::FromByte(bytecodes()->at(last_bytecode_start_))) { | 369 switch (Bytecodes::FromByte(bytecodes()->at(last_bytecode_start_))) { |
362 case Bytecode::kToBoolean: | 370 case Bytecode::kToBoolean: |
363 UNREACHABLE(); | 371 UNREACHABLE(); |
364 case Bytecode::kLdaTrue: | 372 case Bytecode::kLdaTrue: |
365 case Bytecode::kLdaFalse: | 373 case Bytecode::kLdaFalse: |
366 case Bytecode::kLogicalNot: | 374 case Bytecode::kLogicalNot: |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 | 784 |
777 Register TemporaryRegisterScope::NewRegister() { | 785 Register TemporaryRegisterScope::NewRegister() { |
778 count_++; | 786 count_++; |
779 last_register_index_ = builder_->BorrowTemporaryRegister(); | 787 last_register_index_ = builder_->BorrowTemporaryRegister(); |
780 return Register(last_register_index_); | 788 return Register(last_register_index_); |
781 } | 789 } |
782 | 790 |
783 } // namespace interpreter | 791 } // namespace interpreter |
784 } // namespace internal | 792 } // namespace internal |
785 } // namespace v8 | 793 } // namespace v8 |
OLD | NEW |