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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // Function was passed as an argument. | 128 // Function was passed as an argument. |
129 CONVERT_ARG_HANDLE_CHECKED(JSFunction, arg, 0); | 129 CONVERT_ARG_HANDLE_CHECKED(JSFunction, arg, 0); |
130 function = arg; | 130 function = arg; |
131 } | 131 } |
132 | 132 |
133 // The following assertion was lifted from the DCHECK inside | 133 // The following assertion was lifted from the DCHECK inside |
134 // JSFunction::MarkForOptimization(). | 134 // JSFunction::MarkForOptimization(). |
135 RUNTIME_ASSERT(function->shared()->allows_lazy_compilation() || | 135 RUNTIME_ASSERT(function->shared()->allows_lazy_compilation() || |
136 !function->shared()->optimization_disabled()); | 136 !function->shared()->optimization_disabled()); |
137 | 137 |
| 138 // If function is interpreted, just return. OSR is not supported. |
| 139 // TODO(4764): Remove this check when OSR is enabled in the interpreter. |
| 140 if (function->shared()->HasBytecodeArray()) { |
| 141 return isolate->heap()->undefined_value(); |
| 142 } |
| 143 |
138 // If the function is already optimized, just return. | 144 // If the function is already optimized, just return. |
139 if (function->IsOptimized()) return isolate->heap()->undefined_value(); | 145 if (function->IsOptimized()) return isolate->heap()->undefined_value(); |
140 | 146 |
141 Code* unoptimized = function->shared()->code(); | 147 Code* unoptimized = function->shared()->code(); |
142 if (unoptimized->kind() == Code::FUNCTION) { | 148 if (unoptimized->kind() == Code::FUNCTION) { |
143 DCHECK(BackEdgeTable::Verify(isolate, unoptimized)); | 149 DCHECK(BackEdgeTable::Verify(isolate, unoptimized)); |
144 isolate->runtime_profiler()->AttemptOnStackReplacement( | 150 isolate->runtime_profiler()->AttemptOnStackReplacement( |
145 *function, Code::kMaxLoopNestingMarker); | 151 *function, Code::kMaxLoopNestingMarker); |
146 } | 152 } |
147 | 153 |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \ | 504 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \ |
499 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ | 505 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ |
500 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \ | 506 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \ |
501 } | 507 } |
502 | 508 |
503 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION) | 509 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION) |
504 | 510 |
505 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION | 511 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION |
506 } // namespace internal | 512 } // namespace internal |
507 } // namespace v8 | 513 } // namespace v8 |
OLD | NEW |