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 27 matching lines...) Expand all Loading... |
38 } | 38 } |
39 | 39 |
40 Isolate* isolate; | 40 Isolate* isolate; |
41 Handle<JSFunction> function; | 41 Handle<JSFunction> function; |
42 | 42 |
43 Handle<JSFunction> Compile(Handle<JSFunction> function) { | 43 Handle<JSFunction> Compile(Handle<JSFunction> function) { |
44 #if V8_TURBOFAN_TARGET | 44 #if V8_TURBOFAN_TARGET |
45 CompilationInfoWithZone info(function); | 45 CompilationInfoWithZone info(function); |
46 | 46 |
47 CHECK(Parser::Parse(&info)); | 47 CHECK(Parser::Parse(&info)); |
48 StrictMode strict_mode = info.function()->strict_mode(); | |
49 info.SetStrictMode(strict_mode); | |
50 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); | 48 info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code())); |
51 if (flags_ & CompilationInfo::kContextSpecializing) { | 49 if (flags_ & CompilationInfo::kContextSpecializing) { |
52 info.MarkAsContextSpecializing(); | 50 info.MarkAsContextSpecializing(); |
53 } | 51 } |
54 if (flags_ & CompilationInfo::kInliningEnabled) { | 52 if (flags_ & CompilationInfo::kInliningEnabled) { |
55 info.MarkAsInliningEnabled(); | 53 info.MarkAsInliningEnabled(); |
56 } | 54 } |
57 if (flags_ & CompilationInfo::kTypingEnabled) { | 55 if (flags_ & CompilationInfo::kTypingEnabled) { |
58 info.MarkAsTypingEnabled(); | 56 info.MarkAsTypingEnabled(); |
59 } | 57 } |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 Handle<Object> false_value() { return isolate->factory()->false_value(); } | 205 Handle<Object> false_value() { return isolate->factory()->false_value(); } |
208 | 206 |
209 private: | 207 private: |
210 uint32_t flags_; | 208 uint32_t flags_; |
211 }; | 209 }; |
212 } | 210 } |
213 } | 211 } |
214 } // namespace v8::internal::compiler | 212 } // namespace v8::internal::compiler |
215 | 213 |
216 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ | 214 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ |
OLD | NEW |