| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <utility> | 5 #include <utility> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "src/compiler/pipeline.h" | 9 #include "src/compiler/pipeline.h" |
| 10 #include "src/execution.h" | 10 #include "src/execution.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 Isolate* isolate_; | 84 Isolate* isolate_; |
| 85 Zone* zone_; | 85 Zone* zone_; |
| 86 const char* script_; | 86 const char* script_; |
| 87 | 87 |
| 88 Handle<JSFunction> GetFunction() { | 88 Handle<JSFunction> GetFunction() { |
| 89 CompileRun(script_); | 89 CompileRun(script_); |
| 90 Local<Function> api_function = | 90 Local<Function> api_function = |
| 91 Local<Function>::Cast(CcTest::global()->Get(v8_str(kFunctionName))); | 91 Local<Function>::Cast(CcTest::global()->Get(v8_str(kFunctionName))); |
| 92 Handle<JSFunction> function = v8::Utils::OpenHandle(*api_function); | 92 Handle<JSFunction> function = |
| 93 Handle<JSFunction>::cast(v8::Utils::OpenHandle(*api_function)); |
| 93 CHECK(function->shared()->HasBytecodeArray()); | 94 CHECK(function->shared()->HasBytecodeArray()); |
| 94 | 95 |
| 95 ParseInfo parse_info(zone_, function); | 96 ParseInfo parse_info(zone_, function); |
| 96 | 97 |
| 97 CompilationInfo compilation_info(&parse_info); | 98 CompilationInfo compilation_info(&parse_info); |
| 98 compilation_info.SetOptimizing(BailoutId::None(), Handle<Code>()); | 99 compilation_info.SetOptimizing(BailoutId::None(), Handle<Code>()); |
| 99 Parser parser(&parse_info); | 100 Parser parser(&parse_info); |
| 100 CHECK(parser.Parse(&parse_info)); | 101 CHECK(parser.Parse(&parse_info)); |
| 101 compiler::Pipeline pipeline(&compilation_info); | 102 compiler::Pipeline pipeline(&compilation_info); |
| 102 Handle<Code> code = pipeline.GenerateCode(); | 103 Handle<Code> code = pipeline.GenerateCode(); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 snippets[i].code_snippet, kFunctionName); | 250 snippets[i].code_snippet, kFunctionName); |
| 250 | 251 |
| 251 BytecodeGraphTester tester(isolate, zone, script.start()); | 252 BytecodeGraphTester tester(isolate, zone, script.start()); |
| 252 auto callable = tester.GetCallable<Handle<Object>, Handle<Object>>(); | 253 auto callable = tester.GetCallable<Handle<Object>, Handle<Object>>(); |
| 253 Handle<Object> return_value = | 254 Handle<Object> return_value = |
| 254 callable(snippets[i].parameter(0), snippets[i].parameter(1)) | 255 callable(snippets[i].parameter(0), snippets[i].parameter(1)) |
| 255 .ToHandleChecked(); | 256 .ToHandleChecked(); |
| 256 CHECK(return_value->SameValue(*snippets[i].return_value())); | 257 CHECK(return_value->SameValue(*snippets[i].return_value())); |
| 257 } | 258 } |
| 258 } | 259 } |
| OLD | NEW |