OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 "src/compiler.h" | 5 #include "src/compiler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/asmjs/asm-js.h" | 10 #include "src/asmjs/asm-js.h" |
(...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1325 | 1325 |
1326 // Restore the original function info list in order to remain side-effect | 1326 // Restore the original function info list in order to remain side-effect |
1327 // free as much as possible, since some code expects the old shared function | 1327 // free as much as possible, since some code expects the old shared function |
1328 // infos to stick around. | 1328 // infos to stick around. |
1329 script->set_shared_function_infos(*old_function_infos); | 1329 script->set_shared_function_infos(*old_function_infos); |
1330 | 1330 |
1331 return infos; | 1331 return infos; |
1332 } | 1332 } |
1333 | 1333 |
1334 bool Compiler::EnsureBytecode(CompilationInfo* info) { | 1334 bool Compiler::EnsureBytecode(CompilationInfo* info) { |
1335 DCHECK(ShouldUseIgnition(info)); | 1335 if (!ShouldUseIgnition(info)) return false; |
1336 if (!info->shared_info()->HasBytecodeArray()) { | 1336 if (!info->shared_info()->HasBytecodeArray()) { |
1337 Handle<Code> original_code(info->shared_info()->code()); | 1337 Handle<Code> original_code(info->shared_info()->code()); |
1338 if (GetUnoptimizedCode(info).is_null()) return false; | 1338 if (GetUnoptimizedCode(info).is_null()) return false; |
1339 if (info->shared_info()->HasAsmWasmData()) return false; | 1339 if (info->shared_info()->HasAsmWasmData()) return false; |
1340 DCHECK(info->shared_info()->is_compiled()); | 1340 DCHECK(info->shared_info()->is_compiled()); |
1341 if (original_code->kind() == Code::FUNCTION) { | 1341 if (original_code->kind() == Code::FUNCTION) { |
1342 // Generating bytecode will install the {InterpreterEntryTrampoline} as | 1342 // Generating bytecode will install the {InterpreterEntryTrampoline} as |
1343 // shared code on the function. To avoid an implicit tier down we restore | 1343 // shared code on the function. To avoid an implicit tier down we restore |
1344 // original baseline code in case it existed beforehand. | 1344 // original baseline code in case it existed beforehand. |
1345 info->shared_info()->ReplaceCode(*original_code); | 1345 info->shared_info()->ReplaceCode(*original_code); |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1889 DCHECK(shared->is_compiled()); | 1889 DCHECK(shared->is_compiled()); |
1890 function->set_literals(cached.literals); | 1890 function->set_literals(cached.literals); |
1891 } else if (shared->is_compiled()) { | 1891 } else if (shared->is_compiled()) { |
1892 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1892 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1893 JSFunction::EnsureLiterals(function); | 1893 JSFunction::EnsureLiterals(function); |
1894 } | 1894 } |
1895 } | 1895 } |
1896 | 1896 |
1897 } // namespace internal | 1897 } // namespace internal |
1898 } // namespace v8 | 1898 } // namespace v8 |
OLD | NEW |