| 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 int feedback_slot, | 610 int feedback_slot, |
| 611 TailCallMode tail_call_mode) { | 611 TailCallMode tail_call_mode) { |
| 612 Bytecode bytecode = BytecodeForCall(tail_call_mode); | 612 Bytecode bytecode = BytecodeForCall(tail_call_mode); |
| 613 Output(bytecode, RegisterOperand(callable), RegisterOperand(receiver_args), | 613 Output(bytecode, RegisterOperand(callable), RegisterOperand(receiver_args), |
| 614 UnsignedOperand(receiver_args_count), UnsignedOperand(feedback_slot)); | 614 UnsignedOperand(receiver_args_count), UnsignedOperand(feedback_slot)); |
| 615 return *this; | 615 return *this; |
| 616 } | 616 } |
| 617 | 617 |
| 618 BytecodeArrayBuilder& BytecodeArrayBuilder::New(Register constructor, | 618 BytecodeArrayBuilder& BytecodeArrayBuilder::New(Register constructor, |
| 619 Register first_arg, | 619 Register first_arg, |
| 620 size_t arg_count) { | 620 size_t arg_count, |
| 621 int feedback_slot_id) { |
| 621 if (!first_arg.is_valid()) { | 622 if (!first_arg.is_valid()) { |
| 622 DCHECK_EQ(0u, arg_count); | 623 DCHECK_EQ(0u, arg_count); |
| 623 first_arg = Register(0); | 624 first_arg = Register(0); |
| 624 } | 625 } |
| 625 Output(Bytecode::kNew, RegisterOperand(constructor), | 626 Output(Bytecode::kNew, RegisterOperand(constructor), |
| 626 RegisterOperand(first_arg), UnsignedOperand(arg_count)); | 627 RegisterOperand(first_arg), UnsignedOperand(arg_count), |
| 628 UnsignedOperand(feedback_slot_id)); |
| 627 return *this; | 629 return *this; |
| 628 } | 630 } |
| 629 | 631 |
| 630 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime( | 632 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime( |
| 631 Runtime::FunctionId function_id, Register first_arg, size_t arg_count) { | 633 Runtime::FunctionId function_id, Register first_arg, size_t arg_count) { |
| 632 DCHECK_EQ(1, Runtime::FunctionForId(function_id)->result_size); | 634 DCHECK_EQ(1, Runtime::FunctionForId(function_id)->result_size); |
| 633 DCHECK(Bytecodes::SizeForUnsignedOperand(function_id) <= OperandSize::kShort); | 635 DCHECK(Bytecodes::SizeForUnsignedOperand(function_id) <= OperandSize::kShort); |
| 634 if (!first_arg.is_valid()) { | 636 if (!first_arg.is_valid()) { |
| 635 DCHECK_EQ(0u, arg_count); | 637 DCHECK_EQ(0u, arg_count); |
| 636 first_arg = Register(0); | 638 first_arg = Register(0); |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 return Bytecode::kTailCall; | 991 return Bytecode::kTailCall; |
| 990 default: | 992 default: |
| 991 UNREACHABLE(); | 993 UNREACHABLE(); |
| 992 } | 994 } |
| 993 return Bytecode::kIllegal; | 995 return Bytecode::kIllegal; |
| 994 } | 996 } |
| 995 | 997 |
| 996 } // namespace interpreter | 998 } // namespace interpreter |
| 997 } // namespace internal | 999 } // namespace internal |
| 998 } // namespace v8 | 1000 } // namespace v8 |
| OLD | NEW |