| 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);
|
|
|