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

Unified Diff: test/cctest/interpreter/test-interpreter.cc

Issue 1731253003: Revert of [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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/interpreter/test-interpreter.cc
diff --git a/test/cctest/interpreter/test-interpreter.cc b/test/cctest/interpreter/test-interpreter.cc
index 32921cfb03c88710d1f67e166f121029271c3f95..69cf0e18bd48dfa507f248e563083519be77c5d0 100644
--- a/test/cctest/interpreter/test-interpreter.cc
+++ b/test/cctest/interpreter/test-interpreter.cc
@@ -928,8 +928,7 @@
CHECK_EQ(Smi::cast(*result), Smi::FromInt(999));
}
-static void TestInterpreterCall(TailCallMode tail_call_mode,
- bool has_feedback_slot) {
+static void TestInterpreterCall(TailCallMode tail_call_mode) {
HandleAndZoneScope handles;
i::Isolate* isolate = handles.main_isolate();
i::Factory* factory = isolate->factory();
@@ -937,15 +936,10 @@
i::FeedbackVectorSpec feedback_spec(&zone);
i::FeedbackVectorSlot slot = feedback_spec.AddLoadICSlot();
- i::FeedbackVectorSlot call_slot = feedback_spec.AddCallICSlot();
Handle<i::TypeFeedbackVector> vector =
i::NewTypeFeedbackVector(isolate, &feedback_spec);
int slot_index = vector->GetIndex(slot);
- int call_slot_index = -1;
- if (has_feedback_slot) {
- call_slot_index = vector->GetIndex(call_slot);
- }
Handle<i::String> name = factory->NewStringFromAsciiChecked("func");
name = factory->string_table()->LookupString(isolate, name);
@@ -955,16 +949,9 @@
BytecodeArrayBuilder builder(handles.main_isolate(), handles.main_zone(), 1,
0, 1);
builder.LoadNamedProperty(builder.Parameter(0), name, slot_index)
- .StoreAccumulatorInRegister(Register(0));
-
- if (has_feedback_slot) {
- builder.CallIC(Register(0), builder.Parameter(0), 1, call_slot_index,
- tail_call_mode);
- } else {
- builder.Call(Register(0), builder.Parameter(0), 1, tail_call_mode);
- }
-
- builder.Return();
+ .StoreAccumulatorInRegister(Register(0))
+ .Call(Register(0), builder.Parameter(0), 1, 0, tail_call_mode)
+ .Return();
Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray();
InterpreterTester tester(handles.main_isolate(), bytecode_array, vector);
@@ -981,14 +968,9 @@
BytecodeArrayBuilder builder(handles.main_isolate(), handles.main_zone(), 1,
0, 1);
builder.LoadNamedProperty(builder.Parameter(0), name, slot_index)
- .StoreAccumulatorInRegister(Register(0));
- if (has_feedback_slot) {
- builder.CallIC(Register(0), builder.Parameter(0), 1, call_slot_index,
- tail_call_mode);
- } else {
- builder.Call(Register(0), builder.Parameter(0), 1, tail_call_mode);
- }
- builder.Return();
+ .StoreAccumulatorInRegister(Register(0))
+ .Call(Register(0), builder.Parameter(0), 1, 0, tail_call_mode)
+ .Return();
Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray();
InterpreterTester tester(handles.main_isolate(), bytecode_array, vector);
@@ -1014,17 +996,9 @@
.LoadLiteral(Smi::FromInt(51))
.StoreAccumulatorInRegister(Register(2))
.LoadLiteral(Smi::FromInt(11))
- .StoreAccumulatorInRegister(Register(3));
-
- if (has_feedback_slot) {
- builder.CallIC(Register(0), Register(1), 3, call_slot_index,
- tail_call_mode);
- } else {
- builder.Call(Register(0), Register(1), 3, tail_call_mode);
- }
-
- builder.Return();
-
+ .StoreAccumulatorInRegister(Register(3))
+ .Call(Register(0), Register(1), 3, 0, tail_call_mode)
+ .Return();
Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray();
InterpreterTester tester(handles.main_isolate(), bytecode_array, vector);
@@ -1065,17 +1039,9 @@
.LoadLiteral(factory->NewStringFromAsciiChecked("i"))
.StoreAccumulatorInRegister(Register(10))
.LoadLiteral(factory->NewStringFromAsciiChecked("j"))
- .StoreAccumulatorInRegister(Register(11));
-
- if (has_feedback_slot) {
- builder.CallIC(Register(0), Register(1), 11, call_slot_index,
- tail_call_mode);
- } else {
- builder.Call(Register(0), Register(1), 11, tail_call_mode);
- }
-
- builder.Return();
-
+ .StoreAccumulatorInRegister(Register(11))
+ .Call(Register(0), Register(1), 11, 0, tail_call_mode)
+ .Return();
Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray();
InterpreterTester tester(handles.main_isolate(), bytecode_array, vector);
@@ -1095,13 +1061,9 @@
}
}
-TEST(InterpreterCall) { TestInterpreterCall(TailCallMode::kDisallow, false); }
-
-TEST(InterpreterTailCall) { TestInterpreterCall(TailCallMode::kAllow, false); }
-
-TEST(InterpreterCallIC) { TestInterpreterCall(TailCallMode::kDisallow, true); }
-
-TEST(InterpreterTailCallIC) { TestInterpreterCall(TailCallMode::kAllow, true); }
+TEST(InterpreterCall) { TestInterpreterCall(TailCallMode::kDisallow); }
+
+TEST(InterpreterTailCall) { TestInterpreterCall(TailCallMode::kAllow); }
static BytecodeArrayBuilder& SetRegister(BytecodeArrayBuilder& builder,
Register reg, int value,
« no previous file with comments | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698