Chromium Code Reviews| Index: test/cctest/compiler/test-run-bytecode-graph-builder.cc | 
| diff --git a/test/cctest/compiler/test-run-bytecode-graph-builder.cc b/test/cctest/compiler/test-run-bytecode-graph-builder.cc | 
| index c24bcc907272f8a7ab2f6a414a91dede705ab1d7..dfc98ffc7110304c4f76339d257c433fd77f9900 100644 | 
| --- a/test/cctest/compiler/test-run-bytecode-graph-builder.cc | 
| +++ b/test/cctest/compiler/test-run-bytecode-graph-builder.cc | 
| @@ -2603,7 +2603,6 @@ TEST(JumpWithConstantsAndWideConstants) { | 
| TEST(BytecodeGraphBuilderDoExpressions) { | 
| bool old_flag = FLAG_harmony_do_expressions; | 
| FLAG_harmony_do_expressions = true; | 
| - | 
| HandleAndZoneScope scope; | 
| Isolate* isolate = scope.main_isolate(); | 
| Zone* zone = scope.main_zone(); | 
| @@ -2633,6 +2632,30 @@ TEST(BytecodeGraphBuilderDoExpressions) { | 
| FLAG_harmony_do_expressions = old_flag; | 
| } | 
| +TEST(JumpOnHole) { | 
| 
 
rmcilroy
2016/02/03 12:28:26
Could you replicate the test-interpreter tests her
 
mythria
2016/02/04 10:28:53
Done. Now I have a 1500 line cl :)
 
 | 
| + HandleAndZoneScope scope; | 
| + Isolate* isolate = scope.main_isolate(); | 
| + Zone* zone = scope.main_zone(); | 
| + Factory* factory = isolate->factory(); | 
| + // TODO(mythria): Add tests to check JumpIfHole. Initializing 'this' via super | 
| + // calls uses JumpIfHole. | 
| + ExpectedSnippet<0> snippets[] = { | 
| + {"let x = 1; x = 2; return x;", {factory->NewNumberFromInt(2)}}, | 
| + {"const x = 3; return x;", {factory->NewNumberFromInt(3)}}, | 
| + }; | 
| + | 
| + for (size_t i = 0; i < arraysize(snippets); i++) { | 
| + ScopedVector<char> script(1024); | 
| + SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName, | 
| + snippets[i].code_snippet, kFunctionName); | 
| + | 
| + BytecodeGraphTester tester(isolate, zone, script.start()); | 
| + auto callable = tester.GetCallable<>(); | 
| + Handle<Object> return_value = callable().ToHandleChecked(); | 
| + CHECK(return_value->SameValue(*snippets[i].return_value())); | 
| + } | 
| +} | 
| + | 
| } // namespace compiler | 
| } // namespace internal | 
| } // namespace v8 |