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 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
909 // We do not switch to baseline code when the debugger might have created a | 909 // We do not switch to baseline code when the debugger might have created a |
910 // copy of the bytecode with break slots to be able to set break points. | 910 // copy of the bytecode with break slots to be able to set break points. |
911 if (function->shared()->HasDebugInfo()) { | 911 if (function->shared()->HasDebugInfo()) { |
912 return MaybeHandle<Code>(); | 912 return MaybeHandle<Code>(); |
913 } | 913 } |
914 | 914 |
915 // TODO(4280): For now we do not switch generators or async functions to | 915 // TODO(4280): For now we do not switch generators or async functions to |
916 // baseline code because there might be suspended activations stored in | 916 // baseline code because there might be suspended activations stored in |
917 // generator objects on the heap. We could eventually go directly to | 917 // generator objects on the heap. We could eventually go directly to |
918 // TurboFan in this case. | 918 // TurboFan in this case. |
919 if (function->shared()->is_resumable()) { | 919 if (IsResumableFunction(function->shared()->kind())) { |
920 return MaybeHandle<Code>(); | 920 return MaybeHandle<Code>(); |
921 } | 921 } |
922 | 922 |
923 // TODO(4280): For now we disable switching to baseline code in the presence | 923 // TODO(4280): For now we disable switching to baseline code in the presence |
924 // of interpreter activations of the given function. The reasons is that the | 924 // of interpreter activations of the given function. The reasons is that the |
925 // underlying bytecode is cleared below. Note that this only applies in case | 925 // underlying bytecode is cleared below. Note that this only applies in case |
926 // the --ignition-preserve-bytecode flag is not passed. | 926 // the --ignition-preserve-bytecode flag is not passed. |
927 if (!FLAG_ignition_preserve_bytecode) { | 927 if (!FLAG_ignition_preserve_bytecode) { |
928 InterpreterActivationsFinder activations_finder(function->shared()); | 928 InterpreterActivationsFinder activations_finder(function->shared()); |
929 if (HasInterpreterActivations(isolate, &activations_finder)) { | 929 if (HasInterpreterActivations(isolate, &activations_finder)) { |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1378 Handle<SharedFunctionInfo> shared = info->shared_info(); | 1378 Handle<SharedFunctionInfo> shared = info->shared_info(); |
1379 if (!shared->has_deoptimization_support()) { | 1379 if (!shared->has_deoptimization_support()) { |
1380 Zone zone(info->isolate()->allocator()); | 1380 Zone zone(info->isolate()->allocator()); |
1381 CompilationInfo unoptimized(info->parse_info(), info->closure()); | 1381 CompilationInfo unoptimized(info->parse_info(), info->closure()); |
1382 unoptimized.EnableDeoptimizationSupport(); | 1382 unoptimized.EnableDeoptimizationSupport(); |
1383 | 1383 |
1384 // TODO(4280): For now we do not switch generators or async functions to | 1384 // TODO(4280): For now we do not switch generators or async functions to |
1385 // baseline code because there might be suspended activations stored in | 1385 // baseline code because there might be suspended activations stored in |
1386 // generator objects on the heap. We could eventually go directly to | 1386 // generator objects on the heap. We could eventually go directly to |
1387 // TurboFan in this case. | 1387 // TurboFan in this case. |
1388 if (shared->is_resumable()) return false; | 1388 if (IsResumableFunction(shared->kind())) return false; |
1389 | 1389 |
1390 // TODO(4280): For now we disable switching to baseline code in the presence | 1390 // TODO(4280): For now we disable switching to baseline code in the presence |
1391 // of interpreter activations of the given function. The reasons is that the | 1391 // of interpreter activations of the given function. The reasons is that the |
1392 // underlying bytecode is cleared below. The expensive check for activations | 1392 // underlying bytecode is cleared below. The expensive check for activations |
1393 // only needs to be done when the given function has bytecode, otherwise we | 1393 // only needs to be done when the given function has bytecode, otherwise we |
1394 // can be sure there are no activations. Note that this only applies in case | 1394 // can be sure there are no activations. Note that this only applies in case |
1395 // the --ignition-preserve-bytecode flag is not passed. | 1395 // the --ignition-preserve-bytecode flag is not passed. |
1396 if (!FLAG_ignition_preserve_bytecode && shared->HasBytecodeArray()) { | 1396 if (!FLAG_ignition_preserve_bytecode && shared->HasBytecodeArray()) { |
1397 InterpreterActivationsFinder activations_finder(*shared); | 1397 InterpreterActivationsFinder activations_finder(*shared); |
1398 if (HasInterpreterActivations(info->isolate(), &activations_finder)) { | 1398 if (HasInterpreterActivations(info->isolate(), &activations_finder)) { |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1913 DCHECK(shared->is_compiled()); | 1913 DCHECK(shared->is_compiled()); |
1914 function->set_literals(cached.literals); | 1914 function->set_literals(cached.literals); |
1915 } else if (shared->is_compiled()) { | 1915 } else if (shared->is_compiled()) { |
1916 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1916 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1917 JSFunction::EnsureLiterals(function); | 1917 JSFunction::EnsureLiterals(function); |
1918 } | 1918 } |
1919 } | 1919 } |
1920 | 1920 |
1921 } // namespace internal | 1921 } // namespace internal |
1922 } // namespace v8 | 1922 } // namespace v8 |
OLD | NEW |