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

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

Issue 1659023002: [interpreter] Unify meaning of register count operands. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase 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/compiler/interpreter-assembler.h" 10 #include "src/compiler/interpreter-assembler.h"
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 Node* result = __ CallRuntime(Runtime::kDeleteLookupSlot, context, name); 1071 Node* result = __ CallRuntime(Runtime::kDeleteLookupSlot, context, name);
1072 __ SetAccumulator(result); 1072 __ SetAccumulator(result);
1073 __ Dispatch(); 1073 __ Dispatch();
1074 } 1074 }
1075 1075
1076 1076
1077 void Interpreter::DoJSCall(compiler::InterpreterAssembler* assembler) { 1077 void Interpreter::DoJSCall(compiler::InterpreterAssembler* assembler) {
1078 Node* function_reg = __ BytecodeOperandReg(0); 1078 Node* function_reg = __ BytecodeOperandReg(0);
1079 Node* function = __ LoadRegister(function_reg); 1079 Node* function = __ LoadRegister(function_reg);
1080 Node* receiver_reg = __ BytecodeOperandReg(1); 1080 Node* receiver_reg = __ BytecodeOperandReg(1);
1081 Node* first_arg = __ RegisterLocation(receiver_reg); 1081 Node* receiver_arg = __ RegisterLocation(receiver_reg);
1082 Node* args_count = __ BytecodeOperandCount(2); 1082 Node* receiver_args_count = __ BytecodeOperandCount(2);
1083 Node* receiver_count = __ Int32Constant(1);
1084 Node* args_count = __ Int32Sub(receiver_args_count, receiver_count);
1083 // TODO(rmcilroy): Use the call type feedback slot to call via CallIC. 1085 // TODO(rmcilroy): Use the call type feedback slot to call via CallIC.
1084 Node* result = __ CallJS(function, first_arg, args_count); 1086 Node* result = __ CallJS(function, receiver_arg, args_count);
1085 __ SetAccumulator(result); 1087 __ SetAccumulator(result);
1086 __ Dispatch(); 1088 __ Dispatch();
1087 } 1089 }
1088 1090
1089 1091
1090 // Call <callable> <receiver> <arg_count> 1092 // Call <callable> <receiver> <arg_count>
1091 // 1093 //
1092 // Call a JSfunction or Callable in |callable| with the |receiver| and 1094 // Call a JSfunction or Callable in |callable| with the |receiver| and
1093 // |arg_count| arguments in subsequent registers. 1095 // |arg_count| arguments in subsequent registers.
1094 void Interpreter::DoCall(compiler::InterpreterAssembler* assembler) { 1096 void Interpreter::DoCall(compiler::InterpreterAssembler* assembler) {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 compiler::InterpreterAssembler* assembler) { 1181 compiler::InterpreterAssembler* assembler) {
1180 DoCallRuntimeForPairCommon(assembler); 1182 DoCallRuntimeForPairCommon(assembler);
1181 } 1183 }
1182 1184
1183 1185
1184 void Interpreter::DoCallJSRuntimeCommon( 1186 void Interpreter::DoCallJSRuntimeCommon(
1185 compiler::InterpreterAssembler* assembler) { 1187 compiler::InterpreterAssembler* assembler) {
1186 Node* context_index = __ BytecodeOperandIdx(0); 1188 Node* context_index = __ BytecodeOperandIdx(0);
1187 Node* receiver_reg = __ BytecodeOperandReg(1); 1189 Node* receiver_reg = __ BytecodeOperandReg(1);
1188 Node* first_arg = __ RegisterLocation(receiver_reg); 1190 Node* first_arg = __ RegisterLocation(receiver_reg);
1189 Node* args_count = __ BytecodeOperandCount(2); 1191 Node* receiver_args_count = __ BytecodeOperandCount(2);
1192 Node* receiver_count = __ Int32Constant(1);
1193 Node* args_count = __ Int32Sub(receiver_args_count, receiver_count);
1190 1194
1191 // Get the function to call from the native context. 1195 // Get the function to call from the native context.
1192 Node* context = __ GetContext(); 1196 Node* context = __ GetContext();
1193 Node* native_context = 1197 Node* native_context =
1194 __ LoadContextSlot(context, Context::NATIVE_CONTEXT_INDEX); 1198 __ LoadContextSlot(context, Context::NATIVE_CONTEXT_INDEX);
1195 Node* function = __ LoadContextSlot(native_context, context_index); 1199 Node* function = __ LoadContextSlot(native_context, context_index);
1196 1200
1197 // Call the function. 1201 // Call the function.
1198 Node* result = __ CallJS(function, first_arg, args_count); 1202 Node* result = __ CallJS(function, first_arg, args_count);
1199 __ SetAccumulator(result); 1203 __ SetAccumulator(result);
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
1886 Node* index_reg = __ BytecodeOperandReg(0); 1890 Node* index_reg = __ BytecodeOperandReg(0);
1887 Node* index = __ LoadRegister(index_reg); 1891 Node* index = __ LoadRegister(index_reg);
1888 Node* result = __ CallRuntime(Runtime::kForInStep, index); 1892 Node* result = __ CallRuntime(Runtime::kForInStep, index);
1889 __ SetAccumulator(result); 1893 __ SetAccumulator(result);
1890 __ Dispatch(); 1894 __ Dispatch();
1891 } 1895 }
1892 1896
1893 } // namespace interpreter 1897 } // namespace interpreter
1894 } // namespace internal 1898 } // namespace internal
1895 } // namespace v8 1899 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698