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

Unified Diff: test/cctest/compiler/function-tester.cc

Issue 2304553002: Include only stuff you need, part 6: Fix cctest.h. (Closed)
Patch Set: Created 4 years, 3 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/compiler/function-tester.h ('k') | test/cctest/compiler/test-js-constant-cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/function-tester.cc
diff --git a/test/cctest/compiler/function-tester.cc b/test/cctest/compiler/function-tester.cc
index cb6a68993cdbb2d62be17b744a83edb2293b81d0..2da2dc14aa3597adb03d93f14074b6519a8d7836 100644
--- a/test/cctest/compiler/function-tester.cc
+++ b/test/cctest/compiler/function-tester.cc
@@ -98,6 +98,23 @@ v8::Local<v8::Message> FunctionTester::CheckThrowsReturnMessage(
return try_catch.Message();
}
+void FunctionTester::CheckCall(Handle<Object> expected, Handle<Object> a,
+ Handle<Object> b, Handle<Object> c,
+ Handle<Object> d) {
+ Handle<Object> result = Call(a, b, c, d).ToHandleChecked();
+ CHECK(expected->SameValue(*result));
+}
+
+Handle<JSFunction> FunctionTester::NewFunction(const char* source) {
+ return Handle<JSFunction>::cast(v8::Utils::OpenHandle(
+ *v8::Local<v8::Function>::Cast(CompileRun(source))));
+}
+
+Handle<JSObject> FunctionTester::NewObject(const char* source) {
+ return Handle<JSObject>::cast(
+ v8::Utils::OpenHandle(*v8::Local<v8::Object>::Cast(CompileRun(source))));
+}
+
Handle<String> FunctionTester::Val(const char* string) {
return isolate->factory()->InternalizeUtf8String(string);
}
@@ -130,6 +147,16 @@ Handle<Object> FunctionTester::false_value() {
return isolate->factory()->false_value();
}
+Handle<JSFunction> FunctionTester::ForMachineGraph(Graph* graph,
+ int param_count) {
+ JSFunction* p = NULL;
+ { // because of the implicit handle scope of FunctionTester.
+ FunctionTester f(graph, param_count);
+ p = *f.function;
+ }
+ return Handle<JSFunction>(p); // allocated in outer handle scope.
+}
+
Handle<JSFunction> FunctionTester::Compile(Handle<JSFunction> function) {
Zone zone(function->GetIsolate()->allocator());
ParseInfo parse_info(&zone, function);
« no previous file with comments | « test/cctest/compiler/function-tester.h ('k') | test/cctest/compiler/test-js-constant-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698