| 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 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 int feedback_slot, | 575 int feedback_slot, |
| 576 TailCallMode tail_call_mode) { | 576 TailCallMode tail_call_mode) { |
| 577 Bytecode bytecode = BytecodeForCall(tail_call_mode); | 577 Bytecode bytecode = BytecodeForCall(tail_call_mode); |
| 578 Output(bytecode, RegisterOperand(callable), RegisterOperand(receiver_args), | 578 Output(bytecode, RegisterOperand(callable), RegisterOperand(receiver_args), |
| 579 UnsignedOperand(receiver_args_count), UnsignedOperand(feedback_slot)); | 579 UnsignedOperand(receiver_args_count), UnsignedOperand(feedback_slot)); |
| 580 return *this; | 580 return *this; |
| 581 } | 581 } |
| 582 | 582 |
| 583 BytecodeArrayBuilder& BytecodeArrayBuilder::New(Register constructor, | 583 BytecodeArrayBuilder& BytecodeArrayBuilder::New(Register constructor, |
| 584 Register first_arg, | 584 Register first_arg, |
| 585 size_t arg_count) { | 585 size_t arg_count, |
| 586 int feedback_slot_id) { |
| 586 if (!first_arg.is_valid()) { | 587 if (!first_arg.is_valid()) { |
| 587 DCHECK_EQ(0u, arg_count); | 588 DCHECK_EQ(0u, arg_count); |
| 588 first_arg = Register(0); | 589 first_arg = Register(0); |
| 589 } | 590 } |
| 590 Output(Bytecode::kNew, RegisterOperand(constructor), | 591 Output(Bytecode::kNew, RegisterOperand(constructor), |
| 591 RegisterOperand(first_arg), UnsignedOperand(arg_count)); | 592 RegisterOperand(first_arg), UnsignedOperand(arg_count), |
| 593 UnsignedOperand(feedback_slot_id)); |
| 592 return *this; | 594 return *this; |
| 593 } | 595 } |
| 594 | 596 |
| 595 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime( | 597 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime( |
| 596 Runtime::FunctionId function_id, Register first_arg, size_t arg_count) { | 598 Runtime::FunctionId function_id, Register first_arg, size_t arg_count) { |
| 597 DCHECK_EQ(1, Runtime::FunctionForId(function_id)->result_size); | 599 DCHECK_EQ(1, Runtime::FunctionForId(function_id)->result_size); |
| 598 DCHECK(Bytecodes::SizeForUnsignedOperand(function_id) <= OperandSize::kShort); | 600 DCHECK(Bytecodes::SizeForUnsignedOperand(function_id) <= OperandSize::kShort); |
| 599 if (!first_arg.is_valid()) { | 601 if (!first_arg.is_valid()) { |
| 600 DCHECK_EQ(0u, arg_count); | 602 DCHECK_EQ(0u, arg_count); |
| 601 first_arg = Register(0); | 603 first_arg = Register(0); |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 return Bytecode::kTailCall; | 956 return Bytecode::kTailCall; |
| 955 default: | 957 default: |
| 956 UNREACHABLE(); | 958 UNREACHABLE(); |
| 957 } | 959 } |
| 958 return Bytecode::kIllegal; | 960 return Bytecode::kIllegal; |
| 959 } | 961 } |
| 960 | 962 |
| 961 } // namespace interpreter | 963 } // namespace interpreter |
| 962 } // namespace internal | 964 } // namespace internal |
| 963 } // namespace v8 | 965 } // namespace v8 |
| OLD | NEW |