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 29 matching lines...) Expand all Loading... | |
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 | 49 |
50 if (!info.shared_info().is_null()) { | |
sigurds
2014/08/08 11:53:44
Please advice if you think the null check is neces
Michael Starzinger
2014/08/14 08:48:07
Since we initialize the CompilationInfo from a JSF
sigurds
2014/08/14 09:53:33
Done.
| |
51 Handle<ScopeInfo> scope_info = | |
52 ScopeInfo::Create(info.scope(), info.zone()); | |
53 info.shared_info()->set_scope_info(*scope_info); | |
54 } | |
55 | |
50 EnsureDeoptimizationSupport(&info); | 56 EnsureDeoptimizationSupport(&info); |
51 | 57 |
52 Pipeline pipeline(&info); | 58 Pipeline pipeline(&info); |
53 Handle<Code> code = pipeline.GenerateCode(); | 59 Handle<Code> code = pipeline.GenerateCode(); |
54 | 60 |
55 CHECK(!code.is_null()); | 61 CHECK(!code.is_null()); |
56 function->ReplaceCode(*code); | 62 function->ReplaceCode(*code); |
57 #elif USE_CRANKSHAFT | 63 #elif USE_CRANKSHAFT |
58 Handle<Code> unoptimized = Handle<Code>(function->code()); | 64 Handle<Code> unoptimized = Handle<Code>(function->code()); |
59 Handle<Code> code = Compiler::GetOptimizedCode(function, unoptimized, | 65 Handle<Code> code = Compiler::GetOptimizedCode(function, unoptimized, |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
185 | 191 |
186 Handle<Object> true_value() { return isolate->factory()->true_value(); } | 192 Handle<Object> true_value() { return isolate->factory()->true_value(); } |
187 | 193 |
188 Handle<Object> false_value() { return isolate->factory()->false_value(); } | 194 Handle<Object> false_value() { return isolate->factory()->false_value(); } |
189 }; | 195 }; |
190 } | 196 } |
191 } | 197 } |
192 } // namespace v8::internal::compiler | 198 } // namespace v8::internal::compiler |
193 | 199 |
194 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ | 200 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ |
OLD | NEW |