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 "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/deoptimizer.h" | 8 #include "src/deoptimizer.h" |
9 #include "src/frames-inl.h" | 9 #include "src/frames-inl.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 function = arg; | 166 function = arg; |
167 } | 167 } |
168 | 168 |
169 // The following condition was lifted from the DCHECK inside | 169 // The following condition was lifted from the DCHECK inside |
170 // JSFunction::MarkForOptimization(). | 170 // JSFunction::MarkForOptimization(). |
171 if (!(function->shared()->allows_lazy_compilation() || | 171 if (!(function->shared()->allows_lazy_compilation() || |
172 !function->shared()->optimization_disabled())) { | 172 !function->shared()->optimization_disabled())) { |
173 return isolate->heap()->undefined_value(); | 173 return isolate->heap()->undefined_value(); |
174 } | 174 } |
175 | 175 |
176 // If function is interpreted, just return. OSR is not supported. | 176 // If function is interpreted but OSR hasn't been enabled, just return. |
177 // TODO(4764): Remove this check when OSR is enabled in the interpreter. | 177 if (function->shared()->HasBytecodeArray() && !FLAG_ignition_osr) { |
178 if (function->shared()->HasBytecodeArray()) { | |
179 return isolate->heap()->undefined_value(); | 178 return isolate->heap()->undefined_value(); |
180 } | 179 } |
181 | 180 |
182 // If the function is already optimized, just return. | 181 // If the function is already optimized, just return. |
183 if (function->IsOptimized()) return isolate->heap()->undefined_value(); | 182 if (function->IsOptimized()) return isolate->heap()->undefined_value(); |
184 | 183 |
185 Code* unoptimized = function->shared()->code(); | 184 // Make the profiler arm all back edges in unoptimized code. |
186 if (unoptimized->kind() == Code::FUNCTION) { | 185 if (function->shared()->HasBytecodeArray() || |
187 DCHECK(BackEdgeTable::Verify(isolate, unoptimized)); | 186 function->shared()->code()->kind() == Code::FUNCTION) { |
188 isolate->runtime_profiler()->AttemptOnStackReplacement( | 187 isolate->runtime_profiler()->AttemptOnStackReplacement( |
189 *function, Code::kMaxLoopNestingMarker); | 188 *function, AbstractCode::kMaxLoopNestingMarker); |
190 } | 189 } |
191 | 190 |
192 return isolate->heap()->undefined_value(); | 191 return isolate->heap()->undefined_value(); |
193 } | 192 } |
194 | 193 |
195 | 194 |
196 RUNTIME_FUNCTION(Runtime_NeverOptimizeFunction) { | 195 RUNTIME_FUNCTION(Runtime_NeverOptimizeFunction) { |
197 HandleScope scope(isolate); | 196 HandleScope scope(isolate); |
198 DCHECK(args.length() == 1); | 197 DCHECK(args.length() == 1); |
199 CONVERT_ARG_CHECKED(JSFunction, function, 0); | 198 CONVERT_ARG_CHECKED(JSFunction, function, 0); |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 | 588 |
590 RUNTIME_FUNCTION(Runtime_SpeciesProtector) { | 589 RUNTIME_FUNCTION(Runtime_SpeciesProtector) { |
591 SealHandleScope shs(isolate); | 590 SealHandleScope shs(isolate); |
592 DCHECK_EQ(0, args.length()); | 591 DCHECK_EQ(0, args.length()); |
593 return isolate->heap()->ToBoolean(isolate->IsArraySpeciesLookupChainIntact()); | 592 return isolate->heap()->ToBoolean(isolate->IsArraySpeciesLookupChainIntact()); |
594 } | 593 } |
595 | 594 |
596 | 595 |
597 } // namespace internal | 596 } // namespace internal |
598 } // namespace v8 | 597 } // namespace v8 |
OLD | NEW |