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

Unified 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: removes an unused label declaration. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/interpreter.h ('k') | src/interpreter/interpreter-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 9756020ecf9992aeb9b348fa693e5712b8dc9080..4ef4637f85f38987742ccebf151905c29ad88088 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -929,6 +929,58 @@ void Interpreter::DoDeletePropertySloppy(InterpreterAssembler* assembler) {
DoDelete(Runtime::kDeleteProperty_Sloppy, assembler);
}
+void Interpreter::DoJSCallWithFeedback(InterpreterAssembler* assembler,
+ TailCallMode tail_call_mode) {
+ Node* function_reg = __ BytecodeOperandReg(0);
+ Node* function = __ LoadRegister(function_reg);
+ Node* receiver_reg = __ BytecodeOperandReg(1);
+ Node* receiver_arg = __ RegisterLocation(receiver_reg);
+ Node* receiver_args_count = __ BytecodeOperandCount(2);
+ Node* receiver_count = __ Int32Constant(1);
+ Node* args_count = __ Int32Sub(receiver_args_count, receiver_count);
+ Node* slot_id_raw = __ BytecodeOperandIdx(3);
+ Node* slot_id = __ SmiTag(slot_id_raw);
+ Node* type_feedback_vector = __ LoadTypeFeedbackVector();
+ Node* context = __ GetContext();
+ Node* result =
+ __ CallJSWithFeedback(function, context, receiver_arg, args_count,
+ slot_id, type_feedback_vector, tail_call_mode);
+ __ SetAccumulator(result);
+ __ Dispatch();
+}
+
+// Call <callable> <receiver> <arg_count>
+//
+// Call a JSfunction or Callable in |callable| with the |receiver| and
+// |arg_count| arguments in subsequent registers.
+void Interpreter::DoCallIC(InterpreterAssembler* assembler) {
+ DoJSCallWithFeedback(assembler, TailCallMode::kDisallow);
+}
+
+// CallWide <callable> <receiver> <arg_count>
+//
+// Call a JSfunction or Callable in |callable| with the |receiver| and
+// |arg_count| arguments in subsequent registers.
+void Interpreter::DoCallICWide(InterpreterAssembler* assembler) {
+ DoJSCallWithFeedback(assembler, TailCallMode::kDisallow);
+}
+
+// Call <callable> <receiver> <arg_count>
+//
+// Call a JSfunction or Callable in |callable| with the |receiver| and
+// |arg_count| arguments in subsequent registers.
+void Interpreter::DoTailCallIC(InterpreterAssembler* assembler) {
+ DoJSCallWithFeedback(assembler, TailCallMode::kAllow);
+}
+
+// CallWide <callable> <receiver> <arg_count>
+//
+// Call a JSfunction or Callable in |callable| with the |receiver| and
+// |arg_count| arguments in subsequent registers.
+void Interpreter::DoTailCallICWide(InterpreterAssembler* assembler) {
+ DoJSCallWithFeedback(assembler, TailCallMode::kAllow);
+}
+
void Interpreter::DoJSCall(InterpreterAssembler* assembler,
TailCallMode tail_call_mode) {
Node* function_reg = __ BytecodeOperandReg(0);
@@ -939,7 +991,6 @@ void Interpreter::DoJSCall(InterpreterAssembler* assembler,
Node* receiver_count = __ Int32Constant(1);
Node* args_count = __ Int32Sub(receiver_args_count, receiver_count);
Node* context = __ GetContext();
- // TODO(rmcilroy): Use the call type feedback slot to call via CallStub.
Node* result =
__ CallJS(function, context, receiver_arg, args_count, tail_call_mode);
__ SetAccumulator(result);
« no previous file with comments | « src/interpreter/interpreter.h ('k') | src/interpreter/interpreter-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698