| 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/interpreter.h" | 5 #include "src/interpreter/interpreter.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
| 9 #include "src/compiler/interpreter-assembler.h" | 9 #include "src/compiler/interpreter-assembler.h" |
| 10 #include "src/factory.h" | 10 #include "src/factory.h" |
| (...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 // DeletePropertySloppy | 875 // DeletePropertySloppy |
| 876 // | 876 // |
| 877 // Delete the property specified in the accumulator from the object | 877 // Delete the property specified in the accumulator from the object |
| 878 // referenced by the register operand following sloppy mode semantics. | 878 // referenced by the register operand following sloppy mode semantics. |
| 879 void Interpreter::DoDeletePropertySloppy( | 879 void Interpreter::DoDeletePropertySloppy( |
| 880 compiler::InterpreterAssembler* assembler) { | 880 compiler::InterpreterAssembler* assembler) { |
| 881 DoDelete(Runtime::kDeleteProperty_Sloppy, assembler); | 881 DoDelete(Runtime::kDeleteProperty_Sloppy, assembler); |
| 882 } | 882 } |
| 883 | 883 |
| 884 | 884 |
| 885 void Interpreter::DoJSCall(compiler::InterpreterAssembler* assembler) { |
| 886 Node* function_reg = __ BytecodeOperandReg(0); |
| 887 Node* function = __ LoadRegister(function_reg); |
| 888 Node* receiver_reg = __ BytecodeOperandReg(1); |
| 889 Node* first_arg = __ RegisterLocation(receiver_reg); |
| 890 Node* args_count = __ BytecodeOperandCount(2); |
| 891 // TODO(rmcilroy): Use the call type feedback slot to call via CallIC. |
| 892 Node* result = __ CallJS(function, first_arg, args_count); |
| 893 __ SetAccumulator(result); |
| 894 __ Dispatch(); |
| 895 } |
| 896 |
| 897 |
| 885 // Call <callable> <receiver> <arg_count> | 898 // Call <callable> <receiver> <arg_count> |
| 886 // | 899 // |
| 887 // Call a JSfunction or Callable in |callable| with the |receiver| and | 900 // Call a JSfunction or Callable in |callable| with the |receiver| and |
| 888 // |arg_count| arguments in subsequent registers. | 901 // |arg_count| arguments in subsequent registers. |
| 889 void Interpreter::DoCall(compiler::InterpreterAssembler* assembler) { | 902 void Interpreter::DoCall(compiler::InterpreterAssembler* assembler) { |
| 890 Node* function_reg = __ BytecodeOperandReg(0); | 903 DoJSCall(assembler); |
| 891 Node* function = __ LoadRegister(function_reg); | 904 } |
| 892 Node* receiver_reg = __ BytecodeOperandReg(1); | 905 |
| 893 Node* first_arg = __ RegisterLocation(receiver_reg); | 906 |
| 894 Node* args_count = __ BytecodeOperandCount(2); | 907 // CallWide <callable> <receiver> <arg_count> |
| 895 Node* result = __ CallJS(function, first_arg, args_count); | 908 // |
| 896 __ SetAccumulator(result); | 909 // Call a JSfunction or Callable in |callable| with the |receiver| and |
| 897 __ Dispatch(); | 910 // |arg_count| arguments in subsequent registers. |
| 911 void Interpreter::DoCallWide(compiler::InterpreterAssembler* assembler) { |
| 912 DoJSCall(assembler); |
| 898 } | 913 } |
| 899 | 914 |
| 900 | 915 |
| 901 // CallRuntime <function_id> <first_arg> <arg_count> | 916 // CallRuntime <function_id> <first_arg> <arg_count> |
| 902 // | 917 // |
| 903 // Call the runtime function |function_id| with the first argument in | 918 // Call the runtime function |function_id| with the first argument in |
| 904 // register |first_arg| and |arg_count| arguments in subsequent | 919 // register |first_arg| and |arg_count| arguments in subsequent |
| 905 // registers. | 920 // registers. |
| 906 void Interpreter::DoCallRuntime(compiler::InterpreterAssembler* assembler) { | 921 void Interpreter::DoCallRuntime(compiler::InterpreterAssembler* assembler) { |
| 907 Node* function_id = __ BytecodeOperandIdx(0); | 922 Node* function_id = __ BytecodeOperandIdx(0); |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1450 Node* cache_length = __ LoadFixedArrayElement(for_in_state, 3); | 1465 Node* cache_length = __ LoadFixedArrayElement(for_in_state, 3); |
| 1451 Node* result = __ CallRuntime(Runtime::kForInDone, index, cache_length); | 1466 Node* result = __ CallRuntime(Runtime::kForInDone, index, cache_length); |
| 1452 __ SetAccumulator(result); | 1467 __ SetAccumulator(result); |
| 1453 __ Dispatch(); | 1468 __ Dispatch(); |
| 1454 } | 1469 } |
| 1455 | 1470 |
| 1456 | 1471 |
| 1457 } // namespace interpreter | 1472 } // namespace interpreter |
| 1458 } // namespace internal | 1473 } // namespace internal |
| 1459 } // namespace v8 | 1474 } // namespace v8 |
| OLD | NEW |