| 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/v8.h" | 5 #include "src/v8.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/full-codegen.h" | 9 #include "src/full-codegen.h" |
| 10 #include "src/runtime/runtime-utils.h" | 10 #include "src/runtime/runtime-utils.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 } | 81 } |
| 82 | 82 |
| 83 | 83 |
| 84 RUNTIME_FUNCTION(Runtime_OptimizeFunctionOnNextCall) { | 84 RUNTIME_FUNCTION(Runtime_OptimizeFunctionOnNextCall) { |
| 85 HandleScope scope(isolate); | 85 HandleScope scope(isolate); |
| 86 RUNTIME_ASSERT(args.length() == 1 || args.length() == 2); | 86 RUNTIME_ASSERT(args.length() == 1 || args.length() == 2); |
| 87 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | 87 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
| 88 // The following assertion was lifted from the DCHECK inside | 88 // The following assertion was lifted from the DCHECK inside |
| 89 // JSFunction::MarkForOptimization(). | 89 // JSFunction::MarkForOptimization(). |
| 90 RUNTIME_ASSERT(function->shared()->allows_lazy_compilation() || | 90 RUNTIME_ASSERT(function->shared()->allows_lazy_compilation() || |
| 91 !function->shared()->optimization_disabled()); | 91 (function->code()->kind() == Code::FUNCTION && |
| 92 !function->shared()->optimization_disabled())); |
| 92 | 93 |
| 93 // If the function is already optimized, just return. | 94 // If the function is already optimized, just return. |
| 94 if (function->IsOptimized()) return isolate->heap()->undefined_value(); | 95 if (function->IsOptimized()) return isolate->heap()->undefined_value(); |
| 95 | 96 |
| 96 function->MarkForOptimization(); | 97 function->MarkForOptimization(); |
| 97 | 98 |
| 98 Code* unoptimized = function->shared()->code(); | 99 Code* unoptimized = function->shared()->code(); |
| 99 if (args.length() == 2 && unoptimized->kind() == Code::FUNCTION) { | 100 if (args.length() == 2 && unoptimized->kind() == Code::FUNCTION) { |
| 100 CONVERT_ARG_HANDLE_CHECKED(String, type, 1); | 101 CONVERT_ARG_HANDLE_CHECKED(String, type, 1); |
| 101 if (type->IsOneByteEqualTo(STATIC_CHAR_VECTOR("concurrent")) && | 102 if (type->IsOneByteEqualTo(STATIC_CHAR_VECTOR("concurrent")) && |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \ | 498 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \ |
| 498 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ | 499 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ |
| 499 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \ | 500 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \ |
| 500 } | 501 } |
| 501 | 502 |
| 502 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION) | 503 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION) |
| 503 | 504 |
| 504 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION | 505 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION |
| 505 } // namespace internal | 506 } // namespace internal |
| 506 } // namespace v8 | 507 } // namespace v8 |
| OLD | NEW |