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 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1422 if (shared->code()->kind() == Code::FUNCTION && | 1422 if (shared->code()->kind() == Code::FUNCTION && |
1423 shared->code()->has_reloc_info_for_serialization()) { | 1423 shared->code()->has_reloc_info_for_serialization()) { |
1424 unoptimized.PrepareForSerializing(); | 1424 unoptimized.PrepareForSerializing(); |
1425 } | 1425 } |
1426 EnsureFeedbackMetadata(&unoptimized); | 1426 EnsureFeedbackMetadata(&unoptimized); |
1427 if (!FullCodeGenerator::MakeCode(&unoptimized)) return false; | 1427 if (!FullCodeGenerator::MakeCode(&unoptimized)) return false; |
1428 | 1428 |
1429 // TODO(4280): For now we play it safe and remove the bytecode array when we | 1429 // TODO(4280): For now we play it safe and remove the bytecode array when we |
1430 // switch to baseline code. We might consider keeping around the bytecode so | 1430 // switch to baseline code. We might consider keeping around the bytecode so |
1431 // that it can be used as the "source of truth" eventually. | 1431 // that it can be used as the "source of truth" eventually. |
1432 shared->ClearBytecodeArray(); | 1432 if (shared->HasBytecodeArray()) { |
| 1433 shared->ClearBytecodeArray(); |
| 1434 } |
1433 | 1435 |
1434 // The scope info might not have been set if a lazily compiled | 1436 // The scope info might not have been set if a lazily compiled |
1435 // function is inlined before being called for the first time. | 1437 // function is inlined before being called for the first time. |
1436 if (shared->scope_info() == ScopeInfo::Empty(info->isolate())) { | 1438 if (shared->scope_info() == ScopeInfo::Empty(info->isolate())) { |
1437 InstallSharedScopeInfo(info, shared); | 1439 InstallSharedScopeInfo(info, shared); |
1438 } | 1440 } |
1439 | 1441 |
1440 // Install compilation result on the shared function info | 1442 // Install compilation result on the shared function info |
1441 shared->EnableDeoptimizationSupport(*unoptimized.code()); | 1443 shared->EnableDeoptimizationSupport(*unoptimized.code()); |
1442 | 1444 |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1944 DCHECK(shared->is_compiled()); | 1946 DCHECK(shared->is_compiled()); |
1945 function->set_literals(cached.literals); | 1947 function->set_literals(cached.literals); |
1946 } else if (shared->is_compiled()) { | 1948 } else if (shared->is_compiled()) { |
1947 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1949 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1948 JSFunction::EnsureLiterals(function); | 1950 JSFunction::EnsureLiterals(function); |
1949 } | 1951 } |
1950 } | 1952 } |
1951 | 1953 |
1952 } // namespace internal | 1954 } // namespace internal |
1953 } // namespace v8 | 1955 } // namespace v8 |
OLD | NEW |