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 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 public OptimizedFunctionVisitor { | 844 public OptimizedFunctionVisitor { |
845 public: | 845 public: |
846 explicit InterpreterActivationsFinder(SharedFunctionInfo* shared) | 846 explicit InterpreterActivationsFinder(SharedFunctionInfo* shared) |
847 : shared_(shared), has_activations_(false) {} | 847 : shared_(shared), has_activations_(false) {} |
848 | 848 |
849 void VisitThread(Isolate* isolate, ThreadLocalTop* top) { | 849 void VisitThread(Isolate* isolate, ThreadLocalTop* top) { |
850 Address* activation_pc_address = nullptr; | 850 Address* activation_pc_address = nullptr; |
851 JavaScriptFrameIterator it(isolate, top); | 851 JavaScriptFrameIterator it(isolate, top); |
852 for (; !it.done(); it.Advance()) { | 852 for (; !it.done(); it.Advance()) { |
853 JavaScriptFrame* frame = it.frame(); | 853 JavaScriptFrame* frame = it.frame(); |
854 if (!frame->is_interpreted()) continue; | 854 if (FLAG_turbo_from_bytecode && FLAG_ignition_osr && |
855 if (frame->function()->shared() == shared_) { | 855 frame->is_optimized() && frame->function()->shared() == shared_) { |
| 856 // If we are able to optimize functions directly from bytecode, then |
| 857 // there might be optimized OSR code active on the stack that is not |
| 858 // reachable through a function. We count this as an activation. |
| 859 has_activations_ = true; |
| 860 } |
| 861 if (frame->is_interpreted() && frame->function()->shared() == shared_) { |
856 has_activations_ = true; | 862 has_activations_ = true; |
857 activation_pc_address = frame->pc_address(); | 863 activation_pc_address = frame->pc_address(); |
858 } | 864 } |
859 } | 865 } |
860 | 866 |
861 if (activation_pc_address) { | 867 if (activation_pc_address) { |
862 activation_pc_addresses_.push_back(activation_pc_address); | 868 activation_pc_addresses_.push_back(activation_pc_address); |
863 } | 869 } |
864 } | 870 } |
865 | 871 |
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1926 DCHECK(shared->is_compiled()); | 1932 DCHECK(shared->is_compiled()); |
1927 function->set_literals(cached.literals); | 1933 function->set_literals(cached.literals); |
1928 } else if (shared->is_compiled()) { | 1934 } else if (shared->is_compiled()) { |
1929 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1935 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1930 JSFunction::EnsureLiterals(function); | 1936 JSFunction::EnsureLiterals(function); |
1931 } | 1937 } |
1932 } | 1938 } |
1933 | 1939 |
1934 } // namespace internal | 1940 } // namespace internal |
1935 } // namespace v8 | 1941 } // namespace v8 |
OLD | NEW |