Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1578)

Side by Side Diff: src/interpreter/interpreter.cc

Issue 1688283003: [Interpreter] Implements calls through CallICStub in the interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/ast/prettyprinter.h" 7 #include "src/ast/prettyprinter.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/factory.h" 10 #include "src/factory.h"
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 1012
1013 1013
1014 // DeletePropertySloppy 1014 // DeletePropertySloppy
1015 // 1015 //
1016 // Delete the property specified in the accumulator from the object 1016 // Delete the property specified in the accumulator from the object
1017 // referenced by the register operand following sloppy mode semantics. 1017 // referenced by the register operand following sloppy mode semantics.
1018 void Interpreter::DoDeletePropertySloppy(InterpreterAssembler* assembler) { 1018 void Interpreter::DoDeletePropertySloppy(InterpreterAssembler* assembler) {
1019 DoDelete(Runtime::kDeleteProperty_Sloppy, assembler); 1019 DoDelete(Runtime::kDeleteProperty_Sloppy, assembler);
1020 } 1020 }
1021 1021
1022 void Interpreter::DoJSCallWithFeedback(InterpreterAssembler* assembler) {
1023 Node* function_reg = __ BytecodeOperandReg(0);
1024 Node* function = __ LoadRegister(function_reg);
1025 Node* receiver_reg = __ BytecodeOperandReg(1);
1026 Node* receiver_arg = __ RegisterLocation(receiver_reg);
1027 Node* receiver_args_count = __ BytecodeOperandCount(2);
1028 Node* receiver_count = __ Int32Constant(1);
1029 Node* args_count = __ Int32Sub(receiver_args_count, receiver_count);
1030 Node* slot_id_raw = __ BytecodeOperandIdx(3);
1031 Node* slot_id = __ SmiTag(slot_id_raw);
1032 Node* type_feedback_vector = __ LoadTypeFeedbackVector();
1033 Node* context = __ GetContext();
1034 Node* result =
1035 __ CallJSWithFeedback(function, context, receiver_arg, args_count,
1036 slot_id, type_feedback_vector);
1037 __ SetAccumulator(result);
1038 __ Dispatch();
1039 }
1040
1041 // Call <callable> <receiver> <arg_count>
1042 //
1043 // Call a JSfunction or Callable in |callable| with the |receiver| and
1044 // |arg_count| arguments in subsequent registers.
1045 void Interpreter::DoCallIC(InterpreterAssembler* assembler) {
1046 DoJSCallWithFeedback(assembler);
1047 }
1048
1049 // CallWide <callable> <receiver> <arg_count>
1050 //
1051 // Call a JSfunction or Callable in |callable| with the |receiver| and
1052 // |arg_count| arguments in subsequent registers.
1053 void Interpreter::DoCallICWide(InterpreterAssembler* assembler) {
1054 DoJSCallWithFeedback(assembler);
1055 }
1022 1056
1023 void Interpreter::DoJSCall(InterpreterAssembler* assembler) { 1057 void Interpreter::DoJSCall(InterpreterAssembler* assembler) {
1024 Node* function_reg = __ BytecodeOperandReg(0); 1058 Node* function_reg = __ BytecodeOperandReg(0);
1025 Node* function = __ LoadRegister(function_reg); 1059 Node* function = __ LoadRegister(function_reg);
1026 Node* receiver_reg = __ BytecodeOperandReg(1); 1060 Node* receiver_reg = __ BytecodeOperandReg(1);
1027 Node* receiver_arg = __ RegisterLocation(receiver_reg); 1061 Node* receiver_arg = __ RegisterLocation(receiver_reg);
1028 Node* receiver_args_count = __ BytecodeOperandCount(2); 1062 Node* receiver_args_count = __ BytecodeOperandCount(2);
1029 Node* receiver_count = __ Int32Constant(1); 1063 Node* receiver_count = __ Int32Constant(1);
1030 Node* args_count = __ Int32Sub(receiver_args_count, receiver_count); 1064 Node* args_count = __ Int32Sub(receiver_args_count, receiver_count);
1031 Node* context = __ GetContext(); 1065 Node* context = __ GetContext();
1032 // TODO(rmcilroy): Use the call type feedback slot to call via CallStub.
1033 Node* result = __ CallJS(function, context, receiver_arg, args_count); 1066 Node* result = __ CallJS(function, context, receiver_arg, args_count);
1034 __ SetAccumulator(result); 1067 __ SetAccumulator(result);
1035 __ Dispatch(); 1068 __ Dispatch();
1036 } 1069 }
1037 1070
1038 1071
1039 // Call <callable> <receiver> <arg_count> 1072 // Call <callable> <receiver> <arg_count>
1040 // 1073 //
1041 // Call a JSfunction or Callable in |callable| with the |receiver| and 1074 // Call a JSfunction or Callable in |callable| with the |receiver| and
1042 // |arg_count| arguments in subsequent registers. 1075 // |arg_count| arguments in subsequent registers.
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
1877 Node* index = __ LoadRegister(index_reg); 1910 Node* index = __ LoadRegister(index_reg);
1878 Node* context = __ GetContext(); 1911 Node* context = __ GetContext();
1879 Node* result = __ CallRuntime(Runtime::kForInStep, context, index); 1912 Node* result = __ CallRuntime(Runtime::kForInStep, context, index);
1880 __ SetAccumulator(result); 1913 __ SetAccumulator(result);
1881 __ Dispatch(); 1914 __ Dispatch();
1882 } 1915 }
1883 1916
1884 } // namespace interpreter 1917 } // namespace interpreter
1885 } // namespace internal 1918 } // namespace internal
1886 } // namespace v8 1919 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698