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/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/frames.h" | 10 #include "src/frames.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 function->ReplaceCode(*code); | 40 function->ReplaceCode(*code); |
41 return *code; | 41 return *code; |
42 } | 42 } |
43 | 43 |
44 | 44 |
45 RUNTIME_FUNCTION(Runtime_CompileOptimized) { | 45 RUNTIME_FUNCTION(Runtime_CompileOptimized) { |
46 HandleScope scope(isolate); | 46 HandleScope scope(isolate); |
47 DCHECK(args.length() == 2); | 47 DCHECK(args.length() == 2); |
48 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | 48 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
49 CONVERT_BOOLEAN_ARG_CHECKED(concurrent, 1); | 49 CONVERT_BOOLEAN_ARG_CHECKED(concurrent, 1); |
50 DCHECK(isolate->use_crankshaft()); | |
51 | 50 |
52 Compiler::ConcurrencyMode mode = | 51 Compiler::ConcurrencyMode mode = |
53 concurrent ? Compiler::CONCURRENT : Compiler::NOT_CONCURRENT; | 52 concurrent ? Compiler::CONCURRENT : Compiler::NOT_CONCURRENT; |
54 Handle<Code> code; | 53 Handle<Code> code; |
55 Handle<Code> unoptimized(function->shared()->code()); | 54 Handle<Code> unoptimized(function->shared()->code()); |
56 if (Compiler::GetOptimizedCode(function, unoptimized, mode).ToHandle(&code)) { | 55 if (Compiler::GetOptimizedCode(function, unoptimized, mode).ToHandle(&code)) { |
57 // Optimization succeeded, return optimized code. | 56 // Optimization succeeded, return optimized code. |
58 function->ReplaceCode(*code); | 57 function->ReplaceCode(*code); |
59 } else { | 58 } else { |
60 // Optimization failed, get unoptimized code. | 59 // Optimization failed, get unoptimized code. |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 DCHECK(is_valid_language_mode(args.smi_at(4))); | 444 DCHECK(is_valid_language_mode(args.smi_at(4))); |
446 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(4)); | 445 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(4)); |
447 DCHECK(args[5]->IsSmi()); | 446 DCHECK(args[5]->IsSmi()); |
448 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), | 447 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), |
449 isolate); | 448 isolate); |
450 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, | 449 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, |
451 args.at<Object>(3), language_mode, args.smi_at(5)); | 450 args.at<Object>(3), language_mode, args.smi_at(5)); |
452 } | 451 } |
453 } | 452 } |
454 } // namespace v8::internal | 453 } // namespace v8::internal |
OLD | NEW |