OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ | 5 #ifndef V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ |
6 #define V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ | 6 #define V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 #include "test/cctest/cctest.h" | 9 #include "test/cctest/cctest.h" |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 #if V8_TURBOFAN_TARGET | 39 #if V8_TURBOFAN_TARGET |
40 CompilationInfoWithZone info(function); | 40 CompilationInfoWithZone info(function); |
41 | 41 |
42 CHECK(Parser::Parse(&info)); | 42 CHECK(Parser::Parse(&info)); |
43 StrictMode strict_mode = info.function()->strict_mode(); | 43 StrictMode strict_mode = info.function()->strict_mode(); |
44 info.SetStrictMode(strict_mode); | 44 info.SetStrictMode(strict_mode); |
45 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); | 45 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); |
46 CHECK(Rewriter::Rewrite(&info)); | 46 CHECK(Rewriter::Rewrite(&info)); |
47 CHECK(Scope::Analyze(&info)); | 47 CHECK(Scope::Analyze(&info)); |
48 CHECK_NE(NULL, info.scope()); | 48 CHECK_NE(NULL, info.scope()); |
| 49 Handle<ScopeInfo> scope_info = ScopeInfo::Create(info.scope(), info.zone()); |
| 50 info.shared_info()->set_scope_info(*scope_info); |
49 | 51 |
50 EnsureDeoptimizationSupport(&info); | 52 EnsureDeoptimizationSupport(&info); |
51 | 53 |
52 Pipeline pipeline(&info); | 54 Pipeline pipeline(&info); |
53 Handle<Code> code = pipeline.GenerateCode(); | 55 Handle<Code> code = pipeline.GenerateCode(); |
54 | 56 |
55 CHECK(!code.is_null()); | 57 CHECK(!code.is_null()); |
56 function->ReplaceCode(*code); | 58 function->ReplaceCode(*code); |
57 #elif USE_CRANKSHAFT | 59 #elif USE_CRANKSHAFT |
58 Handle<Code> unoptimized = Handle<Code>(function->code()); | 60 Handle<Code> unoptimized = Handle<Code>(function->code()); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 187 |
186 Handle<Object> true_value() { return isolate->factory()->true_value(); } | 188 Handle<Object> true_value() { return isolate->factory()->true_value(); } |
187 | 189 |
188 Handle<Object> false_value() { return isolate->factory()->false_value(); } | 190 Handle<Object> false_value() { return isolate->factory()->false_value(); } |
189 }; | 191 }; |
190 } | 192 } |
191 } | 193 } |
192 } // namespace v8::internal::compiler | 194 } // namespace v8::internal::compiler |
193 | 195 |
194 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ | 196 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ |
OLD | NEW |