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

Unified Diff: test/cctest/compiler/test-run-stubs.cc

Issue 1475953002: [stubs] A new approach to TF stubs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Win64 build Created 5 years 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/compiler/test-code-stub-assembler.cc ('k') | test/cctest/compiler/test-simplified-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-run-stubs.cc
diff --git a/test/cctest/compiler/test-run-stubs.cc b/test/cctest/compiler/test-run-stubs.cc
index 8f092976d00fc3775d711c238626627cb84c771e..1a23ef6f53dcbbad2d1598c24163443c2af496ee 100644
--- a/test/cctest/compiler/test-run-stubs.cc
+++ b/test/cctest/compiler/test-run-stubs.cc
@@ -22,55 +22,13 @@ namespace internal {
namespace compiler {
-TEST(RunOptimizedMathFloorStub) {
- HandleAndZoneScope scope;
- Isolate* isolate = scope.main_isolate();
-
- // Create code and an accompanying descriptor.
- MathFloorStub stub(isolate, TurboFanIC::CALL_FROM_OPTIMIZED_CODE);
- Handle<Code> code = stub.GenerateCode();
- Zone* zone = scope.main_zone();
- CompilationInfo info(&stub, isolate, zone);
- CallDescriptor* descriptor = Linkage::ComputeIncoming(zone, &info);
- Handle<FixedArray> tv = isolate->factory()->NewFixedArray(10);
-
- // Create a function to call the code using the descriptor.
- Graph graph(zone);
- CommonOperatorBuilder common(zone);
- JSOperatorBuilder javascript(zone);
- MachineOperatorBuilder machine(zone);
- JSGraph js(isolate, &graph, &common, &javascript, nullptr, &machine);
-
- // FunctionTester (ab)uses a 2-argument function
- Node* start = graph.NewNode(common.Start(4));
- // Parameter 0 is the number to round
- Node* numberParam = graph.NewNode(common.Parameter(1), start);
- Node* theCode = graph.NewNode(common.HeapConstant(code));
- Node* vector = graph.NewNode(common.HeapConstant(tv));
- Node* dummyContext = graph.NewNode(common.NumberConstant(0.0));
- Node* call =
- graph.NewNode(common.Call(descriptor), theCode, js.UndefinedConstant(),
- js.OneConstant(), vector, js.UndefinedConstant(),
- numberParam, dummyContext, start, start);
- Node* ret = graph.NewNode(common.Return(), call, call, start);
- Node* end = graph.NewNode(common.End(1), ret);
- graph.SetStart(start);
- graph.SetEnd(end);
- FunctionTester ft(&graph);
-
- Handle<Object> value = ft.Val(1.5);
- Handle<Object> result = ft.Call(value, value).ToHandleChecked();
- CHECK_EQ(1, Smi::cast(*result)->value());
-}
-
-
-TEST(RunStringLengthTFStub) {
+TEST(RunStringLengthStub) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
Zone* zone = scope.main_zone();
// Create code and an accompanying descriptor.
- StringLengthTFStub stub(isolate);
+ StringLengthStub stub(isolate);
Handle<Code> code = stub.GenerateCode();
CompilationInfo info(&stub, isolate, zone);
CallDescriptor* descriptor = Linkage::ComputeIncoming(zone, &info);
@@ -94,7 +52,7 @@ TEST(RunStringLengthTFStub) {
Node* end = graph.NewNode(common.End(1), ret);
graph.SetStart(start);
graph.SetEnd(end);
- FunctionTester ft(&graph);
+ FunctionTester ft(&graph, 4);
// Actuall call through to the stub, verifying its result.
const char* testString = "Und das Lamm schrie HURZ!";
@@ -109,42 +67,6 @@ TEST(RunStringLengthTFStub) {
}
-TEST(RunStringAddTFStub) {
- HandleAndZoneScope scope;
- Isolate* isolate = scope.main_isolate();
- Zone* zone = scope.main_zone();
-
- // Create code and an accompanying descriptor.
- StringAddTFStub stub(isolate, STRING_ADD_CHECK_BOTH, NOT_TENURED);
- Handle<Code> code = stub.GenerateCode();
- CompilationInfo info(&stub, isolate, zone);
- CallDescriptor* descriptor = Linkage::ComputeIncoming(zone, &info);
-
- // Create a function to call the code using the descriptor.
- Graph graph(zone);
- CommonOperatorBuilder common(zone);
- // FunctionTester (ab)uses a 2-argument function
- Node* start = graph.NewNode(common.Start(4));
- // Parameter 0 is the receiver
- Node* leftParam = graph.NewNode(common.Parameter(1), start);
- Node* rightParam = graph.NewNode(common.Parameter(2), start);
- Node* theCode = graph.NewNode(common.HeapConstant(code));
- Node* dummyContext = graph.NewNode(common.NumberConstant(0.0));
- Node* call = graph.NewNode(common.Call(descriptor), theCode, leftParam,
- rightParam, dummyContext, start, start);
- Node* ret = graph.NewNode(common.Return(), call, call, start);
- Node* end = graph.NewNode(common.End(1), ret);
- graph.SetStart(start);
- graph.SetEnd(end);
- FunctionTester ft(&graph);
-
- // Actuall call through to the stub, verifying its result.
- Handle<String> leftArg = ft.Val("links");
- Handle<String> rightArg = ft.Val("rechts");
- Handle<Object> result = ft.Call(leftArg, rightArg).ToHandleChecked();
- CHECK(String::Equals(ft.Val("linksrechts"), Handle<String>::cast(result)));
-}
-
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « test/cctest/compiler/test-code-stub-assembler.cc ('k') | test/cctest/compiler/test-simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698