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/natives.h" | 10 #include "src/natives.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 HandleScope scope(isolate); | 53 HandleScope scope(isolate); |
54 RUNTIME_ASSERT(args.length() == 1 || args.length() == 2); | 54 RUNTIME_ASSERT(args.length() == 1 || args.length() == 2); |
55 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | 55 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
56 // The following two assertions are lifted from the DCHECKs inside | 56 // The following two assertions are lifted from the DCHECKs inside |
57 // JSFunction::MarkForOptimization(). | 57 // JSFunction::MarkForOptimization(). |
58 RUNTIME_ASSERT(!function->shared()->is_generator()); | 58 RUNTIME_ASSERT(!function->shared()->is_generator()); |
59 RUNTIME_ASSERT(function->shared()->allows_lazy_compilation() || | 59 RUNTIME_ASSERT(function->shared()->allows_lazy_compilation() || |
60 (function->code()->kind() == Code::FUNCTION && | 60 (function->code()->kind() == Code::FUNCTION && |
61 function->code()->optimizable())); | 61 function->code()->optimizable())); |
62 | 62 |
| 63 if (!isolate->use_crankshaft()) return isolate->heap()->undefined_value(); |
| 64 |
63 // If the function is optimized, just return. | 65 // If the function is optimized, just return. |
64 if (function->IsOptimized()) return isolate->heap()->undefined_value(); | 66 if (function->IsOptimized()) return isolate->heap()->undefined_value(); |
65 | 67 |
66 function->MarkForOptimization(); | 68 function->MarkForOptimization(); |
67 | 69 |
68 Code* unoptimized = function->shared()->code(); | 70 Code* unoptimized = function->shared()->code(); |
69 if (args.length() == 2 && unoptimized->kind() == Code::FUNCTION) { | 71 if (args.length() == 2 && unoptimized->kind() == Code::FUNCTION) { |
70 CONVERT_ARG_HANDLE_CHECKED(String, type, 1); | 72 CONVERT_ARG_HANDLE_CHECKED(String, type, 1); |
71 if (type->IsOneByteEqualTo(STATIC_CHAR_VECTOR("osr")) && FLAG_use_osr) { | 73 if (type->IsOneByteEqualTo(STATIC_CHAR_VECTOR("osr")) && FLAG_use_osr) { |
72 // Start patching from the currently patched loop nesting level. | 74 // Start patching from the currently patched loop nesting level. |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \ | 403 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \ |
402 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ | 404 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ |
403 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \ | 405 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \ |
404 } | 406 } |
405 | 407 |
406 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION) | 408 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION) |
407 | 409 |
408 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION | 410 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION |
409 } | 411 } |
410 } // namespace v8::internal | 412 } // namespace v8::internal |
OLD | NEW |