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 #include "src/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/compiler-dispatcher/optimizing-compile-dispatcher.h" | 10 #include "src/compiler-dispatcher/optimizing-compile-dispatcher.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 if (!function_object->IsJSFunction()) { | 41 if (!function_object->IsJSFunction()) { |
42 return isolate->heap()->undefined_value(); | 42 return isolate->heap()->undefined_value(); |
43 } | 43 } |
44 Handle<JSFunction> function = Handle<JSFunction>::cast(function_object); | 44 Handle<JSFunction> function = Handle<JSFunction>::cast(function_object); |
45 | 45 |
46 // If the function is not optimized, just return. | 46 // If the function is not optimized, just return. |
47 if (!function->IsOptimized()) return isolate->heap()->undefined_value(); | 47 if (!function->IsOptimized()) return isolate->heap()->undefined_value(); |
48 | 48 |
49 // TODO(turbofan): Deoptimization is not supported yet. | 49 // TODO(turbofan): Deoptimization is not supported yet. |
50 if (function->code()->is_turbofanned() && | 50 if (function->code()->is_turbofanned() && |
51 function->shared()->asm_function() && !FLAG_turbo_asm_deoptimization) { | 51 function->shared()->asm_function()) { |
52 return isolate->heap()->undefined_value(); | 52 return isolate->heap()->undefined_value(); |
53 } | 53 } |
54 | 54 |
55 Deoptimizer::DeoptimizeFunction(*function); | 55 Deoptimizer::DeoptimizeFunction(*function); |
56 | 56 |
57 return isolate->heap()->undefined_value(); | 57 return isolate->heap()->undefined_value(); |
58 } | 58 } |
59 | 59 |
60 | 60 |
61 RUNTIME_FUNCTION(Runtime_DeoptimizeNow) { | 61 RUNTIME_FUNCTION(Runtime_DeoptimizeNow) { |
62 HandleScope scope(isolate); | 62 HandleScope scope(isolate); |
63 DCHECK(args.length() == 0); | 63 DCHECK(args.length() == 0); |
64 | 64 |
65 Handle<JSFunction> function; | 65 Handle<JSFunction> function; |
66 | 66 |
67 // Find the JavaScript function on the top of the stack. | 67 // Find the JavaScript function on the top of the stack. |
68 JavaScriptFrameIterator it(isolate); | 68 JavaScriptFrameIterator it(isolate); |
69 if (!it.done()) function = Handle<JSFunction>(it.frame()->function()); | 69 if (!it.done()) function = Handle<JSFunction>(it.frame()->function()); |
70 if (function.is_null()) return isolate->heap()->undefined_value(); | 70 if (function.is_null()) return isolate->heap()->undefined_value(); |
71 | 71 |
72 // If the function is not optimized, just return. | 72 // If the function is not optimized, just return. |
73 if (!function->IsOptimized()) return isolate->heap()->undefined_value(); | 73 if (!function->IsOptimized()) return isolate->heap()->undefined_value(); |
74 | 74 |
75 // TODO(turbofan): Deoptimization is not supported yet. | 75 // TODO(turbofan): Deoptimization is not supported yet. |
76 if (function->code()->is_turbofanned() && | 76 if (function->code()->is_turbofanned() && |
77 function->shared()->asm_function() && !FLAG_turbo_asm_deoptimization) { | 77 function->shared()->asm_function()) { |
78 return isolate->heap()->undefined_value(); | 78 return isolate->heap()->undefined_value(); |
79 } | 79 } |
80 | 80 |
81 Deoptimizer::DeoptimizeFunction(*function); | 81 Deoptimizer::DeoptimizeFunction(*function); |
82 | 82 |
83 return isolate->heap()->undefined_value(); | 83 return isolate->heap()->undefined_value(); |
84 } | 84 } |
85 | 85 |
86 | 86 |
87 RUNTIME_FUNCTION(Runtime_RunningInSimulator) { | 87 RUNTIME_FUNCTION(Runtime_RunningInSimulator) { |
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 RUNTIME_FUNCTION(Runtime_ValidateWasmOrphanedInstance) { | 825 RUNTIME_FUNCTION(Runtime_ValidateWasmOrphanedInstance) { |
826 HandleScope shs(isolate); | 826 HandleScope shs(isolate); |
827 DCHECK(args.length() == 1); | 827 DCHECK(args.length() == 1); |
828 CONVERT_ARG_HANDLE_CHECKED_2(WasmInstanceObject, instance, 0); | 828 CONVERT_ARG_HANDLE_CHECKED_2(WasmInstanceObject, instance, 0); |
829 wasm::testing::ValidateOrphanedInstance(isolate, instance); | 829 wasm::testing::ValidateOrphanedInstance(isolate, instance); |
830 return isolate->heap()->ToBoolean(true); | 830 return isolate->heap()->ToBoolean(true); |
831 } | 831 } |
832 | 832 |
833 } // namespace internal | 833 } // namespace internal |
834 } // namespace v8 | 834 } // namespace v8 |
OLD | NEW |