Chromium Code Reviews| 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-inl.h" | 10 #include "src/frames-inl.h" |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 PrintF("]\n"); | 28 PrintF("]\n"); |
| 29 } | 29 } |
| 30 #endif | 30 #endif |
| 31 | 31 |
| 32 // Compile the target function. | 32 // Compile the target function. |
| 33 DCHECK(function->shared()->allows_lazy_compilation()); | 33 DCHECK(function->shared()->allows_lazy_compilation()); |
| 34 | 34 |
| 35 Handle<Code> code; | 35 Handle<Code> code; |
| 36 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, code, | 36 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, code, |
| 37 Compiler::GetLazyCode(function)); | 37 Compiler::GetLazyCode(function)); |
| 38 DCHECK(code->kind() == Code::FUNCTION || | 38 DCHECK( |
| 39 code->kind() == Code::OPTIMIZED_FUNCTION); | 39 code->kind() == Code::FUNCTION || |
|
Michael Starzinger
2015/08/18 08:17:16
suggestion: Do you think it makes sense to add a C
| |
| 40 code->kind() == Code::OPTIMIZED_FUNCTION || | |
| 41 code.is_identical_to(isolate->builtins()->InterpreterEntryTrampoline())); | |
| 42 | |
| 40 function->ReplaceCode(*code); | 43 function->ReplaceCode(*code); |
| 41 return *code; | 44 return *code; |
| 42 } | 45 } |
| 43 | 46 |
| 44 | 47 |
| 45 RUNTIME_FUNCTION(Runtime_CompileOptimized) { | 48 RUNTIME_FUNCTION(Runtime_CompileOptimized) { |
| 46 HandleScope scope(isolate); | 49 HandleScope scope(isolate); |
| 47 DCHECK(args.length() == 2); | 50 DCHECK(args.length() == 2); |
| 48 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | 51 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
| 49 CONVERT_BOOLEAN_ARG_CHECKED(concurrent, 1); | 52 CONVERT_BOOLEAN_ARG_CHECKED(concurrent, 1); |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 436 DCHECK(is_valid_language_mode(args.smi_at(3))); | 439 DCHECK(is_valid_language_mode(args.smi_at(3))); |
| 437 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); | 440 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); |
| 438 DCHECK(args[4]->IsSmi()); | 441 DCHECK(args[4]->IsSmi()); |
| 439 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), | 442 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), |
| 440 isolate); | 443 isolate); |
| 441 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, | 444 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, |
| 442 language_mode, args.smi_at(4)); | 445 language_mode, args.smi_at(4)); |
| 443 } | 446 } |
| 444 } // namespace internal | 447 } // namespace internal |
| 445 } // namespace v8 | 448 } // namespace v8 |
| OLD | NEW |