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

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

Issue 1995453002: [stubs] Extend HasProperty stub with dictionary-mode and double-elements objects support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Drive-by fix: replace Load()s with LoadObjectField()s Created 4 years, 7 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/utils.cc ('k') | test/cctest/test-code-stub-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/function-tester.h
diff --git a/test/cctest/compiler/function-tester.h b/test/cctest/compiler/function-tester.h
index 584ad49708ccf9ebaa9a397dafdb9befdc8b029d..9246dfb79e47d4f6a9a26ed01ddd59985eb9aa8f 100644
--- a/test/cctest/compiler/function-tester.h
+++ b/test/cctest/compiler/function-tester.h
@@ -42,16 +42,18 @@ class FunctionTester : public InitializedHandleScope {
CompileGraph(graph);
}
- FunctionTester(const CallInterfaceDescriptor& descriptor, Handle<Code> code)
+ FunctionTester(Handle<Code> code, int param_count)
: isolate(main_isolate()),
- function(
- (FLAG_allow_natives_syntax = true,
- NewFunction(BuildFunctionFromDescriptor(descriptor).c_str()))),
+ function((FLAG_allow_natives_syntax = true,
+ NewFunction(BuildFunction(param_count).c_str()))),
flags_(0) {
Compile(function);
function->ReplaceCode(*code);
}
+ FunctionTester(const CallInterfaceDescriptor& descriptor, Handle<Code> code)
+ : FunctionTester(code, descriptor.GetParameterCount()) {}
+
Isolate* isolate;
Handle<JSFunction> function;
@@ -64,6 +66,12 @@ class FunctionTester : public InitializedHandleScope {
return Execution::Call(isolate, function, undefined(), 2, args);
}
+ MaybeHandle<Object> Call(Handle<Object> a, Handle<Object> b,
+ Handle<Object> c) {
+ Handle<Object> args[] = {a, b, c};
+ return Execution::Call(isolate, function, undefined(), 3, args);
+ }
+
MaybeHandle<Object> Call(Handle<Object> a, Handle<Object> b, Handle<Object> c,
Handle<Object> d) {
Handle<Object> args[] = {a, b, c, d};
@@ -91,41 +99,56 @@ class FunctionTester : public InitializedHandleScope {
return try_catch.Message();
}
- void CheckCall(Handle<Object> expected, Handle<Object> a, Handle<Object> b) {
- Handle<Object> result = Call(a, b).ToHandleChecked();
+ void 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));
}
+ void CheckCall(Handle<Object> expected, Handle<Object> a, Handle<Object> b,
+ Handle<Object> c) {
+ return CheckCall(expected, a, b, c, undefined());
+ }
+
+ void CheckCall(Handle<Object> expected, Handle<Object> a, Handle<Object> b) {
+ return CheckCall(expected, a, b, undefined());
+ }
+
void CheckCall(Handle<Object> expected, Handle<Object> a) {
CheckCall(expected, a, undefined());
}
- void CheckCall(Handle<Object> expected) {
- CheckCall(expected, undefined(), undefined());
- }
+ void CheckCall(Handle<Object> expected) { CheckCall(expected, undefined()); }
void CheckCall(double expected, double a, double b) {
CheckCall(Val(expected), Val(a), Val(b));
}
+ void CheckTrue(Handle<Object> a) { CheckCall(true_value(), a); }
+
void CheckTrue(Handle<Object> a, Handle<Object> b) {
CheckCall(true_value(), a, b);
}
- void CheckTrue(Handle<Object> a) { CheckCall(true_value(), a, undefined()); }
+ void CheckTrue(Handle<Object> a, Handle<Object> b, Handle<Object> c) {
+ CheckCall(true_value(), a, b, c);
+ }
+
+ void CheckTrue(Handle<Object> a, Handle<Object> b, Handle<Object> c,
+ Handle<Object> d) {
+ CheckCall(true_value(), a, b, c, d);
+ }
void CheckTrue(double a, double b) {
CheckCall(true_value(), Val(a), Val(b));
}
+ void CheckFalse(Handle<Object> a) { CheckCall(false_value(), a); }
+
void CheckFalse(Handle<Object> a, Handle<Object> b) {
CheckCall(false_value(), a, b);
}
- void CheckFalse(Handle<Object> a) {
- CheckCall(false_value(), a, undefined());
- }
-
void CheckFalse(double a, double b) {
CheckCall(false_value(), Val(a), Val(b));
}
@@ -217,11 +240,6 @@ class FunctionTester : public InitializedHandleScope {
return function_string;
}
- std::string BuildFunctionFromDescriptor(
- const CallInterfaceDescriptor& descriptor) {
- return BuildFunction(descriptor.GetParameterCount());
- }
-
// Compile the given machine graph instead of the source of the function
// and replace the JSFunction's code with the result.
Handle<JSFunction> CompileGraph(Graph* graph) {
« no previous file with comments | « src/utils.cc ('k') | test/cctest/test-code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698