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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 } | 87 } |
88 | 88 |
89 return isolate->heap()->undefined_value(); | 89 return isolate->heap()->undefined_value(); |
90 } | 90 } |
91 | 91 |
92 | 92 |
93 RUNTIME_FUNCTION(Runtime_NeverOptimizeFunction) { | 93 RUNTIME_FUNCTION(Runtime_NeverOptimizeFunction) { |
94 HandleScope scope(isolate); | 94 HandleScope scope(isolate); |
95 DCHECK(args.length() == 1); | 95 DCHECK(args.length() == 1); |
96 CONVERT_ARG_CHECKED(JSFunction, function, 0); | 96 CONVERT_ARG_CHECKED(JSFunction, function, 0); |
| 97 function->shared()->set_disable_optimization_reason(kOptimizationDisabled); |
97 function->shared()->set_optimization_disabled(true); | 98 function->shared()->set_optimization_disabled(true); |
98 return isolate->heap()->undefined_value(); | 99 return isolate->heap()->undefined_value(); |
99 } | 100 } |
100 | 101 |
101 | 102 |
102 RUNTIME_FUNCTION(Runtime_GetOptimizationStatus) { | 103 RUNTIME_FUNCTION(Runtime_GetOptimizationStatus) { |
103 HandleScope scope(isolate); | 104 HandleScope scope(isolate); |
104 RUNTIME_ASSERT(args.length() == 1 || args.length() == 2); | 105 RUNTIME_ASSERT(args.length() == 1 || args.length() == 2); |
105 if (!isolate->use_crankshaft()) { | 106 if (!isolate->use_crankshaft()) { |
106 return Smi::FromInt(4); // 4 == "never". | 107 return Smi::FromInt(4); // 4 == "never". |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \ | 409 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \ |
409 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ | 410 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ |
410 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \ | 411 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \ |
411 } | 412 } |
412 | 413 |
413 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION) | 414 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION) |
414 | 415 |
415 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION | 416 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION |
416 } | 417 } |
417 } // namespace v8::internal | 418 } // namespace v8::internal |
OLD | NEW |